Package com.sun.j3d.loaders
Interface Loader
- All Known Implementing Classes:
LoaderBase
,Lw3dLoader
,ObjectFile
public interface Loader
The Loader interface is used to specify the location
and elements of a file format to load.
The interface is used to give loaders of various
file formats a common public interface. Ideally
the Scene interface will be implemented to give
the user a consistent interface to extract the
data.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
This flag enables the loading of all objects into the scene.static final int
This flag enables the loading of background objects into the scene.static final int
This flag enables the loading of behaviors into the scene.static final int
This flag enables the loading of fog objects into the scene.static final int
This flag enables the loading of light objects into the scene.static final int
This flag enables the loading of sound objects into the scene.static final int
This flag enables the loading of view (camera) objects into the scene. -
Method Summary
Modifier and TypeMethodDescriptionReturns the current base path setting.Returns the current base URL setting.int
getFlags()
Returns the current loading flags setting.This method loads the Reader and returns the Scene containing the scene.This method loads the named file and returns the Scene containing the scene.This method loads the named file and returns the Scene containing the scene.void
setBasePath
(String pathName) This method sets the base path name for data files associated with the file passed into the load(String) method.void
setBaseUrl
(URL url) This method sets the base URL name for data files associated with the file passed into the load(URL) method.void
setFlags
(int flags) This method sets the load flags for the file.
-
Field Details
-
LOAD_LIGHT_NODES
static final int LOAD_LIGHT_NODESThis flag enables the loading of light objects into the scene.- See Also:
-
LOAD_FOG_NODES
static final int LOAD_FOG_NODESThis flag enables the loading of fog objects into the scene.- See Also:
-
LOAD_BACKGROUND_NODES
static final int LOAD_BACKGROUND_NODESThis flag enables the loading of background objects into the scene.- See Also:
-
LOAD_BEHAVIOR_NODES
static final int LOAD_BEHAVIOR_NODESThis flag enables the loading of behaviors into the scene.- See Also:
-
LOAD_VIEW_GROUPS
static final int LOAD_VIEW_GROUPSThis flag enables the loading of view (camera) objects into the scene.- See Also:
-
LOAD_SOUND_NODES
static final int LOAD_SOUND_NODESThis flag enables the loading of sound objects into the scene.- See Also:
-
LOAD_ALL
static final int LOAD_ALLThis flag enables the loading of all objects into the scene.- See Also:
-
-
Method Details
-
load
Scene load(String fileName) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException This method loads the named file and returns the Scene containing the scene. Any data files referenced by this file should be located in the same place as the named file; otherwise users should specify an alternate base path with the setBasePath(String) method. -
load
This method loads the named file and returns the Scene containing the scene. Any data files referenced by the Reader should be located in the same place as the named file; otherwise, users should specify an alternate base path with the setBaseUrl(URL) method. -
load
Scene load(Reader reader) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException This method loads the Reader and returns the Scene containing the scene. Any data files referenced by the Reader should be located in the user's current working directory. -
setBaseUrl
This method sets the base URL name for data files associated with the file passed into the load(URL) method. The basePath should be null by default, which is an indicator to the loader that it should look for any associated files starting from the same directory as the file passed into the load(URL) method. -
setBasePath
This method sets the base path name for data files associated with the file passed into the load(String) method. The basePath should be null by default, which is an indicator to the loader that it should look for any associated files starting from the same directory as the file passed into the load(String) method. -
getBaseUrl
URL getBaseUrl()Returns the current base URL setting. By default this is null, implying the loader should look for associated files starting from the same directory as the file passed into the load(URL) method. -
getBasePath
String getBasePath()Returns the current base path setting. By default this is null, implying the loader should look for associated files starting from the same directory as the file passed into the load(String) method. -
setFlags
void setFlags(int flags) This method sets the load flags for the file. The flags should equal 0 by default (which tells the loader to only load geometry). To enable the loading of any particular scene elements, pass in a logical OR of the LOAD values specified above. -
getFlags
int getFlags()Returns the current loading flags setting.
-