Package com.itextpdf.layout.renderer
Class CollapsedTableBorders
java.lang.Object
com.itextpdf.layout.renderer.TableBorders
com.itextpdf.layout.renderer.CollapsedTableBorders
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
A comparison function to compare twoBorder
instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Comparator
<Border> Horizontal borders to be collapsed with the last-on-the-area row's cell bottom borders of this TableRenderer instance.Horizontal borders to be collapsed with the first-on-the-area row's cell top borders of this TableRenderer instance.Vertical borders to be collapsed with the last-on-the-area row's cell bottom borders of this TableRenderer instance.Fields inherited from class com.itextpdf.layout.renderer.TableBorders
finishRow, horizontalBorders, largeTableIndexOffset, leftBorderMaxWidth, numberOfColumns, rightBorderMaxWidth, rows, startRow, tableBoundingBorders, verticalBorders
-
Constructor Summary
ConstructorsConstructorDescriptionCollapsedTableBorders
(List<CellRenderer[]> rows, int numberOfColumns, Border[] tableBoundingBorders) CollapsedTableBorders
(List<CellRenderer[]> rows, int numberOfColumns, Border[] tableBoundingBorders, int largeTableIndexOffset) -
Method Summary
Modifier and TypeMethodDescriptionprotected TableBorders
applyBottomTableBorder
(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) protected TableBorders
applyBottomTableBorder
(Rectangle occupiedBox, Rectangle layoutBox, boolean isEmpty, boolean force, boolean reverse) protected TableBorders
applyCellIndents
(Rectangle box, float topIndent, float rightIndent, float bottomIndent, float leftIndent, boolean reverse) protected TableBorders
applyLeftAndRightTableBorder
(Rectangle layoutBox, boolean reverse) protected TableBorders
applyTopTableBorder
(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) protected TableBorders
applyTopTableBorder
(Rectangle occupiedBox, Rectangle layoutBox, boolean isEmpty, boolean force, boolean reverse) protected void
buildBordersArrays
(CellRenderer cell, int row) protected void
buildBordersArrays
(CellRenderer cell, int row, int col) protected boolean
checkAndReplaceBorderInArray
(List<List<Border>> borderArray, int i, int j, Border borderToAdd, boolean hasPriority) protected TableBorders
collapseTableWithFooter
(TableBorders footerBordersHandler, boolean hasContent) protected TableBorders
collapseTableWithHeader
(TableBorders headerBordersHandler, boolean updateBordersHandler) protected TableBorders
drawHorizontalBorder
(PdfCanvas canvas, TableBorderDescriptor borderDescriptor) protected TableBorders
drawVerticalBorder
(PdfCanvas canvas, TableBorderDescriptor borderDescriptor) protected TableBorders
fixHeaderOccupiedArea
(Rectangle occupiedBox, Rectangle layoutBox) float[]
getCellBorderIndents
(int row, int col, int rowspan, int colspan) protected float
getCellVerticalAddition
(float[] indents) static Border
getCollapsedBorder
(Border cellBorder, Border tableBorder) Returns the collapsed border.getCollapsedList
(List<Border> innerList, List<Border> outerList) getCrossingBorders
(int horizontalIndex, int verticalIndex) Returns theBorder
instances, which intersect in the specified point.getHorizontalBorder
(int index) getVerticalBorder
(int index) Gets vertical borders which cross the top horizontal border.private float
getWidestBorderWidth
(Border... borders) Gets the width of the widest border in the specified list.private static boolean
isBorderWider
(Border thisBorder, Border otherBorder) Compares borders and defines whether this border is wider than the other.private static boolean
isBorderWider
(Border thisBorder, Border otherBorder, boolean strict) Compares borders and defines whether this border is wider than the other.setBottomBorderCollapseWith
(List<Border> bottomBorderCollapseWith, List<Border> verticalBordersCrossingBottomBorder) setTopBorderCollapseWith
(List<Border> topBorderCollapseWith) protected TableBorders
skipFooter
(Border[] borders) protected TableBorders
skipHeader
(Border[] borders) protected TableBorders
updateBordersOnNewPage
(boolean isOriginalNonSplitRenderer, boolean isFooterOrHeader, TableRenderer currentRenderer, TableRenderer headerRenderer, TableRenderer footerRenderer) Methods inherited from class com.itextpdf.layout.renderer.TableBorders
getFinishRow, getFirstHorizontalBorder, getFirstVerticalBorder, getLastHorizontalBorder, getLastVerticalBorder, getLeftBorderMaxWidth, getMaxBottomWidth, getMaxLeftWidth, getMaxRightWidth, getMaxTopWidth, getNumberOfColumns, getRightBorderMaxWidth, getStartRow, getTableBoundingBorders, getWidestHorizontalBorder, getWidestHorizontalBorder, getWidestVerticalBorder, getWidestVerticalBorder, initializeBorders, processAllBordersAndEmptyRows, setFinishRow, setRowRange, setStartRow, setTableBoundingBorders
-
Field Details
-
topBorderCollapseWith
Horizontal borders to be collapsed with the first-on-the-area row's cell top borders of this TableRenderer instance. -
bottomBorderCollapseWith
Horizontal borders to be collapsed with the last-on-the-area row's cell bottom borders of this TableRenderer instance. -
verticalBottomBorderCollapseWith
Vertical borders to be collapsed with the last-on-the-area row's cell bottom borders of this TableRenderer instance. -
borderComparator
-
-
Constructor Details
-
CollapsedTableBorders
public CollapsedTableBorders(List<CellRenderer[]> rows, int numberOfColumns, Border[] tableBoundingBorders) -
CollapsedTableBorders
public CollapsedTableBorders(List<CellRenderer[]> rows, int numberOfColumns, Border[] tableBoundingBorders, int largeTableIndexOffset)
-
-
Method Details
-
getTopBorderCollapseWith
-
getBottomBorderCollapseWith
-
getCellBorderIndents
public float[] getCellBorderIndents(int row, int col, int rowspan, int colspan) - Overrides:
getCellBorderIndents
in classTableBorders
-
getVerticalBordersCrossingTopHorizontalBorder
Gets vertical borders which cross the top horizontal border.- Returns:
- vertical borders which cross the top horizontal border
-
getVerticalBorder
- Specified by:
getVerticalBorder
in classTableBorders
-
getHorizontalBorder
- Specified by:
getHorizontalBorder
in classTableBorders
-
setTopBorderCollapseWith
-
setBottomBorderCollapseWith
public CollapsedTableBorders setBottomBorderCollapseWith(List<Border> bottomBorderCollapseWith, List<Border> verticalBordersCrossingBottomBorder) -
buildBordersArrays
- Specified by:
buildBordersArrays
in classTableBorders
-
buildBordersArrays
-
checkAndReplaceBorderInArray
-
drawHorizontalBorder
protected TableBorders drawHorizontalBorder(PdfCanvas canvas, TableBorderDescriptor borderDescriptor) - Specified by:
drawHorizontalBorder
in classTableBorders
-
drawVerticalBorder
- Specified by:
drawVerticalBorder
in classTableBorders
-
getCollapsedBorder
Returns the collapsed border. We process collapse if the table border width is strictly greater than cell border width.- Parameters:
cellBorder
- cell bordertableBorder
- table border- Returns:
- the collapsed border
-
getCollapsedList
-
applyLeftAndRightTableBorder
- Specified by:
applyLeftAndRightTableBorder
in classTableBorders
-
applyTopTableBorder
protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean isEmpty, boolean force, boolean reverse) - Specified by:
applyTopTableBorder
in classTableBorders
-
applyBottomTableBorder
protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean isEmpty, boolean force, boolean reverse) - Specified by:
applyBottomTableBorder
in classTableBorders
-
applyTopTableBorder
protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) - Specified by:
applyTopTableBorder
in classTableBorders
-
applyBottomTableBorder
protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse) - Specified by:
applyBottomTableBorder
in classTableBorders
-
applyCellIndents
protected TableBorders applyCellIndents(Rectangle box, float topIndent, float rightIndent, float bottomIndent, float leftIndent, boolean reverse) - Specified by:
applyCellIndents
in classTableBorders
-
getCellVerticalAddition
protected float getCellVerticalAddition(float[] indents) - Specified by:
getCellVerticalAddition
in classTableBorders
-
updateBordersOnNewPage
protected TableBorders updateBordersOnNewPage(boolean isOriginalNonSplitRenderer, boolean isFooterOrHeader, TableRenderer currentRenderer, TableRenderer headerRenderer, TableRenderer footerRenderer) - Specified by:
updateBordersOnNewPage
in classTableBorders
-
skipHeader
- Specified by:
skipHeader
in classTableBorders
-
collapseTableWithHeader
protected TableBorders collapseTableWithHeader(TableBorders headerBordersHandler, boolean updateBordersHandler) - Specified by:
collapseTableWithHeader
in classTableBorders
-
fixHeaderOccupiedArea
- Specified by:
fixHeaderOccupiedArea
in classTableBorders
-
getCrossingBorders
Returns theBorder
instances, which intersect in the specified point.The order of the borders: first the left one, then the top, the right and the bottom ones.
- Parameters:
horizontalIndex
- index of horizontal borderverticalIndex
- index of vertical border- Returns:
- a list of
Border
instances, which intersect in the specified point
-
getWidestBorderWidth
Gets the width of the widest border in the specified list.- Parameters:
borders
- the borders which widths should be considered- Returns:
- the width of the widest border in the specified list
-
isBorderWider
Compares borders and defines whether this border is wider than the other.Note that by default the comparison will be strict, e.g. if this border is of the same width as the other border, then false will be returned.
- Parameters:
thisBorder
- this borderotherBorder
- the other border to be compared with- Returns:
- whether this border is wider than the other
-
isBorderWider
Compares borders and defines whether this border is wider than the other.- Parameters:
thisBorder
- this borderotherBorder
- the other border to be compared withstrict
- if true, then in case this border is of the same width as the other border, true will be returned. If false, it will be checked whether the width of this border is strictly greater than the other border's width- Returns:
- whether this border is wider than the other
-