|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.jaspira.action.keys.KeySequence
public class KeySequence
A key sequence describes a chain of key combinations. Key sequences can be represented as strings. There are two forms: A short form and a long form of the string representation. The short form is used to define a key sequence, e. g. in resource files. Modifiers are represented by the letters C, S and A for control, shift and alt, respectively. For example, Control-Shift j would be represented as "C-S-j". The long form will be presented to the user, e. g. as accelerator key in a tool tip. Modifiers are represented by their full name (CTRL, SHIFT, ALT). The "+" character is used as delimiter. For example, Control-Shift j would be represented as "CTRL+SHIFT+j".
| Field Summary | |
|---|---|
static java.lang.String |
LONG_ALT
ALT delimiter (long form) |
static java.lang.String |
LONG_CTRL
CTRL delimiter (long form) |
static char |
LONG_DELIM
Delimeter between modifiers and the actual key (long form) |
static java.lang.String |
LONG_SHIFT
SHIFT delimiter (long form) |
static java.lang.String |
SHORT_ALT
ALT delimiter (short form) |
static java.lang.String |
SHORT_CTRL
CTRL delimiter (short form) |
static char |
SHORT_DELIM
Delimeter between modifiers and the actual key (short form) |
static java.lang.String |
SHORT_SHIFT
SHIFT delimiter (short form) |
| Constructor Summary | |
|---|---|
KeySequence(java.lang.String sequence)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Checks two objects for equality. |
javax.swing.KeyStroke |
getKeyAt(int n)
Returns the n'th key combination of the sequence. |
KeySequence |
getSequenceTail()
Returns a tailsequence of this sequence, i\.e\. the last length - 1 key combinations. |
KeySequence |
getSubSequence(int n)
Returns a subsequence of this sequence, i\.e\. the first n key combinations. |
int |
hashCode()
Returns the hashcode of this sequence, which is determined using the string representation . |
static java.lang.String |
keyToString(javax.swing.KeyStroke key,
boolean longForm)
Returns a string representation of a given key stroke. |
int |
length()
Returns the length of the key-sequence. |
static javax.swing.KeyStroke |
stringToKey(java.lang.String string)
Converts a string representation (short form) into a corresponding key. |
java.lang.String |
toString()
Returns a string representation of this KeySequence. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final char SHORT_DELIM
public static final java.lang.String SHORT_SHIFT
public static final java.lang.String SHORT_CTRL
public static final java.lang.String SHORT_ALT
public static final char LONG_DELIM
public static final java.lang.String LONG_SHIFT
public static final java.lang.String LONG_CTRL
public static final java.lang.String LONG_ALT
| Constructor Detail |
|---|
public KeySequence(java.lang.String sequence)
sequence - Key sequence| Method Detail |
|---|
public int length()
public javax.swing.KeyStroke getKeyAt(int n)
public KeySequence getSubSequence(int n)
n - number of combinations that the new sequence should contain
public KeySequence getSequenceTail()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static javax.swing.KeyStroke stringToKey(java.lang.String string)
string - String to parse
public static java.lang.String keyToString(javax.swing.KeyStroke key,
boolean longForm)
key - The key to be convertedlongForm - true Returns the long form of the string representation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||