-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathAquaSimApplication.java
More file actions
66 lines (50 loc) · 2.27 KB
/
AquaSimApplication.java
File metadata and controls
66 lines (50 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import java.awt.Color;
import java.util.Random;
/** Aquarium Lab Series: <br>
* The AquaSimApplication class contains the main function that will
* run the Aquarium Simulation. (This description should be updated
* when the behavior of the program changes.)<br>
*
* Modifications: <br>
* 23 March 2008, Alyce Brady, Created skeleton main that constructs and
* displays an empty aquarium.<br>
* (date), (your name), Modified to .... <br>
*
* @author Alyce Brady (should be Your Name)
* @version 23 March 2008 (should be today's date)
* @see AquariumController
**/
public class AquaSimApplication
{
/**
* This is the main function. It executes 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 fish and add them to the aquarium.
// CODE MISSING HERE!
// 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
// Tell the user how to start the aquarium simulation.
System.out.println("Press the Start button to start the simulation.");
// Now wait for the user to press the start button.
userInterface.waitForStart();
// Draw the initial view of the aquarium and its contents.
userInterface.showAquarium();
// RUN THE AQUARIUM SIMULATION.
// Make the fish move and redisplay.
// CODE MISSING HERE!
// WRAP UP.
// Remind user how to quit application.
userInterface.println ("Close GUI display window to quit.");
}//end main
}//end class