public class ResourceManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.Locale |
DEFAULT_LOCALE |
Constructor and Description |
---|
ResourceManager() |
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
findImage(java.lang.String imageName)
Searches for an image with the given name and returns
an URL pointing to it.
|
static javax.swing.Icon |
getIcon(java.lang.String pathName)
Loads and returns the icon specified by
pathName ,
where the path can be the path inside a jar file. |
static java.lang.String |
getMessage(java.lang.String key)
Returns the localized message for the given key
key
or null if no corresponding message is found in the list of global messages. |
static java.awt.image.BufferedImage |
loadBufferedImage(java.lang.String imageName)
Loads and returns a buffered image with the given name.
|
static java.awt.Image |
loadImage(java.lang.String imageName)
Loads and returns an image with the given name.
|
public static java.lang.String getMessage(java.lang.String key)
key
or null
if no corresponding message is found in the list of global messages.public static javax.swing.Icon getIcon(java.lang.String pathName)
pathName
,
where the path can be the path inside a jar file.public static java.awt.Image loadImage(java.lang.String imageName)
.files
folder
of a mathlet, the image name may be relative to this directory.
Otherwise the full path must be given.imageName
- relative or absolute path to an image filenull
if no image can be foundpublic static java.awt.image.BufferedImage loadBufferedImage(java.lang.String imageName)
.files
folder
of a mathlet, the image name may be relative to this directory.
Otherwise the full path must be given.imageName
- relative or absolute path to an image filenull
if no image can be foundpublic static java.net.URL findImage(java.lang.String imageName)
null
if no image can be found.
If the image is stored inside the .files
folder
of a mathlet, the image name may be relative to this directory.
Otherwise the full path must be given.imageName
- relative or absolute path to an image filenull
if no image can be foundFurther documentation and examples can be found under www.mathletfactory.de.