Class SAIExternProtoDeclaration
java.lang.Object
org.web3d.vrml.scripting.external.sai.SAIExternProtoDeclaration
- All Implemented Interfaces:
X3DExternProtoDeclaration
,X3DProtoDeclaration
Wrapper class for external PROTO declaration data.
-
Constructor Summary
ConstructorsConstructorDescriptionSAIExternProtoDeclaration
(SAINodeFactory factory, VRMLExternProtoDeclare externProto, BasicScene scene) -
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of this proto that may be used at runtime.void
dispose()
Dispose of this node's resources.Get the list of fields that this node contains.int
Check to see if the underlying definition has been loaded yet.int[]
Fetch the type of this proto.Get the type of this node.String[]
getURLs()
Get the URLs used to describe this external prototype.void
loadNow()
Ask the browser to load the definition now.
-
Constructor Details
-
SAIExternProtoDeclaration
public SAIExternProtoDeclaration(SAINodeFactory factory, VRMLExternProtoDeclare externProto, BasicScene scene)
-
-
Method Details
-
getLoadState
public int getLoadState()Description copied from interface:X3DExternProtoDeclaration
Check to see if the underlying definition has been loaded yet. There are 4 load states - not loaded, in-progress, failed and complete. If an externproto is never used in the containing scene then the browser may never even attempt to load it. This is the not-loaded state. A user may force the browser to load the definition through the loadNow() method later on.- Specified by:
getLoadState
in interfaceX3DExternProtoDeclaration
- Returns:
- The current load state
- See Also:
-
loadNow
public void loadNow()Description copied from interface:X3DExternProtoDeclaration
Ask the browser to load the definition now. If the load state is already in progress, failed or completed, then this request will be ignored.- Specified by:
loadNow
in interfaceX3DExternProtoDeclaration
- See Also:
-
getURLs
Description copied from interface:X3DExternProtoDeclaration
Get the URLs used to describe this external prototype. If no URLs are defined in the file, this will return null.- Specified by:
getURLs
in interfaceX3DExternProtoDeclaration
- Returns:
- The URLs used to describe this node's contents
- See Also:
-
getProtoName
Description copied from interface:X3DProtoDeclaration
Get the type of this node. The string returned should be the name of the VRML node or the name of the proto instance this node represents.- Specified by:
getProtoName
in interfaceX3DProtoDeclaration
- Returns:
- The type of this node.
- Throws:
InvalidNodeException
- The node has had it's resources disposed of- See Also:
-
getNodeType
Description copied from interface:X3DProtoDeclaration
Fetch the type of this proto. The proto's type is defined by the first child node in the body, in accordance with the X3D specification.The types values are provided in the array of values. There is no specific order of the returned types. It is expected that most node types, which only descend from a single parent type would return an array of length 1.
- Specified by:
getNodeType
in interfaceX3DProtoDeclaration
- Returns:
- The primary type(s) of this node
- Throws:
InvalidNodeException
- The node has had it's resources disposed of- See Also:
-
getFieldDefinitions
Description copied from interface:X3DProtoDeclaration
Get the list of fields that this node contains. This will return one definition for each field regardless of whether it is eventIn/Out, exposedField or field access type.- Specified by:
getFieldDefinitions
in interfaceX3DProtoDeclaration
- Returns:
- The definitions for all fields of this node
- Throws:
InvalidNodeException
- The node has had it's resources disposed of- See Also:
-
createInstance
Description copied from interface:X3DProtoDeclaration
Create an instance of this proto that may be used at runtime.- Specified by:
createInstance
in interfaceX3DProtoDeclaration
- Returns:
- An instance of this proto to work with
- Throws:
InvalidNodeException
- The node has had it's resources disposed of- See Also:
-
dispose
Description copied from interface:X3DProtoDeclaration
Dispose of this node's resources. This is used to indicate to the browser that the java side of the application does not require the resources represented by this node. The browser is now free to do what it likes with the node.This in no way implies that the browser is to remove this node from the scene graph, only that the java code is no longer interested in this particular node through this reference.
Once this method has been called, any further calls to methods of this instance of the class is shall generate an InvalidNodeException.
- Specified by:
dispose
in interfaceX3DProtoDeclaration
- Throws:
InvalidNodeException
- The node is no longer valid and can't be disposed of again.- See Also:
-