Class BaseMetadataObjectNode
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.BaseMetadataObjectNode
- All Implemented Interfaces:
VRMLNode,FrameStateListener,VRMLMetadataObjectNodeType,VRMLNodeType
- Direct Known Subclasses:
BaseMetadataBoolean,BaseMetadataDouble,BaseMetadataFloat,BaseMetadataInteger,BaseMetadataSet,BaseMetadataString
public abstract class BaseMetadataObjectNode
extends AbstractNode
implements VRMLMetadataObjectNodeType
An abstract implementation of any node that uses component nodes to provide
coordinate, normal and texture information.
- Version:
- $Revision: 1.3 $
- Author:
- =Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intIndex of the name fieldprotected static final intIndex of the reference fieldprotected static final intThe last field index used by this classprotected StringexposedField SFString name ""protected StringexposedField SFString reference ""Fields 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
ConstructorsModifierConstructorDescriptionprotectedBaseMetadataObjectNode(String name) Construct a default instance of this class with the bind flag set to false and no time information set (effective value of zero). -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCopy the values of the metadata node into this node.getFieldValue(int index) Get the value of a field.getName()Get the currently set name associated with this metadata object.intGet the primary type of this node.Get the currently set reference associated with this metadata object.voidsendRoute(double time, int srcIndex, VRMLNodeType destNode, int destIndex) Send a routed value from this node to the given destination node.voidSet the name value for the metadata object.voidsetReference(String reference) Set the reference value for the metadata object.voidSet the value of the field at the given index as an array of strings.Methods 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, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setupFinished, setUserData, setValue, 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.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields
-
Field Details
-
FIELD_NAME
protected static final int FIELD_NAMEIndex of the name field- See Also:
-
FIELD_REFERENCE
protected static final int FIELD_REFERENCEIndex of the reference field- See Also:
-
LAST_METADATA_INDEX
protected static final int LAST_METADATA_INDEXThe last field index used by this class- See Also:
-
vfName
exposedField SFString name "" -
vfReference
exposedField SFString reference ""
-
-
Constructor Details
-
BaseMetadataObjectNode
Construct a default instance of this class with the bind flag set to false and no time information set (effective value of zero).- Parameters:
name- The name of the type of node
-
-
Method Details
-
copy
Copy the values of the metadata node into this node.- Parameters:
node- The node to copy details from
-
getName
Get the currently set name associated with this metadata object. If none is set, this returns null.- Specified by:
getNamein interfaceVRMLMetadataObjectNodeType- Returns:
- The current name
-
setName
Set the name value for the metadata object. Use null to clear the currently set name.- Specified by:
setNamein interfaceVRMLMetadataObjectNodeType- Parameters:
name- The name to use
-
getReference
Get the currently set reference associated with this metadata object. If none is set, this returns null.- Specified by:
getReferencein interfaceVRMLMetadataObjectNodeType- Returns:
- The current reference
-
setReference
Set the reference value for the metadata object. Use null to clear the currently set reference.- Specified by:
setReferencein interfaceVRMLMetadataObjectNodeType- Parameters:
reference- The reference to use
-
getPrimaryType
public int getPrimaryType()Get the primary type of this node. Replaces the instanceof mechanism for use in switch statements.- Specified by:
getPrimaryTypein interfaceVRMLNode- Returns:
- The primary type
-
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
-
sendRoute
Send a routed value from this node to the given destination node. The route should use the appropriate setValue() method of the destination node. It should not attempt to cast the node up to a higher level. Routing should also follow the standard rules for the loop breaking and other appropriate rules for the specification.- Specified by:
sendRoutein interfaceVRMLNodeType- Overrides:
sendRoutein classAbstractNode- Parameters:
time- The time that this route occurred (not necessarily epoch time. Should be treated as a relative value only)srcIndex- The index of the field in this node that the value should be sent fromdestNode- The node reference that we will be sending the value todestIndex- The index of the field in the destination node that the value should be sent to.
-
setValue
public void setValue(int index, String value) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of strings. This would be used to set SFString field types.- 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
-