Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
A
B
C
D
E
F
G
I
K
L
M
N
P
Q
R
S
T
W
A
accelerate(double)
- Method in class
Force
accelerates the boid by change amount
actionPerformed(ActionEvent)
- Method in class
AnimationCanvas
called by timer-fire
actionPerformed(ActionEvent)
- Method in class
Clear
Clears the canvas
actionPerformed(ActionEvent)
- Method in class
Exit
Exits the program
actionPerformed(ActionEvent)
- Method in class
Pause
Pauses the animation
actionPerformed(ActionEvent)
- Method in class
Step
Steps through the animation
ADD
- Static variable in class
AnimationController
add(Force)
- Method in class
Force
add forces
add(Paintable)
- Method in class
Canvas
Remember given shape.
addBehavior(Behavior)
- Method in class
AnimatedObject
Start given behavior by adding it to object.
AddRules(Iterator)
- Method in class
Flock
Adds the rules to the flock rulesIter iterates over the vector of rules
addSlider(JSlider, String)
- Method in class
Sliders
angleBetween(int, int)
- Static method in class
MyMath
Returns angle given dx and dy
angleBetween(Point, Point)
- Static method in class
MyMath
Returns angle between two points
Animatable
- interface
Animatable
.
Represents anything that knows how to be animated by making small incremental changes over time
animate()
- Method in interface
Animatable
Implementors must describe how to animate themselves.
animate()
- Method in class
AnimatedObject
Animate by applying all behaviors.
animate()
- Method in class
AnimationCanvas
Called by each step of timer.
AnimatedObject
- class
AnimatedObject
.
Object that knows how to animate itself, but not paint itself.
AnimatedObject()
- Constructor for class
AnimatedObject
Create an inanimate object :)
AnimationCanvas
- class
AnimationCanvas
.
Manage animation of a group of shapes.
AnimationCanvas()
- Constructor for class
AnimationCanvas
Create canvas of default size.
AnimationCanvas(Dimension)
- Constructor for class
AnimationCanvas
Create canvas of given size.
AnimationController
- class
AnimationController
.
Allow user some control over animation
AnimationController(ActionMap)
- Constructor for class
AnimationController
AnimationController(AnimationCanvas)
- Constructor for class
AnimationController
apply()
- Method in interface
Behavior
Apply one step in the overall behavior (like the body of an infinite loop).
apply()
- Method in class
Cohesion
Does the work of "cohesing" the boids
apply()
- Method in class
Mover
applies the move to each boid in the flock
apply()
- Method in class
Wandering
applys the "wander" behavior for each boid in the flock
applyForce(Force)
- Method in class
Boid
applyForce(Force)
- Method in class
Flock
Iterators through the vector of animals and applie the force to each animal in the flock
average(Point, Point)
- Static method in class
MyMath
Returns average point between two points
B
Behavior
- interface
Behavior
.
Represents an effect that can be applied over time.
Boid
- class
Boid
.
Boid that draws itself as a circle
Boid(Canvas, Point, Force)
- Constructor for class
Boid
Create a red boid
Boid(Container, Point, Force, Color)
- Constructor for class
Boid
Create a boid
BoidFactory
- class
BoidFactory
.
BoidFactory()
- Constructor for class
BoidFactory
C
Canvas
- class
Canvas
.
Retain memory of shapes to draw on refresh.
Canvas()
- Constructor for class
Canvas
Create canvas of default size.
Canvas(Dimension)
- Constructor for class
Canvas
Create canvas of given size.
Clear
- class
Clear
.
CLEAR
- Static variable in class
AnimationController
clear()
- Method in class
AnimatedObject
Effectively stop object by removing all behaviors.
clear()
- Method in class
Canvas
Clear canvas of all shapes.
Clear(Canvas)
- Constructor for class
Clear
Constructor
Cohesion
- class
Cohesion
.
Cohesion()
- Constructor for class
Cohesion
Constructor
Create(Canvas, Point, Iterator)
- Method in class
Flock
Creates animals in the flocks
D
DEFAULT_DELAY
- Static variable in class
AnimationCanvas
DEFAULT_SIZE
- Static variable in class
Canvas
DIAMETER
- Static variable in class
Boid
difference(Force)
- Method in class
Force
returns teh differnec of two forces
distanceBetween(int, int)
- Static method in class
MyMath
Returns distance given dx and dy
distanceBetween(Point, Point)
- Static method in class
MyMath
Returns distance between two points
E
equals(Object)
- Method in class
Force
returns true if two forces are equal
Exit
- class
Exit
.
exit()
- Method in class
Exit
exits the program
Exit()
- Constructor for class
Exit
F
Flock
- class
Flock
.
Flock()
- Constructor for class
Flock
Constructor
Force
- class
Force
.
Force(double, double)
- Constructor for class
Force
Constructor &/ public Force () { this(0.0, 0.0); } /** Constructor
Force(Force)
- Constructor for class
Force
Constructor from another force
Force(int, int)
- Constructor for class
Force
Constructor with detla x, delta y
Force(Point, Point)
- Constructor for class
Force
Constructor with points source and target point
G
getAngle()
- Method in class
Force
Returns the angle moving at
getAngleBetween(Force)
- Method in class
Force
returns the angle between to forces
getBehavior(int)
- Method in class
RuleFactory
returns the behavior corresponding to the key
getCenter(Container)
- Static method in class
BoidFactory
Helper function to make apointin the center of the container
getInfo()
- Method in class
ScreenInputter
Prompts and gets info from the user from the screen
getKeySet()
- Method in class
RuleFactory
Returns all the keys in the map
getMagnitude()
- Method in class
Force
Returns magnitude
getNumberAdded()
- Method in class
Canvas
Find out how many shapes are currently retained for drawing.
getNumberInRange(int, int)
- Static method in class
BoidFactory
Helper function to return nubmer in range
getPosition()
- Method in class
Boid
Get current position
getPredictedPosition()
- Method in class
Boid
Return ball's next position assuming no changes to its velocity
getRelativeMagnitude(Force)
- Method in class
Force
returns the relative magnitude
getSize()
- Method in class
Boid
Get current size
getVelocity()
- Method in class
Boid
Get current velocity
getXChange()
- Method in class
Force
returns delta x
getYChange()
- Method in class
Force
returns detla y
I
InFront(Point, Point)
- Method in class
Cohesion
Boids don't generally move backwards, so if the average point is behind the boid, then it shouldn't go backwards
isDone()
- Method in class
Exit
Override to verify if application is done before quitting.
isRunning()
- Method in class
AnimationCanvas
Check if animation is going or not.
iterator()
- Method in class
Canvas
Allow restricted access to display list.
iterator()
- Method in class
Flock
Returns an iterator over myAnimals
iterator()
- Method in class
ScreenInputter
Returns an iterator over the collectin of rules
K
keyTyped(KeyEvent)
- Method in class
AnimationController
L
lengthFromAvg(Point, Point)
- Method in class
Cohesion
Facilitates cohesion by if they are alreay a certain distance close to the average position, then it shouldn't go towards that point
listener
- Variable in class
Sliders
M
Main
- class
Main
.
Main()
- Constructor for class
Main
main(String[])
- Static method in class
Force
main(String[])
- Static method in class
Main
makeBoid(Canvas, Point)
- Static method in class
BoidFactory
Create a single boid with attributes
makeFactory(AnimationCanvas)
- Static method in class
Main
makeVelocity()
- Static method in class
BoidFactory
Helper function to create velocity
move()
- Method in class
Boid
Move boid by its current velocity
Mover
- class
Mover
.
Mover()
- Constructor for class
Mover
Constructor
myActions
- Variable in class
AnimationController
myAngle
- Variable in class
Force
myAnimals
- Variable in class
Cohesion
myAnimals
- Variable in class
Flock
myAnimals
- Variable in class
Mover
myAnimals
- Variable in class
Wandering
myBehaviors
- Variable in class
AnimatedObject
myColor
- Variable in class
Boid
myContainer
- Variable in class
Boid
myMagnitude
- Variable in class
Force
MyMath
- class
MyMath
.
MyMath()
- Constructor for class
MyMath
myPaintables
- Variable in class
Canvas
myPosition
- Variable in class
Boid
myRules
- Variable in class
RuleFactory
myRules
- Variable in class
ScreenInputter
mySize
- Variable in class
Boid
myTarget
- Variable in class
Clear
myTarget
- Variable in class
Cohesion
myTarget
- Variable in class
Mover
myTarget
- Variable in class
Pause
myTarget
- Variable in class
Step
myTarget
- Variable in class
Wandering
myTimer
- Variable in class
AnimationCanvas
myValue
- Variable in class
Cohesion
myValueX
- Variable in class
Wandering
myValueY
- Variable in class
Wandering
myVelocity
- Variable in class
Boid
N
negate()
- Method in class
Force
negates a forece
P
paint(Graphics)
- Method in class
Boid
Paint a graphical view of boid
paint(Graphics)
- Method in class
Flock
paint Applies paint to each boid in the flock
paint(Graphics)
- Method in interface
Paintable
Implementors must describe how to paint themselves.
Paintable
- interface
Paintable
.
Represents anything that knows how to draw itself
paintComponent(Graphics)
- Method in class
Canvas
called when area of screen covered by this container needs to be displayed (i.e., creation, uncovering, change in status)
Pause
- class
Pause
.
Action to pause the animation
PAUSE
- Static variable in class
AnimationController
Pause(AnimationCanvas)
- Constructor for class
Pause
Constructor
Q
QUIT
- Static variable in class
AnimationController
R
RADIUS
- Static variable in class
Boid
randomNumber(double)
- Static method in class
MyMath
Returns a random double from 0 to max
randomNumber(float)
- Static method in class
MyMath
Returns a random float from 0 to max
randomNumber(int)
- Static method in class
MyMath
Returns a random int from 0 to max
randomNumber(long)
- Static method in class
MyMath
Returns a random long from 0 to max
randomNumberInRange(double, double)
- Static method in class
MyMath
Returns a random double in given range
randomNumberInRange(float, float)
- Static method in class
MyMath
Returns a random float in given range
randomNumberInRange(int, int)
- Static method in class
MyMath
Returns a random int in given range
randomNumberInRange(long, long)
- Static method in class
MyMath
Returns a random long in given range
removeBehavior(Behavior)
- Method in class
AnimatedObject
Stop given behavior by removing from object.
reset()
- Method in class
ScreenInputter
Clears the rule colection
RuleFactory
- class
RuleFactory
.
RuleFactory()
- Constructor for class
RuleFactory
Constructor
S
ScreenInputter
- class
ScreenInputter
.
ScreenInputter()
- Constructor for class
ScreenInputter
Constructor
setAngle(double)
- Method in class
Force
sets the angle
setMagnitude(double)
- Method in class
Force
Sets the magnitude
setTarget(Flock)
- Method in interface
Behavior
Set the target
setTarget(Flock)
- Method in class
Cohesion
Sets the target for cohesion
setTarget(Flock)
- Method in class
Mover
sets the target to the flock by applying it to each boid
setTarget(Flock)
- Method in class
Wandering
Populates vector myAnimals of all the animals to wander on
sliderPanel
- Variable in class
Sliders
Sliders
- class
Sliders
.
Sliders()
- Constructor for class
Sliders
sqr(double)
- Static method in class
MyMath
Returns squared value of given double
sqr(float)
- Static method in class
MyMath
Returns squared value of given float
sqr(int)
- Static method in class
MyMath
Returns squared value of given int
sqr(long)
- Static method in class
MyMath
Returns squared value of given long
start()
- Method in class
AnimationCanvas
Start animation within canvas.
StartVariant(Point)
- Static method in class
BoidFactory
Returns a point that varies from where the user clicks.
Step
- class
Step
.
STEP
- Static variable in class
AnimationController
Step(AnimationCanvas)
- Constructor for class
Step
Constructor
stop()
- Method in class
AnimationCanvas
Stop animation within canvas.
stringToInt(String)
- Static method in class
Force
convert string to int
T
textField
- Variable in class
Sliders
toString()
- Method in class
Force
overriden for outputting
turn(double)
- Method in class
Force
turns
W
Wandering
- class
Wandering
.
Wandering()
- Constructor for class
Wandering
Constructor
WeakMenu()
- Method in class
ScreenInputter
Prints a hard-coded (ahhhh!!!!!!!) menu.
A
B
C
D
E
F
G
I
K
L
M
N
P
Q
R
S
T
W
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES