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 thecycleDuration
property.javafx.util.Duration
getDelay()
Gets the value of thedelay
property.boolean
Gets the value of therepeats
property.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 thecycleDuration
property.void
setDelay
(javafx.util.Duration value) Sets the value of thedelay
property.void
setRepeats
(boolean value) Sets the value of therepeats
property.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- Returns:
- the
delay
property - See Also:
-
getDelay
public javafx.util.Duration getDelay()Gets the value of thedelay
property.- Property description:
- delay: initial delay
- Returns:
- the value of the
delay
property - See Also:
-
setDelay
public void setDelay(javafx.util.Duration value) Sets the value of thedelay
property.- Property description:
- delay: initial delay
- Parameters:
value
- the value for thedelay
property- See Also:
-
withDelay
-
cycleDurationProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationProperty()cycleDuration: time between fires- Returns:
- the
cycleDuration
property - See Also:
-
getCycleDuration
public javafx.util.Duration getCycleDuration()Gets the value of thecycleDuration
property.- Property description:
- cycleDuration: time between fires
- Returns:
- the value of the
cycleDuration
property - See Also:
-
setCycleDuration
public void setCycleDuration(javafx.util.Duration value) Sets the value of thecycleDuration
property.- Property description:
- cycleDuration: time between fires
- Parameters:
value
- the value for thecycleDuration
property- See Also:
-
withCycleDuration
-
repeatsProperty
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.- Returns:
- the
repeats
property - See Also:
-
getRepeats
public boolean getRepeats()Gets the value of therepeats
property.- Property description:
- repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
- Returns:
- the value of the
repeats
property - See Also:
-
setRepeats
public void setRepeats(boolean value) Sets the value of therepeats
property.- Property description:
- repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
- Parameters:
value
- the value for therepeats
property- See Also:
-
withRepeats
-
start
Start the timer -
stop
stop the timer if running -
restart
restart the timer
-