Package docking.dnd

Interface DragDropManager


public interface DragDropManager
Interface used by the DragDropTree to know how to handle the drag and drop operations.
  • Method Details

    • isStartDragOk

      boolean isStartDragOk(DragDropNode dragNode, int dragAction)
      Return true if the dragNode can be dragged.
      Parameters:
      dragNode - node where user is initiating the drag operation
      dragAction - user action for the drag operation
    • isDropSiteOk

      boolean isDropSiteOk(DragDropNode destNode, DropTargetDragEvent e)
      Return true if the drop site is valid for the given target and drag event.
      Parameters:
      destNode - destination for node being dragged
      e - the drag event
    • add

      void add(DragDropNode destNode, Object data, DataFlavor chosen, int dropAction)
      Add the given data to the destination node.
      Parameters:
      destNode - destination node for the data.
      data - data to add
      chosen - data flavor for the data being added
      dropAction - user action for drop operation
    • move

      void move(DragDropNode[] sourceNodes)
      Remove the given sourceNodes. (It got moved, so remove it at the source)
      Parameters:
      sourceNodes - nodes to remove.
    • getAcceptableFlavors

      DataFlavor[] getAcceptableFlavors()
      Return the data flavors that can be dragged and dropped.
    • getTransferable

      Transferable getTransferable(Point p)
      Get the transferable at the given point.
      Parameters:
      p - point where the mouse pointer is when the drag begins