public class RollController extends Controller implements IRollController, ModelObserver, java.awt.event.ActionListener
| Modifier and Type | Field and Description |
|---|---|
private IRollResultView |
resultView |
private javax.swing.Timer |
timer |
private static int |
TIMER_INTERVAL |
| Constructor and Description |
|---|
RollController(IRollView view,
IRollResultView resultView)
RollController constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent arg0) |
void |
alert()
Notifies an object that something has happened
|
IRollResultView |
getResultView() |
IRollView |
getRollView() |
void |
rollDice()
Called when the user clicks the "Roll!" button in the roll view
|
void |
setResultView(IRollResultView resultView) |
getViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetViewprivate IRollResultView resultView
private javax.swing.Timer timer
private static final int TIMER_INTERVAL
public RollController(IRollView view, IRollResultView resultView)
view - Roll viewresultView - Roll result viewpublic IRollResultView getResultView()
public void setResultView(IRollResultView resultView)
public IRollView getRollView()
public void rollDice()
IRollControllerrollDice in interface IRollControllerpublic void alert()
ModelObserveralert in interface ModelObserverpublic void actionPerformed(java.awt.event.ActionEvent arg0)
actionPerformed in interface java.awt.event.ActionListener