vrml
Class Browser

java.lang.Object
  extended by vrml.Browser

public class Browser
extends java.lang.Object

The browser interface provides a mechanism for scripts contained by Script nodes to get and set browser state.


Method Summary
 void addRoute(BaseNode fromNode, java.lang.String fromEventOut, BaseNode toNode, java.lang.String toEventIn)
          Add a route between the given event names for the given nodes.
 BaseNode[] createVrmlFromString(java.lang.String vrmlSyntax)
          This method parses a string consisting of VRML statements, establishes any PROTO and EXTERNPROTO declarations and routes, and returns an MFNode value containing the set of nodes in those statements.
 void createVrmlFromURL(java.lang.String[] url, BaseNode node, java.lang.String event)
          Instructs the browser to load a VRML scene description from the given URL or URLs.
 void deleteRoute(BaseNode fromNode, java.lang.String fromEventOut, BaseNode toNode, java.lang.String toEventIn)
          Delete a route between the given event names for the given nodes.
 float getCurrentFrameRate()
          Return the current frame rate in frames/second.
 float getCurrentSpeed()
          Returns the average navigation speed for the currently bound NavigationInfo node in meters/second.
 java.lang.String getName()
          Name of the browser currently in use.
 java.lang.String getVersion()
          Version of the browser currently in use.
 java.lang.String getWorldURL()
          Return the URL for the root of the currently loaded world.
 void loadURL(java.lang.String[] url, java.lang.String[] parameter)
          Loads the first recognized URL from the specified url field with the passed parameters.
 void replaceWorld(BaseNode[] nodes)
          Replaces the current world with the world represented by the passed nodes.
 void setDescription(java.lang.String description)
          Sets the passed string as the current description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Name of the browser currently in use.

Returns:
name of the browser

getVersion

public java.lang.String getVersion()
Version of the browser currently in use.

Returns:
version of the browser

getCurrentSpeed

public float getCurrentSpeed()
Returns the average navigation speed for the currently bound NavigationInfo node in meters/second.

Returns:
current speed in metres/second

getCurrentFrameRate

public float getCurrentFrameRate()
Return the current frame rate in frames/second.

Returns:
current frame rate

getWorldURL

public java.lang.String getWorldURL()
Return the URL for the root of the currently loaded world.

Returns:
root URL of the currently loaded world

replaceWorld

public void replaceWorld(BaseNode[] nodes)
Replaces the current world with the world represented by the passed nodes.

Parameters:
nodes - New world

createVrmlFromString

public BaseNode[] createVrmlFromString(java.lang.String vrmlSyntax)
                                throws InvalidVRMLSyntaxException
This method parses a string consisting of VRML statements, establishes any PROTO and EXTERNPROTO declarations and routes, and returns an MFNode value containing the set of nodes in those statements.

Parameters:
vrmlSyntax - VRML statements
Returns:
Array of nodes representing the given VRML statements.
Throws:
InvalidVRMLSyntaxException - If invalid syntax in string

createVrmlFromURL

public void createVrmlFromURL(java.lang.String[] url,
                              BaseNode node,
                              java.lang.String event)
                       throws InvalidVRMLSyntaxException
Instructs the browser to load a VRML scene description from the given URL or URLs. After the scene is loaded, the given event is sent to the passed node.

Parameters:
url - array of URLs
node - node to send event to
event - event to send to node
Throws:
InvalidVRMLSyntaxException - If URL contain invalid syntax

addRoute

public void addRoute(BaseNode fromNode,
                     java.lang.String fromEventOut,
                     BaseNode toNode,
                     java.lang.String toEventIn)
Add a route between the given event names for the given nodes.

Parameters:
fromNode - Node where route originates
fromEvenOut - Event Out where route originates
toNode - Node where route ends
toEventIn - Event In where route ends

deleteRoute

public void deleteRoute(BaseNode fromNode,
                        java.lang.String fromEventOut,
                        BaseNode toNode,
                        java.lang.String toEventIn)
Delete a route between the given event names for the given nodes.

Parameters:
fromNode - Node where route originates
fromEvenOut - Event Out where route originates
toNode - Node where route ends
toEventIn - Event In where route ends

loadURL

public void loadURL(java.lang.String[] url,
                    java.lang.String[] parameter)
             throws InvalidVRMLSyntaxException
Loads the first recognized URL from the specified url field with the passed parameters.

Parameters:
url - array of URLs
parameter - parameters to load URL with
Throws:
InvalidVRMLSyntaxException - If URL has invalid VRML syntax

setDescription

public void setDescription(java.lang.String description)
Sets the passed string as the current description

Parameters:
description - New description