Class CollapsedTableBorders

java.lang.Object
com.itextpdf.layout.renderer.TableBorders
com.itextpdf.layout.renderer.CollapsedTableBorders

class CollapsedTableBorders extends TableBorders
  • Field Details

    • topBorderCollapseWith

      private List<Border> topBorderCollapseWith
      Horizontal borders to be collapsed with the first-on-the-area row's cell top borders of this TableRenderer instance.
    • bottomBorderCollapseWith

      private List<Border> bottomBorderCollapseWith
      Horizontal borders to be collapsed with the last-on-the-area row's cell bottom borders of this TableRenderer instance.
    • verticalBottomBorderCollapseWith

      private List<Border> verticalBottomBorderCollapseWith
      Vertical borders to be collapsed with the last-on-the-area row's cell bottom borders of this TableRenderer instance.
    • borderComparator

      private static Comparator<Border> 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

      public List<Border> getTopBorderCollapseWith()
    • getBottomBorderCollapseWith

      public List<Border> getBottomBorderCollapseWith()
    • getCellBorderIndents

      public float[] getCellBorderIndents(int row, int col, int rowspan, int colspan)
      Overrides:
      getCellBorderIndents in class TableBorders
    • getVerticalBordersCrossingTopHorizontalBorder

      public List<Border> getVerticalBordersCrossingTopHorizontalBorder()
      Gets vertical borders which cross the top horizontal border.
      Returns:
      vertical borders which cross the top horizontal border
    • getVerticalBorder

      public List<Border> getVerticalBorder(int index)
      Specified by:
      getVerticalBorder in class TableBorders
    • getHorizontalBorder

      public List<Border> getHorizontalBorder(int index)
      Specified by:
      getHorizontalBorder in class TableBorders
    • setTopBorderCollapseWith

      public CollapsedTableBorders setTopBorderCollapseWith(List<Border> topBorderCollapseWith)
    • setBottomBorderCollapseWith

      public CollapsedTableBorders setBottomBorderCollapseWith(List<Border> bottomBorderCollapseWith, List<Border> verticalBordersCrossingBottomBorder)
    • buildBordersArrays

      protected void buildBordersArrays(CellRenderer cell, int row, int col, int[] rowspansToDeduct)
      Specified by:
      buildBordersArrays in class TableBorders
    • buildBordersArrays

      protected void buildBordersArrays(CellRenderer cell, int row, boolean isNeighbourCell)
    • checkAndReplaceBorderInArray

      protected boolean checkAndReplaceBorderInArray(List<List<Border>> borderArray, int i, int j, Border borderToAdd, boolean hasPriority)
    • drawHorizontalBorder

      protected TableBorders drawHorizontalBorder(PdfCanvas canvas, TableBorderDescriptor borderDescriptor)
      Specified by:
      drawHorizontalBorder in class TableBorders
    • drawVerticalBorder

      protected TableBorders drawVerticalBorder(PdfCanvas canvas, TableBorderDescriptor borderDescriptor)
      Specified by:
      drawVerticalBorder in class TableBorders
    • getCollapsedBorder

      public static Border getCollapsedBorder(Border cellBorder, Border tableBorder)
      Returns the collapsed border. We process collapse if the table border width is strictly greater than cell border width.
      Parameters:
      cellBorder - cell border
      tableBorder - table border
      Returns:
      the collapsed border
    • getCollapsedList

      public static List<Border> getCollapsedList(List<Border> innerList, List<Border> outerList)
    • applyLeftAndRightTableBorder

      protected TableBorders applyLeftAndRightTableBorder(Rectangle layoutBox, boolean reverse)
      Specified by:
      applyLeftAndRightTableBorder in class TableBorders
    • applyTopTableBorder

      protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean isEmpty, boolean force, boolean reverse)
      Specified by:
      applyTopTableBorder in class TableBorders
    • applyBottomTableBorder

      protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean isEmpty, boolean force, boolean reverse)
      Specified by:
      applyBottomTableBorder in class TableBorders
    • applyTopTableBorder

      protected TableBorders applyTopTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse)
      Specified by:
      applyTopTableBorder in class TableBorders
    • applyBottomTableBorder

      protected TableBorders applyBottomTableBorder(Rectangle occupiedBox, Rectangle layoutBox, boolean reverse)
      Specified by:
      applyBottomTableBorder in class TableBorders
    • applyCellIndents

      protected TableBorders applyCellIndents(Rectangle box, float topIndent, float rightIndent, float bottomIndent, float leftIndent, boolean reverse)
      Specified by:
      applyCellIndents in class TableBorders
    • getCellVerticalAddition

      protected float getCellVerticalAddition(float[] indents)
      Specified by:
      getCellVerticalAddition in class TableBorders
    • updateBordersOnNewPage

      protected TableBorders updateBordersOnNewPage(boolean isOriginalNonSplitRenderer, boolean isFooterOrHeader, TableRenderer currentRenderer, TableRenderer headerRenderer, TableRenderer footerRenderer)
      Specified by:
      updateBordersOnNewPage in class TableBorders
    • skipFooter

      protected TableBorders skipFooter(Border[] borders)
      Specified by:
      skipFooter in class TableBorders
    • skipHeader

      protected TableBorders skipHeader(Border[] borders)
      Specified by:
      skipHeader in class TableBorders
    • collapseTableWithFooter

      protected TableBorders collapseTableWithFooter(TableBorders footerBordersHandler, boolean hasContent)
      Specified by:
      collapseTableWithFooter in class TableBorders
    • collapseTableWithHeader

      protected TableBorders collapseTableWithHeader(TableBorders headerBordersHandler, boolean updateBordersHandler)
      Specified by:
      collapseTableWithHeader in class TableBorders
    • fixHeaderOccupiedArea

      protected TableBorders fixHeaderOccupiedArea(Rectangle occupiedBox, Rectangle layoutBox)
      Specified by:
      fixHeaderOccupiedArea in class TableBorders
    • getCrossingBorders

      List<Border> getCrossingBorders(int horizontalIndex, int verticalIndex)
      Returns the Border 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 border
      verticalIndex - index of vertical border
      Returns:
      a list of Border instances, which intersect in the specified point
    • getWidestBorderWidth

      private float getWidestBorderWidth(Border... borders)
      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

      private static boolean isBorderWider(Border thisBorder, Border otherBorder)
      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 border
      otherBorder - the other border to be compared with
      Returns:
      whether this border is wider than the other
    • isBorderWider

      private static boolean isBorderWider(Border thisBorder, Border otherBorder, boolean strict)
      Compares borders and defines whether this border is wider than the other.
      Parameters:
      thisBorder - this border
      otherBorder - the other border to be compared with
      strict - 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