j3d-vrml97-0.1.0

org.jdesktop.j3d.loaders.vrml97.impl
Class Browser

java.lang.Object
  extended by org.jdesktop.j3d.loaders.vrml97.impl.Browser

public class Browser
extends Object

Browser J3D structure:

The browser has two kinds of J3D structures: permanent structures which are changed the current scene and reset for each URL, and a scene branchgraph which holds the J3D tree parsed from the current VRML url.

The permanent BranchGroup is called browserRoot. It holds:

Views:

There is one View, PhysicalBody and PhysicalEnvironment which are used by the currently active Viewpoint and NavigationInfo.

Each file Viewpoint defines a new ViewPlaform, which get associated with the view when the viewpoint is bound.

There are default Viewpoint, NavigationInfo, Fog and Background VRML nodes which are used if the file does not define them

The initial VP, NI, Fog and BG are the value first seen from the file. This value will be bound in loadFinalize().

The VP, NI, Fog and BG stacks are used after the file is loaded. When each node is bound, if it is already on the stack, it removed itself from the stack and then it pushes itself onto the stack. The top entry on the stack is the currently active value.

The browser also has an ambient light and a directional light (the headlight). These are added to the TransformGroup which holds the ViewPlatform associated with the current Viewpoint.


Constructor Summary
Browser()
          Constructor for the Browser object
Browser(Canvas3D vc3d)
          Constructor for the Browser object
 
Method Summary
 void addCanvas3D(Canvas3D can)
          Adds a feature to the Canvas3D attribute of the Browser object
 void addRoute(BaseNode fromNode, String fromEventOut, BaseNode toNode, String toEventIn)
          Adds a feature to the Route attribute of the Browser object
protected  void addViewpoint(Viewpoint viewpoint)
          Adds a feature to the Viewpoint attribute of the Browser object
 void cleanUp()
          Description of the Method
protected  void clear()
          Description of the Method
 BaseNode[] createVrmlFromString(String vrmlSyntax)
          Description of the Method
 void createVrmlFromURL(String[] url, BaseNode node, String event)
          Description of the Method
 void deleteRoute(BaseNode fromNode, String fromEventOut, BaseNode toNode, String toEventIn)
          Description of the Method
 Canvas3D getCanvas3D()
          Gets the canvas3D attribute of the Browser object
 float getCurrentFrameRate()
          Gets the currentFrameRate attribute of the Browser object
 float getCurrentSpeed()
          Gets the currentSpeed attribute of the Browser object
 String getDescription()
          Gets the description attribute of the Browser object
 String getName()
          Gets the name attribute of the Browser object
 URL getURL()
          Gets the uRL attribute of the Browser object
 String getVersion()
          Gets the version attribute of the Browser object
 String[] getViewpointDescriptions()
          Gets the viewpointDescriptions attribute of the Browser object
 String getWorldURL()
          Gets the worldURL attribute of the Browser object
 void loadStringAsVrml(String sourceVrml)
          Description of the Method
 void loadURL(String[] urlString, String[] parameter)
          Description of the Method
 void outputTiming()
          Description of the Method
 void processEvent(AWTEvent evt)
          Description of the Method
 void removeCanvas3D(Canvas3D can)
          Description of the Method
 void replaceWorld(BaseNode[] nodes)
          Description of the Method
 void resetViewpoint()
          Description of the Method
 void setAutoSmooth(boolean s)
          Sets the autoSmooth attribute of the Browser object
 void setAWTContainer(Container container)
          Sets the aWTContainer attribute of the Browser object
protected  void setDefTable(Hashtable t)
          Sets the defTable attribute of the Browser object
 void setDescription(String description)
          Sets the description attribute of the Browser object
 void setViewpoint(int vi)
          Sets the viewpoint attribute of the Browser object
 void shutDown()
          Description of the Method
 void startRender()
          Description of the Method
 void stopRender()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Browser

public Browser(Canvas3D vc3d)
Constructor for the Browser object

Parameters:
vc3d - Description of the Parameter

Browser

public Browser()
Constructor for the Browser object

Method Detail

loadURL

public void loadURL(String[] urlString,
                    String[] parameter)
             throws InvalidVRMLSyntaxException,
                    IOException,
                    MalformedURLException
Description of the Method

Parameters:
urlString - Description of the Parameter
parameter - Description of the Parameter
Throws:
InvalidVRMLSyntaxException - Description of the Exception
IOException - Description of the Exception
MalformedURLException - Description of the Exception

loadStringAsVrml

