public class ResourceUILoader extends ResourceLoader
loader, pack, resourceURL
Constructor and Description |
---|
ResourceUILoader(File file)
Creates a new resource loader, fetching resources in a File, which can be a directory.
|
ResourceUILoader(String pack)
Creates a new resource loader, retrieving resources in a package.
|
ResourceUILoader(String pack,
Class clazz)
Creates a new resource loader, retrieving resources in a package, and , using the ClassLoader associated with a class.
|
ResourceUILoader(String pack,
ClassLoader loader)
Creates a new resource loader, retrieving resources in a package.
|
ResourceUILoader(String pack,
Object o)
Creates a new resource loader, retrieving resources in a package, and , using the ClassLoader associated with an Object.
|
ResourceUILoader(URL url)
Creates a new resource loader, fetching resources in the
url URL (which can be a directory) |
Modifier and Type | Method and Description |
---|---|
static ResourceUILoader |
createFromContext(String pack)
CreateResourceLoader to use the ClassLoader or the caller class.
|
static ResourceUILoader |
createFromContext(String pack,
boolean useInternalAPI)
Create a ResourceUILoader using the ClassLoader or the caller class.
|
ImageIcon |
getIcon(String icon)
Return the icon of the relative name
icon in the resource package or URL. |
ImageIcon |
getIcon(String icon,
Class clazz)
Return the icon of the relative name
icon in the resource package or URL. |
ImageIcon |
getIcon(String icon,
ClassLoader loader)
Return the icon of the relative name
icon in the resource package or URL. |
ImageIcon |
getIcon(String icon,
Object o)
Return the icon of the relative name
icon in the resource package or URL. |
Image |
getImage()
Return the Image of the selected absolute URL.
|
Image |
getImage(String image)
Return the image of the relative name
image in the resource package or URL. |
Image |
getImage(String image,
Class clazz)
Return the image of the relative name
image in the resource package or URL. |
Image |
getImage(String image,
ClassLoader loader)
Return the image of the relative name
image in the resource package or URL. |
Image |
getImage(String image,
Object o)
Return the image of the relative name
image in the resource package or URL. |
getDefaultClassLoader, getPackage, getPropertyResourceBundle, getPropertyResourceBundle, getResourceAsStream, getResourceAsStream, getResourceAsStream, getResourceAsStream, getResourceAsStream, getResourceAsStream, getResourceAsStream, getResourceURL, getURL, getURL, getURL, getURL, getURL, getURL
public ResourceUILoader(String pack)
ResourceUILoader loader = new ResourceUILoader("svglab/resources");
pack
- the packagepublic ResourceUILoader(String pack, ClassLoader loader)
ResourceUILoader loader = new ResourceUILoader("svglab/resources", myClassLoader);
pack
- the packageloader
- the Class loaderpublic ResourceUILoader(String pack, Class clazz)
ResourceUILoader loader = new ResourceUILoader("svglab/resources", myClassLoader);
pack
- the packageclazz
- the Class used to get the Class loaderpublic ResourceUILoader(String pack, Object o)
ResourceLoader loader = new ResourceLoader("svglab/resources", myClassLoader);It is useful to retrieve bundled resources.
pack
- the packageo
- the Object used to get the Class loaderpublic ResourceUILoader(File file)
file
- the Filepublic ResourceUILoader(URL url)
url
URL (which can be a directory)url
- the URLpublic static ResourceUILoader createFromContext(String pack)
createFromContext(java.lang.String, boolean)
with
false for the second argumentpack
- the packagepublic static ResourceUILoader createFromContext(String pack, boolean useInternalAPI)
pack
- the packageuseInternalAPI
- true if the sun.reflect.Reflection
will be usedpublic ImageIcon getIcon(String icon)
icon
in the resource package or URL. The Class loader used to get the Icon will be
the default ClassLoader.icon
- the icon namepublic ImageIcon getIcon(String icon, ClassLoader loader)
icon
in the resource package or URL. The Class loader used to get the Icon will be a
specified ClassLoader.icon
- the icon nameloader
- the Class loaderpublic ImageIcon getIcon(String icon, Class clazz)
icon
in the resource package or URL. The Class loader used to get the Icon will be
the ClassLoader associated with the Class passed in the arguments.icon
- the icon nameclazz
- the Class used to get the ClassLoaderpublic ImageIcon getIcon(String icon, Object o)
icon
in the resource package or URL. The Class loader used to get the Icon will be
the ClassLoader associated with the Object passed in the arguments.icon
- the icon nameo
- the Object used to get the ClassLoaderpublic Image getImage()
public Image getImage(String image)
image
in the resource package or URL. The Class loader used to get the Image will
be the default ClassLoader.image
- the image namepublic Image getImage(String image, ClassLoader loader)
image
in the resource package or URL. The Class loader used to get the Image will
be a specified ClassLoader.image
- the image nameloader
- the Class loaderpublic Image getImage(String image, Class clazz)
image
in the resource package or URL. The Class loader used to get the Icon will be
the ClassLoader associated with the Class passed in the arguments.image
- the image nameclazz
- the Class used to get the ClassLoaderpublic Image getImage(String image, Object o)
image
in the resource package or URL. The Class loader used to get the Icon will be
the ClassLoader associated with the Object passed in the arguments.image
- the image nameo
- the Object used to get the ClassLoader