public class CalloutAnnotation extends TextAnnotation
At the moment, the arrow head is always an "open arrow". Its size can be defined via the "arrow width" and "arrow height" parameters.
Modifier and Type | Field and Description |
---|---|
protected int |
arrowHeight |
protected int |
arrowWidth |
protected Path2D |
callout |
protected Rectangle2D |
rectangleTextbox |
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 |
---|
CalloutAnnotation() |
Modifier and Type | Method and Description |
---|---|
CalloutAnnotation |
clone() |
protected void |
copyAttributesTo(Annotation annotation)
Copy annotation type related attributes to new annotation.
|
int |
getArrowHeight() |
int |
getArrowWidth() |
Path2D |
getCallout() |
Rectangle2D |
getRectangleTextbox()
Returns the rectangle of the textbox of this
CalloutAnnotation . |
void |
setArrowHeight(int arrowHeight) |
void |
setArrowWidth(int arrowWidth) |
void |
setCallout(Path2D callout)
Sets the callout of this CalloutAnnotation.
|
void |
setLocation(double x,
double y)
Set the location (upper-left corner) of the annotation to the given point.
|
void |
setRectangleTextbox(Rectangle2D rectangleTextbox)
Set the Rectangle of the textbox of this callout annotation.
|
void |
setRotation(int rotation)
Rotation is not supported.
|
void |
setSize(double width,
double height)
Set the size of the annotation to the given size.
|
void |
translate(double dx,
double dy)
Translates this
Annotation the indicated distance, to the right along the x
coordinate axis, and downward along the y coordinate axis. |
getBounds, getDefaultText, getFontFace, getFontSize, getHorizontalAlignment, getMaxCharacters, getPathIterator, getRotation, getText, getTextColor, isBold, isEditable, isItalic, isScaleText, isStrikethrough, isUnderscored, setBold, setDefaultText, setEditable, setFontFace, setFontSize, setHorizontalAlignment, setItalic, setMaxCharacters, setScaleText, setStrikethrough, setText, setTextColor, setUnderscored
getRectangle, getShape, setRectangle
createColorWithAlpha, getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, 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
protected Rectangle2D rectangleTextbox
protected Path2D callout
protected int arrowWidth
protected int arrowHeight
public void setRectangleTextbox(Rectangle2D rectangleTextbox)
rectangleTextbox
- the rectangle of the textboxpublic Rectangle2D getRectangleTextbox()
CalloutAnnotation
.public void setCallout(Path2D callout)
callout
- the new calloutIllegalArgumentException
- if the callout does not consist of exactly 3 pointspublic void translate(double dx, double dy)
Annotation
Annotation
the indicated distance, to the right along the x
coordinate axis, and downward along the y coordinate axis.translate
in class TextAnnotation
dx
- the distance to move this Rectangle
along the x axisdy
- the distance to move this Rectangle
along the y axispublic Path2D getCallout()
public CalloutAnnotation clone()
clone
in class TextAnnotation
Object.clone()
protected void copyAttributesTo(Annotation annotation)
Annotation
copyAttributesTo
in class TextAnnotation
annotation
- Annotation to set attributespublic int getArrowWidth()
public void setArrowWidth(int arrowWidth)
public int getArrowHeight()
public void setArrowHeight(int arrowHeight)
public void setLocation(double x, double y)
ShapeBasedAnnotation
setLocation
in class RectangleAnnotation
x
- X-positiony
- Y-positionpublic 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 setRotation(int rotation)
setRotation
in class TextAnnotation
Copyright © 2024 levigo holding gmbh. All rights reserved.