|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Basic browser interface that represents the interface to the VRML browser from any application. Individual VRML browser implementors are to extend this interface and provide this functionality. The individual users will not see anything but this interface.
A number of the methods in this applicationcan take strings representing URLs. Relative URL strings contained in URL fields of nodes or these method arguments are interpreted as follows:
Relative URLs are treated as per clause B.3.5 of the EAI Java Bindings
| Method Summary | |
void |
addBrowserListener(BrowserListener l)
Add a listener for browser events. |
void |
addRoute(Node fromNode,
java.lang.String eventOut,
Node toNode,
java.lang.String eventIn)
Add a route between two nodes, from an eventOut to an eventIn. |
void |
beginUpdate()
Lock the output from the external interface to the browser as the code is about to begin a series of updates. |
Node[] |
createVrmlFromString(java.lang.String vrmlString)
Parse the given string and turn this into a list of VRML nodes. |
void |
createVrmlFromURL(java.lang.String[] url,
Node node,
java.lang.String eventIn)
Create and load VRML from the given URL and place the returned values as nodes into the given VRML node in the scene. |
void |
deleteRoute(Node fromNode,
java.lang.String eventOut,
Node toNode,
java.lang.String eventIn)
Delete a route between two nodes. |
void |
dispose()
Dispose the resources that are used by this instance. |
void |
endUpdate()
Release the output of events from the external interface into the VRML browser. |
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 |
getName()
Get the name of the browser. |
Node |
getNode(java.lang.String name)
Get a DEF node by name. |
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.lang.String[] parameter)
Load the URL as the new root of the scene. |
void |
removeBrowserListener(BrowserListener l)
Remove a listener for browser events. |
void |
replaceWorld(Node[] nodes)
Replace the current world with the given nodes. |
void |
setDescription(java.lang.String desc)
Set the description of the current world. |
| Method Detail |
public java.lang.String getName()
throws InvalidBrowserException
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public java.lang.String getVersion()
throws InvalidBrowserException
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public float getCurrentSpeed()
throws InvalidBrowserException
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public float getCurrentFrameRate()
throws InvalidBrowserException
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public java.lang.String getWorldURL()
throws InvalidBrowserException,
URLUnavailableException
loadURL then the string will reflect the new URL. If
replaceWorld is called then the URL still represents the
original world.
InvalidBrowserException - The dispose method has been called on
this browser reference.
URLUnavailableException - The URL is not available because a
world has not been loaded
ConnectionException - An error occurred in the connection to the
browser.loadURL(java.lang.String[], java.lang.String[]),
replaceWorld(vrml.eai.Node[])
public void replaceWorld(Node[] nodes)
throws java.lang.IllegalArgumentException,
InvalidBrowserException
Calling this method causes a SHUTDOWN event followed by an INITIALIZED event to be generated.
nodes - The list of nodes to use as the new root of the world
java.lang.IllegalArgumentException - if the nodes are not valid VRML nodes
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void loadURL(java.lang.String[] url,
java.lang.String[] parameter)
throws InvalidBrowserException,
InvalidURLException
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.parameter - The list of parameters to accompany the load call as
defined in the Anchor node specification of VRML97
InvalidBrowserException - The dispose method has been called on
this browser reference.
InvalidURLException - All of the URLs passed to this method are
bogus and cannot be translated to usable values
ConnectionException - An error occurred in the connection to the
browser.
public void setDescription(java.lang.String desc)
throws InvalidBrowserException
desc - The description string to set.
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public Node[] createVrmlFromString(java.lang.String vrmlString)
throws InvalidBrowserException,
InvalidVrmlException
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 VRML syntax. The VRML header line is not required to be present in the string.
vrmlString - The string containing VRML string syntax
InvalidVrmlException - If the string does not contain legal
VRML syntax or no node instantiations
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void createVrmlFromURL(java.lang.String[] url,
Node node,
java.lang.String eventIn)
throws InvalidBrowserException,
InvalidNodeException,
InvalidURLException
url - The list of URLs in decreasing order of preference as defined
in the VRML97 specification.node - The destination node for the VRML code to be sent to.eventIn - The name of the MFNode eventIn to send the nodes to.
InvalidNodeException - The nominated destination node has been
disposed of
InvalidBrowserException - The dispose method has been called on
this browser reference.
InvalidURLException - All of the URLs passed to this method are
bogus and cannot be translated to usable values
ConnectionException - An error occurred in the connection to the
browser.
public Node getNode(java.lang.String name)
throws InvalidNodeException,
InvalidBrowserException,
URLUnavailableException
name - The name of the DEF node to retrieve
InvalidNodeException - The named node does not exist or is not
accessible.
InvalidBrowserException - The dispose method has been called on
this browser reference.
URLUnavailableException - The URL is not available because a
world has not been loaded
ConnectionException - An error occurred in the connection to the
browser.
public void addRoute(Node fromNode,
java.lang.String eventOut,
Node toNode,
java.lang.String eventIn)
throws InvalidBrowserException,
InvalidEventOutException,
InvalidEventInException,
InvalidNodeException
fromNode - The source node for the routeeventOut - The eventOut source of the routetoNode - The destination node of the routeeventIn - The eventIn destination of the route
InvalidEventOutException - if the named eventOut does not exist
InvalidEventInException - if the named eventIn does not exist.
InvalidNodeException - The nominated destination or source node
has been disposed of
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void deleteRoute(Node fromNode,
java.lang.String eventOut,
Node toNode,
java.lang.String eventIn)
throws InvalidBrowserException,
InvalidEventOutException,
InvalidEventInException,
InvalidNodeException
fromNode - The source node for the routeeventOut - The eventOut source of the routetoNode - The destination node of the routeeventIn - The eventIn destination of the route
InvalidEventOutException - if the named eventOut does not exist
InvalidEventInException - if the named eventIn does not exist.
InvalidNodeException - The nominated destination or source node
has been disposed of
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void beginUpdate()
throws InvalidBrowserException
This call is a nesting call which means subsequent calls to beginUpdate are kept on a stack. No events will be released to the VRML browser until as many endUpdates have been called as beginUpdate.
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void endUpdate()
throws InvalidBrowserException
This call is a nesting call which means subsequent calls to beginUpdate are kept on a stack. No events will be released to the VRML browser until as many endUpdates have been called as beginUpdate.
If no beginUpdate has been called before calling this method, it has no effect.
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void addBrowserListener(BrowserListener l)
throws InvalidBrowserException
l - The listener to add.
java.lang.NullPointerException - If the provided listener reference is
null
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
public void removeBrowserListener(BrowserListener l)
throws InvalidBrowserException
l - The listener to remove
java.lang.NullPointerException - If the provided listener reference is
null
InvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.public void dispose()
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||