org.jagatoo.input.impl.lwjgl
Class LWJGLController

java.lang.Object
  extended by org.jagatoo.input.devices.InputDevice
      extended by org.jagatoo.input.devices.Controller
          extended by org.jagatoo.input.impl.lwjgl.LWJGLController
All Implemented Interfaces:
Enableable

public class LWJGLController
extends Controller

LWJGL implementation of a Controller.


Constructor Summary
protected LWJGLController(ControllerFactory factory, InputSourceWindow sourceWindow, EventQueue eventQueue, org.lwjgl.input.Controller implController)
           
 
Method Summary
 void collectEvents(InputSystem is, EventQueue eventQueue, long nanoTime)
          Processes pending events from the system and places them into the EventQueue.
protected  void collectOrFireEvents(InputSystem is, EventQueue eventQueue, long nanoTime)
           
 void consumePendingEvents(InputSystem is, EventQueue eventQueue, long nanoTime)
          Processes pending events from the system and simply wastes them.
protected  LWJGLControllerAxis[] createAxesArray(java.lang.Object implObj)
           
protected  ControllerButton[] createButtonsArray(java.lang.Object implObj)
           
 void destroyImpl()
          Destroys the Controller.
protected  org.lwjgl.input.Controller getController()
           
protected  int getIndex()
           
 void onDeviceRegistered(InputSystem inputSystem)
          This method is called by the InputSystem after the device has been completely and successfully registered.
 void onDeviceUnregistered(InputSystem inputSystem)
          This method is called by the InputSystem after the device has been completely and successfully deregistered.
 void update(InputSystem is, EventQueue eventQueue, long nanoTime)
          Processes pending events from the system and directly fires them (notifes the listeners).
 
Methods inherited from class org.jagatoo.input.devices.Controller
addControllerListener, destroy, fireControllerEvent, fireOnControllerAxisChanged, fireOnControllerButtonPressed, fireOnControllerButtonReleased, getAxesCount, getAxis, getButton, getButtonsCount, getButtonState, getSourceFactory, getState, hasControllerListener, hasListener, isButtonPressed, prepareControllerAxisChanged, prepareControllerButtonPressed, prepareControllerButtonReleased, removeControllerListener, toString
 
Methods inherited from class org.jagatoo.input.devices.InputDevice
addInputStateListener, equals, fireStateEventsAndDoActions, getEventQueue, getName, getSourceWindow, hasInputStateListener, isEnabled, removeInputStateListener, setEnabled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LWJGLController

protected LWJGLController(ControllerFactory factory,
                          InputSourceWindow sourceWindow,
                          EventQueue eventQueue,
                          org.lwjgl.input.Controller implController)
                   throws InputSystemException
Throws:
InputSystemException
Method Detail

onDeviceRegistered

public void onDeviceRegistered(InputSystem inputSystem)
                        throws InputSystemException
This method is called by the InputSystem after the device has been completely and successfully registered.

Overrides:
onDeviceRegistered in class InputDevice
Throws:
InputSystemException

onDeviceUnregistered

public void onDeviceUnregistered(InputSystem inputSystem)
                          throws InputSystemException
This method is called by the InputSystem after the device has been completely and successfully deregistered.

Overrides:
onDeviceUnregistered in class InputDevice
Throws:
InputSystemException

getController

protected final org.lwjgl.input.Controller getController()

getIndex

protected final int getIndex()

collectOrFireEvents

protected final void collectOrFireEvents(InputSystem is,
                                         EventQueue eventQueue,
                                         long nanoTime)
                                  throws InputSystemException
Throws:
InputSystemException

consumePendingEvents

public void consumePendingEvents(InputSystem is,
                                 EventQueue eventQueue,
                                 long nanoTime)
                          throws InputSystemException
Processes pending events from the system and simply wastes them.
This method is invoked by the InputSystem when a new InputDevice is registered and instead of the InputDevice.update(InputSystem, EventQueue, long) method, if the device is disabled or its InputSourceWindow doesn't currently receive input events.

Specified by:
consumePendingEvents in class InputDevice
Throws:
InputSystemException

collectEvents

public void collectEvents(InputSystem is,
                          EventQueue eventQueue,
                          long nanoTime)
                   throws InputSystemException
Processes pending events from the system and places them into the EventQueue.
The events are not fired (listeners are not notified). They are fired when the InputDevice.update(InputSystem, EventQueue, long) method is invoked.

Specified by:
collectEvents in class InputDevice
Throws:
InputSystemException

update

public void update(InputSystem is,
                   EventQueue eventQueue,
                   long nanoTime)
            throws InputSystemException
Processes pending events from the system and directly fires them (notifes the listeners).
This method also flushes the EventQueue, if the previously called InputDevice.collectEvents(InputSystem, EventQueue, long) method placed events into it.

Specified by:
update in class InputDevice
Throws:
InputSystemException

destroyImpl

public void destroyImpl()
                 throws InputSystemException
Destroys the Controller.

Specified by:
destroyImpl in class Controller
Throws:
InputSystemException

createAxesArray

protected final LWJGLControllerAxis[] createAxesArray(java.lang.Object implObj)
Specified by:
createAxesArray in class Controller

createButtonsArray

protected final ControllerButton[] createButtonsArray(java.lang.Object implObj)
Specified by:
createButtonsArray in class Controller