boolean notLeftButton = (e.getModifiers() & InputEvent.BUTTON1_MASK) == 0;
    public void mouseReleased(MouseEvent e) {        if (Debug.debugging("mousemode")) {            Debug.output(getID() + "|NavMouseMode2.mouseReleased()");        }        Object obj = e.getSource();        if (!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);                // Dont 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                dx = Math.abs(point2.x - point1.x);                dy = Math.abs(point2.y - point1.y);                // cornerPoint 1 should be the upper left.                Point cornerPoint1 = new Point(point2.x < point1.x ? point2.x                        : point1.x, point2.y < point1.y ? point2.y : point1.y);                Point cornerPoint2 = new Point(cornerPoint1.x + 2 * dx, cornerPoint1.y                        + 2 * dy);                float newScale = com.bbn.openmap.proj.ProjMath.getScale(cornerPoint1,                        cornerPoint2,                        projection);                // Figure out the center of the rectangle                com.bbn.openmap.LatLonPoint center = projection.inverse(point1.x,                        point1.y);                // 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 so they don't show up in the                // listener paint.                point1 = null;                point2 = null;                map.setProjection(p);            }        }    }