question: private void drawZoomRectangle ( Graphics2D g2 , boolean xor ) { if ( this . zoomRectangle != null ) { if ( xor ) { g2 . setXORMode ( Color . gray ) ; } if ( this . fillZoomRectangle ) { g2 . setPaint ( this . zoomFillPaint ) ; g2 . fill ( this . zoomRectangle ) ; } else { g2 . setPaint ( this . zoomOutlinePaint ) ; g2 . draw ( this . zoomRectangle ) ; } if ( xor ) { g2 . setPaintMode ( ) ; } } }
target:  Draws zoom rectangle (if present). The drawing is performed in XOR mode, therefore when this method is called twice in a row, the second call will completely restore the state of the canvas.