public class TimeTracker extends Object
TimelineModel.nowProperty()
. In most cases the time "now" will be
equivalent to the system time but in simulations this might not be the case.
The time tracker is used by the timeline and can be replaced by calling
Timeline.setTimeTracker(TimeTracker)
. However, a default tracker is
already installed and can be started by calling
Timeline.startTimeTracking()
.Constructor and Description |
---|
TimeTracker()
Constructs a new tracker.
|
Modifier and Type | Method and Description |
---|---|
long |
getDelay()
Returns the delay in milliseconds between updates of
TimelineModel.nowProperty() . |
protected Instant |
getNow()
Override to return the instant that will be set as "now" on the timeline
model.
|
TimelineModel<?> |
getTimelineModel() |
void |
setDelay(long millis)
Sets the delay between updates of
TimelineModel.nowProperty() . |
void |
setTimelineModel(TimelineModel<?> model) |
void |
startTracking()
Starts the tracking of the time.
|
void |
stopTracking()
Stops the tracking of the time.
|
public final void setTimelineModel(TimelineModel<?> model)
public final TimelineModel<?> getTimelineModel()
public final long getDelay()
TimelineModel.nowProperty()
. The default is 1000 millis.public final void setDelay(long millis)
TimelineModel.nowProperty()
.
The default is 1000 millis.millis
- the new delayIllegalArgumentException
- if the delay is zero or smallerpublic final void startTracking()
Timeline.startTimeTracking()
public final void stopTracking()
Timeline.stopTimeTracking()
protected Instant getNow()
Instant.now()
.TimelineModel.setNow(Instant)
Copyright © 2014 Dirk Lemmermann Software & Consulting. All rights reserved.