|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.vrml.scripting.browser.CommonBrowser
org.web3d.vrml.scripting.browser.X3DCommonBrowser
public class X3DCommonBrowser
The common parts of a browser implementation suitable for X3D scripting.
This class is a full implementation because the external and scripting interfaces will use it differently. External use can just subclass and add the SAI Browser interface. For scripting, the need to extend the Browser base class means that this class will need to be delegated to.
The current implementation ignores any parameter values provided by the world.
| Field Summary |
|---|
| Fields inherited from class org.web3d.vrml.scripting.browser.CommonBrowser |
|---|
core, errorReporter, loaderManager, routeManager, stateManager |
| Constructor Summary | |
|---|---|
X3DCommonBrowser(BrowserCore browser,
ViewpointManager vpm,
RouteManager rm,
FrameStateManager fsm,
WorldLoaderManager wlm)
Create a browser instance that represents the given universe details. |
|
| Method Summary | |
|---|---|
VRMLScene |
createX3DFromStream(java.io.InputStream stream)
Parse the given input stream and turn this into a list of X3D nodes. |
VRMLScene |
createX3DFromString(java.lang.String x3dSyntax)
Parse the given string and turn this into a list of X3D nodes. |
VRMLScene |
createX3DFromURL(java.lang.String[] urls)
Create and load X3D from the given URL and place the returned values as nodes into the given X3D node in the scene. |
void |
firstViewpoint()
Bind the first viewpoint in the list. |
void |
firstViewpoint(int layer)
Bind the first viewpoint in the list. |
ViewpointManager |
getViewpointManager()
Get the contained viewpoint manager instance. |
VRMLScene |
importDocument(org.w3c.dom.Node domNode)
Implementation of the importDocument optional capabilities. |
void |
lastViewpoint()
Bind the last viewpoint in the list. |
void |
lastViewpoint(int layer)
Bind the last viewpoint in the list. |
void |
nextViewpoint()
Bind the next viewpoint in the list. |
void |
nextViewpoint(int layer)
Bind the next viewpoint in the list. |
void |
previousViewpoint()
Bind the previous viewpoint in the list. |
void |
previousViewpoint(int layer)
Bind the previous viewpoint in the list. |
void |
replaceWorld(VRMLScene scene)
Replace the current world with the given nodes. |
void |
setErrorReporter(ErrorReporter reporter)
Register an error reporter with the CommonBrowser instance so that any errors generated can be reported in a nice manner. |
| Methods inherited from class org.web3d.vrml.scripting.browser.CommonBrowser |
|---|
addRoute, completeUrl, deleteRoute, getCurrentFrameRate, getCurrentSpeed, getDescription, getName, getVersion, getWorldURL, loadURL, setDescription |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public X3DCommonBrowser(BrowserCore browser,
ViewpointManager vpm,
RouteManager rm,
FrameStateManager fsm,
WorldLoaderManager wlm)
browser - The core representation of the browservpm - The manager for viewpointsrm - A route manager for users creating/removing routeswlm - Loader manager for doing async callsfsm - State manager for coordinating inter-frame processing
java.lang.IllegalArgumentException - A paramter is null| Method Detail |
|---|
public ViewpointManager getViewpointManager()
public void replaceWorld(VRMLScene scene)
Calling this method causes a SHUTDOWN event followed by an INITIALIZED event to be generated.
scene - The new scene instance to use
public VRMLScene createX3DFromStream(java.io.InputStream stream)
throws VRMLException,
VRMLParseException,
java.io.IOException
At the point that this method returns, external files such as textures, sounds and inlines may not have been loaded.
The stream may contain all legal X3D syntax. The X3D header line is not required to be present in the string.
stream - The stream containing VRML string syntax
VRMLException - General error during processing
VRMLParseException - If the string does not contain legal
VRML syntax or no node instantiations
java.io.IOException
public VRMLScene createX3DFromString(java.lang.String x3dSyntax)
throws VRMLException,
VRMLParseException,
java.io.IOException
At the point that this method returns, external files such as textures, sounds and inlines may not have been loaded.
The string may contain all legal X3D syntax. The X3D header line is not required to be present in the string.
x3dSyntax - The string containing X3D string syntax
VRMLException - General error during processing
VRMLParseException - If the string does not contain legal
VRML syntax or no node instantiations
java.io.IOExceptionpublic VRMLScene createX3DFromURL(java.lang.String[] urls)
urls - The list of URLs in decreasing order of preference as defined
in the X3D specification.
public VRMLScene importDocument(org.w3c.dom.Node domNode)
throws NotSupportedException
NotSupportedExceptionpublic void setErrorReporter(ErrorReporter reporter)
setErrorReporter in class CommonBrowserreporter - The new ErrorReporter to use.public void nextViewpoint()
public void nextViewpoint(int layer)
layer - The ID of the layer. Must be between 0 and the maximum
layer numberpublic void previousViewpoint()
public void previousViewpoint(int layer)
layer - The ID of the layer. Must be between 0 and the maximum
layer numberpublic void firstViewpoint()
public void firstViewpoint(int layer)
layer - The ID of the layer. Must be between 0 and the maximum
layer numberpublic void lastViewpoint()
public void lastViewpoint(int layer)
layer - The ID of the layer. Must be between 0 and the maximum
layer number
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||