Class ARubberbandButton

All Implemented Interfaces:
IRubberbanded, MouseListener, MouseMotionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, SwingConstants

public abstract class ARubberbandButton extends JToggleButton implements MouseMotionListener, MouseListener, IRubberbanded
Toggle tool that drives a rubberband gesture on a canvas.

This class manages the lifetime of the underlying ARubberband and a GestureContext for the gesture.

Start policy

Some policies are "drag-started" (rectangle policies) and delay rubberband creation until a drag occurs. Others are click-based and start immediately on press.

See Also:
  • Field Details

    • canvas

      protected final Component canvas
    • toolBar

      protected final AToolBar toolBar
    • policy

      protected final ARubberband.Policy policy
    • rubberband

      protected ARubberband rubberband
    • startOnDrag

      protected final boolean startOnDrag
    • gesture

      protected GestureContext gesture
      Gesture context for the current gesture (null when idle).
  • Constructor Details

    • ARubberbandButton

      protected ARubberbandButton(Component canvas, AToolBar toolBar, ARubberband.Policy policy, int minSizePx)
      Create a rubberband tool.
      Parameters:
      canvas - canvas component (non-null)
      toolBar - owning toolbar (non-null)
      policy - rubberband policy (non-null)
      minSizePx - minimum size (pixels) required for a valid gesture
  • Method Details