Class ClipEnvelope

java.lang.Object
javafx.animation.ClipEnvelope
Direct Known Subclasses:
FiniteClipEnvelope, InfiniteClipEnvelope, SingleLoopClipEnvelope

public abstract class ClipEnvelope extends Object
An instance of ClipEnvelope handles the loop-part of a clip. The functionality to react on a pulse-signal from the timer is implemented in two classes: ClipEnvelope and ClipCore. ClipEnvelope is responsible for the "loop-part" (keeping track of the number of cycles, handling the direction of the clip etc.). ClipCore takes care of the inner part (interpolating the values, triggering the action-functions, ...) Both classes have an abstract public definition and can only be created using the factory method create(). The intent is to provide a general implementation plus eventually some fast-track implementations for common use cases.
  • Field Details

    • INDEFINITE

      protected static final long INDEFINITE
      See Also:
    • EPSILON

      protected static final double EPSILON
      See Also:
    • animation

      protected Animation animation
    • rate

      protected double rate
    • cycleTicks

      protected long cycleTicks
    • deltaTicks

      protected long deltaTicks
    • ticks

      protected long ticks
    • currentRate

      protected double currentRate
    • inTimePulse

      protected boolean inTimePulse
    • aborted

      protected boolean aborted
  • Constructor Details

    • ClipEnvelope

      protected ClipEnvelope(Animation animation)
  • Method Details

    • create

      public static ClipEnvelope create(Animation animation)
    • setCycleDuration

      public abstract ClipEnvelope setCycleDuration(Duration cycleDuration)
    • setRate

      public abstract void setRate(double rate)
    • setAutoReverse

      public abstract void setAutoReverse(boolean autoReverse)
    • setCycleCount

      public abstract ClipEnvelope setCycleCount(int cycleCount)
    • updateCycleTicks

      protected void updateCycleTicks(Duration cycleDuration)
    • wasSynched

      public boolean wasSynched()
    • start

      public void start()
    • timePulse

      public abstract void timePulse(long currentTick)
    • jumpTo

      public abstract void jumpTo(long ticks)
    • abortCurrentPulse

      public void abortCurrentPulse()
    • calculateCurrentRate

      protected abstract double calculateCurrentRate()
    • setCurrentRate

      protected void setCurrentRate(double currentRate)
    • checkBounds

      protected static long checkBounds(long value, long max)
    • getCurrentRate

      public double getCurrentRate()