|
Graphics2D Actor API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectg2d.glyph.Identifiable
g2d.glyph.Attributable
public class Attributable
Those things that have Attributes. Attributes are indexed by a String as a key. They contain an Object as the value.
One can set attributes for each object instance or using static attributes that apply to all things Attributable.
| Field Summary |
|---|
| Fields inherited from class g2d.glyph.Identifiable |
|---|
DEBUG, uid |
| Constructor Summary | |
|---|---|
Attributable()
|
|
| Method Summary | |
|---|---|
Object |
getAttribute(String key)
Get value of given attribute. |
boolean |
getAttributeAsBoolean(String key,
boolean defaultValue)
|
byte |
getAttributeAsByte(String key,
byte defaultValue)
|
char |
getAttributeAsChar(String key,
char defaultValue)
|
double |
getAttributeAsDouble(String key,
double defaultValue)
|
float |
getAttributeAsFloat(String key,
float defaultValue)
|
int |
getAttributeAsInt(String key,
int defaultValue)
|
short |
getAttributeAsShort(String key,
short defaultValue)
|
String |
getAttributeAsString(String key,
String defaultValue)
|
String[] |
getKeys()
Obtain all keys of currently set attributes as an array. |
Object |
getStaticAttribute(String key)
Get value of given static attribute. |
String[] |
getStaticKeys()
Obtain all keys of currently set static attributes as an array. |
boolean |
isAttribute(String key)
Test whether given key is a valid attribute. |
boolean |
isStaticAttribute(String key)
Test whether given key is a valid static attribute. |
void |
setAttribute(String key,
Object value)
Set an attribute using the given parameters. |
void |
setStaticAttribute(String key,
Object value)
Set a static attribute using the given parameters. |
| Methods inherited from class g2d.glyph.Identifiable |
|---|
getObject, getUID, setUID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Attributable()
| Method Detail |
|---|
public void setAttribute(String key,
Object value)
key - String of key to identify attributevalue - Object that is value of this attributepublic boolean isAttribute(String key)
null as a value, this will still
result in true.
key - String of key to test attribute existence
true if attribute with given key
has been assigned before, false otherwisesetAttribute(java.lang.String, java.lang.Object)public Object getAttribute(String key)
null if attribute does not exist.
key - String of key to obtain attribute
null if attribute key does not exist)public String[] getKeys()
public void setStaticAttribute(String key,
Object value)
key - String of key to identify static attributevalue - Object that is value of this static attributepublic boolean isStaticAttribute(String key)
null as a value, this will still
result in true.
key - String of key to test static attribute existence
true if static attribute with given key
has been assigned before, false otherwisesetStaticAttribute(java.lang.String, java.lang.Object)public Object getStaticAttribute(String key)
null if static attribute does not exist.
key - String of key to obtain static attribute
null if attribute key does not exist)public String[] getStaticKeys()
public byte getAttributeAsByte(String key,
byte defaultValue)
public boolean getAttributeAsBoolean(String key,
boolean defaultValue)
public char getAttributeAsChar(String key,
char defaultValue)
public double getAttributeAsDouble(String key,
double defaultValue)
public float getAttributeAsFloat(String key,
float defaultValue)
public int getAttributeAsInt(String key,
int defaultValue)
public short getAttributeAsShort(String key,
short defaultValue)
public String getAttributeAsString(String key,
String defaultValue)
|
Graphics2D Actor API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||