A B G M N P R S

A

action() - Method in class Ball
Perform an appropriate action on each cycle of the simulation, in this case advancing by dx,dy and reversing either direction if we hit an edge of the simulation.
action() - Method in interface SimThing
Perform desired action for one simulation cycle.
actionPerformed(ActionEvent) - Method in class SimButtonListener
Process button clicks by turning the simulation on and off
add(SimThing) - Method in class SimModel
Add the given SimThing to the world after this cycle is complete.
addView(SimView) - Method in class SimModel
Add the given SimView to the list of viewers to be notified each cycle.

B

Ball - class Ball.
A small ball object that wanders randomly around a bounded area.
Ball(int, int, int, int, Color, int, SimModel) - Constructor for class Ball
Construct a new Ball with the given coordinates, initial direction, and model.
BallGraphicsView - class BallGraphicsView.
Graphical viewer for Ball simulation.
BallGraphicsView(SimModel) - Constructor for class BallGraphicsView
Construct a new BallGraphicsView viewer for the given model
BallSim - class BallSim.
Demonstration program for simple simulation framework.
BallSim() - Constructor for class BallSim
 
BallSimControl - class BallSimControl.
Viewer/controller for ball world simulation.
BallSimControl(SimModel) - Constructor for class BallSimControl
Construct a viewer/controller for the given world

G

getHeight() - Method in class SimModel
Return the vertical size of the simulated world
getThings() - Method in class SimModel
Return a copy of the list of Things in the simulation at the beginning of the current cycle.
getWidth() - Method in class SimModel
Return the horizontal size of the simulated world
go(int) - Method in class SimModel
Run the simulation for the requested number of cycles
go() - Method in class SimModel
Run the simulation indefinitely

M

main(String[]) - Static method in class BallSim
Create window, viewer, and balls and run simulation
mouseClicked(MouseEvent) - Method in class SimMouseListener
Process mouse click by adding a new ball to the simulation at the location of the click with a random color, size, and velocity
mouseEntered(MouseEvent) - Method in class SimMouseListener
 
mouseExited(MouseEvent) - Method in class SimMouseListener
 
mousePressed(MouseEvent) - Method in class SimMouseListener
 
mouseReleased(MouseEvent) - Method in class SimMouseListener
 

N

notifyViewer() - Method in class BallGraphicsView
React when notified of a change by a model by repainting this view
notifyViewer() - Method in interface SimView
Notify this SimView so it can update its display of the SimModel.

P

paintComponent(Graphics) - Method in class Ball
Display this ball on the given graphics context
paintComponent(Graphics) - Method in class BallGraphicsView
Repaint the simulation by requesting each item to repaint itself
paintComponent(Graphics) - Method in interface SimThing
Draw graphical representation of this SimThing.
pause() - Method in class SimModel
Pause the simulation

R

resume() - Method in class SimModel
Resume the simulation

S

SimButtonListener - class SimButtonListener.
Handle button clicks for the BallSimControl window.
SimButtonListener(SimModel) - Constructor for class SimButtonListener
Constructor for objects of class SimButton
SimModel - class SimModel.
A SimModel is a basic simulation framework for simulations of collections of objects.
SimModel(int, int) - Constructor for class SimModel
Constructor for objects of class SimModel
SimMouseListener - class SimMouseListener.
Handle mouse clicks for the BallSimControl window.
SimMouseListener(SimModel) - Constructor for class SimMouseListener
Constructor for objects of class SimMouseListener
SimThing - interface SimThing.
Basic interface for objects in the simple simulation world.
SimView - interface SimView.
Basic interface for viewers of a SimModel.
stop() - Method in class SimModel
Stop the simulation

A B G M N P R S