edu.gatech.cs2335.lemmings.graphics
Class ImageLoader

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.graphics.ImageLoader

public final class ImageLoader
extends java.lang.Object

Class ImageLoader: The image loader class provides the functionality for loading images from the hard drive or the web into BufferedImages.

 Revision History:
     v1.0 (Feb. 06, 2004) - Created the ImageLoader class
 

Version:
Version 1.0, Feb. 06, 2004
Author:
Vladimir Urazov

Field Summary
static java.lang.String IMAGE_LOCATION
          Contains the location for all of the system images.
 
Method Summary
 java.awt.image.BufferedImage createBlankImage(int width, int height)
          Returns a hardware-accelerated blank image of the specified size.
 java.awt.GraphicsConfiguration getImageConfiguration()
          Returns the graphics configuration used.
static ImageLoader getInstance()
          Singleton implementation.
 java.awt.image.BufferedImage loadImage(java.io.File src)
          Loads the image from the file specified.
 java.awt.image.BufferedImage loadImage(java.net.URL path)
          Loads the image from the specified URL.
 java.awt.image.BufferedImage loadLocalImage(java.lang.String imagePath)
          Loads a local image for instance, for insertion into the graphics pane.
 java.awt.image.BufferedImage loadSystemImage(java.lang.String imageName)
          Loads a system image from the standard location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_LOCATION

public static final java.lang.String IMAGE_LOCATION
Contains the location for all of the system images.

See Also:
Constant Field Values
Method Detail

getInstance

public static ImageLoader getInstance()
Singleton implementation.

Returns:
an ImageLoader value

getImageConfiguration

public java.awt.GraphicsConfiguration getImageConfiguration()
Returns the graphics configuration used.

Returns:
a GraphicsConfiguration value

loadImage

public java.awt.image.BufferedImage loadImage(java.net.URL path)
Loads the image from the specified URL. Returns an accelerated version of the image, ready to be rendered.

Parameters:
path - an URL value
Returns:
a BufferedImage value

loadImage

public java.awt.image.BufferedImage loadImage(java.io.File src)
Loads the image from the file specified.

Parameters:
src - a File value
Returns:
a BufferedImage value

loadLocalImage

public java.awt.image.BufferedImage loadLocalImage(java.lang.String imagePath)
Loads a local image for instance, for insertion into the graphics pane.

Parameters:
imagePath - a String value
Returns:
a BufferedImage value

loadSystemImage

public java.awt.image.BufferedImage loadSystemImage(java.lang.String imageName)
Loads a system image from the standard location.

Parameters:
imageName - a String value
Returns:
a BufferedImage value

createBlankImage

public java.awt.image.BufferedImage createBlankImage(int width,
                                                     int height)
Returns a hardware-accelerated blank image of the specified size.

Parameters:
width - an int value
height - an int value
Returns:
a BufferedImage value