Package com.levigo.jadice.annotation
Class CalloutAnnotation
java.lang.Object
com.levigo.jadice.annotation.Annotation
com.levigo.jadice.annotation.ShapeBasedAnnotation
com.levigo.jadice.annotation.RectangleAnnotation
com.levigo.jadice.annotation.TextAnnotation
com.levigo.jadice.annotation.CalloutAnnotation
- All Implemented Interfaces:
PermissionsProvider<Annotation>
,PropertiesProvider
,com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
,Serializable
,org.jadice.util.base.MementoOriginator
A sub type of a TextAnnotation which has a text box and a callout arrow line which points to a
specific point in the document.
At the moment, the arrow head is always an "open arrow". Its size can be defined via the "arrow width" and "arrow height" parameters.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected int
protected Path2D
protected Rectangle2D
Fields inherited from class com.levigo.jadice.annotation.TextAnnotation
bold, defaultText, editable, fontFace, fontSize, horizontalAlignment, italic, rotation, scaleText, strikethrough, text, textColor, underscored
Fields inherited from class com.levigo.jadice.annotation.RectangleAnnotation
rect, shape
Fields inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
allowResize, fillColor, filled, iconified, linePainted, lineWidth, strokeColor, strokeResolution
Fields inherited from class com.levigo.jadice.annotation.Annotation
createdAt, createdBy, doFireAnnotationEvents, id, initializer, isModified, lastModifiedAt, lastModifiedBy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
copy()
protected void
copyAttributesTo
(Annotation annotation) int
int
Returns the rectangle of the textbox of thisCalloutAnnotation
.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
translate
(double dx, double dy) Translates thisAnnotation
the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.Methods inherited from class com.levigo.jadice.annotation.TextAnnotation
getBounds, getDefaultText, getFontFace, getFontSize, getHorizontalAlignment, getMaxCharacters, getPathIterator, getRotation, getText, getTextColor, isBold, isEditable, isItalic, isScaleText, isStrikethrough, isUnderscored, setBold, setDefaultText, setEditable, setFontFace, setFontSize, setHorizontalAlignment, setItalic, setMaxCharacters, setRotation, setScaleText, setSize, setStrikethrough, setText, setTextColor, setUnderscored
Methods inherited from class com.levigo.jadice.annotation.RectangleAnnotation
getRectangle, getShape, setRectangle, update
Methods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, prepareSerialisation, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, setStrokeColor, setStrokeResolution
Methods inherited from class com.levigo.jadice.annotation.Annotation
clearModified, createMemento, fireAnnotationChange, getChangeHandler, getCreatedAt, getCreatedBy, getID, getInitializer, getLastModifiedAt, getLastModifiedBy, getModCount, getPermissions, getProfileId, getProperties, getType, getTypeName, initialize, isDoFireAnnotationEvents, isInitialized, isModified, restoreFrom, setChangeHandler, setCreatedBy, setCreationTimestamp, setDoFireAnnotationEvents, setID, setInitializer, setLastModifiedBy, setModified, setModifyTimestamp, setProfileId, setType, setTypeName
-
Field Details
-
rectangleTextbox
-
callout
-
arrowWidth
protected int arrowWidth -
arrowHeight
protected int arrowHeight
-
-
Constructor Details
-
CalloutAnnotation
public CalloutAnnotation()
-
-
Method Details
-
setRectangleTextbox
Set the Rectangle of the textbox of this callout annotation.- Parameters:
rectangleTextbox
- the rectangle of the textbox
-
getRectangleTextbox
Returns the rectangle of the textbox of thisCalloutAnnotation
.- Returns:
- the textbox rectangle
-
setCallout
Sets the callout of this CalloutAnnotation. The callout is the arrow line with the following components (points):- Head-Point of the arrow
- Knee-Point of the arrow
- Anchor-Point of the arrow, anchoring it at the textbox
- Parameters:
callout
- the new callout- Throws:
IllegalArgumentException
- if the callout does not consist of exactly 3 points
-
translate
public void translate(double dx, double dy) Description copied from class:Annotation
Translates thisAnnotation
the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.- Overrides:
translate
in classTextAnnotation
- Parameters:
dx
- the distance to move thisRectangle
along the x axisdy
- the distance to move thisRectangle
along the y axis
-
setLocation
public void setLocation(double x, double y) Description copied from class:ShapeBasedAnnotation
Set the location (upper-left corner) of the annotation to the given point. 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.- Overrides:
setLocation
in classTextAnnotation
- Parameters:
x
- X-positiony
- Y-position
-
getCallout
-
clone
- Overrides:
clone
in classAnnotation
-
copyAttributesTo
- Overrides:
copyAttributesTo
in classTextAnnotation
-
getArrowWidth
public int getArrowWidth() -
setArrowWidth
public void setArrowWidth(int arrowWidth) -
getArrowHeight
public int getArrowHeight() -
setArrowHeight
public void setArrowHeight(int arrowHeight) -
copy
- Specified by:
copy
in interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
- Overrides:
copy
in classTextAnnotation
-