public class Timer extends Object
A timer class in the spirit of java.swing.Timer but using JavaFX properties.
Type | Property and Description |
---|---|
ObjectProperty<Duration> |
cycleDuration
cycleDuration: time between fires
|
ObjectProperty<Duration> |
delay
delay: initial delay
|
ObjectProperty<Boolean> |
repeats
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
|
Constructor and Description |
---|
Timer(boolean isDaemon,
Runnable runnable) |
Timer(Runnable runnable) |
Modifier and Type | Method and Description |
---|---|
ObjectProperty<Duration> |
cycleDurationProperty()
cycleDuration: time between fires
|
ObjectProperty<Duration> |
delayProperty()
delay: initial delay
|
Duration |
getCycleDuration() |
Duration |
getDelay() |
boolean |
getRepeats() |
ObjectProperty<Boolean> |
repeatsProperty()
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
|
Timer |
restart()
restart the timer
|
void |
setCycleDuration(Duration value) |
void |
setDelay(Duration value) |
void |
setRepeats(boolean value) |
Timer |
start()
Start the timer
|
Timer |
stop()
stop the timer if running
|
Timer |
withCycleDuration(Duration value) |
Timer |
withDelay(Duration value) |
Timer |
withRepeats(boolean value) |
public ObjectProperty<Duration> delayProperty
delay: initial delay
getDelay()
,
setDelay(Duration)
public ObjectProperty<Duration> cycleDurationProperty
cycleDuration: time between fires
getCycleDuration()
,
setCycleDuration(Duration)
public ObjectProperty<Boolean> repeatsProperty
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
getRepeats()
,
setRepeats(boolean)
public Timer(Runnable runnable)
runnable
- public Timer(boolean isDaemon, Runnable runnable)
isDaemon
- runnable
- public ObjectProperty<Duration> delayProperty()
delay: initial delay
getDelay()
,
setDelay(Duration)
public Duration getDelay()
public void setDelay(Duration value)
public ObjectProperty<Duration> cycleDurationProperty()
cycleDuration: time between fires
getCycleDuration()
,
setCycleDuration(Duration)
public Duration getCycleDuration()
public void setCycleDuration(Duration value)
public ObjectProperty<Boolean> repeatsProperty()
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
getRepeats()
,
setRepeats(boolean)
public boolean getRepeats()
public void setRepeats(boolean value)
public Timer withRepeats(boolean value)
public Timer start()
Start the timer
public Timer stop()
stop the timer if running
public Timer restart()
restart the timer