|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.ImageUtils
public final class ImageUtils
User: mgarin Date: 05.07.11 Time: 13:22
Field Summary | |
---|---|
static javax.swing.ImageIcon |
coloredChooserIcon
Creates color chooser icon |
static java.lang.String |
IMAGE_CACHE_SEPARATOR
Default cached image data parts separator |
static javax.swing.ImageIcon |
transarentChooserIcon
|
Constructor Summary | |
---|---|
ImageUtils()
|
Method Summary | |
---|---|
static java.awt.image.BufferedImage |
addBackground(java.awt.image.BufferedImage image,
java.awt.Color background)
|
static javax.swing.ImageIcon |
addBackground(javax.swing.ImageIcon imageIcon,
java.awt.Color background)
Adds background to icon |
static void |
clearDisabledCopyCache()
|
static void |
clearDisabledCopyCache(java.lang.String id)
|
static void |
clearImageCache(java.lang.String src)
|
static void |
clearImagesCache()
|
static void |
clearMergedIconsCache()
|
static void |
clearMergedImagesCache()
|
static java.awt.image.BufferedImage |
combineIcons(java.awt.Image... images)
|
static javax.swing.ImageIcon |
combineIcons(javax.swing.ImageIcon... icons)
|
static java.awt.image.BufferedImage |
combineIcons(int spacing,
java.awt.Image... images)
|
static javax.swing.ImageIcon |
combineIcons(int spacing,
javax.swing.ImageIcon... icons)
|
static javax.swing.ImageIcon |
combineIcons(int spacing,
java.util.List<javax.swing.ImageIcon> icons)
|
static javax.swing.ImageIcon |
combineIcons(java.util.List<javax.swing.ImageIcon> icons)
Combines few images into single one |
static java.awt.image.BufferedImage |
copy(java.awt.image.BufferedImage bufferedImage)
|
static java.awt.image.BufferedImage |
copy(java.awt.Image image)
Makes a copy of BufferedImage |
static java.awt.image.BufferedImage |
createBufferedImage(javax.swing.Icon icon)
|
static javax.swing.ImageIcon |
createColorChooserIcon(java.awt.Color color)
|
static java.awt.image.BufferedImage |
createColorChooserImage(java.awt.Color color)
|
static javax.swing.ImageIcon |
createColorIcon(java.awt.Color color)
Creates color icon |
static javax.swing.ImageIcon |
createColorIcon(java.awt.Color color,
int width,
int height)
|
static java.awt.image.BufferedImage |
createColorImage(java.awt.Color color)
|
static java.awt.image.BufferedImage |
createColorImage(java.awt.Color color,
int width,
int height)
|
static java.awt.image.BufferedImage |
createCompatibleImage(java.awt.image.BufferedImage image)
|
static java.awt.image.BufferedImage |
createCompatibleImage(java.awt.image.BufferedImage image,
int transparency)
|
static java.awt.image.BufferedImage |
createCompatibleImage(java.awt.image.BufferedImage image,
int width,
int height)
|
static java.awt.image.BufferedImage |
createCompatibleImage(int width,
int height)
Creates a compatible image using given data |
static java.awt.image.BufferedImage |
createCompatibleImage(int width,
int height,
int transparency)
|
static java.awt.image.BufferedImage |
createDisabledCopy(java.awt.Image img)
|
static javax.swing.ImageIcon |
createDisabledCopy(javax.swing.ImageIcon imageIcon)
|
static javax.swing.ImageIcon |
createDownArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createDownArrowImage(int shadeWidth)
|
static javax.swing.ImageIcon |
createEmptyIcon(int width,
int height)
Creates empty icon |
static java.awt.image.BufferedImage |
createEmptyImage(int width,
int height)
|
static java.awt.image.BufferedImage |
createGrayscaleCopy(java.awt.image.BufferedImage img)
|
static java.awt.image.BufferedImage |
createGrayscaleCopy(java.awt.Image img)
|
static javax.swing.ImageIcon |
createGrayscaleCopy(javax.swing.ImageIcon imageIcon)
Creates grayscale image copy |
static java.awt.image.BufferedImage |
createImageShade(int w,
int h,
java.awt.Shape shape,
int shadeWidth,
float shadeOpacity)
Creating shade for specified shape |
static java.awt.image.BufferedImage |
createImageShade(int w,
int h,
java.awt.Shape shape,
int shadeWidth,
float shadeOpacity,
java.awt.Color clearColor)
|
static javax.swing.ImageIcon |
createLeftArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createLeftArrowImage(int shadeWidth)
|
static java.awt.image.BufferedImage |
createPrettyImage(java.awt.image.BufferedImage bufferedImage,
int shadeWidth,
int round)
|
static java.awt.image.BufferedImage |
createPrettyImage(java.awt.Image image,
int shadeWidth,
int round)
Creating bordered pretty image |
static javax.swing.ImageIcon |
createPreviewIcon(java.awt.image.BufferedImage image,
int size)
|
static javax.swing.ImageIcon |
createPreviewIcon(javax.swing.ImageIcon image,
int size)
|
static javax.swing.ImageIcon |
createPreviewIcon(java.awt.Image image,
int size)
|
static java.awt.image.BufferedImage |
createPreviewImage(java.awt.image.BufferedImage image,
java.awt.Dimension fitTo)
|
static java.awt.image.BufferedImage |
createPreviewImage(java.awt.image.BufferedImage image,
int length)
|
static java.awt.image.BufferedImage |
createPreviewImage(java.awt.image.BufferedImage image,
int width,
int height)
|
static javax.swing.ImageIcon |
createRightArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createRightArrowImage(int shadeWidth)
|
static javax.swing.ImageIcon |
createSimpleDownArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createSimpleDownArrowImage(int shadeWidth)
|
static javax.swing.ImageIcon |
createSimpleLeftArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createSimpleLeftArrowImage(int shadeWidth)
|
static javax.swing.ImageIcon |
createSimpleRightArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createSimpleRightArrowImage(int shadeWidth)
|
static javax.swing.ImageIcon |
createSimpleUpArrowIcon(int shadeWidth)
Arrow icons and images creation methods |
static java.awt.image.BufferedImage |
createSimpleUpArrowImage(int shadeWidth)
|
static javax.swing.ImageIcon |
createSizedImagePreview(javax.swing.ImageIcon icon,
int length,
boolean drawBorder)
|
static javax.swing.ImageIcon |
createThumbnailIcon(java.lang.String src)
Image preview generation |
static javax.swing.ImageIcon |
createThumbnailIcon(java.lang.String src,
int size)
|
static javax.swing.ImageIcon |
createTransparentCopy(javax.swing.ImageIcon imageIcon,
float trasparency)
|
static javax.swing.ImageIcon |
createUpArrowIcon(int shadeWidth)
|
static java.awt.image.BufferedImage |
createUpArrowImage(int shadeWidth)
|
static java.awt.image.BufferedImage |
cutImage(java.awt.Shape shape,
java.awt.Image image)
|
static javax.swing.ImageIcon |
cutImage(java.awt.Shape shape,
javax.swing.ImageIcon image)
Cuts image by the specified shape |
static void |
darkenImage(java.awt.image.BufferedImage image,
float darken)
Darkens specified BufferedImage |
static java.awt.image.BufferedImage |
getBufferedImage(javax.swing.Icon icon)
Retrieves BufferedImage from Icon |
static java.awt.image.BufferedImage |
getBufferedImage(java.awt.Image image)
|
static java.awt.image.BufferedImage |
getBufferedImage(javax.swing.ImageIcon imageIcon)
|
static java.awt.image.BufferedImage |
getBufferedImage(java.lang.String iconSrc)
|
static java.awt.image.BufferedImage |
getBufferedImage(java.net.URL url)
Retrieves BufferedImage from Image |
static javax.swing.ImageIcon |
getDisabledCopy(java.lang.String key,
javax.swing.ImageIcon imageIcon)
|
static java.awt.Color |
getImageAverageColor(javax.swing.ImageIcon icon)
Average image color |
static javax.swing.ImageIcon |
getImageIcon(java.io.File file)
|
static javax.swing.ImageIcon |
getImageIcon(java.io.File file,
boolean useCache)
|
static javax.swing.ImageIcon |
getImageIcon(javax.swing.Icon icon)
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String src)
|
static javax.swing.ImageIcon |
getImageIcon(java.lang.String src,
boolean useCache)
|
static javax.swing.ImageIcon |
getImageIcon(java.net.URL resource)
|
static javax.swing.ImageIcon |
getImageIcon(java.net.URL resource,
boolean useCache)
|
static javax.swing.ImageIcon |
getSizedImagePreview(java.lang.String id,
javax.swing.ImageIcon icon,
int length,
boolean drawBorder)
|
static javax.swing.ImageIcon |
getSizedImagePreview(java.lang.String src,
int length,
boolean drawBorder)
|
static javax.swing.ImageIcon |
getTransparentCopy(java.lang.String id,
javax.swing.ImageIcon imageIcon,
float trasparency)
|
static boolean |
isCompatibleImage(java.awt.image.BufferedImage image)
Returns true if image is compatible |
static boolean |
isImageCached(java.lang.String src)
|
static boolean |
isImageContains(java.awt.image.BufferedImage image,
int x,
int y)
Checks if the specified image pixel is fully transparent |
static boolean |
isImageLoadable(java.lang.String name)
Is this image format can be loaded |
static java.awt.image.BufferedImage |
loadCompatibleImage(java.net.URL resource)
Creates a compatible image from the content specified by the resource |
static javax.swing.ImageIcon |
loadImage(java.lang.Class nearClass,
java.lang.String src)
Loads image from specified resource near class |
static java.awt.image.BufferedImage |
loadImage(java.io.File file)
|
static javax.swing.ImageIcon |
loadImage(java.io.InputStream inputStream)
Loads image from InputStream |
static java.awt.image.BufferedImage |
loadImage(java.lang.String src)
Loads image from specified source file |
static javax.swing.ImageIcon |
loadImage(java.net.URL url)
Loads image from URL |
static javax.swing.ImageIcon |
mergeIcons(javax.swing.ImageIcon... icons)
|
static javax.swing.ImageIcon |
mergeIcons(java.util.List<javax.swing.ImageIcon> icons)
|
static javax.swing.ImageIcon |
mergeIcons(java.lang.String key,
javax.swing.ImageIcon... icons)
|
static javax.swing.ImageIcon |
mergeIcons(java.lang.String key,
java.util.List<javax.swing.ImageIcon> icons)
|
static java.awt.image.BufferedImage |
mergeImages(java.awt.Image... images)
|
static java.awt.image.BufferedImage |
mergeImages(java.lang.String key,
java.awt.Image... images)
|
static java.awt.image.BufferedImage |
resizeCanvas(java.awt.image.BufferedImage image,
int width,
int height)
|
static javax.swing.ImageIcon |
resizeCanvas(javax.swing.ImageIcon imageIcon,
int width,
int height)
Resizes image canvas |
static java.awt.image.BufferedImage |
rotateImage180(java.awt.image.BufferedImage image)
|
static javax.swing.ImageIcon |
rotateImage180(javax.swing.ImageIcon imageIcon)
|
static java.awt.image.BufferedImage |
rotateImage90CCW(java.awt.image.BufferedImage image)
|
static javax.swing.ImageIcon |
rotateImage90CCW(javax.swing.ImageIcon imageIcon)
|
static java.awt.image.BufferedImage |
rotateImage90CW(java.awt.image.BufferedImage image)
|
static javax.swing.ImageIcon |
rotateImage90CW(javax.swing.ImageIcon imageIcon)
Rotate image |
static void |
setImageCache(java.lang.String src,
javax.swing.ImageIcon imageIcon)
|
static java.awt.image.BufferedImage |
toCompatibleImage(java.awt.image.BufferedImage image)
If the source image is already compatible, then the source image is returned. |
static java.util.List<java.awt.Image> |
toImagesList(java.util.List<? extends javax.swing.ImageIcon> imageIcons)
Returns Images list instead of ImageIcons list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String IMAGE_CACHE_SEPARATOR
public static final javax.swing.ImageIcon coloredChooserIcon
public static final javax.swing.ImageIcon transarentChooserIcon
Constructor Detail |
---|
public ImageUtils()
Method Detail |
---|
public static boolean isImageContains(java.awt.image.BufferedImage image, int x, int y)
public static java.awt.image.BufferedImage createCompatibleImage(int width, int height)
public static java.awt.image.BufferedImage createCompatibleImage(int width, int height, int transparency)
public static java.awt.image.BufferedImage createCompatibleImage(java.awt.image.BufferedImage image)
public static java.awt.image.BufferedImage createCompatibleImage(java.awt.image.BufferedImage image, int transparency)
public static java.awt.image.BufferedImage createCompatibleImage(java.awt.image.BufferedImage image, int width, int height)
public static java.awt.image.BufferedImage loadCompatibleImage(java.net.URL resource) throws java.io.IOException
java.io.IOException
public static java.awt.image.BufferedImage toCompatibleImage(java.awt.image.BufferedImage image)
public static boolean isCompatibleImage(java.awt.image.BufferedImage image)
public static javax.swing.ImageIcon cutImage(java.awt.Shape shape, javax.swing.ImageIcon image)
public static java.awt.image.BufferedImage cutImage(java.awt.Shape shape, java.awt.Image image)
public static java.util.List<java.awt.Image> toImagesList(java.util.List<? extends javax.swing.ImageIcon> imageIcons)
public static javax.swing.ImageIcon combineIcons(java.util.List<javax.swing.ImageIcon> icons)
public static javax.swing.ImageIcon combineIcons(int spacing, java.util.List<javax.swing.ImageIcon> icons)
public static javax.swing.ImageIcon combineIcons(javax.swing.ImageIcon... icons)
public static javax.swing.ImageIcon combineIcons(int spacing, javax.swing.ImageIcon... icons)
public static java.awt.image.BufferedImage combineIcons(java.awt.Image... images)
public static java.awt.image.BufferedImage combineIcons(int spacing, java.awt.Image... images)
public static void clearMergedIconsCache()
public static javax.swing.ImageIcon mergeIcons(java.util.List<javax.swing.ImageIcon> icons)
public static javax.swing.ImageIcon mergeIcons(java.lang.String key, java.util.List<javax.swing.ImageIcon> icons)
public static javax.swing.ImageIcon mergeIcons(javax.swing.ImageIcon... icons)
public static javax.swing.ImageIcon mergeIcons(java.lang.String key, javax.swing.ImageIcon... icons)
public static void clearMergedImagesCache()
public static java.awt.image.BufferedImage mergeImages(java.awt.Image... images)
public static java.awt.image.BufferedImage mergeImages(java.lang.String key, java.awt.Image... images)
public static java.awt.image.BufferedImage loadImage(java.lang.String src)
public static java.awt.image.BufferedImage loadImage(java.io.File file)
public static javax.swing.ImageIcon loadImage(java.net.URL url)
public static javax.swing.ImageIcon loadImage(java.lang.Class nearClass, java.lang.String src)
public static javax.swing.ImageIcon loadImage(java.io.InputStream inputStream)
public static javax.swing.ImageIcon addBackground(javax.swing.ImageIcon imageIcon, java.awt.Color background)
public static java.awt.image.BufferedImage addBackground(java.awt.image.BufferedImage image, java.awt.Color background)
public static javax.swing.ImageIcon resizeCanvas(javax.swing.ImageIcon imageIcon, int width, int height)
public static java.awt.image.BufferedImage resizeCanvas(java.awt.image.BufferedImage image, int width, int height)
public static javax.swing.ImageIcon rotateImage90CW(javax.swing.ImageIcon imageIcon)
public static java.awt.image.BufferedImage rotateImage90CW(java.awt.image.BufferedImage image)
public static javax.swing.ImageIcon rotateImage90CCW(javax.swing.ImageIcon imageIcon)
public static java.awt.image.BufferedImage rotateImage90CCW(java.awt.image.BufferedImage image)
public static javax.swing.ImageIcon rotateImage180(javax.swing.ImageIcon imageIcon)
public static java.awt.image.BufferedImage rotateImage180(java.awt.image.BufferedImage image)
public static javax.swing.ImageIcon createEmptyIcon(int width, int height)
public static java.awt.image.BufferedImage createEmptyImage(int width, int height)
public static javax.swing.ImageIcon createColorIcon(java.awt.Color color)
public static javax.swing.ImageIcon createColorIcon(java.awt.Color color, int width, int height)
public static java.awt.image.BufferedImage createColorImage(java.awt.Color color)
public static java.awt.image.BufferedImage createColorImage(java.awt.Color color, int width, int height)
public static javax.swing.ImageIcon createColorChooserIcon(java.awt.Color color)
public static java.awt.image.BufferedImage createColorChooserImage(java.awt.Color color)
public static void darkenImage(java.awt.image.BufferedImage image, float darken)
public static java.awt.Color getImageAverageColor(javax.swing.ImageIcon icon)
public static boolean isImageLoadable(java.lang.String name)
public static javax.swing.ImageIcon createThumbnailIcon(java.lang.String src)
public static javax.swing.ImageIcon createThumbnailIcon(java.lang.String src, int size)
public static javax.swing.ImageIcon createPreviewIcon(javax.swing.ImageIcon image, int size)
public static javax.swing.ImageIcon createPreviewIcon(java.awt.Image image, int size)
public static javax.swing.ImageIcon createPreviewIcon(java.awt.image.BufferedImage image, int size)
public static java.awt.image.BufferedImage createPreviewImage(java.awt.image.BufferedImage image, java.awt.Dimension fitTo)
public static java.awt.image.BufferedImage createPreviewImage(java.awt.image.BufferedImage image, int width, int height)
public static java.awt.image.BufferedImage createPreviewImage(java.awt.image.BufferedImage image, int length)
public static boolean isImageCached(java.lang.String src)
public static void setImageCache(java.lang.String src, javax.swing.ImageIcon imageIcon)
public static void clearImagesCache()
public static void clearImageCache(java.lang.String src)
public static javax.swing.ImageIcon getImageIcon(java.io.File file)
public static javax.swing.ImageIcon getImageIcon(java.io.File file, boolean useCache)
public static javax.swing.ImageIcon getImageIcon(java.lang.String src)
public static javax.swing.ImageIcon getImageIcon(java.lang.String src, boolean useCache)
public static javax.swing.ImageIcon getImageIcon(java.net.URL resource)
public static javax.swing.ImageIcon getImageIcon(java.net.URL resource, boolean useCache)
public static java.awt.image.BufferedImage copy(java.awt.Image image)
public static java.awt.image.BufferedImage copy(java.awt.image.BufferedImage bufferedImage)
public static java.awt.image.BufferedImage getBufferedImage(java.net.URL url)
public static java.awt.image.BufferedImage getBufferedImage(java.lang.String iconSrc)
public static java.awt.image.BufferedImage getBufferedImage(javax.swing.ImageIcon imageIcon)
public static java.awt.image.BufferedImage getBufferedImage(java.awt.Image image)
public static java.awt.image.BufferedImage getBufferedImage(javax.swing.Icon icon)
public static java.awt.image.BufferedImage createBufferedImage(javax.swing.Icon icon)
public static javax.swing.ImageIcon getImageIcon(javax.swing.Icon icon)
public static javax.swing.ImageIcon getSizedImagePreview(java.lang.String src, int length, boolean drawBorder)
public static javax.swing.ImageIcon getSizedImagePreview(java.lang.String id, javax.swing.ImageIcon icon, int length, boolean drawBorder)
public static javax.swing.ImageIcon createSizedImagePreview(javax.swing.ImageIcon icon, int length, boolean drawBorder)
public static void clearDisabledCopyCache()
public static void clearDisabledCopyCache(java.lang.String id)
public static javax.swing.ImageIcon getDisabledCopy(java.lang.String key, javax.swing.ImageIcon imageIcon)
public static javax.swing.ImageIcon createDisabledCopy(javax.swing.ImageIcon imageIcon)
public static java.awt.image.BufferedImage createDisabledCopy(java.awt.Image img)
public static javax.swing.ImageIcon createGrayscaleCopy(javax.swing.ImageIcon imageIcon)
public static java.awt.image.BufferedImage createGrayscaleCopy(java.awt.Image img)
public static java.awt.image.BufferedImage createGrayscaleCopy(java.awt.image.BufferedImage img)
public static javax.swing.ImageIcon getTransparentCopy(java.lang.String id, javax.swing.ImageIcon imageIcon, float trasparency)
public static javax.swing.ImageIcon createTransparentCopy(javax.swing.ImageIcon imageIcon, float trasparency)
public static java.awt.image.BufferedImage createPrettyImage(java.awt.Image image, int shadeWidth, int round)
public static java.awt.image.BufferedImage createPrettyImage(java.awt.image.BufferedImage bufferedImage, int shadeWidth, int round)
public static java.awt.image.BufferedImage createImageShade(int w, int h, java.awt.Shape shape, int shadeWidth, float shadeOpacity)
public static java.awt.image.BufferedImage createImageShade(int w, int h, java.awt.Shape shape, int shadeWidth, float shadeOpacity, java.awt.Color clearColor)
public static javax.swing.ImageIcon createSimpleUpArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createSimpleUpArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createUpArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createUpArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createSimpleLeftArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createSimpleLeftArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createLeftArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createLeftArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createSimpleDownArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createSimpleDownArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createDownArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createDownArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createSimpleRightArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createSimpleRightArrowImage(int shadeWidth)
public static javax.swing.ImageIcon createRightArrowIcon(int shadeWidth)
public static java.awt.image.BufferedImage createRightArrowImage(int shadeWidth)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |