nu.dll.mm
Interface ImageLoader
- All Known Implementing Classes:
- FileImageLoader
- public interface ImageLoader
The ImageLoader interface is meant to serve as a generic method
of acquiring images synchrously. The Pong game implements this
through the FileImageLoader, that loads images from the file system
or class loader resources.
It can also serve as a container for serveral images, each stored
by a label given to the loadImage() method. When loaded, an Image
object can later be retreived by calling getName().
|
Method Summary |
java.awt.Image |
getImage(java.lang.String name)
Retreives a previously loaded image by its given label. |
java.awt.Image |
loadImage(java.lang.String fileName,
java.lang.String name)
Synchronously loads an image into this ImageLoader's map
and returns the new Image object, or null
if the image could not be created for some reason. |
loadImage
public java.awt.Image loadImage(java.lang.String fileName,
java.lang.String name)
throws java.io.IOException
- Synchronously loads an image into this ImageLoader's map
and returns the new Image object, or
null
if the image could not be created for some reason.
- Throws:
java.io.IOException - if an I/O error occurs while loading the image
getImage
public java.awt.Image getImage(java.lang.String name)
- Retreives a previously loaded image by its given label.
- Parameters:
name - The label which the image has been given in the loadImage() call