Xj3D 2.0 VRML/X3D Code API

org.xj3d.sai
Interface Xj3DBrowser

All Superinterfaces:
Browser, ExternalBrowser
All Known Implementing Classes:
SAIBrowser

public interface Xj3DBrowser
extends ExternalBrowser

Extension Xj3D-specific browser methods.

Only external browsers are able to make use of this interface.

Version:
$Revision: 1.4 $
Author:
Justin Couch

Field Summary
static int RENDER_FLAT
          The rendering style uses flat shading mode
static int RENDER_LINES
          The rendering style uses wireframe mode
static int RENDER_POINTS
          The rendering style uses point mode
static int RENDER_SHADED
          The rendering style uses a generic shading model
 
Method Summary
 void addStatusListener(Xj3DStatusListener l)
          Add a listener for status messages.
 Xj3DCADView getCADView()
          Fetch the copontent-specific interface for managing a CAD scene.
 int getMinimumFrameInterval()
          Get the currently set minimum frame cycle interval.
 Xj3DNavigationUIManager getNavigationManager()
          Fetch the interface that allows an external application to implement their own navigation user interface.
 int getRenderingStyle()
          Get the currently set rendering style.
 void removeStatusListener(Xj3DStatusListener l)
          Remove a listener for status messages.
 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.
 
Methods inherited from interface org.web3d.x3d.sai.ExternalBrowser
addBrowserListener, beginUpdate, dispose, endUpdate, pauseRender, removeBrowserListener, startRender, stopRender
 
Methods inherited from interface org.web3d.x3d.sai.Browser
createScene, createX3DFromStream, createX3DFromString, createX3DFromURL, firstViewpoint, firstViewpoint, getBrowserProperties, getComponent, getCurrentFrameRate, getCurrentSpeed, getDescription, getExecutionContext, getName, getProfile, getRenderingProperties, getSupportedComponents, getSupportedProfiles, getVersion, importDocument, lastViewpoint, lastViewpoint, loadURL, nextViewpoint, nextViewpoint, previousViewpoint, previousViewpoint, print, println, replaceWorld, setDescription
 

Field Detail

RENDER_POINTS

static final int RENDER_POINTS
The rendering style uses point mode

See Also:
Constant Field Values

RENDER_LINES

static final int RENDER_LINES
The rendering style uses wireframe mode

See Also:
Constant Field Values

RENDER_FLAT

static final int RENDER_FLAT
The rendering style uses flat shading mode

See Also:
Constant Field Values

RENDER_SHADED

static final int RENDER_SHADED
The rendering style uses a generic shading model

See Also:
Constant Field Values
Method Detail

setMinimumFrameInterval

void setMinimumFrameInterval(int millis)
                             throws InvalidBrowserException
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.

Parameters:
millis - The minimum time in milleseconds.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

getMinimumFrameInterval

int getMinimumFrameInterval()
                            throws InvalidBrowserException
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.

Returns:
The cycle interval time in milliseconds
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

setRenderingStyle

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

Parameters:
style - One of the RENDER_* constants
Throws:
java.lang.IllegalArgumentException - A style constant that is not recognized by the implementation was provided
InvalidBrowserException - The dispose method has been called on this browser reference.

getRenderingStyle

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

Returns:
one of the RENDER_ constants
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

setErrorReporter

void setErrorReporter(Xj3DErrorReporter reporter)
                      throws InvalidBrowserException
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.

Parameters:
reporter - The error reporter instance to use
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

addStatusListener

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

Parameters:
l - The listener instance to add
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

removeStatusListener

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

Parameters:
l - The listener instance to remove
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

getNavigationManager

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

Returns:
An interface allowing end-user code to manipulate the navigation.
Throws:
InvalidBrowserException - The dispose method has been called on this browser reference.

getCADView

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

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.

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium