Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.scripting.external.sai
Class SAIBrowser

java.lang.Object
  extended by org.web3d.vrml.scripting.external.sai.SAIBrowser
All Implemented Interfaces:
BrowserCoreListener, Browser, ExternalBrowser, Xj3DBrowser

public class SAIBrowser
extends java.lang.Object
implements Xj3DBrowser, BrowserCoreListener

SAIBrowser 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, SAIBrowser needs to be constructed using CommonBrowser and BrowserCore instances. The SAIBrowser 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.

Version:
$Revision: 1.55 $
Author:
Brad Vender, Rex Melton, Justin Couch

Field Summary
 
Fields inherited from interface org.xj3d.sai.Xj3DBrowser
RENDER_FLAT, RENDER_LINES, RENDER_POINTS, RENDER_SHADED
 
Constructor Summary
SAIBrowser(BrowserCore browserCore, X3DCommonBrowser browserImpl, RouteManager rm, FrameStateManager fsm, ExternalEventQueue eventQueue, CursorManager cm, ErrorReporter reporter)
          Construct an SAIBrowser for the given VrmlDisplayPanel
 
Method Summary
 void addBrowserListener(BrowserListener l)
          addBrowserListener adds the specified listener to the set of listeners for this browser.
 void addStatusListener(Xj3DStatusListener l)
          Add a listener for status messages.
 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.
 X3DScene createScene(ProfileInfo profile, ComponentInfo[] components)
          Create a new, empty scene that can be used to programmatically fill in new scenes.
 X3DScene createX3DFromStream(java.io.InputStream is)
          Parse the contents of the stream and interpret it as X3D content.
 X3DScene createX3DFromString(java.lang.String string)
          Parse the given string and turn this into a list of X3D nodes.
 X3DScene createX3DFromURL(java.lang.String[] url)
          Create and load X3D from the given URL.
 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.
 void firstViewpoint()
          Bind the first viewpoint in the list.
 void firstViewpoint(int layer)
          Bind the first viewpoint in the list.
 java.util.Map getBrowserProperties()
          Get the collection of browser properties that the browser provides.
 Xj3DCADView getCADView()
          Fetch the copontent-specific interface for managing a CAD scene.
 ComponentInfo getComponent(java.lang.String name, int level)
          Get a specific component at the requested support level.
 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.
 Xj3DCursorUIManager getCursorManager()
          Fetch the interface that allows an external application to implement their own cursor user interface.
 java.lang.String getDescription()
          Get the description of the current world.
 X3DExecutionContext getExecutionContext()
          Get the information about the current scene.
 int getMinimumFrameInterval()
          Get the currently set minimum frame cycle interval.
 java.lang.String getName()
          Returns the name of the Browser.
 Xj3DNavigationUIManager getNavigationManager()
          Fetch the interface that allows an external application to implement their own navigation user interface.
 ProfileInfo getProfile(java.lang.String profileName)
          Get a specific profile.
 java.util.Map getRenderingProperties()
          Get the collection of rendering properties that the browser provides.
 int getRenderingStyle()
          Get the currently set rendering style.
 ComponentInfo[] getSupportedComponents()
          Get a listing of all the components that this browser implementation is capable of supporting.
 ProfileInfo[] getSupportedProfiles()
          Get a listing of the profiles that this browser implementation is capable of supporting.
 java.lang.String getVersion()
          Returns the version string for this Browser.
 X3DScene importDocument(org.w3c.dom.Node aDocument)
          A utility request to import a W3C DOM document or document fragment and convert it to an X3D scene.
 void initializeWorld()
          Initialize the world to a known state.
 void lastViewpoint()
          Bind the last viewpoint in the list.
 void lastViewpoint(int layer)
          Bind the last viewpoint in the list.
 void loadURL(java.lang.String[] urls, java.util.Map params)
          Load the URL as the new root of the scene.
 void nextViewpoint()
          Bind the next viewpoint in the list.
 void nextViewpoint(int layer)
          Bind the next viewpoint in the list.
 void pauseRender()
          Pause the render and event cascade evaluation system.
 void previousViewpoint()
          Bind the previous viewpoint in the list.
 void previousViewpoint(int layer)
          Bind the previous viewpoint in the list.
 void print(java.lang.Object msg)
          Print the message to the browser console without wrapping a new line onto it.
 void println(java.lang.Object msg)
          Print the message to the browser console and append a new line onto it.
 void removeBrowserListener(BrowserListener l)
          removeBrowserListener removes the specified listener from the set of listeners for this browser.
 void removeStatusListener(Xj3DStatusListener l)
          Remove a listener for status messages.
 void replaceWorld(X3DScene scene)
          Replace the current world with the given nodes.
 void setDescription(java.lang.String newDescription)
          Set the description of the current world.
 void setErrorReporter(Xj3DErrorReporter reporter)
          Set the handler for error messages.
 void setMinimumFrameInterval(int millis)
          Set the minimum frame interval time to limit the CPU resources taken up by the 3D renderer.
 void setRenderingStyle(int style)
          Change the rendering style that the browser should currently be using.
 void startRender()
          Start the render and event cascade evaluation system again after a pause or stop.
 void stopRender()
          Stop the render and event cascade evaluation system completely.
 void urlLoadFailed(java.lang.String msg)
          The browser 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

