Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.awt.device
Class AWTDeviceFactory

java.lang.Object
  extended by org.xj3d.core.eventmodel.DeviceFactory
      extended by org.xj3d.ui.awt.device.AWTDeviceFactory

public class AWTDeviceFactory
extends DeviceFactory

A concrete implementation of DeviceFactory that is specific to the AWT UI toolkit. Devices created through this factory are initialized with the appropriate AWT event listeners.

Version:
$Revision: 1.7 $
Author:
Rex Melton

Field Summary
 
Fields inherited from class org.xj3d.core.eventmodel.DeviceFactory
canvas, errorReporter, rendererID, surface, toolkitID
 
Constructor Summary
AWTDeviceFactory(java.lang.Object canvas, java.lang.String rendererID, java.lang.Object surface, ErrorReporter reporter)
          Constructor.
 
Method Summary
 DeviceManager[] getDeviceManagers()
          Return the array of DeviceManagers that are available per the constructor parameters.
 KeySensorDevice getKeySensorDevice()
          Return the KeySensorDevice associated with the rendering surface initialized with the AWT key event listener.
 
Methods inherited from class org.xj3d.core.eventmodel.DeviceFactory
createDevices, setErrorReporter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTDeviceFactory

public AWTDeviceFactory(java.lang.Object canvas,
                        java.lang.String rendererID,
                        java.lang.Object surface,
                        ErrorReporter reporter)
Constructor.

Parameters:
canvas - - The Object representing the ui toolkit specific graphical component. Must be an instance of java.awt.Component.
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 java.awt.Component.
Method Detail

getDeviceManagers

public DeviceManager[] getDeviceManagers()
Return the array of DeviceManagers that are available per the constructor parameters. The InputDevices instantiated will be initialized with the AWT 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 AWT key event listener.

Specified by:
getKeySensorDevice in class DeviceFactory
Returns:
the KeySensorDevice

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium