|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.KeyActionAdapter
An adapter class for receiving key events, and performing action listeners in response to those events.
| Field Summary | |
protected ActionSequence |
pressedActions
List of action listeners to be performed upon the notification of key pressed events. |
protected ActionSequence |
releasedActions
List of action listeners to be performed upon the notification of key released events. |
protected ActionSequence |
typedActions
List of action listeners to be performed upon the notification of key typed events. |
| Constructor Summary | |
KeyActionAdapter()
Constructs a key action adapter. |
|
KeyActionAdapter(Component target)
Constructs a key action adapter listening for key events generated by the given component. |
|
| Method Summary | |
void |
addKeyPressedAction(ActionListener a)
Adds an action listener to this adapter so that it will be performed when a key is pressed. |
void |
addKeyReleasedAction(ActionListener a)
Adds an action listener to this adapter so that it will be performed when a key is released. |
void |
addKeyTypedAction(ActionListener a)
Adds an action listener to this adapter so that it will be performed when a key is typed. |
ActionSequence |
getKeyPressedActions()
Returns the action sequence for key pressed events. |
ActionSequence |
getKeyReleasedActions()
Returns the action sequence for key released events. |
ActionSequence |
getKeyTypedActions()
Returns the action sequence for key typed events. |
void |
keyPressed(KeyEvent evt)
Performs the stored action sequence when a key has been pressed. |
void |
keyReleased(KeyEvent evt)
Performs the stored action sequence when a key has been released. |
void |
keyTyped(KeyEvent evt)
Performs the stored action sequence when a key has been typed. |
void |
removeKeyPressedAction(ActionListener a)
Removes the given action listener from this adapter so that it will be no longer be performed when a key is pressed. |
void |
removeKeyReleasedAction(ActionListener a)
Removes the given action listener from this adapter so that it will be no longer be performed when a key is released. |
void |
removeKeyTypedAction(ActionListener a)
Removes the given action listener from this adapter so that it will be no longer be performed when a key is typed. |
void |
setKeyPressedActions(ActionSequence sequence)
Sets the action sequence for key pressed events to the provided action sequence. |
void |
setKeyReleasedActions(ActionSequence sequence)
Sets the action sequence for key released events to the provided action sequence. |
void |
setKeyTypedActions(ActionSequence sequence)
Sets the action sequence for key typed events to the provided action sequence. |
void |
uninstallAllKeyActions()
Uninstall all key actions for this adapter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected ActionSequence pressedActions
protected ActionSequence releasedActions
protected ActionSequence typedActions
| Constructor Detail |
public KeyActionAdapter()
public KeyActionAdapter(Component target)
null, this adapter does not listen
to a particular component by default.
target - the component that is listened to| Method Detail |
public final void keyPressed(KeyEvent evt)
keyPressed in interface KeyListenerevt - the key pressed event to be handledpublic final void keyReleased(KeyEvent evt)
keyReleased in interface KeyListenerevt - the key released event to be handledpublic final void keyTyped(KeyEvent evt)
keyTyped in interface KeyListenerevt - the key typed event to be handledpublic void addKeyPressedAction(ActionListener a)
a - the action listener to be performedremoveKeyPressedAction(ActionListener),
setKeyPressedActions(ActionSequence),
getKeyPressedActions()public void addKeyReleasedAction(ActionListener a)
a - the action listener to be performedremoveKeyReleasedAction(ActionListener),
setKeyReleasedActions(ActionSequence),
getKeyReleasedActions()public void addKeyTypedAction(ActionListener a)
a - the action listener to be performedremoveKeyTypedAction(ActionListener),
setKeyTypedActions(ActionSequence),
getKeyTypedActions()public void removeKeyPressedAction(ActionListener a)
a - the action listener to be removedaddKeyPressedAction(ActionListener),
setKeyPressedActions(ActionSequence),
getKeyPressedActions()public void removeKeyReleasedAction(ActionListener a)
a - the action listener to be removedaddKeyReleasedAction(ActionListener),
setKeyReleasedActions(ActionSequence),
getKeyReleasedActions()public void removeKeyTypedAction(ActionListener a)
a - the action listener to be removedaddKeyTypedAction(ActionListener),
setKeyTypedActions(ActionSequence),
getKeyTypedActions()public void setKeyPressedActions(ActionSequence sequence)
null, the action sequence
for key pressed events is cleared.
sequence - the desired action sequencegetKeyPressedActions(),
addKeyPressedAction(ActionListener),
removeKeyPressedAction(ActionListener)public void setKeyReleasedActions(ActionSequence sequence)
null, the action sequence
for key released events is cleared.
sequence - the desired action sequencegetKeyReleasedActions(),
addKeyReleasedAction(ActionListener),
removeKeyReleasedAction(ActionListener)public void setKeyTypedActions(ActionSequence sequence)
null, the action sequence
for key typed events is cleared.
sequence - the desired action sequencegetKeyTypedActions(),
addKeyTypedAction(ActionListener),
removeKeyTypedAction(ActionListener)public ActionSequence getKeyPressedActions()
setKeyPressedActions(ActionSequence),
addKeyPressedAction(ActionListener),
removeKeyPressedAction(ActionListener)public ActionSequence getKeyReleasedActions()
setKeyReleasedActions(ActionSequence),
addKeyReleasedAction(ActionListener),
removeKeyReleasedAction(ActionListener)public ActionSequence getKeyTypedActions()
setKeyTypedActions(ActionSequence),
addKeyTypedAction(ActionListener),
removeKeyTypedAction(ActionListener)public void uninstallAllKeyActions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||