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 DraggableonDragDetected(DragEvent event) Called when the drag gesture is first detected by the drag container.abstract voidonDragDone(DragEvent event) Called on listeners on the SOUCE container when the drag operation is completed, regardless of whether the drop was successful.voidonDragEnter(DragEvent event) Default implementation does nothing.voidonDragExit(DragEvent event) Default implementation does nothing.abstract voidonDragOver(DragEvent event) Called for all draggable motion over the drag-and-drop container to which this listener is listening.abstract voidCalled 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:DragAndDropListenerCalled 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:
onDragDetectedin interfaceDragAndDropListener
-
onDragEnter
Default implementation does nothing.- Specified by:
onDragEnterin interfaceDragAndDropListener
-
onDragExit
Default implementation does nothing.- Specified by:
onDragExitin interfaceDragAndDropListener
-
onDragOver
Description copied from interface:DragAndDropListenerCalled for all draggable motion over the drag-and-drop container to which this listener is listening.- Specified by:
onDragOverin interfaceDragAndDropListener
-
onDrop
Description copied from interface:DragAndDropListenerCalled 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:
onDropin interfaceDragAndDropListener
-
onDragDone
Description copied from interface:DragAndDropListenerCalled 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:
onDragDonein interfaceDragAndDropListener
-