org.jagatoo.input.managers
Class InputHotPlugManager

java.lang.Object
  extended by org.jagatoo.input.managers.InputHotPlugManager
All Implemented Interfaces:
java.lang.Runnable

public class InputHotPlugManager
extends java.lang.Object
implements java.lang.Runnable

The InputHotPlugManager polls for hot-plugged InputDevices and notifies listeners when devices are plugged in or out.


Constructor Summary
InputHotPlugManager()
           
 
Method Summary
 void addHotPlugListener(InputHotPlugListener l)
          Adds a new InputHotPlugListener to the list of notifed listeners.
 void deregisterControllerFactory(ControllerFactory factory)
          Deregisters a ControllerFactory.
 void deregisterDeviceFactory(InputDeviceFactory factory)
          Deregisters a InputDeviceFactory.
 void deregisterKeyboardFactory(KeyboardFactory factory)
          Deregisters a KeyboardFactory.
 void deregisterMouseFactory(MouseFactory factory)
          Deregisters a MouseFactory.
 boolean isRunning()
           
protected  void notifyListeners(InputDevice[] devices0, InputDevice[] devices1)
           
 void registerControllerFactory(ControllerFactory factory)
          Registers a ControllerFactory to be polled for hot-plugged devices.
 void registerDeviceFactory(InputDeviceFactory factory)
          Registers a InputDeviceFactory to be polled for hot-plugged devices.
 void registerKeyboardFactory(KeyboardFactory factory)
          Registers a KeyboardFactory to be polled for hot-plugged devices.
 void registerMouseFactory(MouseFactory factory)
          Registers a MouseFactory to be polled for hot-plugged devices.
 void removeHotPlugListener(InputHotPlugListener l)
          Removes a InputHotPlugListener from the list of notifed listeners.
 void run()
          
 void start()
          Starts the InputHotPlugManager in a new Thread.
 void stop(boolean wait)
          Stops the InputHotPlugManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputHotPlugManager

public InputHotPlugManager()
Method Detail

registerKeyboardFactory

public void registerKeyboardFactory(KeyboardFactory factory)
                             throws InputSystemException
Registers a KeyboardFactory to be polled for hot-plugged devices.

Parameters:
factory -
Throws:
InputSystemException

deregisterKeyboardFactory

public void deregisterKeyboardFactory(KeyboardFactory factory)
                               throws InputSystemException
Deregisters a KeyboardFactory.

Parameters:
factory -
Throws:
InputSystemException

registerMouseFactory

public void registerMouseFactory(MouseFactory factory)
                          throws InputSystemException
Registers a MouseFactory to be polled for hot-plugged devices.

Parameters:
factory -
Throws:
InputSystemException

deregisterMouseFactory

public void deregisterMouseFactory(MouseFactory factory)
                            throws InputSystemException
Deregisters a MouseFactory.

Parameters:
factory -
Throws:
InputSystemException

registerControllerFactory

public void registerControllerFactory(ControllerFactory factory)
                               throws InputSystemException
Registers a ControllerFactory to be polled for hot-plugged devices.

Parameters:
factory -
Throws:
InputSystemException

deregisterControllerFactory

public void deregisterControllerFactory(ControllerFactory factory)
                                 throws InputSystemException
Deregisters a ControllerFactory.

Parameters:
factory -
Throws:
InputSystemException

registerDeviceFactory

public void registerDeviceFactory(InputDeviceFactory factory)
                           throws InputSystemException
Registers a InputDeviceFactory to be polled for hot-plugged devices.
This simply calls registerKeyboardFactory(KeyboardFactory), registerMouseFactory(MouseFactory) and registerControllerFactory(ControllerFactory).

Parameters:
factory -
Throws:
InputSystemException

deregisterDeviceFactory

public void deregisterDeviceFactory(InputDeviceFactory factory)
                             throws InputSystemException
Deregisters a InputDeviceFactory.
This simply calls deregisterKeyboardFactory(KeyboardFactory), deregisterMouseFactory(MouseFactory) and deregisterControllerFactory(ControllerFactory).

Parameters:
factory -
Throws:
InputSystemException

addHotPlugListener

public void addHotPlugListener(InputHotPlugListener l)
Adds a new InputHotPlugListener to the list of notifed listeners.

Parameters:
l -

removeHotPlugListener

public void removeHotPlugListener(InputHotPlugListener l)
Removes a InputHotPlugListener from the list of notifed listeners.

Parameters:
l -

notifyListeners

protected void notifyListeners(InputDevice[] devices0,
                               InputDevice[] devices1)

run

public void run()

Specified by:
run in interface java.lang.Runnable

isRunning

public final boolean isRunning()

start

public void start()
Starts the InputHotPlugManager in a new Thread.


stop

public void stop(boolean wait)
Stops the InputHotPlugManager.

Parameters:
wait - if true, the method will not terminate until the manager's Thread is stopped.