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
|
javafx.beans.property.ObjectProperty<javafx.util.Duration> |
delay
|
javafx.beans.property.ObjectProperty<java.lang.Boolean> |
repeats
|
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()
|
javafx.beans.property.ObjectProperty<javafx.util.Duration> |
delayProperty()
|
javafx.util.Duration |
getCycleDuration() |
javafx.util.Duration |
getDelay() |
boolean |
getRepeats() |
javafx.beans.property.ObjectProperty<java.lang.Boolean> |
repeatsProperty()
|
Timer |
restart()
|
void |
setCycleDuration(javafx.util.Duration value) |
void |
setDelay(javafx.util.Duration value) |
void |
setRepeats(boolean value) |
Timer |
start()
|
Timer |
stop()
|
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