SAIBrowser

public SAIBrowser(BrowserCore browserCore,
                  X3DCommonBrowser browserImpl,
                  RouteManager rm,
                  FrameStateManager fsm,
                  ExternalEventQueue eventQueue,
                  CursorManager cm,
                  ErrorReporter reporter)
Construct an SAIBrowser for the given VrmlDisplayPanel

Parameters:
browserImpl - The delegated browser implementation
browserCore - The BrowserCore to use as the implementation.
eventQueue - The buffer to send events to.
reporter - The ErrorReporter to use. If null, will use DefaultErrorReporter's default.
Method Detail

setErrorReporter

public void setErrorReporter(Xj3DErrorReporter reporter)
Set the handler for error messages. This can be used to replace the stock console. Passing a value of null removes the currently registered reporter. Setting this will replace the current reporter with this instance. If the current reporter is the default system console, then the console will not receive any further messages.

Specified by:
setErrorReporter in interface Xj3DBrowser
Parameters:
reporter - The error reporter instance to use

addStatusListener

public void addStatusListener(Xj3DStatusListener l)
Add a listener for status messages. Adding the same listener instance more than once will be silently ignored. Null values are ignored.

Specified by:
addStatusListener in interface Xj3DBrowser
Parameters:
l - The listener instance to add

removeStatusListener

public void removeStatusListener(Xj3DStatusListener l)
Remove a listener for status messages. If this listener is not currently registered, the request will be silently ignored.

Specified by:
removeStatusListener in interface Xj3DBrowser
Parameters:
l - The listener instance to remove

getNavigationManager

public Xj3DNavigationUIManager getNavigationManager()
Fetch the interface that allows an external application to implement their own navigation user interface. This is guaranteed to be unique per browser instance.

Specified by:
getNavigationManager in interface Xj3DBrowser
Returns:
An interface allowing end-user code to manipulate the navigation.

getCursorManager

public Xj3DCursorUIManager getCursorManager()
Fetch the interface that allows an external application to implement their own cursor user interface.

Returns:
An interface allowing end-user code to manipulate the cursor.

getCADView

public Xj3DCADView getCADView()
                       throws InvalidBrowserException
Fetch the copontent-specific interface for managing a CAD scene. This interface exposes CAD structures

Specified by:
getCADView in interface Xj3DBrowser
Returns:
An interface allowing end-user code to manipulate the the CAD-specific structures in the scene.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

setMinimumFrameInterval

public void setMinimumFrameInterval(int millis)
Set the minimum frame interval time to limit the CPU resources taken up by the 3D renderer. By default it will use all of them.

Specified by:
setMinimumFrameInterval in interface Xj3DBrowser
Parameters:
millis - The minimum time in milleseconds.

getMinimumFrameInterval

public int getMinimumFrameInterval()
Get the currently set minimum frame cycle interval. Note that this is the minimum interval, not the actual frame rate. Heavy content loads can easily drag this down below the max frame rate that this will generate.

Specified by:
getMinimumFrameInterval in interface Xj3DBrowser
Returns:
The cycle interval time in milliseconds

setRenderingStyle

public void setRenderingStyle(int style)
                       throws java.lang.IllegalArgumentException
