Package docking.dnd

Interface DragDropManager


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(DragDropNode destNode, java.lang.Object data, java.awt.datatransfer.DataFlavor chosen, int dropAction)
      Add the given data to the destination node.
      java.awt.datatransfer.DataFlavor[] getAcceptableFlavors()
      Return the data flavors that can be dragged and dropped.
      java.awt.datatransfer.Transferable getTransferable​(java.awt.Point p)
      Get the transferable at the given point.
      boolean isDropSiteOk​(DragDropNode destNode, java.awt.dnd.DropTargetDragEvent e)
      Return true if the drop site is valid for the given target and drag event.
      boolean isStartDragOk​(DragDropNode dragNode, int dragAction)
      Return true if the dragNode can be dragged.
      void move​(DragDropNode[] sourceNodes)
      Remove the given sourceNodes.
    • Method Detail

      • 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,
                             java.awt.dnd.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,
                 java.lang.Object data,
                 java.awt.datatransfer.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

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

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