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 intprotected intprotected Path2Dprotected Rectangle2DFields inherited from class com.levigo.jadice.annotation.TextAnnotation
bold, defaultText, editable, fontFace, fontSize, horizontalAlignment, italic, rotation, scaleText, strikethrough, text, textColor, underscoredFields inherited from class com.levigo.jadice.annotation.RectangleAnnotation
rect, shapeFields inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
allowResize, fillColor, filled, iconified, linePainted, lineWidth, strokeColor, strokeResolutionFields 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 voidcopyAttributesTo(Annotation annotation) intintReturns the rectangle of the textbox of thisCalloutAnnotation.voidsetArrowHeight(int arrowHeight) voidsetArrowWidth(int arrowWidth) voidsetCallout(Path2D callout) Sets the callout of this CalloutAnnotation.voidsetLocation(double x, double y) Set the location (upper-left corner) of the annotation to the given point.voidsetRectangleTextbox(Rectangle2D rectangleTextbox) Set the Rectangle of the textbox of this callout annotation.voidtranslate(double dx, double dy) Translates thisAnnotationthe 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, setUnderscoredMethods inherited from class com.levigo.jadice.annotation.RectangleAnnotation
getRectangle, getShape, setRectangle, updateMethods inherited from class com.levigo.jadice.annotation.ShapeBasedAnnotation
getFillColor, getLineWidth, getStrokeColor, getStrokeResolution, isAllowResize, isFilled, isIconified, isLinePainted, prepareSerialisation, setAllowResize, setFillColor, setFilled, setIconified, setLinePainted, setLineWidth, setStrokeColor, setStrokeResolutionMethods 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:AnnotationTranslates thisAnnotationthe indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.- Overrides:
translatein classTextAnnotation- Parameters:
dx- the distance to move thisRectanglealong the x axisdy- the distance to move thisRectanglealong the y axis
-
setLocation
public void setLocation(double x, double y) Description copied from class:ShapeBasedAnnotationSet 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:
setLocationin classTextAnnotation- Parameters:
x- X-positiony- Y-position
-
getCallout
-
clone
- Overrides:
clonein classAnnotation
-
copyAttributesTo
- Overrides:
copyAttributesToin classTextAnnotation
-
getArrowWidth
public int getArrowWidth() -
setArrowWidth
public void setArrowWidth(int arrowWidth) -
getArrowHeight
public int getArrowHeight() -
setArrowHeight
public void setArrowHeight(int arrowHeight) -
copy
- Specified by:
copyin interfacecom.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation- Overrides:
copyin classTextAnnotation
-