import javax.swing.*;
import java.awt.*;
//import java.lang.Object.*;

public class StreakerApplet extends JApplet {
	private static final int FRAME_WIDTH = 400;
	private static final int FRAME_HEIGHT = 590;
	private static final int GRID_ROWS = 25;
	private static final int GRID_COLUMNS = 19;

	public StreakerApplet() {
		JRootPane pane = getRootPane();

		if (pane != null) {
			pane.putClientProperty(
				"defaultSystemEventQueueCheck",
				Boolean.TRUE);
		}
	}

	public void init() {
		Grid grid = new Grid(GRID_ROWS, GRID_COLUMNS);
		Simulator sim = new Simulator(FRAME_HEIGHT, FRAME_WIDTH, grid);
		Container content = getContentPane();

		//	Add classes to the simulation.  
		sim.addClass("RandomWalker");
		sim.addClass("ThePoPo");
		sim.addClass("Squirrels");
		//Initialize Streaker
		try {
			grid.setObjectAt(24, 9, new Streaker());
			//Initialize Cabell
			for (int i = 0; i < grid.numColumns(); i++) {
				grid.setObjectAt(0, i, new Cabell()); //@nowarn
			}
		} catch (BadLocationException e) {
		};
		if (content != null) {
			content.add(sim, BorderLayout.CENTER);
		} else {
			System.err.println("ERROR: No content pane");
		}

		Container pane = getContentPane();

		if (pane != null) {
			pane.add(sim, BorderLayout.CENTER);
		}
	}
}