This class provides base functionality for a resource manager; it includes
support for the caching of images and sounds, and provides convenience
methods for retrieving other types of resources. All resources are
retrieved relative to an anchor class. The resource manager assumes
that images will be within an "images" directory, textures within a
"textures" directory, sounds within a "sounds" directory, URL-based
references within an "html" directory, properties within a "properties"
directory, resource bundles within a "locale" directory, and color theme
definitions within a "themes" directory.
The Kiwi library includes a resource library of its own; the resources
within the library are accessible through the internal
ResourceManager, a reference to which may be obtained via
a call to kiwi.util.KiwiUtils.getResourceManager(). Links to
index files of some of the resources are listed below:
Retrieve an internal Icon resource. This is a convenience
method that makes a call to getImage() and then wraps the
result in a Swing ImageIcon object.
Parameters:
name - The name of the resource.
Returns:
An Icon for the specified image. If an icon for this
image has previously been constructed, the cached copy is returned.
Get a reference to a LocaleData object for the default
locale. The locale naming convention
basename_language_country_variant is
supported; a search is performed starting with the most specific name
and ending with the most generic.
Parameters:
name - The name of the resource; this should be the base name of
the resource bundle; the appropriate locale contry, language, and
variant codes and the ".msg" extension will be automatically
appended to the name.
Returns:
The LocaleData object representing the resource.
If the resource bundle has been previously loaded, a cached copy is
returned.
Get a reference to a LocaleData object for a specified
locale. The locale naming convention
basename_language_country_variant is
supported; a search is performed starting with the most specific name
and ending with the most generic. If the resource bundle has been
previously loaded, a cached copy is returned.
Parameters:
name - The name of the resource; this should be the base name of
the resource bundle; the appropriate locale contry, language, and
variant codes and the ".msg" extension will be automatically
appended to the name.