Change the rendering style that the browser should currently be using. Various options are available based on the constants defined in this interface.

Specified by:
setRenderingStyle in interface Xj3DBrowser
Parameters:
style - One of the RENDER_* constants
Throws:
java.lang.IllegalArgumentException - A style constant that is not recognized by the implementation was provided

getRenderingStyle

public int getRenderingStyle()
Get the currently set rendering style. The default style is RENDER_SHADED.

Specified by:
getRenderingStyle in interface Xj3DBrowser
Returns:
one of the RENDER_ constants

addBrowserListener

public void addBrowserListener(BrowserListener l)
                        throws InvalidBrowserException
addBrowserListener adds the specified listener to the set of listeners for this browser.

Specified by:
addBrowserListener in interface ExternalBrowser
Parameters:
l - The listener to add to the list of listeners for this browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

beginUpdate

public void beginUpdate()
                 throws InvalidBrowserException
Description copied from interface: ExternalBrowser
Lock the output from the external interface to the browser as the code is about to begin a series of updates. No events will be passed to the VRML world. They will be buffered pending release due to a subsequent call to endUpdate.

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.

Specified by:
beginUpdate in interface ExternalBrowser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
ExternalBrowser.beginUpdate()

endUpdate

public void endUpdate()
               throws InvalidBrowserException
Description copied from interface: ExternalBrowser
Release the output of events from the external interface into the VRML browser. All events posted to this point from the last time that beginUpdate was called are released into the VRML browser for processing at the next available oppourtunity.

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.

Specified by:
endUpdate in interface ExternalBrowser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
ExternalBrowser.endUpdate()

pauseRender

public void pauseRender()
Description copied from interface: ExternalBrowser
Pause the render and event cascade evaluation system.

Specified by:
pauseRender in interface ExternalBrowser
See Also:
ExternalBrowser.pauseRender()

removeBrowserListener

public void removeBrowserListener(BrowserListener l)
                           throws InvalidBrowserException
removeBrowserListener removes the specified listener from the set of listeners for this browser.

Specified by:
removeBrowserListener in interface ExternalBrowser
Parameters:
l - The listener to remove from the list.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
ExternalBrowser.removeBrowserListener(org.web3d.x3d.sai.BrowserListener)

startRender

public void startRender()
Description copied from interface: ExternalBrowser
Start the render and event cascade evaluation system again after a pause or stop. If this is a start after a stop, it should be treated as the world having just been loaded. All scripts and sensors should be told to initialise again. If it is after a pause, the world continues as before as though nothing has happened, except TimeSensors will have their time values updated to reflect the current time and the fraction adjusted accordingly.

Specified by:
startRender in interface ExternalBrowser
See Also:
ExternalBrowser.startRender()

stopRender

public void stopRender()
Description copied from interface: ExternalBrowser
Stop the render and event cascade evaluation system completely. This will trigger the proper shutdown notifications being sent to all nodes and scripts.

Specified by:
stopRender in interface ExternalBrowser
See Also:
ExternalBrowser.stopRender()

dispose

public void dispose()
             throws InvalidBrowserException
Clean up and get rid of this browser. When this method is called, the event queue will be processed, the browser will shut down, and any subsequent calls to browser methods will result in InvalidBrowserException's being generated.

Specified by:
dispose in interface ExternalBrowser
Throws:
InvalidBrowserException

createScene

public X3DScene createScene(ProfileInfo profile,
                            ComponentInfo[] components)
                     throws InvalidBrowserException
Description copied from interface: Browser
Create a new, empty scene that can be used to programmatically fill in new scenes. This scene has the give profile and/or component information set, and is not currently being rendered. Either argument may be null, but not both arguments. If the profile is null, then the default profile of "NONE" is used, and only the components are used. The scene version is set to the highest supported version of the specification that this browser currently implements.

Specified by:
createScene in interface Browser
Parameters:
profile - The profile to use for this scene or null for none
components - The list of components to use or null
Returns:
A new empty scene to work with
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.createScene(org.web3d.x3d.sai.ProfileInfo, org.web3d.x3d.sai.ComponentInfo[])

createX3DFromString

public X3DScene createX3DFromString(java.lang.String string)
                             throws InvalidBrowserException,
                                    InvalidX3DException
