Package org.apache.fop.layoutmgr.table
Class TableContentLayoutManager
- java.lang.Object
-
- org.apache.fop.layoutmgr.table.TableContentLayoutManager
-
- All Implemented Interfaces:
PercentBaseContext
public class TableContentLayoutManager extends java.lang.Object implements PercentBaseContext
Layout manager for table contents, particularly managing the creation of combined element lists.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
atLeastOnce
private TableRowIterator
bodyIter
private TableRowIterator
footerIter
private java.util.LinkedList
footerList
private int
footerNetHeight
private boolean
headerIsBeingRepeated
private TableRowIterator
headerIter
private java.util.LinkedList
headerList
private int
headerNetHeight
private static org.apache.commons.logging.Log
LOG
Loggerprivate int
startXOffset
private TableStepper
stepper
private TableLayoutManager
tableLM
private int
usedBPD
-
Constructor Summary
Constructors Constructor Description TableContentLayoutManager(TableLayoutManager parent)
Main constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addAreas(PositionIterator parentIter, LayoutContext layoutContext)
Adds the areas generated by this layout manager to the area tree.private void
addBodyAreas(java.util.Iterator iterator, RowPainter painter, boolean lastOnPage)
Iterates over the positions corresponding to the table's body (which may contain several table-body elements!) and adds the corresponding areas.private void
addHeaderFooterAreas(java.util.List elements, TablePart part, RowPainter painter, boolean lastOnPage)
private void
addTablePartAreas(java.util.List positions, RowPainter painter, TablePart body, boolean isFirstPos, boolean isLastPos, boolean lastInBody, boolean lastOnPage)
Adds the areas corresponding to a single fo:table-header/footer/body element.int
getBaseLength(int lengthBase, FObj fobj)
Returns the base length for the given length base.(package private) ColumnSetup
getColumns()
protected java.util.LinkedList
getFooterElements()
protected int
getFooterNetHeight()
private int
getFootnotesBPD(java.util.List<java.util.List<KnuthElement>> footnotes)
protected java.util.LinkedList
getHeaderElements()
protected int
getHeaderNetHeight()
private java.util.LinkedList
getKnuthElementsForRowIterator(TableRowIterator iter, LayoutContext context, int alignment, int bodyType)
Creates Knuth elements by iterating over a TableRowIterator.java.util.List
getNextKnuthElements(LayoutContext context, int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM.(package private) TableLayoutManager
getTableLM()
(package private) int
getUsedBPD()
protected int
getXOffsetOfGridUnit(int colIndex, int nrColSpan)
Returns the X offset of the grid unit in the given column.protected int
getXOffsetOfGridUnit(PrimaryGridUnit gu)
Returns the X offset of the given grid unit.(package private) boolean
isSeparateBorderModel()
(package private) void
setStartXOffset(int startXOffset)
Sets the overall starting x-offset.
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
Logger
-
tableLM
private TableLayoutManager tableLM
-
bodyIter
private TableRowIterator bodyIter
-
headerIter
private TableRowIterator headerIter
-
footerIter
private TableRowIterator footerIter
-
headerList
private java.util.LinkedList headerList
-
footerList
private java.util.LinkedList footerList
-
headerNetHeight
private int headerNetHeight
-
footerNetHeight
private int footerNetHeight
-
startXOffset
private int startXOffset
-
usedBPD
private int usedBPD
-
stepper
private TableStepper stepper
-
headerIsBeingRepeated
private boolean headerIsBeingRepeated
-
atLeastOnce
private boolean atLeastOnce
-
-
Constructor Detail
-
TableContentLayoutManager
TableContentLayoutManager(TableLayoutManager parent)
Main constructor- Parameters:
parent
- Parent layout manager
-
-
Method Detail
-
getTableLM
TableLayoutManager getTableLM()
- Returns:
- the table layout manager
-
isSeparateBorderModel
boolean isSeparateBorderModel()
- Returns:
- true if the table uses the separate border model.
-
getColumns
ColumnSetup getColumns()
- Returns:
- the column setup of this table
-
getHeaderNetHeight
protected int getHeaderNetHeight()
- Returns:
- the net header height
-
getFooterNetHeight
protected int getFooterNetHeight()
- Returns:
- the net footer height
-
getHeaderElements
protected java.util.LinkedList getHeaderElements()
- Returns:
- the header element list
-
getFooterElements
protected java.util.LinkedList getFooterElements()
- Returns:
- the footer element list
-
getNextKnuthElements
public java.util.List getNextKnuthElements(LayoutContext context, int alignment)
Get a sequence of KnuthElements representing the content of the node assigned to the LM.- Parameters:
context
- the LayoutContext used to store layout informationalignment
- the desired text alignment- Returns:
- the list of KnuthElements
- See Also:
LayoutManager.getNextKnuthElements(LayoutContext, int)
-
getFootnotesBPD
private int getFootnotesBPD(java.util.List<java.util.List<KnuthElement>> footnotes)
-
getKnuthElementsForRowIterator
private java.util.LinkedList getKnuthElementsForRowIterator(TableRowIterator iter, LayoutContext context, int alignment, int bodyType)
Creates Knuth elements by iterating over a TableRowIterator.- Parameters:
iter
- TableRowIterator instance to fetch rows fromcontext
- Active LayoutContextalignment
- alignment indicatorbodyType
- Indicates what kind of body is being processed (BODY, HEADER or FOOTER)- Returns:
- An element list
-
getXOffsetOfGridUnit
protected int getXOffsetOfGridUnit(PrimaryGridUnit gu)
Returns the X offset of the given grid unit.- Parameters:
gu
- the grid unit- Returns:
- the requested X offset
-
getXOffsetOfGridUnit
protected int getXOffsetOfGridUnit(int colIndex, int nrColSpan)
Returns the X offset of the grid unit in the given column.- Parameters:
colIndex
- the column index (zero-based)nrColSpan
- number columns spanned- Returns:
- the requested X offset
-
addAreas
void addAreas(PositionIterator parentIter, LayoutContext layoutContext)
Adds the areas generated by this layout manager to the area tree.- Parameters:
parentIter
- the position iteratorlayoutContext
- the layout context for adding areas
-
addHeaderFooterAreas
private void addHeaderFooterAreas(java.util.List elements, TablePart part, RowPainter painter, boolean lastOnPage)
-
addBodyAreas
private void addBodyAreas(java.util.Iterator iterator, RowPainter painter, boolean lastOnPage)
Iterates over the positions corresponding to the table's body (which may contain several table-body elements!) and adds the corresponding areas.- Parameters:
iterator
- iterator over TableContentPosition elements. Those positions correspond to the elements of the body present on the current pagepainter
-lastOnPage
- true if the table has no footer (then the last line of the table that will be present on the page belongs to the body)
-
addTablePartAreas
private void addTablePartAreas(java.util.List positions, RowPainter painter, TablePart body, boolean isFirstPos, boolean isLastPos, boolean lastInBody, boolean lastOnPage)
Adds the areas corresponding to a single fo:table-header/footer/body element.
-
setStartXOffset
void setStartXOffset(int startXOffset)
Sets the overall starting x-offset. Used for proper placement of cells.- Parameters:
startXOffset
- starting x-offset (table's start-indent)
-
getUsedBPD
int getUsedBPD()
- Returns:
- the amount of block-progression-dimension used by the content
-
getBaseLength
public int getBaseLength(int lengthBase, FObj fobj)
Returns the base length for the given length base. Length base should be one of the constants defined inLengthBase
.- Specified by:
getBaseLength
in interfacePercentBaseContext
- Parameters:
lengthBase
- Indicates which type of the base length value is to be returnedfobj
- The FO object against which the percentage should be evaluated- Returns:
- The base length value of the given kind
-
-