question: public void mouseDragged ( MouseEvent e ) { if ( Debug . debugging ( "mousemodedetail" ) ) { Debug . output ( getID ( ) + "|NavMouseMode.mouseDragged()" ) ; } super . mouseDragged ( e ) ; Object obj = e . getSource ( ) ; if ( obj instanceof MapBean && theMap == null ) { theMap = ( MapBean ) obj ; theMap . addPaintListener ( this ) ; } MapBean map = this . theMap ; Point firstPoint = this . point1 ; if ( map != null ) { if ( ! autoZoom ) { return ; } point2 = getRatioPoint ( map , firstPoint , e . getPoint ( ) ) ; map . repaint ( ) ; } }
target:  Handle a mouseDragged MouseMotionListener event. A rectangle is drawn from the mousePressed point, since I'm assuming that I'm drawing a box to zoom the map to. If a previous box was drawn, it is erased.