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
Modifier and TypeMethodDescriptionvoid
add
(DragDropNode destNode, Object data, DataFlavor chosen, int dropAction) Add the given data to the destination node.Return the data flavors that can be dragged and dropped.Get the transferable at the given point.boolean
isDropSiteOk
(DragDropNode destNode, 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 Details
-
isStartDragOk
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
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
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
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
Get the transferable at the given point.- Parameters:
p
- point where the mouse pointer is when the drag begins
-