Description copied from interface: Browser
Parse the given string and turn this into a list of X3D nodes. Method is a blocking call that won't return until all of the top level nodes defined in the string have been returned.

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 - either UTF8 or XML encoding. The X3D header line is not required to be present in the string if UTF8 syntax.

Specified by:
createX3DFromString in interface Browser
Parameters:
string - The string containing VRML string syntax
Returns:
The scene that was created from the string.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
InvalidX3DException - If the string does not contain legal X3D/VRML syntax or no node instantiations
See Also:
Browser.createX3DFromString(java.lang.String)

createX3DFromStream

public X3DScene createX3DFromStream(java.io.InputStream is)
                             throws InvalidBrowserException,
                                    InvalidX3DException,
                                    java.io.IOException
Description copied from interface: Browser
Parse the contents of the stream and interpret it as X3D content. The browser shall interpret the content using the initial characters of the stream to determine which encoding and file format is used.

Specified by:
createX3DFromStream in interface Browser
Parameters:
is - The input stream that contains the content to parse
Returns:
The scene that was created from the string.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
InvalidX3DException - If the string does not contain legal X3D/VRML syntax or no node instantiations
java.io.IOException - An I/O Error occurred while reading the stream
See Also:
Browser.createX3DFromStream(java.io.InputStream)

createX3DFromURL

public X3DScene createX3DFromURL(java.lang.String[] url)
                          throws InvalidBrowserException,
                                 InvalidURLException,
                                 InvalidX3DException
Description copied from interface: Browser
Create and load X3D from the given URL. The call will not return until the basic top-level scene has been processed or an error has occurred. Inlines, textures, sound and externprotos are not guaranteed to be loaded at this time. If the caller needs to know what the final URL was that loaded, use the getWorldURL() call from the returned scene.

Specified by:
createX3DFromURL in interface Browser
Parameters:
url - The list of URLs in decreasing order of preference as defined in the VRML97/X3D specification.
Returns:
The scene that was created from the URLs.
Throws:
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
InvalidX3DException - If the string does not contain legal X3D/VRML syntax or no node instantiations
See Also:
Browser.createX3DFromURL(java.lang.String[])

getComponent

public ComponentInfo getComponent(java.lang.String name,
                                  int level)
                           throws InvalidBrowserException,
                                  NotSupportedException
Description copied from interface: Browser
Get a specific component at the requested support level.

Specified by:
getComponent in interface Browser
Parameters:
name - The component name
level - The minimum component level
Returns:
The specified component
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
NotSupportedException - The reqested profile is not supported
See Also:
Browser.getComponent(java.lang.String, int)

getCurrentSpeed

public float getCurrentSpeed()
                      throws InvalidBrowserException
Description copied from interface: Browser
Get the current velocity of the bound viewpoint in meters per second. The velocity is defined in terms of the world values, not the local coordinate system of the viewpoint.

Specified by:
getCurrentSpeed in interface Browser
Returns:
The velocity in m/s or 0.0 if not supported
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.getCurrentSpeed()

getCurrentFrameRate

public float getCurrentFrameRate()
                          throws InvalidBrowserException
Description copied from interface: Browser
Get the current frame rate of the browser in frames per second.

Specified by:
getCurrentFrameRate in interface Browser
Returns:
The current frame rate or 0.0 if not supported
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.getCurrentFrameRate()

getExecutionContext

public X3DExecutionContext getExecutionContext()
                                        throws InvalidBrowserException
Description copied from interface: Browser
Get the information about the current scene. If no scene has been set then this will return null.

Specified by:
getExecutionContext in interface Browser
Returns:
The current scene data
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.getExecutionContext()

getName

public java.lang.String getName()
                         throws InvalidBrowserException
Returns the name of the Browser.

Specified by:
getName in interface Browser
Returns:
The name of the Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.getName()

getProfile

public ProfileInfo getProfile(java.lang.String profileName)
Description copied from interface: Browser
Get a specific profile.

Specified by:
getProfile in interface Browser
Parameters:
profileName - The profile name
Returns:
The specified profile
See Also:
Browser.getProfile(java.lang.String)

getSupportedComponents

public ComponentInfo[] getSupportedComponents()
Description copied from interface: Browser
Get a listing of all the components that this browser implementation is capable of supporting.

