From d54d562992f4f4663c95b8ea044afa65f36c4646 Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Mon, 13 Aug 2001 15:00:24 +0000 Subject: [PATCH] Updated comments. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@230 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/cast/CharacterSprite.java | 19 +++------- .../threerings/media/tile/TileManager.java | 21 ++++++++--- .../threerings/media/tile/TileSetManager.java | 17 +++++---- .../media/tile/XMLTileSetParser.java | 4 +- .../media/util/PerformanceMonitor.java | 17 ++++++++- .../miso/client/DisplayMisoSceneImpl.java | 5 ++- .../miso/tools/xml/XMLSceneParser.java | 4 +- .../com/threerings/miso/util/MisoUtil.java | 37 ++++++++++--------- 8 files changed, 73 insertions(+), 51 deletions(-) diff --git a/src/java/com/threerings/cast/CharacterSprite.java b/src/java/com/threerings/cast/CharacterSprite.java index 96c8c7c3c..69fe5c77c 100644 --- a/src/java/com/threerings/cast/CharacterSprite.java +++ b/src/java/com/threerings/cast/CharacterSprite.java @@ -1,5 +1,5 @@ // -// $Id: CharacterSprite.java,v 1.1 2001/08/02 21:02:56 shaper Exp $ +// $Id: CharacterSprite.java,v 1.2 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.sprite; @@ -8,16 +8,15 @@ import com.threerings.miso.tile.Tile; import com.threerings.miso.tile.TileManager; /** - * A AmbulatorySprite is a sprite that can face in one of - * eight compass directions and animate itself walking along any - * chosen path. + * An AmbulatorySprite is a sprite that can face in one + * of the various compass directions and that can animate itself + * walking along some chosen path. */ public class AmbulatorySprite extends Sprite { /** - * Construct a AmbulatorySprite, loading the tiles - * used to display the sprite from the given tileset via the given - * tile manager. + * Construct an AmbulatorySprite, loading the tiles + * used to display the sprite from the given tileset. * * @param x the sprite x-position in pixels. * @param y the sprite y-position in pixels. @@ -92,12 +91,6 @@ public class AmbulatorySprite extends Sprite /** The number of frames of animation for each direction. */ protected static final int NUM_DIR_FRAMES = 8; - /** - * The buffer space in pixels allowed for horizontal or vertical - * selection of movement north/south or east/west, respectively. - */ - protected static final int DIR_BUFFER = 20; - /** The animation frames for the sprite facing each direction. */ protected Tile[][] _dirTiles; diff --git a/src/java/com/threerings/media/tile/TileManager.java b/src/java/com/threerings/media/tile/TileManager.java index fd580b0f8..4588c98b3 100644 --- a/src/java/com/threerings/media/tile/TileManager.java +++ b/src/java/com/threerings/media/tile/TileManager.java @@ -1,5 +1,5 @@ // -// $Id: TileManager.java,v 1.12 2001/07/28 01:31:51 shaper Exp $ +// $Id: TileManager.java,v 1.13 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.tile; @@ -12,13 +12,18 @@ import java.awt.image.BufferedImage; import java.util.ArrayList; /** - * Provides a simplified interface for managing multiple tilesets and - * tiles. + * The TileManager class provides a simplified interface + * for retrieving and caching tiles. + * + * @see TileSetManager */ public class TileManager { /** - * Initialize the tile manager with the given TileSetManager object. + * Initialize the tile manager with the given + * TileSetManager object. + * + * @param tilesetmgr the tileset manager. */ public TileManager (TileSetManager tilesetmgr) { @@ -26,7 +31,13 @@ public class TileManager } /** - * Return the Tile object for the specified tileset and tile id. + * Return the Tile object for the specified tileset + * and tile id. + * + * @param tsid the tileset id. + * @param tid the tile id. + * + * @return the tile object. */ public Tile getTile (int tsid, int tid) { diff --git a/src/java/com/threerings/media/tile/TileSetManager.java b/src/java/com/threerings/media/tile/TileSetManager.java index dfa260355..f54aa6317 100644 --- a/src/java/com/threerings/media/tile/TileSetManager.java +++ b/src/java/com/threerings/media/tile/TileSetManager.java @@ -1,5 +1,5 @@ // -// $Id: TileSetManager.java,v 1.9 2001/07/23 22:31:48 shaper Exp $ +// $Id: TileSetManager.java,v 1.10 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.tile; @@ -9,11 +9,13 @@ import java.awt.Image; import java.util.ArrayList; /** - * The TileSetManager provides tileset management functionality - * intended for use by the TileManager. It provides facilities for - * obtaining information about individual tilesets, retrieving an list - * of all tilesets available, and retrieving the image associated with - * a particular tile in a set. + * The TileSetManager provides tileset management + * functionality intended for use by the TileManager. It + * provides facilities for obtaining information about individual + * tilesets, retrieving an list of all tilesets available, and + * retrieving the image associated with a particular tile in a set. + * + * @see TileManager */ public interface TileSetManager { @@ -27,7 +29,8 @@ public interface TileSetManager public int getNumTilesInSet (int tsid); /** - * Return an ArrayList containing all TileSet objects available. + * Return an ArrayList containing all + * TileSet objects available. * * @return the list of tilesets. */ diff --git a/src/java/com/threerings/media/tile/XMLTileSetParser.java b/src/java/com/threerings/media/tile/XMLTileSetParser.java index a73e7f44e..b0358858f 100644 --- a/src/java/com/threerings/media/tile/XMLTileSetParser.java +++ b/src/java/com/threerings/media/tile/XMLTileSetParser.java @@ -1,5 +1,5 @@ // -// $Id: XMLTileSetParser.java,v 1.9 2001/08/08 00:33:54 shaper Exp $ +// $Id: XMLTileSetParser.java,v 1.10 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.tile; @@ -151,7 +151,7 @@ public class XMLTileSetParser extends DefaultHandler /** The tilesets constructed thus far. */ protected ArrayList _tilesets = new ArrayList(); - // temporary storage of tileset object values + /** Temporary storage of tileset object values. */ protected StringBuffer _chars; protected String _tsName; protected int _tsTsid; diff --git a/src/java/com/threerings/media/util/PerformanceMonitor.java b/src/java/com/threerings/media/util/PerformanceMonitor.java index 78c9db6a4..2b5656ead 100644 --- a/src/java/com/threerings/media/util/PerformanceMonitor.java +++ b/src/java/com/threerings/media/util/PerformanceMonitor.java @@ -1,5 +1,5 @@ // -// $Id: PerformanceMonitor.java,v 1.1 2001/08/02 00:42:02 shaper Exp $ +// $Id: PerformanceMonitor.java,v 1.2 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.util; @@ -24,7 +24,7 @@ import com.threerings.miso.Log; *