public void loadStringAsVrml(String sourceVrml)
Description of the Method

Parameters:
sourceVrml - Description of the Parameter

clear

protected void clear()
Description of the Method


addViewpoint

protected void addViewpoint(Viewpoint viewpoint)
Adds a feature to the Viewpoint attribute of the Browser object

Parameters:
viewpoint - The feature to be added to the Viewpoint attribute

setViewpoint

public void setViewpoint(int vi)
Sets the viewpoint attribute of the Browser object

Parameters:
vi - The new viewpoint value

resetViewpoint

public void resetViewpoint()
Description of the Method


getViewpointDescriptions

public String[] getViewpointDescriptions()
Gets the viewpointDescriptions attribute of the Browser object

Returns:
The viewpointDescriptions value

outputTiming

public void outputTiming()
Description of the Method


shutDown

public void shutDown()
Description of the Method


getCanvas3D

public Canvas3D getCanvas3D()
Gets the canvas3D attribute of the Browser object

Returns:
The canvas3D value

createVrmlFromURL

public void createVrmlFromURL(String[] url,
                              BaseNode node,
                              String event)
                       throws InvalidVRMLSyntaxException
Description of the Method

Parameters:
url - Description of the Parameter
node - Description of the Parameter
event - Description of the Parameter
Throws:
InvalidVRMLSyntaxException - Description of the Exception

getName

public String getName()
Gets the name attribute of the Browser object

Returns:
The name value

getVersion

public String getVersion()
Gets the version attribute of the Browser object

Returns:
The version value

getCurrentSpeed

public float getCurrentSpeed()
Gets the currentSpeed attribute of the Browser object

Returns:
The currentSpeed value

getCurrentFrameRate

public float getCurrentFrameRate()
Gets the currentFrameRate attribute of the Browser object

Returns:
The currentFrameRate value

getWorldURL

public String getWorldURL()
Gets the worldURL attribute of the Browser object

Returns:
The worldURL value

replaceWorld

public void replaceWorld(BaseNode[] nodes)
Description of the Method

Parameters:
nodes - Description of the Parameter

createVrmlFromString

public BaseNode[] createVrmlFromString(String vrmlSyntax)
                                throws InvalidVRMLSyntaxException
Description of the Method

Parameters:
vrmlSyntax - Description of the Parameter
Returns:
Description of the Return Value
Throws:
InvalidVRMLSyntaxException - Description of the Exception

setDefTable

protected void setDefTable(Hashtable t)
Sets the defTable attribute of the Browser object

Parameters:
t - The new defTable value

setDescription

public void setDescription(String description)
Sets the description attribute of the Browser object

Parameters:
description - The new description value

getDescription

public String getDescription()
Gets the description attribute of the Browser object

Returns:
The description value

addRoute

public void addRoute(BaseNode fromNode,
                     String fromEventOut,
                     BaseNode toNode,
                     String toEventIn)
Adds a feature to the Route attribute of the Browser object

Parameters:
fromNode - The feature to be added to the Route attribute
fromEventOut - The feature to be added to the Route attribute
toNode - The feature to be added to the Route attribute
toEventIn - The feature to be added to the Route attribute

deleteRoute

public void deleteRoute(BaseNode fromNode,
                        String fromEventOut,
                        BaseNode toNode,
                        String toEventIn)
Description of the Method

Parameters:
fromNode - Description of the Parameter
fromEventOut - Description of the Parameter
toNode - Description of the Parameter
toEventIn - Description of the Parameter

processEvent

public void processEvent(AWTEvent evt)
Description of the Method

Parameters:
evt - Description of the Parameter

startRender

public void startRender()
Description of the Method


stopRender

public void stopRender()
Description of the Method


cleanUp

public void cleanUp()
Description of the Method


getURL

public URL getURL()
Gets the uRL attribute of the Browser object

Returns:
The uRL value

removeCanvas3D

public void removeCanvas3D(Canvas3D can)
Description of the Method

Parameters:
can - Description of the Parameter

addCanvas3D

public void addCanvas3D(Canvas3D can)
Adds a feature to the Canvas3D attribute of the Browser object

Parameters:
can - The feature to be added to the Canvas3D attribute

setAWTContainer

public void setAWTContainer(Container container)
Sets the aWTContainer attribute of the Browser object

Parameters:
container - The new aWTContainer value

setAutoSmooth

public void setAutoSmooth(boolean s)
Sets the autoSmooth attribute of the Browser object

Parameters:
s - The new autoSmooth value

j3d-vrml97-0.1.0

Todo: put BSD License reference here..