From c6b7212e5763c087785709cfcd8476814fbc3c4a Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 18 Dec 2001 09:46:07 +0000 Subject: [PATCH] Automatically start up the animation manager, regardless of whether or not we're showing (the animated panel doesn't choke any more if it's asked to render when not showing). Also leave the animation manager running until it is explicitly shut down. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@833 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../media/sprite/AnimationManager.java | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/src/java/com/threerings/media/sprite/AnimationManager.java b/src/java/com/threerings/media/sprite/AnimationManager.java index 2997415ae..9a75680a9 100644 --- a/src/java/com/threerings/media/sprite/AnimationManager.java +++ b/src/java/com/threerings/media/sprite/AnimationManager.java @@ -1,5 +1,5 @@ // -// $Id: AnimationManager.java,v 1.20 2001/12/16 08:05:06 mdb Exp $ +// $Id: AnimationManager.java,v 1.21 2001/12/18 09:46:07 mdb Exp $ package com.threerings.media.sprite; @@ -26,7 +26,10 @@ public class AnimationManager { /** * Construct and initialize the animation manager with a sprite - * manager and the view in which the animations will take place. + * manager and the view in which the animations will take place. The + * animation manager will automatically start itself up, but must be + * explicitly shutdown when the animated view is no longer in + * operation via a call to {@link #stop}. */ public AnimationManager (SpriteManager spritemgr, AnimatedView view) { @@ -37,24 +40,8 @@ public class AnimationManager // register to monitor the refresh action PerformanceMonitor.register(this, "refresh", 1000); - // register the refresh interval immediately if the component is - // already showing on-screen - JComponent target = _view.getComponent(); - if (target.isShowing()) { - start(); - } - - // listen to the view's ancestor events - target.addAncestorListener(new AncestorAdapter() { - public void ancestorAdded (AncestorEvent event) { - // start ourselves up when our animated view is added - start(); - } - public void ancestorRemoved (AncestorEvent event) { - // automatically shutdown if our animated view is hidden - stop(); - } - }); + // start ourselves up + start(); } /**