public interface Paintable
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
Modifier and Type | Method and Description |
---|---|
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.
|
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.Copyright © 1996–2017. All rights reserved.