Beispiel #1
0
 public void mouseDragged(MouseEvent e) {
   if (startPoint == null) return;
   Point p = e.getPoint();
   DragMode mode = DragMode.NONE;
   if (Base.isMacOS()) {
     if (button == MouseEvent.BUTTON1 && !e.isShiftDown()) {
       mode = DragMode.TRANSLATE_OBJECT;
     }
   } else {
     if (button == MouseEvent.BUTTON1) {
       mode = DragMode.TRANSLATE_OBJECT;
     }
   }
   double xd = (double) (p.x - startPoint.x);
   double yd = -(double) (p.y - startPoint.y);
   switch (mode) {
     case NONE:
       super.mouseDragged(e);
       break;
     case TRANSLATE_OBJECT:
       doTranslate(xd, yd);
       break;
   }
   startPoint = p;
 }
 public void mouseDragged(MouseEvent evt) {
   if (getView() != null && getView().isEnabled()) {
     tracker.mouseDragged(evt);
   }
 }