protected BufferedImage create_MEASURED_VALUE_Image ( final int WIDTH , final int HEIGHT , final Color COLOR ) { if ( WIDTH <= 20 || HEIGHT <= 20 ) // 20 is needed otherwise the image size could be smaller than 1 { return UTIL . createImage ( 1 , 1 , Transparency . TRANSLUCENT ) ; } final int IMAGE_WIDTH ; final int IMAGE_HEIGHT ; if ( getOrientation ( ) == Orientation . VERTICAL ) { // Vertical orientation IMAGE_WIDTH = ( int ) ( WIDTH * 0.05 ) ; IMAGE_HEIGHT = IMAGE_WIDTH ; } else { // Horizontal orientation IMAGE_HEIGHT = ( int ) ( HEIGHT * 0.05 ) ; IMAGE_WIDTH = IMAGE_HEIGHT ; } final BufferedImage IMAGE = UTIL . createImage ( IMAGE_WIDTH , IMAGE_HEIGHT , Transparency . TRANSLUCENT ) ; final Graphics2D G2 = IMAGE . createGraphics ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; final GeneralPath INDICATOR = new GeneralPath ( ) ; INDICATOR . setWindingRule ( Path2D . WIND_EVEN_ODD ) ; if ( getOrientation ( ) == Orientation . VERTICAL ) { INDICATOR . moveTo ( IMAGE_WIDTH , IMAGE_HEIGHT * 0.5 ) ; INDICATOR . lineTo ( 0.0 , 0.0 ) ; INDICATOR . lineTo ( 0.0 , IMAGE_HEIGHT ) ; INDICATOR . closePath ( ) ; } else { INDICATOR . moveTo ( IMAGE_WIDTH * 0.5 , 0.0 ) ; INDICATOR . lineTo ( IMAGE_WIDTH , IMAGE_HEIGHT ) ; INDICATOR . lineTo ( 0.0 , IMAGE_HEIGHT ) ; INDICATOR . closePath ( ) ; } G2 . setColor ( COLOR ) ; G2 . fill ( INDICATOR ) ; G2 . dispose ( ) ; return IMAGE ; }
Returns the image of the MinMeasuredValue and MaxMeasuredValue dependend on the given color