|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jrummikub.control.TurnTimer
public class TurnTimer
Count-down timer used to limit the turn time
Field Summary | |
---|---|
private int |
timeLeft
|
private javax.swing.Timer |
timer
|
private Event |
timeRunOutEvent
|
private int |
totalTime
|
private IView |
view
|
Constructor Summary | |
---|---|
TurnTimer(IView view,
int totalTime)
Create a new timer using a given view to display the current time left |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent arg0)
|
IEvent |
getTimeRunOutEvent()
Returns the event that is emitted if the timer timed out. |
void |
startTimer()
Starts the timer |
void |
stopTimer()
Stops the timer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IView view
private int timeLeft
private int totalTime
private javax.swing.Timer timer
private Event timeRunOutEvent
Constructor Detail |
---|
public TurnTimer(IView view, int totalTime)
view
- view to displaytotalTime
- total time for turnMethod Detail |
---|
public void startTimer()
ITurnTimer
startTimer
in interface ITurnTimer
public void stopTimer()
ITurnTimer
stopTimer
in interface ITurnTimer
public void actionPerformed(java.awt.event.ActionEvent arg0)
actionPerformed
in interface java.awt.event.ActionListener
public IEvent getTimeRunOutEvent()
ITurnTimer
getTimeRunOutEvent
in interface ITurnTimer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |