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:
javax.swing.Icon,org.pushingpixels.neon.api.AsynchronousLoading,org.pushingpixels.neon.api.icon.ResizableIcon
public class IconDeckResizableIcon<T> extends java.lang.Object implements org.pushingpixels.neon.api.icon.ResizableIcon, org.pushingpixels.neon.api.AsynchronousLoadingImplementation 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(java.util.Map<T,? extends org.pushingpixels.neon.api.icon.ResizableIcon> iconDeck)Creates the icon deck.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAsynchronousLoadListener(org.pushingpixels.neon.api.AsynchronousLoadListener l)intgetIconHeight()intgetIconWidth()booleanisLoading()voidpaintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)voidremoveAsynchronousLoadListener(org.pushingpixels.neon.api.AsynchronousLoadListener l)voidsetDimension(java.awt.Dimension dim)voidsetIcon(T key)Sets the currently shown icon.
-
-
-
Constructor Detail
-
IconDeckResizableIcon
public IconDeckResizableIcon(java.util.Map<T,? extends org.pushingpixels.neon.api.icon.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(java.awt.Dimension dim)
- Specified by:
setDimensionin interfaceorg.pushingpixels.neon.api.icon.ResizableIcon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
addAsynchronousLoadListener
public void addAsynchronousLoadListener(org.pushingpixels.neon.api.AsynchronousLoadListener l)
- Specified by:
addAsynchronousLoadListenerin interfaceorg.pushingpixels.neon.api.AsynchronousLoading
-
isLoading
public boolean isLoading()
- Specified by:
isLoadingin interfaceorg.pushingpixels.neon.api.AsynchronousLoading
-
removeAsynchronousLoadListener
public void removeAsynchronousLoadListener(org.pushingpixels.neon.api.AsynchronousLoadListener l)
- Specified by:
removeAsynchronousLoadListenerin interfaceorg.pushingpixels.neon.api.AsynchronousLoading
-
-