Specified by:
getSupportedComponents in interface Browser
Returns:
The listing of all supported components
See Also:
Browser.getSupportedComponents()

getSupportedProfiles

public ProfileInfo[] getSupportedProfiles()
Description copied from interface: Browser
Get a listing of the profiles that this browser implementation is capable of supporting.

Specified by:
getSupportedProfiles in interface Browser
Returns:
The listing of all supported profiles
See Also:
Browser.getSupportedProfiles()

getVersion

public java.lang.String getVersion()
                            throws InvalidBrowserException
Returns the version string for this Browser.

Specified by:
getVersion in interface Browser
Returns:
The version string for this Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.getVersion()

importDocument

public X3DScene importDocument(org.w3c.dom.Node aDocument)
Description copied from interface: Browser
A utility request to import a W3C DOM document or document fragment and convert it to an X3D scene. The method only performs a conversion process and does not display the resulting scene. The scene may then be used as the argument for the replaceWorld service. When the conversion is made, there is no lasting connection between the DOM and the generated scene. Each request shall be a one-off conversion attempt (the conversion may not be successful if the DOM does not match the X3D scene graph structure).

Specified by:
importDocument in interface Browser
Parameters:
aDocument - The root element to convert
Returns:
A scene representation corresponding to the document
See Also:
Browser.importDocument(org.w3c.dom.Node)

loadURL

public void loadURL(java.lang.String[] urls,
                    java.util.Map params)
             throws InvalidBrowserException,
                    InvalidURLException
Description copied from interface: Browser
Load the URL as the new root of the scene. Replaces all the current scene graph with the new world. A non-blocking call that will change the contents at some time in the future.

Generates an immediate SHUTDOWN event and then when the new contents are ready to be loaded, sends an INITIALIZED event.

Specified by:
loadURL in interface Browser
Parameters:
urls - 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
Throws:
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
See Also:
Browser.loadURL(java.lang.String[], java.util.Map)

replaceWorld

public void replaceWorld(X3DScene scene)
                  throws java.lang.IllegalArgumentException,
                         InvalidBrowserException
Description copied from interface: Browser
Replace the current world with the given nodes. Replaces the entire contents of the VRML world with the new nodes. Any node references that belonged to the previous world are still valid but no longer form part of the scene graph (unless it is these nodes passed to this method). The URL of the world still represents the just unloaded world.

Calling this method causes a SHUTDOWN event followed by an INITIALIZED event to be generated.

Specified by:
replaceWorld in interface Browser
Parameters:
scene - The new scene to render in the browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
java.lang.IllegalArgumentException
See Also:
Browser.replaceWorld(org.web3d.x3d.sai.X3DScene)

getDescription

public java.lang.String getDescription()
                                throws InvalidBrowserException
Get the description of the current world.

Specified by:
getDescription in interface Browser
Returns:
A description string or null if none set
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
ConnectionException - An error occurred in the connection to the browser.

setDescription

public void setDescription(java.lang.String newDescription)
                    throws InvalidBrowserException
Description copied from interface: Browser
Set the description of the current world. If the world is operating as part of a web browser then it shall attempt to set the title of the window. If the browser is from a component then the result is dependent on the implementation

Specified by:
setDescription in interface Browser
Parameters:
newDescription - The description string to set.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
See Also:
Browser.setDescription(java.lang.String)

getRenderingProperties

public java.util.Map getRenderingProperties()
                                     throws InvalidBrowserException,
                                            InvalidOperationTimingException
Get the collection of rendering properties that the browser provides. Rendering properties are key/value pairs, as defined in table 9.2 of ISO/IEC 19775-1. Keys are instances of Strings, while the value is dependent on the property. If the property is not defined in the returned map, treat it as not being supported by the browser.

Specified by:
getRenderingProperties in interface Browser
Returns:
A read-only map of the list of properties defined by the browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
ConnectionException - An error occurred in the connection to the browser.
InvalidOperationTimingException - This was not called during the correct timing during a script (may be called at any time from external)

getBrowserProperties

public java.util.Map getBrowserProperties()
                                   throws InvalidBrowserException,
                                          InvalidOperationTimingException
