|
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.external.eai.EAIBrowser
public class EAIBrowser
EAIBrowser implements the Browser interface, largely by
translating and interfacing between the wrapper classes and the
implementation class represented by {org.web3d.vrml.scripting.CommonBrowser}.
To function correctly, EAIBrowser needs to be constructed using CommonBrowser and BrowserCore instances. The EAIBrowser then registers as a listener so that BrowserCoreListener BrowserInitialized and browserShutdown messages. The BrowserCore instance is necessary mainly for the global namespace and VRMLExecutionSpace information.
| Constructor Summary | |
|---|---|
EAIBrowser(BrowserCore browserCore,
VRML97CommonBrowser browserImpl,
ExternalEventQueue eventQueue,
ErrorReporter reporter)
Construct an EAIBrowser for the given VrmlDisplayPanel |
|
| Method Summary | |
|---|---|
void |
addBrowserListener(BrowserListener theListener)
addBrowserListener adds the specified listener to the set of listeners for this browser. |
void |
addRoute(Node fromNode,
java.lang.String fromEventName,
Node toNode,
java.lang.String toEventName)
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. |
void |
browserDisposed()
The browser has been disposed, all resources may be freed. |
void |
browserInitialized(VRMLScene newScene)
The browser has been initialised with new content. |
void |
browserShutdown()
The browser has been shut down and the previous content is no longer valid. |
Node[] |
createVrmlFromString(java.lang.String string)
Parse the given string and turn this into a list of VRML nodes. |
void |
createVrmlFromURL(java.lang.String[] urls,
Node targetNode,
java.lang.String eventInName)
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 fromEventName,
Node toNode,
java.lang.String toEventName)
Delete a route between two nodes. |
void |
dispose()
Clean up and get rid of this browser. |
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()
Returns the name of the Browser. |
Node |
getNode(java.lang.String nodeName)
Get a DEF node by name. |
java.lang.String |
getVersion()
Returns the version string for this Browser. |
java.lang.String |
getWorldURL()
Get the fully qualified URL of the currently loaded world. |
void |
initializeWorld()
Initialize the world to a known and default state. |
void |
loadURL(java.lang.String[] urls,
java.lang.String[] params)
Load the URL as the new root of the scene. |
void |
removeBrowserListener(BrowserListener listener)
removeBrowserListener removes the specified listener from the set of listeners for this browser. |
void |
replaceWorld(Node[] nodes)
Replace the current world with the given nodes. |
void |
setDescription(java.lang.String newDescription)
Set the description of the current world. |
void |
urlLoadFailed(java.lang.String msg)
The tried to load a URL and failed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EAIBrowser(BrowserCore browserCore,
VRML97CommonBrowser browserImpl,
ExternalEventQueue eventQueue,
ErrorReporter reporter)
browserCore - The BrowserCore to use as the implementation.browserImpl - The VRML97CommonBrowser to use.eventQueue - The queue for sending events to the internals.reporter - The ErrorReporter for messages and errors.| Method Detail |
|---|
public java.lang.String getName()
throws InvalidBrowserException
getName in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getName()
public java.lang.String getVersion()
throws InvalidBrowserException
getVersion in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getVersion()
public float getCurrentSpeed()
throws InvalidBrowserException
Browser
getCurrentSpeed in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getCurrentSpeed()
public float getCurrentFrameRate()
throws InvalidBrowserException
Browser
getCurrentFrameRate in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getCurrentFrameRate()
public java.lang.String getWorldURL()
throws InvalidBrowserException,
URLUnavailableException
BrowserloadURL then the string will reflect the new URL. If
replaceWorld is called then the URL still represents the
original world.
getWorldURL in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
URLUnavailableException - The URL is not available because a
world has not been loadedBrowser.getWorldURL()
public void replaceWorld(Node[] nodes)
throws java.lang.IllegalArgumentException,
InvalidBrowserException
BrowserCalling this method causes a SHUTDOWN event followed by an INITIALIZED event to be generated.
replaceWorld in interface Browsernodes - 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.Browser.replaceWorld(vrml.eai.Node[])
public void loadURL(java.lang.String[] urls,
java.lang.String[] params)
throws InvalidBrowserException,
InvalidURLException
BrowserGenerates an immediate SHUTDOWN event and then when the new contents are ready to be loaded, sends an INITIALIZED event.
loadURL in interface Browserurls - The list of URLs in decreasing order of preference as defined
in the VRML97 specification.params - 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 valuesBrowser.loadURL(java.lang.String[], java.lang.String[])
public void setDescription(java.lang.String newDescription)
throws InvalidBrowserException
Browser
setDescription in interface BrowsernewDescription - The description string to set.
InvalidBrowserException - The dispose method has been called on
this browser reference.Browser.setDescription(java.lang.String)
public Node[] createVrmlFromString(java.lang.String string)
throws InvalidBrowserException,
InvalidVrmlException
BrowserAt 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.
createVrmlFromString in interface Browserstring - The string containing VRML string syntax
InvalidBrowserException - The dispose method has been called on
this browser reference.
InvalidVrmlException - If the string does not contain legal
VRML syntax or no node instantiationsBrowser.createVrmlFromString(java.lang.String)
public void createVrmlFromURL(java.lang.String[] urls,
Node targetNode,
java.lang.String eventInName)
throws InvalidBrowserException,
InvalidNodeException,
InvalidURLException,
InvalidEventInException
Browser
createVrmlFromURL in interface Browserurls - The list of URLs in decreasing order of preference as defined
in the VRML97 specification.targetNode - The destination node for the VRML code to be sent to.eventInName - The name of the MFNode eventIn to send the nodes to.
InvalidBrowserException - The dispose method has been called on
this browser reference.
InvalidNodeException - The nominated destination node has been
disposed of
InvalidURLException - All of the URLs passed to this method are
bogus and cannot be translated to usable values
InvalidEventInExceptionBrowser.createVrmlFromURL(java.lang.String[], vrml.eai.Node, java.lang.String)
public Node getNode(java.lang.String nodeName)
throws InvalidNodeException,
InvalidBrowserException,
URLUnavailableException
Browser
getNode in interface BrowsernodeName - 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 loadedBrowser.getNode(java.lang.String)
public void addRoute(Node fromNode,
java.lang.String fromEventName,
Node toNode,
java.lang.String toEventName)
throws InvalidBrowserException,
InvalidEventOutException,
InvalidEventInException,
InvalidNodeException
Browser
addRoute in interface BrowserfromNode - The source node for the routefromEventName - The eventOut source of the routetoNode - The destination node of the routetoEventName - The eventIn destination of the route
InvalidBrowserException - The dispose method has been called on
this browser reference.
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 ofBrowser.addRoute(vrml.eai.Node, java.lang.String, vrml.eai.Node, java.lang.String)
public void deleteRoute(Node fromNode,
java.lang.String fromEventName,
Node toNode,
java.lang.String toEventName)
throws InvalidBrowserException,
InvalidEventOutException,
InvalidEventInException,
InvalidNodeException
Browser
deleteRoute in interface BrowserfromNode - The source node for the routefromEventName - The eventOut source of the routetoNode - The destination node of the routetoEventName - The eventIn destination of the route
InvalidBrowserException - The dispose method has been called on
this browser reference.
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 ofBrowser.deleteRoute(vrml.eai.Node, java.lang.String, vrml.eai.Node, java.lang.String)
public void beginUpdate()
throws InvalidBrowserException
BrowserThis 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.
beginUpdate in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.beginUpdate()
public void endUpdate()
throws InvalidBrowserException
BrowserThis 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.
endUpdate in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.endUpdate()
public void addBrowserListener(BrowserListener theListener)
throws InvalidBrowserException
addBrowserListener in interface BrowsertheListener - The listener to add to the list of listeners for
this browser
InvalidBrowserException - The dispose method has been called on
this browser reference.
public void removeBrowserListener(BrowserListener listener)
throws InvalidBrowserException
removeBrowserListener in interface Browserlistener - The listener to remove from the list.
InvalidBrowserException - The dispose method has been called on
this browser reference.public void browserInitialized(VRMLScene newScene)
BrowserCoreListener
browserInitialized in interface BrowserCoreListenernewScene - The scene of the new contentBrowserCoreListener.browserInitialized(org.web3d.vrml.nodes.VRMLScene)public void urlLoadFailed(java.lang.String msg)
urlLoadFailed in interface BrowserCoreListenermsg - An error message to go with the failurepublic void browserShutdown()
BrowserCoreListener
browserShutdown in interface BrowserCoreListenerBrowserCoreListener.browserShutdown()public void browserDisposed()
browserDisposed in interface BrowserCoreListenerpublic void dispose()
Since this version does not support sharing between clients, shutdown also initiates the termination of the Xj3D to EAI event adapter system.
dispose in interface Browserpublic void initializeWorld()
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||