Prune trailing whitespace & foreachize loops.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@824 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2009-05-23 01:57:36 +00:00
parent 09d081e261
commit ecdf0f2f4a
43 changed files with 182 additions and 184 deletions
@@ -101,8 +101,8 @@ public class SwissArmyTileSet extends TileSet
{
// compute our number of tiles
_numTiles = 0;
for (int i = 0; i < _tileCounts.length; i++) {
_numTiles += _tileCounts[i];
for (int count : _tileCounts) {
_numTiles += count;
}
}
@@ -46,7 +46,7 @@ public class TileIcon implements Icon
{
_tile.paint((Graphics2D)g, x, y);
}
// documentation inherited from interface
public int getIconWidth ()
{
@@ -40,7 +40,7 @@ import static com.threerings.media.Log.log;
* it can provide a tileset repository which loads up tilesets using whatever repository mechanism
* is implemented by the supplied repository. In the latter case, tilesets are loaded by a unique
* identifier.
*
*
* <p> Loading tilesets by hand is intended for things like toolbar icons or games with a single
* set of tiles (think Stratego, for example). Loading tilesets from a repository supports games
* with vast numbers of tiles to which more tiles may be added on the fly (think the tiles for an
@@ -51,7 +51,7 @@ public class TileManager
/**
* Creates a tile manager and provides it with a reference to the image manager from which it
* will load tileset images.
*
*
* @param imgr the image manager via which the tile manager will decode and cache images.
*/
public TileManager (ImageManager imgr)
@@ -145,9 +145,9 @@ public class TileManager
/**
* Returns the tileset with the specified id. Tilesets are fetched from the tileset repository
* supplied via {@link #setTileSetRepository}, and are subsequently cached.
*
*
* @param tileSetId the unique identifier for the desired tileset.
*
*
* @exception NoSuchTileSetException thrown if no tileset exists with the specified id or if
* an underlying error occurs with the tileset repository's persistence mechanism.
*/
@@ -169,7 +169,7 @@ public class TileManager
/**
* Returns the tileset with the specified name.
*
*
* @throws NoSuchTileSetException if no tileset with the specified name is available via our
* configured tile set repository.
*/
@@ -191,7 +191,7 @@ public class TileManager
/**
* Returns the {@link Tile} object with the specified fully qualified tile id.
*
*
* @see TileUtil#getFQTileId
*/
public Tile getTile (int fqTileId)
@@ -203,7 +203,7 @@ public class TileManager
/**
* Returns the {@link Tile} object with the specified fully qualified tile id. The supplied
* colorizer will be used to recolor the tile.
*
*
* @see TileUtil#getFQTileId
*/
public Tile getTile (int fqTileId, TileSet.Colorizer rizer)
@@ -214,10 +214,10 @@ public class TileManager
/**
* Returns the {@link Tile} object from the specified tileset at the specified index.
*
*
* @param tileSetId the tileset id.
* @param tileIndex the index of the tile to be retrieved.
*
*
* @return the tile object.
*/
public Tile getTile (int tileSetId, int tileIndex, TileSet.Colorizer rizer)
@@ -88,21 +88,21 @@ public class DirectoryTileSetBundler extends TileSetBundler
// write the trimmed tileset image to the destination output stream
File outFile = new File(target, imagePath);
FileOutputStream fout = null;
if (outFile.lastModified() > newestMod) {
// Our file's newer than the newest bundle mod - up to date.
// So don't actually do anything
// TODO: Ideally, we'd like to skip re-trimming altogether, since that's
// expensive, but for the moment, we're at least doing half as much by
// not writing out the trimmed image.
} else {
// It's changed, so let's open the file & do all that jazz
outFile.getParentFile().mkdirs();
fout = new FileOutputStream(outFile);
}
TrimmedObjectTileSet tset =
TrimmedObjectTileSet.trimObjectTileSet((ObjectTileSet)set, fout, "png");
tset.setImagePath(imagePath);
@@ -49,17 +49,17 @@ public class DumpBundle
System.exit(-1);
}
for (int i = 0; i < args.length; i++) {
for (String arg : args) {
// oh the hackery
if (args[i].equals("-tiles")) {
if (arg.equals("-tiles")) {
dumpTiles = true;
continue;
}
File file = new File(args[i]);
File file = new File(arg);
try {
TileSetBundle tsb = null;
if (args[i].endsWith(".jar")) {
if (arg.endsWith(".jar")) {
ResourceBundle bundle = new FileResourceBundle(file);
tsb = BundleUtil.extractBundle(bundle);
tsb.init(bundle);
@@ -81,7 +81,7 @@ public class DumpBundle
}
} catch (Exception e) {
System.err.println("Error dumping bundle [path=" + args[i] +
System.err.println("Error dumping bundle [path=" + arg +
", error=" + e + "].");
e.printStackTrace();
}
@@ -173,7 +173,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
set.setSpotOrients(sorients);
}
});
digester.addRule(
_path + "/constraints",
new CallMethodSpecialRule() {
@@ -52,7 +52,7 @@ public abstract class TileSetRuleSet
public String getPath(){
return _path;
}
/**
* Instructs the tileset rule set to match tilesets with the supplied
* prefix. For example, passing a prefix of
@@ -129,9 +129,9 @@ public abstract class TileSetRuleSet
*/
protected abstract Class<? extends TileSet> getTileSetClass ();
/** The tileset path we append to the prefix to get the full path. */
/** The tileset path we append to the prefix to get the full path. */
protected String _tilesetPath = TILESET_PATH;
/** The full path at which me match our tilesets. */
protected String _path;
}
@@ -47,11 +47,11 @@ public class UniformTileSetRuleSet extends TileSetRuleSet
public UniformTileSetRuleSet(){
this(TILESET_PATH);
}
public UniformTileSetRuleSet(String tilesetPath){
_tilesetPath = tilesetPath;
}
@Override
public void addRuleInstances (Digester digester)
{