org.pushingpixels.flamingo.api.common.icon
T
- enumeration key into the deckpublic class IconDeckResizableIcon<T> extends 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 and Description |
---|
IconDeckResizableIcon(Map<T,? extends ResizableIcon> iconDeck)
Creates the icon deck.
|
Modifier and Type | Method and 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(Component c,
Graphics g,
int x,
int y) |
void |
removeAsynchronousLoadListener(AsynchronousLoadListener l)
Removes listener on the asynchronous loading events.
|
void |
setDimension(Dimension dim)
Changes the dimension of
this icon. |
void |
setIcon(T key)
Sets the currently shown icon.
|
public IconDeckResizableIcon(Map<T,? extends ResizableIcon> iconDeck)
iconDeck
- Icon deck.public void setIcon(T key)
key
- Icon key.public void setDimension(Dimension dim)
ResizableIcon
this
icon.setDimension
in interface ResizableIcon
dim
- New dimension for this
icon.public int getIconHeight()
getIconHeight
in interface Icon
public int getIconWidth()
getIconWidth
in interface Icon
public void addAsynchronousLoadListener(AsynchronousLoadListener l)
AsynchronousLoading
addAsynchronousLoadListener
in interface AsynchronousLoading
l
- Listener to add.public boolean isLoading()
AsynchronousLoading
isLoading
in interface AsynchronousLoading
true
if the content is still loading,
false
otherwise.public void removeAsynchronousLoadListener(AsynchronousLoadListener l)
AsynchronousLoading
removeAsynchronousLoadListener
in interface AsynchronousLoading
l
- Listener to remove.