net.nexttext.input
Class InputManager

java.lang.Object
  extended by net.nexttext.input.InputManager

public class InputManager
extends java.lang.Object

A manager for the input sources.

The input manager keeps input sources accessible by name. The application adds input source objects to the manager and behaviours can fetch these objects to access their data. All sources are stored in a HashMap.


Constructor Summary
InputManager(Mouse mouse, Keyboard keyboard)
          Builds an InputManager.
 
Method Summary
 void add(java.lang.String name, InputSource source)
          Adds an input source to the list.
 InputSource get(java.lang.String name)
          Gets an input source from the list.
 void remove(java.lang.String name)
          Removes an input source from the list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputManager

public InputManager(Mouse mouse,
                    Keyboard keyboard)
Builds an InputManager.

Parameters:
mouse - the default Mouse InputSource
keyboard - the default Keyboard InputSource
Method Detail

add

public void add(java.lang.String name,
                InputSource source)
Adds an input source to the list.

Parameters:
name - key of the new input source
source - the new input source object

remove

public void remove(java.lang.String name)
Removes an input source from the list.

Parameters:
name - key of the input source to remove

get

public InputSource get(java.lang.String name)
Gets an input source from the list.

Parameters:
name - key of the input source to return
Returns:
input source specified by the key parameter. null if no source is attached to the specified key.
See Also:
InputSource