A B C D E F H I M P R S T U W X Y

A

animation - Variable in class MainApplet
Thread for animation

B

backBufferGraphics - Variable in class MainApplet
Graphic context associate with the back image buffer
backBufferImage - Variable in class MainApplet
Back Image buffer for drawing

C

createFly() - Method in class FlyManager

PRE: NONE
POST: A fly is created if the maximum number of fly has not been reach yet

D

destroy() - Method in class MainApplet

PRE: NONE
POST: Clean up the thread
drawFrog(Graphics) - Method in class MainApplet

PRE: A valid Graphics object
POST: Draw the frog onto the Graphics object
drawTongue - Variable in class MainApplet
delay for drawing the tongue

E

eatFly(int, int) - Method in class FlyManager

PRE: NONE
POST: Try to eat the fly, if fail return false, otherwise, return true and the fly will be removed
eye_x - Variable in class MainApplet
position of the frog's eye (x)
eye_y - Variable in class MainApplet
position of the frog's eye (y)
eyeCenterX - Variable in class MainApplet
position of the center of frog's eye (x)
eyeCenterY - Variable in class MainApplet
position of the center of frog's eye (y)
eyeEmotion - Variable in class MainApplet
For displaying eye emotion, happy, sad, netural
eyeSize - Variable in class MainApplet
size of the frog's eye
eyeXOffset - Variable in class MainApplet
x offset for drawing the frog's eye
eyeYOffset - Variable in class MainApplet
y offset for drawing the frog's eye

F

fc - Variable in class MainApplet
FlyCreator for creating fly
Fly - class Fly.
CLASS: Fly
PURPOSE: This class just keep track of the fly position
IMPORT: NONE
EXPORT: New Class|Fly
New Method| NONE
Fly() - Constructor for class Fly

PRE: NONE
POST: Initialize the position of the fly
FlyCreator - class FlyCreator.
CLASS: FlyCreator
PURPOSE: This class will run as a thread and create fly using FlyManager based on probabily and the time interval
IMPORT: FlyManager
EXPORT: New Class|FlyCreator
New Method| FlyCreator, run
FlyCreator(FlyManager, double, long) - Constructor for class FlyCreator

PRE: A valid flyManager object, interval has to be greater than 0
POST: Save all the configuration information
flyImage - Variable in class MainApplet
Fly image
flyList - Variable in class FlyManager
Keep track of the list of flies
FlyManager - class FlyManager.
CLASS: FlyManager
PURPOSE: This class is the monitor of where the flies are and to manage them
IMPORT: java.util.Vector, java.awt.Image, java.awt.Graphics, java.awt.image.ImageObserver, Fly
EXPORT: New Class|FlyManager
New Method| FlyManager, createFly, eatFly moveAllFly, paintAllFly
FlyManager(int, int, int) - Constructor for class FlyManager

PRE: NONE
POST: Save the configuration information
fm - Variable in class FlyCreator
FlyManager for adding fly
fm - Variable in class MainApplet
FlyManager for eating fly
frogEatImage - Variable in class MainApplet
Frog image (eating)
frogHeight - Variable in class MainApplet
Height of the frog image in pixel
frogImage - Variable in class MainApplet
Frog image (still)
frogWidth - Variable in class MainApplet
Width of the frog image in pixel
frogY_pos - Variable in class MainApplet
position of the frog image

H

height - Variable in class FlyManager
height of the box where the fly is allow to go
height - Variable in class MainApplet
Display Height of the applet

I

init() - Method in class MainApplet

PRE: NONE
POST: Initialize all variables and start all the threads

M

MainApplet - class MainApplet.
CLASS: MainApplet
PURPOSE: This class handle all the GUI action and this is also the main class for the applet
IMPORT: java.applet.Applet, java.awt.Graphics, java.awt.Image, java.awt.MediaTracker, java.awt.Color, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseEvent, FlyManager, FlyCreator
EXPORT: New Class|MainApplet
New Method| destroy, init, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, run, setEyePos, update, drawFrog
MainApplet() - Constructor for class MainApplet
 
maxFly - Variable in class FlyManager
Maximum number of flies alive at any given time
maxMovement - Variable in class FlyManager
how far the flies can move
milliSec - Variable in class FlyCreator
The time interval to try to create a fly
mouseClicked(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: Nothing.
mouseDragged(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: Nothing.
mouseEntered(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: Nothing.
mouseExited(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: set the eye position to center
mouseMoved(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: Set eye position according to the mouse movement
mousePressed(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: try to eat the fly and set the animations
mouseReleased(MouseEvent) - Method in class MainApplet

PRE: A valid MouseEvent object
POST: Nothing.
mouth_x - Variable in class MainApplet
position of the mouth(x)
mouth_y - Variable in class MainApplet
position of the mouth(y)
moveAllFly() - Method in class FlyManager

PRE: NONE
POST: move all the flies' position randomly

P

paint(Graphics) - Method in class MainApplet

PRE: A valid Graphics object
POST: Paint all the objects
paintAllFly(Graphics, Image, ImageObserver) - Method in class FlyManager

PRE: Valid instance of Graphics, Image, and ImageObserver
POST: Paint all the flies available onto the Graphics object
prob - Variable in class FlyCreator
Probabily of successfully create a fly

R

refreshRate - Variable in class MainApplet
rehresh rate in millisecond
run() - Method in class FlyCreator

PRE: NONE
POST: Infinite loop to try to create fly based on probability and time interval
run() - Method in class MainApplet

PRE: NONE
POST: Refresh the screen in a timely manner and move the flies too

S

setEyePos(int, int) - Method in class MainApplet

PRE: NONE
POST: set the eye position so that it will stare at that point

T

tongue_x - Variable in class MainApplet
destination of the tongue (x)
tongue_y - Variable in class MainApplet
destination of the tongue (y)

U

update(Graphics) - Method in class MainApplet

PRE: A valid Graphics object
POST: Paint all the objects

W

width - Variable in class FlyManager
width of the box where the fly is allow to go
width - Variable in class MainApplet
Display Width of the applet

X

x_pos - Variable in class Fly
Fly's x position

Y

y_pos - Variable in class Fly
Fly's y position

A B C D E F H I M P R S T U W X Y