|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.media.tile.bundle.tools.TileSetBundler
public class TileSetBundler
The tileset bundler is used to create tileset bundles from a set of XML tileset descriptions in a bundle description file. The bundles contain a serialized representation of the tileset objects along with the actual image files referenced by those tilesets.
The organization of the bundle description file is customizable based on the an XML configuration file provided to the tileset bundler when constructed. The bundler configuration maps XML paths to tileset parsers. An example configuration follows:
<bundler-config>
<mapping>
<path>bundle.tilesets.uniform</path>
<ruleset>
com.threerings.media.tile.tools.xml.UniformTileSetRuleSet
</ruleset>
</mapping>
<mapping>
<path>bundle.tilesets.object</path>
<ruleset>
com.threerings.media.tile.tools.xml.ObjectTileSetRuleSet
</ruleset>
</mapping>
</bundler-config>
This configuration would be used to parse a bundle description that
looked something like the following:
<bundle>
<tilesets>
<uniform>
<tileset>
<!-- ... -->
</tileset>
</uniform>
<object>
<tileset>
<!-- ... -->
</tileset>
</object>
</tilesets>
The class specified in the ruleset element must derive
from TileSetRuleSet. The images that will be included in the
bundle must be in the same directory as the bundle description file and
the tileset descriptions must reference the images without a preceding
path.
| Nested Class Summary | |
|---|---|
static class |
TileSetBundler.Mapping
Used to parse our configuration. |
| Constructor Summary | |
|---|---|
TileSetBundler(File configFile)
Constructs a tileset bundler with the specified bundler config file. |
|
TileSetBundler(File configFile,
boolean keepRawPngs,
boolean uncompressed)
Constructs a tileset bundler with the specified bundler config file and whether to keep pngs as-is or if not, re-encode them. |
|
TileSetBundler(String configPath)
Constructs a tileset bundler with the specified path to a bundler configuration file. |
|
| Method Summary | |
|---|---|
boolean |
createBundle(File target,
TileSetBundle bundle,
ImageProvider improv,
String imageBase,
long newestMod)
Finish the creation of a tileset bundle jar file. |
boolean |
createBundle(TileSetIDBroker idBroker,
File bundleDesc,
File target)
Creates a tileset bundle at the location specified by the targetPath parameter, based on the description
provided via the bundleDesc parameter. |
void |
createBundle(TileSetIDBroker idBroker,
File bundleDesc,
String targetPath)
Creates a tileset bundle at the location specified by the targetPath parameter, based on the description
provided via the bundleDesc parameter. |
static boolean |
createBundleJar(File target,
TileSetBundle bundle,
ImageProvider improv,
String imageBase,
boolean keepOriginalPngs,
boolean uncompressed)
Create a tileset bundle jar file. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TileSetBundler(String configPath)
throws IOException
IOException
public TileSetBundler(File configFile)
throws IOException
IOException
public TileSetBundler(File configFile,
boolean keepRawPngs,
boolean uncompressed)
throws IOException
IOException| Method Detail |
|---|
public void createBundle(TileSetIDBroker idBroker,
File bundleDesc,
String targetPath)
throws IOException
targetPath parameter, based on the description
provided via the bundleDesc parameter.
idBroker - the tileset id broker that will be used to map
tileset names to tileset ids.bundleDesc - a file object pointing to the bundle description
file.targetPath - the path of the tileset bundle file that will be
created.
IOException - thrown if an error occurs reading, writing
or processing anything.
public boolean createBundle(TileSetIDBroker idBroker,
File bundleDesc,
File target)
throws IOException
targetPath parameter, based on the description
provided via the bundleDesc parameter.
idBroker - the tileset id broker that will be used to map
tileset names to tileset ids.bundleDesc - a file object pointing to the bundle description
file.target - the tileset bundle file that will be created.
IOException - thrown if an error occurs reading, writing
or processing anything.
public boolean createBundle(File target,
TileSetBundle bundle,
ImageProvider improv,
String imageBase,
long newestMod)
throws IOException
target - the tileset bundle file that will be created.bundle - contains the tilesets we'd like to save out to the bundle.improv - the image provider.imageBase - the base directory for getting images for nonnewestMod - the most recent modification to any part of the bundle. By default we
ignore this since we normally duck out if we're up to date.
ObjectTileSet tilesets.
IOException
public static boolean createBundleJar(File target,
TileSetBundle bundle,
ImageProvider improv,
String imageBase,
boolean keepOriginalPngs,
boolean uncompressed)
throws IOException
target - the tileset bundle file that will be created.bundle - contains the tilesets we'd like to save out to the bundle.improv - the image provider.imageBase - the base directory for getting images for non-ObjectTileSet tilesets.keepOriginalPngs - bundle up the original PNGs as PNGs instead of converting to the
FastImageIO raw format
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||