Package com.day.cq.dam.commons.watermark
Class TextWatermark
- java.lang.Object
-
- com.day.cq.dam.commons.watermark.Watermark
-
- com.day.cq.dam.commons.watermark.ImageWatermark
-
- com.day.cq.dam.commons.watermark.TextWatermark
-
public class TextWatermark extends ImageWatermark
ATextWatermark
represents a string of text to be used to watermark an underlying image.
While actually applying the watermark effect, the styled text is converted to an image so that the effect is uniform.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COPYRIGHT
-
Fields inherited from class com.day.cq.dam.commons.watermark.Watermark
DEFAULT_LOCATION, DEFAULT_OPACITY, DEFAULT_ORIENTATION
-
-
Constructor Summary
Constructors Constructor Description TextWatermark(int top, int left, double orientation, float opacity, java.lang.String text, Font font)
TextWatermark(int top, int left, java.lang.String text, Font font)
TextWatermark(Location position, double orientation, float opacity, java.lang.String text, Font font)
TextWatermark(Location position, java.lang.String text, Font font)
TextWatermark(java.lang.String text)
TextWatermark(java.lang.String text, Font font)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Font
getFont()
java.awt.image.BufferedImage
getImage()
Generates a transparent image representing the text of this watermark.java.lang.String
getText()
boolean
isVertical()
void
setFont(Font font)
void
setText(java.lang.String text)
void
setVertical(boolean vertical)
java.lang.String
toString()
-
Methods inherited from class com.day.cq.dam.commons.watermark.ImageWatermark
setImage
-
Methods inherited from class com.day.cq.dam.commons.watermark.Watermark
getLeft, getOpacity, getOrientation, getPosition, getTop, setCoords, setLeft, setOpacity, setOrientation, setPosition, setTop
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TextWatermark
public TextWatermark(java.lang.String text)
-
TextWatermark
public TextWatermark(java.lang.String text, Font font)
-
TextWatermark
public TextWatermark(Location position, double orientation, float opacity, java.lang.String text, Font font)
-
TextWatermark
public TextWatermark(int top, int left, double orientation, float opacity, java.lang.String text, Font font)
-
TextWatermark
public TextWatermark(int top, int left, java.lang.String text, Font font)
-
-
Method Detail
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String text)
-
getFont
public Font getFont()
-
setFont
public void setFont(Font font)
-
getImage
public java.awt.image.BufferedImage getImage()
Generates a transparent image representing the text of this watermark. Text in the image will abide by the font specifications.- Overrides:
getImage
in classImageWatermark
- Returns:
- the
BufferedImage
object thus produced
-
isVertical
public boolean isVertical()
-
setVertical
public void setVertical(boolean vertical)
-
-