|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo2.app.Component
echopointng.ComponentEx
echopointng.KeyStrokeListener
public class KeyStrokeListener
KeyStrokeListener is a component that listens for key stroke
combinations and raises action events if any one of those key combinations
have been pressed.
This can be a a single keystroke combination such as VK_F2 or a combination using a mask such as ALT_MASK | CONTROL_MASK | VK_F2 which is equates to Alt-Ctrl-F2.
Some components "EAT" all of the key strokes that go to them and hence only the key combinations that bubble up all the way to the base level will be able to be caught by the key stroke listener.
| Field Summary | |
|---|---|
static java.lang.String |
ACTION_LISTENERS_CHANGED_PROPERTY
|
static int |
ALT_MASK
Use this mask to determine if the ALT key is held a key is pressed |
static int |
CONTROL_MASK
Use this mask to determine if the CONTROL key is held a key is pressed |
static java.lang.String |
KEYSTROKE_CHANGED_PROPERTY
|
static int |
META_MASK
Use this mask to determine if the META key is held a key is pressed |
static java.lang.String |
PROPERTY_CANCEL_MODE
|
static int |
SHIFT_MASK
Use this mask to determine if the SHIFT key is held a key is pressed |
static int |
VK_0
|
static int |
VK_1
|
static int |
VK_2
|
static int |
VK_3
|
static int |
VK_4
|
static int |
VK_5
|
static int |
VK_6
|
static int |
VK_7
|
static int |
VK_8
|
static int |
VK_9
|
static int |
VK_A
|
static int |
VK_ADD
|
static int |
VK_ALT
|
static int |
VK_B
|
static int |
VK_BACK_QUOTE
|
static int |
VK_BACK_SLASH
|
static int |
VK_BACK_SPACE
|
static int |
VK_C
|
static int |
VK_CANCEL
|
static int |
VK_CAPS_LOCK
|
static int |
VK_CLEAR
|
static int |
VK_CLOSE_BRACKET
|
static int |
VK_COMMA
|
static int |
VK_CONTEXT_MENU
|
static int |
VK_CONTROL
|
static int |
VK_D
|
static int |
VK_DECIMAL
|
static int |
VK_DELETE
|
static int |
VK_DIVIDE
|
static int |
VK_DOWN
|
static int |
VK_E
|
static int |
VK_END
|
static int |
VK_ENTER
|
static int |
VK_EQUALS
|
static int |
VK_ESCAPE
|
static int |
VK_F
|
static int |
VK_F1
|
static int |
VK_F10
|
static int |
VK_F11
|
static int |
VK_F12
|
static int |
VK_F13
|
static int |
VK_F14
|
static int |
VK_F15
|
static int |
VK_F16
|
static int |
VK_F17
|
static int |
VK_F18
|
static int |
VK_F19
|
static int |
VK_F2
|
static int |
VK_F20
|
static int |
VK_F21
|
static int |
VK_F22
|
static int |
VK_F23
|
static int |
VK_F24
|
static int |
VK_F3
|
static int |
VK_F4
|
static int |
VK_F5
|
static int |
VK_F6
|
static int |
VK_F7
|
static int |
VK_F8
|
static int |
VK_F9
|
static int |
VK_G
|
static int |
VK_H
|
static int |
VK_HELP
|
static int |
VK_HOME
|
static int |
VK_I
|
static int |
VK_INSERT
|
static int |
VK_J
|
static int |
VK_K
|
static int |
VK_L
|
static int |
VK_LEFT
|
static int |
VK_M
|
static int |
VK_META
|
static int |
VK_MULTIPLY
|
static int |
VK_N
|
static int |
VK_NUM_LOCK
|
static int |
VK_NUMPAD0
|
static int |
VK_NUMPAD1
|
static int |
VK_NUMPAD2
|
static int |
VK_NUMPAD3
|
static int |
VK_NUMPAD4
|
static int |
VK_NUMPAD5
|
static int |
VK_NUMPAD6
|
static int |
VK_NUMPAD7
|
static int |
VK_NUMPAD8
|
static int |
VK_NUMPAD9
|
static int |
VK_O
|
static int |
VK_OPEN_BRACKET
|
static int |
VK_P
|
static int |
VK_PAGE_DOWN
|
static int |
VK_PAGE_UP
|
static int |
VK_PAUSE
|
static int |
VK_PERIOD
|
static int |
VK_PRINTSCREEN
|
static int |
VK_Q
|
static int |
VK_QUOTE
|
static int |
VK_R
|
static int |
VK_RETURN
|
static int |
VK_RIGHT
|
static int |
VK_S
|
static int |
VK_SCROLL_LOCK
|
static int |
VK_SEMICOLON
|
static int |
VK_SEPARATOR
|
static int |
VK_SHIFT
|
static int |
VK_SLASH
|
static int |
VK_SPACE
|
static int |
VK_SUBTRACT
|
static int |
VK_T
|
static int |
VK_TAB
|
static int |
VK_U
|
static int |
VK_UP
|
static int |
VK_V
|
static int |
VK_W
|
static int |
VK_X
|
static int |
VK_Y
|
static int |
VK_Z
|
| Fields inherited from class echopointng.ComponentEx |
|---|
PROPERTY_HIDDEN |
| Constructor Summary | |
|---|---|
KeyStrokeListener()
Constructs a KeyStrokeListener |
|
| Method Summary | |
|---|---|
void |
addActionListener(ActionListener l)
Adds an ActionListener to receive notification of user
actions, i.e., key presses. |
void |
addKeyCombination(int keyCombination)
This adds a key combination to the KeyStrokeListener using
string returned from getMnemonic as the command string. |
void |
addKeyCombination(int keyCombination,
java.lang.String command)
This adds a key combination to the KeyStrokeListener. |
boolean |
getCancelMode()
|
java.lang.String |
getKeyCombinationCommand(int keyCombination)
Returns the command that is currently associated with the given key combination. |
int[] |
getKeyCombinations()
Returns all the key combinations that currently in this KeyStrokeListener. |
static java.lang.String |
getMnemonic(int keyCombination)
This returns a mnemonic string representation of the given key combination for example 'F1' or 'Ctrl-F1' or 'A'. |
boolean |
hasActionListeners()
Determines if there are any ActionListener s registered. |
boolean |
hasKeyCombination(int keyCombination)
Returns true if the given key combination has been previously added to this KeyStrokeListener. |
boolean |
isValidChild(Component child)
This component does not support children. |
void |
processInput(java.lang.String inputName,
java.lang.Object inputValue)
Processes client input specific to the Component
received from the UpdateManager. |
void |
removeActionListener(ActionListener l)
Removes an ActionListener from being notified of user
actions, i.e., key presses. |
void |
removeKeyCombination(int keyCombination)
Removes a key combination from this KeyStrokeListener. |
void |
setCancelMode(boolean newValue)
When cancelMode is true, then the key stroke is cancel and prevented from bubling further up the hierarchy. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ALT_MASK
public static final int CONTROL_MASK
public static final int SHIFT_MASK
public static final int META_MASK
public static final int VK_CANCEL
public static final int VK_HELP
public static final int VK_BACK_SPACE
public static final int VK_TAB
public static final int VK_CLEAR
public static final int VK_RETURN
public static final int VK_ENTER
public static final int VK_SHIFT
public static final int VK_CONTROL
public static final int VK_ALT
public static final int VK_PAUSE
public static final int VK_CAPS_LOCK
public static final int VK_ESCAPE
public static final int VK_SPACE
public static final int VK_PAGE_UP
public static final int VK_PAGE_DOWN
public static final int VK_END
public static final int VK_HOME
public static final int VK_LEFT
public static final int VK_UP
public static final int VK_RIGHT
public static final int VK_DOWN
public static final int VK_PRINTSCREEN
public static final int VK_INSERT
public static final int VK_DELETE
public static final int VK_0
public static final int VK_1
public static final int VK_2
public static final int VK_3
public static final int VK_4
public static final int VK_5
public static final int VK_6
public static final int VK_7
public static final int VK_8
public static final int VK_9
public static final int VK_SEMICOLON
public static final int VK_EQUALS
public static final int VK_A
public static final int VK_B
public static final int VK_C
public static final int VK_D
public static final int VK_E
public static final int VK_F
public static final int VK_G
public static final int VK_H
public static final int VK_I
public static final int VK_J
public static final int VK_K
public static final int VK_L
public static final int VK_M
public static final int VK_N
public static final int VK_O
public static final int VK_P
public static final int VK_Q
public static final int VK_R
public static final int VK_S
public static final int VK_T
public static final int VK_U
public static final int VK_V
public static final int VK_W
public static final int VK_X
public static final int VK_Y
public static final int VK_Z
public static final int VK_CONTEXT_MENU
public static final int VK_NUMPAD0
public static final int VK_NUMPAD1
public static final int VK_NUMPAD2
public static final int VK_NUMPAD3
public static final int VK_NUMPAD4
public static final int VK_NUMPAD5
public static final int VK_NUMPAD6
public static final int VK_NUMPAD7
public static final int VK_NUMPAD8
public static final int VK_NUMPAD9
public static final int VK_MULTIPLY
public static final int VK_ADD
public static final int VK_SEPARATOR
public static final int VK_SUBTRACT
public static final int VK_DECIMAL
public static final int VK_DIVIDE
public static final int VK_F1
public static final int VK_F2
public static final int VK_F3
public static final int VK_F4
public static final int VK_F5
public static final int VK_F6
public static final int VK_F7
public static final int VK_F8
public static final int VK_F9
public static final int VK_F10
public static final int VK_F11
public static final int VK_F12
public static final int VK_F13
public static final int VK_F14
public static final int VK_F15
public static final int VK_F16
public static final int VK_F17
public static final int VK_F18
public static final int VK_F19
public static final int VK_F20
public static final int VK_F21
public static final int VK_F22
public static final int VK_F23
public static final int VK_F24
public static final int VK_NUM_LOCK
public static final int VK_SCROLL_LOCK
public static final int VK_COMMA
public static final int VK_PERIOD
public static final int VK_SLASH
public static final int VK_BACK_QUOTE
public static final int VK_OPEN_BRACKET
public static final int VK_BACK_SLASH
public static final int VK_CLOSE_BRACKET
public static final int VK_QUOTE
public static final int VK_META
public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
public static final java.lang.String KEYSTROKE_CHANGED_PROPERTY
public static final java.lang.String PROPERTY_CANCEL_MODE
| Constructor Detail |
|---|
public KeyStrokeListener()
KeyStrokeListener
| Method Detail |
|---|
public boolean isValidChild(Component child)
isValidChild in class Componentchild - the Component to evaluate as a child
Component is a valid childComponent.isValidChild(nextapp.echo2.app.Component)
public void processInput(java.lang.String inputName,
java.lang.Object inputValue)
ComponentComponent
received from the UpdateManager.
Derivative implementations should take care to invoke
super.processInput().
processInput in class ComponentinputName - the name of the inputinputValue - the value of the inputComponent.processInput(java.lang.String,
java.lang.Object)
public void addKeyCombination(int keyCombination,
java.lang.String command)
KeyStrokeListener.
This can be a single keystroke combination such as VK_F2 or a combination
using a mask such as ALT_MASK | CONTROL_MASK | VK_F2 which is
Alt-Ctrl-F2.
If this key combination is pressed, then the command will be used to raise an ActionEvent.
keyCombination - -
the new key combination to add.command - -
the command to be used with the ActionEventpublic void addKeyCombination(int keyCombination)
KeyStrokeListener using
string returned from getMnemonic as the command string.
addKeyCombination(int, String)public boolean hasKeyCombination(int keyCombination)
KeyStrokeListener.
keyCombination - -
the key combination to test for
KeyStrokeListener.public void removeKeyCombination(int keyCombination)
KeyStrokeListener.
keyCombination - -
the key combination to remove.public int[] getKeyCombinations()
KeyStrokeListener.
KeyStrokeListener.public java.lang.String getKeyCombinationCommand(int keyCombination)
keyCombination - -
the key combination to look for.
public void addActionListener(ActionListener l)
ActionListener to receive notification of user
actions, i.e., key presses.
l - the listener to addpublic boolean hasActionListeners()
ActionListener s registered.
public void removeActionListener(ActionListener l)
ActionListener from being notified of user
actions, i.e., key presses.
l - the listener to removepublic boolean getCancelMode()
setCancelMode(boolean)public void setCancelMode(boolean newValue)
newValue - - the new cancel moed valuepublic static java.lang.String getMnemonic(int keyCombination)
keyCombination - -
the key combination to look for.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||