Class Controller

java.lang.Object
  extended by Controller
All Implemented Interfaces:
ActionListener, EventListener

public class Controller
extends Object
implements ActionListener

The class that manages the model and the view. Here, it starts independent threads for the model and its view, and listens for button-presses that pause/resume the animation in the view.

Author:
David Mutchler. Created October 18, 2008.

Constructor Summary
Controller(Model model, View view)
          Starts independent threads for the model and the view.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Responds to a press of the pause/resume button by toggling between the is-paused and not-paused animation state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(Model model,
                  View view)
Starts independent threads for the model and the view.

Parameters:
model - Model of this application -- here, just a number that goes up and down over time
view - View of the model -- here, just a point whose x-value represents time and whose y-value represents the model's data
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
Responds to a press of the pause/resume button by toggling between the is-paused and not-paused animation state.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - The event that invoked this method (presumably a button-press)