Package org.web3d.vrml.nodes
Interface VRMLProtoDeclare
- All Superinterfaces:
VRMLNodeTemplate
- All Known Implementing Classes:
PrototypeDecl
Prototype declaration within a file.
- Version:
- $Revision: 1.9 $
- Author:
- Alan Hudson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFieldNodeValue
(int index, VRMLNodeType node) Used to set the field value where the field represents a SFNode or MFNode.Get the grouping node that represents the body of the proto.getFieldValue
(int index) Get the value of a field.Get the set of the current route declarations that are available for this definitions.void
setValue
(int index, boolean value) Set the value of the field at the given index as an boolean.void
setValue
(int index, boolean[] value, int numValid) Set the value of the field at the given index as an array of boolean.void
setValue
(int index, double value) Set the value of the field at the given index as an double.void
setValue
(int index, double[] value, int numValid) Set the value of the field at the given index as an array of doubles.void
setValue
(int index, float value) Set the value of the field at the given index as a float.void
setValue
(int index, float[] value, int numValid) Set the value of the field at the given index as an array of floats.void
setValue
(int index, int value) Set the value of the field at the given index as an integer.void
setValue
(int index, int[] value, int numValid) Set the value of the field at the given index as an array of integers.void
setValue
(int index, long value) Set the value of the field at the given index as an long.void
setValue
(int index, long[] value, int numValid) Set the value of the field at the given index as an array of longs.void
Set the value of the field at the given index as a string.void
Set the value of the field at the given index as an array of strings.Methods inherited from interface org.web3d.vrml.lang.VRMLNodeTemplate
appendField, createNewInstance, deleteField, deleteField, getAllFields, getFieldCount, getFieldDeclaration, getFieldIndex, getNumFields, getPrimaryType, getVRMLNodeName, setErrorReporter
-
Method Details
-
getBodyGroup
VRMLGroupingNodeType getBodyGroup()Get the grouping node that represents the body of the proto. This is implicitly created by the proto but does not represent the abstract type of the proto that would allow it to be used in a scene graph.- Returns:
- A grouping node suitable for adding content to during parsing
-
getRouteDecls
-
getFieldValue
Get the value of a field. The return value will either be a String or String[] representing the raw value of the field. The prototype declaration does not bother attempting to parse and validate the field values, so we only deal with raw items here.- 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
Set the value of the field at the given index as an integer. This would be used to set SFInt32 field types.- 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
void setValue(int index, int[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of integers. This would be used to set MFInt32 field types.- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-
setValue
Set the value of the field at the given index as an boolean. This would be used to set SFBool field types.- 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
void setValue(int index, boolean[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of boolean. This would be used to set MFBool field types.- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-
setValue
Set the value of the field at the given index as a float. This would be used to set SFFloat field types.- 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
void setValue(int index, float[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of floats. This would be used to set MFFloat, SFVec2f, SFVec3f and SFRotation field types.- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-
setValue
Set the value of the field at the given index as an long. This would be used to set SFTime field types.- 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
void setValue(int index, long[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of longs. This would be used to set MFTime field types.- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-
setValue
Set the value of the field at the given index as an double. This would be used to set SFDouble field types.- 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
void setValue(int index, double[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of doubles. This would be used to set MFDouble, SFVec2d and SFVec3d field types.- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-
setValue
Set the value of the field at the given index as a string. This would be used to set SFString field types.- 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
void setValue(int index, String[] value, int numValid) throws InvalidFieldException, InvalidFieldValueException Set the value of the field at the given index as an array of strings. This would be used to set MFString field types.- Parameters:
index
- The index of destination field to setvalue
- The new value to use for the nodenumValid
- The number of valid values to copy from the array- Throws:
InvalidFieldException
- The field index is not knownInvalidFieldValueException
- The value provided is not in range or not appropriate for this field
-
addFieldNodeValue
void addFieldNodeValue(int index, VRMLNodeType node) throws InvalidFieldException, InvalidFieldValueException Used to set the field value where the field represents a SFNode or MFNode. The behavior of this call is dependent on whether the field is single or multiple.- Parameters:
index
- The index of destination field to setnode
- The node to set or add to this field- Throws:
InvalidFieldValueException
- This field does not take a nodeInvalidFieldException
- The field index is not known
-