com.alee.graphics.filters
Class ShadowFilter

java.lang.Object
  extended by com.alee.graphics.filters.AbstractBufferedImageOp
      extended by com.alee.graphics.filters.ShadowFilter
All Implemented Interfaces:
java.awt.image.BufferedImageOp

public class ShadowFilter
extends AbstractBufferedImageOp

A filter which draws a drop shadow based on the alpha channel of the image.


Constructor Summary
ShadowFilter()
           
ShadowFilter(int radius, int xOffset, int yOffset, float opacity)
           
 
Method Summary
 java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
           
 boolean getAddMargins()
           
 float getOpacity()
           
 int getRadius()
          Get the radius of the kernel.
 int getShadowColor()
           
 boolean getShadowOnly()
           
 int getXOffset()
           
 int getYOffset()
           
 void setAddMargins(boolean addMargins)
           
 void setOpacity(float opacity)
           
 void setRadius(int radius)
          Set the radius of the kernel, and hence the amount of blur.
 void setShadowColor(int shadowColor)
           
 void setShadowOnly(boolean shadowOnly)
           
 void setXOffset(int xOffset)
           
 void setYOffset(int yOffset)
           
protected  void transformSpace(java.awt.Rectangle r)
           
 
Methods inherited from class com.alee.graphics.filters.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowFilter

public ShadowFilter()

ShadowFilter

public ShadowFilter(int radius,
                    int xOffset,
                    int yOffset,
                    float opacity)
Method Detail

setXOffset

public void setXOffset(int xOffset)

getXOffset

public int getXOffset()

setYOffset

public void setYOffset(int yOffset)

getYOffset

public int getYOffset()

setRadius

public void setRadius(int radius)
Set the radius of the kernel, and hence the amount of blur. The bigger the radius, the longer this filter will take.

Parameters:
radius - the radius of the blur in pixels.

getRadius

public int getRadius()
Get the radius of the kernel.

Returns:
the radius

setOpacity

public void setOpacity(float opacity)

getOpacity

public float getOpacity()

setShadowColor

public void setShadowColor(int shadowColor)

getShadowColor

public int getShadowColor()

setAddMargins

public void setAddMargins(boolean addMargins)

getAddMargins

public boolean getAddMargins()

setShadowOnly

public void setShadowOnly(boolean shadowOnly)

getShadowOnly

public boolean getShadowOnly()

transformSpace

protected void transformSpace(java.awt.Rectangle r)

filter

public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src,
                                           java.awt.image.BufferedImage dst)