T - enumeration key into the deckjavax.swing.Icon, AsynchronousLoading, ResizableIconpublic class IconDeckResizableIcon<T> extends java.lang.Object implements ResizableIcon, AsynchronousLoading
ResizableIcon that allows switching the icon
painting at runtime. This class can be used as a delegate in the
DecoratedResizableIcon where the "base" icon is changed at runtime
without the need to recompute all the decorators.| Constructor | Description |
|---|---|
IconDeckResizableIcon(java.util.Map<T,? extends ResizableIcon> iconDeck) |
Creates the icon deck.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAsynchronousLoadListener(AsynchronousLoadListener l) |
Adds listener on the asynchronous loading events.
|
int |
getIconHeight() |
|
int |
getIconWidth() |
|
boolean |
isLoading() |
Returns indication whether the content is still loading.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
|
void |
removeAsynchronousLoadListener(AsynchronousLoadListener l) |
Removes listener on the asynchronous loading events.
|
void |
setDimension(java.awt.Dimension dim) |
Changes the dimension of
this icon. |
void |
setIcon(T key) |
Sets the currently shown icon.
|
public IconDeckResizableIcon(java.util.Map<T,? extends ResizableIcon> iconDeck)
iconDeck - Icon deck.public void setIcon(T key)
key - Icon key.public void setDimension(java.awt.Dimension dim)
ResizableIconthis icon.setDimension in interface ResizableIcondim - New dimension for this icon.public int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic int getIconWidth()
getIconWidth 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 addAsynchronousLoadListener(AsynchronousLoadListener l)
AsynchronousLoadingaddAsynchronousLoadListener in interface AsynchronousLoadingl - Listener to add.public boolean isLoading()
AsynchronousLoadingisLoading in interface AsynchronousLoadingtrue if the content is still loading,
false otherwise.public void removeAsynchronousLoadListener(AsynchronousLoadListener l)
AsynchronousLoadingremoveAsynchronousLoadListener in interface AsynchronousLoadingl - Listener to remove.