Class ImageBackedFilterableRadianceIcon
- java.lang.Object
-
- org.pushingpixels.radiance.common.api.icon.ImageBackedFilterableRadianceIcon
-
- All Implemented Interfaces:
javax.swing.Icon,AsynchronousLoading,RadianceIcon
public class ImageBackedFilterableRadianceIcon extends java.lang.Object implements RadianceIcon, AsynchronousLoading
Implementation of theRadianceIconinterface that supports color filtering of content by drawing it into offscreen images and applying the requestedRadianceIcon.ColorFilter. Note that this is a heavy operation that consumes additional memory resources. If your original icon returnstruefrom itsRadianceIcon.supportsColorFilter(), do not use this class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.pushingpixels.radiance.common.api.icon.RadianceIcon
RadianceIcon.ColorFilter, RadianceIcon.Factory
-
-
Constructor Summary
Constructors Constructor Description ImageBackedFilterableRadianceIcon(RadianceIcon.Factory sourceFactory, RadianceIcon.ColorFilter colorFilter)
-
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(java.awt.Component c, java.awt.Graphics g, int x, int y)voidremoveAsynchronousLoadListener(AsynchronousLoadListener l)Removes listener on the asynchronous loading events.voidsetColorFilter(RadianceIcon.ColorFilter colorFilter)voidsetDimension(java.awt.Dimension newDimension)Changes the dimension ofthisicon.booleansupportsColorFilter()-
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
-
-
-
-
Constructor Detail
-
ImageBackedFilterableRadianceIcon
public ImageBackedFilterableRadianceIcon(RadianceIcon.Factory sourceFactory, RadianceIcon.ColorFilter colorFilter)
-
-
Method Detail
-
setDimension
public void setDimension(java.awt.Dimension newDimension)
Description copied from interface:RadianceIconChanges the dimension ofthisicon.- Specified by:
setDimensionin interfaceRadianceIcon- Parameters:
newDimension- New dimension forthisicon.
-
supportsColorFilter
public boolean supportsColorFilter()
- Specified by:
supportsColorFilterin interfaceRadianceIcon
-
setColorFilter
public void setColorFilter(RadianceIcon.ColorFilter colorFilter)
- Specified by:
setColorFilterin interfaceRadianceIcon
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)- Specified by:
paintIconin interfacejavax.swing.Icon
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfacejavax.swing.Icon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfacejavax.swing.Icon
-
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.
-
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.
-
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.
-
-