public BufferedImage getAllRecolors ( boolean label ) { if ( _colRepo == null ) { return null ; } ColorPository . ClassRecord colClass = _colRepo . getClassRecord ( ( String ) _classList . getSelectedItem ( ) ) ; int classId = colClass . classId ; BufferedImage img = new BufferedImage ( _image . getWidth ( ) , _image . getHeight ( ) * colClass . colors . size ( ) , BufferedImage . TYPE_INT_ARGB ) ; Graphics gfx = img . getGraphics ( ) ; gfx . setColor ( Color . BLACK ) ; int y = 0 ; Integer [ ] sortedKeys = colClass . colors . keySet ( ) . toArray ( new Integer [ colClass . colors . size ( ) ] ) ; Arrays . sort ( sortedKeys ) ; for ( int key : sortedKeys ) { Colorization coloriz = _colRepo . getColorization ( classId , key ) ; BufferedImage subImg = ImageUtil . recolorImage ( _image , coloriz . rootColor , coloriz . range , coloriz . offsets ) ; gfx . drawImage ( subImg , 0 , y , null , null ) ; if ( label ) { ColorRecord crec = _colRepo . getColorRecord ( classId , key ) ; gfx . drawString ( crec . name , 2 , y + gfx . getFontMetrics ( ) . getHeight ( ) + 2 ) ; gfx . drawRect ( 0 , y , _image . getWidth ( ) - 1 , _image . getHeight ( ) ) ; } y += subImg . getHeight ( ) ; } return img ; }
Gets an image with all recolorings of the selection colorization class .