javax.swing.Icon, org.pushingpixels.neon.icon.ResizableIconpublic class ImageWrapperResizableIcon
extends java.lang.Object
implements org.pushingpixels.neon.icon.ResizableIcon
ResizableIcon interface that wraps image files.| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.Map<java.lang.String,java.awt.image.BufferedImage> |
cachedImages |
Contains all precomputed images.
|
protected int |
height |
The height of the current image.
|
protected java.awt.Image |
image |
The input stream of the original image.
|
protected java.io.InputStream |
imageInputStream |
The input stream of the original image.
|
protected javax.swing.event.EventListenerList |
listenerList |
The listeners.
|
protected java.awt.image.BufferedImage |
originalImage |
The original image.
|
protected int |
width |
The width of the current image.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAsynchronousLoadListener(org.pushingpixels.neon.AsynchronousLoadListener l) |
|
protected void |
fireAsyncCompleted(java.lang.Boolean event) |
Fires the asynchronous load event.
|
static ImageWrapperResizableIcon |
getIcon(java.awt.Image image,
java.awt.Dimension initialDim) |
Returns the icon for the specified URL.
|
static ImageWrapperResizableIcon |
getIcon(java.io.InputStream inputStream,
java.awt.Dimension initialDim) |
Returns the icon for the specified input stream.
|
static ImageWrapperResizableIcon |
getIcon(java.net.URL location,
java.awt.Dimension initialDim) |
Returns the icon for the specified URL.
|
int |
getIconHeight() |
|
int |
getIconWidth() |
|
boolean |
isLoading() |
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
|
void |
removeAsynchronousLoadListener(org.pushingpixels.neon.AsynchronousLoadListener l) |
|
protected void |
renderImage(int renderWidth,
int renderHeight) |
Renders the image.
|
void |
setDimension(java.awt.Dimension dim) |
|
void |
setPreferredSize(java.awt.Dimension dim) |
Sets the preferred size for
this icon. |
protected java.awt.image.BufferedImage originalImage
protected java.io.InputStream imageInputStream
protected java.awt.Image image
protected java.util.Map<java.lang.String,java.awt.image.BufferedImage> cachedImages
protected int width
protected int height
protected javax.swing.event.EventListenerList listenerList
public static ImageWrapperResizableIcon getIcon(java.awt.Image image, java.awt.Dimension initialDim)
image - Image.initialDim - Initial dimension of the icon.public static ImageWrapperResizableIcon getIcon(java.net.URL location, java.awt.Dimension initialDim)
location - Icon URL.initialDim - Initial dimension of the icon.public static ImageWrapperResizableIcon getIcon(java.io.InputStream inputStream, java.awt.Dimension initialDim)
inputStream - Icon input stream.initialDim - Initial dimension of the icon.public void setDimension(java.awt.Dimension dim)
setDimension in interface org.pushingpixels.neon.icon.ResizableIconpublic void addAsynchronousLoadListener(org.pushingpixels.neon.AsynchronousLoadListener l)
addAsynchronousLoadListener in interface org.pushingpixels.neon.AsynchronousLoadingpublic void removeAsynchronousLoadListener(org.pushingpixels.neon.AsynchronousLoadListener l)
removeAsynchronousLoadListener in interface org.pushingpixels.neon.AsynchronousLoadingpublic int getIconWidth()
getIconWidth in interface javax.swing.Iconpublic int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
paintIcon in interface javax.swing.Iconpublic void setPreferredSize(java.awt.Dimension dim)
this icon. The rendering is
scheduled automatically.dim - Preferred size.protected void renderImage(int renderWidth,
int renderHeight)
renderWidth - Requested rendering width.renderHeight - Requested rendering height.protected void fireAsyncCompleted(java.lang.Boolean event)
event - Event object.public boolean isLoading()
isLoading in interface org.pushingpixels.neon.AsynchronousLoading