Package docking.dnd
Interface DragDropManager
-
public interface DragDropManagerInterface 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 voidadd(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.TransferablegetTransferable(java.awt.Point p)Get the transferable at the given point.booleanisDropSiteOk(DragDropNode destNode, java.awt.dnd.DropTargetDragEvent e)Return true if the drop site is valid for the given target and drag event.booleanisStartDragOk(DragDropNode dragNode, int dragAction)Return true if the dragNode can be dragged.voidmove(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 operationdragAction- 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 draggede- 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 addchosen- data flavor for the data being addeddropAction- 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
-
-