org.globus.cog.util
Class ImageLoader

java.lang.Object
  extended by org.globus.cog.util.ImageLoader

public class ImageLoader
extends Object

Loads an image from a file/resource Hopefully it works regardless of the packaging. It also caches the icons, returning only one instance of the same icon.


Constructor Summary
ImageLoader()
          Creates a new image loader.
 
Method Summary
static ImageIcon loadIcon(String name)
          Convenience method that automatically creates an ImageLoader instance
 ImageIcon loadImage(String name)
          Loads an image
static void loadMap(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLoader

public ImageLoader()
Creates a new image loader. This is needed in order to get a reference to the correct class loader, which is needed for loading images from jars that are not local (webstart). This will not affect the cache, which is shared between all instances of this class.

Method Detail

loadMap

public static void loadMap(String name)

loadImage

public ImageIcon loadImage(String name)
Loads an image

Parameters:
name - The URI of the image to be loaded
Returns:
An ImageIcon with the loaded image or null if the image was not found

loadIcon

public static ImageIcon loadIcon(String name)
Convenience method that automatically creates an ImageLoader instance

Parameters:
name - The URI of the image to be loaded
Returns:
An ImageIcon with the loaded image or null if the image was not found