public class EffectiveAppearance extends Object
Appearance
s arer designed to be inherited via the
scene graph tree structure. This class manages this inheritance mechanism.
To evaluate the actual state of the Appearance system at a point in a scene graph
specified by a SceneGraphPath
, one must essentially create a chain of
EffectiveAppearance's, one for each Appearance instance occurring on this path.
Requests for the value of a given key (getAttribute(String, Object)
and related
methods) cause a search "up" the tree towards the root, for an appearance which
containing this key.
If such an appearance is found, then the value is returned.
If it is not found, the the special value Appearance.INHERITED
is returned.
TODO: The details of this inheritance mechanism are quite complicated and need to be
further documented here. In particular, the '.' character plays a special role in the
key strings, allowing for example the key "foo"
to match a request for
the string "bar.foo"
.
Modifier and Type | Method and Description |
---|---|
static EffectiveAppearance |
create() |
EffectiveAppearance |
create(Appearance app) |
static EffectiveAppearance |
create(SceneGraphPath p) |
Appearance |
getApp() |
List |
getAppearanceHierarchy() |
boolean |
getAttribute(String key,
boolean value) |
char |
getAttribute(String key,
char value) |
double |
getAttribute(String key,
double value) |
float |
getAttribute(String key,
float value) |
int |
getAttribute(String key,
int value) |
long |
getAttribute(String key,
long value) |
Object |
getAttribute(String key,
Object defaultValue) |
Object |
getAttribute(String key,
Object defaultValue,
Class class1) |
static boolean |
matches(EffectiveAppearance eap,
SceneGraphPath p) |
String |
toString() |
public Appearance getApp()
public static EffectiveAppearance create()
public static EffectiveAppearance create(SceneGraphPath p)
public EffectiveAppearance create(Appearance app)
public double getAttribute(String key, double value)
public float getAttribute(String key, float value)
public int getAttribute(String key, int value)
public long getAttribute(String key, long value)
public boolean getAttribute(String key, boolean value)
public char getAttribute(String key, char value)
public static boolean matches(EffectiveAppearance eap, SceneGraphPath p)
public List getAppearanceHierarchy()