Package org.apache.fop.layoutmgr.table
Class TableContentLayoutManager
java.lang.Object
org.apache.fop.layoutmgr.table.TableContentLayoutManager
- All Implemented Interfaces:
PercentBaseContext
Layout manager for table contents, particularly managing the creation of combined element lists.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
protected TableRowIterator
private TableRowIterator
private LinkedList
private int
private boolean
private TableRowIterator
private LinkedList
private int
private static final org.apache.commons.logging.Log
Loggerprivate int
private TableStepper
private TableLayoutManager
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
addAreas
(PositionIterator parentIter, LayoutContext layoutContext) Adds the areas generated by this layout manager to the area tree.private void
addBodyAreas
(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
(List elements, TablePart part, RowPainter painter, boolean lastOnPage) private void
addTablePartAreas
(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
protected LinkedList
protected int
private int
getFootnotesBPD
(List<List<KnuthElement>> footnotes) protected LinkedList
protected int
private LinkedList
getKnuthElementsForRowIterator
(TableRowIterator iter, LayoutContext context, int alignment, int bodyType) Creates Knuth elements by iterating over a TableRowIterator.getNextKnuthElements
(LayoutContext context, int alignment) Get a sequence of KnuthElements representing the content of the node assigned to the LM.(package private) TableLayoutManager
(package private) int
protected int
getXOffsetOfGridUnit
(int colIndex, int nrColSpan) Returns the X offset of the grid unit in the given column.protected int
Returns the X offset of the given grid unit.(package private) boolean
(package private) void
setStartXOffset
(int startXOffset) Sets the overall starting x-offset.
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOGLogger -
tableLM
-
bodyIter
-
headerIter
-
headerList
-
headerNetHeight
private int headerNetHeight -
startXOffset
private int startXOffset -
usedBPD
private int usedBPD -
stepper
-
headerIsBeingRepeated
private boolean headerIsBeingRepeated -
atLeastOnce
private boolean atLeastOnce
-
-
Constructor Details
-
TableContentLayoutManager
TableContentLayoutManager(TableLayoutManager parent) Main constructor- Parameters:
parent
- Parent layout manager
-
-
Method Details
-
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
-
getHeaderElements
- Returns:
- the header element list
-
getNextKnuthElements
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:
-
getFootnotesBPD
-
getKnuthElementsForRowIterator
private 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
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
Adds the areas generated by this layout manager to the area tree.- Parameters:
parentIter
- the position iteratorlayoutContext
- the layout context for adding areas
-
addBodyAreas
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(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
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
-