de.jreality.scene
Class SceneGraphNode

java.lang.Object
  extended by de.jreality.scene.SceneGraphNode
Direct Known Subclasses:
Appearance, AudioSource, Camera, Geometry, Light, SceneGraphComponent, Transformation

public class SceneGraphNode
extends Object

Base class for scene graph member nodes. Common features of all scene graph nodes are an optional name and a read-only flag.

This class handles the thread-safe access to the state using a collection of protected and private methods for locked read and write access.

Many subclasses support specific listeners which notify interested parties of any change in state of the node. See the specific subclasses for details.


Constructor Summary
SceneGraphNode(String name)
           
 
Method Summary
 void accept(SceneGraphVisitor v)
          The accept method for a SceneGraphVisitor.
 String getName()
           
 Object getOwner()
           
static boolean getThreadSafe()
           
 boolean isReadOnly()
          Returns the readOnly flag
 void setName(String string)
           
 void setOwner(Object owner)
           
 void setReadOnly(boolean newReadOnlyState)
          Sets the readOnly flag
static void setThreadSafe(boolean b)
          Allow thread-unsafe access to all scene graph nodes, to optimize performance in case there are no threading issues.
 String toString()
          Return a string representation of the current state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SceneGraphNode

public SceneGraphNode(String name)
Method Detail

isReadOnly

public boolean isReadOnly()
Returns the readOnly flag

Returns:
boolean

setReadOnly

public void setReadOnly(boolean newReadOnlyState)
Sets the readOnly flag

Parameters:
newReadOnlyState - the desired readOnly flag value

getName

public String getName()

setName

public void setName(String string)

getOwner

public Object getOwner()

setOwner

public void setOwner(Object owner)

accept

public void accept(SceneGraphVisitor v)
The accept method for a SceneGraphVisitor.

Parameters:
a - visitor SceneGraphVisitor

toString

public String toString()
Return a string representation of the current state. Only for debugging purposes.

Overrides:
toString in class Object

setThreadSafe

public static void setThreadSafe(boolean b)
Allow thread-unsafe access to all scene graph nodes, to optimize performance in case there are no threading issues. Default is true.

Parameters:
b -

getThreadSafe

public static boolean getThreadSafe()