Пример #1
0
 @Override
 protected void handlePress(MouseEvent e) {
   super.handlePress(e);
   DrawingItem item = getItem();
   DragHandle handle = getHandle();
   if (handle != null && item != null) {
     int index = (Integer) handle.getData();
     Double p = item.getPoints().get(Math.abs(index - 1)); // opposite is the anchor
     anchor = new Double(p.getX(), p.getY());
   }
 }
Пример #2
0
 @Override
 protected void handleRelease(MouseEvent e) {
   super.handleRelease(e);
   anchor = null;
 }