org.mars_sim.msp.ui.standard
Class ImageLoader

java.lang.Object
  extended by org.mars_sim.msp.ui.standard.ImageLoader

public class ImageLoader
extends java.lang.Object

This is a static class that acts as a helper to load Images for use in the UI. It is based on loading the resource form the class path via the ClassLoader assuming all the Images to load a GIF. However other alternative strategies can be easily implemented within this class.


Field Summary
static java.lang.String IMAGE_DIR
          Sub-directory/package for the images
 
Method Summary
static javax.swing.ImageIcon getIcon(java.lang.String name)
          Load the image icon with the specified name.
static java.awt.Image getImage(java.lang.String imagename)
          Get an image with the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_DIR

public static final java.lang.String IMAGE_DIR
Sub-directory/package for the images

See Also:
Constant Field Values
Method Detail

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String name)
Load the image icon with the specified name. This operation may either create a new Image Icon of returned a previously created one.

Parameters:
name - Name of the image to load.
Returns:
ImageIcon containing image of specified name.

getImage

public static java.awt.Image getImage(java.lang.String imagename)
Get an image with the specified name. The name should include the suffix identifying the format of the image.

Parameters:
imagename - Name of image including suffix.
Returns:
Image found and loaded.