Class Controller
java.lang.Object
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 |
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 timeview
- View of the model -- here, just a point whose
x-value represents time and whose y-value represents
the model's data
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)