com.jaxfront.core.util
Class ImageHelper
java.lang.Object
com.jaxfront.core.util.ImageHelper
public class ImageHelper
- extends java.lang.Object
- Author:
- Chris Gantenbein
TODO To change the template for this generated type comment go to Window -
Preferences - Java - Code Style - Code Templates
Method Summary |
static byte[] |
createByteArray(javax.swing.ImageIcon i,
java.lang.String type)
|
static byte[] |
createByteArray(java.awt.Image image,
java.lang.String type)
|
static java.lang.String |
getHTMLSpacerImageTag(Document dom)
|
java.awt.Image |
getImage(java.lang.String imageName)
|
javax.swing.ImageIcon |
getImageIcon(java.lang.String imageName)
Return the image with the specified image name. |
javax.swing.ImageIcon |
getImageIcon(java.net.URL baseURL,
java.lang.String imageName)
Return the image with the specified image name. |
ResourceWrapper |
getImageIconWrapper(java.net.URL baseURL,
java.lang.String imageName,
boolean createNullImage)
Return the image with the specified image name. |
static byte[] |
getImageNotFound()
|
static java.net.URL |
getImageUrl(java.lang.String imageName)
|
java.util.Enumeration |
getImageWrappers()
|
static ImageHelper |
getInstance()
|
int |
getLoadedImages()
|
int |
getLoadedImagesSize()
|
static java.awt.Image |
getScaledImage(java.awt.Component imageHolder,
java.awt.Image image,
int newWidth,
int newHeight)
|
void |
putImage(java.lang.String key,
byte[] value,
boolean internalized)
|
void |
releaseImageCache()
|
void |
releaseInternalizedImages()
|
void |
removeImage(java.lang.String key)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NULL_IMAGE_DEF
public static final byte[] NULL_IMAGE_DEF
IMAGE_NOT_FOUND_DEF
public static final byte[] IMAGE_NOT_FOUND_DEF
imageNotFound
public static javax.swing.ImageIcon imageNotFound
ImageHelper
public ImageHelper()
getScaledImage
public static java.awt.Image getScaledImage(java.awt.Component imageHolder,
java.awt.Image image,
int newWidth,
int newHeight)
getImageNotFound
public static byte[] getImageNotFound()
getInstance
public static ImageHelper getInstance()
getLoadedImages
public int getLoadedImages()
getLoadedImagesSize
public int getLoadedImagesSize()
removeImage
public void removeImage(java.lang.String key)
getHTMLSpacerImageTag
public static java.lang.String getHTMLSpacerImageTag(Document dom)
getImageWrappers
public java.util.Enumeration getImageWrappers()
releaseImageCache
public void releaseImageCache()
releaseInternalizedImages
public void releaseInternalizedImages()
getImageIconWrapper
public ResourceWrapper getImageIconWrapper(java.net.URL baseURL,
java.lang.String imageName,
boolean createNullImage)
- Return the image with the specified image name. Note that the image
should be in the class path.
- Parameters:
imageName
- the name of the image
- Returns:
- an image with the specified name
putImage
public void putImage(java.lang.String key,
byte[] value,
boolean internalized)
getImageUrl
public static java.net.URL getImageUrl(java.lang.String imageName)
getImage
public java.awt.Image getImage(java.lang.String imageName)
getImageIcon
public javax.swing.ImageIcon getImageIcon(java.lang.String imageName)
- Return the image with the specified image name. Note that the image
should be in the class path.
- Parameters:
imageName
- the name of the image
- Returns:
- an image with the specified name
getImageIcon
public javax.swing.ImageIcon getImageIcon(java.net.URL baseURL,
java.lang.String imageName)
- Return the image with the specified image name. Note that the image
should be in the class path.
- Parameters:
imageName
- the name of the image
- Returns:
- an image with the specified name
createByteArray
public static byte[] createByteArray(java.awt.Image image,
java.lang.String type)
createByteArray
public static byte[] createByteArray(javax.swing.ImageIcon i,
java.lang.String type)