public class StampAnnotation extends TextAnnotation
An stamp annotation could be used to set an entrance day stamp on a interesting part of the displayed document page. For this purpose it can be rotated, changed its appearance color and text style.
bold, defaultText, editable, fontFace, fontSize, horizontalAlignment, italic, rotation, scaleText, strikethrough, text, textColor, underscored
shape
allowResize, fillColor, filled, iconified, linePainted, lineWidth, strokeColor, strokeResolution
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy
Constructor and Description |
---|
StampAnnotation() |
Modifier and Type | Method and Description |
---|---|
StampAnnotation |
clone() |
protected void |
copyAttributesTo(Annotation annotation)
Copy annotation type related attributes to new annotation.
|
int |
getGap()
Returns the insets width of stamp border and displayed text
|
int |
getLineCount(String text) |
RectangularShape |
getShape()
Shape for render structure
|
boolean |
isAllowMultipleTextlines() |
boolean |
isAllowRotation()
Deprecated.
Property function will be moved to wrangler class (boolean property
showRotationHandle) and removed in the next major release.
|
boolean |
isIgnoreLineWidth() |
boolean |
isUseCenterAsOrigin() |
void |
setAllowMultipleTextlines(boolean allowMultipleTextlines) |
void |
setAllowRotation(boolean allowRotation)
Deprecated.
Property function will be moved to wrangler class (boolean property
showRotationHandle) and removed in the next major release.
|
void |
setBold(boolean fontStyleBold) |
void |
setFontFace(String fontFace)
Sets the logical name of the font to display.
|
void |
setFontSize(float fontSize)
Sets the font size of the displayed text.
|
void |
setGap(int gap)
Returns the insets gap width of stamp border and displayed text
|
void |
setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
Sets the alignment of the text within the annotation.
|
void |
setIgnoreLineWidth(boolean ignoreLineWidth)
Flag to ignore line width for annotation size update.
|
void |
setItalic(boolean fontStyleItalic) |
void |
setLineWidth(float newValue)
Sets the border line width of this annotation.
|
void |
setLocation(double x,
double y)
Set the location (upper-left corner) of the annotation to the given point.
|
void |
setRotation(int rotation)
Sets the rotation.
|
void |
setSize(double width,
double height)
Set the size of the annotation to the given size.
|
void |
setText(String text)
Sets the display text of this annotation.
|
void |
setUseCenterAsOrigin(boolean useCenterAsOrigin) |
getBounds, getDefaultText, getFontFace, getFontSize, getHorizontalAlignment, getMaxCharacters, getPathIterator, getRotation, getText, getTextColor, isBold, isEditable, isItalic, isScaleText, isStrikethrough, isUnderscored, setDefaultText, setEditable, setMaxCharacters, setScaleText, setStrikethrough, setTextColor, setUnderscored, translate
getRectangle, setRectangle
createColorWithAlpha, getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setStrokeColor, setStrokeResolution
clearModified, createMemento, fireAnnotationChange, getChangeHandler, getCreatedAt, getCreatedBy, getID, getInitializer, getLastModifiedAt, getLastModifiedBy, getModCount, getPermissions, getProperties, getType, initialize, isDoFireAnnotationEvents, isInitialized, isLoadedAnnotation, isModified, restoreFrom, setChangeHandler, setCreatedBy, setCreationTimestamp, setDoFireAnnotationEvents, setID, setInitializer, setLastModifiedBy, setModified, setModifyTimestamp, setType
public boolean isUseCenterAsOrigin()
public void setUseCenterAsOrigin(boolean useCenterAsOrigin)
public boolean isAllowRotation()
public void setAllowRotation(boolean allowRotation)
public void setText(String text)
TextAnnotation
null
or empty a
default text will be set.setText
in class TextAnnotation
TextAnnotation.setText(java.lang.String)
public int getGap()
public void setGap(int gap)
gap
- gap between border and textpublic void setRotation(int rotation)
setRotation
in class TextAnnotation
rotation
- The rotation to setpublic int getLineCount(String text)
public void setFontSize(float fontSize)
TextAnnotation
setFontSize
in class TextAnnotation
fontSize
- The fontSize to setpublic void setSize(double width, double height)
Annotation
IllegalArgumentException
is thrown in this case.
Caveat: it is currently necessary, to force a repaint on the viewer
in order to make the results of the modification visible. Moreover there
are no modification events fired on the page and document. This will change
in the future.setSize
in class TextAnnotation
public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
TextAnnotation
HorizontalAlignment
setHorizontalAlignment
in class TextAnnotation
horizontalAlignment
- The alignment for the text.public void setLocation(double x, double y)
ShapeBasedAnnotation
setLocation
in class RectangleAnnotation
x
- X-positiony
- Y-positionpublic StampAnnotation clone()
clone
in class TextAnnotation
Object.clone()
protected void copyAttributesTo(Annotation annotation)
Annotation
copyAttributesTo
in class TextAnnotation
annotation
- Annotation to set attributespublic boolean isAllowMultipleTextlines()
public void setAllowMultipleTextlines(boolean allowMultipleTextlines)
public RectangularShape getShape()
ShapeBasedAnnotation
getShape
in class RectangleAnnotation
public void setFontFace(String fontFace)
TextAnnotation
setFontFace
in class TextAnnotation
fontFace
- The fontFace to setpublic void setItalic(boolean fontStyleItalic)
setItalic
in class TextAnnotation
public void setBold(boolean fontStyleBold)
setBold
in class TextAnnotation
public void setLineWidth(float newValue)
ShapeBasedAnnotation
Notice, if this annotation has disabled the line painted attribute
setLineWidth
in class ShapeBasedAnnotation
newValue
- the new line widthand
,
the border line will not be rendered.
public boolean isIgnoreLineWidth()
public void setIgnoreLineWidth(boolean ignoreLineWidth)
Copyright © 2024 levigo holding gmbh. All rights reserved.