Beispiel #1
0
    @Override
    public void dropActionChanged(DragSourceDragEvent dd) {
      // Can maby change the cursor?

      if (Model.isOperation(node.getNodeData())) {

        if (dd.getUserAction() == TransferHandler.COPY) {
          node.getNodeData().setCopy(true);
          dd.getDragSourceContext().setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
        } else if (dd.getUserAction() == TransferHandler.MOVE) {
          node.getNodeData().setCopy(false);
          dd.getDragSourceContext().setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
        }
      }
    }
Beispiel #2
0
 /** @param e the event */
 public void dragOver(DragSourceDragEvent e) {
   DragSourceContext context = e.getDragSourceContext();
   int sa = context.getSourceActions();
   int ua = e.getUserAction();
   int da = e.getDropAction();
   int ta = e.getTargetActions();
   System.out.println("dl dragOver source actions" + sa);
   System.out.println("user action" + ua);
   System.out.println("drop actions" + da);
   System.out.println("target actions" + ta);
 }
 public void dropActionChanged(DragSourceDragEvent dsde) {
   System.out.println("Action: " + dsde.getDropAction());
   System.out.println("Target Action: " + dsde.getTargetActions());
   System.out.println("User Action: " + dsde.getUserAction());
 }
 public void dropActionChanged(DragSourceDragEvent dsde) {
   DragSourceContext dsc = dsde.getDragSourceContext();
   JComponent comp = (JComponent) dsc.getComponent();
   updatePartialChosen(comp, dsde.getUserAction() == MOVE);
 }