/** * Aquarium Lab Series:
* The AquariumController object constructs the aquarium and controls * the movement of fish and their display. *

* Created:
* 23 March 2008, Alyce Brady, from the previous version of AquaSimApplication * dated 10 July 2002.
*
* Modifications:
* (date), (your name), Modified to add three fish to the aquarium and * make them move once.
* * @author (your name) (with assistance from) * @version (date) * @see Aquarium * @see AquaFish * @see AquaSimGUI */ public class AquariumController { // instance variables - replace the example below with your own private Aquarium aqua; // reference to the aquarium private AquaFish fish1; // reference to a fish private AquaSimGUI userInterface; // ref. to the graphical user interface /** * Constructor for objects of class AquariumController */ public AquariumController() { // Construct the aquarium. Specify its dimensions when creating it. this.aqua = new Aquarium(600, 480); // Construct fish and add them to the aquarium. this.fish1 = new AquaFish(this.aqua); aqua.add(this.fish1); // CODE MISSING HERE! // Construct a graphical user interface (GUI) to display the aquarium // and interact with the user. The user interface needs to know about // the aquarium, so we pass aqua to the user interface constructor. this.userInterface = new AquaSimGUI(this.aqua); // Tell the user how to start the program. userInterface.println("This will be an aquarium simulation."); userInterface.println("Press the Start button to start the simulation."); }//end constructor /** * Runs the aquarium program. */ public void runProgram() { // First wait for the user to press the start button. userInterface.waitForStart(); // Draw the aquarium and its contents. userInterface.showAquarium(); // Make the fish move and redisplay. // CODE MISSING HERE! // Remind user how to quit application. userInterface.println ("Close GUI display window to quit."); }//end runProgram }//end AquariumController class