// Class: AquaSimApplication // // Author: Your Name // based on a template provided by Alyce Brady // with assistance from: people who helped (including instructor/TAs) // // Created on July 10, 2002 // Modifications: // Date Name Reason // ---- ---- ------ // March 24, 2004 Kelly Schultz Modified comments and removed waitForStart code // The color class will be used in mini-lab #2 import java.awt.Color; /** Aquarium Lab Series:
* The AquaSimApplication class contains the main function that will * run the Aquarium SimulationKelly. The main function creates an aquarium * and a number of fish and lets the fish move in the aquarium. * * @author Your name here * @version 10 July 2002 * @see Aquarium * @see AquaFish * @see AquaSimGUI **/ public class AquaSimApplication { /** * This is the main function. It controls the execution of the program. * @param String args[] is never used **/ public static void main(String args[]) { System.out.println("This will be an aquarium simulation."); // CONSTRUCT OBJECTS NEEDED FOR THE AQUARIUM SIMULATION. // Construct the aquarium. Specify its dimensions when creating it. Aquarium aqua; // create reference to an Aquarium ... aqua = new Aquarium(600, 480); // ... object that has now been created // Construct a graphical user interface (GUI) to display and control // the simulation. The user interface needs to know about the // aquarium, so we pass aqua to the user interface constructor. AquaSimGUI userInterface; // create reference to GUI ... userInterface = new AquaSimGUI(aqua); // ... and then GUI itself // VIEW THE INITIAL CONFIGURATION. // Displaying the aquarium requires 3 steps: // - Drawing the picture (e.g., showAquarium) // - Repainting the drawing on the screen // - Pausing the display to give the user time to view it userInterface.showAquarium(); userInterface.repaint(); userInterface.pauseToView(); // RUN THE AQUARIUM SIMULATION AND REDISPLAY. // WRAP UP. // Remind user how to quit application. System.out.println ("Close GUI display window to quit."); }//end main }//end class