Package docking.dnd
Interface Draggable
- All Known Implementing Classes:
VersionHistoryPanel
public interface Draggable
Interface to define a drag source.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
dragFinished
(boolean cancelled) Called when the drag and drop operation completes.int
Get the drag actions supported by this drag source: DnDConstants.ACTION_MOVE DnDConstants.ACTION_COPY DnDConstants.ACTION_COPY_OR_MOVECalled by the DragGestureAdapter when the drag is started.Get the object to transfer.boolean
Return true if the object at the location in the DragGesture event is draggable.
-
Method Details
-
isStartDragOk
Return true if the object at the location in the DragGesture event is draggable.- Parameters:
e
- event passed to a DragGestureListener via its dragGestureRecognized() method when a particular DragGestureRecognizer detects a platform dependent Drag and Drop action initiating gesture has occurred on the Component it is tracking.- Returns:
- true if a drag can be starts
- See Also:
-
dragFinished
default void dragFinished(boolean cancelled) Called when the drag and drop operation completes.Clients can use this callback to reset visual state.
- Parameters:
cancelled
- true if the drag operation was cancelled- See Also:
-
getDragAction
int getDragAction()Get the drag actions supported by this drag source:- DnDConstants.ACTION_MOVE
- DnDConstants.ACTION_COPY
- DnDConstants.ACTION_COPY_OR_MOVE
- Returns:
- the drag actions
-
getTransferable
Get the object to transfer.- Parameters:
p
- location of object to transfer- Returns:
- object to transfer
-
getDragSourceListener
DragSourceListener getDragSourceListener()Called by the DragGestureAdapter when the drag is started.- Returns:
- the listener
- See Also:
-