net.talvi.puffinplot
Class PuffinAction
java.lang.Object
javax.swing.AbstractAction
net.talvi.puffinplot.PuffinAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public abstract class PuffinAction
- extends javax.swing.AbstractAction
PuffinAction is the superclass for most Actions used in PuffinPlot.
It provides convenient constructors for setting up an Action with
a tooltip and operating-system-appropriate keyboard shortcuts.
- See Also:
- Serialized Form
Field Summary |
static int |
modifierKey
The standard modifier key for the platform; generally, this will
correspond to Ctrl on most systems, and ⌘ (‘Apple key’) on
Mac OS X systems. |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary |
PuffinAction(java.lang.String name,
java.lang.String description)
Creates a new PuffinAction with the specified parameters. |
PuffinAction(java.lang.String name,
java.lang.String description,
java.lang.Character accelerator,
boolean shift,
java.lang.Integer mnemonic)
Creates a new PuffinAction with the specified parameters. |
PuffinAction(java.lang.String name,
java.lang.String description,
java.lang.Character accelerator,
boolean shift,
java.lang.Integer mnemonic,
boolean specialMacMenuItem,
int modifier)
Creates a new PuffinAction with the specified parameters. |
Method Summary |
boolean |
isExcludedFromMenu()
Determines whether the Action should be excluded from the normal
application menus (on the grounds that it already exists in a
special Mac OS X menu and the application is being run on Mac OS X). |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.ActionListener |
actionPerformed |
modifierKey
public static final int modifierKey
- The standard modifier key for the platform; generally, this will
correspond to Ctrl on most systems, and ⌘ (‘Apple key’) on
Mac OS X systems.
PuffinAction
public PuffinAction(java.lang.String name,
java.lang.String description,
java.lang.Character accelerator,
boolean shift,
java.lang.Integer mnemonic,
boolean specialMacMenuItem,
int modifier)
- Creates a new PuffinAction with the specified parameters.
- Parameters:
name
- the name of the Action (used for the menu item)description
- a short description of the Action (used for the tooltip)accelerator
- the accelerator key (keyboard shortcut) for the Action.
If null
, no accelerator will be setshift
- true
if the accelerator should require shift to be held downmnemonic
- mnemonic key (used to select the Action from a menu when the
menu is open); if null
, no mnemonic key will be setspecialMacMenuItem
- if true
, no menu item should be
created on Mac OS X, because this Action (e.g. ‘quit’) is
conventionally reached via a different interface (e.g. the
application menu) under Mac OS Xmodifier
- the modifier key (usually 0
for no modifier
key, or modifierKey
for an automatically chosen
platform-appropriate modifier key (ctrl or ‘apple’).
PuffinAction
public PuffinAction(java.lang.String name,
java.lang.String description,
java.lang.Character accelerator,
boolean shift,
java.lang.Integer mnemonic)
- Creates a new PuffinAction with the specified parameters.
- Parameters:
name
- the name of the Action (used for the menu item)description
- a short description of the Action (used for the tooltip)accelerator
- the accelerator key (keyboard shortcut) for the Action.
If null
, no accelerator will be setshift
- true
if the accelerator should require shift to be held downmnemonic
- mnemonic key (used to select the Action from a menu when the
menu is open); if null
, no mnemonic key will be set
PuffinAction
public PuffinAction(java.lang.String name,
java.lang.String description)
- Creates a new PuffinAction with the specified parameters.
- Parameters:
name
- the name of the Action (used for the menu item)description
- a short description of the Action (used for the tooltip)
isExcludedFromMenu
public boolean isExcludedFromMenu()
- Determines whether the Action should be excluded from the normal
application menus (on the grounds that it already exists in a
special Mac OS X menu and the application is being run on Mac OS X).
- Returns:
true
if this Action should not be shown on menus