org.jfree.layouting.renderer.process

Class AbstractAlignmentProcessor

public abstract class AbstractAlignmentProcessor extends Object implements TextAlignmentProcessor

Todo: The whole horizontal alignment is not suitable for spanned page breaks.

Author: Thomas Morgner

Constructor Summary
AbstractAlignmentProcessor()
Method Summary
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)

Constructor Detail

AbstractAlignmentProcessor

public AbstractAlignmentProcessor()

Method Detail

computeInlineBlock

protected void computeInlineBlock(RenderBox box, long position, long itemElementWidth)

getBreakableIndex

public int getBreakableIndex()

getElementDimensions

public long[] getElementDimensions()

getElementPositions

public long[] getElementPositions()

getEndOfLine

public long getEndOfLine()

getPageBreak

protected long getPageBreak(int pageIndex)

getPageGrid

public PageGrid getPageGrid()

getSequenceElements

protected InlineSequenceElement[] getSequenceElements()

getSkipIndex

public int getSkipIndex()

getStartOfLine

public long getStartOfLine()

handleElement

protected int handleElement(int start, int count)
Handle the next input chunk.

Parameters: start the start index count 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)

hasNext

public boolean hasNext()

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.

Parameters: sequence start end breaks

iterate

public int iterate(InlineSequenceElement[] elements, int maxPos)

next

public RenderNode next()

setBreakableIndex

public void setBreakableIndex(int breakableIndex)

setSkipIndex

public void setSkipIndex(int skipIndex)