public abstract class AbstractKeyboardController extends Object implements KeyboardController
KeyboardController
offering methods to store and call
KeyboardListener
s.Constructor and Description |
---|
AbstractKeyboardController(DockController controller)
Creates a new
KeyboardController . |
Modifier and Type | Method and Description |
---|---|
void |
addGlobalListener(KeyListener listener)
Adds a global key listener to this controller.
|
void |
addListener(KeyboardListener listener)
Adds a listener to this controller.
|
protected void |
fireKeyPressed(KeyEvent event)
Forwards
event to all listeners whose
DockElement is above the component
on which the event occurred. |
protected void |
fireKeyReleased(KeyEvent event)
Forwards
event to all listeners whose
DockElement is above the component
on which the event occurred. |
protected void |
fireKeyTyped(KeyEvent event)
Forwards
event to all listeners whose
DockElement is above the component
on which the event occurred. |
DockController |
getController()
Gets the
DockController in whose realm this KeyboardController works. |
void |
removeGlobalListener(KeyListener listener)
Removes a listener from this controller.
|
void |
removeListener(KeyboardListener listener)
Removes a listener from this controller.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
kill
public AbstractKeyboardController(DockController controller)
KeyboardController
.controller
- the controller in whose realm this KeyBoardController
will work.public void addGlobalListener(KeyListener listener)
KeyboardController
KeyListener
s
will receive a notification for every event that this controller handles.
The listeners will also be informed about events that are consumed.addGlobalListener
in interface KeyboardController
listener
- the new listenerpublic void removeGlobalListener(KeyListener listener)
KeyboardController
removeGlobalListener
in interface KeyboardController
listener
- the listener to removepublic void addListener(KeyboardListener listener)
KeyboardController
KeyEvent
occurs in the subtree below
the listeners DockElement
.addListener
in interface KeyboardController
listener
- the new listenerpublic void removeListener(KeyboardListener listener)
KeyboardController
removeListener
in interface KeyboardController
listener
- the listener to removepublic DockController getController()
KeyboardController
DockController
in whose realm this KeyboardController
works.getController
in interface KeyboardController
protected void fireKeyPressed(KeyEvent event)
event
to all listeners whose
DockElement
is above the component
on which the event occurred.event
- the event to sendprotected void fireKeyReleased(KeyEvent event)
event
to all listeners whose
DockElement
is above the component
on which the event occurred.event
- the event to sendprotected void fireKeyTyped(KeyEvent event)
event
to all listeners whose
DockElement
is above the component
on which the event occurred.event
- the event to send