@Override
 public void dragOver(DragSourceDragEvent dsde) {
   Point p = dsde.getDragSourceContext().getComponent().getMousePosition();
   if (p != null) {
     dsde.getDragSourceContext().getComponent().firePropertyChange("dragPoint", p.x, p.y);
   }
 }
Esempio n. 2
0
 @Override
 public void dropActionChanged(DragSourceDragEvent dsde) {
   int action = dsde.getDropAction();
   if (action == DnDConstants.ACTION_MOVE)
     dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
   else dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
 }
Esempio n. 3
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);
 }
Esempio n. 4
0
 /** @param e the event */
 public void dragEnter(DragSourceDragEvent e) {
   System.out.println("draglabel enter " + e);
   DragSourceContext context = e.getDragSourceContext();
   // intersection of the users selected action, and the source and target actions
   int myaction = e.getDropAction();
   if ((myaction & DragLabel.this.dragAction) != 0) {
     context.setCursor(DragSource.DefaultCopyDrop);
   } else {
     context.setCursor(DragSource.DefaultCopyNoDrop);
   }
 }
Esempio n. 5
0
 /** @param e the event */
 @Override
 public void dragEnter(DragSourceDragEvent e) {
   DragSourceContext context = e.getDragSourceContext();
   // intersection of the users selected action, and the source and
   // target actions
   int myaction = e.getDropAction();
   if ((myaction & dragAction) != 0) {
     context.setCursor(DragSource.DefaultCopyDrop);
   } else {
     context.setCursor(DragSource.DefaultCopyNoDrop);
   }
 }
 @Override
 public void dragEnter(DragSourceDragEvent dragSourceDragEvent) {
   DragSourceContext context = dragSourceDragEvent.getDragSourceContext();
   int dropAction = dragSourceDragEvent.getDropAction();
   if ((dropAction & DnDConstants.ACTION_COPY) != 0) {
     context.setCursor(DragSource.DefaultCopyDrop);
   } else if ((dropAction & DnDConstants.ACTION_MOVE) != 0) {
     context.setCursor(DragSource.DefaultMoveDrop);
   } else {
     context.setCursor(DragSource.DefaultCopyNoDrop);
   }
 }
 public final void dropActionChanged(DragSourceDragEvent dsde) {
   int action = dsde.getDropAction();
   if (action == DnDConstants.ACTION_COPY) {
     dsde.getDragSourceContext().setCursor(DragSource.DefaultCopyDrop);
   } else {
     if (action == DnDConstants.ACTION_MOVE) {
       dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveDrop);
     } else {
       dsde.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
     }
   }
 }
Esempio n. 8
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));
        }
      }
    }
Esempio n. 9
0
    @Override
    public void dragEnter(DragSourceDragEvent ddd) {
      ddd.getDragSourceContext().getCursor();

      if (Model.isResource(node.getNodeData())) {
        //                ddd.getDragSourceContext().setCursor(resPointer);
      } else if (Model.isLiason(node.getNodeData())) {
        //                ddd.getDragSourceContext().setCursor(productPointer);s
      }
    }
 public void dropActionChanged(DragSourceDragEvent event) {
   // Update drag gesture modifiers
   DnDContext.setDragGestureModifiersEx(event.getGestureModifiersEx());
 }
Esempio n. 11
0
 /**
  * for example, press shift during drag to change to a link action
  *
  * @param e the event
  */
 @Override
 public void dropActionChanged(DragSourceDragEvent e) {
   DragSourceContext context = e.getDragSourceContext();
   context.setCursor(DragSource.DefaultCopyNoDrop);
 }
Esempio n. 12
0
 /** @param e the event */
 @Override
 public void dragOver(DragSourceDragEvent e) {
   // interface
   getPalette().setDragSourceContext(e.getDragSourceContext());
 }
 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());
 }
Esempio n. 14
0
 @Override
 public void dragMouseMoved(DragSourceDragEvent dsde) {
   ImageMover.w.setLocation(new Point(dsde.getLocation().x + 2, dsde.getLocation().y + 4));
 }
Esempio n. 15
0
 public void dropActionChanged(DragSourceDragEvent dsde) {
   DragSourceContext dsc = dsde.getDragSourceContext();
   JComponent comp = (JComponent) dsc.getComponent();
   updatePartialChosen(comp, dsde.getUserAction() == MOVE);
 }
 @Override
 public void dragEnter(DragSourceDragEvent evt) {
   DragSourceContext ctx = evt.getDragSourceContext();
   ctx.setCursor(cursor);
 }