import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Color;

/**
 * Draws a colored circle.
 *
 * @version 1.1    February 1, 2002
 * @author Franck van Breugel
 */
public class Drawer extends Applet
{
    public static final int WIDTH = 400;   // width of the applet
    public static final int HEIGHT = 200;  // height of the applet

    private boolean isVisible;             // visibility of applet

    /**
     * Initializes the applet.
     */
    public void init()
    {
        setBackground(Color.black);
        setSize(WIDTH, HEIGHT);
    }

    /**
     * Starts applet.
     */
    public void start()
    {
	isVisible = true;
    }

    /**
     * Stops applet.
     */
    public void stop()
    {
	isVisible = false;
    }

    /**
     * Draws a colored circle on the specified component.
     *
     * @param page the component on which is drawn.
     */
    public void paint(Graphics page)
    {
        Point corner = new Point(WIDTH, HEIGHT);
        while (isVisible)
	{
            new ColoredCircle(corner).draw(page);
	}
    }
}
