|
Aquarium Lab Series | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AquaSimGUI
Aquarium Lab Series:
The AquaSimGUI class provides a graphical user interface
to the Aquarium Lab Series. This class uses the Java
Power Tools (JPT) classes from Northeastern University to
build the graphical interface. In particular, it inherits
the repaint
method (which does not appear in
the specification for this class) from the JPT DisplayPanel
class. The repaint
method draws the
components in the graphical user interface.
This partial specification for the AquaSimGUI class shows the public methods used by non-GUI client code, but does not show some of the public methods used just by the GUI.
Constructor Summary | |
AquaSimGUI(Aquarium aquarium)
Construct a simple graphical user interface for the Aquarium Simulation program. |
|
AquaSimGUI(Aquarium aquarium,
boolean promptForSimSteps)
Construct a simple graphical user interface for the Aquarium Simulation program, with or without prompts for the number of simulation steps. |
|
AquaSimGUI(Aquarium aquarium,
boolean promptForSimSteps,
boolean promptForNumFish)
Construct a graphical user interface for the Aquarium Simulation program, with or without prompts for the number of simulation steps and the number of fish. |
|
AquaSimGUI(Aquarium aquarium,
boolean promptForSimSteps,
boolean promptForNumFish,
boolean useSimulationObj)
Construct a graphical user interface for the Aquarium Simulation program, with or without prompts for the number of simulation steps and the number of fish. |
Method Summary | |
int |
getNumberOfFish()
Get the number of fish to put in the aquarium from user input. |
int |
getNumberOfSteps()
Get the number of steps to run from user input. |
void |
pauseToView()
Pause so user can view the display. |
void |
show(AquaFish[] fishList)
Display all the AquaFish in the fishList array. |
void |
show(java.util.ArrayList fishList)
Display all the AquaFish in the fishList list. |
void |
showAquarium()
Display only the Aquarium: paint the aquarium blue to cover up old fish. |
void |
showFish(AquaFish fish)
Display a single AquaFish. |
void |
waitForStart()
Wait for start button to be pushed. |
Constructor Detail |
public AquaSimGUI(Aquarium aquarium)
aquarium
- the aquarium in which the fish swimpublic AquaSimGUI(Aquarium aquarium, boolean promptForSimSteps)
aquarium
- the aquarium in which the fish swimpromptForSimSteps
- true
if GUI should
prompt for number of simulation stepspublic AquaSimGUI(Aquarium aquarium, boolean promptForSimSteps, boolean promptForNumFish)
aquarium
- the aquarium in which the fish swimpromptForSimSteps
- true
if GUI should
prompt for number of simulation stepspromptForNumFish
- true
if GUI should
prompt for number of fishpublic AquaSimGUI(Aquarium aquarium, boolean promptForSimSteps, boolean promptForNumFish, boolean useSimulationObj)
aquarium
- the aquarium in which the fish swimpromptForSimSteps
- true
if GUI should
prompt for number of simulation stepspromptForNumFish
- true
if GUI should
prompt for number of fishuseSimulationObj
- true
if GUI should
construct and use a Simulation objectMethod Detail |
public void waitForStart()
public int getNumberOfFish()
public int getNumberOfSteps()
public void show(AquaFish[] fishList)
fishList
array.
Paints the aquarium blue to cover up old fish and displays
the fish in the array.fishList
- the array of AquaFish to be displayedpublic void show(java.util.ArrayList fishList)
fishList
list.
Paints the aquarium blue to cover up old fish and displays
the fish in the list.fishList
- the list of AquaFish to be displayedpublic void showAquarium()
public void showFish(AquaFish fish)
fish
- the fish to be displayedpublic void pauseToView()
|
Aquarium Lab Series | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |