Package org.xj3d.sai
Interface Xj3DBrowser
- All Superinterfaces:
Browser
,ExternalBrowser
- All Known Implementing Classes:
SAIBrowser
Extension Xj3D-specific browser methods.
Only external browsers are able to make use of this interface.
- Version:
- $Revision: 1.7 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The rendering style uses flat shading modestatic final int
The rendering style uses wireframe modestatic final int
The rendering style uses point modestatic final int
The rendering style uses a generic shading model -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener for status messages.void
captureFrames
(int n) Request that the browser capture the next n number of frames as images.Fetch the component-specific interface for managing a CAD scene.Fetch the interface that allows an external application to implement their own cursor user interface.int
Get the currently set minimum frame cycle interval.Fetch the interface that allows an external application to implement their own navigation user interface.int
Get the currently set rendering style.void
Pause the render and event cascade evaluation system.void
Remove a listener for status messages.void
Set the interceptor for the anchor node handling.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
Set the handler for processing screen captures.void
Start the render and event cascade evaluation system again after a pause or stop.void
Stop the render and event cascade evaluation system completely.Methods inherited from interface org.web3d.x3d.sai.Browser
createScene, createX3DFromStream, createX3DFromString, createX3DFromURL, firstViewpoint, firstViewpoint, getBrowserProperties, getComponentInfo, getCurrentFrameRate, getCurrentSpeed, getDescription, getExecutionContext, getName, getProfile, getRenderingProperties, getSupportedComponents, getSupportedProfiles, getVersion, importDocument, lastViewpoint, lastViewpoint, loadURL, nextViewpoint, nextViewpoint, previousViewpoint, previousViewpoint, print, println, replaceWorld, setDescription
Methods inherited from interface org.web3d.x3d.sai.ExternalBrowser
addBrowserListener, beginUpdate, dispose, endUpdate, removeBrowserListener
-
Field Details
-
RENDER_POINTS
static final int RENDER_POINTSThe rendering style uses point mode- See Also:
-
RENDER_LINES
static final int RENDER_LINESThe rendering style uses wireframe mode- See Also:
-
RENDER_FLAT
static final int RENDER_FLATThe rendering style uses flat shading mode- See Also:
-
RENDER_SHADED
static final int RENDER_SHADEDThe rendering style uses a generic shading model- See Also:
-
-
Method Details
-
setMinimumFrameInterval
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 milliseconds.- Throws:
InvalidBrowserException
- The dispose method has been called on this browser reference.
-
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.- Returns:
- The cycle interval time in milliseconds
- Throws:
InvalidBrowserException
- The dispose method has been called on this browser reference.
-
setRenderingStyle
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:
IllegalArgumentException
- A style constant that is not recognized by the implementation was providedInvalidBrowserException
- The dispose method has been called on this browser reference.
-
getRenderingStyle
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
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
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
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.
-
getCursorManager
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.
- Throws:
InvalidBrowserException
- The dispose method has been called on this browser reference.
-
getCADView
Fetch the component-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.
-
setAnchorListener
Set the interceptor for the anchor node handling. This can be used to process the clicks on Anchor nodes and replace or supplement the existing behaviour. See documentation of the listener for more specific details on usage patterns.Only one interceptor instance can be registered. Setting a new item will replace an existing registered instance. Setting a null value will clear the current set instance.
- Parameters:
l
- The interceptor instance to register or null to clear- Throws:
InvalidBrowserException
- The dispose method has been called on this browser reference.
-
captureFrames
Request that the browser capture the next n number of frames as images. This will begin from the frame after this method is called. If no screen capture listener is registered at the time this is called, the request is ignored.- Parameters:
n
- The number of frames to capture- Throws:
InvalidBrowserException
- The dispose method has been called on this browser reference.
-
setScreenCaptureListener
Set the handler for processing screen captures. This can be used to process images for saving to disc, processing or other task.Only one listener instance can be registered. Setting a new item will replace an existing registered instance. Setting a null value will clear the current set instance.
- Parameters:
l
- The processing instance to register or null to clear- Throws:
InvalidBrowserException
- The dispose method has been called on this browser reference.
-
startRender
void startRender()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. -
pauseRender
void pauseRender()Pause the render and event cascade evaluation system. -
stopRender
void stopRender()Stop the render and event cascade evaluation system completely. This will trigger the proper shutdown notifications being sent to all nodes and scripts.
-