Class CalloutAnnotations
java.lang.Object
com.levigo.jadice.web.client.internal.annotation.wrangler.callout.CalloutAnnotations
Common utility methods for working with
CalloutAnnotations.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidautoMoveTextBox(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 GeneralPathcreateCallout(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 Line2DgetAnchorLine(CalloutAnnotation annotation) Returns a line connecting the anchor point with the knee point.static Point2DgetAnchorPoint(CalloutAnnotation annotation) Returns the anchor point of the callout line (anchor to textbox).static Point2DgetClosestAnchorSnapPoint(CalloutAnnotation annotation, Point2D point) Returns the closest anchor snap point for the given point.static Line2DgetHeadLine(CalloutAnnotation annotation) Returns a line connecting the head point with the knee point.static Point2DgetHeadPoint(CalloutAnnotation annotation) Returns the head point of the callout line (arrow position).static Point2DgetKneePoint(CalloutAnnotation annotation) Returns the knee point of the callout line (middle point of the line).static voidpageClampPoint(PageView pageView, Page page, Point2D p) Makes sure that the given point is inside the page rectanglestatic voidupdateAnchorPoint(CalloutAnnotation annotation, Point2D anchorPoint) Updates the callout anchor point of the given annotation.static voidupdateAnnotationBounds(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 voidupdateHeadPoint(CalloutAnnotation annotation, Point2D headPoint) Updates the callout head point of the given annotation.static voidupdateKneePoint(CalloutAnnotation annotation, Point2D kneePoint) Updates the callout knee point of the given annotation.static voidvalidateAnchorPoint(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- theCalloutAnnotationanchorPoint- the anchor point
-
updateKneePoint
Updates the callout knee point of the given annotation. Annotation bounds will be recalculated.- Parameters:
annotation- theCalloutAnnotationkneePoint- the knee point
-
updateHeadPoint
Updates the callout head point of the given annotation. Annotation bounds will be recalculated.- Parameters:
annotation- theCalloutAnnotationheadPoint- 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- theCalloutAnnotationpageView- the page viewmoveToCenterPoint- the point to move to (center point of the textbox as the auto-move Handle is at center)
-