arlut.csd.Util
Class PackageResources
java.lang.Object
|
+--arlut.csd.Util.PackageResources
- public class PackageResources
- extends java.lang.Object
Utility class to provide resource-loading services. Methods in this class
can load images and other resources from either CLASSPATH or a jar file,
depending on how the program using this class is run.
|
Field Summary |
(package private) static java.applet.AppletContext |
context
|
(package private) static boolean |
debug
|
(package private) static boolean |
nevertryagain
|
|
Method Summary |
static java.awt.Image |
getImageResource(java.awt.Component comp,
java.lang.String imageName,
java.lang.Class refClass)
Loads an image by its filename from either CLASSPATH or a jar file,
depending on how the code calling this method was run. |
static java.net.URL |
getPackageResource(java.lang.String strResource,
java.lang.Class refClass)
Loads a generic resource by its filename from either CLASSPATH or a jar file,
depending on how the code calling this method was run. |
static void |
waitForImage(java.awt.Component component,
java.awt.Image image)
Helper method to handle the MediaTracker for image loading. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
context
static java.applet.AppletContext context
nevertryagain
static boolean nevertryagain
debug
static final boolean debug
PackageResources
public PackageResources()
getPackageResource
public static java.net.URL getPackageResource(java.lang.String strResource,
java.lang.Class refClass)
Loads a generic resource by its filename from either CLASSPATH or a jar file,
depending on how the code calling this method was run.
- Parameters:
strResource - Filename of resource to be loadedrefClass - Parent Class, used to find path to image
getImageResource
public static java.awt.Image getImageResource(java.awt.Component comp,
java.lang.String imageName,
java.lang.Class refClass)
Loads an image by its filename from either CLASSPATH or a jar file,
depending on how the code calling this method was run.
- Parameters:
comp - Parent component, used for Util.waitforimageimageName - Name of image to be loadedrefClass - Parent Class, used to find path to image
waitForImage
public static void waitForImage(java.awt.Component component,
java.awt.Image image)
- Helper method to handle the MediaTracker for image loading.