Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class BaseSceneGraphObject

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.BaseSceneGraphObject

public abstract class BaseSceneGraphObject
extends SceneGraphObject

A general purpose container class to allow end users to extend the basic geometry capabilities, while still providing a way to manage scene graph state such as liveness calls and update handlers.

A lot of the state calls of children can only be called by extending the class and calling protected methods. When a child scenegraph object is defined for a collection of children outside of the base aviatrix3d package there is no way for passing in liveness state due to the protected nature of the required methods. This class provides methods that allow a derived class to call back into the package and set those states.

Version:
$Revision: 2.1 $
Author:
Alan Hudson, Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Constructor Summary
protected BaseSceneGraphObject()
          The default constructor
 
Method Summary
protected  void checkForCyclicChild(SceneGraphObject node, SceneGraphObject parent)
          Check to see if this node is the same reference as the passed node that is a parent of this node.
protected  void checkForCyclicParent(SceneGraphObject node, SceneGraphObject child)
          Check to see if this node is the same reference as the passed node.
protected  void clearUpdateHandler(SceneGraphObject node)
          Clear the scenegraph update handler for this node.
protected  void setLive(SceneGraphObject node, boolean state)
          Set the live state of the given node to this state.
protected  void setUpdateHandler(SceneGraphObject node)
          Set the scenegraph update handler for this node.
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseSceneGraphObject

protected BaseSceneGraphObject()
The default constructor

Method Detail

setLive

protected void setLive(SceneGraphObject node,
                       boolean state)
Set the live state of the given node to this state.

Parameters:
state - The new liveness state to set
node - The node instance to set the live state on

checkForCyclicParent

protected void checkForCyclicParent(SceneGraphObject node,
                                    SceneGraphObject child)
                             throws CyclicSceneGraphStructureException
Check to see if this node is the same reference as the passed node. This is the upwards check to ensure that there is no cyclic scene graph structures at the point where someone adds a node to the scenegraph. When the reference and this are the same, an exception is generated.

Parameters:
child - The reference to check against this class
node - The node instance to check on
Throws:
CyclicSceneGraphStructureException - Equal parent and child

checkForCyclicChild

protected void checkForCyclicChild(SceneGraphObject node,
                                   SceneGraphObject parent)
                            throws CyclicSceneGraphStructureException
Check to see if this node is the same reference as the passed node that is a parent of this node. This is the downwards check to ensure that there is no cyclic scene graph structures at the point where someone adds a node to the scenegraph. When the reference and this are the same, an exception is generated. Since each class may have different lists of child node setups, this should be overriden by any class that can take children, and have the call passed along to the children.

Parameters:
node - The node instance to check on
parent - The reference to check against this class
Throws:
CyclicSceneGraphStructureException - Equal parent and child

setUpdateHandler

protected void setUpdateHandler(SceneGraphObject node)
Set the scenegraph update handler for this node. It will notify all its children of the value. A null value will clear the current handler.

Parameters:
node - The node instance to set the current handler on

clearUpdateHandler

protected void clearUpdateHandler(SceneGraphObject node)
Clear the scenegraph update handler for this node.

Parameters:
node - The node instance to set the state on

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org