Xj3D VRML/X3D Code API

org.web3d.vrml.renderer.common.nodes
Class AbstractNode

java.lang.Object
  extended byorg.web3d.vrml.renderer.common.nodes.AbstractNode
All Implemented Interfaces:
FrameStateListener, VRMLNode, VRMLNodeType
Direct Known Subclasses:
BaseBindableNode, BaseComponentGeometryNode, BaseGeometricPropertyNode, BaseGroupingNode, BaseInterpolatorNode, BaseLightNode, BaseMetadataObjectNode, BaseSensorNode, BaseSequencerNode, BaseTextureNode, BaseTimeDependentNode, J3DNode, NRNode

public abstract class AbstractNode
extends java.lang.Object
implements VRMLNodeType

Base node for all implementations that define their own field handling.

Each node will keep its own fieldDeclarations and fieldMaps. These will be created in a static constructor so only one copy per class will be created.

Each node will maintain its own LAST_*_INDEX which tells others what the last field declared by this node.

Version:
$Revision: 1.24 $
Author:
Justin Couch

Field Summary
protected static java.lang.String BAD_NODE_MSG
          A standard message for when the supplied node is wrong.
protected  ErrorReporter errorReporter
          Reporter instance for handing out errors
static int FIELD_METADATA
          The field index for the metadata node field
protected  VRMLFieldData fieldData
          Scratch class var for returning field data.
protected  boolean[] hasChanged
          hasChanged flags for fields
protected static java.lang.String INIT_ONLY_WRITE_MSG
          Standard message for when the user is attempting to set a value for an initializeOnly field (field access field in VRML97 terms) after the setup process is complete.
protected  boolean inSetup
          Is this node still being setup/parsed.
protected  boolean isDEF
          Flag indicating this is a DEF node
protected  boolean isStatic
          Flag for the node being static
static int LAST_NODE_INDEX
          The last field index used by this class
protected static java.lang.String METADATA_NODE_MSG
          Message for when the node in setValue() is not a Metadata
protected static java.lang.String METADATA_PROTO_MSG
          Message for when the proto is not a Metadata
protected  java.lang.String nodeName
          The name of this node
protected  VRMLProtoInstance pMetadata
          proto representation of the metadata node
protected  int refCount
          The current number of references to this node.
protected  FrameStateManager stateManager
          State manager for propogating updates
protected  VRMLNodeType vfMetadata
          SFNode metadata NULL
protected  int vrmlMajorVersion
          The major version of the spec this instance belongs to.
protected  int vrmlMinorVersion
          The minor version of the spec this instance belongs to.
 
Constructor Summary
AbstractNode(java.lang.String name)
          Create a new instance of this node with the given node type name.
 
Method Summary
 void addNodeListener(VRMLNodeListener l)
          Add a listener to this node instance.
 void allEventsComplete()
          Ignored by this base implementation.
protected  void checkNodeType(VRMLNodeType node)
          Check to see if the supplied node type is the same as this node.
protected static void checkSecondaryType(VRMLNodeType instance, int[] type, java.lang.String msg)
          Verify that one of a protoInstance's secondary type is one of the supplied types.
protected static void checkSecondaryType(VRMLNodeType instance, int type, java.lang.String msg)
          Verify that one of a protoInstance's secondary type is the supplied type.
protected  void fireFieldChanged(int index)
          Send a notification to the registered listeners that a field has been changed.
 VRMLFieldData getFieldValue(int index)
          Get the value of a field.
 VRMLNodeType getMetadataObject()
          Get the currently registered metadata object instance.
