|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiwi.util.ResourceManager
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, and properties within a "properties" directory.
ResourceLoader
Constructor Summary | |
ResourceManager(Class clazz)
Construct a new ResourceManager . |
Method Summary | |
Icon |
getIcon(String name)
Retrieve an internal Icon resource. |
Image |
getImage(String name)
Retrieve an internal Image resource. |
Properties |
getProperties(String name)
Get a reference to a Properties resource. |
AudioClip |
getSound(String name)
Retrieve an internal AudioClip resource. |
Image |
getTexture(String name)
Retrieve an internal texture resource. |
URL |
getURL(String name)
Retrieve an internal URL resource. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ResourceManager(Class clazz)
ResourceManager
.clazz
- The resource anchor class.Method Detail |
public Icon getIcon(String name)
Icon
resource. This is a convenience
method that makes a call to getImage()
and then wraps the
result in a Swing ImageIcon
object.Icon
for the specified image. If an icon for this
image has previously been constructed, the cached copy is returned.ImageIcon
public Image getImage(String name)
Image
resource. If the named image has
previously been loaded, a cached copy is returned.name
- The name of the resource.Image
object representing the resource.public Image getTexture(String name)
name
- The name of the resource.Image
object representing the resource.public URL getURL(String name)
URL
resource.The
- name of the resource.public AudioClip getSound(String name)
AudioClip
resource. If the named sound
has previously been loaded, a cached copy is returned.name
- The name of the resource.AudioClip
object representing the resource.public Properties getProperties(String name)
Properties
resource.The
- name of the resource.Properties
object representing the resource.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |