changeset 2833:c77fa8b03077

RT-28914: Remove unneeded classes in Animation and unused methods Summary: Removed methods that are unused, and trimmed out 8 Java files that aren't needed. Also moved StandaloneAccessor to test code.
author Richard Bair <richard.bair@oracle.com>
date Mon, 11 Mar 2013 09:58:45 -0700
parents c176fd6cd024
children 90056a34a341
files javafx-anim/src/com/sun/javafx/animation/TickCalculation.java javafx-anim/src/com/sun/javafx/animation/TimingTarget.java javafx-anim/src/com/sun/scenario/DelayedRunnable.java javafx-anim/src/com/sun/scenario/Settings.java javafx-anim/src/com/sun/scenario/StandaloneAccessor.java javafx-anim/src/com/sun/scenario/ToolkitAccessor.java javafx-anim/src/com/sun/scenario/animation/AbstractMasterTimer.java javafx-anim/src/com/sun/scenario/animation/AnimationPulse.java javafx-anim/src/com/sun/scenario/animation/AnimationPulseMBean.java javafx-anim/src/com/sun/scenario/animation/FixedPulseTime.java javafx-anim/src/com/sun/scenario/animation/MilliCurrentTime.java javafx-anim/src/com/sun/scenario/animation/NanoCurrentTime.java javafx-anim/src/com/sun/scenario/animation/SplineInterpolator.java javafx-anim/src/com/sun/scenario/animation/shared/AnimationAccessor.java javafx-anim/src/com/sun/scenario/animation/shared/AnimationPulseReceiver.java javafx-anim/src/com/sun/scenario/animation/shared/ClipEnvelope.java javafx-anim/src/com/sun/scenario/animation/shared/ClipEnvelopeFactory.java javafx-anim/src/com/sun/scenario/animation/shared/ClipInterpolator.java javafx-anim/src/com/sun/scenario/animation/shared/CurrentTime.java javafx-anim/src/com/sun/scenario/animation/shared/FiniteClipEnvelope.java javafx-anim/src/com/sun/scenario/animation/shared/GeneralClipInterpolator.java javafx-anim/src/com/sun/scenario/animation/shared/InfiniteClipEnvelope.java javafx-anim/src/com/sun/scenario/animation/shared/InterpolationInterval.java javafx-anim/src/com/sun/scenario/animation/shared/PulseReceiver.java javafx-anim/src/com/sun/scenario/animation/shared/SimpleClipInterpolator.java javafx-anim/src/com/sun/scenario/animation/shared/SingleLoopClipEnvelope.java javafx-anim/src/com/sun/scenario/animation/shared/TimelineClipCore.java javafx-anim/src/javafx/animation/Animation.java javafx-anim/src/javafx/animation/AnimationAccessorImpl.java javafx-anim/test/unit/com/sun/scenario/StandaloneAccessor.java javafx-anim/test/unit/com/sun/scenario/ToolkitAccessorStub.java javafx-anim/test/unit/com/sun/scenario/animation/AbstractMasterTimerMock.java javafx-anim/test/unit/com/sun/scenario/animation/AbstractMasterTimerTest.java javafx-anim/test/unit/com/sun/scenario/animation/shared/AnimationPulseReceiverTest.java javafx-anim/test/unit/com/sun/scenario/animation/shared/FiniteClipEnvelopeTest.java javafx-anim/test/unit/com/sun/scenario/animation/shared/InfiniteClipEnvelopeTest.java javafx-anim/test/unit/com/sun/scenario/animation/shared/SingleLoopClipEnvelopeTest.java javafx-anim/test/unit/javafx/animation/AnimationImpl.java javafx-anim/test/unit/javafx/animation/AnimationMock.java javafx-anim/test/unit/javafx/animation/AnimationPulseReceiverTest.java javafx-anim/test/unit/javafx/animation/AnimationSetRateTest.java javafx-anim/test/unit/javafx/animation/AnimationTest.java javafx-ui-common/build-closed.xml javafx-ui-common/project.properties javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java javafx-ui-common/src/javafx/scene/Cursor.java javafx-ui-common/test/unit/javafx/animation/AbstractMasterTimerMock.java javafx-ui-common/test/unit/javafx/scene/transform/TransformOperationsTest.java test-stub-toolkit/src/com/sun/javafx/pgstub/StubMasterTimer.java test-stub-toolkit/src/com/sun/javafx/pgstub/StubToolkit.java
diffstat 50 files changed, 900 insertions(+), 1441 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-anim/src/com/sun/javafx/animation/TickCalculation.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/javafx/animation/TickCalculation.java	Mon Mar 11 09:58:45 2013 -0700
@@ -90,10 +90,6 @@
         return Duration.millis(toMillis(ticks));
     }
 
-    public static Duration toDuration(long ticks, double rate) {
-        return Duration.millis(ticks * Math.abs(rate) / TICKS_PER_MILI);
-    }
-    
     public static double toMillis(long ticks) {
         return ticks / TICKS_PER_MILI;
     }
