public class ImageLibrary
extends java.lang.Object
Constructor and Description |
---|
ImageLibrary() |
Modifier and Type | Method and Description |
---|---|
static javax.swing.ImageIcon |
getIcon(java.lang.String iconName)
Retrun the icon associated with a specified name.
|
static java.lang.String |
getIconName(javax.swing.Icon icon)
Return the name associated with a specified icon.
|
static java.awt.image.BufferedImage |
getImage(java.lang.String imageName)
Retrun the image associated with a specified name.
|
static java.awt.image.BufferedImage |
getImageForIcon(javax.swing.Icon icon)
Returns the image associated with a specified icon.
|
static java.lang.String |
getImageName(java.awt.image.BufferedImage image)
Return the name associated with a specified image.
|
static java.net.URL |
getImageURL(java.lang.String imageName) |
static javax.swing.Icon |
getWarningIcon(int size)
Returns a warning icon, an icon that can be used when a desired icon is not available.
|
static java.awt.image.BufferedImage |
getWarningImage(int size)
Returns a warning image, an image that can be used when a desired image is not available.
|
protected void |
loadWarningImages() |
static java.lang.Object |
register(java.lang.String name,
java.lang.Object image)
Register an image with the library.
|
static void |
setInstance(ImageLibrary library)
Specify the instance for this conceptual singleton.
|
public static javax.swing.ImageIcon getIcon(java.lang.String iconName)
iconName
- the name of the desired icon.public static java.lang.String getIconName(javax.swing.Icon icon)
icon
- the icon whose name to return.public static java.awt.image.BufferedImage getImage(java.lang.String imageName)
imageName
- the name of the desired image.public static java.awt.image.BufferedImage getImageForIcon(javax.swing.Icon icon)
icon
- the icon whose image is desired.public static java.lang.String getImageName(java.awt.image.BufferedImage image)
image
- the image whose name to return.public static java.net.URL getImageURL(java.lang.String imageName)
public static javax.swing.Icon getWarningIcon(int size)
size
- the desired icon size in pixels, either 16, 24, 32 or 64.public static java.awt.image.BufferedImage getWarningImage(int size)
size
- the desired image size in pixels, either 16, 24, 32 or 64.protected void loadWarningImages()
public static java.lang.Object register(java.lang.String name, java.lang.Object image)
name
- the image name. If null the image is not registered.image
- the image. If null the image is not registered.image
argument.public static void setInstance(ImageLibrary library)
library
- the image library instance.