Search in sources :

Example 11 with TextNode

use of org.apache.pivot.wtk.text.TextNode in project pivot by apache.

the class TextPaneSkinTextNodeView method toString.

@Override
public String toString() {
    TextNode textNode = (TextNode) getNode();
    String text = textNode.getText();
    // Sometimes the length may not be correct yet (i.e., during layout) so check before using
    String textSubString = "";
    if (length < 0 || start + length > text.length()) {
        textSubString = text.substring(start);
    } else {
        textSubString = text.substring(start, start + length);
    }
    return ClassUtils.simpleToString(this) + " start=" + start + ",length=" + length + " [" + textSubString + "]";
}
Also used : TextNode(org.apache.pivot.wtk.text.TextNode)

Aggregations

TextNode (org.apache.pivot.wtk.text.TextNode)11 Element (org.apache.pivot.wtk.text.Element)5 Node (org.apache.pivot.wtk.text.Node)4 Paragraph (org.apache.pivot.wtk.text.Paragraph)4 TextSpan (org.apache.pivot.wtk.text.TextSpan)4 ComponentNode (org.apache.pivot.wtk.text.ComponentNode)3 ImageNode (org.apache.pivot.wtk.text.ImageNode)3 Font (java.awt.Font)2 FontRenderContext (java.awt.font.FontRenderContext)2 LineBreakMeasurer (java.awt.font.LineBreakMeasurer)2 TextLayout (java.awt.font.TextLayout)2 AttributedCharacterIterator (java.text.AttributedCharacterIterator)2 AttributedStringCharacterIterator (org.apache.pivot.text.AttributedStringCharacterIterator)2 Dimensions (org.apache.pivot.wtk.Dimensions)2 Span (org.apache.pivot.wtk.Span)2 TextPane (org.apache.pivot.wtk.TextPane)2 ArrayList (org.apache.pivot.collections.ArrayList)1 CharSpan (org.apache.pivot.text.CharSpan)1 CompositeIterator (org.apache.pivot.text.CompositeIterator)1 ApplicationContext (org.apache.pivot.wtk.ApplicationContext)1