Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.runtime
Class BindableNodeManager

java.lang.Object
  extended byorg.web3d.vrml.nodes.runtime.BindableNodeManager
All Implemented Interfaces:
VRMLBindableNodeListener

public class BindableNodeManager
extends java.lang.Object
implements VRMLBindableNodeListener

The manager of bindable/activatable nodes at runtime.

This common manager is responsible for handling the details of a single type of bindable or activatable node. The primary difference between the two types is that bindable nodes also have a bindTime field that must be set at the time they get bound.

Version:
$Revision: 1.10 $
Author:
Justin Couch

Constructor Summary
BindableNodeManager()
          Create and initialise a route manager instance
 
Method Summary
 void addNode(VRMLBindableNodeType node, boolean isDefault)
          Add a bindable node to the management system.
 void clearAll()
          Clear all of the nodes that this manager is currently dealing with.
 VRMLBindableNodeType getBoundNode()
          Get the currently bound node.
 VRMLBindableNodeType getFirstNode()
          Fetch the first node that was added to the manager after it was cleared.
 void nodeIsBound(VRMLNodeType src, boolean yes)
          Notification that the environment has requested that this node be now bound or removed as the active node in the stack.
 void removeNode(VRMLBindableNodeType node)
          Remove a bindable node from the management system.
 void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 void setNodeChangeListener(BindableNodeListener l)
          Set the handler for node bind change events.
 void setVRMLClock(VRMLClock clk)
          Set the VRML clock instance that we are using so that we can set the bind time information for nodes that require it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindableNodeManager

public BindableNodeManager()
Create and initialise a route manager instance

Method Detail

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

setVRMLClock

public void setVRMLClock(VRMLClock clk)
Set the VRML clock instance that we are using so that we can set the bind time information for nodes that require it. A value of null can be used to clear the current clock instance.

Parameters:
clk - The new clock to set

getBoundNode

public VRMLBindableNodeType getBoundNode()
Get the currently bound node. If there are no nodes being managed then this will return null.

Returns:
The currently bound node

getFirstNode

public VRMLBindableNodeType getFirstNode()
Fetch the first node that was added to the manager after it was cleared. This is used to determine the default instance to use when the scene is first loaded. The concept of the first node is a bit grey and should really only be used during the scene setup phase. For example, if the end user deletes the first node from the runtime scene graph, does this call still make sense? We shouldn't really need to keep an ordered list of the items as they are added.

Returns:
The first added node

addNode

public void addNode(VRMLBindableNodeType node,
                    boolean isDefault)
Add a bindable node to the management system.

Parameters:
node - The instance to add to this manager
isDefault - Is this a default bindable

removeNode

public void removeNode(VRMLBindableNodeType node)
Remove a bindable node from the management system.

Parameters:
node - The instance to add to this manager

clearAll

public void clearAll()
Clear all of the nodes that this manager is currently dealing with. All listeners are removed and no watch is kept on the nodes.


setNodeChangeListener

public void setNodeChangeListener(BindableNodeListener l)
Set the handler for node bind change events. This will replace the current listener. A value of null will de-register the current listener instance.

Parameters:
l - The listener to be used or null

nodeIsBound

public void nodeIsBound(VRMLNodeType src,
                        boolean yes)
Notification that the environment has requested that this node be now bound or removed as the active node in the stack.

Specified by:
nodeIsBound in interface VRMLBindableNodeListener
Parameters:
src - The source node that is to be bound
yes - true if the node is to becoming active

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium