Class LineRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer

public class LineRenderer extends AbstractRenderer
  • Field Details

    • maxAscent

      protected float maxAscent
    • maxDescent

      protected float maxDescent
    • levels

      protected byte[] levels
  • Constructor Details

    • LineRenderer

      public LineRenderer()
  • Method Details

    • layout

      public LayoutResult layout (LayoutContext layoutContext)
      Description copied from interface: IRenderer
      This method simulates positioning of the renderer, including all of its children, and returns the LayoutResult, representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. LayoutResult can be extended to return custom layout results for custom elements, e.g. TextRenderer uses TextLayoutResult as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called before IRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.
      layoutContext - the description of layout area and any other additional information
      result of the layout process
    • getMaxAscent

      public float getMaxAscent()
    • getMaxDescent

      public float getMaxDescent()
    • getYLine

      public float getYLine()
    • getLeadingValue

      public float getLeadingValue (Leading leading)
    • getNextRenderer

      public IRenderer getNextRenderer()
      Description copied from interface: IRenderer
      Gets a new instance of this class to be used as a next renderer, after this renderer is used, if IRenderer.layout(LayoutContext) is called more than once.
      new renderer instance
    • getFirstYLineRecursively

      protected Float getFirstYLineRecursively()
      Description copied from class: AbstractRenderer
      Gets the first yLine of the nested children recursively. E.g. for a list, this will be the yLine of the first item (if the first item is indeed a paragraph). NOTE: this method will no go further than the first child.
      getFirstYLineRecursively in class AbstractRenderer
      the first yline of the nested children, null if there is no text found
    • getLastYLineRecursively

      protected Float getLastYLineRecursively()
      getLastYLineRecursively in class AbstractRenderer
    • justify

      public void justify (float width)
    • getNumberOfSpaces

      protected int getNumberOfSpaces()
    • length

      protected int length()
      Gets the total lengths of characters in this line. Other elements (images, tables) are not taken into account.
      the total lengths of characters in this line.
    • baseCharactersCount

      protected int baseCharactersCount()
      Returns the number of base characters, i.e. non-mark characters
      the number of base non-mark characters
    • toString

      public String toString()
      Description copied from class: AbstractRenderer
      Returns a string representation of the renderer.
      toString in class AbstractRenderer
      a String
      See Also:
    • createSplitRenderer

      protected LineRenderer createSplitRenderer()
    • createOverflowRenderer

      protected LineRenderer createOverflowRenderer()
    • split

      protected LineRenderer[] split()
    • adjustChildrenYLine

      protected LineRenderer adjustChildrenYLine()
    • applyLeading

      protected void applyLeading (float deltaY)
    • trimLast

      protected LineRenderer trimLast()
    • containsImage

      public boolean containsImage()
    • getMinMaxWidth

      public MinMaxWidth getMinMaxWidth()
      Description copied from class: AbstractRenderer
      Calculates min and max width values for current renderer.
      getMinMaxWidth in class AbstractRenderer
      instance of MinMaxWidth