Package snap.text
Class RichTextLine
java.lang.Object
snap.text.TextLine
snap.text.RichTextLine
- All Implemented Interfaces:
CharSequence
,Cloneable
,CharSequenceX
A class to represent a line of text (for each newline) in RichText.
-
Field Summary
Fields inherited from class snap.text.TextLine
_index, _lineStyle, _runs, _sb, _startCharIndex, _textDoc, _tokens, _width, EMPTY_RUNS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChars
(CharSequence theChars, TextStyle theStyle, int anIndex) Adds characters with attributes to this line at given index.clone()
Standard clone implementation.void
removeChars
(int aStart, int anEnd) Removes characters in given range.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).Methods inherited from class snap.text.TextLine
addRun, charAt, copyForRange, createRun, createTokens, getAlignX, getCharIndexForX, getEndCharIndex, getIndex, getLastToken, getLineStyle, getNext, getPrevious, getRun, getRunCount, getRunForCharIndex, getRunForCharRange, getRunLast, getRuns, getStartCharIndex, getString, getTextDoc, getTokenForCharIndex, getTokenForX, getTokens, getWidth, getWidth, getXForCharIndex, getXForTabAtIndexAndX, indexOf, isUnderlined, length, removeRun, setAlignX, setLineStyle, setStyle, splitLineAtIndex, subSequence, toString, toStringProps, updateRuns, updateText
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
Methods inherited from interface snap.util.CharSequenceX
getIndentLength, getIndentString, getLastChar, indexAfterNewline, indexOfNewline, isAfterLineEnd, isLastCharNewline, isLineEnd, isLineEndChar, isWhiteSpace, lastIndexAfterNewline, lastIndexOfNewline, startsWith
-
Constructor Details
-
RichTextLine
Constructor.
-
-
Method Details
-
addChars
Adds characters with attributes to this line at given index. -
removeChars
public void removeChars(int aStart, int anEnd) Removes characters in given range.- Overrides:
removeChars
in classTextLine
-
splitRunForCharIndex
Splits given run at given char index and returns the run containing the remaining chars (and identical attributes). -
clone
Standard clone implementation.
-