Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.loader
Class DefaultScriptLoader

java.lang.Object
  extended byorg.web3d.vrml.nodes.loader.DefaultScriptLoader
All Implemented Interfaces:
ScriptLoader

public class DefaultScriptLoader
extends java.lang.Object
implements ScriptLoader

A utility class who's sole job is to take a script node and load the contents and get the runtime items happening.

Version:
$Revision: 1.12 $
Author:
Justin Couch

Constructor Summary
DefaultScriptLoader()
          Create a new script loader that represents the given browser.
 
Method Summary
 int getNumberInProgress()
          Get the number of items in progress of loading.
 void loadScript(VRMLScriptNodeType script)
          Attempt to load the script.
 void registerScriptingEngine(ScriptEngine engine)
          Register a new scripting engine with this loader.
 void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 void setStatusListener(ScriptLoadStatusListener l)
          Set the script load status listener for this loader.
 void shutdown()
          Notification that the manager needs to shut down all the currently running threads.
 void unregisterScriptingEngine(ScriptEngine engine)
          Unregister a the scripting engine with this loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultScriptLoader

public DefaultScriptLoader()
Create a new script loader that represents the given browser.

Method Detail

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of 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 interface ScriptLoader
Parameters:
reporter - The instance to use or null

registerScriptingEngine

public void registerScriptingEngine(ScriptEngine engine)
Register a new scripting engine with this loader. There can be only one scripting engine per content type so if the new engine supports a content type that is already registered, the new engine will replace the old one.

Specified by:
registerScriptingEngine in interface ScriptLoader
Parameters:
engine - The new engine instance to register

unregisterScriptingEngine

public void unregisterScriptingEngine(ScriptEngine engine)
Unregister a the scripting engine with this loader. If the engine was not registered in the first place, this method is ignored.

Specified by:
unregisterScriptingEngine in interface ScriptLoader
Parameters:
engine - The engine instance to deregister

setStatusListener

public void setStatusListener(ScriptLoadStatusListener l)
Set the script load status listener for this loader. A null value is used to clear the reference.

Specified by:
setStatusListener in interface ScriptLoader
Parameters:
l - The listener instance to use or null

loadScript

public void loadScript(VRMLScriptNodeType script)
Attempt to load the script. Queues the script and lets the internals deal with it.

Specified by:
loadScript in interface ScriptLoader
Parameters:
script - The script instance to load

getNumberInProgress

public int getNumberInProgress()
Get the number of items in progress of loading.

Specified by:
getNumberInProgress in interface ScriptLoader
Returns:
The number of items queued.

shutdown

public void shutdown()
Notification that the manager needs to shut down all the currently running threads. Normally called when the application is exiting, so it is not expected that the manager needs to act sanely after this method has been called.

Specified by:
shutdown in interface ScriptLoader

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium