Class AOneShotButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants
Direct Known Subclasses:
GridButton

public abstract class AOneShotButton extends JButton
A non-toggle toolbar button that performs an immediate action (one-shot).

Unlike the JToggleButton-based tool buttons in this package (e.g. APointerButton, AMoveButton, ADragButton, ASingleClickButton, ARubberbandButton), this class does not become the active tool or participate in the toolbar's mutual-exclusion group — it just fires an action and leaves whichever tool was active selected.

Author:
heddle
See Also:
  • Field Details

    • canvas

      protected Component canvas
      Component that owns the current gesture.
    • toolBar

      protected AToolBar toolBar
      Toolbar that owns this tool.
  • Constructor Details

    • AOneShotButton

      protected AOneShotButton(Component canvas, AToolBar toolBar)
      Creates a one-shot button.
      Parameters:
      canvas - the component that owns the current gesture
      toolBar - the toolbar that owns this button
  • Method Details

    • performAction

      public abstract void performAction()
      Perform the action associated with this button. This is implemented by subclasses.