Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLProtoDeclare

All Superinterfaces:
VRMLNodeTemplate
All Known Implementing Classes:
PrototypeDecl

public interface VRMLProtoDeclare
extends VRMLNodeTemplate

Prototype declaration within a file.

Version:
$Revision: 1.9 $
Author:
Alan Hudson
See Also:
VRMLExternProtoDeclare, VRMLProtoInstance

Method Summary
 void addFieldNodeValue(int index, VRMLNodeType node)
          Used to set the field value where the field represents a SFNode or MFNode.
 VRMLGroupingNodeType getBodyGroup()
          Get the grouping node that represents the body of the proto.
 VRMLFieldData getFieldValue(int index)
          Get the value of a field.
 java.util.Set getRouteDecls()
          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 setValue(int index, java.lang.String value)
          Set the value of the field at the given index as a string.
 void setValue(int index, java.lang.String[] value, int numValid)
          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 Detail

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 scenegraph.

Returns:
A grouping node suitable for adding content to during parsing

getRouteDecls

java.util.Set getRouteDecls()
Get the set of the current route declarations that are available for this definitions.

Returns:
The set of ROUTEs registered

getFieldValue

VRMLFieldData getFieldValue(int index)
                            throws InvalidFieldException
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

void setValue(int index,
              int value)
              throws InvalidFieldException,
                     InvalidFieldValueException
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 set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - 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 set
value - The new value to use for the node
numValid - The number of valid values to copy from the array
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is not in range or not appropriate for this field

setValue

void setValue(int index,
              boolean value)
              throws InvalidFieldException,
                     InvalidFieldValueException
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 set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - 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 set
value - The new value to use for the node
numValid - The number of valid values to copy from the array
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is not in range or not appropriate for this field

setValue

void setValue(int index,
              float value)
              throws InvalidFieldException,
                     InvalidFieldValueException
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 set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - 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 set
value - The new value to use for the node
numValid - The number of valid values to copy from the array
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is not in range or not appropriate for this field

setValue

void setValue(int index,
              long value)
              throws InvalidFieldException,
                     InvalidFieldValueException
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 set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - 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 set
value - The new value to use for the node
numValid - The number of valid values to copy from the array
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is not in range or not appropriate for this field

setValue

void setValue(int index,
              double value)
              throws InvalidFieldException,
                     InvalidFieldValueException
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 set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - 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 set
value - The new value to use for the node
numValid - The number of valid values to copy from the array
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is not in range or not appropriate for this field

setValue

void setValue(int index,
              java.lang.String value)
              throws InvalidFieldException,
                     InvalidFieldValueException
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 set
value - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is not in range or not appropriate for this field

setValue

void setValue(int index,
              java.lang.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 set
value - The new value to use for the node
numValid - The number of valid values to copy from the array
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - 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 set
node - The node to set or add to this field
Throws:
InvalidFieldValueException - This field does not take a node
InvalidFieldException - The field index is not known

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium