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 TranslatablePiece
i18nPiece
protected String
localizedMenuText
protected NamedKeyStroke
namedKeyStroke
protected String
untranslatedName
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
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 void
actionPerformed(ActionEvent evt)
KeyStroke
getKeyStroke()
String
getLocalizedMenuText()
The human-readable text that will appear in the right-click menu, translated to the user's LocaleString
getName()
NamedKeyStroke
getNamedKeyStroke()
GamePiece
getTarget()
boolean
isEnabled()
boolean
isGlobal()
If true, then this action will apply to all selected piecesboolean
isMenuSeparator()
boolean
matches(KeyStroke key)
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
-
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:
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:
-
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:
-