AnimatorListener
interface.
*
* @author David Kaspar
*/
public abstract class Animator {
+ private CopyOnWriteArrayListAnimator
.
+ *
+ * @author David Kaspar
+ */
+public interface AnimatorListener {
+
+ /**
+ * Called when an animator is invoked to be started.
+ * @param animator the animator
+ */
+ void animatorStarted (Animator animator);
+
+ /**
+ * Called when an animator is changed, so the animation has to be restarted.
+ * @param animator the animator
+ */
+ void animatorReset (Animator animator);
+
+ /**
+ * Called when an animator is finished - is running for 500+ms.
+ * @param animator the animator
+ */
+ void animatorFinished (Animator animator);
+
+ /**
+ * Called immediately before the animator performs a tick of an animation.
+ * @param animator the animator
+ * @param progress the animation progress; 0.0 is the start, 1.0 is the end
+ */
+ void animatorPreTick (Animator animator, double progress);
+
+ /**
+ * Called immediately after the animator performs a tick of an animation.
+ * @param animator the animator
+ * @param progress the animation progress; 0.0 is the start, 1.0 is the end
+ */
+ void animatorPostTick (Animator animator, double progress);
+
+}
Index: graph/lib/src/org/netbeans/api/visual/animator/SceneAnimator.java
===================================================================
RCS file: /cvs/graph/lib/src/org/netbeans/api/visual/animator/SceneAnimator.java,v
--- graph/lib/src/org/netbeans/api/visual/animator/SceneAnimator.java 14 Nov 2006 10:04:15 -0000 1.13
+++ graph/lib/src/org/netbeans/api/visual/animator/SceneAnimator.java 10 Apr 2007 12:44:44 -0000
@@ -188,6 +188,38 @@
colorAnimator.setForegroundColor (widget, targetForegroundColor);
}
+ /**
+ * Returns the preferred location animator which animates preferred location of all widgets in the scene.
+ * @return the preferred location animator
+ */
+ public Animator getPreferredLocationAnimator () {
+ return preferredLocationAnimator;
+ }
+
+ /**
+ * Returns the preferred bounds animator which animates preferred bounds of all widgets in the scene.
+ * @return the preferred bounds animator
+ */
+ public Animator getPreferredBoundsAnimator () {
+ return preferredBoundsAnimator;
+ }
+
+ /**
+ * Returns the zoom animator.
+ * @return the zoom animator
+ */
+ public Animator getZoomAnimator () {
+ return zoomAnimator;
+ }
+
+ /**
+ * Returns the color animator which animates background and foreground colors of all widgets in the scene.
+ * @return the preferred location animator
+ */
+ public Animator getColorAnimator () {
+ return colorAnimator;
+ }
+
private class UpdateTask implements Runnable {
public void run () {
Index: graph/lib/src/org/netbeans/api/visual/animator/package.html
===================================================================
RCS file: /cvs/graph/lib/src/org/netbeans/api/visual/animator/package.html,v
--- graph/lib/src/org/netbeans/api/visual/animator/package.html 13 Mar 2007 10:46:27 -0000 1.3
+++ graph/lib/src/org/netbeans/api/visual/animator/package.html 10 Apr 2007 12:44:44 -0000
@@ -21,5 +21,6 @@
This package contains SceneAnimator
classes which is used for controlling animations on a scene.
Also you can supply your own animator by implementing Animator
class.
+Also you can listen on each animator using AnimatorListener
interface.