Class LineAnnotation

All Implemented Interfaces:
PermissionsProvider<Annotation>, PropertiesProvider, com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation, Serializable, org.jadice.util.base.MementoOriginator
Direct Known Subclasses:
ArrowAnnotation

public class LineAnnotation extends ShapeBasedAnnotation
An annotation looking like a line.

An line annotation could be used to underline or strike through something interesting of the displayed document page.

See Also:
  • Field Details

  • Constructor Details

    • LineAnnotation

      public LineAnnotation()
  • Method Details

    • isLinePainted

      public boolean isLinePainted()
      Description copied from class: ShapeBasedAnnotation
      Returns a flag if annotation border is rendered.
      Overrides:
      isLinePainted in class ShapeBasedAnnotation
      Returns:
      boolean
    • update

      public void update()
      Specified by:
      update in class ShapeBasedAnnotation
    • updateShape

      protected void updateShape(LineAnnotation previousState)
    • getPoints

      public Point2D[] getPoints()
    • setSize

      public void setSize(double width, double height)
      Description copied from class: Annotation
      Set the size of the annotation to the given size. Depending on the type of annotation, this may not be possible. E.g. stamp annotations handle the sizing on their own, so they will refuse to resize themselves. An IllegalArgumentExceptionis thrown in this case. 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.
      Specified by:
      setSize in class Annotation
      Parameters:
      width -
      height -
    • 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 ShapeBasedAnnotation
      Parameters:
      x - X-position
      y - Y-position
    • copy

      public LineAnnotation copy()
      See Also:
      • JwtAnnotation.copy()
    • copyAttributesTo

      protected void copyAttributesTo(Annotation annotation)
      Overrides:
      copyAttributesTo in class ShapeBasedAnnotation
    • setP1

      public void setP1(Point2D p)
    • setP1

      public void setP1(double x, double y)
    • setP2

      public void setP2(Point2D p)
    • setP2

      public void setP2(double x, double y)
    • getP1

      public Point2D getP1()
    • getP2

      public Point2D getP2()
    • 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.
      Specified by:
      translate in class Annotation
      Parameters:
      dx - the distance to move this Rectangle along the x axis
      dy - the distance to move this Rectangle along the y axis
    • getShape

      public Polygon getShape()
      Description copied from class: ShapeBasedAnnotation
      Shape for render structure
      Specified by:
      getShape in class ShapeBasedAnnotation
      Returns:
      Shape
    • getBounds

      public Rectangle2D getBounds()
      Description copied from class: ShapeBasedAnnotation
      Returns an integer Rectanglethat completely encloses the annotation.
      Specified by:
      getBounds in class ShapeBasedAnnotation
      Returns:
      Rectangle annotation bounding box