com.jhlabs.image

Class RenderTextFilter

Implemented Interfaces:
BufferedImageOp, Cloneable

public class RenderTextFilter
extends AbstractBufferedImageOp

A filter which renders text onto an image.

Constructor Summary

RenderTextFilter()
Construct a RenderTextFilter.
RenderTextFilter(String text, Font font, Paint paint, Composite composite, AffineTransform transform)
Construct a RenderTextFilter.

Method Summary

BufferedImage
filter(BufferedImage src, BufferedImage dst)
Composite
getComposite()
Get the composite with which to paint the text.
Font
getFont()
Get the font with which to paint the text.
Paint
getPaint()
Get the paint with which to paint the text.
String
getText()
Get the text to paint.
AffineTransform
getTransform()
Get the transform with which to paint the text.
void
setComposite(Composite composite)
Set the composite with which to paint the text.
void
setFont(Font font)
Set the font with which to paint the text.
void
setPaint(Paint paint)
Set the paint with which to paint the text.
void
setText(String text)
Set the text to paint.
void
setTransform(AffineTransform transform)
Set the transform with which to paint the text.

Methods inherited from class com.jhlabs.image.AbstractBufferedImageOp

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

Constructor Details

RenderTextFilter

public RenderTextFilter()
Construct a RenderTextFilter.

RenderTextFilter

public RenderTextFilter(String text,
                        Font font,
                        Paint paint,
                        Composite composite,
                        AffineTransform transform)
Construct a RenderTextFilter.
Parameters:
text - the text
font - the font to use (may be null)
paint - the paint (may be null)
composite - the composite (may be null)
transform - the transform (may be null)

Method Details

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)

getComposite

public Composite getComposite()
Get the composite with which to paint the text.
Returns:
the composite

getFont

public Font getFont()
Get the font with which to paint the text.
Returns:
the font

getPaint

public Paint getPaint()
Get the paint with which to paint the text.
Returns:
the paint

getText

public String getText()
Get the text to paint.
Returns:
the text

getTransform

public AffineTransform getTransform()
Get the transform with which to paint the text.
Returns:
the transform

setComposite

public void setComposite(Composite composite)
Set the composite with which to paint the text.
Parameters:
composite - the composite

setFont

public void setFont(Font font)
Set the font with which to paint the text.
Parameters:
font - the font

setPaint

public void setPaint(Paint paint)
Set the paint with which to paint the text.
Parameters:
paint - the paint

setText

public void setText(String text)
Set the text to paint.
Parameters:
text - the text

setTransform

public void setTransform(AffineTransform transform)
Set the transform with which to paint the text.
Parameters:
transform - the transform