Class DraggableRectangle

All Implemented Interfaces:
Draggable, Shape, Serializable, Cloneable
Direct Known Subclasses:
ExtraText, Legend

public class DraggableRectangle extends Rectangle implements Draggable
Rectangle with the interaction state required for draggable plot overlays.
See Also:
  • Field Details

    • _dragging

      protected boolean _dragging
    • _draggingPrimed

      protected boolean _draggingPrimed
    • _currentPoint

      protected Point _currentPoint
    • _beenMoved

      protected boolean _beenMoved
  • Constructor Details

    • DraggableRectangle

      public DraggableRectangle()
  • Method Details

    • isDraggingPrimed

      public boolean isDraggingPrimed()
      Specified by:
      isDraggingPrimed in interface Draggable
      Returns:
      whether a press has primed a possible drag
    • isDragging

      public boolean isDragging()
      Specified by:
      isDragging in interface Draggable
      Returns:
      whether a drag is currently active
    • setDraggingPrimed

      public void setDraggingPrimed(boolean primed)
      Specified by:
      setDraggingPrimed in interface Draggable
      Parameters:
      primed - whether a possible drag is primed
    • setDragging

      public void setDragging(boolean dragging)
      Specified by:
      setDragging in interface Draggable
      Parameters:
      dragging - whether a drag is active; setting this to true marks the overlay as having been moved (see implementation notes on "been moved" tracking)
    • setCurrentPoint

      public void setCurrentPoint(Point p)
      Specified by:
      setCurrentPoint in interface Draggable
      Parameters:
      p - current screen point, or null
    • getCurrentPoint

      public Point getCurrentPoint()
      Specified by:
      getCurrentPoint in interface Draggable
      Returns:
      defensive copy of the current screen point, or null