Share scene block resolvers across a context instead of statically across all scene panels. Exiting an applet sometimes kills the resolver thread making it worthless to scene panels coming along in a new applet

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@560 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Charlie Groves
2008-07-03 00:56:42 +00:00
parent 6776b83ce6
commit e7bf315b1b
@@ -111,11 +111,13 @@ public class MisoScenePanel extends VirtualMediaPanel
addMouseMotionListener(this);
// create the resolver if it's not already around
_resolver = _resolvers.get(_ctx);
if (_resolver == null) {
_resolver = new SceneBlockResolver();
_resolver.setDaemon(true);
_resolver.setPriority(Thread.MIN_PRIORITY);
_resolver.start();
_resolvers.put(_ctx, _resolver);
}
}
@@ -1609,8 +1611,12 @@ public class MisoScenePanel extends VirtualMediaPanel
/** Flags indicating which features we should show in the scene. */
protected int _showFlags = 0;
/** A scene block resolver shared by all scene panels. */
protected static SceneBlockResolver _resolver;
/** The scene block resolver for this scene panel's context. */
protected SceneBlockResolver _resolver;
/** Scene block resolvers shared by all scene panels in a context. */
protected static Map<MisoContext, SceneBlockResolver> _resolvers =
new WeakHashMap<MisoContext, SceneBlockResolver>();
// used to display debugging information on scene block resolution
protected JFrame _dframe;