Package VASSAL.counters
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
public class KeyCommand extends AbstractAction
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected TranslatablePiecei18nPieceprotected StringlocalizedMenuTextprotected NamedKeyStrokenamedKeyStrokeprotected StringuntranslatedNameFields inherited from class javax.swing.AbstractAction
changeSupportFields 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
Constructors Constructor Description KeyCommand(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, NamedKeyStroke key, GamePiece target)KeyCommand(String name, NamedKeyStroke key, GamePiece target, boolean enabled)KeyCommand(String name, NamedKeyStroke key, GamePiece target, TranslatablePiece i18nPiece)KeyCommand(KeyCommand command) -
Method Summary
Modifier and Type Method Description voidactionPerformed(ActionEvent evt)KeyStrokegetKeyStroke()StringgetLocalizedMenuText()The human-readable text that will appear in the right-click menu, translated to the user's LocaleStringgetName()NamedKeyStrokegetNamedKeyStroke()GamePiecegetTarget()booleanisEnabled()booleanisGlobal()If true, then this action will apply to all selected piecesbooleanisMenuSeparator()booleanmatches(KeyStroke key)voidsetEnabled(boolean b)voidsetGlobal(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
-
untranslatedName
-
localizedMenuText
-
i18nPiece
-
namedKeyStroke
-
-
Constructor Details
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
KeyCommand
-
-
Method Details
-
getName
-
matches
-
getKeyStroke
-
getNamedKeyStroke
-
getTarget
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceAction- Overrides:
isEnabledin classAbstractAction
-
setEnabled
public void setEnabled(boolean b)- Specified by:
setEnabledin interfaceAction- Overrides:
setEnabledin classAbstractAction
-
isGlobal
public boolean isGlobal()If true, then this action will apply to all selected pieces- Returns:
-
setGlobal
public void setGlobal(boolean global)If true, then this action will apply to all selected pieces- Parameters:
global-
-
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:
-