Class CalloutAnnotations
java.lang.Object
com.levigo.jadice.web.client.internal.annotation.wrangler.callout.CalloutAnnotations
Common utility methods for working with
CalloutAnnotation
s.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
autoMoveTextBox
(CalloutAnnotation annotation, PageView pageView, Point2D moveToCenterPoint) Performs the automatic move, meaning the textbox can be moved, but the arrow head remains at the same location.static GeneralPath
createCallout
(Point2D[] line) Creates a new callout for the given array of points.createPossibleAnchorSnapPoints
(CalloutAnnotation annotation) Returns a list of the possible anchor snap points.static Line2D
getAnchorLine
(CalloutAnnotation annotation) Returns a line connecting the anchor point with the knee point.static Point2D
getAnchorPoint
(CalloutAnnotation annotation) Returns the anchor point of the callout line (anchor to textbox).static Point2D
getClosestAnchorSnapPoint
(CalloutAnnotation annotation, Point2D point) Returns the closest anchor snap point for the given point.static Line2D
getHeadLine
(CalloutAnnotation annotation) Returns a line connecting the head point with the knee point.static Point2D
getHeadPoint
(CalloutAnnotation annotation) Returns the head point of the callout line (arrow position).static Point2D
getKneePoint
(CalloutAnnotation annotation) Returns the knee point of the callout line (middle point of the line).static void
pageClampPoint
(PageView pageView, Page page, Point2D p) Makes sure that the given point is inside the page rectanglestatic void
updateAnchorPoint
(CalloutAnnotation annotation, Point2D anchorPoint) Updates the callout anchor point of the given annotation.static void
updateAnnotationBounds
(CalloutAnnotation annotation) After modifying the textbox rectangle or the callout, this method can be used to update the annotation full rectangle to the actual value.static void
updateHeadPoint
(CalloutAnnotation annotation, Point2D headPoint) Updates the callout head point of the given annotation.static void
updateKneePoint
(CalloutAnnotation annotation, Point2D kneePoint) Updates the callout knee point of the given annotation.static void
validateAnchorPoint
(CalloutAnnotation annotation) Checks if the anchor point is still correct (it might be necessary to update it if the textbox was moved/resized for example).
-
Field Details
-
DEFAULT_CALLOUT_POINT_COUNT
public static final int DEFAULT_CALLOUT_POINT_COUNT- See Also:
-
-
Method Details
-
getHeadPoint
Returns the head point of the callout line (arrow position).- Parameters:
annotation
- theCalloutAnnotation
- Returns:
- the head point (document coordinates in JadiceDocumentUnits)
-
getKneePoint
Returns the knee point of the callout line (middle point of the line).- Parameters:
annotation
- theCalloutAnnotation
- Returns:
- the knee point (document coordinates in JadiceDocumentUnits)
-
getAnchorPoint
Returns the anchor point of the callout line (anchor to textbox).- Parameters:
annotation
- theCalloutAnnotation
- Returns:
- the anchor point (document coordinates in JadiceDocumentUnits)
-
getHeadLine
Returns a line connecting the head point with the knee point.- Parameters:
annotation
- theCalloutAnnotation
- Returns:
- the head line
-
getAnchorLine
Returns a line connecting the anchor point with the knee point.- Parameters:
annotation
- theCalloutAnnotation
- Returns:
- the anchor line
-
createCallout
Creates a new callout for the given array of points.- Parameters:
line
- the point array- Returns:
- the callout path
-
createPossibleAnchorSnapPoints
Returns a list of the possible anchor snap points.- Parameters:
annotation
- theCalloutAnnotation
- Returns:
- the list of possible anchor snap points
-
getClosestAnchorSnapPoint
Returns the closest anchor snap point for the given point.- Parameters:
annotation
- the annotationpoint
- the point- Returns:
- the closest anchor snap point
-
updateAnchorPoint
Updates the callout anchor point of the given annotation. Annotation bounds will be recalculated.- Parameters:
annotation
- theCalloutAnnotation
anchorPoint
- the anchor point
-
updateKneePoint
Updates the callout knee point of the given annotation. Annotation bounds will be recalculated.- Parameters:
annotation
- theCalloutAnnotation
kneePoint
- the knee point
-
updateHeadPoint
Updates the callout head point of the given annotation. Annotation bounds will be recalculated.- Parameters:
annotation
- theCalloutAnnotation
headPoint
- the head point
-
updateAnnotationBounds
After modifying the textbox rectangle or the callout, this method can be used to update the annotation full rectangle to the actual value.- Parameters:
annotation
- theCalloutAnnotation
-
pageClampPoint
Makes sure that the given point is inside the page rectangle- Parameters:
pageView
- the pageViewpage
- the pagep
- the point to clamp into the page bounds
-
validateAnchorPoint
Checks if the anchor point is still correct (it might be necessary to update it if the textbox was moved/resized for example).- Parameters:
annotation
- theCalloutAnnotation
-
autoMoveTextBox
public static void autoMoveTextBox(CalloutAnnotation annotation, PageView pageView, Point2D moveToCenterPoint) Performs the automatic move, meaning the textbox can be moved, but the arrow head remains at the same location.- Parameters:
annotation
- theCalloutAnnotation
pageView
- the page viewmoveToCenterPoint
- the point to move to (center point of the textbox as the auto-move Handle is at center)
-