Package org.web3d.vrml.scripting.jsai
Class VRML97ScriptEngine
java.lang.Object
org.web3d.vrml.scripting.jsai.VRML97ScriptEngine
- All Implemented Interfaces:
ScriptEngine
An engine that supports VRML97 Java scripts only.
- Version:
- $Revision: 1.15 $
- Author:
- Justin Couch
-
Constructor Summary
ConstructorsConstructorDescriptionVRML97ScriptEngine
(BrowserCore browser, RouteManager rm, FrameStateManager fsm, WorldLoaderManager wlm) Construct a new script engine with a reference to the enclosing browser. -
Method Summary
Modifier and TypeMethodDescriptionbuildWrapper
(VRMLExecutionSpace space, String contentType, Object content) Create a wrapper for the given script content.String[]
Get a listing of the content types that this engine implementation can handle.int
Get the version of the specification that this engine implementation supports.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the script code can be reported in a nice, pretty fashion.
-
Constructor Details
-
VRML97ScriptEngine
public VRML97ScriptEngine(BrowserCore browser, RouteManager rm, FrameStateManager fsm, WorldLoaderManager wlm) Construct a new script engine with a reference to the enclosing browser.- Parameters:
browser
- The core representation of the browserrm
- A route manager for users creating/removing routesfsm
- State manager for coordinating inter-frame processingwlm
- Loader for full files- Throws:
IllegalArgumentException
- The browser reference is null
-
-
Method Details
-
getSupportedSpecificationVersion
public int getSupportedSpecificationVersion()Get the version of the specification that this engine implementation supports. A script engine only supports a single major version of any given spec.- Specified by:
getSupportedSpecificationVersion
in interfaceScriptEngine
- Returns:
- A number greater than one indicating the supported spec.
-
getSupportedContentTypes
Get a listing of the content types that this engine implementation can handle.- Specified by:
getSupportedContentTypes
in interfaceScriptEngine
- Returns:
- A non-empty list of content types
-
buildWrapper
public ScriptWrapper buildWrapper(VRMLExecutionSpace space, String contentType, Object content) throws InvalidScriptContentException Create a wrapper for the given script content. The wrapper will be built based on the details from the mime type.- Specified by:
buildWrapper
in interfaceScriptEngine
- Parameters:
space
- The execution space this script belongs tocontentType
- The MIME type of the enginecontent
- The actual content loaded from a stream- Returns:
- An appropriate wrapper instance
- Throws:
InvalidScriptContentException
- The form of the content does not match the requirements of the engine.
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter reporter) Register an error reporter with the engine so that any errors generated by the script code 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 interfaceScriptEngine
- Parameters:
reporter
- The instance to use or null
-