Package com.simsilica.lemur.dnd
Class AbstractDragAndDropListener
java.lang.Object
com.simsilica.lemur.dnd.AbstractDragAndDropListener
- All Implemented Interfaces:
DragAndDropListener
Base class that DragAndDropListeners can extend to provide
default implementations for some methods. Implementors must
provide onDragDetected(), onDragOver(), onDrop(), onDragDone() at a minimum.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Draggable
onDragDetected
(DragEvent event) Called when the drag gesture is first detected by the drag container.abstract void
onDragDone
(DragEvent event) Called on listeners on the SOUCE container when the drag operation is completed, regardless of whether the drop was successful.void
onDragEnter
(DragEvent event) Default implementation does nothing.void
onDragExit
(DragEvent event) Default implementation does nothing.abstract void
onDragOver
(DragEvent event) Called for all draggable motion over the drag-and-drop container to which this listener is listening.abstract void
Called on listeners on the TARGET container when a drag operation is completed and the drag status at the time was DragStatus.ValidTarget.
-
Constructor Details
-
AbstractDragAndDropListener
public AbstractDragAndDropListener()
-
-
Method Details
-
onDragDetected
Description copied from interface:DragAndDropListener
Called when the drag gesture is first detected by the drag container. It is up to the implementation to return a proper Draggable or not depending on if the drag operation is valid at the event's location. Return null if no drag operation should commence.- Specified by:
onDragDetected
in interfaceDragAndDropListener
-
onDragEnter
Default implementation does nothing.- Specified by:
onDragEnter
in interfaceDragAndDropListener
-
onDragExit
Default implementation does nothing.- Specified by:
onDragExit
in interfaceDragAndDropListener
-
onDragOver
Description copied from interface:DragAndDropListener
Called for all draggable motion over the drag-and-drop container to which this listener is listening.- Specified by:
onDragOver
in interfaceDragAndDropListener
-
onDrop
Description copied from interface:DragAndDropListener
Called on listeners on the TARGET container when a drag operation is completed and the drag status at the time was DragStatus.ValidTarget. It is up to the listeners to decide if the drag was successful or failed by setting the session's drag status. By default, drop operations succeed unless the listeners set the status to DragStatus.InvalidTarget.- Specified by:
onDrop
in interfaceDragAndDropListener
-
onDragDone
Description copied from interface:DragAndDropListener
Called on listeners on the SOUCE container when the drag operation is completed, regardless of whether the drop was successful. This allows the source container to either refresh undropped item or clean its view up now that the item is gone 'for real'.- Specified by:
onDragDone
in interfaceDragAndDropListener
-