|
CSP for Java (JCSP) 1.1-rc1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Paintable
Active components may delegate their paint and update methods to objects implementing this interface.
ActiveCanvas
). The Active component will
then register
with the Paintable object
and delegate to it its paint and update methods.
The Paintable object may either be passed statically
(via the component's setPaintable
method, before the component starts running) or dynamically
(via the component's
toGraphics/fromGraphics
channels).
Note: these operations are currently supported only for
ActiveCanvas
components.
A CSProcess may choose to implement Paintable itself and take
responsibility for its own painting/updating. However, this would break the JCSP
design pattern that the thread(s) of control within a running process have exclusive
access to the process state (since painting/updating is actually done by the
Java event thread). It is, therefore, better to delegate this task to
a different (and passive) object such as a DisplayList
.
ActiveCanvas
,
DisplayList
Method Summary | |
---|---|
void |
paint(Graphics g)
This is the call-back delegated here by the registered Component. |
void |
register(Component c)
Register the Component that will delegate its paint and update methods here. |
void |
update(Graphics g)
This is the call-back delegated here by the registered Component. |
Method Detail |
---|
void register(Component c)
c
- the Component that will do the delegating.void paint(Graphics g)
g
- the graphics context for the painting.void update(Graphics g)
g
- the graphics context for the painting.
|
CSP for Java (JCSP) 1.1-rc1 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |