Package snap.text

Class RichTextLine

java.lang.Object
snap.text.TextLine
snap.text.RichTextLine
All Implemented Interfaces:
CharSequence, Cloneable, CharSequenceX

public class RichTextLine extends TextLine
A class to represent a line of text (for each newline) in RichText.
  • Constructor Details

    • RichTextLine

      public RichTextLine(RichText aRichText)
      Constructor.
  • Method Details

    • addChars

      public void addChars(CharSequence theChars, TextStyle theStyle, int anIndex)
      Adds characters with attributes to this line at given index.
      Overrides:
      addChars in class TextLine
    • removeChars

      public void removeChars(int aStart, int anEnd)
      Removes characters in given range.
      Overrides:
      removeChars in class TextLine
    • splitRunForCharIndex

      protected TextRun splitRunForCharIndex(TextRun aRun, int anIndex)
      Splits given run at given char index and returns the run containing the remaining chars (and identical attributes).
    • clone

      public RichTextLine clone()
      Standard clone implementation.
      Overrides:
      clone in class TextLine