Package VASSAL.configure
Class NamedHotKeyConfigurer
java.lang.Object
VASSAL.configure.Configurer
VASSAL.configure.NamedHotKeyConfigurer
- All Implemented Interfaces:
KeyListener
,EventListener
public class NamedHotKeyConfigurer extends Configurer implements KeyListener
A Configurer for
NamedKeyStroke
values-
Field Summary
Fields inherited from class VASSAL.configure.Configurer
changeSupport, frozen, key, name, NAME_PROPERTY, noUpdate, value
-
Constructor Summary
Constructors Constructor Description NamedHotKeyConfigurer(String key, String name)
NamedHotKeyConfigurer(String key, String name, NamedKeyStroke val)
-
Method Summary
Modifier and Type Method Description static NamedKeyStroke
decode(String s)
Decode a String into a NamedKeyStrokestatic String
encode(NamedKeyStroke stroke)
Encode a NamedKeyStroke into a StringComponent
getControls()
GUI interface for setting the option in an editing windowstatic String
getFancyString(NamedKeyStroke k)
static String
getString(KeyStroke k)
static String
getString(NamedKeyStroke k)
A plain text representation of a KeyStroke.Object
getValue()
The Object value May be null if the Object has not been initializedNamedKeyStroke
getValueNamedKeyStroke()
String
getValueString()
boolean
isNamed()
protected boolean
isPrintableAscii(char c)
protected boolean
isPrintableAscii(int i)
void
keyPressed(KeyEvent e)
void
keyReleased(KeyEvent e)
String
keyToString()
void
keyTyped(KeyEvent e)
void
setEnabled(boolean b)
void
setValue(Object o)
Set the Object valuevoid
setValue(String s)
Set the Object value from a Stringprotected void
updateVisibility()
Methods inherited from class VASSAL.configure.Configurer
addPropertyChangeListener, fireUpdate, getKey, getName, isFrozen, removePropertyChangeListener, setFrozen, setName
-
Constructor Details
-
NamedHotKeyConfigurer
-
NamedHotKeyConfigurer
-
-
Method Details
-
setValue
Description copied from class:Configurer
Set the Object value- Overrides:
setValue
in classConfigurer
-
keyToString
-
getValue
Description copied from class:Configurer
The Object value May be null if the Object has not been initialized- Overrides:
getValue
in classConfigurer
-
getValueString
- Specified by:
getValueString
in classConfigurer
- Returns:
- a String representation of the Object value
-
getValueNamedKeyStroke
-
setValue
Description copied from class:Configurer
Set the Object value from a String- Specified by:
setValue
in classConfigurer
-
setEnabled
public void setEnabled(boolean b) -
getControls
Description copied from class:Configurer
GUI interface for setting the option in an editing window- Specified by:
getControls
in classConfigurer
-
updateVisibility
protected void updateVisibility() -
isNamed
public boolean isNamed() -
keyTyped
- Specified by:
keyTyped
in interfaceKeyListener
-
keyPressed
- Specified by:
keyPressed
in interfaceKeyListener
-
keyReleased
- Specified by:
keyReleased
in interfaceKeyListener
-
isPrintableAscii
protected boolean isPrintableAscii(char c) -
isPrintableAscii
protected boolean isPrintableAscii(int i) -
getString
A plain text representation of a KeyStroke. Doesn't differ much fromKeyEvent.getKeyText(int)
-
getFancyString
-
getString
-
decode
Decode a String into a NamedKeyStroke -
encode
Encode a NamedKeyStroke into a String
-