@Test public void frame4() { final Interpolator i = new SplineInterpolator(0, 1, 0, 1); final Interpolator a = new AccelerationInterpolator(0.1, 0.1); KeyFrames.Frame<Integer> f1 = new KeyFrames.Frame<Integer>(2, 0.3, i); KeyFrames.Frame<Integer> f2 = new KeyFrames.Frame<Integer>(3, 0.4, a); KeyFrames.Frame<Integer> f3 = new KeyFrames.Frame<Integer>(4, 1, DiscreteInterpolator.getInstance()); final KeyFrames.Builder<Integer> b = new KeyFrames.Builder<Integer>(1); b.addFrame(f1); b.addFrame(f2); b.addFrame(f3); final KeyFrames<Integer> kf = b.build(); Assert.assertEquals(1, kf.getFrame(0).getValue().intValue()); Assert.assertEquals(2, kf.getFrame(1).getValue().intValue()); Assert.assertEquals(3, kf.getFrame(2).getValue().intValue()); Assert.assertEquals(4, kf.getFrame(3).getValue().intValue()); Assert.assertEquals(0.0, kf.getFrame(0).getTimeFraction(), 1e-9); Assert.assertEquals(0.3, kf.getFrame(1).getTimeFraction(), 1e-9); Assert.assertEquals(0.4, kf.getFrame(2).getTimeFraction(), 1e-9); Assert.assertEquals(1.0, kf.getFrame(3).getTimeFraction(), 1e-9); Assert.assertNull(kf.getFrame(0).getInterpolator()); Assert.assertSame(i, kf.getFrame(1).getInterpolator()); Assert.assertSame(a, kf.getFrame(2).getInterpolator()); Assert.assertSame(DiscreteInterpolator.getInstance(), kf.getFrame(3).getInterpolator()); }
@NonNull public Frame<T> getFrame(int index) { return f_frames[index]; }
KeyFrames implements Iterable<Frame<T>> { @NonNull public Frame<T> getFrame(int index) { return f_frames[index]; } }
KeyFrames implements Iterable<Frame<T>> { @NonNull public Frame<T> getFrame(int index) { return f_frames[index]; } @RegionEffects("none")  KeyFrames(@Unique Frame<T>[] frames, Evaluator<T> evaluator); }
KeyFrames implements Iterable<Frame<T>> { @NonNull public Frame<T> getFrame(int index) { return f_frames[index]; } @RegionEffects("none")  KeyFrames(@Unique Frame<T>[] frames, Evaluator<T> evaluator); @Borrowed("this") @RegionEffects("reads this:Instance") int size(); @NonNull Frame<T> getFrame(int index); @NonNull Class<?> getClassOfValue(); @Borrowed("this") @RegionEffects("reads this:Instance") @Unique("return") Iterator<Frame<T>> iterator(); @RegionEffects("reads any(org.jdesktop.core.animation.timing.KeyFrames.Frame):Instance, this:Instance") int getFrameIndexAt(double fraction); T getInterpolatedValueAt(double fraction); }
KeyFrames implements Iterable<Frame<T>> { @NonNull public Frame<T> getFrame(int index) { return f_frames[index]; } @RegionEffects("none")  KeyFrames(@Unique Frame<T>[] frames, Evaluator<T> evaluator); @Borrowed("this") @RegionEffects("reads this:Instance") int size(); @NonNull Frame<T> getFrame(int index); @NonNull Class<?> getClassOfValue(); @Borrowed("this") @RegionEffects("reads this:Instance") @Unique("return") Iterator<Frame<T>> iterator(); @RegionEffects("reads any(org.jdesktop.core.animation.timing.KeyFrames.Frame):Instance, this:Instance") int getFrameIndexAt(double fraction); T getInterpolatedValueAt(double fraction);  }