org.objectweb.jac.aspects.gui
Class ResourceManager

java.lang.Object
  extended byorg.objectweb.jac.aspects.gui.ResourceManager

public class ResourceManager
extends Object

A class with static methods to get GUI resources as icons.

Author:
Renaud Pawlak, Laurent Martelli

Field Summary
static String RESOURCES_PATH
          Store the path where to find resources for the GUI.
 
Constructor Summary
ResourceManager()
           
 
Method Summary
static ImageIcon createIcon(String path)
          Creates an icon from a path string.
static void defineResource(String name, String path)
          Define a resource.
static ImageIcon getIcon(String resource)
          Build an icon using a resource as the image.
static ImageIcon getIconResource(String name)
          Build an icon using a named resource as the image.
static String getResource(String name)
           
static InputStream getResourceAsStream(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCES_PATH

public static final String RESOURCES_PATH
Store the path where to find resources for the GUI.

See Also:
Constant Field Values
Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

createIcon

public static ImageIcon createIcon(String path)
Creates an icon from a path string.

Parameters:
path - the path of the icon (absolute or accessible through the classpath)

defineResource

public static void defineResource(String name,
                                  String path)
Define a resource.

Parameters:
name - the short name of the resource
path - the full path to the resource
See Also:
getIcon(String)

getResource

public static String getResource(String name)

getResourceAsStream

public static InputStream getResourceAsStream(String name)

getIcon

public static ImageIcon getIcon(String resource)
Build an icon using a resource as the image. If the resource is null, returns null.

Parameters:
resource - the resource name (full path)
See Also:
getIconResource(String), defineResource(String,String)

getIconResource

public static ImageIcon getIconResource(String name)
Build an icon using a named resource as the image. If name is not a known resource name, returns null.

Parameters:
name - the name of the resource
See Also:
getIcon(String), defineResource(String,String)