Class IconDeckRadianceIcon<T>
java.lang.Object
org.pushingpixels.radiance.component.api.common.icon.IconDeckRadianceIcon<T>
- Type Parameters:
T
- enumeration key into the deck
- All Implemented Interfaces:
Icon
,AsynchronousLoading
,RadianceIcon
Implementation of the
RadianceIcon
that allows switching the icon
painting at runtime. This class can be used as a delegate in the
DecoratedRadianceIcon
where the "base" icon is changed at runtime
without the need to recompute all the decorators.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.pushingpixels.radiance.common.api.icon.RadianceIcon
RadianceIcon.ColorFilter, RadianceIcon.Factory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RadianceIcon
Currently shown icon.private final Map
<T, ? extends RadianceIcon> The icon deck. -
Constructor Summary
ConstructorsConstructorDescriptionIconDeckRadianceIcon
(Map<T, ? extends RadianceIcon> 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
setColorFilter
(RadianceIcon.ColorFilter colorFilter) void
setDimension
(Dimension dim) Changes the dimension ofthis
icon.void
Sets the currently shown icon.boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.pushingpixels.radiance.common.api.icon.RadianceIcon
toImage
-
Field Details
-
currentIcon
Currently shown icon. -
iconDeck
The icon deck.
-
-
Constructor Details
-
IconDeckRadianceIcon
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:RadianceIcon
Changes the dimension ofthis
icon.- Specified by:
setDimension
in interfaceRadianceIcon
- Parameters:
dim
- New dimension forthis
icon.
-
supportsColorFilter
public boolean supportsColorFilter()- Specified by:
supportsColorFilter
in interfaceRadianceIcon
-
setColorFilter
- Specified by:
setColorFilter
in interfaceRadianceIcon
-
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.
-