Class IconDeckResizableIcon<T>
- java.lang.Object
-
- org.pushingpixels.flamingo.api.common.icon.IconDeckResizableIcon<T>
-
- Type Parameters:
T
- enumeration key into the deck
- All Implemented Interfaces:
Icon
,AsynchronousLoading
,ResizableIcon
public class IconDeckResizableIcon<T> extends Object implements ResizableIcon, AsynchronousLoading
Implementation of theResizableIcon
that allows switching the icon painting at runtime. This class can be used as a delegate in theDecoratedResizableIcon
where the "base" icon is changed at runtime without the need to recompute all the decorators.
-
-
Constructor Summary
Constructors Constructor Description IconDeckResizableIcon(Map<T,? extends ResizableIcon> iconDeck)
Creates the icon deck.
-
Method Summary
All Methods Instance Methods Concrete Methods 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(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 ofthis
icon.void
setIcon(T key)
Sets the currently shown icon.
-
-
-
Constructor Detail
-
IconDeckResizableIcon
public IconDeckResizableIcon(Map<T,? extends ResizableIcon> iconDeck)
Creates the icon deck.- Parameters:
iconDeck
- Icon deck.
-
-
Method Detail
-
setIcon
public void setIcon(T key)
Sets the currently shown icon.- Parameters:
key
- Icon key.
-
setDimension
public void setDimension(Dimension dim)
Description copied from interface:ResizableIcon
Changes the dimension ofthis
icon.- Specified by:
setDimension
in interfaceResizableIcon
- Parameters:
dim
- New dimension forthis
icon.
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interfaceIcon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interfaceIcon
-
addAsynchronousLoadListener
public void addAsynchronousLoadListener(AsynchronousLoadListener l)
Description copied from interface:AsynchronousLoading
Adds listener on the asynchronous loading events.- Specified by:
addAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to add.
-
isLoading
public boolean isLoading()
Description copied from interface:AsynchronousLoading
Returns indication whether the content is still loading.- Specified by:
isLoading
in interfaceAsynchronousLoading
- Returns:
true
if the content is still loading,false
otherwise.
-
removeAsynchronousLoadListener
public void removeAsynchronousLoadListener(AsynchronousLoadListener l)
Description copied from interface:AsynchronousLoading
Removes listener on the asynchronous loading events.- Specified by:
removeAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to remove.
-
-