All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class test.jcsp.CheckboxTest

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----jcsp.awt.ActiveApplet
                                           |
                                           +----test.jcsp.CheckboxTest

public class CheckboxTest
extends ActiveApplet
implements ItemListener

Applet

Process Diagram

External View

  ______________
 |              |
 | CheckboxTest |
 |______________|
 

Internal View

  _____________________________________
 |  ___________________                |
 | |                   |               |
 | | Java Event Thread |               |
 | |___________________|               |
 |         |                           |
 |         v configure                 |
 |  _______|________         ________  |
 | |                | event |        | |
 | | ActiveCheckbox |--->---|        | |
 | |________________|       |________| |
 |                                     |
 |                        CheckboxTest |
 |_____________________________________|
 

Description

The CheckboxTest Applet has two processes an instance of ActiveCheckbox and an anonymous process running in Parallel.

The anonymous process has an infinite loop which reads one Boolean and one Object from the event Channel if the Boolean was true "Selected" will be displayed on the Label otherwise "Unselected" will be displayed.

NOTE: The Java Event thread is a process which is created by the Java runtime environment and calls the itemStateChanged method when one of the components the Applet is listening to generates an ItemEvent.

The purpose of this test is to check to see if the events are notified correctly and that the configuration functions correctly.

NOTE: The code for this Applet is not a good example of developing programs using the library, it has been designed to allow the component to be tested without depending on more classes from the library than is necessary.

Author:
P.D.Austin

Constructor Index

 o CheckboxTest()

Method Index

 o getAppletInfo()
returns the name and author of the Applet.
 o init()
Initialises the Applet.
 o itemStateChanged(ItemEvent)
Handles ItemEvents generated by components this class is listening to.

Constructors

 o CheckboxTest
 public CheckboxTest()

Methods

 o init
 public void init()
Initialises the Applet.

Overrides:
init in class Applet
 o itemStateChanged
 public void itemStateChanged(ItemEvent e)
Handles ItemEvents generated by components this class is listening to.

Parameters:
e - The ItemEvent to be processed
 o getAppletInfo
 public String getAppletInfo()
returns the name and author of the Applet.

Overrides:
getAppletInfo in class Applet

All Packages  Class Hierarchy  This Package  Previous  Next  Index