|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.tile.bundle.BundledTileSetRepository
public class BundledTileSetRepository
Loads tileset data from a set of resource bundles.
ResourceManager| Field Summary | |
|---|---|
protected HashIntMap<TileSet> |
_idmap
A mapping from tileset id to tileset. |
protected ImageManager |
_imgr
The image manager via which we load our images. |
protected HashMap<String,Integer> |
_namemap
A mapping from tileset name to tileset id. |
| Constructor Summary | |
|---|---|
BundledTileSetRepository(ResourceManager rmgr,
ImageManager imgr,
String name)
Constructs a repository which will obtain its resource set from the supplied resource manager. |
|
| Method Summary | |
|---|---|
protected void |
addBundle(HashIntMap<TileSet> idmap,
HashMap<String,Integer> namemap,
ResourceBundle bundle)
Extracts the tileset bundle from the supplied resource bundle and registers it. |
protected void |
addBundle(HashIntMap<TileSet> idmap,
HashMap<String,Integer> namemap,
TileSetBundle bundle)
Adds the tilesets in the supplied bundle to our tileset mapping tables. |
void |
addBundle(ResourceBundle bundle)
Registers the bundle with the tileset repository, overriding any bundle with the same id or name. |
Iterator<Integer> |
enumerateTileSetIds()
Returns an iterator over the identifiers of all TileSet
objects available. |
Iterator<TileSet> |
enumerateTileSets()
Returns an iterator over all TileSet objects available. |
TileSet |
getTileSet(int tileSetId)
Returns the TileSet with the specified tile set
identifier. |
TileSet |
getTileSet(String setName)
Returns the TileSet with the specified tile set name. |
int |
getTileSetId(String setName)
Returns the unique identifier of the TileSet with the
specified tile set name. |
protected void |
initBundles(ResourceManager rmgr,
String name)
Initializes our bundles, |
protected void |
waitForBundles()
Used to allow bundle unpacking to proceed asynchronously. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ImageManager _imgr
protected HashIntMap<TileSet> _idmap
protected HashMap<String,Integer> _namemap
| Constructor Detail |
|---|
public BundledTileSetRepository(ResourceManager rmgr,
ImageManager imgr,
String name)
rmgr - the resource manager from which to obtain our resource
set.imgr - the image manager through which we will configure the
tile sets to load their images, or null if image tiles
should not be loaded (only the tile metadata)name - the name of the resource set from which we will be
loading our tile data.| Method Detail |
|---|
protected void initBundles(ResourceManager rmgr,
String name)
public void addBundle(ResourceBundle bundle)
protected void addBundle(HashIntMap<TileSet> idmap,
HashMap<String,Integer> namemap,
ResourceBundle bundle)
protected void addBundle(HashIntMap<TileSet> idmap,
HashMap<String,Integer> namemap,
TileSetBundle bundle)
public Iterator<Integer> enumerateTileSetIds()
throws PersistenceException
TileSetRepositoryTileSet
objects available.
enumerateTileSetIds in interface TileSetRepositoryPersistenceException
public Iterator<TileSet> enumerateTileSets()
throws PersistenceException
TileSetRepositoryTileSet objects available.
enumerateTileSets in interface TileSetRepositoryPersistenceException
public TileSet getTileSet(int tileSetId)
throws NoSuchTileSetException,
PersistenceException
TileSetRepositoryTileSet with the specified tile set
identifier. The repository is responsible for configuring the tile
set with an image provider.
getTileSet in interface TileSetRepositoryNoSuchTileSetException - thrown if no tileset exists with
the specified identifier.
PersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism.
public int getTileSetId(String setName)
throws NoSuchTileSetException,
PersistenceException
TileSetRepositoryTileSet with the
specified tile set name.
getTileSetId in interface TileSetRepositoryNoSuchTileSetException - thrown if no tileset exists with
the specified name.
PersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism.
public TileSet getTileSet(String setName)
throws NoSuchTileSetException,
PersistenceException
TileSetRepositoryTileSet with the specified tile set name. The
repository is responsible for configuring the tile set with an
image provider.
getTileSet in interface TileSetRepositoryNoSuchTileSetException - thrown if no tileset exists with
the specified name.
PersistenceException - thrown if an error occurs
communicating with the underlying persistence mechanism.protected void waitForBundles()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||