Package com.jhlabs.image
Class BorderFilter
- java.lang.Object
-
- com.jhlabs.image.AbstractBufferedImageOp
-
- com.jhlabs.image.BorderFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
,java.lang.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
Constructors Constructor Description BorderFilter()
Construct a BorderFilter which does nothing.BorderFilter(int leftBorder, int topBorder, int rightBorder, int bottomBorder, java.awt.Paint borderPaint)
Construct a BorderFilter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
java.lang.String
getBorderColor()
java.awt.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
setBorderColor(java.lang.String borderColor)
void
setBorderPaint(java.awt.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.java.lang.String
toString()
-
Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB, stringToColor
-
-
-
-
Constructor Detail
-
BorderFilter
public BorderFilter()
Construct a BorderFilter which does nothing.
-
BorderFilter
public BorderFilter(int leftBorder, int topBorder, int rightBorder, int bottomBorder, java.awt.Paint borderPaint)
Construct a BorderFilter.- Parameters:
leftBorder
- the left border valuetopBorder
- the top border valuerightBorder
- the right border valuebottomBorder
- the bottom border valueborderPaint
- the paint with which to fill the border
-
-
Method Detail
-
getBorderColor
public java.lang.String getBorderColor()
-
setBorderColor
public void setBorderColor(java.lang.String borderColor)
-
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, min-value 0- See Also:
getLeftBorder()
-
getLeftBorder
public int getLeftBorder()
Returns the left border value.- Returns:
- the left border value.
- See Also:
setLeftBorder(int)
-
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, min-value 0- See Also:
getRightBorder()
-
getRightBorder
public int getRightBorder()
Returns the right border value.- Returns:
- the right border value.
- See Also:
setRightBorder(int)
-
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, min-value 0- See Also:
getTopBorder()
-
getTopBorder
public int getTopBorder()
Returns the top border value.- Returns:
- the top border value.
- See Also:
setTopBorder(int)
-
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, min-value 0- See Also:
getBottomBorder()
-
getBottomBorder
public int getBottomBorder()
Returns the border border value.- Returns:
- the border border value.
- See Also:
setBottomBorder(int)
-
setBorderPaint
public void setBorderPaint(java.awt.Paint borderPaint)
Set the border paint.- Parameters:
borderPaint
- the paint with which to fill the border- See Also:
getBorderPaint()
-
getBorderPaint
public java.awt.Paint getBorderPaint()
Get the border paint.- Returns:
- the paint with which to fill the border
- See Also:
setBorderPaint(java.awt.Paint)
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-