Class CalloutAnnotation

  • All Implemented Interfaces:
    com.google.gwt.user.client.rpc.IsSerializable, PermissionsProvider<Annotation>, PropertiesProvider, com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation, Serializable

    public class CalloutAnnotation
    extends TextAnnotation
    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:
    Serialized Form
    • Field Detail

      • rectangleTextbox

        protected Rectangle2D rectangleTextbox
      • callout

        protected Path2D callout
      • arrowWidth

        protected int arrowWidth
      • arrowHeight

        protected int arrowHeight
    • Constructor Detail

      • CalloutAnnotation

        public CalloutAnnotation()
    • Method Detail

      • setRectangleTextbox

        public void setRectangleTextbox​(Rectangle2D rectangleTextbox)
        Set the Rectangle of the textbox of this callout annotation.
        Parameters:
        rectangleTextbox - the rectangle of the textbox
      • getRectangleTextbox

        public Rectangle2D getRectangleTextbox()
        Returns the rectangle of the textbox of this CalloutAnnotation.
        Returns:
        the textbox rectangle
      • setCallout

        public void setCallout​(Path2D callout)
        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 this Annotation the indicated distance, to the right along the x coordinate axis, and downward along the y coordinate axis.
        Overrides:
        translate in class TextAnnotation
        Parameters:
        dx - the distance to move this Rectangle along the x axis
        dy - the distance to move this Rectangle 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 class TextAnnotation
        Parameters:
        x - X-position
        y - Y-position
      • getCallout

        public Path2D getCallout()
      • getArrowWidth

        public int getArrowWidth()
      • setArrowWidth

        public void setArrowWidth​(int arrowWidth)
      • getArrowHeight

        public int getArrowHeight()
      • setArrowHeight

        public void setArrowHeight​(int arrowHeight)
      • copy

        public CalloutAnnotation copy()
        Specified by:
        copy in interface com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation
        Overrides:
        copy in class TextAnnotation