org.pushingpixels.flamingo.api.common.icon
Class FilteredResizableIcon

java.lang.Object
  extended by org.pushingpixels.flamingo.api.common.icon.FilteredResizableIcon
All Implemented Interfaces:
Icon, ResizableIcon

public class FilteredResizableIcon
extends Object
implements ResizableIcon

Implementation of ResizableIcon that allows applying a BufferedImageOp on another icon.


Field Summary
protected  Map<String,BufferedImage> cachedImages
          Image cache to speed up rendering.
protected  ResizableIcon delegate
          The main (pre-filtered) icon.
protected  BufferedImageOp operation
          Filter operation.
 
Constructor Summary
FilteredResizableIcon(ResizableIcon delegate, BufferedImageOp operation)
          Creates a new filtered icon.
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(Component c, Graphics g, int x, int y)
           
 void setDimension(Dimension newDimension)
          Changes the dimension of this icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedImages

protected Map<String,BufferedImage> cachedImages
Image cache to speed up rendering.


delegate

protected ResizableIcon delegate
The main (pre-filtered) icon.


operation

protected BufferedImageOp operation
Filter operation.

Constructor Detail

FilteredResizableIcon

public FilteredResizableIcon(ResizableIcon delegate,
                             BufferedImageOp operation)
Creates a new filtered icon.

Parameters:
delegate - The main (pre-filtered) icon.
operation - Filter operation.
Method Detail

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

setDimension

public void setDimension(Dimension newDimension)
Description copied from interface: ResizableIcon
Changes the dimension of this icon.

Specified by:
setDimension in interface ResizableIcon
Parameters:
newDimension - New dimension for this icon.

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon