コード例 #1
0
 /**
  * If a new click is done while creating a cadastre object, it has to snap to a point. Because the
  * only layer used as snaptarget is the NewSurveyPointLayer the only points are the survey points.
  *
  * @param ev
  */
 @Override
 public void onMouseClicked(MapMouseEvent ev) {
   if (ev.getButton() == java.awt.event.MouseEvent.BUTTON1
       && this.getSnappedTarget() != SNAPPED_TARGET_TYPE.Vertex) {
     Messaging.getInstance().show(GisMessage.CADASTRE_CHANGE_NEW_CO_MUST_SNAP);
     return;
   }
   super.onMouseClicked(ev);
 }
コード例 #2
0
 /** @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);
   }
 }