Package com.openhtmltopdf.bidi
Class ParagraphSplitter.Paragraph
- java.lang.Object
-
- com.openhtmltopdf.bidi.ParagraphSplitter.Paragraph
-
- Direct Known Subclasses:
ParagraphSplitter.FakeParagraph
- Enclosing class:
- ParagraphSplitter
public static class ParagraphSplitter.Paragraph extends java.lang.ObjectA paragraph object collects the text of one paragraph. That is the text in a block element wiht possible holes from BIDI isolation tags. This text is then used to run the Unicode BIDI algorithm splitting text up into runs of LTR and RTL text.
-
-
Field Summary
Fields Modifier and Type Field Description private byteactualDirectionprivate java.lang.StringBuilderbuilderprotected IdentValuecssDirectionprivate java.util.TreeMap<java.lang.Integer,BidiTextRun>splitPointsprotected java.util.Map<org.w3c.dom.Text,java.lang.Integer>textRuns
-
Constructor Summary
Constructors Modifier Constructor Description privateParagraph(IdentValue direction)privateParagraph(IdentValue direction, boolean isLiveImplementation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadd(java.lang.String text, org.w3c.dom.Text textNode)Here we add a textnode and its postion to a list.private voidcopySplitPointsFromBidiSplitter(BidiSplitter splitter)Here we copy the split points from the BIDI processor to our tree map for easy access.bytegetActualDirection()IdentValuegetCSSDirection()intgetFirstCharIndexInParagraph(org.w3c.dom.Text text)BidiTextRunnextSplit(int startIndexInParagraph)BidiTextRunprevSplit(int startIndexInParagraph)protected voidrunBidiSplitter(BidiSplitter splitter, LayoutContext c)Here we call out to the actual BIDI algorithm.
-
-
-
Field Detail
-
builder
private final java.lang.StringBuilder builder
-
splitPoints
private final java.util.TreeMap<java.lang.Integer,BidiTextRun> splitPoints
-
textRuns
protected final java.util.Map<org.w3c.dom.Text,java.lang.Integer> textRuns
-
cssDirection
protected final IdentValue cssDirection
-
actualDirection
private byte actualDirection
-
-
Constructor Detail
-
Paragraph
private Paragraph(IdentValue direction)
-
Paragraph
private Paragraph(IdentValue direction, boolean isLiveImplementation)
-
-
Method Detail
-
add
protected void add(java.lang.String text, org.w3c.dom.Text textNode)Here we add a textnode and its postion to a list. We also build the paragraph string.
-
runBidiSplitter
protected void runBidiSplitter(BidiSplitter splitter, LayoutContext c)
Here we call out to the actual BIDI algorithm.
-
getFirstCharIndexInParagraph
public int getFirstCharIndexInParagraph(org.w3c.dom.Text text)
- Returns:
- the first char index into this paragraph from a Text node or -1 if not available.
-
copySplitPointsFromBidiSplitter
private void copySplitPointsFromBidiSplitter(BidiSplitter splitter)
Here we copy the split points from the BIDI processor to our tree map for easy access.
-
nextSplit
public BidiTextRun nextSplit(int startIndexInParagraph)
- Returns:
- the BidiTextRun that starts at or above startIndexInPararagraph.
-
prevSplit
public BidiTextRun prevSplit(int startIndexInParagraph)
- Returns:
- the BidiTextRun that starts at or before startIndexInParagraph.
-
getActualDirection
public byte getActualDirection()
-
getCSSDirection
public IdentValue getCSSDirection()
-
-