Beispiel #1
0
 @Override
 public void dragDropEnd(DragSourceDropEvent dsd) {
   if (dsd.getDropAction() == TransferHandler.MOVE) {
     node.getNodeData().setCopy(false);
   } else if (dsd.getDropAction() == TransferHandler.COPY) {
     node.getNodeData().setCopy(true);
   }
 }
Beispiel #2
0
    /** @param e the event */
    public void dragDropEnd(DragSourceDropEvent e) {
      if (e.getDropSuccess() == false) {
        System.out.println("not successful");
        return;
      }

      /*
       * the dropAction should be what the drop target specified
       * in acceptDrop
       */
      System.out.println("dragdropend action " + e.getDropAction());

      // this is the action selected by the drop target
      if (e.getDropAction() == DnDConstants.ACTION_MOVE) DragLabel.this.setText("");
    }
  public void dragDropEnd(DragSourceDropEvent dsde) {
    /*
     * to support move or copy, we have to check which occurred:
     */
    System.out.println("Drop Action: " + dsde.getDropAction());
    if (dsde.getDropSuccess() && (dsde.getDropAction() == DnDConstants.ACTION_MOVE)) {

      // ((DefaultTreeModel) sourceTree.getModel()).removeNodeFromParent(oldNode);
    }

    /*
     * to support move only... if (dsde.getDropSuccess()) {
     * ((DefaultTreeModel)sourceTree.getModel()).removeNodeFromParent(oldNode); }
     */
  }
 /* Methods for DragSourceListener */
 public void dragDropEnd(DragSourceDropEvent dsde) {
   if (dsde.getDropSuccess()
       && dsde.getDropAction() == DnDConstants.ACTION_MOVE
       && draggedNodeParentPath != null) {
     //			((MetsTreeModel)tree.getModel()).nodeStructureChanged(draggedNodeParentPath);
   }
 }
    /** as the operation completes. */
    public void dragDropEnd(DragSourceDropEvent dsde) {
      DragSourceContext dsc = dsde.getDragSourceContext();
      JComponent c = (JComponent) dsc.getComponent();

      if (dsde.getDropSuccess()) {
        ((DefaultTransferHandler) c.getTransferHandler())
            .exportDone(c, dsc.getTransferable(), dsde.getDropAction());
      } else {
        ((DefaultTransferHandler) c.getTransferHandler()).exportDone(c, null, NONE);
      }
      c.setAutoscrolls(scrolls);
    }
 /** @param e the event */
 @Override
 public void dragDropEnd(DragSourceDropEvent e) {
   // Resets the screenshot stored by the palette view.
   getDrawingView().resetCapturedNode();
   if (e.getDropSuccess() == false) {
     if (logger.isLoggable(Level.INFO)) {
       logger.info("Dropping was not successful");
     }
     return;
   }
   /*
    * the dropAction should be what the drop target specified in
    * acceptDrop
    */
   // this is the action selected by the drop target
   if (e.getDropAction() == DnDConstants.ACTION_MOVE) {
     setName("");
   }
 }