abstract  int[] getNodeFieldIndices()
          Get the list of indices that correspond to fields that contain nodes ie MFNode and SFNode).
 int getRefCount()
          Ask for the current number of references to this object.
 int[] getSecondaryType()
          Get the secondary types of this node.
 java.lang.Object getUserData(int index)
          Fetch the stored user data for a given field index.
 java.lang.String getVRMLNodeName()
          Get the name of this node as a string.
 boolean hasFieldChanged(int index)
          Check to see if the given field has changed since we last checked.
 boolean isDEF()
          Check to see if this node has been DEFd.
 boolean isSetupFinished()
          Check to see if setupFinished() has already been called on this node.
 void notifyExternProtoLoaded(int index, VRMLNodeType node)
          Notify a node that an ExternProto has resolved.
 void removeNodeListener(VRMLNodeListener l)
          Remove a listener from this node instance.
 void sendRoute(double time, int srcIndex, VRMLNodeType destNode, int destIndex)
          Send a routed value from this node to the given destination node.
 void setDEF()
          Notify this node that is has been DEFd.
 void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion.
 void setFrameStateManager(FrameStateManager mgr)
          Ignored by this implementation.
 void setMetadataObject(VRMLNodeType data)
          Set the X3DMetadataObject that is associated with this node.
 void setupFinished()
          Notification that the construction phase of this node has finished.
 void setUserData(int index, java.lang.Object data)
          Set arbitrary data for a given field.
 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.
 void setValue(int index, VRMLNodeType child)
          Set the value of the field at the given index as a node.
 void setValue(int index, VRMLNodeType[] children, int numValid)
          Set the value of the field at the given index as an array of nodes.
 void setVersion(int major, int minor, boolean isStatic)
          Set the version of VRML that this node should represent.
 int updateRefCount(boolean add)
          Change the reference count up or down by one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNumFields, getPrimaryType
 

Field Detail

FIELD_METADATA

public static final int FIELD_METADATA
The field index for the metadata node field

See Also:
Constant Field Values

LAST_NODE_INDEX

public static final int LAST_NODE_INDEX
The last field index used by this class

See Also:
Constant Field Values

BAD_NODE_MSG

protected static final java.lang.String BAD_NODE_MSG
A standard message for when the supplied node is wrong. Just add the node name of the wrong type to the end.

See Also:
Constant Field Values

INIT_ONLY_WRITE_MSG

protected static final java.lang.String INIT_ONLY_WRITE_MSG
Standard message for when the user is attempting to set a value for an initializeOnly field (field access field in VRML97 terms) after the setup process is complete. The caller should append the name of the field to this message.

See Also:
Constant Field Values

METADATA_PROTO_MSG

protected static final java.lang.String METADATA_PROTO_MSG
Message for when the proto is not a Metadata

See Also:
Constant Field Values

METADATA_NODE_MSG

protected static final java.lang.String METADATA_NODE_MSG
Message for when the node in setValue() is not a Metadata

See Also:
Constant Field Values

nodeName

protected final java.lang.String nodeName
The name of this node


fieldData

protected final VRMLFieldData fieldData
Scratch class var for returning field data. Assigned at construction.


errorReporter

protected ErrorReporter errorReporter
Reporter instance for handing out errors


hasChanged

protected boolean[] hasChanged
hasChanged flags for fields


inSetup

protected boolean inSetup
Is this node still being setup/parsed. Cleared by setupFinished


isDEF

protected boolean isDEF
Flag indicating this is a DEF node


isStatic

protected boolean isStatic
Flag for the node being static


vrmlMajorVersion

protected int vrmlMajorVersion
The major version of the spec this instance belongs to.


vrmlMinorVersion

protected int vrmlMinorVersion
The minor version of the spec this instance belongs to.


stateManager

protected FrameStateManager stateManager
State manager for propogating updates


refCount

protected int refCount
The current number of references to this node. This is for informational purposes only and should never be touched by derived classes.


vfMetadata

protected VRMLNodeType vfMetadata
SFNode metadata NULL


pMetadata

protected VRMLProtoInstance pMetadata
proto representation of the metadata node

Constructor Detail

AbstractNode

public AbstractNode(java.lang.String name)
Create a new instance of this node with the given node type name. inSetup will be set to true and isDEF set to false.

Parameters:
name - The name of the type of node
Method Detail

allEventsComplete

public void allEventsComplete()
Ignored by this base implementation. Any class that needs this method may override this method as required.

Specified by:
allEventsComplete in interface FrameStateListener

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Specified by:
setErrorReporter in interface VRMLNode
Parameters:
reporter - The instance to use or null

getVRMLNodeName

public java.lang.String getVRMLNodeName()
Get the name of this node as a string.

Specified by:
getVRMLNodeName in interface VRMLNode
Returns:
The name of the node

isDEF

public boolean isDEF()
Check to see if this node has been DEFd. Returns true if it has and the user should ask for the shared representation rather than the normal one.

