Active components may delegate their paint and update methods to objects implementing this interface.
The Paintable object may either be passed statically (via the component's ActiveCanvas.setPaintable<TT>setPaintable</TT> method, before the component starts running) or dynamically (via the component's ActiveCanvas.setGraphicsChannels<TT>toGraphics/fromGraphics</TT> channels).
Note: these operations are currently supported only for ActiveCanvas<TT>ActiveCanvas</TT> 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.
Type | Name 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. |
This is the call-back delegated here by the registered Component. It will normally be the JVM event thread that is making this call.
g
- the graphics context for the painting.Register the Component that will delegate its paint and update methods here.
c
- the Component that will do the delegating.This is the call-back delegated here by the registered Component. It will normally be the JVM event thread that is making this call.
g
- the graphics context for the painting.