org.xith3d.scenegraph
Class SceneGraphObject

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject
Direct Known Subclasses:
Node, NodeComponent, View

public abstract class SceneGraphObject
extends java.lang.Object
implements org.jagatoo.datatypes.NamableObject

The base class for all objects contained in a scene graph.


Field Summary
protected static java.lang.Object XITH3D_USERDATAKEY_OLDUSERDATA
          This is the key used to store the user data from the setUserData(Object) method.
 
Constructor Summary
SceneGraphObject()
          Constructs a new SceneGraphObject.
 
Method Summary
 java.lang.String getName()
           
 java.lang.Object getUserData()
          Get user specific data for this SceneGraphObject.
 java.lang.Object getUserData(java.lang.Object key)
          Gets the Object associated with the given key.
 java.util.Map<java.lang.Object,java.lang.Object> getUserDataMap()
          Get the Map of meta-data for the object.
 boolean isLive()
          Is the object live in a scene graph.
protected  boolean setLive(boolean live)
          Sets the live state of the object
 void setName(java.lang.String name)
           
 void setUserData(java.lang.Object userData)
          Set user specific data for this SceneGraphObject.
 void setUserData(java.lang.Object key, java.lang.Object value)
          Set a meta-data value into the user data container.
 void setUserDataRecursive(java.lang.Object key, java.lang.Object value)
          Sets a meta-data value into the user data container, recursively into all its children
static void setUserDataRecursive(SceneGraphObject object, java.lang.Object key, java.lang.Object value)
          Set a meta-data value into the user data container, recursively into all its children
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XITH3D_USERDATAKEY_OLDUSERDATA

protected static final java.lang.Object XITH3D_USERDATAKEY_OLDUSERDATA
This is the key used to store the user data from the setUserData(Object) method. Used to maintain Java3D compatability. Note that Object-type key is used to guarantee that conventional (old) user data namespace will never intersect with other user-defined namespaces.

Constructor Detail

SceneGraphObject

public SceneGraphObject()
Constructs a new SceneGraphObject.

Method Detail

setLive

protected boolean setLive(boolean live)
Sets the live state of the object

Parameters:
live -
Returns:
true, if the state has changed

isLive

public final boolean isLive()
Is the object live in a scene graph.


getUserDataMap

public java.util.Map<java.lang.Object,java.lang.Object> getUserDataMap()
Get the Map of meta-data for the object.

Returns:
The Map of meta-data for this object.

setUserData

public void setUserData(java.lang.Object key,
                        java.lang.Object value)
Set a meta-data value into the user data container.

Parameters:
key - The key to use to lookup the value.
value - The value associated with the key.

setUserDataRecursive

public static void setUserDataRecursive(SceneGraphObject object,
                                        java.lang.Object key,
                                        java.lang.Object value)
Set a meta-data value into the user data container, recursively into all its children

Parameters:
key - The key to use to lookup the value.
value - The value associated with the key.

setUserDataRecursive

public void setUserDataRecursive(java.lang.Object key,
                                 java.lang.Object value)
Sets a meta-data value into the user data container, recursively into all its children

Parameters:
key - The key to use to lookup the value.
value - The value associated with the key.

getUserData

public java.lang.Object getUserData(java.lang.Object key)
Gets the Object associated with the given key.

Returns:
The object associated with the given key or null if not found.

setUserData

public void setUserData(java.lang.Object userData)
Set user specific data for this SceneGraphObject.


getUserData

public java.lang.Object getUserData()
Get user specific data for this SceneGraphObject.


setName

public void setName(java.lang.String name)
Specified by:
setName in interface org.jagatoo.datatypes.NamableObject

getName

public final java.lang.String getName()
Specified by:
getName in interface org.jagatoo.datatypes.NamedObject

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object