Specified by:
isDEF in interface VRMLNode
Returns:
true if this node has been DEFd

getSecondaryType

public int[] getSecondaryType()
Get the secondary types of this node. Replaces the instanceof mechanism for use in switch statements. If there are no secondary types, it will return a zero-length array.

Specified by:
getSecondaryType in interface VRMLNode
Returns:
The secondary type

setVersion

public void setVersion(int major,
                       int minor,
                       boolean isStatic)
Set the version of VRML that this node should represent. Different versions have different capabilities, even within the same node.

Specified by:
setVersion in interface VRMLNode
Parameters:
major - The major version number of this scene
minor - The minor version number of this scene
isStatic - true if this node is under a static group and won't change after the setup is finished

getNodeFieldIndices

public abstract int[] getNodeFieldIndices()
Get the list of indices that correspond to fields that contain nodes ie MFNode and SFNode). Empty for the default implementation. Any derived class that has node children should override this method with real values.

Specified by:
getNodeFieldIndices in interface VRMLNode
Returns:
null

setUserData

public void setUserData(int index,
                        java.lang.Object data)
                 throws InvalidFieldException
Set arbitrary data for a given field. Provided primarily to help the EAI fullfil its requirements, but may be useful elsewhere.

Specified by:
setUserData in interface VRMLNode
Parameters:
index - The index of destination field to set
data - The item to store for the field
Throws:
InvalidFieldException - The field index is not known

getUserData

public java.lang.Object getUserData(int index)
                             throws InvalidFieldException
Fetch the stored user data for a given field index. If nothing is registered, null is returned.

Specified by:
getUserData in interface VRMLNode
Parameters:
index - The index of destination field to set
Returns:
The item stored for the field or null
Throws:
InvalidFieldException - The field index is not known

setMetadataObject

public void setMetadataObject(VRMLNodeType data)
                       throws InvalidFieldValueException
Set the X3DMetadataObject that is associated with this node.

Specified by:
setMetadataObject in interface VRMLNodeType
Parameters:
data - The node to register as the metadata
Throws:
InvalidFieldValueException - The object instance provided does not implment VRMLMetadataNodeType or is not a proto instance that encapsulates it as it's primary type

getMetadataObject

public VRMLNodeType getMetadataObject()
Get the currently registered metadata object instance. If none is set then return null.

Specified by:
getMetadataObject in interface VRMLNodeType
Returns:
The current metadata object or null

isSetupFinished

public boolean isSetupFinished()
Check to see if setupFinished() has already been called on this node.

Specified by:
isSetupFinished in interface VRMLNodeType
Returns:
true if setupFinished() has been called

setupFinished

public void setupFinished()
Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.

Specified by:
setupFinished in interface VRMLNodeType

setDEF

public void setDEF()
Notify this node that is has been DEFd. This method shall only be called before setupFinished(). It is an error to call it any other time. It is also guaranteed that this call will be made after construction, but before any of the setValue() methods have been called.

Specified by:
setDEF in interface VRMLNodeType
Throws:
java.lang.IllegalStateException - The setup is finished.

getRefCount

public int getRefCount()
Ask for the current number of references to this object.

Specified by:
getRefCount in interface VRMLNodeType
Returns:
The number of references to this node

updateRefCount

public int updateRefCount(boolean add)
Change the reference count up or down by one.

Specified by:
updateRefCount in interface VRMLNodeType
Parameters:
add - true to increment the reference count, false to decrement
Returns:
The new reference count

setFrameStateManager

public void setFrameStateManager(FrameStateManager mgr)
Ignored by this implementation.

Specified by:
setFrameStateManager in interface VRMLNodeType
Parameters:
mgr - The manager instance to use

hasFieldChanged

public boolean hasFieldChanged(int index)
Check to see if the given field has changed since we last checked. Calling this method will set the flag back to "not changed" so that two consective reads after a changed value would result in a true and then false being returned. If the field number is not recognized for this node then this returns false.

Specified by:
hasFieldChanged in interface VRMLNodeType
Parameters:
index - The index of the field to change.
Returns:
true if the field has changed since last read

sendRoute

public void sendRoute(double time,
                      int srcIndex,
                      VRMLNodeType destNode,
                      int destIndex)
Send a routed value from this node to the given destination node. Empty implementation in the base class. Derived classes will need to override this to make route management work.

