Package org.reactfx.value
Class AnimatedVal<T>
- java.lang.Object
-
- org.reactfx.ObservableBase<java.util.function.Consumer<? super T>,T>
-
- org.reactfx.value.ValBase<T>
-
- org.reactfx.value.AnimatedVal<T>
-
- All Implemented Interfaces:
javafx.beans.Observable
,javafx.beans.value.ObservableValue<T>
,Observable<java.util.function.Consumer<? super T>>
,ProperObservable<java.util.function.Consumer<? super T>,T>
,ProperVal<T>
,Val<T>
class AnimatedVal<T> extends ValBase<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AnimatedVal.FractionTransition
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.BiFunction<? super T,? super T,java.time.Duration>
duration
private double
fraction
private Interpolator<T>
interpolator
private T
oldValue
private javafx.beans.value.ObservableValue<T>
src
private AnimatedVal.FractionTransition
transition
-
Constructor Summary
Constructors Constructor Description AnimatedVal(javafx.beans.value.ObservableValue<T> src, java.util.function.BiFunction<? super T,? super T,java.time.Duration> duration, Interpolator<T> interpolator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected T
computeValue()
protected Subscription
connect()
Implementation of this method should start observing inputs.-
Methods inherited from class org.reactfx.value.ValBase
getValue, invalidate, newObserver, observeInputs
-
Methods inherited from class org.reactfx.ObservableBase
addObserver, enqueueNotifications, equals, forEachObserver, getObserverCount, hashCode, isObservingInputs, notifyObservers, notifyObservers, observe, removeObserver, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.reactfx.Observable
addObserver, observe, removeObserver
-
Methods inherited from interface org.reactfx.ProperObservable
defaultEquals, defaultHashCode, defaultToString, notifyObservers
-
Methods inherited from interface org.reactfx.value.ProperVal
defaultNotificationAccumulator
-
Methods inherited from interface org.reactfx.value.Val
addInvalidationObserver, addListener, addListener, animate, animate, asList, asVar, changes, conditionOn, conditionOnShowing, filter, flatMap, getOpt, getOrElse, getOrSupply, getOrThrow, ifPresent, invalidations, isEmpty, isPresent, map, mapDynamic, observeChanges, observeInvalidations, orElse, orElseConst, pin, removeInvalidationObserver, removeListener, removeListener, selectVar, selectVar, suspendable, values
-
-
-
-
Field Detail
-
src
private final javafx.beans.value.ObservableValue<T> src
-
duration
private final java.util.function.BiFunction<? super T,? super T,java.time.Duration> duration
-
interpolator
private final Interpolator<T> interpolator
-
transition
private final AnimatedVal.FractionTransition transition
-
fraction
private double fraction
-
oldValue
private T oldValue
-
-
Constructor Detail
-
AnimatedVal
AnimatedVal(javafx.beans.value.ObservableValue<T> src, java.util.function.BiFunction<? super T,? super T,java.time.Duration> duration, Interpolator<T> interpolator)
-
-
Method Detail
-
connect
protected Subscription connect()
Description copied from class:ValBase
Implementation of this method should start observing inputs. If the value of this Val may change as a result of input change, the corresponding input observer should callValBase.invalidate()
to notify observers of this Val. By the time of calling ValBase.invalidate(), the input observer must have already updated any internal state of this Val, so that a subsequent call toValBase.computeValue()
returns the current value of this Val.
-
computeValue
protected T computeValue()
- Specified by:
computeValue
in classValBase<T>
-
-