public class TimeTracker extends Thread
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 can be used in combination with the TimelineModel
by
binding the TimelineModel.nowProperty()
to the
timeProperty()
.Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
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.
|
Instant |
getTime() |
void |
run() |
void |
setDelay(long millis)
Sets the delay between updates of
TimelineModel.nowProperty() . |
void |
startTracking()
Starts the tracking of the time.
|
void |
stopTracking()
Stops the tracking of the time.
|
javafx.beans.property.ReadOnlyObjectProperty<Instant> |
timeProperty() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public final javafx.beans.property.ReadOnlyObjectProperty<Instant> timeProperty()
public final Instant getTime()
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()
public final void stopTracking()
protected Instant getNow()
Instant.now()
.TimelineModel.setNow(Instant)
Copyright © 2020 Dirk Lemmermann Software & Consulting. All rights reserved.