Package snap.text
Class TextBlockUtils
java.lang.Object
snap.text.TextBlockUtils
Utility methods to support TextBlock.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A property change event for addChars/removeChars.static class
A property change event for TextBlock.Style change.static class
A property change event for TextBlock.Style change. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TextToken[]
createTokensForTextLine
(TextLine aTextLine) Returns the tokens.static void
fromXML
(TextBlock textBlock, XMLArchiver anArchiver, XMLElement anElement) XML unarchival.static Shape
getPathForCharRange
(TextBlock textBlock, int aStartCharIndex, int aEndCharIndex) Returns a path for two char indexes - it will be a simple box with extensions for first/last lines.static TextRun[]
getUnderlineRuns
(TextBlock textBlock, Rect aRect) Returns underlined runs for text box.static void
paintTextBlockUnderlines
(Painter aPntr, TextBlock textBlock, Rect clipRect) Paint TextBox to given painter.static void
Sets the Mouse Y for given text block to assist in caret placement (can be ambiguous for start/end of line).static XMLElement
toXML
(TextBlock textBlock, XMLArchiver anArchiver) XML archival.
-
Constructor Details
-
TextBlockUtils
public TextBlockUtils()
-
-
Method Details
-
getPathForCharRange
public static Shape getPathForCharRange(TextBlock textBlock, int aStartCharIndex, int aEndCharIndex) Returns a path for two char indexes - it will be a simple box with extensions for first/last lines. -
getUnderlineRuns
Returns underlined runs for text box. -
paintTextBlockUnderlines
Paint TextBox to given painter. -
createTokensForTextLine
Returns the tokens. -
setMouseY
Sets the Mouse Y for given text block to assist in caret placement (can be ambiguous for start/end of line). -
toXML
XML archival. -
fromXML
XML unarchival.
-