Package org.xj3d.core.loading
Interface WorldLoaderManager
- All Known Implementing Classes:
DefaultWorldLoaderManager
public interface WorldLoaderManager
Independent thread used to load a world from a list of URLs and then
place it in the given node.
This implementation is designed to work as both a loadURL() and createVrmlFromUrl() call handler. The difference is defined by what data is supplied to the thread. If the target node is specified, then we assume that the caller wants us to put the results there. If it is null, then assume that we're doing a loadURL call and replace the entire world.
- Version:
- $Revision: 1.4 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionFetch a world loader instance from the global pool to work on loading of a world.getBuilderFactory
(int renderer) Get the factory for the given renderer type.int
Return the number of WorldLoaders that are currently allocated from the pool and active loading.getParserFactory
(int renderer) Get the factory for the given renderer type.void
queueCreateURL
(String[] urls, VRMLNodeType node, int field, VRMLExecutionSpace space) Queue a request for a createX3D/VRMLFromURL call.void
queueLoadURL
(String[] urls, Map<String, Object> params) Queue a request for a loadURL call.void
registerBuilderFactory
(int renderer, SceneBuilderFactory factory) Register the scene builder factory to be used for the given renderer type.void
registerParserFactory
(int renderer, VRMLParserFactory factory) Register the parser factory to be used for the given renderer type.void
releaseLoader
(WorldLoader loader) Release a currently used world loader back into the cache for others to make use of.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
setProgressListener
(org.ietf.uri.event.ProgressListener listener) Register a progress listener with the engine so progress can be tracked.
-
Method Details
-
setErrorReporter
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.- Parameters:
reporter
- The instance to use or null
-
setProgressListener
void setProgressListener(org.ietf.uri.event.ProgressListener listener) Register a progress listener with the engine so progress can be tracked. Only loadURL calls will issue progress, not createURL.- Parameters:
listener
- The instance to use or null
-
queueLoadURL
-
queueCreateURL
Queue a request for a createX3D/VRMLFromURL call.- Parameters:
urls
- List of urls to loadnode
- The node to send the values tofield
- index of the field to write tospace
- The space the script is in for route adding
-
fetchLoader
WorldLoader fetchLoader()Fetch a world loader instance from the global pool to work on loading of a world.- Returns:
- A loader instance to use
-
releaseLoader
Release a currently used world loader back into the cache for others to make use of.- Parameters:
loader
- The instance to return
-
registerBuilderFactory
Register the scene builder factory to be used for the given renderer type. There can only be one for any given renderer type (where the type value is defined by the constants inBrowserCore
. If the factory instance is null, it will clear the factory for the given renderer type from the map.- Parameters:
renderer
- The ID of the renderer typefactory
- The instance of the factory to use
-
getBuilderFactory
Get the factory for the given renderer type. If no factory exists return null.- Parameters:
renderer
- The ID of the renderer type- Returns:
- The instance of the factory or null
-
registerParserFactory
Register the parser factory to be used for the given renderer type. There can only be one for any given renderer type (where the type value is defined by the constants inBrowserCore
. If the factory instance is null, it will clear the factory for the given renderer type from the map.- Parameters:
renderer
- The ID of the renderer typefactory
- The instance of the factory to use
-
getParserFactory
Get the factory for the given renderer type. If no factory exists return null.- Parameters:
renderer
- The ID of the renderer type- Returns:
- The instance of the factory or null
-
getNumberLoadersActive
int getNumberLoadersActive()Return the number of WorldLoaders that are currently allocated from the pool and active loading.- Returns:
- The number of WorldLoaders currently active.
-