Made iso scene view configuration part of the miso properties file.

Standardized config key member data names to match those used in the
cocktail code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@318 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-08-29 18:41:46 +00:00
parent b882283cd3
commit 8c7efb79fe
9 changed files with 165 additions and 60 deletions
@@ -1,5 +1,5 @@
//
// $Id: ViewerApp.java,v 1.6 2001/08/16 23:14:21 mdb Exp $
// $Id: ViewerApp.java,v 1.7 2001/08/29 18:41:46 shaper Exp $
package com.threerings.miso.viewer;
@@ -53,7 +53,8 @@ public class ViewerApp
MisoUtil.bindProperties(config);
// load the viewer-specific config info
config.bindProperties("miso-viewer", "rsrc/config/miso/viewer");
config.bindProperties(
ViewerModel.CONFIG_KEY, "rsrc/config/miso/viewer");
} catch (IOException ioe) {
Log.warning("Error loading config information [e=" + ioe + "].");
@@ -0,0 +1,10 @@
//
// $Id: ViewerModel.java,v 1.1 2001/08/29 18:41:46 shaper Exp $
package com.threerings.miso.viewer;
public class ViewerModel
{
/** The config key prefix for miso viewer properties. */
public static final String CONFIG_KEY = "miso-viewer";
}
@@ -1,5 +1,5 @@
//
// $Id: ViewerSceneViewPanel.java,v 1.13 2001/08/23 00:23:58 shaper Exp $
// $Id: ViewerSceneViewPanel.java,v 1.14 2001/08/29 18:41:46 shaper Exp $
package com.threerings.miso.viewer;
@@ -26,7 +26,7 @@ public class ViewerSceneViewPanel extends SceneViewPanel
public ViewerSceneViewPanel (
ViewerContext ctx, SpriteManager spritemgr, AmbulatorySprite sprite)
{
super(ctx.getTileManager(), spritemgr);
super(ctx.getConfig(), ctx.getTileManager(), spritemgr);
_ctx = ctx;
_sprite = sprite;
@@ -41,9 +41,6 @@ public class ViewerSceneViewPanel extends SceneViewPanel
// load up the initial scene
prepareStartingScene();
_smodel.setShowCoordinates(true);
_smodel.setShowSpritePaths(true);
PerformanceMonitor.register(this, "paint", 1000);
}
@@ -56,7 +53,7 @@ public class ViewerSceneViewPanel extends SceneViewPanel
// get the starting scene filename
Config config = _ctx.getConfig();
String fname = config.getValue(CFG_SCENE, DEF_SCENE);
String fname = config.getValue(SCENE_KEY, DEF_SCENE);
try {
// load and set up the scene
@@ -104,7 +101,8 @@ public class ViewerSceneViewPanel extends SceneViewPanel
public void mouseDragged (MouseEvent e) { }
/** The config key to obtain the default scene filename. */
protected static final String CFG_SCENE = "miso-viewer.default_scene";
protected static final String SCENE_KEY =
ViewerModel.CONFIG_KEY + ".default_scene";
/** The default scene to load and display. */
protected static final String DEF_SCENE = "rsrc/scenes/default.xml";