|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Denotes a node which allows it's fields to be defined in code - namely scripts and protos.
This interface allows a node to add and remove nodes from it's definition. The interface compliments an ordinary node type. The normal nodes will allow you to set the values of a field, this allows you to change their definition rather than set or query the values.
Due to the assumptions of the event model implementation of using index to name a given field. Deleting a field just removes it from the index. An index value cannot be reused by placing another field at that position. Adding fields appends them to the list. If an API to this allows the insertion of nodes then it must layer that capability over this node keeping track of logical versus actual index lists.
| Method Summary | |
int |
appendField(VRMLFieldDeclaration field)
Append a field declaration to this node. |
VRMLNode |
createNewInstance(VRMLNode root,
boolean isStatic)
Create a new instance of a real node from this template. |
void |
deleteField(int index)
Delete the field at the given index. |
void |
deleteField(VRMLFieldDeclaration field)
Delete the named field. |
java.util.List |
getAllFields()
Make a listing of all fields that are currently registered in this node. |
int |
getFieldCount()
Get the count of the number of fields currently registered. |
VRMLFieldDeclaration |
getFieldDeclaration(int index)
Get the declaration of the field at the given index. |
int |
getFieldIndex(java.lang.String fieldName)
Get the index of the given field name. |
int |
getNumFields()
Get the number of fields defined for this node. |
int |
getPrimaryType()
Get the primary type of this node. |
java.lang.String |
getVRMLNodeName()
Get the name of this node as a string. |
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. |
| Method Detail |
public void setErrorReporter(ErrorReporter reporter)
reporter - The instance to use or null
public VRMLNode createNewInstance(VRMLNode root,
boolean isStatic)
throws InvalidNodeTypeException
root - The node that represents the root node of the
VRMLExecutionSpace that we're in.isStatic - true if this is created within a StaticGroup
InvalidNodeTypeException - The root node is not a node capable
of representing a root of a scene graphVRMLProtoInstance,
VRMLWorldRootNodeTypepublic java.lang.String getVRMLNodeName()
public int getPrimaryType()
public int getFieldIndex(java.lang.String fieldName)
fieldName - The name of the field we want the index from
public int getNumFields()
public VRMLFieldDeclaration getFieldDeclaration(int index)
index - The index of the field to get information
public int getFieldCount()
public java.util.List getAllFields()
VRMLFieldDeclaration.
public int appendField(VRMLFieldDeclaration field)
throws FieldExistsException,
InvalidFieldException
field - The new field to add
FieldExistsException - A conflicting field of the same name
already exists for this node
InvalidFieldException - The field type is not valid for this
specification version.
public void deleteField(int index)
throws InvalidFieldException,
java.lang.ArrayIndexOutOfBoundsException
index - The index of the field to delete
InvalidFieldException - The field does not exist at the index
java.lang.ArrayIndexOutOfBoundsException - The index provided is out of
range for the current field numbers
public void deleteField(VRMLFieldDeclaration field)
throws InvalidFieldException,
java.lang.ArrayIndexOutOfBoundsException
field - The field to delete
InvalidFieldException - The named field does not exist
java.lang.ArrayIndexOutOfBoundsException - The index provided is out of
range for the current field numbers
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||