Class BaseTimeControlledNode
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseTimeDependentNode
org.web3d.vrml.renderer.common.nodes.BaseTimeControlledNode
- All Implemented Interfaces:
VRMLNode,FrameStateListener,VRMLChildNodeType,VRMLNodeType,VRMLTimeControlledNodeType,VRMLTimeDependentNodeType,VRMLWorldRootChildNodeType
- Direct Known Subclasses:
BaseAudioClip,BaseMovieTexture,BaseTimeSensor
public abstract class BaseTimeControlledNode
extends BaseTimeDependentNode
implements VRMLTimeControlledNodeType
An abstract representation of any form of time dependent node for
subclassing by specific implementations.
The implementation performs the basic handling of the time fields but does not create any data structures for them to run with.
- Version:
- $Revision: 1.8 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intThe field index for elapsedTimeprotected static final intThe field index for Loopprotected static final intThe field index for pauseTimeprotected static final intThe field index for resumeTimeprotected static final intThe field index for startTimeprotected static final intThe field index for stopTimeprotected static final intThe last field index used by this classprotected doubleThe value of the pauseTime fieldprotected booleanThe value of the loop fieldprotected doubleThe value of the pauseTime fieldprotected doubleThe value of the resumeTime fieldprotected doubleThe value of the startTime fieldprotected doubleThe value of the stopTime fieldFields inherited from class org.web3d.vrml.renderer.common.nodes.BaseTimeDependentNode
vrmlClockFields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseTimeControlledNode(String name) Initialise the time dependent node and it's fields that are held locally. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSet the fields of the time dependent node that has the fields set based on the fields of the passed in node.getFieldValue(int index) Get the value of a field.booleangetLoop()Accessor method to get current value of field loop, default value isfalsedoubleAccessor method to get current value of field startTime, default value is0.doubleAccessor method to get current value of field stopTime, default value is0voidsetLoop(boolean newLoop) Accessor method to set a new value for field attribute loopvoidsetPauseTime(double newPauseTime) Accessor method to set a new value for field attribute pauseTimevoidsetResumeTime(double newResumeTime) Accessor method to set a new value for field attribute resumeTimevoidsetStartTime(double newStartTime) Accessor method to set a new value for field attribute startTimevoidsetStopTime(double newStopTime) Accessor method to set a new value for field attribute stopTimevoidsetValue(int index, boolean value) Set the value of the field at the given index as a boolean.voidsetValue(int index, double value) Set the value of the field at the given index as a double for the SFTime fields.Methods inherited from class org.web3d.vrml.renderer.common.nodes.BaseTimeDependentNode
setVRMLClockMethods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getSecondaryType, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setupFinished, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsCompleteMethods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersionMethods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCountMethods inherited from interface org.web3d.vrml.nodes.VRMLTimeDependentNodeType
setVRMLClock
-
Field Details
-
FIELD_LOOP
protected static final int FIELD_LOOPThe field index for Loop- See Also:
-
FIELD_START_TIME
protected static final int FIELD_START_TIMEThe field index for startTime- See Also:
-
FIELD_STOP_TIME
protected static final int FIELD_STOP_TIMEThe field index for stopTime- See Also:
-
FIELD_PAUSE_TIME
protected static final int FIELD_PAUSE_TIMEThe field index for pauseTime- See Also:
-
FIELD_RESUME_TIME
protected static final int FIELD_RESUME_TIMEThe field index for resumeTime- See Also:
-
FIELD_ELAPSED_TIME
protected static final int FIELD_ELAPSED_TIMEThe field index for elapsedTime- See Also:
-
LAST_TIME_INDEX
protected static final int LAST_TIME_INDEXThe last field index used by this class- See Also:
-
vfLoop
protected boolean vfLoopThe value of the loop field -
vfStartTime
protected double vfStartTimeThe value of the startTime field -
vfStopTime
protected double vfStopTimeThe value of the stopTime field -
vfPauseTime
protected double vfPauseTimeThe value of the pauseTime field -
vfResumeTime
protected double vfResumeTimeThe value of the resumeTime field -
vfElapsedTime
protected double vfElapsedTimeThe value of the pauseTime field
-
-
Constructor Details
-
BaseTimeControlledNode
Initialise the time dependent node and it's fields that are held locally.- Parameters:
name- The name of the type of node
-
-
Method Details
-
copy
Set the fields of the time dependent node that has the fields set based on the fields of the passed in node. This will not copy any children nodes, only the local fields.- Parameters:
node- The grouping node to copy info from
-
setLoop
public void setLoop(boolean newLoop) Accessor method to set a new value for field attribute loop- Specified by:
setLoopin interfaceVRMLTimeControlledNodeType- Parameters:
newLoop- Whether this field loops or not
-
getLoop
public boolean getLoop()Accessor method to get current value of field loop, default value isfalse- Specified by:
getLoopin interfaceVRMLTimeControlledNodeType- Returns:
- The value of the loop field
-
setStartTime
public void setStartTime(double newStartTime) Accessor method to set a new value for field attribute startTime- Specified by:
setStartTimein interfaceVRMLTimeControlledNodeType- Parameters:
newStartTime- The new start time
-
setPauseTime
public void setPauseTime(double newPauseTime) Accessor method to set a new value for field attribute pauseTime- Parameters:
newPauseTime- The new start time
-
setResumeTime
public void setResumeTime(double newResumeTime) Accessor method to set a new value for field attribute resumeTime- Parameters:
newResumeTime- The new start time
-
getStartTime
public double getStartTime()Accessor method to get current value of field startTime, default value is0.- Specified by:
getStartTimein interfaceVRMLTimeControlledNodeType- Returns:
- The current startTime
-
setStopTime
public void setStopTime(double newStopTime) Accessor method to set a new value for field attribute stopTime- Specified by:
setStopTimein interfaceVRMLTimeControlledNodeType- Parameters:
newStopTime- The new stop time
-
getStopTime
public double getStopTime()Accessor method to get current value of field stopTime, default value is0- Specified by:
getStopTimein interfaceVRMLTimeControlledNodeType- Returns:
- The current stop Time
-
getFieldValue
Get the value of a field. If the field is a primitive type, it will return a class representing the value. For arrays or nodes it will return the instance directly.- Specified by:
getFieldValuein interfaceVRMLNodeType- Overrides:
getFieldValuein classAbstractNode- Parameters:
index- The index of the field to change.- Returns:
- The class representing the field value
- Throws:
InvalidFieldException- The field index is not known
-
setValue
public void setValue(int index, double value) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as a double for the SFTime fields. The fields affected by this cycleTime, cycleInterval, startTime, stopTime, fraction and time fields. This method does not currently check for negative values. Should it?- Specified by:
setValuein interfaceVRMLNodeType- Overrides:
setValuein classAbstractNode- Parameters:
index- The index of destination field to setvalue- The new value to use for the node- Throws:
InvalidFieldException- The field index is not knownInvalidFieldValueException- The value provided is not in range or not appropriate for this field
-
setValue
public void setValue(int index, boolean value) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as a boolean. This is be used to set SFBool field types isActive, enabled and loop.- Specified by:
setValuein interfaceVRMLNodeType- Overrides:
setValuein classAbstractNode- Parameters:
index- The index of destination field to setvalue- The new value to use for the node- Throws:
InvalidFieldException- The field index is not knownInvalidFieldValueException- The value provided is not in range or not appropriate for this field
-