Renamed XMLFile* classes to just XML*.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@585 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-11-02 02:52:16 +00:00
parent a954cccfe1
commit 1a3ed6e45a
7 changed files with 35 additions and 36 deletions
@@ -1,5 +1,5 @@
// //
// $Id: XMLComponentRepository.java,v 1.3 2001/11/01 01:40:42 shaper Exp $ // $Id: XMLComponentRepository.java,v 1.4 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.scene.xml; package com.threerings.miso.scene.xml;
@@ -20,16 +20,16 @@ import com.threerings.miso.Log;
import com.threerings.miso.util.MisoUtil; import com.threerings.miso.util.MisoUtil;
/** /**
* The xml file component repository provides access to character * The xml component repository provides access to character
* components obtained from component descriptions stored in an XML * components obtained from component descriptions stored in an XML
* file. * file.
*/ */
public class XMLFileComponentRepository implements ComponentRepository public class XMLComponentRepository implements ComponentRepository
{ {
/** /**
* Constructs an xml file component repository. * Constructs an xml component repository.
*/ */
public XMLFileComponentRepository (Config config, ImageManager imgmgr) public XMLComponentRepository (Config config, ImageManager imgmgr)
{ {
// load component types and components // load component types and components
String file = config.getValue(COMPONENTS_KEY, DEFAULT_COMPONENTS); String file = config.getValue(COMPONENTS_KEY, DEFAULT_COMPONENTS);
@@ -1,5 +1,5 @@
// //
// $Id: XMLTileSetRepository.java,v 1.1 2001/11/01 01:40:42 shaper Exp $ // $Id: XMLTileSetRepository.java,v 1.2 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.tile; package com.threerings.miso.tile;
@@ -19,7 +19,7 @@ import com.threerings.miso.util.MisoUtil;
* Extends general tile set repository functionality to read tile set * Extends general tile set repository functionality to read tile set
* descriptions from an XML file. * descriptions from an XML file.
*/ */
public class XMLFileTileSetRepository implements TileSetRepository public class XMLTileSetRepository implements TileSetRepository
{ {
// documentation inherited // documentation inherited
public void init (Config config, ImageManager imgmgr) public void init (Config config, ImageManager imgmgr)
@@ -1,5 +1,5 @@
// //
// $Id: XMLSceneRepository.java,v 1.12 2001/09/21 02:30:35 mdb Exp $ // $Id: XMLSceneRepository.java,v 1.13 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.scene.xml; package com.threerings.miso.scene.xml;
@@ -16,16 +16,15 @@ import com.threerings.miso.scene.EditableMisoScene;
import com.threerings.miso.util.MisoUtil; import com.threerings.miso.util.MisoUtil;
/** /**
* The <code>XMLFileSceneRepository</code> provides a mechanism for * The xml scene repository provides a mechanism for reading scenes
* reading scenes from and writing scenes to XML files. These files will * from and writing scenes to XML files. These files are template
* comprise the template scene files from which actual runtime game scenes * scene files from which actual runtime game scenes will be
* will be constructed. * constructed.
*/ */
public class XMLFileSceneRepository public class XMLSceneRepository
{ {
/** /**
* Initialize the XMLFileSceneRepository with the given config and * Initializes the xml scene repository.
* tile manager objects.
* *
* @param config the config object. * @param config the config object.
* @param tilemgr the tile manager object. * @param tilemgr the tile manager object.
@@ -49,7 +48,7 @@ public class XMLFileSceneRepository
} }
/** /**
* Return the path to the scene root directory. * Returns the path to the scene root directory.
*/ */
public String getScenePath () public String getScenePath ()
{ {
+10 -10
View File
@@ -1,5 +1,5 @@
// //
// $Id: MisoUtil.java,v 1.12 2001/11/01 01:40:42 shaper Exp $ // $Id: MisoUtil.java,v 1.13 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.util; package com.threerings.miso.util;
@@ -19,8 +19,8 @@ import com.threerings.media.tile.*;
import com.threerings.miso.Log; import com.threerings.miso.Log;
import com.threerings.miso.scene.*; import com.threerings.miso.scene.*;
import com.threerings.miso.scene.xml.XMLFileComponentRepository; import com.threerings.miso.scene.xml.XMLComponentRepository;
import com.threerings.miso.scene.xml.XMLFileSceneRepository; import com.threerings.miso.scene.xml.XMLSceneRepository;
import com.threerings.miso.tile.*; import com.threerings.miso.tile.*;
/** /**
@@ -90,15 +90,15 @@ public class MisoUtil
public static CharacterManager createCharacterManager ( public static CharacterManager createCharacterManager (
Config config, ImageManager imgmgr) Config config, ImageManager imgmgr)
{ {
XMLFileComponentRepository crepo = XMLComponentRepository crepo =
new XMLFileComponentRepository(config, imgmgr); new XMLComponentRepository(config, imgmgr);
CharacterManager charmgr = new CharacterManager(crepo); CharacterManager charmgr = new CharacterManager(crepo);
charmgr.setCharacterClass(MisoCharacterSprite.class); charmgr.setCharacterClass(MisoCharacterSprite.class);
return charmgr; return charmgr;
} }
/** /**
* Creates an <code>XMLFileSceneRepository</code> object, reading * Creates an <code>XMLSceneRepository</code> object, reading
* the name of the class to instantiate from the config object. * the name of the class to instantiate from the config object.
* *
* @param config the <code>Config</code> object. * @param config the <code>Config</code> object.
@@ -106,11 +106,11 @@ public class MisoUtil
* @return the new scene repository object or null if an error * @return the new scene repository object or null if an error
* occurred. * occurred.
*/ */
public static XMLFileSceneRepository createSceneRepository ( public static XMLSceneRepository createSceneRepository (
Config config, TileManager tilemgr) Config config, TileManager tilemgr)
{ {
try { try {
XMLFileSceneRepository scenerepo = (XMLFileSceneRepository) XMLSceneRepository scenerepo = (XMLSceneRepository)
config.instantiateValue(SCENEREPO_KEY, DEF_SCENEREPO); config.instantiateValue(SCENEREPO_KEY, DEF_SCENEREPO);
scenerepo.init(config, tilemgr); scenerepo.init(config, tilemgr);
return scenerepo; return scenerepo;
@@ -190,11 +190,11 @@ public class MisoUtil
/** The default scene repository class name. */ /** The default scene repository class name. */
protected static final String DEF_SCENEREPO = protected static final String DEF_SCENEREPO =
XMLFileSceneRepository.class.getName(); XMLSceneRepository.class.getName();
/** The default tile set repository class name. */ /** The default tile set repository class name. */
protected static final String DEF_TILESETREPO = protected static final String DEF_TILESETREPO =
XMLFileTileSetRepository.class.getName(); XMLTileSetRepository.class.getName();
/** The config key for the scene repository class. */ /** The config key for the scene repository class. */
protected static final String SCENEREPO_KEY = CONFIG_KEY + ".scenerepo"; protected static final String SCENEREPO_KEY = CONFIG_KEY + ".scenerepo";
@@ -1,5 +1,5 @@
// //
// $Id: ViewerApp.java,v 1.11 2001/11/01 01:40:43 shaper Exp $ // $Id: ViewerApp.java,v 1.12 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.viewer; package com.threerings.miso.viewer;
@@ -13,7 +13,7 @@ import com.threerings.media.ImageManager;
import com.threerings.media.tile.TileManager; import com.threerings.media.tile.TileManager;
import com.threerings.miso.Log; import com.threerings.miso.Log;
import com.threerings.miso.scene.xml.XMLFileSceneRepository; import com.threerings.miso.scene.xml.XMLSceneRepository;
import com.threerings.miso.util.MisoUtil; import com.threerings.miso.util.MisoUtil;
import com.threerings.miso.viewer.util.ViewerContext; import com.threerings.miso.viewer.util.ViewerContext;
@@ -74,7 +74,7 @@ public class ViewerApp
return _tilemgr; return _tilemgr;
} }
public XMLFileSceneRepository getSceneRepository () public XMLSceneRepository getSceneRepository ()
{ {
return _screpo; return _screpo;
} }
@@ -111,7 +111,7 @@ public class ViewerApp
protected Config _config; protected Config _config;
/** The scene repository. */ /** The scene repository. */
protected XMLFileSceneRepository _screpo; protected XMLSceneRepository _screpo;
/** The tile manager object. */ /** The tile manager object. */
protected TileManager _tilemgr; protected TileManager _tilemgr;
@@ -1,5 +1,5 @@
// //
// $Id: ViewerSceneViewPanel.java,v 1.26 2001/11/01 01:40:43 shaper Exp $ // $Id: ViewerSceneViewPanel.java,v 1.27 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.viewer; package com.threerings.miso.viewer;
@@ -24,7 +24,7 @@ import com.threerings.media.util.PerformanceObserver;
import com.threerings.miso.Log; import com.threerings.miso.Log;
import com.threerings.miso.scene.*; import com.threerings.miso.scene.*;
import com.threerings.miso.scene.xml.XMLFileSceneRepository; import com.threerings.miso.scene.xml.XMLSceneRepository;
import com.threerings.miso.scene.util.IsoUtil; import com.threerings.miso.scene.util.IsoUtil;
import com.threerings.miso.util.*; import com.threerings.miso.util.*;
import com.threerings.miso.viewer.util.ViewerContext; import com.threerings.miso.viewer.util.ViewerContext;
@@ -113,7 +113,7 @@ public class ViewerSceneViewPanel extends SceneViewPanel
{ {
ViewerModel model = _ctx.getViewerModel(); ViewerModel model = _ctx.getViewerModel();
try { try {
XMLFileSceneRepository screpo = _ctx.getSceneRepository(); XMLSceneRepository screpo = _ctx.getSceneRepository();
_view.setScene(screpo.loadScene(model.scenefile)); _view.setScene(screpo.loadScene(model.scenefile));
} catch (IOException ioe) { } catch (IOException ioe) {
@@ -1,11 +1,11 @@
// //
// $Id: ViewerContext.java,v 1.4 2001/09/05 00:45:27 shaper Exp $ // $Id: ViewerContext.java,v 1.5 2001/11/02 02:52:16 shaper Exp $
package com.threerings.miso.viewer.util; package com.threerings.miso.viewer.util;
import com.samskivert.util.Context; import com.samskivert.util.Context;
import com.threerings.miso.scene.xml.XMLFileSceneRepository; import com.threerings.miso.scene.xml.XMLSceneRepository;
import com.threerings.miso.util.MisoContext; import com.threerings.miso.util.MisoContext;
import com.threerings.miso.viewer.ViewerModel; import com.threerings.miso.viewer.ViewerModel;
@@ -18,7 +18,7 @@ public interface ViewerContext extends MisoContext, Context
/** /**
* Returns the scene repository that we can use to get scenes. * Returns the scene repository that we can use to get scenes.
*/ */
public XMLFileSceneRepository getSceneRepository (); public XMLSceneRepository getSceneRepository ();
/** /**
* Returns the viewer data model. * Returns the viewer data model.