Class HighlightPainterInfo

java.lang.Object
ro.sync.ecss.extensions.api.highlights.HighlightPainterInfo

@API(type=NOT_EXTENDABLE, src=PUBLIC) public class HighlightPainterInfo extends Object
Information needed by the painter.
  • Constructor Details

    • HighlightPainterInfo

      public HighlightPainterInfo(Graphics g, int currentBoxHeight, Point origin, int relativeX, int textYPadding, int length, int startOffset, int endOffset, int baseLine, int fontAscent, int fontSize, Point parentLineBoxOrigin, int parentLineBoxWidth, int parentLineBoxHeight, int viewEndOffset)
      Renders the highlight.
      Parameters:
      g - The graphics
      currentBoxHeight - The current box height.
      origin - Origin (upper left corner of the box in absolute coordinates)
      relativeX - The x relative to the origin where the highlight must start.
      textYPadding - The relative Y position from box Y used to paint the box.
      length - The length of the highlight, in pixels.
      startOffset - Start offset of highlight
      endOffset - End offset of highlight
      baseLine - The base line relative to the box start
      fontAscent - The font ascent
      fontSize - The font size
      parentLineBoxWidth - The width of the parent line box. Can be -1.
      parentLineBoxHeight - The height of the parent line box. Can be -1.
      parentLineBoxOrigin - The origin of the parent line box. Can be null.
      viewEndOffset - The end offset of the current view over which the highight is being painted.
  • Method Details

    • setHighlightOverText

      public void setHighlightOverText(boolean isHighlightOverText)
      It is set by the author layout, so that the painter knows the painted box is a text box.
      Parameters:
      isHighlightOverText - The isHighlightOverText to set.
    • getGraphics

      public Graphics getGraphics()
      Returns the graphics used for paint.
      Returns:
      Returns the graphics used for paint.
    • getCurrentBoxHeight

      public int getCurrentBoxHeight()
      Current run of text/image height. Usually the highlight should expand as high as the containing box.
      Returns:
      Current run of text/image height. Usually the highlight should expand as high as the containing box.
    • getOrigin

      public Point getOrigin()
      Returns the origin of box, relative to the upper corner of the editor.
      Returns:
      Returns the origin of box, relative to the upper corner of the editor.
    • getRelativeX

      public int getRelativeX()
      Returns the relative X from where highlight should start.
      Returns:
      Returns the relative X from where highlight should start.
    • getTextYPadding

      public int getTextYPadding()
      Returns the relative Y position from box Y used to paint the text inside the box.
      Returns:
      The relative Y position from box Y used to paint the text inside the box.
    • getLength

      public int getLength()
      Returns the length of highlight, in pixels.
      Returns:
      Returns the length of highlight, in pixels.
    • setLength

      public void setLength(int length)
      Set a new value for the length of the highlight, in pixels.
      Parameters:
      length - the new value.
    • getStartOffset

      public int getStartOffset()
      Returns the start offset in content.
      Returns:
      Returns the start offset in content.
    • getEndOffset

      public int getEndOffset()
      Returns the end offset in content.
      Returns:
      Returns the end offset in content.
    • getBaseLine

      public int getBaseLine()
      Returns the base line relative to top, relative to the box.
      Returns:
      Returns the base line relative to top, relative to the box.
    • getFontAscent

      public int getFontAscent()
      Returns the font ascent.
      Returns:
      Returns the font ascent.
    • getFontSize

      public int getFontSize()
      Returns the font size.
      Returns:
      Returns the font size.
    • isHighlightOverText

      public boolean isHighlightOverText()
      Returns true if the highlight is done over a text view.
      Returns:
      Returns true if the highlight is done over a text view.
    • getParentLineBoxHight

      public int getParentLineBoxHight()
      Returns:
      Returns the height of parent line box. Can be -1.
    • getParentLineBoxWidth

      public int getParentLineBoxWidth()
      Returns:
      Returns the width of parent line box. Can be -1.
    • getParentLineBoxOrigin

      public Point getParentLineBoxOrigin()
      Returns:
      Returns the origin(absolute) of the parent line box. Can be null.
    • setHighlightOverImage

      public void setHighlightOverImage(boolean isHighlightOverImage)
      true if the highlight is over an image
      Parameters:
      isHighlightOverImage - true if the highlight is over an image
    • isHighlightOverImage

      public boolean isHighlightOverImage()
      Returns:
      Returns true if the highlight is over an image
    • setHighlightOverFormControls

      public void setHighlightOverFormControls(boolean isHighlightOverFormControl)
      Set highlight over form controls.
      Parameters:
      isHighlightOverFormControl - true if we have a highlight over form controls.
    • isHighlightOverFormControl

      public boolean isHighlightOverFormControl()
      Check if we have a highlight over form controls
      Returns:
      Returns true if we have a highlight over form controls.
    • getViewEndOffset

      public int getViewEndOffset()
      Returns:
      The end offset of the current view over which the highight is being painted.