Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLProtoInstance

All Superinterfaces:
FrameStateListener, VRMLExecutionSpace, VRMLNode, VRMLNodeType
All Known Implementing Classes:
CRProtoInstance, ProtoInstancePlaceHolder

public interface VRMLProtoInstance
extends VRMLNodeType, VRMLExecutionSpace

A instance of a Prototype.

Can be placed anywhere a regular VRML node can. This representation allows access at the root node that is the first of the proto.

This proto may represent a prototype that comes from an external source. It is possible that when the implementation asks for a node it may still be loading it's contents. In this case, the value returned is null. It is an open question as to how we deal with notification that the node content has been loaded.

Version:
$Revision: 1.9 $
Author:
Alan Hudson, Justin Couch

Method Summary
 java.util.List getAllFields()
          Make a listing of all fields that are currently registered in this node.
 VRMLNodeType[] getBodyNodes()
          Get the list of all the body nodes in this proto instance.
 int getFieldCount()
          Get the count of the number of fields currently registered.
 VRMLNodeType getImplementationNode()
          Get the first node declared in the proto as that defines just how we we can add this into the scenegraph.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, 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, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 
Methods inherited from interface org.web3d.vrml.lang.VRMLExecutionSpace
getContainedScene
 

Method Detail

getFieldCount

int getFieldCount()
Get the count of the number of fields currently registered.

Returns:
The number of fields available

getAllFields

java.util.List getAllFields()
Make a listing of all fields that are currently registered in this node. The list contains instances of VRMLFieldDeclaration.

Returns:
A list of the current field declarations

getImplementationNode

VRMLNodeType getImplementationNode()
Get the first node declared in the proto as that defines just how we we can add this into the scenegraph. If this is an empty prototype implementation, or represents an Extern proto that has not been loaded yet then this will return null.

Returns:
The node instance that represents the first node

getBodyNodes

VRMLNodeType[] getBodyNodes()
Get the list of all the body nodes in this proto instance. Nodes are defined in declaration order. Index 0 is always the same value as that returned by getImplementationNode(). This should be called sparingly. It is really only of use to something that needs to traverse the entire scene graph or for scripting to provide access to the root of the scene.

Returns:
The list of nodes from the body

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium