com.codemesh.terp.util
Class TextLayoutEngine
java.lang.Object
com.codemesh.terp.util.TextLayoutEngine
- All Implemented Interfaces:
- java.util.Iterator<java.lang.String>
public class TextLayoutEngine
- extends java.lang.Object
- implements java.util.Iterator<java.lang.String>
The engine that performs the text layout on behalf
of the terp expander.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREFERRED_ADD
public static final java.util.regex.Pattern PREFERRED_ADD
NEWLINE
public static final java.util.regex.Pattern NEWLINE
TextLayoutEngine
public TextLayoutEngine()
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface java.util.Iterator<java.lang.String>
next
public java.lang.String next()
- Specified by:
next in interface java.util.Iterator<java.lang.String>
remove
public void remove()
- Specified by:
remove in interface java.util.Iterator<java.lang.String>
append
public java.lang.String append(java.lang.String text,
TextLayoutEngine.LayoutRelevantData data)
toSegments
public java.util.List<com.codemesh.terp.util.TextLayoutEngine.Segment> toSegments(java.lang.String text,
TextLayoutEngine.LayoutRelevantData data)
setAnchor
public void setAnchor()
getAnchor
public int getAnchor()
resetAnchor
public void resetAnchor()
formatLine
public void formatLine()
breakLine
public java.util.List<java.lang.String> breakLine(TextLayoutEngine.LayoutRelevantData firstData)
identifyBreak
protected TextLayoutEngine.Break identifyBreak(java.lang.CharSequence seq,
int index)
treatLine
public void treatLine(TextLayoutEngine.LayoutRelevantData firstData,
boolean bBlockJustify)
- Takes the accumulated linebuffers (left,right,center) and assembles them into a line,
taking the layout data into account.
The firstData parameter is used to pass the information that was in force at the beginning
of the line.
- Parameters:
firstData - the layout data of the first segment in that line.bBlockJustify - add spaces if necessary.
getBuffer
public java.lang.StringBuilder getBuffer(TextLayoutEngine.LayoutRelevantData data)
containsEOL
public boolean containsEOL(java.lang.String text)
endsWithEOL
public boolean endsWithEOL(java.lang.String text)
Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.