Пример #1
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);
   }
 }
Пример #2
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);
   }
 }
Пример #4
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);
 }
 @Override
 public void dragExit(DragSourceEvent evt) {
   DragSourceContext ctx = evt.getDragSourceContext();
   ctx.setCursor(DragSource.DefaultCopyNoDrop);
 }
 @Override
 public void dragEnter(DragSourceDragEvent evt) {
   DragSourceContext ctx = evt.getDragSourceContext();
   ctx.setCursor(cursor);
 }