--- a/javafx-anim/src/com/sun/javafx/animation/TimingTarget.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.javafx.animation;
-
-/**
- * This interface provides the methods which are called by Clip during the
- * course of a timing observableArrayList. Applications that wish to receive
- * timing events will either create a subclass of TimingTargetAdapter and
- * override or they can create or use an implementation of TimingTarget. A
- * TimingTarget can be passed into the constructor of Clip or set later with the
- * {@link TimelineClip#addTarget(TimingTarget)} method. Any Clip may have
- * multiple TimingTargets.
- */
-public interface TimingTarget {
-    /**
-     * This method will receive all of the timing events from a Clip during an
-     * animation.
-     * 
-     * @param totalElapsed
-     *            the amount of time that has elapsed relative to the start time
-     *            of a Clip, in milliseconds.
-     */
-    public void timingEvent(long totalElapsed);
-
-    /**
-     * Called when the Clip's animation begins. This provides a chance for
-     * targets to perform any setup required at animation start time.
-     */
-    public void begin();
-
-    /**
-     * Called when the Clip's animation ends.
-     */
-    public void end();
-
-    /**
-     * Called when the direction of a clip changes.
-     */
-    public void toggle();
-
-    /**
-     * Called when the Clip's animation is paused.
-     */
-    public void pause();
-
-    /**
-     * Called when the Clip's animation resumes from a paused state.
-     */
-    public void resume();
-}
--- a/javafx-anim/src/com/sun/scenario/DelayedRunnable.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/DelayedRunnable.java	Mon Mar 11 09:58:45 2013 -0700
@@ -27,6 +27,7 @@
 
 public interface DelayedRunnable extends Runnable {
     /**
+     * Gets the delay <strong>in milliseconds</strong>.
      * @return delay in millis
      */
     public long getDelay();
--- a/javafx-anim/src/com/sun/scenario/Settings.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/Settings.java	Mon Mar 11 09:58:45 2013 -0700
@@ -44,8 +44,8 @@
  */
 public class Settings {
 
-    private final Map<String, String> settings = new HashMap<String, String>(5);
-    private final CopyOnWriteArrayList<Callback<String, Void>> listeners = new CopyOnWriteArrayList<Callback<String, Void>>();
+    private final Map<String, String> settings = new HashMap<>(5);
+    private final CopyOnWriteArrayList<Callback<String, Void>> listeners = new CopyOnWriteArrayList<>();
     private static final Object SETTINGS_KEY;
     static {
         SETTINGS_KEY = new StringBuilder("SettingsKey");
--- a/javafx-anim/src/com/sun/scenario/StandaloneAccessor.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-import com.sun.scenario.animation.AbstractMasterTimer;
-
-/**
- * This class is used in case Toolkit is not present. Usual use case is animaton
- * testing for openjfx-compiler.
- */
-public class StandaloneAccessor extends ToolkitAccessor {
-    private final Map<Object, Object> map = new HashMap<Object, Object>();
-    private final ScheduledExecutorService executor = Executors
-            .newSingleThreadScheduledExecutor(new ThreadFactory() {
-                private final ThreadFactory factory = Executors
-                        .defaultThreadFactory();
-
-                public Thread newThread(Runnable r) {
-                    Thread thread = factory.newThread(r);
-                    thread.setDaemon(true);
-                    return thread;
-                }
-            });
-
-    private AtomicReference<Future<?>> refFuture = new AtomicReference<Future<?>>();
-    private StandaloneMasterTimer standaloneMasterTimer = new StandaloneMasterTimer();
-
-    @Override
-    public Map<Object, Object> getContextMapImpl() {
-        return map;
-    }
-
-    @Override
-    public AbstractMasterTimer getMasterTimerImpl() {
-        return standaloneMasterTimer;
-    }
-
-    private class StandaloneMasterTimer extends AbstractMasterTimer {
-        @Override
-        protected boolean shouldUseNanoTime() {
-            return true;
-        }
-
-        @Override
-        protected void postUpdateAnimationRunnable(
-                final DelayedRunnable animationRunnable) {
-            if (animationRunnable == null) {
-                Future<?> future = refFuture.get();
-                if (future != null) {
-                    future.cancel(false);
-                    refFuture.set(null);
-                }
-                return;
-            }
-            if (refFuture.get() != null) {
-                return;
-            }
-            Future<?> future = executor.schedule(new Runnable() {
-                public void run() {
-                    refFuture.set(null);
-                    animationRunnable.run();
-                }
-            }, animationRunnable.getDelay(), TimeUnit.MILLISECONDS);
-            refFuture.set(future);
-        }
-
-        @Override
-        protected int getPulseDuration(int precision) {
-            int retVal = precision / 60;
-            return retVal;
-        }
-    }
-}
--- a/javafx-anim/src/com/sun/scenario/ToolkitAccessor.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/ToolkitAccessor.java	Mon Mar 11 09:58:45 2013 -0700
@@ -30,8 +30,9 @@
 import com.sun.scenario.animation.AbstractMasterTimer;
 
 /**
- * A simple java accessor to the current Toolkit
- * 
+ * A simple java accessor to the current Toolkit.
+ * This class is ONLY NECESSARY because javafx-anim is separate from javafx-ui-common.
+ * When they are combined, we can remove this class.
  */
 public abstract class ToolkitAccessor {
     private static ToolkitAccessor instance;
--- a/javafx-anim/src/com/sun/scenario/animation/AbstractMasterTimer.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/AbstractMasterTimer.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,15 +25,13 @@
 
 package com.sun.scenario.animation;
 
+import java.util.Arrays;
+import javafx.animation.AnimationTimer;
+import javafx.util.Callback;
 import com.sun.javafx.animation.TickCalculation;
-import javafx.animation.AnimationTimer;
-
 import com.sun.scenario.DelayedRunnable;
 import com.sun.scenario.Settings;
-import com.sun.scenario.animation.shared.CurrentTime;
 import com.sun.scenario.animation.shared.PulseReceiver;
-import java.util.Arrays;
-import javafx.util.Callback;
 
 public abstract class AbstractMasterTimer {
 
@@ -41,13 +39,17 @@
     // to the nogap and fullspeed properties.
     private static Callback<String, Void> pcl = new Callback<String, Void>() {
         public Void call(String key) {
-            if (key.equals(FULLSPEED_PROP)) {
-                fullspeed = Settings.getBoolean(FULLSPEED_PROP);
-            } else if (key.equals(ADAPTIVE_PULSE_PROP)) {
-                useAdaptivePulse = Settings.getBoolean(ADAPTIVE_PULSE_PROP);
-            } else if (key.equals(ANIMATION_MBEAN_ENABLED)) {
-                AnimationPulse.getDefaultBean()
-                  .setEnabled(Settings.getBoolean(ANIMATION_MBEAN_ENABLED));
+            switch (key) {
+                case FULLSPEED_PROP:
+                    fullspeed = Settings.getBoolean(FULLSPEED_PROP);
+                    break;
+                case ADAPTIVE_PULSE_PROP:
+                    useAdaptivePulse = Settings.getBoolean(ADAPTIVE_PULSE_PROP);
+                    break;
+                case ANIMATION_MBEAN_ENABLED:
+                    AnimationPulse.getDefaultBean()
+                                  .setEnabled(Settings.getBoolean(ANIMATION_MBEAN_ENABLED));
+                    break;
             }
             return null;
         }
@@ -69,21 +71,25 @@
     // pulses per second)
     protected final static String PULSE_PROP = "javafx.animation.pulse";
     protected final static String FRAMERATE_PROP = "javafx.animation.framerate";
-    protected final static String FIXED_PULSE_LENGHT_PROP = "com.sun.scenario.animation.fixed.pulse.length";
+    protected final static String FIXED_PULSE_LENGTH_PROP = "com.sun.scenario.animation.fixed.pulse.length";
 
     // property to enable AnimationPulse data gathering
     // note: it can be enabled via the MBean itself too
     protected final static String ANIMATION_MBEAN_ENABLED = "com.sun.scenario.animation.AnimationMBean.enabled";
     protected final static boolean enableAnimationMBean = false;
 
-    protected final int PULSE_DURATION = getPulseDuration(1000);
-    protected final int PULSE_DURATION_NS = getPulseDuration(1000000000);
-    protected final int PULSE_DURATION_TICKS = getPulseDuration((int)TickCalculation.fromMillis(1000));
+    private final int PULSE_DURATION_NS = getPulseDuration(1000000000);
+    private final int PULSE_DURATION_TICKS = getPulseDuration((int)TickCalculation.fromMillis(1000));
 
     private boolean paused = false;
     private long totalPausedTime;
     private long startPauseTime;
 
+    // These methods only exist for the sake of testing.
+    boolean isPaused() { return paused; }
+    long getTotalPausedTime() { return totalPausedTime; }
+    long getStartPauseTime() { return startPauseTime; }
+
     private PulseReceiver receivers[] = new PulseReceiver[2];
     private int receiversLength;
     private boolean receiversLocked;
@@ -93,16 +99,14 @@
                                                                      // snapshot
     private int animationTimersLength;
     private boolean animationTimersLocked;
+    private final boolean shouldUseNanoTime;
 
-    private Runnable activeAnimationHandler;
-    
-    // There is a memory leak possibility by having this be non-static, as
-    // Clip has a ref to this and this (may) have a ref to the enclosing class.
-    // But having it static has initialization issues (need to call
-    // shouldUseNanoTime() in the subclass during static init of the
-    // superclass).
-    // Moving to a true singleton model might help...
-    private final/* static */CurrentTime currentTime = createCurrentTime();
+    // These two variables are ONLY USED if FIXED_PULSE_LENGTH_PROP is true. In this
+    // case, instead of advancing time based on the system time (nanos etc) we instead
+    // increment each animation by a fixed length of time for each pulse. This is
+    // handy while debugging.
+    private final long fixedPulseLength = Boolean.getBoolean(FIXED_PULSE_LENGTH_PROP) ? PULSE_DURATION_NS : 0;
+    private long debugNanos = 0;
 
     private final MainLoop theMaster = new MainLoop();
 
@@ -120,14 +124,6 @@
         return PULSE_DURATION_TICKS;
     }
     
-    protected CurrentTime createCurrentTime() {
-        if (Boolean.getBoolean(FIXED_PULSE_LENGHT_PROP)) { // Fixed time pulse is for debugging purposes only
-            FixedPulseTime time = new FixedPulseTime(PULSE_DURATION_NS);
-            return time;
-        }
-        return shouldUseNanoTime()? new NanoCurrentTime() : new MilliCurrentTime();
-    }
-    
     public void pause() {
         if (!paused) {
             startPauseTime = nanos();
@@ -143,44 +139,25 @@
     }
     
     public long nanos() {
-        return paused? startPauseTime : currentTime.nanos() - totalPausedTime;
+        if (fixedPulseLength > 0) {
+            return debugNanos;
+        }
+
+        return paused ? startPauseTime :
+                (shouldUseNanoTime ?
+                        System.nanoTime() :
+                        System.currentTimeMillis() * 1000000) - totalPausedTime;
     }
 
     public boolean isFullspeed() {
         return fullspeed;
     }
 
-    protected abstract boolean shouldUseNanoTime();
-    
-    /** Prevent external instantiation of MasterTimer */
-    protected AbstractMasterTimer() {
-        if (Boolean.getBoolean(FIXED_PULSE_LENGHT_PROP)) { // Fixed time pulse is for debugging purposes only
-            addPulseReceiver((FixedPulseTime)currentTime);
-        }
+    /** Prevent external instantiation of MasterTimer. */
+    protected AbstractMasterTimer(boolean shouldUseNanoTime) {
+        this.shouldUseNanoTime = shouldUseNanoTime;
     }
     
-    // new methods to interact with Toolkit, will replace current interaction later
-    // for now they call the respecive methods of the old implementation
-    
-    // triggers an animation cycle, called by the platform
-    public void animationTrigger() {
-        theMaster.run();
-    }
-    
-    // return the delay to when the next pulse should be triggered
-    public long getNextPulseTime() {
-        return (theMaster.getDelay());
-    }
-    
-    public boolean isActive() {
-        return !theMaster.inactive;
-    }
-    
-    public void setActiveAnimationHandler(Runnable activeAnimationHandler) {
-        this.activeAnimationHandler = activeAnimationHandler;
-        
-    }
-
     /**
      * Adds a PulseReceiver to the list of targets being tracked against the
      * global schedule. The target should already have an absolute start time
@@ -260,11 +237,6 @@
         }
     }
 
-    @Deprecated
-    public void notifyJobsReady() {
-        postUpdateAnimationRunnable(theMaster);
-    }
-
     /*
      * methods to record times for different stages of a pulse overriden in
      * MasterTimer to collect data for AnimationPulse Mbean
@@ -353,9 +325,6 @@
             if (inactive != newInactive) {
                 inactive = newInactive;
                 final DelayedRunnable animationRunnable = inactive? null : this;
-                if (activeAnimationHandler != null) {
-                    activeAnimationHandler.run();
-                }
                 postUpdateAnimationRunnable(animationRunnable);
             }
         }
@@ -367,6 +336,10 @@
     protected abstract int getPulseDuration(int precision);
 
     protected void timePulseImpl(long now) {
+        if (fixedPulseLength > 0) {
+            debugNanos += fixedPulseLength;
+            now = debugNanos;
+        }
         final PulseReceiver receiversSnapshot[] = receivers;
         final int rLength = receiversLength;
         try {
--- a/javafx-anim/src/com/sun/scenario/animation/AnimationPulse.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/AnimationPulse.java	Mon Mar 11 09:58:45 2013 -0700
@@ -73,40 +73,18 @@
               : 0;
         }
         
-        void recordPaintingStart() {
-            paintingStartNanos = ToolkitAccessor.getMasterTimer().nanos();
-        }
-        
-        void recordPaintingEnd() {
-            paintingEndNanos = ToolkitAccessor.getMasterTimer().nanos();
-        }
-        
         long getPaintingDuration(TimeUnit unit) {
             return (paintingEndNanos > Long.MIN_VALUE && paintingStartNanos > Long.MIN_VALUE) 
               ? unit.convert(paintingEndNanos - paintingStartNanos, TimeUnit.NANOSECONDS)
               : 0;
         }
         
-        void recordScenePaintingStart() {
-            scenePaintingStartNanos = ToolkitAccessor.getMasterTimer().nanos();
-        }
-        
-        void recordScenePaintingEnd() {
-            scenePaintingEndNanos = ToolkitAccessor.getMasterTimer().nanos();
-        }
-        
         long getScenePaintingDuration(TimeUnit unit) {
             return (scenePaintingEndNanos > Long.MIN_VALUE && scenePaintingStartNanos > Long.MIN_VALUE) 
               ? unit.convert(scenePaintingEndNanos - scenePaintingStartNanos, TimeUnit.NANOSECONDS)
               : 0;
         }
         
-        long getPaintingPreparationDuration(TimeUnit unit) {
-            return (paintingStartNanos > Long.MIN_VALUE && scenePaintingStartNanos > Long.MIN_VALUE) 
-              ? unit.convert(scenePaintingStartNanos - paintingStartNanos, TimeUnit.NANOSECONDS)
-              : 0;
-        }
-        
         long getPaintingFinalizationDuration(TimeUnit unit) {
             return (scenePaintingEndNanos > Long.MIN_VALUE && paintingEndNanos > Long.MIN_VALUE) 
               ? unit.convert(paintingEndNanos - scenePaintingEndNanos, TimeUnit.NANOSECONDS)
@@ -210,7 +188,7 @@
 //        }
     }
     
-    private final Queue<PulseData> pulseDataQueue = new ConcurrentLinkedQueue<PulseData>();
+    private final Queue<PulseData> pulseDataQueue = new ConcurrentLinkedQueue<>();
     
     //to be accessed from the EDT
     private PulseData pulseData = null;
@@ -439,18 +417,6 @@
         return getAv(PulseData.AnimationDurationAccessor, 100, TimeUnit.MILLISECONDS);
     }
     
-    public void recordPaintingStart() {
-        if (getEnabled() && pulseData != null) {
-            pulseData.recordPaintingStart();
-        }
-    }
-    
-    public void recordPaintingEnd() {
-        if (getEnabled() && pulseData != null) {
-            pulseData.recordPaintingEnd();
-        }
-    }
-    
     @Override
     public long getPaintingDurationMax() {
         return paintingDurationMax.get();
@@ -467,22 +433,10 @@
     }
     
     @Override
-    public long getPaitningDurationAvIn100Millis() {
+    public long getPaintingDurationAvIn100Millis() {
         return getAv(PulseData.PaintingDurationAccessor, 100, TimeUnit.MILLISECONDS);
     }
     
-    public void recordScenePaintingStart() {
-        if (getEnabled() && pulseData != null) {
-            pulseData.recordScenePaintingStart();
-        }
-    }
-    
-    public void recordScenePaintingEnd() {
-        if (getEnabled() && pulseData != null) {
-            pulseData.recordScenePaintingEnd();
-        }
-    }
-    
     @Override
     public long getScenePaintingDurationMaxIn1Sec() {
         return getMax(PulseData.ScenePaintingDurationAccessor, 1000, TimeUnit.MILLISECONDS);
--- a/javafx-anim/src/com/sun/scenario/animation/AnimationPulseMBean.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/AnimationPulseMBean.java	Mon Mar 11 09:58:45 2013 -0700
@@ -69,7 +69,7 @@
 
     public long getPaintingDurationAv();
 
-    public long getPaitningDurationAvIn100Millis();
+    public long getPaintingDurationAvIn100Millis();
 
     public long getScenePaintingDurationMaxIn1Sec();
 
--- a/javafx-anim/src/com/sun/scenario/animation/FixedPulseTime.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation;
-
-import com.sun.scenario.animation.shared.CurrentTime;
-import com.sun.scenario.animation.shared.PulseReceiver;
-
-/**
- *
- */
-class FixedPulseTime implements CurrentTime, PulseReceiver {
-
-    public FixedPulseTime(long step) {
-        this.step = step;
-    }
-
-    private long currentNanos;
-    private final long step;
-
-    @Override
-    public long nanos() {
-        return currentNanos;
-    }
-
-    @Override
-    public void timePulse(long now) {
-        currentNanos += step;
-    }
-
-}
--- a/javafx-anim/src/com/sun/scenario/animation/MilliCurrentTime.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation;
-
-import com.sun.scenario.animation.shared.CurrentTime;
-
-final class MilliCurrentTime implements CurrentTime {
-
-    @Override
-    public long nanos() {
-        return System.currentTimeMillis() * 1000000;
-    }
-}
--- a/javafx-anim/src/com/sun/scenario/animation/NanoCurrentTime.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation;
-
-import com.sun.scenario.animation.shared.CurrentTime;
-
-final class NanoCurrentTime implements CurrentTime {
-
-    @Override
-    public long nanos() {
-        return System.nanoTime();
-    }
-}
--- a/javafx-anim/src/com/sun/scenario/animation/SplineInterpolator.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/SplineInterpolator.java	Mon Mar 11 09:58:45 2013 -0700
@@ -30,7 +30,7 @@
 /**
  * An implementation of a spline interpolator for temporal interpolation that
  * tries to follow the specification referenced by:
- * http://www.w3.org/TR/SMIL/animation.html#animationNS-OverviewSpline
+ * http://www.w3.org/TR/SMIL/animation.html#animationNS-OverviewSpline .
  * <p>
  * Basically, a cubic Bezier curve is created with start point (0,0) and
  * endpoint (1,1). The other two control points (px1, py1) and (px2, py2) are
@@ -50,37 +50,37 @@
     /**
      * The coordinates of the 2 2D control points for a cubic Bezier curve, with
      * implicit start point (0,0) and end point (1,1) -- each individual
-     * coordinate value must be in range [0,1]
+     * coordinate value must be in range [0,1].
      */
     private final double x1, y1, x2, y2;
 
     /**
      * Do the input control points form a line with (0,0) and (1,1), i.e., x1 ==
-     * y1 and x2 == y2 -- if so, then all x(t) == y(t) for the curve
+     * y1 and x2 == y2 -- if so, then all x(t) == y(t) for the curve.
      */
     private final boolean isCurveLinear;
 
     /**
-     * Power of 2 sample size for lookup table of x values
+     * Power of 2 sample size for lookup table of x values.
      */
     private static final int SAMPLE_SIZE = 16;
 
     /**
      * Difference in t used to calculate each of the xSamples values -- power of
      * 2 sample size should provide exact representation of this value and its
-     * integer multiples (integer in range of [0..SAMPLE_SIZE]
+     * integer multiples (integer in range of [0..SAMPLE_SIZE].
      */
     private static final double SAMPLE_INCREMENT = 1.0 / SAMPLE_SIZE;
 
     /**
      * X values for the bezier curve, sampled at increments of 1/SAMPLE_SIZE --
-     * this is used to find the good initial guess for parameter t, given an x
+     * this is used to find the good initial guess for parameter t, given an x.
      */
     private final double[] xSamples = new double[SAMPLE_SIZE + 1];
 
     /**
      * Creates a new instance with control points (0,0) (px1,py1) (px2,py2)
-     * (1,1) -- px1, py1, px2, py2 all in range [0,1]
+     * (1,1) -- px1, py1, px2, py2 all in range [0,1].
      * 
      * @param px1
      *            X coordinate of first control point, in range [0,1]
--- a/javafx-anim/src/com/sun/scenario/animation/shared/AnimationAccessor.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/AnimationAccessor.java	Mon Mar 11 09:58:45 2013 -0700
@@ -26,7 +26,6 @@
 package com.sun.scenario.animation.shared;
 
 import javafx.animation.Animation;
-import javafx.animation.Timeline;
 
 public abstract class AnimationAccessor {
  public static AnimationAccessor DEFAULT;
@@ -36,7 +35,7 @@
             return DEFAULT;
         }
 
-        // invokes static initializer of Item.class
+        // invokes static initializer of Animation.class
         // that will assign value to the DEFAULT field above
         Class c = Animation.class;
         try {
@@ -48,8 +47,6 @@
         return DEFAULT;
     }
 
-    public abstract void timePulse(Animation animation, long elapsedTime);
-
     public abstract void setCurrentRate(Animation animation, double currentRate);
 
     public abstract void setCurrentTicks(Animation animation, long ticks);
--- a/javafx-anim/src/com/sun/scenario/animation/shared/AnimationPulseReceiver.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation.shared;
-
-import com.sun.javafx.animation.TickCalculation;
-import javafx.animation.Animation;
-import com.sun.scenario.animation.AbstractMasterTimer;
-
-public class AnimationPulseReceiver implements PulseReceiver {
-
-    private final Animation animation;
-    private final AbstractMasterTimer timer;
-
-    private long startTime;
-    private long pauseTime;
-    private boolean paused = false;
-
-    public AnimationPulseReceiver(Animation animation, AbstractMasterTimer timer) {
-        this.animation = animation;
-        this.timer = timer;
-    }
-
-    protected void addPulseReceiver() {
-        timer.addPulseReceiver(this);
-    }
-
-    protected void removePulseReceiver() {
-        timer.removePulseReceiver(this);
-    }
-
-    private long now() {
-        return TickCalculation.fromNano(timer.nanos());
-    }
-
-    public void start(long delay) {
-        paused = false;
-        startTime = now() + delay;
-        addPulseReceiver();
-    }
-
-    public void stop() {
-        if (!paused) {
-            removePulseReceiver();
-        }
-    }
-
-    public void pause() {
-        if (!paused) {
-            pauseTime = now();
-            paused = true;
-            removePulseReceiver();
-        }
-    }
-
-    public void resume() {
-        if (paused) {
-            final long deltaTime = now() - pauseTime;
-            startTime += deltaTime;
-            paused = false;
-            addPulseReceiver();
-        }
-    }
-
-    @Override
-    public void timePulse(long now) {
-        final long elapsedTime = now - startTime;
-        if (elapsedTime < 0) {
-            return;
-        }
-
-        AnimationAccessor.getDefault().timePulse(animation, elapsedTime);
-    }
-}
--- a/javafx-anim/src/com/sun/scenario/animation/shared/ClipEnvelope.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/ClipEnvelope.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,9 +25,9 @@
 
 package com.sun.scenario.animation.shared;
 
-import com.sun.javafx.animation.TickCalculation;
 import javafx.animation.Animation;
 import javafx.util.Duration;
+import com.sun.javafx.animation.TickCalculation;
 
 /**
  * An instance of ClipEnvelope handles the loop-part of a clip.
@@ -39,7 +39,7 @@
  * values, triggering the action-functions, ...)
  * 
  * Both classes have an abstract public definition and can only be created using
- * the factory method create(). The intend is to provide a general
+ * the factory method create(). The intent is to provide a general
  * implementation plus eventually some fast-track implementations for common use
  * cases.
  */
@@ -69,6 +69,16 @@
         }
     }
 
+    public static ClipEnvelope create(Animation animation) {
+        if ((animation.getCycleCount() == 1) || (animation.getCycleDuration().isIndefinite())) {
+            return new SingleLoopClipEnvelope(animation);
+        } else if (animation.getCycleCount() == Animation.INDEFINITE) {
+            return new InfiniteClipEnvelope(animation);
+        } else {
+            return new FiniteClipEnvelope(animation);
+        }
+    }
+
     public abstract ClipEnvelope setCycleDuration(Duration cycleDuration);
     public abstract void setRate(double rate);
     public abstract void setAutoReverse(boolean autoReverse);
--- a/javafx-anim/src/com/sun/scenario/animation/shared/ClipEnvelopeFactory.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation.shared;
-
-import javafx.animation.Animation;
-
-public class ClipEnvelopeFactory {
-
-    private ClipEnvelopeFactory() {}
-
-    public static ClipEnvelope create(Animation animation) {
-        if ((animation.getCycleCount() == 1) || (animation.getCycleDuration().isIndefinite())) {
-            return new SingleLoopClipEnvelope(animation);
-        } else if (animation.getCycleCount() == Animation.INDEFINITE) {
-            return new InfiniteClipEnvelope(animation);
-        } else {
-            return new FiniteClipEnvelope(animation);
-        }
-    }
-
-    
-
-}
--- a/javafx-anim/src/com/sun/scenario/animation/shared/ClipInterpolator.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/ClipInterpolator.java	Mon Mar 11 09:58:45 2013 -0700
@@ -38,10 +38,11 @@
     }
 
     /**
-     * Returns keyFrames.length
+     * Figures out the number of "real" key frames. The user may not have specified the "zero" key
+     * frame, in which case we end up inferring an additional zero key frame on the array.
      * 
-     * @param keyFrames
-     * @return
+     * @param keyFrames The key frames. Must not be null.
+     * @return The "real" number of key frames
      */
     static int getRealKeyFrameCount(KeyFrame[] keyFrames) {
         final int length = keyFrames.length;
--- a/javafx-anim/src/com/sun/scenario/animation/shared/CurrentTime.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation.shared;
-
-/**
- * Query the current time in millis and nanos. Implementations can be based
- * either on System.currentTimeMillis() or System.nanoTime() (but not both!).
- * 
- */
-public interface CurrentTime {
-    public long nanos();
-}
--- a/javafx-anim/src/com/sun/scenario/animation/shared/FiniteClipEnvelope.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/FiniteClipEnvelope.java	Mon Mar 11 09:58:45 2013 -0700
@@ -59,7 +59,7 @@
     @Override
     public ClipEnvelope setCycleDuration(Duration cycleDuration) {
         if (cycleDuration.isIndefinite()) {
-            return ClipEnvelopeFactory.create(animation);
+            return create(animation);
         }
         updateCycleTicks(cycleDuration);
         updateTotalTicks();
@@ -69,7 +69,7 @@
     @Override
     public ClipEnvelope setCycleCount(int cycleCount) {
         if ((cycleCount == 1) || (cycleCount == Animation.INDEFINITE)) {
-            return ClipEnvelopeFactory.create(animation);
+            return create(animation);
         }
         this.cycleCount = cycleCount;
         updateTotalTicks();
--- a/javafx-anim/src/com/sun/scenario/animation/shared/GeneralClipInterpolator.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/GeneralClipInterpolator.java	Mon Mar 11 09:58:45 2013 -0700
@@ -79,9 +79,9 @@
     @Override
     void validate(boolean forceSync) {
         if (invalid) {
-            final Map<WritableValue<?>, KeyValue> lastKeyValues = new HashMap<WritableValue<?>, KeyValue>();
+            final Map<WritableValue<?>, KeyValue> lastKeyValues = new HashMap<>();
             final int n = keyFrames.length;
-            int index = 0;
+            int index;
             for (index = 0; index < n; index++) {
                 final KeyFrame keyFrame = keyFrames[index];
                 if (keyFrameTicks[index] == 0) {
@@ -93,8 +93,8 @@
                 }
             }
 
-            final Map<WritableValue<?>, List<InterpolationInterval>> map = new HashMap<WritableValue<?>, List<InterpolationInterval>>();
-            final Set<WritableValue<?>> undefinedValues = new HashSet<WritableValue<?>>();
+            final Map<WritableValue<?>, List<InterpolationInterval>> map = new HashMap<>();
+            final Set<WritableValue<?>> undefinedValues = new HashSet<>();
             // iterate through all keyFrames
             for (; index < n; index++) {
                 final KeyFrame keyFrame = keyFrames[index];
@@ -107,7 +107,7 @@
                     if (list == null) {
                         // first encounter of a particular target, generate a
                         // new interval list
-                        list = new ArrayList<InterpolationInterval>();
+                        list = new ArrayList<>();
                         map.put(target, list);
                         if (leftKeyValue == null) {
                             list.add(InterpolationInterval.create(
--- a/javafx-anim/src/com/sun/scenario/animation/shared/InfiniteClipEnvelope.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/InfiniteClipEnvelope.java	Mon Mar 11 09:58:45 2013 -0700
@@ -55,7 +55,7 @@
     @Override
     public ClipEnvelope setCycleDuration(Duration cycleDuration) {
         if (cycleDuration.isIndefinite()) {
-            return ClipEnvelopeFactory.create(animation);
+            return create(animation);
         }
         updateCycleTicks(cycleDuration);
         return this;
@@ -63,7 +63,7 @@
 
     @Override
     public ClipEnvelope setCycleCount(int cycleCount) {
-       return (cycleCount != Animation.INDEFINITE)? ClipEnvelopeFactory.create(animation) : this;
+       return (cycleCount != Animation.INDEFINITE)? create(animation) : this;
     }
 
     @Override
--- a/javafx-anim/src/com/sun/scenario/animation/shared/InterpolationInterval.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/InterpolationInterval.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,7 +25,6 @@
 
 package com.sun.scenario.animation.shared;
 
-import com.sun.javafx.animation.TickCalculation;
 import javafx.animation.Interpolator;
 import javafx.animation.KeyValue;
 import javafx.beans.value.WritableBooleanValue;
@@ -59,25 +58,25 @@
                 return new BooleanInterpolationInterval(rightKeyValue, ticks,
                         leftKeyValue.getEndValue());
             case DOUBLE:
-                return (((Interpolator) leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || ((Interpolator) rightKeyValue
+                return ((leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || (rightKeyValue
                         .getInterpolator() instanceof NumberTangentInterpolator)) ? new TangentDoubleInterpolationInterval(
                         rightKeyValue, ticks, leftKeyValue, duration)
                         : new DoubleInterpolationInterval(rightKeyValue,
                                 ticks, leftKeyValue.getEndValue());
             case FLOAT:
-                return (((Interpolator) leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || ((Interpolator) rightKeyValue
+                return ((leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || (rightKeyValue
                         .getInterpolator() instanceof NumberTangentInterpolator)) ? new TangentFloatInterpolationInterval(
                         rightKeyValue, ticks, leftKeyValue, duration)
                         : new FloatInterpolationInterval(rightKeyValue, ticks,
                                 leftKeyValue.getEndValue());
             case INTEGER:
-                return (((Interpolator) leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || ((Interpolator) rightKeyValue
+                return ((leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || (rightKeyValue
                         .getInterpolator() instanceof NumberTangentInterpolator)) ? new TangentIntegerInterpolationInterval(
                         rightKeyValue, ticks, leftKeyValue, duration)
                         : new IntegerInterpolationInterval(rightKeyValue,
                                 ticks, leftKeyValue.getEndValue());
             case LONG:
-                return (((Interpolator) leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || ((Interpolator) rightKeyValue
+                return ((leftKeyValue.getInterpolator() instanceof NumberTangentInterpolator) || (rightKeyValue
                         .getInterpolator() instanceof NumberTangentInterpolator)) ? new TangentLongInterpolationInterval(
                         rightKeyValue, ticks, leftKeyValue, duration)
                         : new LongInterpolationInterval(rightKeyValue, ticks,
@@ -95,20 +94,20 @@
             case BOOLEAN:
                 return new BooleanInterpolationInterval(rightKeyValue, ticks);
             case DOUBLE:
-                return ((Interpolator) rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentDoubleInterpolationInterval(
+                return (rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentDoubleInterpolationInterval(
                         rightKeyValue, ticks)
                         : new DoubleInterpolationInterval(rightKeyValue, ticks);
             case FLOAT:
-                return ((Interpolator) rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentFloatInterpolationInterval(
+                return (rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentFloatInterpolationInterval(
                         rightKeyValue, ticks)
                         : new FloatInterpolationInterval(rightKeyValue, ticks);
             case INTEGER:
-                return ((Interpolator) rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentIntegerInterpolationInterval(
+                return (rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentIntegerInterpolationInterval(
                         rightKeyValue, ticks)
                         : new IntegerInterpolationInterval(rightKeyValue,
                                 ticks);
             case LONG:
-                return ((Interpolator) rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentLongInterpolationInterval(
+                return (rightKeyValue.getInterpolator() instanceof NumberTangentInterpolator) ? new TangentLongInterpolationInterval(
                         rightKeyValue, ticks) : new LongInterpolationInterval(
                         rightKeyValue, ticks);
             case OBJECT:
@@ -179,7 +178,7 @@
 
             return oneMinusTSquared * oneMinusT * p0 + 3 * oneMinusTSquared * t
                     * p1 + 3 * oneMinusT * tSquared * p2 + tSquared * t * p3;
-        };
+        }
 
         protected final void recalculateStartValue(double leftValue) {
             p0 = leftValue;
@@ -222,7 +221,7 @@
             final boolean value = rightInterpolator.interpolate(leftValue,
                     rightValue, frac);
             target.set(value);
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -262,7 +261,7 @@
             final double value = rightInterpolator.interpolate(leftValue,
                     rightValue, frac);
             target.set(value);
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -293,7 +292,7 @@
         @Override
         public void interpolate(double frac) {
             target.set(calculate(frac));
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -333,7 +332,7 @@
             final float value = (float) rightInterpolator.interpolate(
                     leftValue, rightValue, frac);
             target.set(value);
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -364,7 +363,7 @@
         @Override
         public void interpolate(double frac) {
             target.set((float) calculate(frac));
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -404,7 +403,7 @@
             final int value = rightInterpolator.interpolate(leftValue,
                     rightValue, frac);
             target.set(value);
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -435,7 +434,7 @@
         @Override
         public void interpolate(double frac) {
             target.set((int) Math.round(calculate(frac)));
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -475,7 +474,7 @@
             final long value = rightInterpolator.interpolate(leftValue,
                     rightValue, frac);
             target.set(value);
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -506,7 +505,7 @@
         @Override
         public void interpolate(double frac) {
             target.set(Math.round(calculate(frac)));
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
@@ -543,7 +542,7 @@
             final Object value = rightInterpolator.interpolate(leftValue,
                     rightValue, frac);
             target.setValue(value);
-        };
+        }
 
         @Override
         public void recalculateStartValue() {
--- a/javafx-anim/src/com/sun/scenario/animation/shared/PulseReceiver.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/PulseReceiver.java	Mon Mar 11 09:58:45 2013 -0700
@@ -29,6 +29,9 @@
  * A PulseReceiver can receive regular pulses from the MasterTimer. Removing
  * receivers from the MasterTimer needs to be in-sync with the
  * timePulse-iteration. The receiver is removed if timePulse returns true.
+ * The reason we do not use Callback or some other pre-existing interface
+ * is that we want an interface that takes a primitive long, whereas Callback
+ * would require a wrapped Long and would have some impact on performance.
  */
 public interface PulseReceiver {
     /**
--- a/javafx-anim/src/com/sun/scenario/animation/shared/SimpleClipInterpolator.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/SimpleClipInterpolator.java	Mon Mar 11 09:58:45 2013 -0700
@@ -89,7 +89,7 @@
         if (invalid) {
             ticks = endTicks;
             
-            final Map<WritableValue<?>, KeyValue> map = new HashMap<WritableValue<?>, KeyValue>();
+            final Map<WritableValue<?>, KeyValue> map = new HashMap<>();
             // create a map from target => keyValues of endFrame
             for (final KeyValue keyValue : endKeyFrame.getValues()) {
                 map.put(keyValue.getTarget(), keyValue);
--- a/javafx-anim/src/com/sun/scenario/animation/shared/SingleLoopClipEnvelope.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/SingleLoopClipEnvelope.java	Mon Mar 11 09:58:45 2013 -0700
@@ -71,7 +71,7 @@
     @Override
     public ClipEnvelope setCycleDuration(Duration cycleDuration) {
         if ((cycleCount != 1) && !cycleDuration.isIndefinite()) {
-            return ClipEnvelopeFactory.create(animation);
+            return create(animation);
         }
         updateCycleTicks(cycleDuration);
         return this;
@@ -80,7 +80,7 @@
     @Override
     public ClipEnvelope setCycleCount(int cycleCount) {
         if ((cycleCount != 1) && (cycleTicks != ClipEnvelope.INDEFINITE)) {
-            return ClipEnvelopeFactory.create(animation);
+            return create(animation);
         }
         this.cycleCount = cycleCount;
         return this;
--- a/javafx-anim/src/com/sun/scenario/animation/shared/TimelineClipCore.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/com/sun/scenario/animation/shared/TimelineClipCore.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,7 +25,6 @@
 
 package com.sun.scenario.animation.shared;
 
-import com.sun.javafx.animation.TickCalculation;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Comparator;
@@ -35,6 +34,7 @@
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.util.Duration;
+import com.sun.javafx.animation.TickCalculation;
 
 /**
  * An instance of ClipCore handles the core part of a clip.
@@ -98,9 +98,8 @@
             keyFrameTicks[i] = TickCalculation.fromDuration(this.keyFrames[i].getTime());
         }
         clipInterpolator = clipInterpolator.setKeyFrames(sortedKeyFrames, keyFrameTicks);
-        final Duration duration = (n == 0) ? Duration.ZERO
+        return (n == 0) ? Duration.ZERO
                 : sortedKeyFrames[n-1].getTime();
-        return duration;
     }
 
     public void notifyCurrentRateChanged() {
@@ -152,16 +151,7 @@
     }
 
     /**
-     * Called to visit all keyframes within a specified time-interval
-     * 
-     * @param toTime
-     *            the stopping time of the interval (inclusive)
-     * @param catchingUp
-     *            true, if we are running behind and want to skip keyframe
-     *            visits (keyframe.canSkip is true)
-     * @param visitLast
-     *            true, if we want to enforce visiting the last keyframe within
-     *            toTime
+     * Called to visit all keyframes within a specified time-interval.
      */
     public void playTo(long ticks) {
         aborted = false;
@@ -218,7 +208,7 @@
     }
 
     /**
-     * Visit a single keyframe
+     * Visit a single keyframe.
      * 
      * @param kfIndex
      *            the index of the keyframe in the keyframe-array
--- a/javafx-anim/src/javafx/animation/Animation.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/javafx/animation/Animation.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,15 +25,14 @@
 
 package javafx.animation;
 
-import com.sun.javafx.animation.TickCalculation;
 import java.util.HashMap;
-
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.DoubleProperty;
 import javafx.beans.property.DoublePropertyBase;
 import javafx.beans.property.IntegerProperty;
 import javafx.beans.property.IntegerPropertyBase;
 import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.ObjectPropertyBase;
 import javafx.beans.property.ReadOnlyDoubleProperty;
 import javafx.beans.property.ReadOnlyDoublePropertyBase;
 import javafx.beans.property.ReadOnlyObjectProperty;
@@ -45,15 +44,13 @@
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.util.Duration;
+import com.sun.javafx.animation.TickCalculation;
+import com.sun.scenario.ToolkitAccessor;
+import com.sun.scenario.animation.AbstractMasterTimer;
+import com.sun.scenario.animation.shared.ClipEnvelope;
+import com.sun.scenario.animation.shared.PulseReceiver;
 
-import com.sun.scenario.ToolkitAccessor;
-import com.sun.scenario.animation.shared.AnimationPulseReceiver;
-import com.sun.scenario.animation.shared.ClipEnvelope;
-import com.sun.scenario.animation.shared.ClipEnvelopeFactory;
-
-import static com.sun.javafx.animation.TickCalculation.fromDuration;
-import com.sun.scenario.animation.AbstractMasterTimer;
-import javafx.beans.property.ObjectPropertyBase;
+import static com.sun.javafx.animation.TickCalculation.*;
 
 /**
  * The class {@code Animation} provides the core functionality of all animations
@@ -118,7 +115,57 @@
     }
 
     private static final double EPSILON = 1e-12;
-    
+
+    /*
+        These four fields and associated methods were moved here from AnimationPulseReceiver
+        when that class was removed. They could probably be integrated much cleaner into Animation,
+        but to make sure the change was made without introducing regressions, this code was
+        moved pretty much verbatim.
+     */
+    private long startTime;
+    private long pauseTime;
+    private boolean paused = false;
+    private final AbstractMasterTimer timer;
+
+    private long now() {
+        return TickCalculation.fromNano(timer.nanos());
+    }
+
+    void startReceiver(long delay) {
+        paused = false;
+        startTime = now() + delay;
+        timer.addPulseReceiver(pulseReceiver);
+    }
+
+    void pauseReceiver() {
+        if (!paused) {
+            pauseTime = now();
+            paused = true;
+            timer.removePulseReceiver(pulseReceiver);
+        }
+    }
+
+    void resumeReceiver() {
+        if (paused) {
+            final long deltaTime = now() - pauseTime;
+            startTime += deltaTime;
+            paused = false;
+            timer.addPulseReceiver(pulseReceiver);
+        }
+    }
+
+    // package private only for the sake of testing
+    final PulseReceiver pulseReceiver = new PulseReceiver() {
+        @Override public void timePulse(long now) {
+            final long elapsedTime = now - startTime;
+            if (elapsedTime < 0) {
+                return;
+            }
+
+            impl_timePulse(elapsedTime);
+        }
+    };
+
     private class CurrentRateProperty extends ReadOnlyDoublePropertyBase {
         private double value;
         
@@ -174,9 +221,6 @@
         }
     }
     
-
-    private final AnimationPulseReceiver pulseReceiver;
-    
     /**
      * The parent of this {@code Animation}. If this animation has not been
      * added to another animation, such as {@link ParallelTransition} and
@@ -245,13 +289,13 @@
                                         - oldRate) < EPSILON);
                             }
                             setCurrentRate(0.0);
-                            pulseReceiver.pause();
+                            pauseReceiver();
                         } else {
                             if (getStatus() == Status.RUNNING) {
                                 final double currentRate = getCurrentRate();
                                 if (Math.abs(currentRate) < EPSILON) {
                                     setCurrentRate(lastPlayedForward ? newRate : -newRate);
-                                    pulseReceiver.resume();
+                                    resumeReceiver();
                                 } else {
                                     final boolean playingForward = Math.abs(currentRate - oldRate) < EPSILON;
                                     setCurrentRate(playingForward ? newRate : -newRate);
@@ -845,9 +889,9 @@
                     }
                     lastPlayedFinished = false;
                     impl_start(forceSync);
-                    pulseReceiver.start(TickCalculation.fromDuration(getDelay()));
+                    startReceiver(TickCalculation.fromDuration(getDelay()));
                     if (Math.abs(rate) < EPSILON) {
-                        pulseReceiver.pause();
+                        pauseReceiver();
                     } else {
                         
                     }
@@ -861,7 +905,7 @@
             case PAUSED:
                 impl_resume();
                 if (Math.abs(getRate()) >= EPSILON) {
-                    pulseReceiver.resume();
+                    resumeReceiver();
                 }
                 break;
         }
@@ -935,7 +979,7 @@
         }
         if (getStatus() == Status.RUNNING) {
             clipEnvelope.abortCurrentPulse();
-            pulseReceiver.pause();
+            pauseReceiver();
             impl_pause();
         }
     }
@@ -952,9 +996,8 @@
     protected Animation(double targetFramerate) {
         this.targetFramerate = targetFramerate;
         this.resolution = (int) Math.max(1, Math.round(TickCalculation.TICKS_PER_SECOND / targetFramerate));
-        this.pulseReceiver = new AnimationPulseReceiver(this, ToolkitAccessor
-                .getMasterTimer());
-        this.clipEnvelope = ClipEnvelopeFactory.create(this);
+        this.clipEnvelope = ClipEnvelope.create(this);
+        this.timer = ToolkitAccessor.getMasterTimer();
     }
 
     /**
@@ -963,25 +1006,24 @@
     protected Animation() {
         this.resolution = 1;
         this.targetFramerate = TickCalculation.TICKS_PER_SECOND / ToolkitAccessor.getMasterTimer().getDefaultResolution();
-        this.pulseReceiver = new AnimationPulseReceiver(this, ToolkitAccessor
-                .getMasterTimer());
-        this.clipEnvelope = ClipEnvelopeFactory.create(this);
+        this.clipEnvelope = ClipEnvelope.create(this);
+        this.timer = ToolkitAccessor.getMasterTimer();
     }
 
     // These constructors are only for testing purposes
     Animation(AbstractMasterTimer timer) {
         this.resolution = 1;
         this.targetFramerate = TickCalculation.TICKS_PER_SECOND / timer.getDefaultResolution();
-        this.pulseReceiver = new AnimationPulseReceiver(this, timer);
-        this.clipEnvelope = ClipEnvelopeFactory.create(this);
+        this.clipEnvelope = ClipEnvelope.create(this);
+        this.timer = timer;
     }
 
     // These constructors are only for testing purposes
-    Animation(AnimationPulseReceiver pulseReceiver, ClipEnvelope clipEnvelope, int resolution) {
+    Animation(AbstractMasterTimer timer, ClipEnvelope clipEnvelope, int resolution) {
         this.resolution = resolution;
         this.targetFramerate = TickCalculation.TICKS_PER_SECOND / resolution;
-        this.pulseReceiver = pulseReceiver;
         this.clipEnvelope = clipEnvelope;
+        this.timer = timer;
     }
 
     boolean impl_startable(boolean forceSync) {
@@ -1027,7 +1069,9 @@
     }
 
     void impl_stop() {
-        pulseReceiver.stop();
+        if (!paused) {
+            timer.removePulseReceiver(pulseReceiver);
+        }
         setStatus(Status.STOPPED);
         setCurrentRate(0.0);
     }
--- a/javafx-anim/src/javafx/animation/AnimationAccessorImpl.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/src/javafx/animation/AnimationAccessorImpl.java	Mon Mar 11 09:58:45 2013 -0700
@@ -30,11 +30,6 @@
 final class AnimationAccessorImpl extends AnimationAccessor{
 
     @Override
-    public void timePulse(Animation animation, long elapsedTime) {
-        animation.impl_timePulse(elapsedTime);
-    }
-
-    @Override
     public void setCurrentRate(Animation animation, double currentRate) {
         animation.impl_setCurrentRate(currentRate);
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-anim/test/unit/com/sun/scenario/StandaloneAccessor.java	Mon Mar 11 09:58:45 2013 -0700
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 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 com.sun.scenario;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
+
+import com.sun.scenario.animation.AbstractMasterTimer;
+
+/**
+ * This class is used in case Toolkit is not present. Usual use case is animaton
+ * testing for openjfx-compiler.
+ */
+public class StandaloneAccessor extends ToolkitAccessor {
+    private final Map<Object, Object> map = new HashMap<Object, Object>();
+    private final ScheduledExecutorService executor = Executors
+            .newSingleThreadScheduledExecutor(new ThreadFactory() {
+                private final ThreadFactory factory = Executors
+                        .defaultThreadFactory();
+
+                public Thread newThread(Runnable r) {
+                    Thread thread = factory.newThread(r);
+                    thread.setDaemon(true);
+                    return thread;
+                }
+            });
+
+    private AtomicReference<Future<?>> refFuture = new AtomicReference<Future<?>>();
+    private StandaloneMasterTimer standaloneMasterTimer = new StandaloneMasterTimer();
+
+    @Override
+    public Map<Object, Object> getContextMapImpl() {
+        return map;
+    }
+
+    @Override
+    public AbstractMasterTimer getMasterTimerImpl() {
+        return standaloneMasterTimer;
+    }
+
+    private class StandaloneMasterTimer extends AbstractMasterTimer {
+        protected StandaloneMasterTimer() {
+            super(true);
+        }
+
+        @Override
+        protected void postUpdateAnimationRunnable(
+                final DelayedRunnable animationRunnable) {
+            if (animationRunnable == null) {
+                Future<?> future = refFuture.get();
+                if (future != null) {
+                    future.cancel(false);
+                    refFuture.set(null);
+                }
+                return;
+            }
+            if (refFuture.get() != null) {
+                return;
+            }
+            Future<?> future = executor.schedule(new Runnable() {
+                public void run() {
+                    refFuture.set(null);
+                    animationRunnable.run();
+                }
+            }, animationRunnable.getDelay(), TimeUnit.MILLISECONDS);
+            refFuture.set(future);
+        }
+
+        @Override
+        protected int getPulseDuration(int precision) {
+            int retVal = precision / 60;
+            return retVal;
+        }
+    }
+}
--- a/javafx-anim/test/unit/com/sun/scenario/ToolkitAccessorStub.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario;
-
-import java.util.Map;
-
-import com.sun.scenario.animation.AbstractMasterTimer;
-
-public class ToolkitAccessorStub extends ToolkitAccessor {
-
-    private int fps = 1000 / 60;
-    private boolean shouldUseNanoTime = true;
-    private long nanos = 0;
-
-    public void setFps(int fps) {this.fps = fps;}
-    public void setShouldUseNanoTime(boolean shouldUseNanoTime) {this.shouldUseNanoTime = shouldUseNanoTime;}
-    public void setNanos(long nanos) {this.nanos = nanos;}
-
-    @Override
-    public Map<Object, Object> getContextMapImpl() {
-        throw new UnsupportedOperationException("Not supported yet.");
-    }
-
-    @Override
-    public AbstractMasterTimer getMasterTimerImpl() {
-        return abstractMasterTimerStub;
-    }
-
-    private final AbstractMasterTimerStub abstractMasterTimerStub = new AbstractMasterTimerStub();
-    
-    private class AbstractMasterTimerStub extends AbstractMasterTimer {
-
-        @Override
-        public long nanos() {
-            return nanos;
-        }
-
-        @Override
-        protected boolean shouldUseNanoTime() {
-            return shouldUseNanoTime;
-        }
-
-        @Override
-        protected void postUpdateAnimationRunnable(DelayedRunnable dr) {
-            // ignore
-        }
-
-        @Override
-        protected int getPulseDuration(int precision) {
-            return precision / fps;
-        }
-        
-    };
-
-
-
-}
--- a/javafx-anim/test/unit/com/sun/scenario/animation/AbstractMasterTimerMock.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/com/sun/scenario/animation/AbstractMasterTimerMock.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,10 +25,9 @@
 
 package com.sun.scenario.animation;
 
-import com.sun.javafx.animation.TickCalculation;
 import java.util.HashSet;
 import java.util.Set;
-
+import com.sun.javafx.animation.TickCalculation;
 import com.sun.scenario.DelayedRunnable;
 import com.sun.scenario.animation.shared.PulseReceiver;
 
@@ -38,6 +37,10 @@
     
     private long nanos;
     
+    public AbstractMasterTimerMock() {
+        super(true);
+    }
+
     public void setNanos(long nanos) {
         this.nanos = nanos;
     }
@@ -48,11 +51,6 @@
     }
 
     @Override
-    protected boolean shouldUseNanoTime() {
-        return true;
-    }
-
-    @Override
     protected void postUpdateAnimationRunnable(DelayedRunnable animationRunnable) {
     }
 
--- a/javafx-anim/test/unit/com/sun/scenario/animation/AbstractMasterTimerTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/com/sun/scenario/animation/AbstractMasterTimerTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,17 +25,13 @@
 
 package com.sun.scenario.animation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import javafx.animation.AnimationTimer;
-
+import com.sun.scenario.DelayedRunnable;
+import com.sun.scenario.animation.shared.PulseReceiver;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.sun.scenario.DelayedRunnable;
-import com.sun.scenario.animation.shared.CurrentTime;
-import com.sun.scenario.animation.shared.PulseReceiver;
+import static org.junit.Assert.*;
 
 public class AbstractMasterTimerTest {
     
@@ -162,6 +158,10 @@
         private long nanos;
         private DelayedRunnable animationRunnable;
         
+        protected AbstractMasterTimerStub() {
+            super(true);
+        }
+
         public void setNanos(long nanos) {
             this.nanos = nanos;
         }
@@ -172,19 +172,8 @@
             }
         }
 
-        @Override
-        protected CurrentTime createCurrentTime() {
-            return new CurrentTime() {
-
-                @Override
-                public long nanos() {
-                    return nanos;
-                }};
-        }
-        
-        @Override
-        protected boolean shouldUseNanoTime() {
-            return true;
+        @Override public long nanos() {
+            return isPaused() ? getStartPauseTime() : nanos - getTotalPausedTime();
         }
 
         @Override
--- a/javafx-anim/test/unit/com/sun/scenario/animation/shared/AnimationPulseReceiverTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * 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 com.sun.scenario.animation.shared;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import javafx.animation.Animation;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import com.sun.scenario.ToolkitAccessor;
-import com.sun.scenario.animation.AbstractMasterTimerMock;
-import javafx.animation.AnimationMock;
-import javafx.util.Duration;
-
-public class AnimationPulseReceiverTest {
-
-    private static final int DEFAULT_RESOLUTION = ToolkitAccessor.getMasterTimer().getDefaultResolution();
-    private static final double TICKS_2_NANOS = 1.0 / 6e-6;
-    private AbstractMasterTimerMock timer;
-    private AnimationMock animation;
-    private AnimationPulseReceiver defaultPR;
-
-    @Before
-    public void setUp() {
-        timer = new AbstractMasterTimerMock();
-        animation = new AnimationMock(Duration.INDEFINITE, 1.0, 1, false);
-        defaultPR = new AnimationPulseReceiver(animation, timer);
-    }
-
-    @After
-    public void tearDown() {
-        defaultPR.stop();
-        ToolkitAccessor.setInstance(null);
-    }
-
-    @Test
-    public void testPlay_DefaultResolution() {
-        // start animatiom
-        timer.setNanos(Math.round(3 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.start(0);
-        assertTrue(timer.containsPulseReceiver(defaultPR));
-
-        // send pulse
-        defaultPR.timePulse(7 * DEFAULT_RESOLUTION);
-        assertEquals(4 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
-
-        // another pulse
-        defaultPR.timePulse(16 * DEFAULT_RESOLUTION);
-        assertEquals(13 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
-
-        // stop animation
-        defaultPR.stop();
-        assertFalse(timer.containsPulseReceiver(defaultPR));
-
-        // stop again
-        defaultPR.stop();
-        assertFalse(timer.containsPulseReceiver(defaultPR));
-
-        // start again
-        timer.setNanos(Math.round(30 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.start(0);
-        assertTrue(timer.containsPulseReceiver(defaultPR));
-
-        // send pulse
-        defaultPR.timePulse(43 * DEFAULT_RESOLUTION);
-        assertEquals(13 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
-    }
-
-    @Test
-    public void testPause_DefaultResolution() {
-        // start animation
-        timer.setNanos(Math.round(3 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.start(0);
-        assertTrue(timer.containsPulseReceiver(defaultPR));
-
-        // pause animation
-        timer.setNanos(Math.round(18 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.pause();
-        assertFalse(timer.containsPulseReceiver(defaultPR));
-
-        // pause again
-        timer.setNanos(Math.round(27 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.pause();
-        assertFalse(timer.containsPulseReceiver(defaultPR));
-
-        // resume
-        timer.setNanos(Math.round(36 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.resume();
-        assertTrue(timer.containsPulseReceiver(defaultPR));
-
-        // resume again
-        timer.setNanos(Math.round(42 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.resume();
-        assertTrue(timer.containsPulseReceiver(defaultPR));
-
-        // send pulse
-        defaultPR.timePulse(51 * DEFAULT_RESOLUTION);
-        assertEquals(30 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
-    }
-
-    @Test
-    public void testDelay() {
-        // start animatiom
-        timer.setNanos(Math.round(3 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.start(17 * DEFAULT_RESOLUTION);
-        assertTrue(timer.containsPulseReceiver(defaultPR));
-
-        // send pulse during delay
-        defaultPR.timePulse(5 * DEFAULT_RESOLUTION);
-        assertEquals(0, animation.getLastTimePulse());
-
-        // pause & resume
-        timer.setNanos(Math.round(10 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.pause();
-        timer.setNanos(Math.round(37 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
-        defaultPR.resume();
-
-        // send pulse during delay
-        defaultPR.timePulse(41 * DEFAULT_RESOLUTION);
-        assertEquals(0, animation.getLastTimePulse());
-
-        // send pulse after delay
-        defaultPR.timePulse(48 * DEFAULT_RESOLUTION);
-        assertEquals(1 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
-    }
-}
--- a/javafx-anim/test/unit/com/sun/scenario/animation/shared/FiniteClipEnvelopeTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/com/sun/scenario/animation/shared/FiniteClipEnvelopeTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -26,16 +26,17 @@
 package com.sun.scenario.animation.shared;
 
 
-import static org.junit.Assert.*;
 import javafx.animation.Animation;
+import javafx.animation.Animation.Status;
 import javafx.animation.AnimationMock;
-import javafx.animation.Animation.Status;
 import javafx.animation.AnimationMock.Command;
 import javafx.util.Duration;
-
+import com.sun.scenario.ToolkitAccessor;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 public class FiniteClipEnvelopeTest {
 
     private final long CYCLE_TICKS = Math.round(6.0 * AnimationMock.DEFAULT_DURATION.toMillis());
@@ -45,7 +46,7 @@
     
     @Before
     public void setUp() {
-        animation = new AnimationMock(AnimationMock.DEFAULT_DURATION, AnimationMock.DEFAULT_RATE, 9, AnimationMock.DEFAULT_AUTOREVERSE);
+        animation = new AnimationMock(ToolkitAccessor.getMasterTimer(), AnimationMock.DEFAULT_DURATION, AnimationMock.DEFAULT_RATE, 9, AnimationMock.DEFAULT_AUTOREVERSE);
         clip = new FiniteClipEnvelope(animation);
     }
     
--- a/javafx-anim/test/unit/com/sun/scenario/animation/shared/InfiniteClipEnvelopeTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/com/sun/scenario/animation/shared/InfiniteClipEnvelopeTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -26,18 +26,17 @@
 package com.sun.scenario.animation.shared;
 
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
 import javafx.animation.Animation;
 import javafx.animation.Animation.Status;
 import javafx.animation.AnimationMock;
 import javafx.animation.AnimationMock.Command;
 import javafx.util.Duration;
-
+import com.sun.scenario.ToolkitAccessor;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 public class InfiniteClipEnvelopeTest {
 
     private final long CYCLE_TICKS = Math.round(6.0 * AnimationMock.DEFAULT_DURATION.toMillis());
@@ -47,7 +46,7 @@
     
     @Before
     public void setUp() {
-        animation = new AnimationMock(AnimationMock.DEFAULT_DURATION, AnimationMock.DEFAULT_RATE, Animation.INDEFINITE, AnimationMock.DEFAULT_AUTOREVERSE);
+        animation = new AnimationMock(ToolkitAccessor.getMasterTimer(), AnimationMock.DEFAULT_DURATION, AnimationMock.DEFAULT_RATE, Animation.INDEFINITE, AnimationMock.DEFAULT_AUTOREVERSE);
         clip = new InfiniteClipEnvelope(animation);
     }
     
--- a/javafx-anim/test/unit/com/sun/scenario/animation/shared/SingleLoopClipEnvelopeTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/com/sun/scenario/animation/shared/SingleLoopClipEnvelopeTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -26,17 +26,15 @@
 package com.sun.scenario.animation.shared;
 
 import javafx.animation.Animation.Status;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
 import javafx.animation.AnimationMock;
 import javafx.animation.AnimationMock.Command;
 import javafx.util.Duration;
-
+import com.sun.scenario.ToolkitAccessor;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assert.*;
+
 public class SingleLoopClipEnvelopeTest {
     
     
@@ -47,7 +45,7 @@
     
     @Before
     public void setUp() {
-        animation = new AnimationMock(AnimationMock.DEFAULT_DURATION, AnimationMock.DEFAULT_RATE, 1, AnimationMock.DEFAULT_AUTOREVERSE);
+        animation = new AnimationMock(ToolkitAccessor.getMasterTimer(), AnimationMock.DEFAULT_DURATION, AnimationMock.DEFAULT_RATE, 1, AnimationMock.DEFAULT_AUTOREVERSE);
         clip = new SingleLoopClipEnvelope(animation);
     }
     
--- a/javafx-anim/test/unit/javafx/animation/AnimationImpl.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/javafx/animation/AnimationImpl.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,18 +25,18 @@
 
 package javafx.animation;
 
-import com.sun.scenario.animation.shared.AnimationPulseReceiver;
+import com.sun.scenario.animation.AbstractMasterTimer;
 import com.sun.scenario.animation.shared.ClipEnvelope;
 
 public class AnimationImpl extends Animation {
-	
-	public AnimationImpl(AnimationPulseReceiver pulseReceiver, ClipEnvelope clipEnvelope, int resolution) {
-		super(pulseReceiver, clipEnvelope, resolution);
-	}
-	
-	public AnimationImpl() {
-		super();
-	}
+
+    public AnimationImpl(AbstractMasterTimer timer, ClipEnvelope clipEnvelope, int resolution) {
+        super(timer, clipEnvelope, resolution);
+    }
+
+    public AnimationImpl() {
+        super();
+    }
     
 
     @Override
--- a/javafx-anim/test/unit/javafx/animation/AnimationMock.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/javafx/animation/AnimationMock.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,10 +25,12 @@
 
 package javafx.animation;
 
-import static org.junit.Assert.assertEquals;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.util.Duration;
+import com.sun.scenario.animation.AbstractMasterTimer;
+
+import static org.junit.Assert.*;
 
 public class AnimationMock extends Animation {
     
@@ -53,7 +55,8 @@
         this.setCycleDuration(duration);
     }
     
-    public AnimationMock(Duration cycleDuration, double rate, int cycleCount, boolean autoReverse) {
+    public AnimationMock(AbstractMasterTimer timer, Duration cycleDuration, double rate, int cycleCount, boolean autoReverse) {
+        super(timer);
         setCycleDuration(cycleDuration);
         setRate(rate);
         setCycleCount(cycleCount);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-anim/test/unit/javafx/animation/AnimationPulseReceiverTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import javafx.animation.Animation;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.sun.scenario.ToolkitAccessor;
+import com.sun.scenario.animation.AbstractMasterTimerMock;
+import javafx.animation.AnimationMock;
+import javafx.util.Duration;
+
+public class AnimationPulseReceiverTest {
+
+    private static final int DEFAULT_RESOLUTION = ToolkitAccessor.getMasterTimer().getDefaultResolution();
+    private static final double TICKS_2_NANOS = 1.0 / 6e-6;
+    private AbstractMasterTimerMock timer;
+    private AnimationMock animation;
+
+    @Before
+    public void setUp() {
+        timer = new AbstractMasterTimerMock();
+        animation = new AnimationMock(timer, Duration.INDEFINITE, 1.0, 1, false);
+    }
+
+    @After
+    public void tearDown() {
+        animation.impl_stop();
+        ToolkitAccessor.setInstance(null);
+    }
+
+    @Test
+    public void testPlay_DefaultResolution() {
+        // start animatiom
+        timer.setNanos(Math.round(3 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.startReceiver(0);
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // send pulse
+        animation.pulseReceiver.timePulse(7 * DEFAULT_RESOLUTION);
+        assertEquals(4 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
+
+        // another pulse
+        animation.pulseReceiver.timePulse(16 * DEFAULT_RESOLUTION);
+        assertEquals(13 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
+
+        // stop animation
+        animation.impl_stop();
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // stop again
+        animation.impl_stop();
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // start again
+        timer.setNanos(Math.round(30 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.startReceiver(0);
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // send pulse
+        animation.pulseReceiver.timePulse(43 * DEFAULT_RESOLUTION);
+        assertEquals(13 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
+    }
+
+    @Test
+    public void testPause_DefaultResolution() {
+        // start animation
+        timer.setNanos(Math.round(3 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.startReceiver(0);
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // pause animation
+        timer.setNanos(Math.round(18 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.pauseReceiver();
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // pause again
+        timer.setNanos(Math.round(27 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.pauseReceiver();
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // resume
+        timer.setNanos(Math.round(36 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.resumeReceiver();
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // resume again
+        timer.setNanos(Math.round(42 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.resumeReceiver();
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // send pulse
+        animation.pulseReceiver.timePulse(51 * DEFAULT_RESOLUTION);
+        assertEquals(30 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
+    }
+
+    @Test
+    public void testDelay() {
+        // start animatiom
+        timer.setNanos(Math.round(3 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.startReceiver(17 * DEFAULT_RESOLUTION);
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
+
+        // send pulse during delay
+        animation.pulseReceiver.timePulse(5 * DEFAULT_RESOLUTION);
+        assertEquals(0, animation.getLastTimePulse());
+
+        // pause & resume
+        timer.setNanos(Math.round(10 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.pauseReceiver();
+        timer.setNanos(Math.round(37 * DEFAULT_RESOLUTION * TICKS_2_NANOS));
+        animation.resumeReceiver();
+
+        // send pulse during delay
+        animation.pulseReceiver.timePulse(41 * DEFAULT_RESOLUTION);
+        assertEquals(0, animation.getLastTimePulse());
+
+        // send pulse after delay
+        animation.pulseReceiver.timePulse(48 * DEFAULT_RESOLUTION);
+        assertEquals(1 * DEFAULT_RESOLUTION, animation.getLastTimePulse());
+    }
+}
--- a/javafx-anim/test/unit/javafx/animation/AnimationSetRateTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/javafx/animation/AnimationSetRateTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -26,354 +26,350 @@
 package javafx.animation;
 
 
-import static org.junit.Assert.assertEquals;
 import javafx.animation.Animation.Status;
 import javafx.util.Duration;
-
+import com.sun.scenario.animation.AbstractMasterTimerMock;
+import com.sun.scenario.animation.shared.ClipEnvelopeMock;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.sun.scenario.animation.AbstractMasterTimerMock;
-import com.sun.scenario.animation.shared.AnimationPulseReceiver;
-import com.sun.scenario.animation.shared.ClipEnvelopeMock;
+import static org.junit.Assert.*;
 
 public class AnimationSetRateTest {
 
-	private static final double EPSILON = 1e-12;
-	
-	private AbstractMasterTimerMock timer;
-	private Animation animation;
-	private AnimationPulseReceiver pulseReceiver;
-	private ClipEnvelopeMock clipEnvelope;
+    private static final double EPSILON = 1e-12;
 
-	@Before
-	public void setUp() throws Exception {
-	    timer = new AbstractMasterTimerMock();
-		pulseReceiver = new AnimationPulseReceiver(null, timer);
-		clipEnvelope = new ClipEnvelopeMock();
-		animation = new AnimationImpl(pulseReceiver, clipEnvelope, 1);
-		animation.setCycleDuration(Duration.millis(1000));
-		clipEnvelope.setAnimation(animation);
-	}
-	
-	private void assertAnimation(double rate, double currentRate, Status status, boolean addedToMasterTimer) {
-		assertEquals(rate, animation.getRate(), EPSILON);
-		assertEquals(currentRate, animation.getCurrentRate(), EPSILON);
-		assertEquals(status, animation.getStatus());
-		assertEquals(addedToMasterTimer, timer.containsPulseReceiver(pulseReceiver));
-	}
+    private AbstractMasterTimerMock timer;
+    private Animation animation;
+    private ClipEnvelopeMock clipEnvelope;
 
-	@Test
-	public void testSetRate() {
-		// changing the rate of a playing animation
-		animation.play();
-		animation.setRate(3.0);
-		assertAnimation(3.0, 3.0, Status.RUNNING, true);
-		
-		// toggling a playing animation
-		animation.setRate(-2.0);
-		assertAnimation(-2.0, -2.0, Status.RUNNING, true);
+    @Before
+    public void setUp() throws Exception {
+        timer = new AbstractMasterTimerMock();
+        clipEnvelope = new ClipEnvelopeMock();
+        animation = new AnimationImpl(timer, clipEnvelope, 1);
+        animation.setCycleDuration(Duration.millis(1000));
+        clipEnvelope.setAnimation(animation);
+    }
+
+    private void assertAnimation(double rate, double currentRate, Status status, boolean addedToMasterTimer) {
+        assertEquals(rate, animation.getRate(), EPSILON);
+        assertEquals(currentRate, animation.getCurrentRate(), EPSILON);
+        assertEquals(status, animation.getStatus());
+        assertEquals(addedToMasterTimer, timer.containsPulseReceiver(animation.pulseReceiver));
+    }
+
+    @Test
+    public void testSetRate() {
+        // changing the rate of a playing animation
+        animation.play();
+        animation.setRate(3.0);
+        assertAnimation(3.0, 3.0, Status.RUNNING, true);
+
+        // toggling a playing animation
+        animation.setRate(-2.0);
+        assertAnimation(-2.0, -2.0, Status.RUNNING, true);
 
         // changing the rate
         animation.setRate(-2.5);
-		assertAnimation(-2.5, -2.5, Status.RUNNING, true);
+        assertAnimation(-2.5, -2.5, Status.RUNNING, true);
 
         // toggling back
         animation.setRate(1.5);
-		assertAnimation(1.5, 1.5, Status.RUNNING, true);
+        assertAnimation(1.5, 1.5, Status.RUNNING, true);
 
-		// changing the rate of a animation playing in reverse
-		animation.impl_setCurrentRate(-1.5);
-		animation.setRate(2.2);
-		assertAnimation(2.2, -2.2, Status.RUNNING, true);
-		
-		// toggling a animation playing in reverse
-		animation.setRate(-1.8);
-		assertAnimation(-1.8, 1.8, Status.RUNNING, true);
+        // changing the rate of a animation playing in reverse
+        animation.impl_setCurrentRate(-1.5);
+        animation.setRate(2.2);
+        assertAnimation(2.2, -2.2, Status.RUNNING, true);
+
+        // toggling a animation playing in reverse
+        animation.setRate(-1.8);
+        assertAnimation(-1.8, 1.8, Status.RUNNING, true);
 
         // changing the rate
         animation.setRate(-1.3);
-		assertAnimation(-1.3, 1.3, Status.RUNNING, true);
+        assertAnimation(-1.3, 1.3, Status.RUNNING, true);
 
         // toggling back
         animation.setRate(0.5);
-		assertAnimation(0.5, -0.5, Status.RUNNING, true);
-	}
-	
-	@Test
-	public void testSetRateOfStoppedAnimation() {
-		// changing the rate
-		animation.setRate(2.0);
-		assertAnimation(2.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(2.0, 2.0, Status.RUNNING, true);
+        assertAnimation(0.5, -0.5, Status.RUNNING, true);
+    }
 
-		// toggling the rate of a stopped animation
-		animation.stop();
-		animation.setRate(-1.0);
-		assertAnimation(-1.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(-1.0, -1.0, Status.RUNNING, true);
+    @Test
+    public void testSetRateOfStoppedAnimation() {
+        // changing the rate
+        animation.setRate(2.0);
+        assertAnimation(2.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(2.0, 2.0, Status.RUNNING, true);
+
+        // toggling the rate of a stopped animation
+        animation.stop();
+        animation.setRate(-1.0);
+        assertAnimation(-1.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(-1.0, -1.0, Status.RUNNING, true);
 
         // toggling back
-		animation.stop();
+        animation.stop();
         animation.setRate(3.0);
-		assertAnimation(3.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(3.0, 3.0, Status.RUNNING, true);
+        assertAnimation(3.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(3.0, 3.0, Status.RUNNING, true);
 
-		// setting rate of stopped animation to zero
-		animation.stop();
-		animation.setRate(0);
-		assertAnimation(0.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        // setting rate of stopped animation to zero
+        animation.stop();
+        animation.setRate(0);
+        assertAnimation(0.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
 
-		// setting rate of stopped animation to non-zero
-		animation.stop();
-		animation.setRate(1.5);
-		assertAnimation(1.5, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(1.5, 1.5, Status.RUNNING, true);
+        // setting rate of stopped animation to non-zero
+        animation.stop();
+        animation.setRate(1.5);
+        assertAnimation(1.5, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(1.5, 1.5, Status.RUNNING, true);
 
-		// setting rate of stopped animation to zero
-		animation.stop();
-		animation.setRate(0);
-		assertAnimation(0.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        // setting rate of stopped animation to zero
+        animation.stop();
+        animation.setRate(0);
+        assertAnimation(0.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
 
-		// toggling rate of stopped animation to non-zero
-		animation.stop();
-		animation.setRate(-0.5);
-		assertAnimation(-0.5, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(-0.5, -0.5, Status.RUNNING, true);
+        // toggling rate of stopped animation to non-zero
+        animation.stop();
+        animation.setRate(-0.5);
+        assertAnimation(-0.5, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(-0.5, -0.5, Status.RUNNING, true);
 
-		// setting rate of stopped animation to zero
-		animation.stop();
-		animation.setRate(0);
-		assertAnimation(0.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        // setting rate of stopped animation to zero
+        animation.stop();
+        animation.setRate(0);
+        assertAnimation(0.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
 
-		// setting rate of stopped animation to non-zero
-		animation.stop();
-		animation.setRate(-2.3);
-		assertAnimation(-2.3, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(-2.3, -2.3, Status.RUNNING, true);
+        // setting rate of stopped animation to non-zero
+        animation.stop();
+        animation.setRate(-2.3);
+        assertAnimation(-2.3, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(-2.3, -2.3, Status.RUNNING, true);
 
-		// setting rate of stopped animation to zero
-		animation.stop();
-		animation.setRate(0);
-		assertAnimation(0.0, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        // setting rate of stopped animation to zero
+        animation.stop();
+        animation.setRate(0);
+        assertAnimation(0.0, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
 
-		// toggling rate of stopped animation to non-zero
-		animation.stop();
-		animation.setRate(1.7);
-		assertAnimation(1.7, 0.0, Status.STOPPED, false);
-		animation.play();
-		assertAnimation(1.7, 1.7, Status.RUNNING, true);
+        // toggling rate of stopped animation to non-zero
+        animation.stop();
+        animation.setRate(1.7);
+        assertAnimation(1.7, 0.0, Status.STOPPED, false);
+        animation.play();
+        assertAnimation(1.7, 1.7, Status.RUNNING, true);
     }
 
     @Test
     public void testSetRateToZeroForRunningAnimation() {
-		// changing the rate of a playing animation
-		animation.play();
+        // changing the rate of a playing animation
+        animation.play();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
-		animation.setRate(3.0);
-		assertAnimation(3.0, 3.0, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        animation.setRate(3.0);
+        assertAnimation(3.0, 3.0, Status.RUNNING, true);
 
-		// toggling a playing animation
+        // toggling a playing animation
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
-		animation.setRate(-2.0);
-		assertAnimation(-2.0, -2.0, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        animation.setRate(-2.0);
+        assertAnimation(-2.0, -2.0, Status.RUNNING, true);
 
         // changing the rate
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
         animation.setRate(-2.5);
-		assertAnimation(-2.5, -2.5, Status.RUNNING, true);
+        assertAnimation(-2.5, -2.5, Status.RUNNING, true);
 
         // toggling back
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
         animation.setRate(1.5);
-		assertAnimation(1.5, 1.5, Status.RUNNING, true);
+        assertAnimation(1.5, 1.5, Status.RUNNING, true);
 
-		// changing the rate of a animation playing in reverse
-		animation.impl_setCurrentRate(-1.5);
+        // changing the rate of a animation playing in reverse
+        animation.impl_setCurrentRate(-1.5);
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
-		animation.setRate(2.2);
-		assertAnimation(2.2, -2.2, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        animation.setRate(2.2);
+        assertAnimation(2.2, -2.2, Status.RUNNING, true);
 
-		// toggling a animation playing in reverse
+        // toggling a animation playing in reverse
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
-		animation.setRate(-1.8);
-		assertAnimation(-1.8, 1.8, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        animation.setRate(-1.8);
+        assertAnimation(-1.8, 1.8, Status.RUNNING, true);
 
         // changing the rate
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
         animation.setRate(-1.3);
-		assertAnimation(-1.3, 1.3, Status.RUNNING, true);
+        assertAnimation(-1.3, 1.3, Status.RUNNING, true);
 
         // toggling back
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
         animation.setRate(0.5);
-		assertAnimation(0.5, -0.5, Status.RUNNING, true);
-	}
-	
-	@Test
-	public void testSetRateOfPausedAnimation() {
-		// changing the rate of a paused animation
-		animation.play();
-		animation.pause();
-		animation.setRate(3.0);
-		assertAnimation(3.0, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(3.0, 3.0, Status.RUNNING, true);
-		
-		// toggling a pausing animation
-		animation.pause();
-		animation.setRate(-2.0);
-		assertAnimation(-2.0, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-2.0, -2.0, Status.RUNNING, true);
+        assertAnimation(0.5, -0.5, Status.RUNNING, true);
+    }
+
+    @Test
+    public void testSetRateOfPausedAnimation() {
+        // changing the rate of a paused animation
+        animation.play();
+        animation.pause();
+        animation.setRate(3.0);
+        assertAnimation(3.0, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(3.0, 3.0, Status.RUNNING, true);
+
+        // toggling a pausing animation
+        animation.pause();
+        animation.setRate(-2.0);
+        assertAnimation(-2.0, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-2.0, -2.0, Status.RUNNING, true);
 
         // changing the rate
-		animation.pause();
+        animation.pause();
         animation.setRate(-2.5);
-		assertAnimation(-2.5, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-2.5, -2.5, Status.RUNNING, true);
+        assertAnimation(-2.5, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-2.5, -2.5, Status.RUNNING, true);
 
         // toggling back
-		animation.pause();
+        animation.pause();
         animation.setRate(1.5);
-		assertAnimation(1.5, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(1.5, 1.5, Status.RUNNING, true);
+        assertAnimation(1.5, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(1.5, 1.5, Status.RUNNING, true);
 
-		// changing the rate of a paused animation pointing in reverse
-		animation.impl_setCurrentRate(-1.5);
-		animation.pause();
-		animation.setRate(2.2);
-		assertAnimation(2.2, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(2.2, -2.2, Status.RUNNING, true);
-		
-		// toggling a paused playing pointing in reverse
-		animation.pause();
-		animation.setRate(-1.8);
-		assertAnimation(-1.8, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-1.8, 1.8, Status.RUNNING, true);
+        // changing the rate of a paused animation pointing in reverse
+        animation.impl_setCurrentRate(-1.5);
+        animation.pause();
+        animation.setRate(2.2);
+        assertAnimation(2.2, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(2.2, -2.2, Status.RUNNING, true);
+
+        // toggling a paused playing pointing in reverse
+        animation.pause();
+        animation.setRate(-1.8);
+        assertAnimation(-1.8, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-1.8, 1.8, Status.RUNNING, true);
 
         // changing the rate
-		animation.pause();
+        animation.pause();
         animation.setRate(-1.3);
-		assertAnimation(-1.3, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-1.3, 1.3, Status.RUNNING, true);
+        assertAnimation(-1.3, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-1.3, 1.3, Status.RUNNING, true);
 
         // toggling back
-		animation.pause();
+        animation.pause();
         animation.setRate(0.5);
-		assertAnimation(0.5, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(0.5, -0.5, Status.RUNNING, true);
-	}
+        assertAnimation(0.5, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(0.5, -0.5, Status.RUNNING, true);
+    }
 
     @Test
     public void testSetRateToZeroForPausedAnimation() {
-    	// starting a paused animation with rate 0
-		animation.play();
-		animation.pause();
+        // starting a paused animation with rate 0
+        animation.play();
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(0.0, 0.0, Status.RUNNING, false);
-		
-		// changing the rate of a paused animation
-		animation.pause();
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(0.0, 0.0, Status.RUNNING, false);
+
+        // changing the rate of a paused animation
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
-		animation.setRate(3.0);
-		assertAnimation(3.0, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(3.0, 3.0, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        animation.setRate(3.0);
+        assertAnimation(3.0, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(3.0, 3.0, Status.RUNNING, true);
 
-		// toggling a paused animation
-		animation.pause();
+        // toggling a paused animation
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
-		animation.setRate(-2.0);
-		assertAnimation(-2.0, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-2.0, -2.0, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        animation.setRate(-2.0);
+        assertAnimation(-2.0, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-2.0, -2.0, Status.RUNNING, true);
 
         // changing the rate
-		animation.pause();
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
         animation.setRate(-2.5);
-		assertAnimation(-2.5, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-2.5, -2.5, Status.RUNNING, true);
+        assertAnimation(-2.5, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-2.5, -2.5, Status.RUNNING, true);
 
         // toggling back
-		animation.pause();
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
         animation.setRate(1.5);
-		assertAnimation(1.5, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(1.5, 1.5, Status.RUNNING, true);
+        assertAnimation(1.5, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(1.5, 1.5, Status.RUNNING, true);
 
-		// changing the rate of a paused animation pointing in reverse
-		animation.impl_setCurrentRate(-1.5);
-		animation.pause();
+        // changing the rate of a paused animation pointing in reverse
+        animation.impl_setCurrentRate(-1.5);
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
-		animation.setRate(2.2);
-		assertAnimation(2.2, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(2.2, -2.2, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        animation.setRate(2.2);
+        assertAnimation(2.2, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(2.2, -2.2, Status.RUNNING, true);
 
-		// toggling a paused animation pointing in reverse
-		animation.pause();
+        // toggling a paused animation pointing in reverse
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
-		animation.setRate(-1.8);
-		assertAnimation(-1.8, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-1.8, 1.8, Status.RUNNING, true);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        animation.setRate(-1.8);
+        assertAnimation(-1.8, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-1.8, 1.8, Status.RUNNING, true);
 
         // changing the rate
-		animation.pause();
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
         animation.setRate(-1.3);
-		assertAnimation(-1.3, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(-1.3, 1.3, Status.RUNNING, true);
+        assertAnimation(-1.3, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(-1.3, 1.3, Status.RUNNING, true);
 
         // toggling back
-		animation.pause();
+        animation.pause();
         animation.setRate(0.0);
-		assertAnimation(0.0, 0.0, Status.PAUSED, false);
+        assertAnimation(0.0, 0.0, Status.PAUSED, false);
         animation.setRate(0.5);
-		assertAnimation(0.5, 0.0, Status.PAUSED, false);
-		animation.play();
-		assertAnimation(0.5, -0.5, Status.RUNNING, true);
+        assertAnimation(0.5, 0.0, Status.PAUSED, false);
+        animation.play();
+        assertAnimation(0.5, -0.5, Status.RUNNING, true);
     }
 }
--- a/javafx-anim/test/unit/javafx/animation/AnimationTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-anim/test/unit/javafx/animation/AnimationTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,26 +25,21 @@
 
 package javafx.animation;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
 import javafx.animation.Animation.Status;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.util.Duration;
-
+import com.sun.scenario.ToolkitAccessor;
+import com.sun.scenario.animation.AbstractMasterTimerMock;
+import com.sun.scenario.animation.shared.ClipEnvelopeMock;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.sun.scenario.ToolkitAccessor;
-import com.sun.scenario.animation.AbstractMasterTimerMock;
-import com.sun.scenario.animation.shared.AnimationPulseReceiver;
-import com.sun.scenario.animation.shared.ClipEnvelopeMock;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
+import static org.junit.Assert.*;
 
 public class AnimationTest {
 	
@@ -57,31 +52,29 @@
     private static final int DEFAULT_REPEAT_COUNT = 1;
     private static final boolean DEFAULT_AUTO_REVERSE = false;
     
-	private static final double EPSILON = 1e-12;
-	
-	private AbstractMasterTimerMock timer;
-	private Animation animation;
-	private AnimationPulseReceiver pulseReceiver;
-	private ClipEnvelopeMock clipEnvelope;
+    private static final double EPSILON = 1e-12;
 
-	@Before
-	public void setUp() {
-	    timer = new AbstractMasterTimerMock();
-		pulseReceiver = new AnimationPulseReceiver(null, timer);
-		clipEnvelope = new ClipEnvelopeMock();
-		animation = new AnimationImpl(pulseReceiver, clipEnvelope, 1);
-		animation.setCycleDuration(ONE_SEC);
-		clipEnvelope.setAnimation(animation);
-	}
+    private AbstractMasterTimerMock timer;
+    private Animation animation;
+    private ClipEnvelopeMock clipEnvelope;
+
+    @Before
+    public void setUp() {
+        timer = new AbstractMasterTimerMock();
+        clipEnvelope = new ClipEnvelopeMock();
+        animation = new AnimationImpl(timer, clipEnvelope, 1);
+        animation.setCycleDuration(ONE_SEC);
+        clipEnvelope.setAnimation(animation);
+    }
 
     @After
     public void tearDown() {
         animation.stop();
     }
-	
-	@Test
-	public void testConstructors() {
-    	final Animation animation0 = new AnimationImpl();
+
+    @Test
+    public void testConstructors() {
+        final Animation animation0 = new AnimationImpl();
         assertEquals(DEFAULT_RATE, animation0.getRate(), EPSILON);
         assertEquals(0.0, animation0.getCurrentRate(), EPSILON);
         assertEquals(Duration.ZERO, animation0.getCycleDuration());
@@ -94,12 +87,12 @@
         assertEquals(null, animation0.getOnFinished());
         assertEquals(0, animation0.getCuePoints().size());
 
-        final Animation animation1 = new AnimationImpl(pulseReceiver, clipEnvelope, 600);
+        final Animation animation1 = new AnimationImpl(timer, clipEnvelope, 600);
         assertEquals(10.0, animation1.getTargetFramerate(), EPSILON);
-	}
-	
-	@Test
-	public void testReadOnlyProperties() {
+    }
+
+    @Test
+    public void testReadOnlyProperties() {
         // currentRate
         assertEquals("currentRate", animation.currentRateProperty().getName());
         assertEquals(animation, animation.currentRateProperty().getBean());
@@ -120,10 +113,10 @@
         assertEquals("status", animation.statusProperty().getName());
         assertEquals(animation, animation.statusProperty().getBean());
         
-	}
-	
-	@Test
-	public void testCalculationOfTotalDuration() {
+    }
+
+    @Test
+    public void testCalculationOfTotalDuration() {
         // 1000ms
         assertEquals(ONE_SEC, animation.getTotalDuration());
         animation.setCycleCount(0);
@@ -155,7 +148,7 @@
         animation.setCycleCount(Animation.INDEFINITE);
         assertEquals(Duration.INDEFINITE, animation.getTotalDuration());
         animation.setCycleCount(1);
-	}
+    }
 
     @Test
     public void testDecreaseTotalDuration() {
@@ -166,8 +159,8 @@
         assertEquals(Duration.ZERO, animation.getCurrentTime());
     }
 
-	@Test
-	public void testJumpTo() {
+    @Test
+    public void testJumpTo() {
         animation.setCycleDuration(TWO_SECS);
 
         // cycleCount = 1
@@ -210,29 +203,29 @@
         animation.jumpTo(Duration.ONE.negate());
         assertEquals(Duration.ZERO, animation.getCurrentTime());
         assertEquals(0, clipEnvelope.getLastJumpTo());
-	}
+    }
 
-	@Test
-	public void testJumpTo_ZeroLengthAnimation() {
-		animation.setCycleDuration(Duration.ZERO);
+    @Test
+    public void testJumpTo_ZeroLengthAnimation() {
+        animation.setCycleDuration(Duration.ZERO);
 
         // cycleCount = 1
-		animation.jumpTo(Duration.ZERO);
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo(Duration.ZERO);
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
         assertEquals(0, clipEnvelope.getLastJumpTo());
-		animation.jumpTo(ONE_SEC);
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo(ONE_SEC);
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
         assertEquals(0, clipEnvelope.getLastJumpTo());
 
         // cycleCount = 2
         animation.setCycleCount(2);
-		animation.jumpTo(Duration.ZERO);
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo(Duration.ZERO);
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
         assertEquals(0, clipEnvelope.getLastJumpTo());
-		animation.jumpTo(ONE_SEC);
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo(ONE_SEC);
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
         assertEquals(0, clipEnvelope.getLastJumpTo());
-	}
+    }
 
     @Test
     public void testDurationRoundingError() {
@@ -248,75 +241,75 @@
         assertEquals(Duration.ZERO, animation.getCurrentTime());
         assertEquals(0, clipEnvelope.getLastJumpTo());
     }
-	
-	@Test(expected=NullPointerException.class)
-	public void testJumpTo_Null() {
-		animation.jumpTo((Duration)null);
-	}
 
-	@Test(expected=IllegalArgumentException.class)
-	public void testJumpTo_UNKNOWN() {
-		animation.jumpTo(Duration.UNKNOWN);
-	}
-	
-	@Test
-	public void testJumpToCuePoint_Default() {
-		animation.getCuePoints().put("ONE_SEC", ONE_SEC);
-		animation.getCuePoints().put("THREE_SECS", THREE_SECS);
-		animation.setCycleDuration(TWO_SECS);
-		
-		// normal jumps
-		animation.jumpTo("end");
-		assertEquals(TWO_SECS, animation.getCurrentTime());
-		animation.jumpTo("start");
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
-		animation.jumpTo("ONE_SEC");
-		assertEquals(ONE_SEC, animation.getCurrentTime());
-		
-		// jump to non-existing cue-point
-		animation.jumpTo("undefined");
-		assertEquals(ONE_SEC, animation.getCurrentTime());
-		
-		// jump to cue-point behind end of animation
-		animation.jumpTo("THREE_SECS");
-		assertEquals(TWO_SECS, animation.getCurrentTime());
-	}
-	
-	@Test
-	public void testJumpToCuePoint_ZeroLengthAnimation() {
-		animation.getCuePoints().put("ONE_SEC", ONE_SEC);
-		animation.setCycleDuration(Duration.ZERO);
-		
-		animation.jumpTo("start");
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
-		animation.jumpTo("end");
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
-		animation.jumpTo("ONE_SEC");
-		assertEquals(Duration.ZERO, animation.getCurrentTime());
-	}
-	
-	@Test(expected=NullPointerException.class)
-	public void testJumpToCuePoint_Null() {
-		animation.jumpTo((String)null);
-	}
-	
-	@Test
-	public void testPlay() {
+    @Test(expected=NullPointerException.class)
+    public void testJumpTo_Null() {
+        animation.jumpTo((Duration)null);
+    }
+
+    @Test(expected=IllegalArgumentException.class)
+    public void testJumpTo_UNKNOWN() {
+        animation.jumpTo(Duration.UNKNOWN);
+    }
+
+    @Test
+    public void testJumpToCuePoint_Default() {
+        animation.getCuePoints().put("ONE_SEC", ONE_SEC);
+        animation.getCuePoints().put("THREE_SECS", THREE_SECS);
+        animation.setCycleDuration(TWO_SECS);
+
+        // normal jumps
+        animation.jumpTo("end");
+        assertEquals(TWO_SECS, animation.getCurrentTime());
+        animation.jumpTo("start");
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo("ONE_SEC");
+        assertEquals(ONE_SEC, animation.getCurrentTime());
+
+        // jump to non-existing cue-point
+        animation.jumpTo("undefined");
+        assertEquals(ONE_SEC, animation.getCurrentTime());
+
+        // jump to cue-point behind end of animation
+        animation.jumpTo("THREE_SECS");
+        assertEquals(TWO_SECS, animation.getCurrentTime());
+    }
+
+    @Test
+    public void testJumpToCuePoint_ZeroLengthAnimation() {
+        animation.getCuePoints().put("ONE_SEC", ONE_SEC);
+        animation.setCycleDuration(Duration.ZERO);
+
+        animation.jumpTo("start");
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo("end");
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
+        animation.jumpTo("ONE_SEC");
+        assertEquals(Duration.ZERO, animation.getCurrentTime());
+    }
+
+    @Test(expected=NullPointerException.class)
+    public void testJumpToCuePoint_Null() {
+        animation.jumpTo((String)null);
+    }
+
+    @Test
+    public void testPlay() {
         final OnFinishedListener listener = new OnFinishedListener();
         animation.setOnFinished(listener);
 
-		// stopped timeline
+        // stopped timeline
         listener.wasCalled = false;
         animation.play();
         assertEquals(Status.RUNNING, animation.getStatus());
         assertFalse(listener.wasCalled);
-        assertTrue(timer.containsPulseReceiver(pulseReceiver));
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
 
         // calling play on playing timeline
         animation.play();
         assertEquals(Status.RUNNING, animation.getStatus());
         assertFalse(listener.wasCalled);
-        assertTrue(timer.containsPulseReceiver(pulseReceiver));
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
         animation.stop();
 
         // stopped timeline, rate = 0
@@ -325,7 +318,7 @@
         animation.play();
         assertEquals(Status.RUNNING, animation.getStatus());
         assertFalse(listener.wasCalled);
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
         animation.stop();
         animation.setRate(1.0);
 
@@ -335,7 +328,7 @@
         animation.play();
         assertEquals(Status.STOPPED, animation.getStatus());
         assertTrue(listener.wasCalled);
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
         animation.stop();
         animation.setCycleDuration(ONE_SEC);
 
@@ -344,7 +337,7 @@
         animation.pause();
         animation.play();
         assertEquals(Status.RUNNING, animation.getStatus());
-        assertTrue(timer.containsPulseReceiver(pulseReceiver));
+        assertTrue(timer.containsPulseReceiver(animation.pulseReceiver));
         animation.stop();
 
         // paused timeline, rate = 0
@@ -353,18 +346,18 @@
         animation.setRate(0.0);
         animation.play();
         assertEquals(Status.RUNNING, animation.getStatus());
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
-	}
-	
-	@Test
-	public void testStop() {
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+    }
+
+    @Test
+    public void testStop() {
         // stopped timeline
         animation.jumpTo(ONE_SEC);
         animation.stop();
         assertEquals(Status.STOPPED, animation.getStatus());
         assertEquals(0.0, animation.getCurrentRate(), EPSILON);
         assertEquals(ONE_SEC, animation.getCurrentTime());
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
 
         // playing timeline
         animation.jumpTo(ONE_SEC);
@@ -373,7 +366,7 @@
         assertEquals(Status.STOPPED, animation.getStatus());
         assertEquals(0.0, animation.getCurrentRate(), EPSILON);
         assertEquals(Duration.ZERO, animation.getCurrentTime());
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
 
         // paused timeline
         animation.jumpTo(ONE_SEC);
@@ -383,17 +376,17 @@
         assertEquals(Status.STOPPED, animation.getStatus());
         assertEquals(0.0, animation.getCurrentRate(), EPSILON);
         assertEquals(Duration.ZERO, animation.getCurrentTime());
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
-	}
-	
-	@Test
-	public void testPause() {
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+    }
+
+    @Test
+    public void testPause() {
         // stopped timeline
         animation.jumpTo(ONE_SEC);
         animation.pause();
         assertEquals(Status.STOPPED, animation.getStatus());
         assertEquals(0.0, animation.getCurrentRate(), EPSILON);
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
 
         // playing timeline
         animation.jumpTo(ONE_SEC);
@@ -401,7 +394,7 @@
         animation.pause();
         assertEquals(Status.PAUSED, animation.getStatus());
         assertEquals(0.0, animation.getCurrentRate(), EPSILON);
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
 
         // paused timeline
         animation.jumpTo(ONE_SEC);
@@ -410,13 +403,13 @@
         animation.pause();
         assertEquals(Status.PAUSED, animation.getStatus());
         assertEquals(0.0, animation.getCurrentRate(), EPSILON);
-        assertFalse(timer.containsPulseReceiver(pulseReceiver));
-	}
-	
-	@Test
-	public void testStart() {
+        assertFalse(timer.containsPulseReceiver(animation.pulseReceiver));
+    }
+
+    @Test
+    public void testStart() {
         // cycleDuration = 1000ms
-		assertTrue(animation.impl_startable(true));
+        assertTrue(animation.impl_startable(true));
         animation.impl_start(true);
         assertEquals(Status.RUNNING, animation.getStatus());
         assertEquals(1.0, animation.getCurrentRate(), EPSILON);
@@ -431,7 +424,7 @@
         animation.setRate(-2.0);
         animation.setAutoReverse(true);
         animation.setCycleCount(Animation.INDEFINITE);
-		assertTrue(animation.impl_startable(true));
+        assertTrue(animation.impl_startable(true));
         animation.impl_start(true);
         assertEquals(Status.RUNNING, animation.getStatus());
         assertEquals(-2.0, animation.getCurrentRate(), EPSILON);
@@ -443,8 +436,8 @@
 
         // cycleDuration = 0
         animation.setCycleDuration(Duration.ZERO);
-		assertFalse(animation.impl_startable(true));
-	}
+        assertFalse(animation.impl_startable(true));
+    }
 
     @Test
     public void testFinished() {
@@ -539,7 +532,7 @@
     @Test
     public void testFullSpeedResolution() {
         final int resolution = ToolkitAccessor.getMasterTimer().getDefaultResolution();
-        
+
         // send pulse
         animation.impl_timePulse(4 * resolution);
         assertEquals(4 * resolution, clipEnvelope.getLastTimePulse());
@@ -561,8 +554,8 @@
     @Test
     public void testCustomResolution() {
         final int resolution = 100;
-        animation = new AnimationImpl(pulseReceiver, clipEnvelope, resolution);
-        
+        animation = new AnimationImpl(timer, clipEnvelope, resolution);
+
         // send pulse
         animation.impl_timePulse(4 * resolution);
         assertEquals(4 * resolution, clipEnvelope.getLastTimePulse());
--- a/javafx-ui-common/build-closed.xml	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-ui-common/build-closed.xml	Mon Mar 11 09:58:45 2013 -0700
@@ -20,6 +20,10 @@
         ${runtime.dist.root.dir}/javafx-accessible/dist/javafx-accessible.jar:
         ${jfx.checkstyle.jar}" />
     <property name="javac.classpath" refid="javac.closed.classpath.path"/>
+
+    <path id="javac.closed.test.classpath.path" path="
+        ${rt.dist.root.dir}/javafx-anim/build/test/classes/" />
+    <property name="javac.test.additional.classpath" refid="javac.closed.test.classpath.path" />
     
     <import file="../build-defs.xml"/>
     <import file="build-common.xml"/>
--- a/javafx-ui-common/project.properties	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-ui-common/project.properties	Mon Mar 11 09:58:45 2013 -0700
@@ -16,7 +16,8 @@
 javac.test.additional.classpath=\
     ${rt.dist.root.dir}/test-stub-toolkit/dist/test-stub-toolkit.jar:\
     ${rt.dist.root.dir}/pisces/dist/pisces.jar:\
-    ${rt.dist.root.dir}/prism-common/dist/prism-common.jar
+    ${rt.dist.root.dir}/prism-common/dist/prism-common.jar:\
+    ${rt.dist.root.dir}/javafx-anim/build/test/classes/
 
 build.dir=${basedir}/build
 build.classes.dir=${build.dir}/classes
--- a/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Mon Mar 11 09:58:45 2013 -0700
@@ -431,15 +431,6 @@
         }
     }
 
-    /**
-     * Call this to make sure there is a pulse scheduled soon, this is needed by thing that reily on pulse events like
-     * layout and stage sizing and need pulse events even when there is no running annimation
-     */
-    @Deprecated
-    public void triggerNextPulse() {
-        getMasterTimer().notifyJobsReady();
-    }
-
     // notify the pulse timer code that we need the next pulse to happen
     // this flag is cleared each cycle so subsequent pulses must be requested
     public abstract void requestNextPulse();
--- a/javafx-ui-common/src/javafx/scene/Cursor.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-ui-common/src/javafx/scene/Cursor.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,12 +25,12 @@
 
 package javafx.scene;
 
+import java.net.MalformedURLException;
+import java.net.URL;
+import javafx.scene.image.Image;
 import com.sun.javafx.cursor.CursorFrame;
 import com.sun.javafx.cursor.CursorType;
 import com.sun.javafx.cursor.StandardCursorFrame;
-import java.net.MalformedURLException;
-import java.net.URL;
-import javafx.scene.image.Image;
 
 /**
  * A class to encapsulate the bitmap representation of the mouse cursor.
@@ -182,7 +182,7 @@
 
     /**
      * Deactivates the cursor. Cursor should be deactivated, when no longer in
-     * use to make it collectable by GC.
+     * use to make it collectible by GC.
      */
     void deactivate() {
     }
--- a/javafx-ui-common/test/unit/javafx/animation/AbstractMasterTimerMock.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-ui-common/test/unit/javafx/animation/AbstractMasterTimerMock.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,10 +25,9 @@
 
 package javafx.animation;
 
-import com.sun.javafx.animation.TickCalculation;
 import java.util.HashSet;
 import java.util.Set;
-
+import com.sun.javafx.animation.TickCalculation;
 import com.sun.scenario.DelayedRunnable;
 import com.sun.scenario.animation.AbstractMasterTimer;
 import com.sun.scenario.animation.shared.PulseReceiver;
@@ -39,21 +38,16 @@
     
     private long nanos;
     
-    public void setNanos(long nanos) {
-        this.nanos = nanos;
+    protected AbstractMasterTimerMock() {
+        super(true);
     }
-    
+
     @Override
     public long nanos() {
         return nanos;
     }
 
     @Override
-    protected boolean shouldUseNanoTime() {
-        return true;
-    }
-
-    @Override
     protected void postUpdateAnimationRunnable(DelayedRunnable animationRunnable) {
     }
 
@@ -74,10 +68,6 @@
         targets.remove(target);
     }
     
-    public boolean containsPulseReceiver(PulseReceiver target) {
-        return targets.contains(target);
-    }
-
     public void pulse() {
         nanos += TickCalculation.toMillis(100) * 1000000L;
         for (PulseReceiver pr : targets) {
--- a/javafx-ui-common/test/unit/javafx/scene/transform/TransformOperationsTest.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/javafx-ui-common/test/unit/javafx/scene/transform/TransformOperationsTest.java	Mon Mar 11 09:58:45 2013 -0700
@@ -25,23 +25,24 @@
 
 package javafx.scene.transform;
 
-import com.sun.javafx.scene.transform.TransformUtils;
+import java.util.Arrays;
+import java.util.Collection;
 import javafx.beans.InvalidationListener;
+import javafx.beans.Observable;
 import javafx.beans.value.ChangeListener;
-import javafx.beans.Observable;
 import javafx.beans.value.ObservableValue;
 import javafx.event.EventHandler;
-import java.util.Collection;
-import org.junit.runners.Parameterized.Parameters;
-import org.junit.runners.Parameterized;
-import java.util.Arrays;
-import javafx.geometry.Point3D;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import com.sun.javafx.test.TransformHelper;
 import javafx.geometry.BoundingBox;
 import javafx.geometry.Bounds;
 import javafx.geometry.Point2D;
+import javafx.geometry.Point3D;
+import com.sun.javafx.scene.transform.TransformUtils;
+import com.sun.javafx.test.TransformHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
 import static org.junit.Assert.*;
 
 @RunWith(Parameterized.class)
@@ -2460,7 +2461,7 @@
     }
 
     @Test
-    public void testSetOnTtransformChanged() {
+    public void testSetOnTransformChanged() {
         Transform clone = t.clone();
 
         EventHandler<TransformChangedEvent> ontc =
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubMasterTimer.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubMasterTimer.java	Mon Mar 11 09:58:45 2013 -0700
@@ -36,6 +36,10 @@
 public class StubMasterTimer extends AbstractMasterTimer {
     private long currentTimeMillis;
 
+    protected StubMasterTimer() {
+        super(false);
+    }
+
     protected int getPulseDuration(int precision) {
         return precision / 60;
     }
@@ -44,10 +48,6 @@
         Toolkit.getToolkit().setAnimationRunnable(animationRunnable);
     }
 
-    protected boolean shouldUseNanoTime() {
-        return false;
-    }
-
     public void setCurrentTime(long millis) {
         currentTimeMillis = millis;
     }
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubToolkit.java	Mon Mar 11 09:49:28 2013 +0100
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubToolkit.java	Mon Mar 11 09:58:45 2013 -0700
@@ -61,8 +61,8 @@
 import com.sun.javafx.application.PlatformImpl;
 import com.sun.javafx.embed.HostInterface;
 import com.sun.javafx.geom.BaseBounds;
+import com.sun.javafx.geom.Path2D;
 import com.sun.javafx.geom.Rectangle;
-import com.sun.javafx.geom.Path2D;
 import com.sun.javafx.geom.Shape;
 import com.sun.javafx.geom.transform.Affine3D;
 import com.sun.javafx.geom.transform.BaseTransform;
@@ -87,7 +87,6 @@
 import com.sun.javafx.sg.PGLine;
 import com.sun.javafx.sg.PGMeshView;
 import com.sun.javafx.sg.PGNode;
-import com.sun.javafx.sg.PGNode.CacheHint;
 import com.sun.javafx.sg.PGParallelCamera;
 import com.sun.javafx.sg.PGPath;
 import com.sun.javafx.sg.PGPerspectiveCamera;
@@ -756,27 +755,18 @@
                                           .contains((int) x, (int) y);
     }
 
-    public void setCurrentTime(long millis) {
-        masterTimer.setCurrentTime(millis);
-    }
-
-    public void handleAnimation() {
-        if (animationRunnable != null) {
-            try {
-                animationRunnable.run();
-            } catch (Throwable t) {
-                t.printStackTrace();
-            }
-        }
-    }
-
     public StubImageLoaderFactory getImageLoaderFactory() {
         return imageLoaderFactory;
     }
 
+    public void resetAnimationEngine() {
+        animationRunnable = null;
+        masterTimer = new StubMasterTimer();
+    }
+
     public void setAnimationTime(final long millis) {
-        setCurrentTime(millis);
-        handleAnimation();
+        masterTimer.setCurrentTime(millis);
+        if (animationRunnable != null) animationRunnable.run();
         fireTestPulse();
     }