Package org.xj3d.core.eventmodel
Class KeyDeviceSensorManager
java.lang.Object
org.xj3d.core.eventmodel.KeyDeviceSensorManager
Generalised manager for KeyDeviceSensor nodes.
Key device sensors must operate on an exclusive basis. If the sensor changes state then it must turn off the other key device sensors and send events to the new sensor.
- Version:
- $Revision: 1.4 $
- Author:
- Justin Couch
-
Constructor Summary
ConstructorsConstructorDescriptionKeyDeviceSensorManager
(DeviceFactory factory) Create a manager for KeyDeviceSensor nodes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSensor
(VRMLKeyDeviceSensorNodeType sensor) Add a key device sensor node to the managed list.void
clear()
Force clearing all state from this manager now.void
Send events through to the current enabled key sensors.void
reinitialize
(DeviceFactory factory) Set a new device factory to use.void
Remove the key device sensor from the management list.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
-
Constructor Details
-
KeyDeviceSensorManager
Create a manager for KeyDeviceSensor nodes.- Parameters:
factory
- the factory that creates our KeyDeviceSensor
-
-
Method Details
-
clear
public void clear()Force clearing all state from this manager now. This is used to indicate that a new world is about to be loaded and everything should be cleaned out now. -
reinitialize
Set a new device factory to use. Reinitialize devices.- Parameters:
factory
- The new DeviceFactory
-
processEvents
public void processEvents()Send events through to the current enabled key sensors. -
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.- Parameters:
reporter
- The instance to use or null
-
addSensor
Add a key device sensor node to the managed list. Only adds it to the internal list if it is not already active.- Parameters:
sensor
- The new sensor instance to add
-
removeSensor
Remove the key device sensor from the management list. If the sensor is not being managed by this instance, the request is ignored.- Parameters:
sensor
- The new sensor instance to remove
-