|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jeta.open.resources.AppResourceLoader
public class AppResourceLoader
This class is an implementation of a ResourceLoader. It insulates the application code from having any need to know about the local file system directory structure. It is also useful for debugging and development so we can redirect resource request to debug files if needed.
Field Summary |
---|
Fields inherited from interface com.jeta.open.resources.ResourceLoader |
---|
COMPONENT_ID |
Constructor Summary | |
---|---|
AppResourceLoader()
|
Method Summary | |
---|---|
ClassLoader |
getClassLoader()
Used to provide a custom class loader for certain cases. |
static ImageIcon |
getEmptyIcon()
Returns an icon with a red X to show an icon that could not be loaded. |
static ImageIcon |
getImage(String imageName)
Loads an image from disk. |
InputStream |
getResourceAsStream(String resourceName)
Opens and returns an input stream for the given resourceName. |
ImageIcon |
loadImage(String imageName)
Helper utility to load an image file from the application images directory |
void |
setClassLoader(ClassLoader loader)
Used to provide a custom class loader for certain cases. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AppResourceLoader()
Method Detail |
---|
public ClassLoader getClassLoader()
ResourceLoader
getClassLoader
in interface ResourceLoader
public static ImageIcon getEmptyIcon()
public InputStream getResourceAsStream(String resourceName) throws IOException
getResourceAsStream
in interface ResourceLoader
resourceName
- the relative name of the resource to open
IOException
public static ImageIcon getImage(String imageName)
public ImageIcon loadImage(String imageName)
loadImage
in interface ResourceLoader
imageName
- the name (and optional sub directory ) of the file to loadpublic void setClassLoader(ClassLoader loader)
ResourceLoader
setClassLoader
in interface ResourceLoader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |