org.apache.poi.sl.usermodel
Interface TableShape<S extends Shape<S,P>,P extends TextParagraph<S,P,?>>

All Superinterfaces:
PlaceableShape<S,P>, Shape<S,P>

public interface TableShape<S extends Shape<S,P>,P extends TextParagraph<S,P,?>>
extends Shape<S,P>, PlaceableShape<S,P>


Method Summary
 TableCell<S,P> getCell(int row, int col)
          Gets a cell
 double getColumnWidth(int idx)
          Gets the width (in points) of the n-th column
 int getNumberOfColumns()
          Return the maximum number of columns.
 int getNumberOfRows()
          Return the number of rows
 double getRowHeight(int row)
          Gets the row height
 void setColumnWidth(int idx, double width)
          Sets the width (in points) of the n-th column
 void setRowHeight(int row, double height)
          Sets the row height.
 
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getSheet
 
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
 

Method Detail

getNumberOfColumns

int getNumberOfColumns()
Return the maximum number of columns. If the table contains merged cells, the number of columns might be less than the maximum.

Returns:
the maximum number of column

getNumberOfRows

int getNumberOfRows()
Return the number of rows

Returns:
the row count

getCell

TableCell<S,P> getCell(int row,
                       int col)
Gets a cell

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

getColumnWidth

double getColumnWidth(int idx)
Gets the width (in points) of the n-th column

Parameters:
idx - the column index (0-based)
Returns:
the width (in points)

setColumnWidth

void setColumnWidth(int idx,
                    double width)
Sets the width (in points) of the n-th column

Parameters:
idx - the column index (0-based)
width - the width (in points)

getRowHeight

double getRowHeight(int row)
Gets the row height

Parameters:
row - the row index (0-based)
Returns:
the height (in points)

setRowHeight

void setRowHeight(int row,
                  double height)
Sets the row height.

Parameters:
row - the row index (0-based)
height - the height to set (in points)