Get the collection of browser properties that the browser provides. Rendering properties are key/value pairs, as defined in table 9.2 of ISO/IEC 19775-1. Keys are instances of Strings, while the value is dependent on the property. If the property is not defined in the returned map, treat it as not being supported by the browser.

Specified by:
getBrowserProperties in interface Browser
Returns:
A read-only map of the list of properties defined by the browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.
ConnectionException - An error occurred in the connection to the browser.
InvalidOperationTimingException - This was not called during the correct timing during a script (may be called at any time from external)

nextViewpoint

public void nextViewpoint()
                   throws InvalidBrowserException
Bind the next viewpoint in the list. The definition of "next" is not specified, and may be browser dependent. If only one viewpoint is declared, this method does nothing.

Specified by:
nextViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

nextViewpoint

public void nextViewpoint(int layer)
                   throws InvalidBrowserException
Bind the next viewpoint in the list. The definition of "next" is not specified, and may be browser dependent. If only one viewpoint is declared, this method does nothing.

Specified by:
nextViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

previousViewpoint

public void previousViewpoint()
                       throws InvalidBrowserException
Bind the previous viewpoint in the list. The definition of "previous" is not specified, and may be browser dependent. If only one viewpoint is declared, this method does nothing.

Specified by:
previousViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

previousViewpoint

public void previousViewpoint(int layer)
                       throws InvalidBrowserException
Bind the previous viewpoint in the list. The definition of "previous" is not specified, and may be browser dependent. If only one viewpoint is declared, this method does nothing.

Specified by:
previousViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

firstViewpoint

public void firstViewpoint()
                    throws InvalidBrowserException
Bind the first viewpoint in the list. This is the first viewpoint declared in the user's file. ie The viewpoint that would be bound by default on loading.

Specified by:
firstViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

firstViewpoint

public void firstViewpoint(int layer)
                    throws InvalidBrowserException
Bind the first viewpoint in the list. This is the first viewpoint declared in the user's file. ie The viewpoint that would be bound by default on loading.

Specified by:
firstViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

lastViewpoint

public void lastViewpoint()
                   throws InvalidBrowserException
Bind the last viewpoint in the list.

Specified by:
lastViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

lastViewpoint

public void lastViewpoint(int layer)
                   throws InvalidBrowserException
Bind the last viewpoint in the list.

Specified by:
lastViewpoint in interface Browser
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

print

public void print(java.lang.Object msg)
           throws InvalidBrowserException
Print the message to the browser console without wrapping a new line onto it.

Specified by:
print in interface Browser
Parameters:
msg - The object to be printed
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

println

public void println(java.lang.Object msg)
             throws InvalidBrowserException
Print the message to the browser console and append a new line onto it.

Specified by:
println in interface Browser
Parameters:
msg - The object to be printed
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

browserInitialized

public void browserInitialized(VRMLScene newScene)
Description copied from interface: BrowserCoreListener
The browser has been initialised with new content. The content given is found in the accompanying scene and description.

Specified by:
browserInitialized in interface BrowserCoreListener
Parameters:
newScene - The scene of the new content
See Also:
BrowserCoreListener.browserInitialized(org.web3d.vrml.nodes.VRMLScene)

urlLoadFailed

public void urlLoadFailed(java.lang.String msg)
The browser tried to load a URL and failed. It is typically because none of the URLs resolved to anything valid or there were network failures.

Specified by:
urlLoadFailed in interface BrowserCoreListener
Parameters:
msg - An error message to go with the failure

browserShutdown

public void browserShutdown()
Description copied from interface: BrowserCoreListener
The browser has been shut down and the previous content is no longer valid.

Specified by:
browserShutdown in interface BrowserCoreListener
See Also:
BrowserCoreListener.browserShutdown()

browserDisposed

public void browserDisposed()
Description copied from interface: BrowserCoreListener
The browser has been disposed, all resources may be freed.

Specified by:
browserDisposed in interface BrowserCoreListener
See Also:
BrowserCoreListener.browserDisposed()

initializeWorld

public void initializeWorld()
Initialize the world to a known state. This is necessary to ensure that all of the underlying behaviors are active (which the buffering system relies on). As such, this method calls down to the browser core and common browser instances directly rather than using the SAI methods.


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium