Class KeyCommand
java.lang.Object
javax.swing.AbstractAction
VASSAL.counters.KeyCommand
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
DynamicProperty.DynamicKeyCommand
,KeyCommandSubMenu
,MultiLocationCommand.MultiLocationKeyCommand
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected TranslatablePiece
protected String
protected NamedKeyStroke
static final KeyCommand[]
protected String
Fields inherited from class javax.swing.AbstractAction
changeSupport
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
ConstructorDescriptionKeyCommand
(String name, KeyStroke key, GamePiece target) KeyCommand
(String name, KeyStroke key, GamePiece target, boolean enabled) KeyCommand
(String name, KeyStroke key, GamePiece target, TranslatablePiece i18nPiece) KeyCommand
(String name, KeyStroke key, GamePiece target, TranslatablePiece i18nPiece, boolean enabled) KeyCommand
(String name, NamedKeyStroke key, GamePiece target) KeyCommand
(String name, NamedKeyStroke key, GamePiece target, boolean enabled) KeyCommand
(String name, NamedKeyStroke key, GamePiece target, TranslatablePiece i18nPiece) KeyCommand
(String name, NamedKeyStroke key, GamePiece target, TranslatablePiece i18nPiece, boolean enabled) KeyCommand
(KeyCommand command) -
Method Summary
Modifier and TypeMethodDescriptionvoid
The human-readable text that will appear in the right-click menu, translated to the user's LocalegetName()
boolean
boolean
isGlobal()
If true, then this action will apply to all selected piecesboolean
boolean
void
setEnabled
(boolean b) void
setGlobal
(boolean global) If true, then this action will apply to all selected piecesMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
-
Field Details
-
NONE
-
untranslatedName
-
localizedMenuText
-
i18nPiece
-
namedKeyStroke
-
-
Constructor Details
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
public KeyCommand(String name, NamedKeyStroke key, GamePiece target, TranslatablePiece i18nPiece, boolean enabled) -
KeyCommand
-
KeyCommand
public KeyCommand(String name, KeyStroke key, GamePiece target, TranslatablePiece i18nPiece, boolean enabled) -
KeyCommand
-
-
Method Details
-
getName
-
matches
-
getKeyStroke
-
getNamedKeyStroke
-
getTarget
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceAction
- Overrides:
isEnabled
in classAbstractAction
-
setEnabled
public void setEnabled(boolean b) - Specified by:
setEnabled
in interfaceAction
- Overrides:
setEnabled
in classAbstractAction
-
isGlobal
public boolean isGlobal()If true, then this action will apply to all selected pieces- Returns:
- global
-
setGlobal
public void setGlobal(boolean global) If true, then this action will apply to all selected pieces- Parameters:
global
- value to set
-
actionPerformed
-
isMenuSeparator
public boolean isMenuSeparator() -
getLocalizedMenuText
The human-readable text that will appear in the right-click menu, translated to the user's Locale- Returns:
- Localized text
-