modules/graphics/src/test/java/test/javafx/animation/ParallelTransitionPlayTest.java

Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:

*** 21,34 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package javafx.animation; import com.sun.javafx.animation.TickCalculation; import javafx.animation.Animation.Status; import javafx.beans.property.LongProperty; import javafx.beans.property.SimpleLongProperty; import javafx.util.Duration; import static org.junit.Assert.assertEquals; import org.junit.Before; --- 21,39 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package test.javafx.animation; import com.sun.javafx.animation.TickCalculation; import javafx.animation.Animation.Status; + import javafx.animation.Interpolator; + import javafx.animation.ParallelTransition; + import javafx.animation.ParallelTransitionShim; + import javafx.animation.Transition; + import javafx.animation.TransitionShim; import javafx.beans.property.LongProperty; import javafx.beans.property.SimpleLongProperty; import javafx.util.Duration; import static org.junit.Assert.assertEquals; import org.junit.Before;
*** 50,61 **** Transition childByX; @Before public void setUp() { amt = new AbstractMasterTimerMock(); ! pt = new ParallelTransition(amt); ! child1X = new Transition() { { setCycleDuration(Duration.minutes(1)); setInterpolator(Interpolator.LINEAR); } --- 55,66 ---- Transition childByX; @Before public void setUp() { amt = new AbstractMasterTimerMock(); ! pt = ParallelTransitionShim.getParallelTransition(amt); ! child1X = new TransitionShim() { { setCycleDuration(Duration.minutes(1)); setInterpolator(Interpolator.LINEAR); }
*** 63,73 **** @Override protected void interpolate(double d) { xProperty.set(Math.round(d * 60000)); } }; ! child1Y = new Transition() { { setCycleDuration(Duration.seconds(10)); setInterpolator(Interpolator.LINEAR); } --- 68,78 ---- @Override protected void interpolate(double d) { xProperty.set(Math.round(d * 60000)); } }; ! child1Y = new TransitionShim() { { setCycleDuration(Duration.seconds(10)); setInterpolator(Interpolator.LINEAR); }
*** 75,85 **** @Override protected void interpolate(double d) { yProperty.set(Math.round(d * 10000)); } }; ! childByX = new Transition() { { setCycleDuration(Duration.seconds(1)); setInterpolator(Interpolator.LINEAR); } --- 80,90 ---- @Override protected void interpolate(double d) { yProperty.set(Math.round(d * 10000)); } }; ! childByX = new TransitionShim() { { setCycleDuration(Duration.seconds(1)); setInterpolator(Interpolator.LINEAR); }
*** 89,99 **** protected void interpolate(double frac) { xProperty.set(Math.round(lastX + frac * 1000)); } @Override ! void impl_sync(boolean forceSync) { super.impl_sync(forceSync); if (forceSync) { lastX = xProperty.get(); } } --- 94,104 ---- protected void interpolate(double frac) { xProperty.set(Math.round(lastX + frac * 1000)); } @Override ! public void impl_sync(boolean forceSync) { super.impl_sync(forceSync); if (forceSync) { lastX = xProperty.get(); } }