Class TextHighlightAnnotation

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

public class TextHighlightAnnotation extends ShapeBasedAnnotation
Annotation implementation to highlight / underscore / strike through text content.
See Also:
  • Field Details

    • areas

      protected List<Path2D> areas
    • underscored

      protected boolean underscored
    • strikethrough

      protected boolean strikethrough
    • highlighted

      protected boolean highlighted
  • Constructor Details

    • TextHighlightAnnotation

      public TextHighlightAnnotation()
  • Method Details

    • addArea

      public void addArea(Path2D path)
      Add Path2D object representing a rectangle (defined with 4 points) covering text content.

      Supported path operations (see PathIterator):

      • "move-to" "line-to" "line-to" "line-to"
      • "move-to" "line-to" "line-to" "line-to" "close"
      • "move-to" "line-to" "line-to" "line-to" "line-to" (last line-to must close path)
      • "move-to" "line-to" "line-to" "line-to" "line-to" "close" (last line-to must close path)
      path - Path2D object to add to area.
      IllegalArgumentException - Thrown by unsupported path definitions.
    • getAreas

      public List<Path2D> getAreas()
    • setAreas

      public void setAreas(List<Path2D> areas)
      Set List containing Path2D area definitions. Area objects will be verified, see addArea(Path2D) method description.
      areas - List containing Path2D objects
    • getShape

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

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

      public void translate(double dx, double dy)
      Not supported, annotation is not intended to be movable via GUI actions. It is possible to move the annotation via setLocation(double, double) method.
      Specified by:
      translate in class Annotation
      dx - the distance to move this Rectangle along the x axis
      dy - the distance to move this Rectangle along the y axis
    • setSize

      public void setSize(double width, double height)
      Not supported, annotation is not intended to be resizable.
      Specified by:
      setSize in class Annotation
      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.
      setLocation in class ShapeBasedAnnotation
      x - X-position
      y - Y-position
    • copy

      public TextHighlightAnnotation copy()
    • copyAttributesTo

      protected void copyAttributesTo(Annotation annotation)
      copyAttributesTo in class ShapeBasedAnnotation
    • isUnderscored

      public boolean isUnderscored()
    • setUnderscored

      public void setUnderscored(boolean underscored)
      Enable / disable underscore effect.
      underscored -
    • isStrikethrough

      public boolean isStrikethrough()
    • setStrikethrough

      public void setStrikethrough(boolean strikethrough)
      Enable / disable strike through effect.
      strikethrough -
    • isHighlighted

      public boolean isHighlighted()
    • setHighlighted

      public void setHighlighted(boolean highlighted)
      Enable / disable highlight effect.
      highlighted -
    • update

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