fi.hut.tml.xsmiles.mlfc.x3d
Class X3DRenderer

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.x3d.X3DRenderer
All Implemented Interfaces:
org.web3d.vrml.j3d.input.LinkSelectionListener

public class X3DRenderer
extends java.lang.Object
implements org.web3d.vrml.j3d.input.LinkSelectionListener

X3D Renderer - renders X3D (VRML like) documents - called from X3DMLFC for whole X3D docs and X3DElementImpl for parasite documents.


Field Summary
static MLFCListener mlfcListener
           
protected  java.util.HashMap refMap
          Dom to J3D refMap created from conversion
 
Constructor Summary
X3DRenderer(MLFC m)
          Initializes some private variables.
 
Method Summary
 boolean bindViewpoint(org.web3d.vrml.j3d.nodes.J3DViewpointNodeType vpn)
          Called from X3DAnchorElementImpl to bind (activate) a viewpoint.
 void cleanup()
          Clean up the X3D renderer - stop timers and renderers.
protected  java.lang.String getLocalname(java.lang.String tagname)
          Get local name of a node.
 void linkSelected(org.web3d.vrml.nodes.VRMLLinkNodeType node)
          Invoked when a link node has been activated.
static void loadXMLtexture(java.awt.Container container)
          Testing loading XML as texture.
 void refresh(org.w3c.dom.Node node)
          Refresh the X3D scene, reloads everything from the node.
 java.awt.Component render(org.w3c.dom.Node node)
          Convert X3D DOM doc into VRML graph and render it.
 void setSupportEvents(org.w3c.dom.Node node, boolean set)
          Whether we should support events for this document Can be set anytime, before or after conversion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

refMap

protected java.util.HashMap refMap
Dom to J3D refMap created from conversion


mlfcListener

public static MLFCListener mlfcListener
Constructor Detail

X3DRenderer

public X3DRenderer(MLFC m)
Initializes some private variables.

Method Detail

getLocalname

protected java.lang.String getLocalname(java.lang.String tagname)
Get local name of a node.

Parameters:
tagname - Tag name, including namspace prefix
Returns:
Tag name without namespace prefix

render

public java.awt.Component render(org.w3c.dom.Node node)
Convert X3D DOM doc into VRML graph and render it. cleanup() should be called when the document is no longer needed.

Parameters:
node - X3D root node
Returns:
component containing the X3D document. (rendered as heavy weight).

setSupportEvents

public void setSupportEvents(org.w3c.dom.Node node,
                             boolean set)
Whether we should support events for this document Can be set anytime, before or after conversion

Parameters:
set - Should events be supported

refresh

public void refresh(org.w3c.dom.Node node)
Refresh the X3D scene, reloads everything from the node.

Parameters:
node - X3D root node (X3DElement)

cleanup

public void cleanup()
Clean up the X3D renderer - stop timers and renderers. This method should be called to clean up the system when the document is no longer needed.


bindViewpoint

public boolean bindViewpoint(org.web3d.vrml.j3d.nodes.J3DViewpointNodeType vpn)
Called from X3DAnchorElementImpl to bind (activate) a viewpoint.

Parameters:
vpn - J3DViewpointNodeType
Returns:
true if everything was ok

linkSelected

public void linkSelected(org.web3d.vrml.nodes.VRMLLinkNodeType node)
Invoked when a link node has been activated. This is the node that has been selected.

Specified by:
linkSelected in interface org.web3d.vrml.j3d.input.LinkSelectionListener
Parameters:
node - The selected node

loadXMLtexture

public static void loadXMLtexture(java.awt.Container container)
Testing loading XML as texture.



X-Smiles 1.2