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 TypeMethodDescriptionintGet the number of items in progress of loading.voidloadScript(VRMLScriptNodeType script) Attempt to load the script.voidregisterScriptingEngine(ScriptEngine engine) Register a new scripting engine with this loader.voidsetErrorReporter(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.voidSet the script load status listener for this loader.voidshutdown()Notification that the manager needs to shut down all the currently running threads.voidUnregister 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:
setErrorReporterin 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:
registerScriptingEnginein 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:
unregisterScriptingEnginein 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:
setStatusListenerin 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:
loadScriptin interfaceScriptLoader- Parameters:
script- The script instance to load
-
getNumberInProgress
public int getNumberInProgress()Get the number of items in progress of loading.- Specified by:
getNumberInProgressin 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:
shutdownin interfaceScriptLoader
-