org.xj3d.ui.swt.device
Class SWTDeviceFactory
java.lang.Object
org.xj3d.core.eventmodel.DeviceFactory
org.xj3d.ui.swt.device.SWTDeviceFactory
public class SWTDeviceFactory
- extends DeviceFactory
A concrete implementation of DeviceFactory that is
specific to the SWT UI toolkit. Devices created through
this factory are initialized with the appropriate SWT
event listeners.
- Version:
- $Revision: 1.4 $
- Author:
- Rex Melton
|
Constructor Summary |
SWTDeviceFactory(java.lang.Object canvas,
java.lang.String rendererID,
java.lang.Object surface,
ErrorReporter reporter)
Constructor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SWTDeviceFactory
public SWTDeviceFactory(java.lang.Object canvas,
java.lang.String rendererID,
java.lang.Object surface,
ErrorReporter reporter)
- Constructor.
Note that the canvas argument requires an instance of
org.eclipse.swt.widgets.Control. Control is the lowest
level swt class that implements the device listeners
utilized in this class. Specifically:
- KeyListener
- MouseListener
- MouseMoveListener
- Parameters:
canvas - - The Object representing the ui toolkit
specific graphical component. Must be an instance of
org.eclipse.swt.widgets.Control.rendererID - - Identifier String of the renderer type.surface - - The Object representing the renderer
specific drawing surface.reporter - - The instance to use or null. A value of null
will clear the currently set reporter and causes the factory
to use the DefaultErrorReporter.
- Throws:
java.lang.IllegalArgumentException - if the canvas Object is not
an instance of org.eclipse.swt.widgets.Control.
getDeviceManagers
public DeviceManager[] getDeviceManagers()
- Return the array of DeviceManagers that are available per the
constructor parameters. The InputDevices instantiated will be
initialized with SWT UI toolkit event listeners.
- Specified by:
getDeviceManagers in class DeviceFactory
- Returns:
- the array of DeviceManagers. If no DeviceManagers are
available, an empty (size 0) array is returned.
getKeySensorDevice
public KeySensorDevice getKeySensorDevice()
- Return the KeySensorDevice associated with the rendering surface
initialized with the SWT key event listener.
- Specified by:
getKeySensorDevice in class DeviceFactory
- Returns:
- the KeySensorDevice
Copyright © 2001 - 2006 Web3D Consortium