Package org.xj3d.impl.core.loading
Class DefaultScriptLoader
java.lang.Object
org.xj3d.impl.core.loading.DefaultScriptLoader
- All Implemented Interfaces:
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.2 $
- Author:
- Justin Couch
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new script loader that represents the given browser. -
Method Summary
Modifier and TypeMethodDescriptionint
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
(org.j3d.util.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
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
Unregister a the scripting engine with this loader.
-
Constructor Details
-
DefaultScriptLoader
public DefaultScriptLoader()Create a new script loader that represents the given browser.
-
-
Method Details
-
setErrorReporter
public void setErrorReporter(org.j3d.util.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 interfaceScriptLoader
- Parameters:
reporter
- The instance to use or null
-
registerScriptingEngine
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 interfaceScriptLoader
- Parameters:
engine
- The new engine instance to register
-
unregisterScriptingEngine
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 interfaceScriptLoader
- Parameters:
engine
- The engine instance to deregister
-
setStatusListener
Set the script load status listener for this loader. A null value is used to clear the reference.- Specified by:
setStatusListener
in interfaceScriptLoader
- Parameters:
l
- The listener instance to use or null
-
loadScript
Attempt to load the script. Queues the script and lets the internals deal with it.- Specified by:
loadScript
in interfaceScriptLoader
- Parameters:
script
- The script instance to load
-
getNumberInProgress
public int getNumberInProgress()Get the number of items in progress of loading.- Specified by:
getNumberInProgress
in interfaceScriptLoader
- 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 interfaceScriptLoader
-