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 theResizableIconthat allows switching the icon painting at runtime. This class can be used as a delegate in theDecoratedResizableIconwhere 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 voidaddAsynchronousLoadListener(AsynchronousLoadListener l)Adds listener on the asynchronous loading events.intgetIconHeight()intgetIconWidth()booleanisLoading()Returns indication whether the content is still loading.voidpaintIcon(Component c, Graphics g, int x, int y)voidremoveAsynchronousLoadListener(AsynchronousLoadListener l)Removes listener on the asynchronous loading events.voidsetDimension(Dimension dim)Changes the dimension ofthisicon.voidsetIcon(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:ResizableIconChanges the dimension ofthisicon.- Specified by:
setDimensionin interfaceResizableIcon- Parameters:
dim- New dimension forthisicon.
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfaceIcon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfaceIcon
-
addAsynchronousLoadListener
public void addAsynchronousLoadListener(AsynchronousLoadListener l)
Description copied from interface:AsynchronousLoadingAdds listener on the asynchronous loading events.- Specified by:
addAsynchronousLoadListenerin interfaceAsynchronousLoading- Parameters:
l- Listener to add.
-
isLoading
public boolean isLoading()
Description copied from interface:AsynchronousLoadingReturns indication whether the content is still loading.- Specified by:
isLoadingin interfaceAsynchronousLoading- Returns:
trueif the content is still loading,falseotherwise.
-
removeAsynchronousLoadListener
public void removeAsynchronousLoadListener(AsynchronousLoadListener l)
Description copied from interface:AsynchronousLoadingRemoves listener on the asynchronous loading events.- Specified by:
removeAsynchronousLoadListenerin interfaceAsynchronousLoading- Parameters:
l- Listener to remove.
-
-