Package docking.dnd

Interface Draggable

All Known Implementing Classes:
VersionHistoryPanel

public interface Draggable
Interface to define a drag source.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    default 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_MOVE
    Called 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 Link icon

    • isStartDragOk Link icon

      boolean isStartDragOk(DragGestureEvent e)
      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 Link icon

      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 Link icon

      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 Link icon

      Transferable getTransferable(Point p)
      Get the object to transfer.
      Parameters:
      p - location of object to transfer
      Returns:
      object to transfer
    • getDragSourceListener Link icon

      DragSourceListener getDragSourceListener()
      Called by the DragGestureAdapter when the drag is started.
      Returns:
      the listener
      See Also: