Class Timer
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 booleanprivate final javafx.beans.property.ObjectProperty<Boolean> private final Runnableprivate Timerprivate 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.DurationGets the value of thecycleDurationproperty.javafx.util.DurationgetDelay()Gets the value of thedelayproperty.booleanGets the value of therepeatsproperty.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 timervoidsetCycleDuration(javafx.util.Duration value) Sets the value of thecycleDurationproperty.voidsetDelay(javafx.util.Duration value) Sets the value of thedelayproperty.voidsetRepeats(boolean value) Sets the value of therepeatsproperty.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
delayproperty - See Also:
-
getDelay
public javafx.util.Duration getDelay()Gets the value of thedelayproperty.- Property description:
- delay: initial delay
- Returns:
- the value of the
delayproperty - See Also:
-
setDelay
public void setDelay(javafx.util.Duration value) Sets the value of thedelayproperty.- Property description:
- delay: initial delay
- Parameters:
value- the value for thedelayproperty- See Also:
-
withDelay
-
cycleDurationProperty
public javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationProperty()cycleDuration: time between fires- Returns:
- the
cycleDurationproperty - See Also:
-
getCycleDuration
public javafx.util.Duration getCycleDuration()Gets the value of thecycleDurationproperty.- Property description:
- cycleDuration: time between fires
- Returns:
- the value of the
cycleDurationproperty - See Also:
-
setCycleDuration
public void setCycleDuration(javafx.util.Duration value) Sets the value of thecycleDurationproperty.- Property description:
- cycleDuration: time between fires
- Parameters:
value- the value for thecycleDurationproperty- See Also:
-
withCycleDuration
-
repeatsProperty
repeats: If flag is false, instructs the Timer to send only one action event to its listeners.- Returns:
- the
repeatsproperty - See Also:
-
getRepeats
public boolean getRepeats()Gets the value of therepeatsproperty.- Property description:
- repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
- Returns:
- the value of the
repeatsproperty - See Also:
-
setRepeats
public void setRepeats(boolean value) Sets the value of therepeatsproperty.- Property description:
- repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
- Parameters:
value- the value for therepeatsproperty- See Also:
-
withRepeats
-
start
Start the timer -
stop
stop the timer if running -
restart
restart the timer
-