Specified by:
sendRoute in interface VRMLNodeType
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 from
destNode - The node reference that we will be sending the value to
destIndex - The index of the field in the destination node that the value should be sent to.

addNodeListener

public void addNodeListener(VRMLNodeListener l)
Add a listener to this node instance. If the listener is already added or null the request is silently ignored.

Specified by:
addNodeListener in interface VRMLNodeType
Parameters:
l - The listener instance to add

removeNodeListener

public void removeNodeListener(VRMLNodeListener l)
Remove a listener from this node instance. If the listener is null or not registered, the request is silently ignored.

Specified by:
removeNodeListener in interface VRMLNodeType
Parameters:
l - The listener to be removed

getFieldValue

public VRMLFieldData getFieldValue(int index)
                            throws InvalidFieldException
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:
getFieldValue in interface VRMLNodeType
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,
                     int value)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an integer. This would be used to set SFInt32 field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     int[] value,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an array of integers. This would be used to set MFInt32 field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     boolean value)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an boolean. This would be used to set SFBool field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     boolean[] value,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an array of boolean. This would be used to set MFBool field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     float value)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as a float. This would be used to set SFFloat field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     float[] value,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
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.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     long value)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an long. This would be used to set SFTime field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     long[] value,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an array of longs. This would be used to set MFTime field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     double value)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an double. This would be used to set SFDouble field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     double[] value,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
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.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     java.lang.String value)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as a string. This would be used to set SFString field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     java.lang.String[] value,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an array of strings. This would be used to set MFString field types.

Specified by:
setValue in interface VRMLNodeType
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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     VRMLNodeType child)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as a node. This would be used to set SFNode field types.

Specified by:
setValue in interface VRMLNodeType
Parameters:
index - The index of destination field to set
child - The new value to use for the node
Throws:
InvalidFieldException - The field index is not known
InvalidFieldValueException - The value provided is out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

setValue

public void setValue(int index,
                     VRMLNodeType[] children,
                     int numValid)
              throws InvalidFieldException,
                     InvalidFieldValueException,
                     InvalidFieldAccessException
Set the value of the field at the given index as an array of nodes. This would be used to set MFNode field types.

Specified by:
setValue in interface VRMLNodeType
Parameters:
index - The index of destination field to set
children - 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 out of range for the field type.
InvalidFieldAccessException - The call is attempting to write to a field that does not permit writing now

notifyExternProtoLoaded

public void notifyExternProtoLoaded(int index,
                                    VRMLNodeType node)
                             throws InvalidFieldValueException
Notify a node that an ExternProto has resolved. This will verify the objects type and add it to the render sceneGraph.

Specified by:
notifyExternProtoLoaded in interface VRMLNodeType
Parameters:
index - The field index
node - The node resolved
Throws:
InvalidFieldValueException - If the proto contains he wrong type

fireFieldChanged

protected void fireFieldChanged(int index)
Send a notification to the registered listeners that a field has been changed. If no listeners have been registered, then this does nothing, so always call it regardless.

Parameters:
index - The index of the field that changed

checkNodeType

protected void checkNodeType(VRMLNodeType node)
Check to see if the supplied node type is the same as this node. It does a case sensitive string comparison based on thier node name. If they are not the same then an IllegalArgumentException is thrown. If the same, nothing happens.

Parameters:
node - The node to check
Throws:
java.lang.IllegalArgumentException - The nodes are not the same

checkSecondaryType

protected static void checkSecondaryType(VRMLNodeType instance,
                                         int type,
                                         java.lang.String msg)
Verify that one of a protoInstance's secondary type is the supplied type. This method will throw an InvalidFieldValueException if its not the right type.

Parameters:
instance - The proto instance
type - The type to check for
msg - The error to message for the InvalidFieldValueException thrown
Throws:
InvalidFieldValueException

checkSecondaryType

protected static void checkSecondaryType(VRMLNodeType instance,
                                         int[] type,
                                         java.lang.String msg)
Verify that one of a protoInstance's secondary type is one of the supplied types. This method will throw an InvalidFieldValueException if its not the right type.

Parameters:
instance - The proto instance
type - The types to check for
msg - The error to message for the InvalidFieldValueException thrown
Throws:
InvalidFieldValueException

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium