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
Implementation of the
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 Summary
ConstructorsConstructorDescriptionIconDeckResizableIcon
(Map<T, ? extends ResizableIcon> iconDeck) Creates the icon deck. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds listener on the asynchronous loading events.int
int
boolean
Returns indication whether the content is still loading.void
void
Removes listener on the asynchronous loading events.void
setDimension
(Dimension dim) Changes the dimension ofthis
icon.void
Sets the currently shown icon.
-
Constructor Details
-
IconDeckResizableIcon
Creates the icon deck.- Parameters:
iconDeck
- Icon deck.
-
-
Method Details
-
setIcon
Sets the currently shown icon.- Parameters:
key
- Icon key.
-
setDimension
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
-
paintIcon
-
addAsynchronousLoadListener
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
Description copied from interface:AsynchronousLoading
Removes listener on the asynchronous loading events.- Specified by:
removeAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to remove.
-