/** @param ev */ @Override public void onMouseReleased(MapMouseEvent ev) { // avoid the zooming window at the time scroll button pan action. if (dragged && !ev.getPoint().equals(startDragPos) && ev.getButton() != java.awt.event.MouseEvent.BUTTON2) { dragged = false; Envelope2D env = new Envelope2D(); env.setFrameFromDiagonal(startDragPos, ev.getWorldPos()); this.onRectangleFinished(env); } }
/** * Records the map position of the mouse event in case this button press is the beginning of a * mouse drag * * @param ev the mouse event */ @Override public void onMousePressed(MapMouseEvent ev) { startDragPos.setLocation(ev.getWorldPos()); }