Class TextFragmentBox


public class TextFragmentBox extends ContentBox
A Geometric object for representing a TextFragment region on a line of Text.
  • Field Details

    • length

      public int length
      The fragment's length in characters.
    • offset

      public int offset
      The character offset at which this fragment begins.
  • Constructor Details

    • TextFragmentBox

      public TextFragmentBox(TextFlow textflow)
      Creates a new TextFragmentBox for the given text flow.
      Parameters:
      textflow - the text flow
  • Method Details

    • containsPoint

      public boolean containsPoint(int x, int y)
      Description copied from class: FlowBox
      This method must be called on a block that is completely positioned and committed.
      Specified by:
      containsPoint in class FlowBox
      Parameters:
      x - X
      y - Y
      Returns:
      true if the FlowBox contains the point
      See Also:
    • getAscent

      public int getAscent()
      Returns the textflow's font's ascent. The ascent is the same for all fragments in a given TextFlow.
      Specified by:
      getAscent in class FlowBox
      Returns:
      the ascent
    • getDescent

      public int getDescent()
      Returns the textflow's font's descent. The descent is the same for all fragments in a given TextFlow.
      Specified by:
      getDescent in class FlowBox
      Returns:
      the descent
      See Also:
    • isRightToLeft

      public boolean isRightToLeft()
      Returns true if the bidi level is odd. Right to left fragments should be queried and rendered with the RLO control character inserted in front.
      Returns:
      true if right-to-left
      Since:
      3.1
    • isTruncated

      public boolean isTruncated()
      Returns true if the fragment should be rendered as truncated.
      Returns:
      true if the fragment is truncated
      Since:
      3.1
    • setTruncated

      public void setTruncated(boolean value)
      Marks the fragment as having been truncated.
      Parameters:
      value - true if the fragment is truncated
      Since:
      3.1
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: