Class NamedKeyStroke
java.lang.Object
VASSAL.tools.NamedKeyStroke
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
Modifier and TypeFieldDescriptionprotected final String
static final NamedKeyStroke
protected final KeyStroke
-
Constructor Summary
ConstructorDescriptionNamedKeyStroke
(int code, int modifiers) NamedKeyStroke
(int code, int modifiers, String s) NamedKeyStroke
(KeyStroke k, String s) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getDesc()
Return the allocated KeyStroke associated with this KeyStrokestatic NamedKeyStroke
Deprecated, for removal: This API element is subject to removal in a future version.getName()
static NamedKeyStroke
getNamedKeyStroke
(char c) Deprecated, for removal: This API element is subject to removal in a future version.static NamedKeyStroke
getNamedKeyStroke
(char c, int mod) Deprecated, for removal: This API element is subject to removal in a future version.static NamedKeyStroke
getNamedKeyStroke
(int c, int mod) Deprecated, for removal: This API element is subject to removal in a future version.Return the raw KeyStroke stored in this NamedKeyStrokeint
hashCode()
boolean
isNamed()
Is there a name associated with this KeyStroke?boolean
isNull()
static NamedKeyStroke
of
(char c) static NamedKeyStroke
of
(char c, int modifiers) static NamedKeyStroke
of
(int code, int modifiers) static NamedKeyStroke
static NamedKeyStroke
static NamedKeyStroke
static NamedKeyStroke
static NamedKeyStroke
-
Field Details
-
NULL_KEYSTROKE
-
stroke
-
name
-
-
Constructor Details
-
NamedKeyStroke
public NamedKeyStroke(int code, int modifiers) -
NamedKeyStroke
-
NamedKeyStroke
-
NamedKeyStroke
-
NamedKeyStroke
public NamedKeyStroke() -
NamedKeyStroke
-
-
Method Details
-
isNamed
public boolean isNamed()Is there a name associated with this KeyStroke? No name means it is a standard KeyStroke.- Returns:
- True if a name associated with this Keystroke
-
getName
-
isNull
public boolean isNull() -
getStroke
Return the raw KeyStroke stored in this NamedKeyStroke- Returns:
- KeyStroke
-
getDesc
- Returns:
- If a Named keystroke, returns the name string; otherwise if a "real" keystroke returns a string naming the keystroke (e.g. "Ctrl+C")
-
equals
-
hashCode
-
getKeyStroke
Return the allocated KeyStroke associated with this KeyStroke -
getNamedKeyStroke
@Deprecated(since="2021-12-01", forRemoval=true) public static NamedKeyStroke getNamedKeyStroke(char c) Deprecated, for removal: This API element is subject to removal in a future version. -
getNamedKeyStroke
@Deprecated(since="2021-12-01", forRemoval=true) public static NamedKeyStroke getNamedKeyStroke(char c, int mod) Deprecated, for removal: This API element is subject to removal in a future version. -
getNamedKeyStroke
@Deprecated(since="2021-12-01", forRemoval=true) public static NamedKeyStroke getNamedKeyStroke(int c, int mod) Deprecated, for removal: This API element is subject to removal in a future version. -
getKeyStrokeForEvent
@Deprecated(since="2021-12-01", forRemoval=true) public static NamedKeyStroke getKeyStrokeForEvent(KeyEvent e) Deprecated, for removal: This API element is subject to removal in a future version. -
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-