public class IconManager extends Object
The configuration might look like the following:
arrows.path = /rsrc/media/icons/arrows.png arrows.metrics = 20, 25 # icons that are 20 pixels wide and 25 pixels tall smileys.path = /rsrc/media/icons/smileys.png smileys.metrics = 16, 16 # icons that are 16 pixels squareA user could then request an
arrows icon like so:
Icon icon = iconmgr.getIcon("arrows", 2);
| Constructor and Description |
|---|
IconManager(TileManager tmgr,
Properties config)
Creates an icon manager that will obtain tilesets from the supplied
tile manager and which will read its configuration information from
the supplied properties file.
|
IconManager(TileManager tmgr,
String configPath)
Creates an icon manager that will obtain tilesets from the supplied
tile manager and which will load its configuration information from
the specified properties file.
|
| Modifier and Type | Method and Description |
|---|---|
Icon |
getIcon(String iconSet,
int index)
Fetches the icon with the specified index from the named icon set.
|
void |
setSource(String resourceSet)
If icon images should be loaded from a set of resource bundles
rather than the classpath, that set can be set here.
|
public IconManager(TileManager tmgr, String configPath) throws IOException
tmgr - the tile manager to use when fetching tilesets.configPath - the path (relative to the classpath) from which
the icon manager configuration can be loaded.IOException - thrown if an error occurs loading the
configuration file.public IconManager(TileManager tmgr, Properties config)
public void setSource(String resourceSet)
Copyright © 2015. All rights reserved.