import javax.swing.JFrame;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class StreakerSimulator extends JApplet {
	private static final int FRAME_WIDTH = 400;
	private static final int FRAME_HEIGHT = 590;

	public static JFrame deadbox;

	//Would be used to make a popup box to signal death/win
	public void init() {
		deadbox = new JFrame("You have died");
		JRootPane pane = getRootPane();
		if (pane != null) {
			pane.putClientProperty(
				"defaultSystemEventQueueCheck",
				Boolean.TRUE);
		}
	
		
	}
	
	static void setVisible() {
		deadbox.setVisible(true);
	}
	
	public static void main(String[] args) throws Exception {
		JFrame frame = new JFrame("Streaker Simulator");
		frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);

		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});

		Grid grid = new Grid(25, 19);
		Simulator ca = new Simulator(FRAME_HEIGHT, FRAME_WIDTH, grid);
		Container content = frame.getContentPane();

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

	}
}