Revamp! Modified the way configuration is handled.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1166 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-03-28 22:32:34 +00:00
parent bf9a2ca151
commit b486315e47
31 changed files with 185 additions and 291 deletions
@@ -1,5 +1,5 @@
//
// $Id: ScrollingTestApp.java,v 1.7 2002/03/08 22:37:50 mdb Exp $
// $Id: ScrollingTestApp.java,v 1.8 2002/03/28 22:32:33 mdb Exp $
package com.threerings.miso.scene;
@@ -32,8 +32,8 @@ import com.threerings.cast.NoSuchComponentException;
import com.threerings.cast.bundle.BundledComponentRepository;
import com.threerings.miso.Log;
import com.threerings.miso.MisoConfig;
import com.threerings.miso.util.MisoContext;
import com.threerings.miso.util.MisoUtil;
/**
* Tests the scrolling capabilities of the IsoSceneView.
@@ -68,7 +68,6 @@ public class ScrollingTestApp
_frame = new ScrollingFrame(gc);
// we don't need to configure anything
_config = new Config();
ResourceManager rmgr = new ResourceManager(
"rsrc", null, "config/resource/manager.properties");
ImageManager imgr = new ImageManager(rmgr, _frame);
@@ -76,8 +75,8 @@ public class ScrollingTestApp
_tilemgr.setTileSetRepository(
new BundledTileSetRepository(rmgr, imgr, "tilesets"));
// bind our miso properties
_config.bindProperties("miso", "rsrc/config/miso/scrolling");
// hack in some different MisoProperties
MisoConfig.config = new Config("rsrc/config/miso/scrolling");
// create the context object
MisoContext ctx = new ContextImpl();
@@ -89,7 +88,7 @@ public class ScrollingTestApp
charmgr.setCharacterClass(MisoCharacterSprite.class);
// create our scene view panel
_panel = new SceneViewPanel(new IsoSceneViewModel(_config));
_panel = new SceneViewPanel(new IsoSceneViewModel());
_frame.setPanel(_panel);
// create our "ship" sprite
@@ -139,16 +138,10 @@ public class ScrollingTestApp
/**
* The implementation of the MisoContext interface that provides
* handles to the config and manager objects that offer commonly used
* services.
* handles to the manager objects that offer commonly used services.
*/
protected class ContextImpl implements MisoContext
{
public Config getConfig ()
{
return _config;
}
public TileManager getTileManager ()
{
return _tilemgr;
@@ -178,9 +171,6 @@ public class ScrollingTestApp
}
}
/** The config object. */
protected Config _config;
/** The tile manager object. */
protected TileManager _tilemgr;
@@ -1,5 +1,5 @@
//
// $Id: ViewerApp.java,v 1.27 2002/02/19 07:43:20 mdb Exp $
// $Id: ViewerApp.java,v 1.28 2002/03/28 22:32:33 mdb Exp $
package com.threerings.miso.viewer;
@@ -10,7 +10,6 @@ import java.awt.GraphicsEnvironment;
import java.io.IOException;
import com.samskivert.swing.util.SwingUtil;
import com.samskivert.util.Config;
import com.threerings.resource.ResourceManager;
import com.threerings.media.ImageManager;
@@ -27,7 +26,6 @@ import com.threerings.miso.scene.MisoCharacterSprite;
import com.threerings.miso.scene.MisoSceneModel;
import com.threerings.miso.scene.tools.xml.MisoSceneParser;
import com.threerings.miso.util.MisoContext;
import com.threerings.miso.util.MisoUtil;
/**
* The ViewerApp is a scene viewing application that allows for trying
@@ -68,7 +66,6 @@ public class ViewerApp
_frame = new ViewerFrame(gc);
// we don't need to configure anything
_config = new Config();
ResourceManager rmgr = new ResourceManager(
"rsrc", null, "config/resource/manager.properties");
ImageManager imgr = new ImageManager(rmgr, _frame);
@@ -76,9 +73,6 @@ public class ViewerApp
_tilemgr.setTileSetRepository(
new BundledTileSetRepository(rmgr, imgr, "tilesets"));
// bind our miso properties
MisoUtil.bindProperties(_config);
// create the context object
MisoContext ctx = new ContextImpl();
@@ -129,11 +123,6 @@ public class ViewerApp
*/
protected class ContextImpl implements MisoContext
{
public Config getConfig ()
{
return _config;
}
public TileManager getTileManager ()
{
return _tilemgr;
@@ -163,9 +152,6 @@ public class ViewerApp
}
}
/** The config object. */
protected Config _config;
/** The tile manager object. */
protected TileManager _tilemgr;
@@ -1,5 +1,5 @@
//
// $Id: ViewerSceneViewPanel.java,v 1.44 2002/03/27 21:49:11 mdb Exp $
// $Id: ViewerSceneViewPanel.java,v 1.45 2002/03/28 22:32:33 mdb Exp $
package com.threerings.miso.viewer;
@@ -45,7 +45,7 @@ public class ViewerSceneViewPanel extends SceneViewPanel
CharacterManager charmgr,
ComponentRepository crepo)
{
super(new IsoSceneViewModel(ctx.getConfig()));
super(new IsoSceneViewModel());
// create the character descriptors
_descUser = CastUtil.getRandomDescriptor("female", crepo);