Package swingtree

Class ComponentDragEventDelegate<C extends JComponent>


public final class ComponentDragEventDelegate<C extends JComponent> extends ComponentMouseEventDelegate<C>
A JComponent and MouseEvent delegate providing useful context information to various Action listeners used by UIForAnySwing.onMouseDrag(Action) like for example the ComponentMouseEventDelegate.mouseX() and ComponentMouseEventDelegate.mouseY() of the event as well as more drag specific information like dragEvents() and dragPositions().
  • Method Details

    • dragEvents

      public List<MouseEvent> dragEvents()
      Provides a list of all MouseEvents of a continuous mouse drag performed on the component. When a drag ends, the list is cleared.
      Returns:
      A list of all MouseEvents of a continuous mouse drag performed on the component.
    • dragPositions

      public List<Position> dragPositions()
      SwingTree keeps track of the most recent mouse drag events of a continuous drag. This method returns a list of all mouse Positions of a continuous mouse drag performed on the component.
      Note that this mehod returns an unmodifiable list consisting of immutable Position objects instead of mutable Point objects, to protect the client from side effects.
      Returns:
      A list of all mouse Positions of a continuous mouse drag performed on the component. The points of this list represent the mouse movement track since the start of a continuous drag.