|
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.sai.SAIBrowser
public class SAIBrowser
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.
| 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 |
|---|
public SAIBrowser(BrowserCore browserCore,
X3DCommonBrowser browserImpl,
RouteManager rm,
FrameStateManager fsm,
ExternalEventQueue eventQueue,
CursorManager cm,
ErrorReporter reporter)
browserImpl - The delegated browser implementationbrowserCore - 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 |
|---|
public void setErrorReporter(Xj3DErrorReporter reporter)
setErrorReporter in interface Xj3DBrowserreporter - The error reporter instance to usepublic void addStatusListener(Xj3DStatusListener l)
addStatusListener in interface Xj3DBrowserl - The listener instance to addpublic void removeStatusListener(Xj3DStatusListener l)
removeStatusListener in interface Xj3DBrowserl - The listener instance to removepublic Xj3DNavigationUIManager getNavigationManager()
getNavigationManager in interface Xj3DBrowserpublic Xj3DCursorUIManager getCursorManager()
public Xj3DCADView getCADView()
throws InvalidBrowserException
getCADView in interface Xj3DBrowserInvalidBrowserException - The dispose method has been called on
this browser reference.public void setMinimumFrameInterval(int millis)
setMinimumFrameInterval in interface Xj3DBrowsermillis - The minimum time in milleseconds.public int getMinimumFrameInterval()
getMinimumFrameInterval in interface Xj3DBrowser
public void setRenderingStyle(int style)
throws java.lang.IllegalArgumentException
setRenderingStyle in interface Xj3DBrowserstyle - One of the RENDER_* constants
java.lang.IllegalArgumentException - A style constant that is not recognized
by the implementation was providedpublic int getRenderingStyle()
getRenderingStyle in interface Xj3DBrowser
public void addBrowserListener(BrowserListener l)
throws InvalidBrowserException
addBrowserListener in interface ExternalBrowserl - 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 beginUpdate()
throws InvalidBrowserException
ExternalBrowserThis 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 ExternalBrowserInvalidBrowserException - The dispose method has been called on
this browser reference.ExternalBrowser.beginUpdate()
public void endUpdate()
throws InvalidBrowserException
ExternalBrowserThis 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 ExternalBrowserInvalidBrowserException - The dispose method has been called on
this browser reference.ExternalBrowser.endUpdate()public void pauseRender()
ExternalBrowser
pauseRender in interface ExternalBrowserExternalBrowser.pauseRender()
public void removeBrowserListener(BrowserListener l)
throws InvalidBrowserException
removeBrowserListener in interface ExternalBrowserl - The listener to remove from the list.
InvalidBrowserException - The dispose method has been called on
this browser reference.ExternalBrowser.removeBrowserListener(org.web3d.x3d.sai.BrowserListener)public void startRender()
ExternalBrowser
startRender in interface ExternalBrowserExternalBrowser.startRender()public void stopRender()
ExternalBrowser
stopRender in interface ExternalBrowserExternalBrowser.stopRender()
public void dispose()
throws InvalidBrowserException
dispose in interface ExternalBrowserInvalidBrowserException
public X3DScene createScene(ProfileInfo profile,
ComponentInfo[] components)
throws InvalidBrowserException
Browser
createScene in interface Browserprofile - The profile to use for this scene or null for nonecomponents - The list of components to use or null
InvalidBrowserException - The dispose method has been called on
this browser reference.Browser.createScene(org.web3d.x3d.sai.ProfileInfo, org.web3d.x3d.sai.ComponentInfo[])
public X3DScene createX3DFromString(java.lang.String string)
throws InvalidBrowserException,
InvalidX3DException
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 X3D syntax - either UTF8 or XML encoding. The X3D header line is not required to be present in the string if UTF8 syntax.
createX3DFromString in interface Browserstring - The string containing VRML string syntax
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 instantiationsBrowser.createX3DFromString(java.lang.String)
public X3DScene createX3DFromStream(java.io.InputStream is)
throws InvalidBrowserException,
InvalidX3DException,
java.io.IOException
Browser
createX3DFromStream in interface Browseris - The input stream that contains the content to parse
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 streamBrowser.createX3DFromStream(java.io.InputStream)
public X3DScene createX3DFromURL(java.lang.String[] url)
throws InvalidBrowserException,
InvalidURLException,
InvalidX3DException
Browser
createX3DFromURL in interface Browserurl - The list of URLs in decreasing order of preference as defined
in the VRML97/X3D specification.
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 instantiationsBrowser.createX3DFromURL(java.lang.String[])
public ComponentInfo getComponent(java.lang.String name,
int level)
throws InvalidBrowserException,
NotSupportedException
Browser
getComponent in interface Browsername - The component namelevel - The minimum component level
InvalidBrowserException - The dispose method has been called on
this browser reference.
NotSupportedException - The reqested profile is not supportedBrowser.getComponent(java.lang.String, int)
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 X3DExecutionContext getExecutionContext()
throws InvalidBrowserException
Browser
getExecutionContext in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getExecutionContext()
public java.lang.String getName()
throws InvalidBrowserException
getName in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getName()public ProfileInfo getProfile(java.lang.String profileName)
Browser
getProfile in interface BrowserprofileName - The profile name
Browser.getProfile(java.lang.String)public ComponentInfo[] getSupportedComponents()
Browser
getSupportedComponents in interface BrowserBrowser.getSupportedComponents()public ProfileInfo[] getSupportedProfiles()
Browser
getSupportedProfiles in interface BrowserBrowser.getSupportedProfiles()
public java.lang.String getVersion()
throws InvalidBrowserException
getVersion in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.Browser.getVersion()public X3DScene importDocument(org.w3c.dom.Node aDocument)
Browser
importDocument in interface BrowseraDocument - The root element to convert
Browser.importDocument(org.w3c.dom.Node)
public void loadURL(java.lang.String[] urls,
java.util.Map 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.util.Map)
public void replaceWorld(X3DScene scene)
throws java.lang.IllegalArgumentException,
InvalidBrowserException
BrowserCalling this method causes a SHUTDOWN event followed by an INITIALIZED event to be generated.
replaceWorld in interface Browserscene - The new scene to render in the browser
InvalidBrowserException - The dispose method has been called on
this browser reference.
java.lang.IllegalArgumentExceptionBrowser.replaceWorld(org.web3d.x3d.sai.X3DScene)
public java.lang.String getDescription()
throws InvalidBrowserException
getDescription in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
ConnectionException - An error occurred in the connection to the
browser.
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 java.util.Map getRenderingProperties()
throws InvalidBrowserException,
InvalidOperationTimingException
getRenderingProperties in interface BrowserInvalidBrowserException - 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)
public java.util.Map getBrowserProperties()
throws InvalidBrowserException,
InvalidOperationTimingException
getBrowserProperties in interface BrowserInvalidBrowserException - 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)
public void nextViewpoint()
throws InvalidBrowserException
nextViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void nextViewpoint(int layer)
throws InvalidBrowserException
nextViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void previousViewpoint()
throws InvalidBrowserException
previousViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void previousViewpoint(int layer)
throws InvalidBrowserException
previousViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void firstViewpoint()
throws InvalidBrowserException
firstViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void firstViewpoint(int layer)
throws InvalidBrowserException
firstViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void lastViewpoint()
throws InvalidBrowserException
lastViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void lastViewpoint(int layer)
throws InvalidBrowserException
lastViewpoint in interface BrowserInvalidBrowserException - The dispose method has been called on
this browser reference.
public void print(java.lang.Object msg)
throws InvalidBrowserException
print in interface Browsermsg - The object to be printed
InvalidBrowserException - The dispose method has been called on
this browser reference.
public void println(java.lang.Object msg)
throws InvalidBrowserException
println in interface Browsermsg - The object to be printed
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()
BrowserCoreListener
browserDisposed in interface BrowserCoreListenerBrowserCoreListener.browserDisposed()public 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 | |||||||||