Class HighlightData.Highlight

  • All Implemented Interfaces:
    java.awt.Shape, java.io.Serializable, java.lang.Cloneable
    Enclosing interface:
    HighlightData

    @JsonData
    public static class HighlightData.Highlight
    extends java.awt.Rectangle
    Represents a highlight area on a certain page. The coordinates are in pixels an relative to the unscaled page image coordinates
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HighlightData.Highlight.Appearance
      Appearances of a highlight.
      • Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D

        java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
    • Field Summary

      • Fields inherited from class java.awt.Rectangle

        height, width, x, y
      • Fields inherited from class java.awt.geom.Rectangle2D

        OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
    • Constructor Summary

      Constructors 
      Constructor Description
      Highlight​(int x, int y, int width, int height, java.lang.String caption, HighlightData.Highlight.Appearance appearance, java.awt.Color color)
      Creates the highlight area
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(int x, int y)
      HighlightData.Highlight.Appearance getAppearance()
      Returns the appearance.
      java.lang.String getCaption()
      Returns the caption to be displayed in the area
      java.awt.Color getColor()
      The base color to draw this highlight
      java.awt.Image getImage()
      Returns the image.
      java.lang.String getRenderCacheKey()
      Returns the key of the render cache entry for drawing this highlight.
      java.lang.String getType()
      Returns the type.
      boolean isAnnotation()
      Returns a flag indicating this highlight represents an annotation.
      void setImage​(java.awt.Image image)
      Sets the image.
      void setRenderCacheKey​(java.lang.String renderCacheKey)
      Sets the key of the render cache entry for drawing this highlight.
      void setType​(java.lang.String type)
      Sets the type.
      • Methods inherited from class java.awt.Rectangle

        add, add, add, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
      • Methods inherited from class java.awt.geom.Rectangle2D

        add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
      • Methods inherited from class java.awt.geom.RectangularShape

        clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.Shape

        contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
    • Constructor Detail

      • Highlight

        public Highlight​(int x,
                         int y,
                         int width,
                         int height,
                         java.lang.String caption,
                         HighlightData.Highlight.Appearance appearance,
                         java.awt.Color color)
        Creates the highlight area
        Parameters:
        x - the x-offset
        y - the y-offset
        width - the width in PX
        height - the height in PX
        caption - the caption to be displayed INSIDE the area, may be null
        appearance - indicates how to draw the highlight
        color - the base color for this highlight. Note that the Alpha channel will be ignored an set by the painter
    • Method Detail

      • getCaption

        public java.lang.String getCaption()
        Returns the caption to be displayed in the area
        Returns:
        the caption to be displayed in the area, null if there is none
      • getColor

        public java.awt.Color getColor()
        The base color to draw this highlight
        Returns:
        the base color to draw this highlight
      • getImage

        public java.awt.Image getImage()
        Returns the image.
        Returns:
        the image.
      • setImage

        public void setImage​(java.awt.Image image)
        Sets the image.
        Parameters:
        image - the image
      • isAnnotation

        public boolean isAnnotation()
        Returns a flag indicating this highlight represents an annotation.
        Returns:
        true if this highlight represents an annotation
      • setType

        public void setType​(java.lang.String type)
        Sets the type.
        Parameters:
        type - the type.
      • getType

        public java.lang.String getType()
        Returns the type.
        Returns:
        the type
      • getRenderCacheKey

        public java.lang.String getRenderCacheKey()
        Returns the key of the render cache entry for drawing this highlight.
        Returns:
        the key of the render cache entry for drawing this highlight
      • setRenderCacheKey

        public void setRenderCacheKey​(java.lang.String renderCacheKey)
        Sets the key of the render cache entry for drawing this highlight.
        Parameters:
        renderCacheKey - the key of the render cache entry for drawing this highlight
      • contains

        public boolean contains​(int x,
                                int y)
        Overrides:
        contains in class java.awt.Rectangle