Class TextArea

All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ResolvedPageNumber, UnresolvedPageNumber

public class TextArea extends AbstractTextArea
A text inline area.
See Also:
  • Constructor Details

    • TextArea

      public TextArea()
      Create a text inline area
    • TextArea

      public TextArea(int stretch, int shrink, int adj)
      Constructor with extra parameters: create a TextAdjustingInfo object
      Parameters:
      stretch - the available stretch of the text
      shrink - the available shrink of the text
      adj - the current total adjustment
  • Method Details

    • removeText

      public void removeText()
      Remove the old text
    • addWord

      public void addWord(String word, int offset)
      Create and add a WordArea child to this TextArea.
      Parameters:
      word - the word string
      offset - the offset for the next area
    • addWord

      public void addWord(String word, int offset, int level)
      Create and add a WordArea child to this TextArea.
      Parameters:
      word - the word string
      offset - the offset for the next area
      level - bidirectional level that applies to entire word
    • addWord

      public void addWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset, boolean nextIsSpace)
      Create and add a WordArea child to this TextArea.
      Parameters:
      word - the word string
      ipd - the word's ipd
      letterAdjust - the letter adjustment array (may be null)
      levels - array of resolved bidirectional levels of word characters, or null if default level
      gposAdjustments - array of general position adjustments or null if none apply
      blockProgressionOffset - the offset for the next area
    • addWord

      public void addWord(String word, int ipd, int[] letterAdjust, int[] levels, int[][] gposAdjustments, int blockProgressionOffset)
    • addSpace

      public void addSpace(char space, int ipd, boolean adjustable, int blockProgressionOffset, int level)
      Create and add a SpaceArea child to this TextArea
      Parameters:
      space - the space character
      ipd - the space's ipd
      blockProgressionOffset - the offset for the next area
      adjustable - is this space adjustable?
      level - resolved bidirection level of space character
    • setHyphenated

      public void setHyphenated()
      Records that the last word in this text area is hyphenated.
    • isHyphenated

      public boolean isHyphenated()
      Returns true if the last word in this area is hyphenated.
    • getText

      public String getText()
      Get the whole text string. Renderers whose space adjustment handling is not affected by multi-byte characters can use this method to render the whole TextArea at once; the other renderers (for example PDFRenderer) have to implement renderWord(WordArea) and renderSpace(SpaceArea) in order to correctly place each text fragment.
      Returns:
      the text string
    • toString

      public String toString()
      Overrides:
      toString in class Area
      Returns:
      ipd and bpd of area
    • updateLevel

      public void updateLevel(int newLevel)
    • getEffectiveIPD

      public int getEffectiveIPD()
      Overrides:
      getEffectiveIPD in class Area