net.clackrouter.jgraph.pad.resources
Class ImageLoader

java.lang.Object
  extended by net.clackrouter.jgraph.pad.resources.ImageLoader

public class ImageLoader
extends java.lang.Object

Loader for the resource images. The class uses the getResource Method to get the Resource from the relative path.


Field Summary
protected static java.util.Stack searchPath
          contains string objects which respresents the search paths
 
Constructor Summary
ImageLoader()
           
 
Method Summary
static java.awt.Image getImage(java.lang.String imageName)
          Returns an Image from the same path.
static javax.swing.ImageIcon getImageIcon(int searchPathIndex, java.lang.String imageName)
          Returns an ImageIcon from the same path.
static javax.swing.ImageIcon getImageIcon(java.lang.String imageName)
          Returns an ImageIcon from the same path.
static void popSearchPath()
          pops the highest search path
static void pushSearchPath(java.lang.String path)
          pushes the specified path to the search path An example for a search path file name is 'com/jgraph/pad/resources'.
static void removeSearchPath(int index)
          removes the searchpath at the specified index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

searchPath

protected static java.util.Stack searchPath
contains string objects which respresents the search paths

Constructor Detail

ImageLoader

public ImageLoader()
Method Detail

getImage

public static java.awt.Image getImage(java.lang.String imageName)
Returns an Image from the same path.

Parameters:
imageName - An image name with the file extension buttonEdge.g. Can.gif

getImageIcon

public static javax.swing.ImageIcon getImageIcon(java.lang.String imageName)
Returns an ImageIcon from the same path.

Parameters:
imageName - An image name with the file extension buttonEdge.g. Can.gif

getImageIcon

public static javax.swing.ImageIcon getImageIcon(int searchPathIndex,
                                                 java.lang.String imageName)
Returns an ImageIcon from the same path.

Parameters:
imageName - An image name with the file extension buttonEdge.g. Can.gif

pushSearchPath

public static void pushSearchPath(java.lang.String path)
pushes the specified path to the search path An example for a search path file name is 'com/jgraph/pad/resources'.


removeSearchPath

public static void removeSearchPath(int index)
removes the searchpath at the specified index


popSearchPath

public static void popSearchPath()
pops the highest search path