de.jreality.scene
Class Appearance

java.lang.Object
  extended by de.jreality.scene.SceneGraphNode
      extended by de.jreality.scene.Appearance

public class Appearance
extends SceneGraphNode

The appearance node. Contains attributes of arbitrary type stored as (key,value) pairs in a HashMap. There are special methods for setting attributes whose values are common built-in types: double, float,int, boolean,and char.

You can query the state of the Appearance by using getAttribute(String). If not attribute has been defined for this key, the special object INHERITED is returned. Some wiser person will have to tell you when the special object DEFAULT is returned.

TODO: fire ONE single event that reports all changed attributes

Author:
Unknown

Field Summary
static Object DEFAULT
           
static Object INHERITED
           
 
Constructor Summary
Appearance()
           
Appearance(String name)
           
 
Method Summary
 void accept(SceneGraphVisitor v)
          The accept method for a SceneGraphVisitor.
 void addAppearanceListener(AppearanceListener listener)
           
 Object getAttribute(String key)
           
 Object getAttribute(String key, Class type)
           
 Set getStoredAttributes()
           
 void removeAppearanceListener(AppearanceListener listener)
           
 void setAttribute(String key, boolean value)
           
 void setAttribute(String key, char value)
           
 void setAttribute(String key, double value)
           
 void setAttribute(String key, float value)
           
 void setAttribute(String key, int value)
           
 void setAttribute(String key, long value)
           
 void setAttribute(String key, Object value)
           
 void setAttribute(String key, Object value, Class declaredType)
           
 
Methods inherited from class de.jreality.scene.SceneGraphNode
getName, getOwner, getThreadSafe, isReadOnly, setName, setOwner, setReadOnly, setThreadSafe, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final Object DEFAULT

INHERITED

public static final Object INHERITED
Constructor Detail

Appearance

public Appearance(String name)

Appearance

public Appearance()
Method Detail

getAttribute

public Object getAttribute(String key)

getAttribute

public Object getAttribute(String key,
                           Class type)

setAttribute

public void setAttribute(String key,
                         Object value)

setAttribute

public void setAttribute(String key,
                         Object value,
                         Class declaredType)

setAttribute

public void setAttribute(String key,
                         double value)

setAttribute

public void setAttribute(String key,
                         float value)

setAttribute

public void setAttribute(String key,
                         int value)

setAttribute

public void setAttribute(String key,
                         long value)

setAttribute

public void setAttribute(String key,
                         boolean value)

setAttribute

public void setAttribute(String key,
                         char value)

addAppearanceListener

public void addAppearanceListener(AppearanceListener listener)

removeAppearanceListener

public void removeAppearanceListener(AppearanceListener listener)

getStoredAttributes

public Set getStoredAttributes()

accept

public void accept(SceneGraphVisitor v)
Description copied from class: SceneGraphNode
The accept method for a SceneGraphVisitor.

Overrides:
accept in class SceneGraphNode