ClockController.java
1 |
|
2 |
|
3 |
import be.uhasselt.oo2.mvc.AbstractController; |
4 |
import java.util.Observable; |
5 |
|
6 |
/** |
7 |
* A clock controller that allows the clock to be started, stopped and reset. |
8 |
* @author jvermeulen |
9 |
*/ |
10 |
public class ClockController extends AbstractController { |
11 |
public ClockController(Observable model) { |
12 |
super(model); |
13 |
} |
14 |
|
15 |
public void onStart() { |
16 |
((ClockModel)getModel()).start(); |
17 |
} |
18 |
|
19 |
public void onStop() { |
20 |
((ClockModel)getModel()).stop(); |
21 |
} |
22 |
|
23 |
public void onReset() { |
24 |
((ClockModel)getModel()).setTime(0,0,0); |
25 |
} |
26 |
} |
27 |