private void drawCross ( Color color , int startX , int startY , int width , int height ) { assert color != null ; final int thickness = 2 ; for ( int x = startX ; x < startX + width ; x ++ ) { for ( int y = startY ; y < startY + height ; y ++ ) { try { if ( Math . abs ( ( x - startX ) - ( y - startY ) ) < thickness || Math . abs ( ( width - ( x - startX ) ) - ( y - startY ) ) < thickness ) { image . setRGB ( x , y , color . getRGB ( ) ) ; } } catch ( ArrayIndexOutOfBoundsException e ) { logger . warn ( "tried to set x/y = " + x + "/" + y ) ; } } } }
Draws a cross .