|
Xj3D 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
The common parts of a browser implementation that all the scripting interfaces require.
This class is a partial implementation that is then extended for version-specific functionality. There are major functional differences between VRML97 and X3D and require that some methods be implemented differently. For example createVrmlFromURL is asynchronous in VRML97 by synchronous in X3D and therefore not implemented in this base class. Look to the derived classes for a complete implementation.
The current implementation ignores any parameter values provided by the world.
| Field Summary | |
protected BrowserCore |
core
The basic browser core functionality that this script hooks to |
protected ErrorReporter |
errorReporter
The ErrorReporter for messages |
protected WorldLoaderManager |
loaderManager
Loader manager for doing aysnc loads |
protected WorldLoaderThreadPool |
loaderPool
Loader thread pool in use |
protected RouteManager |
routeManager
Route manager for dealing with add/remove ROUTE methods. |
protected FrameStateManager |
stateManager
The frame state manager for nodes loaded by this class |
| Constructor Summary | |
protected |
CommonBrowser(BrowserCore browser,
RouteManager rm,
FrameStateManager fsm,
WorldLoaderManager wlm)
Create a browser instance that represents the given universe details. |
| Method Summary | |
void |
addRoute(VRMLExecutionSpace execSpace,
VRMLNodeType fromNode,
java.lang.String fromEventOut,
VRMLNodeType toNode,
java.lang.String toEventIn)
Add a route between two nodes, from an eventOut to an eventIn. |
protected java.lang.String[] |
completeUrl(java.lang.String[] base)
Insure that a url is a fully qualified URL. |
void |
deleteRoute(VRMLExecutionSpace execSpace,
VRMLNodeType fromNode,
java.lang.String fromEventOut,
VRMLNodeType toNode,
java.lang.String toEventIn)
Delete a route between two nodes. |
float |
getCurrentFrameRate()
Get the current frame rate of the browser in frames per second. |
float |
getCurrentSpeed()
Get the current velocity of the bound viewpoint in meters per second. |
java.lang.String |
getDescription()
Get the description string currently used by the world. |
java.lang.String |
getName()
Get the name of the browser. |
java.lang.String |
getVersion()
Get the version of the browser. |
java.lang.String |
getWorldURL()
Get the fully qualified URL of the currently loaded world. |
void |
loadURL(java.lang.String[] url,
java.util.Map parameters)
Load the URL as the new root of the scene. |
void |
setDescription(java.lang.String desc)
Set the description of the current world. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected BrowserCore core
protected RouteManager routeManager
protected WorldLoaderManager loaderManager
protected WorldLoaderThreadPool loaderPool
protected FrameStateManager stateManager
protected ErrorReporter errorReporter
| Constructor Detail |
protected CommonBrowser(BrowserCore browser,
RouteManager rm,
FrameStateManager fsm,
WorldLoaderManager wlm)
browser - The core representation of the browserrm - 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 java.lang.String getDescription()
public void setDescription(java.lang.String desc)
desc - The description string to set.public java.lang.String getName()
public java.lang.String getVersion()
public float getCurrentSpeed()
public float getCurrentFrameRate()
public java.lang.String getWorldURL()
loadURL then the string will reflect the new URL. If
replaceWorld is called then the URL still represents the
original world.
loadURL(String[], Map)
public void addRoute(VRMLExecutionSpace execSpace,
VRMLNodeType fromNode,
java.lang.String fromEventOut,
VRMLNodeType toNode,
java.lang.String toEventIn)
throws InvalidFieldException
execSpace - The space that this route takes place infromNode - The source node for the routefromEventOut - The eventOut source of the routetoNode - The destination node of the routetoEventIn - The eventIn destination of the route
InvalidFieldException - the eventIn or eventOut name is not a
field of the src/destination node
public void deleteRoute(VRMLExecutionSpace execSpace,
VRMLNodeType fromNode,
java.lang.String fromEventOut,
VRMLNodeType toNode,
java.lang.String toEventIn)
throws InvalidFieldException
execSpace - The space that this route takes place infromNode - The source node for the routefromEventOut - The eventOut source of the routetoNode - The destination node of the routetoEventIn - The eventIn destination of the route
InvalidFieldException - the eventIn or eventOut name is not a
field of the src/destination node
public void loadURL(java.lang.String[] url,
java.util.Map parameters)
Generates an immediate SHUTDOWN event and then when the new contents are ready to be loaded, sends an INITIALIZED event.
url - The list of URLs in decreasing order of preference as defined
in the VRML97 specification.parameters - The list of parameters to accompany the load call as
defined in the Anchor node specification of VRML97
VRMLException - General error during processingpublic void setErrorReporter(ErrorReporter reporter)
reporter - The new ErrorReporter to use.protected java.lang.String[] completeUrl(java.lang.String[] base)
base - The base url
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||