Class AbstractAlignmentProcessor
- java.lang.Object
-
- org.jfree.layouting.renderer.process.AbstractAlignmentProcessor
-
- All Implemented Interfaces:
TextAlignmentProcessor
- Direct Known Subclasses:
CenterAlignmentProcessor,LeftAlignmentProcessor,RightAlignmentProcessor
public abstract class AbstractAlignmentProcessor extends java.lang.Object implements TextAlignmentProcessor
Todo: The whole horizontal alignment is not suitable for spanned page breaks.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description AbstractAlignmentProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcomputeInlineBlock(RenderBox box, long position, long itemElementWidth)intgetBreakableIndex()long[]getElementDimensions()long[]getElementPositions()longgetEndOfLine()protected longgetPageBreak(int pageIndex)PageGridgetPageGrid()protected InlineSequenceElement[]getSequenceElements()intgetSkipIndex()longgetStartOfLine()protected inthandleElement(int start, int count)Handle the next input chunk.protected abstract inthandleLayout(int start, int count, int contentIndex, long usedWidth)booleanhasNext()voidinitialize(InlineSequenceElement[] sequence, long start, long end, PageGrid breaks)Initializes the alignment process.intiterate(InlineSequenceElement[] elements, int maxPos)RenderNodenext()voidsetBreakableIndex(int breakableIndex)voidsetSkipIndex(int skipIndex)
-
-
-
Method Detail
-
getStartOfLine
public long getStartOfLine()
-
getPageGrid
public PageGrid getPageGrid()
-
getSequenceElements
protected InlineSequenceElement[] getSequenceElements()
-
getElementPositions
public long[] getElementPositions()
-
getElementDimensions
public long[] getElementDimensions()
-
getEndOfLine
public long getEndOfLine()
-
getPageBreak
protected long getPageBreak(int pageIndex)
-
getBreakableIndex
public int getBreakableIndex()
-
setBreakableIndex
public void setBreakableIndex(int breakableIndex)
-
getSkipIndex
public int getSkipIndex()
-
setSkipIndex
public void setSkipIndex(int skipIndex)
-
iterate
public int iterate(InlineSequenceElement[] elements, int maxPos)
-
initialize
public void initialize(InlineSequenceElement[] sequence, long start, long end, PageGrid breaks)
Initializes the alignment process. The start and end parameters specify the line boundaries, and have been precomputed.- Specified by:
initializein interfaceTextAlignmentProcessor- Parameters:
sequence-start-end-breaks-
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceTextAlignmentProcessor
-
next
public RenderNode next()
- Specified by:
nextin interfaceTextAlignmentProcessor
-
handleElement
protected int handleElement(int start, int count)Handle the next input chunk.- Parameters:
start- the start indexcount- the number of elements in the sequence- Returns:
- the processing position. Linebreaks will be inserted, if the returned value is equal or less the start index.
-
handleLayout
protected abstract int handleLayout(int start, int count, int contentIndex, long usedWidth)
-
computeInlineBlock
protected void computeInlineBlock(RenderBox box, long position, long itemElementWidth)
-
-