javax.media.j3d
Class InputDeviceScheduler

java.lang.Object
  extended by java.lang.Thread
      extended by javax.media.j3d.J3dThread
          extended by javax.media.j3d.InputDeviceScheduler
All Implemented Interfaces:
java.lang.Runnable

 class InputDeviceScheduler
extends J3dThread

This thread manages all input device scheduling. It monitors and caches all device additions and removals. It spawns new threads for blocking devices, manages all non-blocking drivers itself, and tags the sensors of demand_driven devices. This implementation assume that processMode of InputDevice will not change after addInputDevice().


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private)  boolean active
           
(package private)  java.util.ArrayList blockingDevices
           
(package private)  java.util.Vector devices
           
private  int instanceNum
           
(package private)  java.util.ArrayList nonBlockingDevices
           
private static int numInstances
           
(package private)  PhysicalEnvironment physicalEnv
           
(package private) static int samplingTime
           
(package private)  J3dThreadData threadData
           
(package private)  java.util.ArrayList threads
           
 
Fields inherited from class javax.media.j3d.J3dThread
args, BEHAVIOR_SCHEDULER, classification, INPUT_DEVICE_SCHEDULER, lastWaitTimestamp, NOTIFY, NOTIFY_AND_WAIT, referenceTime, RENDER_THREAD, RUN, SOUND_SCHEDULER, STOP, type, UPDATE_BEHAVIOR, UPDATE_GEOMETRY, UPDATE_RENDER, UPDATE_RENDERING_ATTRIBUTES, UPDATE_RENDERING_ENVIRONMENT, UPDATE_SOUND, UPDATE_THREAD, UPDATE_TRANSFORM, userStop, WAIT, WORK_THREAD
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
InputDeviceScheduler(java.lang.ThreadGroup threadGroup, PhysicalEnvironment physicalEnv)
           
 
Method Summary
(package private)  void activate()
           
(package private)  void addInputDevice(InputDevice device)
           
(package private)  void deactivate()
           
(package private)  void doWork(long referenceTime)
          This method is defined by all slave threads to implement one iteration of work.
(package private)  int getInstanceNum()
           
(package private)  J3dThreadData getThreadData()
           
private  int newInstanceNum()
           
(package private)  void removeInputDevice(InputDevice device)
           
(package private)  void shutdown()
           
 
Methods inherited from class javax.media.j3d.J3dThread
cleanup, cleanupView, finish, getThreadData, initialize, run, runMonitor
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nonBlockingDevices

java.util.ArrayList nonBlockingDevices

blockingDevices

java.util.ArrayList blockingDevices

threads

java.util.ArrayList threads

physicalEnv

PhysicalEnvironment physicalEnv

devices

java.util.Vector devices

threadData

J3dThreadData threadData

active

boolean active

samplingTime

static int samplingTime

numInstances

private static int numInstances

instanceNum

private int instanceNum
Constructor Detail

InputDeviceScheduler

InputDeviceScheduler(java.lang.ThreadGroup threadGroup,
                     PhysicalEnvironment physicalEnv)
Method Detail

newInstanceNum

private int newInstanceNum()

getInstanceNum

int getInstanceNum()
Overrides:
getInstanceNum in class J3dThread

addInputDevice

void addInputDevice(InputDevice device)

removeInputDevice

void removeInputDevice(InputDevice device)

activate

void activate()

deactivate

void deactivate()

getThreadData

J3dThreadData getThreadData()

doWork

void doWork(long referenceTime)
Description copied from class: J3dThread
This method is defined by all slave threads to implement one iteration of work.

Specified by:
doWork in class J3dThread

shutdown

void shutdown()
Overrides:
shutdown in class J3dThread


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.