Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.sav
Interface ProtoHandler

All Known Subinterfaces:
SceneBuilder
All Known Implementing Classes:
BaseRetainedExporter, BinaryExporter, CRExternProtoBuilder, CRMainSceneBuilder, Exporter, NRExternProtoBuilder, NRVRMLSceneBuilder, NullExporter, OGLExternProtoBuilder, OGLVRMLSceneBuilder, ProtoBuilder, StatisticsCollector, X3DBinaryRetainedDirectExporter, X3DBinaryRetainedExporter, X3DClassicExporter, X3DClassicRetainedExporter, X3DRetainedSAXExporter, X3DXMLExporter, X3DXMLRetainedExporter

public interface ProtoHandler

Receiver of notifications from the VRML document about proto declaration information.

A proto handler deals with proto specific information. During the body of the proto the normal content handler methods are called, except when a field value uses IS.

Version:
$Revision: 1.7 $
Author:
Justin Couch

Method Summary
 void endExternProtoDecl()
          Notification of the end of an EXTERNPROTO declaration.
 void endProtoBody()
          Notification of the end of an ordinary proto body.
 void endProtoDecl()
          Notification of the end of an ordinary proto declaration statement.
 void externProtoURI(java.lang.String[] values)
          Notification of the URI list for an EXTERNPROTO.
 void protoFieldDecl(int access, java.lang.String type, java.lang.String name, java.lang.Object value)
          Notification of a proto's field declaration.
 void protoIsDecl(java.lang.String fieldName)
          Notification of a field value uses an IS statement.
 void startExternProtoDecl(java.lang.String name)
          Notification of the start of an EXTERNPROTO declaration of the given name.
 void startProtoBody()
          Notification of the start of an ordinary proto body.
 void startProtoDecl(java.lang.String name)
          Notification of the start of an ordinary (inline) proto declaration.
 

Method Detail

startProtoDecl

void startProtoDecl(java.lang.String name)
                    throws SAVException,
                           VRMLException
Notification of the start of an ordinary (inline) proto declaration. The proto has the given node name.

Parameters:
name - The name of the proto
Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

endProtoDecl

void endProtoDecl()
                  throws SAVException,
                         VRMLException
Notification of the end of an ordinary proto declaration statement. This is called just after the closing bracket of the declaration and before the opening of the body statement. If the next thing called is not a startProtoBody() Then that method should toss an exception.

Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

protoFieldDecl

void protoFieldDecl(int access,
                    java.lang.String type,
                    java.lang.String name,
                    java.lang.Object value)
                    throws SAVException,
                           VRMLException
Notification of a proto's field declaration. This is used for both external and ordinary protos. Externprotos don't allow the declaration of a value for the field. In this case, the parameter value will be null.

Parameters:
access - The access type (eg exposedField, field etc)
type - The field type (eg SFInt32, MFVec3d etc)
name - The name of the field
value - The default value of the field as either String or String[]. Null if not allowed.
Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

protoIsDecl

void protoIsDecl(java.lang.String fieldName)
                 throws SAVException,
                        VRMLException
Notification of a field value uses an IS statement.

Parameters:
fieldName - The name of the field that is being IS'd
Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

startProtoBody

void startProtoBody()
                    throws SAVException,
                           VRMLException
Notification of the start of an ordinary proto body. All nodes contained between here and the corresponding endProtoBody() statement form the body and not the normal scenegraph information.

Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

endProtoBody

void endProtoBody()
                  throws SAVException,
                         VRMLException
Notification of the end of an ordinary proto body. Parsing now returns to ordinary node declarations.

Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

startExternProtoDecl

void startExternProtoDecl(java.lang.String name)
                          throws SAVException,
                                 VRMLException
Notification of the start of an EXTERNPROTO declaration of the given name. Between here and the matching endExternProtoDecl() call you should only receive protoFieldDecl(int, java.lang.String, java.lang.String, java.lang.Object) calls.

Parameters:
name - The node name of the extern proto
Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

endExternProtoDecl

void endExternProtoDecl()
                        throws SAVException,
                               VRMLException
Notification of the end of an EXTERNPROTO declaration. This is called just after the closing bracket of the declaration and before the opening of the body statement. If the next thing called is not a externProtoURI(java.lang.String[]) Then that method should toss an exception.

Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

externProtoURI

void externProtoURI(java.lang.String[] values)
                    throws SAVException,
                           VRMLException
Notification of the URI list for an EXTERNPROTO. This is a complete list as an array of URI strings. The calling application is required to interpet the incoming string. Even if the externproto has no URIs registered, this method shall be called. If there are none available, this will be called with a zero length list of values.

Parameters:
values - A list of strings representing all of the URI values
Throws:
SAVException - This call is taken at the wrong time in the structure of the document.
VRMLException - This call is taken at the wrong time in the structure of the document.

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium