java.lang.Object
jfxtras.animation.Timer
A timer class in the spirit of java.swing.Timer but using JavaFX properties.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty<javafx.util.Duration>
cycleDuration: time between firesjavafx.beans.property.ObjectProperty<javafx.util.Duration>
delay: initial delayjavafx.beans.property.ObjectProperty<Boolean>
repeats: If flag is false, instructs the Timer to send only one action event to its listeners. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final javafx.beans.property.ObjectProperty<javafx.util.Duration>
private final javafx.beans.property.ObjectProperty<javafx.util.Duration>
private final boolean
private final javafx.beans.property.ObjectProperty<Boolean>
private final Runnable
private Timer
private final AtomicReference<TimerTask>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ObjectProperty<javafx.util.Duration>
cycleDuration: time between firesjavafx.beans.property.ObjectProperty<javafx.util.Duration>
delay: initial delayjavafx.util.Duration
Gets the value of the property cycleDuration.javafx.util.Duration
getDelay()
Gets the value of the property delay.boolean
Gets the value of the property repeats.javafx.beans.property.ObjectProperty<Boolean>
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.restart()
restart the timervoid
setCycleDuration
(javafx.util.Duration value) Sets the value of the property cycleDuration.void
setDelay
(javafx.util.Duration value) Sets the value of the property delay.void
setRepeats
(boolean value) Sets the value of the property repeats.start()
Start the timerstop()
stop the timer if runningwithCycleDuration
(javafx.util.Duration value) withDelay
(javafx.util.Duration value) withRepeats
(boolean value)
-
Property Details
-
delay
public javafx.beans.property.ObjectProperty<javafx.util.Duration> delayPropertydelay: initial delay- See Also:
-
cycleDuration
public javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationPropertycycleDuration: time between fires- See Also:
-
repeats
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.- See Also:
-
-
Field Details
-
runnable
-
isDaemon
private final boolean isDaemon -
timer
-
delayObjectProperty
private final javafx.beans.property.ObjectProperty<javafx.util.Duration> delayObjectProperty -
cycleDurationObjectProperty
private final javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationObjectProperty -
repeatsObjectProperty
-
timerTaskAtomicReference
-
-
Constructor Details
-
Timer
- Parameters:
runnable
-
-
Timer
- Parameters:
isDaemon
-runnable
-
-
-
Method Details
-
delayProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> delayProperty()delay: initial delay- See Also:
-
getDelay
public javafx.util.Duration getDelay()Gets the value of the property delay.- Property description:
- delay: initial delay
-
setDelay
public void setDelay(javafx.util.Duration value) Sets the value of the property delay.- Property description:
- delay: initial delay
-
withDelay
-
cycleDurationProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationProperty()cycleDuration: time between fires- See Also:
-
getCycleDuration
public javafx.util.Duration getCycleDuration()Gets the value of the property cycleDuration.- Property description:
- cycleDuration: time between fires
-
setCycleDuration
public void setCycleDuration(javafx.util.Duration value) Sets the value of the property cycleDuration.- Property description:
- cycleDuration: time between fires
-
withCycleDuration
-
repeatsProperty
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.- See Also:
-
getRepeats
public boolean getRepeats()Gets the value of the property repeats.- Property description:
- repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
-
setRepeats
public void setRepeats(boolean value) Sets the value of the property repeats.- Property description:
- repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
-
withRepeats
-
start
Start the timer -
stop
stop the timer if running -
restart
restart the timer
-