bibliothek.gui.dock.control
Class AbstractKeyboardController

java.lang.Object
  extended by bibliothek.gui.dock.control.AbstractKeyboardController
All Implemented Interfaces:
KeyboardController
Direct Known Subclasses:
DefaultKeyboardController

public abstract class AbstractKeyboardController
extends Object
implements KeyboardController

Abstract implementation of KeyboardController offering methods to store and call KeyboardListeners.

Author:
Benjamin Sigg

Constructor Summary
AbstractKeyboardController(DockController controller)
          Creates a new KeyboardController.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.control.KeyboardController
kill
 

Constructor Detail

AbstractKeyboardController

public AbstractKeyboardController(DockController controller)
Creates a new KeyboardController.

Parameters:
controller - the controller in whose realm this KeyBoardController will work.
Method Detail

addGlobalListener

public void addGlobalListener(KeyListener listener)
Description copied from interface: KeyboardController
Adds a global key listener to this controller. Global KeyListeners will receive a notification for every event that this controller handles. The listeners will also be informed about events that are consumed.

Specified by:
addGlobalListener in interface KeyboardController
Parameters:
listener - the new listener

removeGlobalListener

public void removeGlobalListener(KeyListener listener)
Description copied from interface: KeyboardController
Removes a listener from this controller.

Specified by:
removeGlobalListener in interface KeyboardController
Parameters:
listener - the listener to remove

addListener

public void addListener(KeyboardListener listener)
Description copied from interface: KeyboardController
Adds a listener to this controller. The listener will be invoked when a KeyEvent occurs in the subtree below the listeners DockElement.

Specified by:
addListener in interface KeyboardController
Parameters:
listener - the new listener

removeListener

public void removeListener(KeyboardListener listener)
Description copied from interface: KeyboardController
Removes a listener from this controller.

Specified by:
removeListener in interface KeyboardController
Parameters:
listener - the listener to remove

getController

public DockController getController()
Description copied from interface: KeyboardController
Gets the DockController in whose realm this KeyboardController works.

Specified by:
getController in interface KeyboardController
Returns:
the owner of this controller

fireKeyPressed

protected void fireKeyPressed(KeyEvent event)
Forwards event to all listeners whose DockElement is above the component on which the event occurred.

Parameters:
event - the event to send

fireKeyReleased

protected void fireKeyReleased(KeyEvent event)
Forwards event to all listeners whose DockElement is above the component on which the event occurred.

Parameters:
event - the event to send

fireKeyTyped

protected void fireKeyTyped(KeyEvent event)
Forwards event to all listeners whose DockElement is above the component on which the event occurred.

Parameters:
event - the event to send