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) |
getView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getView
private 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()
IRollController
rollDice
in interface IRollController
public void alert()
ModelObserver
alert
in interface ModelObserver
public void actionPerformed(java.awt.event.ActionEvent arg0)
actionPerformed
in interface java.awt.event.ActionListener