Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.loader
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.2 $
Author:
Justin Couch

Method Summary
 WorldLoader fetchLoader()
          Fetch a world loader instance from the global pool to work on loading of a world.
 SceneBuilderFactory getBuilderFactory(int renderer)
          Get the factory for the given renderer type.
 VRMLParserFactory getParserFactory(int renderer)
          Get the factory for the given renderer type.
 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(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.
 

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.

Parameters:
reporter - The instance to use or null

fetchLoader

public 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

public void releaseLoader(WorldLoader loader)
Release a currently used world loader back into the cache for others to make use of.

Parameters:
loader - The instance to return

registerBuilderFactory

public void registerBuilderFactory(int renderer,
                                   SceneBuilderFactory factory)
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 in BrowserCore. If the factory instance is null, it will clear the facctory for the given renderer type from the map.

Parameters:
renderer - The ID of the renderer type
factory - The instance of the factory to use

getBuilderFactory

public SceneBuilderFactory getBuilderFactory(int renderer)
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

public void registerParserFactory(int renderer,
                                  VRMLParserFactory factory)
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 in BrowserCore. If the factory instance is null, it will clear the facctory for the given renderer type from the map.

Parameters:
renderer - The ID of the renderer type
factory - The instance of the factory to use

getParserFactory

public VRMLParserFactory getParserFactory(int renderer)
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

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium