Have the scene view panel create its own sprite manager and supply it with

a scene view model rather than a config object from which it would create
a model.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1017 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-02-18 00:40:58 +00:00
parent 9faac13369
commit c97222993b
@@ -1,5 +1,5 @@
// //
// $Id: SceneViewPanel.java,v 1.28 2002/02/17 23:45:36 mdb Exp $ // $Id: SceneViewPanel.java,v 1.29 2002/02/18 00:40:58 mdb Exp $
package com.threerings.miso.scene; package com.threerings.miso.scene;
@@ -13,8 +13,6 @@ import java.awt.event.MouseMotionAdapter;
import java.util.List; import java.util.List;
import com.samskivert.util.Config;
import com.threerings.media.animation.AnimationManager; import com.threerings.media.animation.AnimationManager;
import com.threerings.media.animation.AnimatedPanel; import com.threerings.media.animation.AnimatedPanel;
import com.threerings.media.sprite.SpriteManager; import com.threerings.media.sprite.SpriteManager;
@@ -29,25 +27,25 @@ public class SceneViewPanel extends AnimatedPanel
implements IsoSceneViewModelListener implements IsoSceneViewModelListener
{ {
/** /**
* Constructs the scene view panel. * Constructs the scene view panel with the supplied view model.
*/ */
public SceneViewPanel (Config config, SpriteManager spritemgr) public SceneViewPanel (IsoSceneViewModel model)
{ {
// save off references // create a sprite manager
_spritemgr = spritemgr; _spritemgr = new SpriteManager();
// configure our animation manager with the sprite manager // configure our animation manager with the sprite manager
_animmgr.setSpriteManager(_spritemgr); _animmgr.setSpriteManager(_spritemgr);
// create the data model for the scene view // create the data model for the scene view
_viewmodel = new IsoSceneViewModel(config); _viewmodel = model;
// listen to the iso scene view model to receive notice when // listen to the iso scene view model to receive notice when
// the scene display has changed and needs must be repainted // the scene display has changed and needs must be repainted
_viewmodel.addListener(this); _viewmodel.addListener(this);
// create the scene view // create the scene view
_view = newSceneView(_animmgr, spritemgr, _viewmodel); _view = newSceneView(_animmgr, _spritemgr, _viewmodel);
// listen to mouse... // listen to mouse...
addMouseListener(new MouseAdapter() { addMouseListener(new MouseAdapter() {