|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.emn.lite.LiteContext
LiteAttribute provides static methods to modify or initialize a LiteContext.
This allows LiteContext to accept new subclassed LiteAttributes. You must assign a DIFFERENT ID to each LiteAttribute subclass.
Examples of use:
LiteColor.set(context, new LiteColor(Color.black));
LiteColor.set(context, null); // unset
LiteColor c = LiteColor.get(context);
To make a context the current context, use install:
context.install(g);
Or, if you want to install a context temporarily:
LiteContext old = context.install(g);
...
old.install(g);
Constructor Summary | |
LiteContext()
|
Method Summary | |
java.util.Map |
attributes()
|
void |
extract(java.awt.Graphics2D g)
Updates from Graphics2D all attributes that are already defined. |
LiteAttribute |
getAttribute(java.lang.String id)
|
LiteContext |
install(java.awt.Graphics2D g)
Installs all defined attributes in Graphics2D and returns Graphics2D's old attributes. |
void |
setAttribute(java.lang.String id,
LiteAttribute a)
call setAttribute(id, null) to unset an attribute |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LiteContext()
Method Detail |
public java.util.Map attributes()
public void extract(java.awt.Graphics2D g)
This has NO EFFECT on an empty instance.
public LiteAttribute getAttribute(java.lang.String id)
public LiteContext install(java.awt.Graphics2D g)
public void setAttribute(java.lang.String id, LiteAttribute a)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |