Class ShapeBasedAnnotation

java.lang.Object
com.levigo.jadice.annotation.Annotation
com.levigo.jadice.annotation.ShapeBasedAnnotation
All Implemented Interfaces:
PermissionsProvider<Annotation>, PropertiesProvider, com.levigo.jadice.web.shared.model.annotation.internal.JwtAnnotation, Serializable, org.jadice.util.base.MementoOriginator
Direct Known Subclasses:
LineAnnotation, PathAnnotation, RectangleAnnotation, TextHighlightAnnotation

public abstract class ShapeBasedAnnotation extends Annotation
An abstract base class for visual shape based annotations.
See Also:
  • Field Details

    • lineWidth

      protected float lineWidth
    • linePainted

      protected boolean linePainted
    • filled

      protected boolean filled
    • allowResize

      protected boolean allowResize
      Flag, indicating whether resizing is allowed
    • fillColor

      protected Color fillColor
    • strokeColor

      protected Color strokeColor
    • iconified

      protected boolean iconified
    • strokeResolution

      protected Resolution strokeResolution
  • Constructor Details

    • ShapeBasedAnnotation

      public ShapeBasedAnnotation()
  • Method Details

    • getLineWidth

      public float getLineWidth()
      Gets the border line width of this annotation.

      Notice, if this annotation has disabled the line painted attribute

      Returns:
      the annotation border line width
      See Also:
    • setLineWidth

      public void setLineWidth(float newValue)
      Sets the border line width of this annotation.

      Notice, if this annotation has disabled the line painted attribute

      Parameters:
      newValue - the new line width
      See Also:
    • isFilled

      public boolean isFilled()
      Returns a flag indicating if annotation is rendered with a background color.
      Returns:
      boolean
    • setFilled

      public void setFilled(boolean filled)
      Sets a flag indicating if annotation is rendered with a background color.
      Parameters:
      filled - The filled to set
    • isLinePainted

      public boolean isLinePainted()
      Returns a flag if annotation border is rendered.
      Returns:
      boolean
    • setLinePainted

      public void setLinePainted(boolean linePainted)
      Sets a flag if annotation border is rendered.
      Parameters:
      linePainted -
    • setLocation

      public void setLocation(double x, double y)
      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.
      Specified by:
      setLocation in class Annotation
      Parameters:
      x - X-position
      y - Y-position
    • copyAttributesTo

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

      public abstract Shape getShape()
      Shape for render structure
      Returns:
      Shape
    • isAllowResize

      public boolean isAllowResize()
      Returns a flag if annotation could be resized
      Returns:
      boolean
    • setAllowResize

      public void setAllowResize(boolean allowResize)
      Sets a flag if annotation is resizeable
      Parameters:
      allowResize -
    • getFillColor

      public Color getFillColor()
      Returns the current fill color
      Returns:
      Current fill color
    • setFillColor

      public void setFillColor(Color fillColor)
      Sets the fill color (used for filled areas)
      Parameters:
      fillColor - New fill color
    • setStrokeColor

      public void setStrokeColor(Color strokeColor)
      Sets the stroke color (used for lines, borders)
      Parameters:
      strokeColor - New stroke color
    • getStrokeColor

      public Color getStrokeColor()
      Returns the current stroke color
      Returns:
      Current stroke color
    • getBounds

      public abstract Rectangle2D getBounds()
      Returns an integer Rectanglethat completely encloses the annotation.
      Specified by:
      getBounds in class Annotation
      Returns:
      Rectangle annotation bounding box
    • getStrokeResolution

      public Resolution getStrokeResolution()
    • setStrokeResolution

      public void setStrokeResolution(Resolution strokeResolution)
    • isIconified

      public boolean isIconified()
    • setIconified

      public void setIconified(boolean iconified)
    • prepareSerialisation

      public void prepareSerialisation()
    • update

      public abstract void update()