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