CSP for Java
(JCSP) 1.1-rc4

Interface ActiveApplet.Configure

Enclosing class:

public static interface ActiveApplet.Configure

This enables general configuration of this component. Any object implementing this interface and sent down the configure channel to this component will have its configure method invoked on this component.

For example, to set the foreground/background colours, first define:

   private class AppletColours implements ActiveApplet.Configure {
     private Color foreground = Color.white;
     private Color background = Color.black;
     public void setColour (Color foreground, Color background) {
       this.foreground = foreground;
       this.background = background;
     public void configure (java.applet.Applet applet) {
       applet.setForeground (foreground);
       applet.setBackground (background);
Then, construct an instance of AppletColours, set its foreground/background colours as required and send it down the configure channel when appropriate.

Note that an instance of the above AppletColours may have its colours reset and may be resent down the channel. To ensure against race-hazards, construct at least two instances and use them alternately. Acceptance of one of them by the ActiveApplet means that it has finished using the other and, therefore, the other may be safely reset. So long as the configure channel is unbuffered, completion of the write method means that the message has been read (i.e. accepted) by the receiving process.

Method Summary
 void configure(Applet applet)

Method Detail


void configure(Applet applet)
applet - the Applet being configured.

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.