Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.renderer
Class TimeScheduler

java.lang.Object
  extended by org.web3d.vrml.renderer.TimeScheduler
All Implemented Interfaces:
VRMLClock

public class TimeScheduler
extends java.lang.Object
implements VRMLClock

A default time scheduler that deals with all time information within a given scene.

Currently a stubbed implementation that does no work.

Version:
$Revision: 1.3 $
Author:
Alan Hudson

Constructor Summary
TimeScheduler()
          Create a new time scheduler behaviour
 
Method Summary
 void addTimeListener(VRMLTimeListener l)
          Add a time listener to this clock.
 double getTime()
          Request the current time from the system clock.
 long getWallTime()
          Request the time in wall-clock coordinates.
 void initialize()
          Initialise the behavior to start running.
 void processStimulus(java.util.Enumeration why)
          Process the event that builds the current time.
 void removeTimeListener(VRMLTimeListener l)
          Remove a time listener to this clock.
 void resetTimeZero()
          Reset the clock to the current time as time zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeScheduler

public TimeScheduler()
Create a new time scheduler behaviour

Method Detail

initialize

public void initialize()
Initialise the behavior to start running. This will register the first criteria. Don't wake until we have arrived in the activation area of the viewpoint and then run every frame.


processStimulus

public void processStimulus(java.util.Enumeration why)
Process the event that builds the current time.

Parameters:
why - The list of conditions why this was woken

getTime

public double getTime()
Request the current time from the system clock. The time returned is the VRML scene time.

Specified by:
getTime in interface VRMLClock
Returns:
The current time in VRML coodinates

getWallTime

public long getWallTime()
Request the time in wall-clock coordinates. This is standard Unix epoch time.

Specified by:
getWallTime in interface VRMLClock
Returns:
The current wall-clock time

resetTimeZero

public void resetTimeZero()
Reset the clock to the current time as time zero. This can only be called when the timer is not enabled. The last wall clock time is set to now so that fraction information will be correctly oriented for the next time it is enabled. So, ideally it should be called just before setEnabled to get the right time setups working.

Specified by:
resetTimeZero in interface VRMLClock

addTimeListener

public void addTimeListener(VRMLTimeListener l)
Add a time listener to this clock. Only one instance of each listener will be registered and null references are ignored.

Specified by:
addTimeListener in interface VRMLClock
Parameters:
l - The listener instance to add

removeTimeListener

public void removeTimeListener(VRMLTimeListener l)
Remove a time listener to this clock. If the listener is not known to this implementation, it is silently ignored.

Specified by:
removeTimeListener in interface VRMLClock
Parameters:
l - The listener instance to add

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium