|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.action.Actor net.jinx.action.Clock net.jinx.action.RealTimeClock
public class RealTimeClock
Clock extension where ClockEvents are sent at regular intervals. IdleEvents
are sent as often as possible between ClockEvents.
Scheduling of ClockEvents is handled through the use of a
net.jinx.time.StopWatch object. When the system is very busy, RealTimeClocks
will behave almost as though they've been paused.
API Stability: Alpha.
Field Summary |
---|
Fields inherited from class net.jinx.action.Clock |
---|
sync |
Constructor Summary | |
---|---|
RealTimeClock(float deltaTime)
|
|
RealTimeClock(java.lang.String name,
float deltaTime)
Constructs a new RealTimeClock with a default name. |
Method Summary | |
---|---|
float |
getTimeFactor()
Provides the time factor that affects the speed of simulation. |
boolean |
isPaused()
Returns true if this Clock is paused. |
boolean |
isStopped()
Provides a way to check if the time keeping thread is running. |
void |
pause()
Pauses this Clock. |
void |
play()
Unpauses and/or constructs a new java.lang.Thread to handle time keeping. |
void |
run()
This method is for the time keeping thread only. |
void |
setTimeFactor(float timeFactor)
Sets the time factor that affects the speed of simulation. |
void |
stop()
Stops the time keeping thread. |
Methods inherited from class net.jinx.action.Clock |
---|
actorAdded, actorRemoved, getDeltaTime, processEvent, sendClockEvent, sendClockStateEvent, sendIdleEvent, setDeltaTime |
Methods inherited from class net.jinx.action.Actor |
---|
checkAllowAdd, getName, getOwner, hashCode, ownerChanged, sendEvent, sendEvent, sendEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RealTimeClock(float deltaTime)
public RealTimeClock(java.lang.String name, float deltaTime)
deltaTime
- the change in time value for this clock.
java.lang.IllegalArgumentException
- if deltaTime is less than or equal to
zero.Method Detail |
---|
public void setTimeFactor(float timeFactor)
timeFactor
- the multiplier.
java.lang.IllegalArgumentException
- if the time factor is less than or equal
to zero.public float getTimeFactor()
public void pause()
public boolean isPaused()
public void play()
public void stop()
public boolean isStopped()
public void run()
run
in interface java.lang.Runnable
java.lang.IllegalThreadStateException
- if the current thread is not the time
keeping thread.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |