gamingtools
Class ImageSource

java.lang.Object
  |
  +--gamingtools.ImageSource

public class ImageSource
extends Object

The ImageSource class provides methods for loading images. All methods of this class are static.


Field Summary
static String IMAGES_DIR
          Location of the image files relative to the root package.
 
Method Summary
static Image getImage(String fileName)
          Loads an image with the specified name from the images directory.
static Image[] getImages(String[] names, String suffix)
          Loads an array of images with the specified names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGES_DIR

public static final String IMAGES_DIR
Location of the image files relative to the root package.

See Also:
Constant Field Values
Method Detail

getImages

public static Image[] getImages(String[] names,
                                String suffix)
Loads an array of images with the specified names. Each name is formed by concatinating an element of names to the suffix (i.e. names[i] + suffix). The suffix can simply be the file extension.

Parameters:
names - Names of the files without the suffix.
suffix - Examples, ".gif" or "_board3.gif".
Returns:
The array of loaded images.

getImage

public static Image getImage(String fileName)
Loads an image with the specified name from the images directory.

Parameters:
fileName - Include a path relative to the images directory.
Returns:
The loaded image.