CSP for Java
(JCSP) 1.1-rc4

org.jcsp.awt
Interface Paintable

All Known Implementing Classes:
DisplayList

public interface Paintable

Active components may delegate their paint and update methods to objects implementing this interface.

Description

Objects implementing Paintable may be passed to an Active component (such as 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.

Author:
P.H. Welch
See Also:
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

register

void register(Component c)
Register the Component that will delegate its paint and update methods here.

Parameters:
c - the Component that will do the delegating.

paint

void paint(Graphics g)
This is the call-back delegated here by the registered Component. It will normally be the JVM event thread that is making this call.

Parameters:
g - the graphics context for the painting.

update

void update(Graphics g)
This is the call-back delegated here by the registered Component. It will normally be the JVM event thread that is making this call.

Parameters:
g - the graphics context for the painting.

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.