org.bounce.image
Class ImageLoader

java.lang.Object
  extended by org.bounce.image.ImageLoader

public class ImageLoader
extends Object

Loads Images from file and stores the images in a list for future reference.

Version:
$Revision: 1.6 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Constructor Summary
protected ImageLoader()
          Constructs the ImageLoader object.
 
Method Summary
static ImageLoader get()
          Returns the single reference to the ImageLoader.
 ImageIcon getImage(String name)
          Gets an image for the string supplied.
 ImageIcon getImage(URL url)
          Gets an image for the url supplied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLoader

protected ImageLoader()
Constructs the ImageLoader object.

Method Detail

get

public static ImageLoader get()
Returns the single reference to the ImageLoader.

Returns:
the ImageLoader singleton.

getImage

public ImageIcon getImage(String name)
Gets an image for the string supplied. If the image cannot be found in the list of images already loaded, the image is loaded from the class path.

Parameters:
name - the name of the image.
Returns:
the image.

getImage

public ImageIcon getImage(URL url)
Gets an image for the url supplied. The image is only loaded from file if the image cannot be found in the list of images already loaded.

Parameters:
url - the url to the image.
Returns:
the image.


Copyright © 2002-2011 Edwin Dankert. All Rights Reserved.