Package org.apache.fop.layoutmgr.table
Class RowPainter
java.lang.Object
org.apache.fop.layoutmgr.table.RowPainter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]
private int
private EffRow
Currently handled row (= last encountered row).private int
private boolean[]
private CellPart[]
private int
Index of the first row of the current part present on the current page.private int
Index of the very first row on the current page.private CellPart[]
private LayoutContext
private static org.apache.commons.logging.Log
private List
Keeps track of the y-offsets of each row on a page.private CommonBorderPaddingBackground
private List
private int
y-offset of the current table part.private TableContentLayoutManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addAreaForEmptyGridUnit
(EmptyGridUnit gu, int rowIndex, int colIndex, int actualRowHeight, int borderBeforeWhich, int borderAfterWhich, boolean lastOnPage) private void
addAreasAndFlushRow
(boolean lastInPart, boolean lastOnPage) Creates the areas corresponding to the last row.private void
addAreasForCell
(PrimaryGridUnit pgu, int startPos, int endPos, int rowHeight, int borderBeforeWhich, int borderAfterWhich, boolean lastOnPage) private int
computeContentLength
(PrimaryGridUnit pgu, int startIndex, int endIndex) (package private) void
endBody()
Signals that the last table-body instance has ended.(package private) void
endTablePart
(boolean lastInBody, boolean lastOnPage) Signals that the end of the current table part is reached.(package private) int
private int
getRowOffset
(int rowIndex) Returns the offset of the row with the given index.(package private) void
Records the fragment of row represented by the given position.private void
recordRowOffset
(int rowIndex, int offset) Records the y-offset of the row with the given index.(package private) void
registerPartBackgroundArea
(Block backgroundArea) Registers the given area, that will be used to render the part of table-header/footer/body background covered by a table-cell.(package private) void
Signals that the first table-body instance has started.(package private) void
startTablePart
(TablePart tablePart)
-
Field Details
-
log
private static org.apache.commons.logging.Log log -
colCount
private int colCount -
currentRowOffset
private int currentRowOffset -
currentRow
Currently handled row (= last encountered row). -
layoutContext
-
firstRowIndex
private int firstRowIndexIndex of the first row of the current part present on the current page. -
firstRowOnPageIndex
private int firstRowOnPageIndexIndex of the very first row on the current page. Needed to properly handleinvalid reference
BorderProps#COLLAPSE_OUTER
firstRowIndex
when the table has headers! -
rowOffsets
Keeps track of the y-offsets of each row on a page. This is particularly needed for spanned cells where you need to know the y-offset of the starting row when the area is generated at the time the cell is closed. -
cellHeights
private int[] cellHeights -
firstCellOnPage
private boolean[] firstCellOnPage -
firstCellParts
-
lastCellParts
-
tablePartOffset
private int tablePartOffsety-offset of the current table part. -
tablePartBackground
-
tablePartBackgroundAreas
-
tclm
-
-
Constructor Details
-
RowPainter
RowPainter(TableContentLayoutManager tclm, LayoutContext layoutContext)
-
-
Method Details
-
startTablePart
-
endTablePart
void endTablePart(boolean lastInBody, boolean lastOnPage) Signals that the end of the current table part is reached.- Parameters:
lastInBody
- true if the part is the last table-body element to be displayed on the current page. In which case all the cells must be flushed even if they aren't finished, plus the proper collapsed borders must be selected (trailing instead of normal, or rest if the cell is unfinished)lastOnPage
- true if the part is the last to be displayed on the current page. In which case collapsed after borders for the cells on the last row must be drawn in the outer mode
-
getAccumulatedBPD
int getAccumulatedBPD() -
handleTableContentPosition
Records the fragment of row represented by the given position. If it belongs to another (grid) row than the current one, that latter is painted and flushed first.- Parameters:
tcpos
- a position representing the row fragment
-
addAreasAndFlushRow
private void addAreasAndFlushRow(boolean lastInPart, boolean lastOnPage) Creates the areas corresponding to the last row. That is, an area with background for the row, plus areas for all the cells that finish on the row (not spanning over further rows).- Parameters:
lastInPart
- true if the row is the last from its table part to be displayed on the current page. In which case all the cells must be flushed even if they aren't finished, plus the proper collapsed borders must be selected (trailing instead of normal, or rest if the cell is unfinished)lastOnPage
- true if the row is the very last row of the table that will be displayed on the current page. In which case collapsed after borders must be drawn in the outer mode
-
computeContentLength
-
addAreasForCell
private void addAreasForCell(PrimaryGridUnit pgu, int startPos, int endPos, int rowHeight, int borderBeforeWhich, int borderAfterWhich, boolean lastOnPage) -
addAreaForEmptyGridUnit
private void addAreaForEmptyGridUnit(EmptyGridUnit gu, int rowIndex, int colIndex, int actualRowHeight, int borderBeforeWhich, int borderAfterWhich, boolean lastOnPage) -
registerPartBackgroundArea
Registers the given area, that will be used to render the part of table-header/footer/body background covered by a table-cell. If percentages are used to place the background image, the final bpd of the (fraction of) table part that will be rendered on the current page must be known. The traits can't then be set when the areas for the cell are created since at that moment this bpd is yet unknown. So they will instead be set inaddAreasAndFlushRow(boolean, boolean)
.- Parameters:
backgroundArea
- the block of the cell's dimensions that will hold the part background
-
recordRowOffset
private void recordRowOffset(int rowIndex, int offset) Records the y-offset of the row with the given index.- Parameters:
rowIndex
- index of the rowoffset
- y-offset of the row on the page
-
getRowOffset
private int getRowOffset(int rowIndex) Returns the offset of the row with the given index.- Parameters:
rowIndex
- index of the row- Returns:
- its y-offset on the page
-
startBody
void startBody()Signals that the first table-body instance has started. -
endBody
void endBody()Signals that the last table-body instance has ended.
-