Note that this is not intended to be used as an * industrial-strength profiling or performance monitoring tool. The * checkpoint time interval granularity is in milliseconds, not - * microseconds; and the observer's checkpoint() method + * microseconds, and the observer's checkpoint() method * will never be called until/unless a subsequent call to * tick() is made after the requested number of * milliseconds have passed since the last checkpoint. @@ -117,6 +117,10 @@ public class PerformanceMonitor protected static HashMap _observers = new HashMap(); } +/** + * This class represents the individual actions being tracked by the + * PerformanceMonitor class. + */ class PerformanceAction { public PerformanceAction (PerformanceObserver obs, String name, long delta) @@ -155,9 +159,18 @@ class PerformanceAction return buf.append("]").toString(); } + /** The performance observer. */ protected PerformanceObserver _obs; + + /** The action name. */ protected String _name; + + /** The number of milliseconds between each checkpoint. */ protected long _delta; + + /** The time the last time a checkpoint was made. */ protected long _lastDelta; + + /** The number of ticks since the last checkpoint. */ protected int _numTicks; } diff --git a/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java b/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java index c29eb8c06..fdf62dd56 100644 --- a/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java +++ b/src/java/com/threerings/miso/client/DisplayMisoSceneImpl.java @@ -1,5 +1,5 @@ // -// $Id: DisplayMisoSceneImpl.java,v 1.25 2001/08/13 05:42:36 shaper Exp $ +// $Id: DisplayMisoSceneImpl.java,v 1.26 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.scene; @@ -65,11 +65,12 @@ public class Scene _sid = SID_INVALID; _name = DEF_SCENE_NAME; + _locations = new ArrayList(); _clusters = new ArrayList(); _exits = new ArrayList(); - tiles = new Tile[TILE_WIDTH][TILE_HEIGHT][NUM_LAYERS]; + tiles = new Tile[TILE_WIDTH][TILE_HEIGHT][NUM_LAYERS]; _deftile = _tilemgr.getTile(deftsid, deftid); for (int xx = 0; xx < TILE_WIDTH; xx++) { for (int yy = 0; yy < TILE_HEIGHT; yy++) { diff --git a/src/java/com/threerings/miso/tools/xml/XMLSceneParser.java b/src/java/com/threerings/miso/tools/xml/XMLSceneParser.java index d345ace84..e15d1548f 100644 --- a/src/java/com/threerings/miso/tools/xml/XMLSceneParser.java +++ b/src/java/com/threerings/miso/tools/xml/XMLSceneParser.java @@ -1,5 +1,5 @@ // -// $Id: XMLSceneParser.java,v 1.9 2001/08/13 05:42:36 shaper Exp $ +// $Id: XMLSceneParser.java,v 1.10 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.scene.xml; @@ -323,7 +323,7 @@ public class XMLSceneParser extends DefaultHandler /** The tile manager object for use in constructing scenes. */ protected TileManager _tilemgr; - // temporary storage of scene object values and data + /** Temporary storage of scene object values and data. */ protected StringBuffer _chars; protected String _scName; protected ArrayList _scLocations, _scExits, _scClusters; diff --git a/src/java/com/threerings/miso/util/MisoUtil.java b/src/java/com/threerings/miso/util/MisoUtil.java index 0d04d5f38..4f9ac6ff0 100644 --- a/src/java/com/threerings/miso/util/MisoUtil.java +++ b/src/java/com/threerings/miso/util/MisoUtil.java @@ -1,5 +1,5 @@ // -// $Id: MisoUtil.java,v 1.4 2001/07/24 16:10:19 shaper Exp $ +// $Id: MisoUtil.java,v 1.5 2001/08/13 15:00:24 shaper Exp $ package com.threerings.miso.util; @@ -25,7 +25,7 @@ public class MisoUtil /** * Populate the config object with miso configuration values. * - * @param config the Config object to populate. + * @param config the Config object to populate. */ public static void bindProperties (Config config) throws IOException { @@ -33,12 +33,12 @@ public class MisoUtil } /** - * Create a SceneManager object, reading the class name to - * instantiate from the "miso.scenemgr" config value. + * Create a SceneManager object, reading the class + * name to instantiate from the config object. * - * @param config the Config object. + * @param config the Config object. * - * @return the new SceneManager object or null if an error occurred. + * @return the new scene manager object or null if an error occurred. */ public static SceneManager createSceneManager (Config config, TileManager tilemgr) @@ -59,12 +59,12 @@ public class MisoUtil } /** - * Create a TileManager object. + * Create a TileManager object. * - * @param config the Config object. + * @param config the Config object. * @param frame the root frame to which images will be rendered. * - * @return the new TileManager object or null if an error occurred. + * @return the new tile manager object or null if an error occurred. */ public static TileManager createTileManager (Config config, Frame frame) { @@ -77,9 +77,9 @@ public class MisoUtil } /** - * Create a ResourceManager object. + * Create a ResourceManager object. * - * @return the new ResourceManager object or null if an error occurred. + * @return the new resource manager object or null if an error occurred. */ protected static ResourceManager createResourceManager () { @@ -97,13 +97,14 @@ public class MisoUtil } /** - * Create a TileSetManager object, reading the class name to - * instantiate from the "miso.tilesetmgr" config value. + * Create a TileSetManager object, reading the class + * name to instantiate from the config object. * - * @param config the Config object. - * @param imgmgr the ImageManager object from which images are obtained. + * @param config the Config object. + * @param imgmgr the ImageManager object from which + * images are obtained. * - * @return the new TileSetManager object or null if an error occurred. + * @return the new tileset manager object or null if an error occurred. */ protected static TileSetManager createTileSetManager (Config config, ImageManager imgmgr) @@ -122,11 +123,11 @@ public class MisoUtil return tilesetmgr; } - /** The default SceneManager class name. */ + /** The default scene repository class name. */ protected static final String DEF_SCENEREPO = XMLFileSceneRepository.class.getName(); - /** The default TileSetManager class name. */ + /** The default tileset manager class name. */ protected static final String DEF_TILESETMGR = EditableTileSetManager.class.getName(); }