Package VASSAL.tools
Class NamedKeyStroke
java.lang.Object
VASSAL.tools.NamedKeyStroke
public class NamedKeyStroke extends Object
A NamedKeyStroke is a KeyStroke with a name given by the module developer.
An actual KeyStroke is allocated from a pool of KeyStrokes at run-time and
associated with the name.
KeyStrokes have been replaced by NamedKeyStrokes within Vassal wherever
the Stroke is saved. A standard KeyStroke is represented as a NamedKeyStroke
with a null or zero-length name.
NamedKeyStroke variables should never be null, use NULL_KEYSTROKE to
represent a NamedKeyStroke with no value.
-
Field Summary
Fields Modifier and Type Field Description protected Stringnamestatic NamedKeyStrokeNULL_KEYSTROKEprotected KeyStrokestroke -
Constructor Summary
Constructors Constructor Description NamedKeyStroke()NamedKeyStroke(int code, int modifiers)NamedKeyStroke(int code, int modifiers, String s)NamedKeyStroke(String s)NamedKeyStroke(KeyStroke k)NamedKeyStroke(KeyStroke k, String s) -
Method Summary
Modifier and Type Method Description booleanequals(Object o)KeyStrokegetKeyStroke()Return the allocated KeyStroke associated with this KeyStrokestatic NamedKeyStrokegetKeyStrokeForEvent(KeyEvent e)StringgetName()static NamedKeyStrokegetNamedKeyStroke(char c)static NamedKeyStrokegetNamedKeyStroke(char c, int mod)static NamedKeyStrokegetNamedKeyStroke(int c, int mod)KeyStrokegetStroke()Return the raw KeyStroke stored in this NamedKeyStrokebooleanisNamed()Is there a name associated with this KeyStroke? No name means it is a standard KeyStroke.booleanisNull()
-
Field Details
-
NULL_KEYSTROKE
-
stroke
-
name
-
-
Constructor Details
-
NamedKeyStroke
public NamedKeyStroke(int code, int modifiers) -
NamedKeyStroke
-
NamedKeyStroke
-
NamedKeyStroke
-
NamedKeyStroke
-
NamedKeyStroke
public NamedKeyStroke()
-
-
Method Details
-
isNamed
public boolean isNamed()Is there a name associated with this KeyStroke? No name means it is a standard KeyStroke.- Returns:
-
getName
-
isNull
public boolean isNull() -
getStroke
Return the raw KeyStroke stored in this NamedKeyStroke- Returns:
- KeyStroke
-
equals
-
getKeyStroke
Return the allocated KeyStroke associated with this KeyStroke -
getNamedKeyStroke
-
getNamedKeyStroke
-
getNamedKeyStroke
-
getKeyStrokeForEvent
-