void reverse(double now) { currentDuration = duration - (currentDuration - now); // update initial values for (JFXKeyValue keyValue : keyValues) { final WritableValue target = keyValue.getTarget(); if (target != null) { initialValuesMap.put(target, target.getValue()); endValuesMap.put(target, keyValue.getEndValue()); } } }
public void applyEndValues() { for (JFXKeyValue keyValue : keyValues) { if (keyValue.isValid()) { final WritableValue target = keyValue.getTarget(); if (target != null) { final Object endValue = keyValue.getEndValue(); if (endValue != null && !target.getValue().equals(endValue)) { target.setValue(endValue); } } } } }
public void init() { finished = false; for (JFXKeyValue keyValue : keyValues) { if (keyValue.getTarget() != null) { // replaced putIfAbsent for mobile compatibility if (!initialValuesMap.containsKey(keyValue.getTarget())) { initialValuesMap.put(keyValue.getTarget(), keyValue.getTarget().getValue()); } if (!endValuesMap.containsKey(keyValue.getTarget())) { endValuesMap.put(keyValue.getTarget(), keyValue.getEndValue()); } } } }
public void animate(double now) { if (now <= currentDuration) { for (JFXKeyValue keyValue : keyValues) { if (keyValue.isValid()) { final WritableValue target = keyValue.getTarget(); final Object endValue = endValuesMap.get(target); if (endValue != null && target != null && !target.getValue().equals(endValue)) { target.setValue(keyValue.getInterpolator().interpolate(initialValuesMap.get(target), endValue, now / currentDuration)); } } } } else { if (!finished) { finished = true; for (JFXKeyValue keyValue : keyValues) { if (keyValue.isValid()) { final WritableValue target = keyValue.getTarget(); if (target != null) { // set updated end value instead of cached final Object endValue = keyValue.getEndValue(); if (endValue != null) { target.setValue(endValue); } } } } currentDuration = duration; } } }
@Override protected Object doGetValue() { return property.getValue(); }
@Override public boolean interpolate(boolean startValue, boolean endValue, double fraction) { return condition.getAsBoolean() ? interpolator.interpolate(startValue, endValue, fraction) : (boolean) target.getValue(); }
@Override public int interpolate(int startValue, int endValue, double fraction) { return condition.getAsBoolean() ? interpolator.interpolate(startValue, endValue, fraction) : (int) target.getValue(); }
@Override public long interpolate(long startValue, long endValue, double fraction) { return condition.getAsBoolean() ? interpolator.interpolate(startValue, endValue, fraction) : (long) target.getValue(); }
@Override public Object interpolate(Object startValue, Object endValue, double fraction) { return condition.getAsBoolean() ? interpolator.interpolate(startValue, endValue, fraction) : target.getValue(); }
@Override public double interpolate(double startValue, double endValue, double fraction) { return condition.getAsBoolean() ? interpolator.interpolate(startValue, endValue, fraction) : (double) target.getValue(); }
void reverse(double now) { currentDuration = duration - (currentDuration - now); // update initial values for (JFXKeyValue keyValue : keyValues) { final WritableValue target = keyValue.getTarget(); if (target != null) { initialValuesMap.put(target, target.getValue()); endValuesMap.put(target, keyValue.getEndValue()); } } }
@Override public void setValue(W w) { if (!ValueUtils.areEqual(wrapped.getValue(), w)) { wrapped.setValue(w); } } }
public void applyEndValues() { for (JFXKeyValue keyValue : keyValues) { if (keyValue.isValid()) { final WritableValue target = keyValue.getTarget(); if (target != null) { final Object endValue = keyValue.getEndValue(); if (endValue != null && !target.getValue().equals(endValue)) { target.setValue(endValue); } } } } }
public void init() { finished = false; for (JFXKeyValue keyValue : keyValues) { if (keyValue.getTarget() != null) { // replaced putIfAbsent for mobile compatibility if (!initialValuesMap.containsKey(keyValue.getTarget())) { initialValuesMap.put(keyValue.getTarget(), keyValue.getTarget().getValue()); } if (!endValuesMap.containsKey(keyValue.getTarget())) { endValuesMap.put(keyValue.getTarget(), keyValue.getEndValue()); } } } }
public void animate(double now) { if (now <= currentDuration) { for (JFXKeyValue keyValue : keyValues) { if (keyValue.isValid()) { final WritableValue target = keyValue.getTarget(); final Object endValue = endValuesMap.get(target); if (endValue != null && target != null && !target.getValue().equals(endValue)) { target.setValue(keyValue.getInterpolator().interpolate(initialValuesMap.get(target), endValue, now / currentDuration)); } } } } else { if (!finished) { finished = true; for (JFXKeyValue keyValue : keyValues) { if (keyValue.isValid()) { final WritableValue target = keyValue.getTarget(); if (target != null) { // set updated end value instead of cached final Object endValue = keyValue.getEndValue(); if (endValue != null) { target.setValue(endValue); } } } } currentDuration = duration; } } }
|| (prev.first && target.getValue().equals(prev.keyValue.getEndValue()))) {