org.nakedobjects.viewer.lightweight.util
Class ImageFactory

java.lang.Object
  extended byorg.nakedobjects.viewer.lightweight.util.ImageFactory

public class ImageFactory
extends java.lang.Object


Method Summary
 Icon createIcon(java.lang.String name, int size)
          Creates a flyweight Icon object of the specified size.
static ImageFactory getImageFactory()
           
 Icon loadImage(java.lang.String path)
          Load a java.awt.Image object using the file path path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImageFactory

public static ImageFactory getImageFactory()

createIcon

public final Icon createIcon(java.lang.String name,
                             int size)
Creates a flyweight Icon object of the specified size.

Returns:
the corresponding ImageIcon or null if no image found.

loadImage

public Icon loadImage(java.lang.String path)
Load a java.awt.Image object using the file path path. This method attempts to load the image from the jar/zip file this class was loaded from ie, your application, and then from the file system as a file if can't be found as a resource. If neither method works the default image is returned.

See Also:
Class.getResource(String)