Class AbstractDragAndDropListener

java.lang.Object
com.simsilica.lemur.dnd.AbstractDragAndDropListener
All Implemented Interfaces:
DragAndDropListener

public abstract class AbstractDragAndDropListener extends Object implements 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 Details

    • AbstractDragAndDropListener

      public AbstractDragAndDropListener()
  • Method Details

    • onDragDetected

      public abstract Draggable onDragDetected(DragEvent event)
      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 interface DragAndDropListener
    • onDragEnter

      public void onDragEnter(DragEvent event)
      Default implementation does nothing.
      Specified by:
      onDragEnter in interface DragAndDropListener
    • onDragExit

      public void onDragExit(DragEvent event)
      Default implementation does nothing.
      Specified by:
      onDragExit in interface DragAndDropListener
    • onDragOver

      public abstract void onDragOver(DragEvent event)
      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 interface DragAndDropListener
    • onDrop

      public abstract void onDrop(DragEvent event)
      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 interface DragAndDropListener
    • onDragDone

      public abstract void onDragDone(DragEvent event)
      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 interface DragAndDropListener