import java.awt.Color; /** * Tadpole Program - replicates the lifecycle of frogs. * Tadpoles either die out or become frogs. Frogs lay eggs when they die, * which hatch into tadpoles. * * * @author Jeff Minucci (Java 2er Spring 2005) * @version 5/05/05 **/ public class TadpoleApp { // Specify attributes of the environment. private static final int ENV_ROWS = 15; // rows in environment private static final int ENV_COLS = 15; // columns in environment // Specify attributes of the environment display. private static final int MAX_WIDTH = 600; private static final int MAX_HEIGHT = 600; private static final int MIN_CELL_SIZE = 20; private static final Color BACKGROUND_COLOR = Color.blue; /** Starts the Minnow program. * The String arguments (args) are not used in this application. **/ public static void main(String[] args) { // Construct an empty environment and several minnows in the context // of that environment. Environment env = new BoundedEnv(ENV_ROWS, ENV_COLS); Tadpole tadpole1 = new Tadpole(env, new Location(2, 2)); Tadpole tadpole2 = new Tadpole(env, new Location(5,8)); Tadpole tadpole3 = new Tadpole(env, new Location(4,6)); // Construct a window to display an environment, and specify how to // display a minnow in the environment. DisplayMap.associate("Tadpole", new TadpoleDisplay()); DisplayMap.associate("Frog", new FrogDisplay()); DisplayMap.associate("Egg", new EggDisplay()); SettableEnvDisplay display = new MinnowGUI("Tadpole Program", BACKGROUND_COLOR, MAX_WIDTH, MAX_HEIGHT, MIN_CELL_SIZE); display.setEnv(env); } }