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

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

public class LayeredIcon
extends java.lang.Object
implements ResizableIcon

Decorator icon that layers icons one on top of the other. The original icons are drawn and resized together as one layered stack.


Field Summary
protected  ResizableIcon[] layers
          The layer icons.
 
Constructor Summary
LayeredIcon(ResizableIcon... layers)
          Creates a new layered icon.
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void setDimension(java.awt.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

layers

protected ResizableIcon[] layers
The layer icons.

Constructor Detail

LayeredIcon

public LayeredIcon(ResizableIcon... layers)
Creates a new layered icon.

Parameters:
layers - Layer icons.
Method Detail

setDimension

public void setDimension(java.awt.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.

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon