net.talvi.puffinplot
Class PuffinAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by 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
 

Field Detail

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.

Constructor Detail

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 set
shift - true if the accelerator should require shift to be held down
mnemonic - mnemonic key (used to select the Action from a menu when the menu is open); if null, no mnemonic key will be set
specialMacMenuItem - 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 X
modifier - 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 set
shift - true if the accelerator should require shift to be held down
mnemonic - 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)
Method Detail

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