public class Appearance extends SceneGraphNode
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.
If you wish to remove an attribute value from the key foo, call
setAttribute(foo, Appearance.INHERITED);
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
Modifier and Type | Field and Description |
---|---|
static Object |
DEFAULT |
static Object |
INHERITED |
Constructor and Description |
---|
Appearance() |
Appearance(String name) |
Modifier and Type | Method and Description |
---|---|
void |
accept(SceneGraphVisitor v)
The accept method for a SceneGraphVisitor.
|
void |
addAppearanceListener(AppearanceListener listener) |
Object |
getAttribute(String key) |
Object |
getAttribute(String key,
Class type) |
HashMap<String,Object> |
getAttributes() |
Set<String> |
getStoredAttributes() |
void |
removeAppearanceListener(AppearanceListener listener) |
void |
setAttribute(String key,
boolean value) |
void |
setAttribute(String key,
char value) |
void |
setAttribute(String key,
double value)
these methods without a Object input overload setAttributes for different input and calls setAttribute(String key, Object 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)
made for easier typing.
|
void |
setAttribute(String key,
Object value,
Class declaredType)
adds or removes the attribute to the hashmap of the appearance node
|
String |
toString()
Return a string representation of the current state.
|
getName, getOwner, getThreadSafe, isReadOnly, setName, setOwner, setReadOnly, setThreadSafe
public static final Object DEFAULT
public static final Object INHERITED
public Appearance(String name)
public Appearance()
public String toString()
SceneGraphNode
toString
in class SceneGraphNode
public void setAttribute(String key, Object value)
key
- value
- public void setAttribute(String key, Object value, Class declaredType)
key
- value
- declaredType
- public void setAttribute(String key, double value)
key
- value
- public void setAttribute(String key, float value)
public void setAttribute(String key, int value)
public void setAttribute(String key, long value)
public void setAttribute(String key, boolean value)
public void setAttribute(String key, char value)
public void addAppearanceListener(AppearanceListener listener)
public void removeAppearanceListener(AppearanceListener listener)
public void accept(SceneGraphVisitor v)
SceneGraphNode
accept
in class SceneGraphNode