Class Timer

java.lang.Object
jfxtras.animation.Timer

public class Timer extends Object
A timer class in the spirit of java.swing.Timer but using JavaFX properties.
  • Property Details

    • delay

      public javafx.beans.property.ObjectProperty<javafx.util.Duration> delayProperty
      delay: initial delay
      See Also:
    • cycleDuration

      public javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationProperty
      cycleDuration: time between fires
      See Also:
    • repeats

      public javafx.beans.property.ObjectProperty<Boolean> repeatsProperty
      repeats: If flag is false, instructs the Timer to send only one action event to its listeners.
      See Also:
  • Field Details

    • runnable

      private final Runnable runnable
    • isDaemon

      private final boolean isDaemon
    • timer

      private volatile Timer timer
    • delayObjectProperty

      private final javafx.beans.property.ObjectProperty<javafx.util.Duration> delayObjectProperty
    • cycleDurationObjectProperty

      private final javafx.beans.property.ObjectProperty<javafx.util.Duration> cycleDurationObjectProperty
    • repeatsObjectProperty

      private final javafx.beans.property.ObjectProperty<Boolean> repeatsObjectProperty
    • timerTaskAtomicReference

      private final AtomicReference<TimerTask> timerTaskAtomicReference
  • Constructor Details

    • Timer

      public Timer(Runnable runnable)
      Parameters:
      runnable -
    • Timer

      public Timer(boolean isDaemon, Runnable runnable)
      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

      public Timer withDelay(javafx.util.Duration value)
    • 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

      public Timer withCycleDuration(javafx.util.Duration value)
    • repeatsProperty

      public javafx.beans.property.ObjectProperty<Boolean> 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

      public Timer withRepeats(boolean value)
    • start

      public Timer start()
      Start the timer
    • stop

      public Timer stop()
      stop the timer if running
    • restart

      public Timer restart()
      restart the timer