Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.tigris.gef.util
Class ResourceLoader  view ResourceLoader download ResourceLoader.java

java.lang.Object
  extended byorg.tigris.gef.util.ResourceLoader

public class ResourceLoader
extends java.lang.Object

This class manages the resource locations needed within the application. Already loaded resources are cached. The resources can be searched in different locations.


Field Summary
private static java.util.HashMap _resourceCache
           
private static java.util.List _resourceExtensions
           
private static java.util.List _resourceLocations
           
 
Constructor Summary
ResourceLoader()
           
 
Method Summary
static void addResourceExtension(java.lang.String extension)
          This method adds a new extension to the list of known extensions.
static void addResourceLocation(java.lang.String location)
          This method adds a new location to the list of known locations.
static boolean containsExtension(java.lang.String extension)
           
static boolean containsLocation(java.lang.String location)
           
static boolean isInCache(java.lang.String resource)
           
static javax.swing.ImageIcon lookupIconResource(java.lang.String resource)
          This method tries to find an ImageIcon for the given name in all known locations.
static javax.swing.ImageIcon lookupIconResource(java.lang.String resource, java.lang.ClassLoader loader)
           
static javax.swing.ImageIcon lookupIconResource(java.lang.String resource, java.lang.String desc)
           
static javax.swing.ImageIcon lookupIconResource(java.lang.String resource, java.lang.String desc, java.lang.ClassLoader loader)
           
static void removeResourceExtension(java.lang.String extension)
          This method removes a extension from the list of known extensions.
static void removeResourceLocation(java.lang.String location)
          This method removes a location from the list of known locations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_resourceCache

private static java.util.HashMap _resourceCache

_resourceLocations

private static java.util.List _resourceLocations

_resourceExtensions

private static java.util.List _resourceExtensions
Constructor Detail

ResourceLoader

public ResourceLoader()
Method Detail

lookupIconResource

public static javax.swing.ImageIcon lookupIconResource(java.lang.String resource)
This method tries to find an ImageIcon for the given name in all known locations. The file extension of the used image file can be any of the known extensions.


lookupIconResource

public static javax.swing.ImageIcon lookupIconResource(java.lang.String resource,
                                                       java.lang.String desc)

lookupIconResource

public static javax.swing.ImageIcon lookupIconResource(java.lang.String resource,
                                                       java.lang.ClassLoader loader)

lookupIconResource

public static javax.swing.ImageIcon lookupIconResource(java.lang.String resource,
                                                       java.lang.String desc,
                                                       java.lang.ClassLoader loader)

addResourceLocation

public static void addResourceLocation(java.lang.String location)
This method adds a new location to the list of known locations.


addResourceExtension

public static void addResourceExtension(java.lang.String extension)
This method adds a new extension to the list of known extensions.


removeResourceLocation

public static void removeResourceLocation(java.lang.String location)
This method removes a location from the list of known locations.


removeResourceExtension

public static void removeResourceExtension(java.lang.String extension)
This method removes a extension from the list of known extensions.


containsExtension

public static boolean containsExtension(java.lang.String extension)

containsLocation

public static boolean containsLocation(java.lang.String location)

isInCache

public static boolean isInCache(java.lang.String resource)