boolean notLeftButton = (e.getModifiers() & InputEvent.BUTTON1_MASK) == 0;
    public void mouseReleased(MouseEvent e) {        if (Debug.debugging("mousemode")) {            Debug.output(getID() + "|NavMouseMode.mouseReleased()");        }        Object obj = e.getSource();        mouseSupport.fireMapMouseReleased(e);        if (!(obj instanceof MapBean) || !autoZoom || point1 == null)            return;        MapBean map = (MapBean) obj;        Projection projection = map.getProjection();        Proj p = (Proj) projection;        synchronized (this) {            point2 = e.getPoint();            int dx = Math.abs(point2.x - point1.x);            int dy = Math.abs(point2.y - point1.y);            // Don't bother redrawing if the rectangle is too small            if ((dx < 5) || (dy < 5)) {                // clean up the rectangle, since point2 has the old                // value.                paintRectangle(map, point1, point2);                // If rectangle is too small in both x and y then                // recenter the map                if ((dx < 5) && (dy < 5)) {                    LatLonPoint llp = projection.inverse(e.getPoint());                    boolean shift = e.isShiftDown();                    boolean control = e.isControlDown();                    boolean notLeftButton = (e.getModifiers() & InputEvent.BUTTON1_MASK) == 0;                    if (control) {                        if (shift) {                            p.setScale(p.getScale() * 2.0f);                        } else {                            p.setScale(p.getScale() / 2.0f);                        }                    }                    // reset the points here so the point doesn't get                    // rendered on the repaint.                    point1 = null;                    point2 = null;                    p.setCenter(llp);                    map.setProjection(p);                }                return;            }            // Figure out the new scale            float newScale = com.bbn.openmap.proj.ProjMath.getScale(point1,                    point2,                    projection);            // Figure out the center of the rectangle            int centerx = Math.min(point1.x, point2.x) + dx / 2;            int centery = Math.min(point1.y, point2.y) + dy / 2;            com.bbn.openmap.LatLonPoint center = projection.inverse(centerx,                    centery);            // Fire events on main map to change view to match rect1            //    Debug.output("point1: " +point1);            //    Debug.output("point2: " +point2);            //        Debug.output("Centerx: " +centerx +            //             " Centery: " + centery);            //          Debug.output("New Scale: " + newScale);            //          Debug.output("New Center: " +center);            // Set the parameters of the projection and then set            // the projection of the map. This way we save having            // the MapBean fire two ProjectionEvents.            p.setScale(newScale);            p.setCenter(center);            // reset the points here so the point doesn't get rendered            // on the repaint.            point1 = null;            point2 = null;            map.setProjection(p);        }    }