Class Display

java.lang.Object
  |
  +--Display

public class Display
extends java.lang.Object

Aquarium Lab Series: The Display class contains methods for displaying AquaFish in an Aquarium.

Author:
Autumn Spaulding (autumn@max.cs.kzoo.edu) and Alyce Brady (abrady@kzoo.edu)
See Also:
Aquarium, AquaFish

Constructor Summary
Display(Aquarium a)
          Construct a Display Object to display AquaFish in an Aquarium
 
Method Summary
 void pause()
          Pause.
 void setDelay(int delay)
          Set the delay time used by show (length of pause between steps).
 void setTitle(java.lang.String s)
          Set the title to appear in the Title Bar of the "window".
 void show(java.util.Vector fishVector)
          Show a Vector of AquaFish in the Aquarium and pause.
 void showAquarium()
          Display the Aquarium: paint the aquarium blue to cover up old fish.
 void showFish(AquaFish f)
          Display a single AquaFish.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Display

public Display(Aquarium a)
Construct a Display Object to display AquaFish in an Aquarium
Parameters:
a - the Aquarium to Display
Method Detail

setTitle

public void setTitle(java.lang.String s)
Set the title to appear in the Title Bar of the "window".
Parameters:
s - the title

setDelay

public void setDelay(int delay)
Set the delay time used by show (length of pause between steps).
Parameters:
delay - length of pause between each step (in microseconds)

show

public void show(java.util.Vector fishVector)
Show a Vector of AquaFish in the Aquarium and pause. Paints the aquarium blue to cover up old fish, displays the fish in the vector, and pauses.
Parameters:
a - Vector of AquaFish to be displayed

showAquarium

public void showAquarium()
Display the Aquarium: paint the aquarium blue to cover up old fish. Does not pause afterward. Not necessary when displaying an entire vector of fish.

showFish

public void showFish(AquaFish f)
Display a single AquaFish. Does not pause afterward.
Parameters:
f - the fish to be displayed

pause

public void pause()
Pause. Uses the default pause length set when the Display was constructed or the the amount of time specified in a call to setDelay. Not necessary when displaying an entire vector of fish.