Class ImageBackedFilterableRadianceIcon
java.lang.Object
org.pushingpixels.radiance.common.api.icon.ImageBackedFilterableRadianceIcon
- All Implemented Interfaces:
Icon
,AsynchronousLoading
,RadianceIcon
public class ImageBackedFilterableRadianceIcon
extends Object
implements RadianceIcon, AsynchronousLoading
Implementation of the
RadianceIcon
interface that supports color filtering of content
by drawing it into offscreen images and applying the requested
RadianceIcon.ColorFilter
. Note that this is a heavy
operation that consumes additional memory resources. If your original icon returns
true
from its RadianceIcon.supportsColorFilter()
, do not use this class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Nested classes/interfaces inherited from interface org.pushingpixels.radiance.common.api.icon.RadianceIcon
RadianceIcon.ColorFilter, RadianceIcon.Factory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RadianceIcon.ColorFilter
private BufferedImage
private RadianceIcon
private int
private EventListenerList
private RadianceIcon.Factory
private int
-
Constructor Summary
ConstructorsConstructorDescriptionImageBackedFilterableRadianceIcon
(RadianceIcon.Factory sourceFactory, RadianceIcon.ColorFilter colorFilter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds listener on the asynchronous loading events.int
int
boolean
Returns indication whether the content is still loading.private void
void
void
Removes listener on the asynchronous loading events.void
setColorFilter
(RadianceIcon.ColorFilter colorFilter) void
setDimension
(Dimension newDimension) Changes the dimension ofthis
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
-
sourceFactory
-
width
private int width -
height
private int height -
currDelegate
-
listenerList
-
colorFilter
-
currColorized
-
-
Constructor Details
-
ImageBackedFilterableRadianceIcon
public ImageBackedFilterableRadianceIcon(RadianceIcon.Factory sourceFactory, RadianceIcon.ColorFilter colorFilter)
-
-
Method Details
-
setDimension
Description copied from interface:RadianceIcon
Changes the dimension ofthis
icon.- Specified by:
setDimension
in interfaceRadianceIcon
- Parameters:
newDimension
- New dimension forthis
icon.
-
supportsColorFilter
public boolean supportsColorFilter()- Specified by:
supportsColorFilter
in interfaceRadianceIcon
-
setColorFilter
- Specified by:
setColorFilter
in interfaceRadianceIcon
-
makeColorized
private void makeColorized() -
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeight
in interfaceIcon
-
addAsynchronousLoadListener
Description copied from interface:AsynchronousLoading
Adds listener on the asynchronous loading events.- Specified by:
addAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to add.
-
removeAsynchronousLoadListener
Description copied from interface:AsynchronousLoading
Removes listener on the asynchronous loading events.- Specified by:
removeAsynchronousLoadListener
in interfaceAsynchronousLoading
- Parameters:
l
- Listener to remove.
-
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.
-