com.jhlabs.image

Class BorderFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class BorderFilter
extends AbstractBufferedImageOp

A filter to add a border around an image using the supplied Paint, which may be null for no painting.

Constructor Summary

BorderFilter()
Construct a BorderFilter which does nothing.
BorderFilter(int leftBorder, int topBorder, int rightBorder, int bottomBorder, Paint borderPaint)
Construct a BorderFilter.

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
Paint
getBorderPaint()
Get the border paint.
int
getBottomBorder()
Returns the border border value.
int
getLeftBorder()
Returns the left border value.
int
getRightBorder()
Returns the right border value.
int
getTopBorder()
Returns the top border value.
void
setBorderPaint(Paint borderPaint)
Set the border paint.
void
setBottomBorder(int bottomBorder)
Set the border size on the bottom edge.
void
setLeftBorder(int leftBorder)
Set the border size on the left edge.
void
setRightBorder(int rightBorder)
Set the border size on the right edge.
void
setTopBorder(int topBorder)
Set the border size on the top edge.
String
toString()

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRGB, getRenderingHints, setRGB

Constructor Details

BorderFilter

public BorderFilter()
Construct a BorderFilter which does nothing.

BorderFilter

public BorderFilter(int leftBorder,
                    int topBorder,
                    int rightBorder,
                    int bottomBorder,
                    Paint borderPaint)
Construct a BorderFilter.
Parameters:
leftBorder - the left border value
topBorder - the top border value
rightBorder - the right border value
bottomBorder - the bottom border value
borderPaint - the paint with which to fill the border

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getBorderPaint

public Paint getBorderPaint()
Get the border paint.
Returns:
the paint with which to fill the border

getBottomBorder

public int getBottomBorder()
Returns the border border value.
Returns:
the border border value.

getLeftBorder

public int getLeftBorder()
Returns the left border value.
Returns:
the left border value.

getRightBorder

public int getRightBorder()
Returns the right border value.
Returns:
the right border value.

getTopBorder

public int getTopBorder()
Returns the top border value.
Returns:
the top border value.

setBorderPaint

public void setBorderPaint(Paint borderPaint)
Set the border paint.
Parameters:
borderPaint - the paint with which to fill the border

setBottomBorder

public void setBottomBorder(int bottomBorder)
Set the border size on the bottom edge.
Parameters:
bottomBorder - the number of pixels of border to add to the edge

setLeftBorder

public void setLeftBorder(int leftBorder)
Set the border size on the left edge.
Parameters:
leftBorder - the number of pixels of border to add to the edge

setRightBorder

public void setRightBorder(int rightBorder)
Set the border size on the right edge.
Parameters:
rightBorder - the number of pixels of border to add to the edge

setTopBorder

public void setTopBorder(int topBorder)
Set the border size on the top edge.
Parameters:
topBorder - the number of pixels of border to add to the edge

toString

public String toString()