|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swing.SwingKeyStrokeBuilder
An instance of this class which allows building a
instance from the string representations of a key code and modifiers.
Please refer to the documentation of the KeyStroke
method for more information regarding these string representations formats.
The aim of this class is to provide a mean for developers to define commands
short cut keys through property files.
buildKeyStroke(String, String)
| Nested Class Summary |
| Nested classes inherited from class com.tensegrity.gui.KeyStrokeBuilder |
KeyStrokeBuilder.keyStrokeBuilderException |
| Field Summary | |
static java.lang.String |
KEYEVENT_CLASS
Constant representing the KeyEvent class' full name |
| Fields inherited from interface com.tensegrity.gui.KeyStrokeBuilder |
KEYCODE_PREFIX, KEYSTROKE_CLASS, MODIFIER_SUFFIX, MODIFIERS_SEPARATOR, VALID_MODIFIERS |
| Method Summary | |
boolean |
assertModifier(java.lang.String modifier)
Simple utility method returning true if the parameter is
a valid modifier, false otherwise.
|
KeyStroke |
buildKeyStroke(java.lang.String keyCode,
java.lang.String modifiers)
This method builds and returns a
instance using the passed string representation of keycode and
modifiers. |
protected static SwingKeyStrokeBuilder |
getInstance()
Returns the singleton instance |
int |
retrieveKeycodeIntValue(java.lang.String keycode)
This method accepts the string representation of a key code as parameter and returns the corresponding integer representation. |
int |
retrieveModifiersIntValue(java.lang.String modifiers)
This method accepts the string representation of modifiers as parameter and returns the corresponding integer representation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String KEYEVENT_CLASS
| Method Detail |
protected static SwingKeyStrokeBuilder getInstance()
Returns the singleton instance
public int retrieveKeycodeIntValue(java.lang.String keycode)
throws KeyStrokeBuilder.keyStrokeBuilderException
This method accepts the string representation of a key code as parameter
and returns the corresponding integer representation. The integer
representation is in fact the corresponding constant value of the
class. Note that there is a tight coupling between the valid 'keycode'
parameters accepted by this method and the constants starting with the
prefix KeyEvent in the KeyStrokeBuilder.KEYCODE_PREFIX
class. Valid parameters should have a corresponding value in KeyEvent,
when the prefix KeyEvent is added at their
beginning.
KeyStrokeBuilder.KEYCODE_PREFIX
retrieveKeycodeIntValue in interface KeyStrokeBuilderkeycode - this is the String representation of a key code.
KeyEvent
class.
keyStrokeBuilderException
KeyStrokeBuilder.keyStrokeBuilderExceptionpublic boolean assertModifier(java.lang.String modifier)
Simple utility method returning true if the parameter is
a valid modifier, false otherwise.
assertModifier in interface KeyStrokeBuildermodifier - this is the String representation for a modifier.
true if the parameter is a valid modifier, false
otherwise.{@link #VALID_MODIFIERS}
public int retrieveModifiersIntValue(java.lang.String modifiers)
throws KeyStrokeBuilder.keyStrokeBuilderException
This method accepts the string representation of modifiers as parameter
and returns the corresponding integer representation. The integer
representation is in fact the corresponding constant value of the
class. Note that there is a tight coupling between the valid 'modifiers'
parameters accepted by this method and constants defined in the KeyStroke
class.
KeyStroke
KeyStroke.CTRL_MASK
KeyStroke.ALT_MASK
KeyStroke.SHIFT_MASK
KeyStroke.ALT_GRAPH_MASK
KeyStroke.META_MASK
KeyStroke.NO_MASK
KeyStrokeBuilder.VALID_MODIFIERS.
Modifiers must be separated with the KeyStrokeBuilder.MODIFIERS_SEPARATOR
separator.
retrieveModifiersIntValue in interface KeyStrokeBuildermodifiers - a String representation of modifiers.
keyStrokeBuilderException
KeyStrokeBuilder.keyStrokeBuilderException
public KeyStroke buildKeyStroke(java.lang.String keyCode,
java.lang.String modifiers)
throws KeyStrokeBuilder.keyStrokeBuilderException
This method builds and returns a
instance using the passed string representation of keycode and
modifiers. See KeyStroke
and retrieveKeycodeIntValue(String) for more
information regarding the parameters valid formats.
retrieveModifiersIntValue(String)
buildKeyStroke in interface KeyStrokeBuilderkeyCode - a string representation of a key codemodifiers - a string representation of modifiers
KeyStroke instance
keyStrokeBuilderException - this exception is thrown is the KeyStroke
is not succesfully created.
KeyStrokeBuilder.keyStrokeBuilderException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||