Class HSLFTable

All Implemented Interfaces:
Iterable<HSLFShape>, HSLFShapeContainer, GroupShape<HSLFShape,HSLFTextParagraph>, PlaceableShape<HSLFShape,HSLFTextParagraph>, Shape<HSLFShape,HSLFTextParagraph>, ShapeContainer<HSLFShape,HSLFTextParagraph>, TableShape<HSLFShape,HSLFTextParagraph>

public final class HSLFTable extends HSLFGroupShape implements HSLFShapeContainer, TableShape<HSLFShape,HSLFTextParagraph>
Represents a table in a PowerPoint presentation
Author:
Yegor Kozlov
  • Field Details

  • Constructor Details

    • HSLFTable

      protected HSLFTable(int numRows, int numCols)
      Create a new Table of the given number of rows and columns
      Parameters:
      numRows - the number of rows
      numCols - the number of columns
    • HSLFTable

      protected HSLFTable(int numRows, int numCols, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
      Create a new Table of the given number of rows and columns
      Parameters:
      numRows - the number of rows
      numCols - the number of columns
      parent - the parent shape, or null if table is added to sheet
    • HSLFTable

      protected HSLFTable(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
      Create a Table object and initialize it from the supplied Record container.
      Parameters:
      escherRecord - EscherSpContainer container which holds information about this shape
      parent - the parent of the shape
  • Method Details

    • getCell

      public HSLFTableCell getCell(int row, int col)
      Description copied from interface: TableShape
      Gets a cell
      Specified by:
      getCell in interface TableShape<HSLFShape,HSLFTextParagraph>
      Parameters:
      row - the row index (0-based)
      col - the column index (0-based)
      Returns:
      the cell or null if the cell doesn't exists, e.g. when accessing a merged cell or if the index is out of bounds
    • getNumberOfColumns

      public int getNumberOfColumns()
      Description copied from interface: TableShape
      Return the maximum number of columns. If the table contains merged cells, the number of columns might be less than the maximum.
      Specified by:
      getNumberOfColumns in interface TableShape<HSLFShape,HSLFTextParagraph>
      Returns:
      the maximum number of column
    • getNumberOfRows

      public int getNumberOfRows()
      Description copied from interface: TableShape
      Return the number of rows
      Specified by:
      getNumberOfRows in interface TableShape<HSLFShape,HSLFTextParagraph>
      Returns:
      the row count
    • afterInsert

      protected void afterInsert(HSLFSheet sh)
      Description copied from class: HSLFShape
      Event which fires when a shape is inserted in the sheet. In some cases we need to propagate changes to upper level containers.
      Default implementation does nothing.
      Overrides:
      afterInsert in class HSLFShape
      Parameters:
      sh - - owning shape
    • initTable

      protected void initTable()
    • setSheet

      public void setSheet(HSLFSheet sheet)
      Assign the SlideShow this shape belongs to
      Overrides:
      setSheet in class HSLFShape
      Parameters:
      sheet - owner of this shape
    • getRowHeight

      public double getRowHeight(int row)
      Description copied from interface: TableShape
      Gets the row height
      Specified by:
      getRowHeight in interface TableShape<HSLFShape,HSLFTextParagraph>
      Parameters:
      row - the row index (0-based)
      Returns:
      the height (in points)
    • setRowHeight

      public void setRowHeight(int row, double height)
      Description copied from interface: TableShape
      Sets the row height.
      Specified by:
      setRowHeight in interface TableShape<HSLFShape,HSLFTextParagraph>
      Parameters:
      row - the row index (0-based)
      height - the height to set (in points)
    • getColumnWidth

      public double getColumnWidth(int col)
      Description copied from interface: TableShape
      Gets the width (in points) of the n-th column
      Specified by:
      getColumnWidth in interface TableShape<HSLFShape,HSLFTextParagraph>
      Parameters:
      col - the column index (0-based)
      Returns:
      the width (in points)
    • setColumnWidth

      public void setColumnWidth(int col, double width)
      Description copied from interface: TableShape
      Sets the width (in points) of the n-th column
      Specified by:
      setColumnWidth in interface TableShape<HSLFShape,HSLFTextParagraph>
      Parameters:
      col - the column index (0-based)
      width - the width (in points)
    • getRelativeCell

      protected HSLFTableCell getRelativeCell(HSLFTableCell origin, int row, int col)
    • moveAndScale

      protected void moveAndScale(Rectangle2D anchorDest)
      Description copied from class: HSLFGroupShape
      Moves and scales this ShapeGroup to the specified anchor.
      Overrides:
      moveAndScale in class HSLFGroupShape