Package org.apache.poi.hslf.usermodel
Class HSLFTable
- java.lang.Object
-
- org.apache.poi.hslf.usermodel.HSLFShape
-
- org.apache.poi.hslf.usermodel.HSLFGroupShape
-
- org.apache.poi.hslf.usermodel.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
-
-
Field Summary
Fields Modifier and Type Field Description protected static intBORDERS_ALLprotected static intBORDERS_INSIDEprotected static intBORDERS_NONEprotected static intBORDERS_OUTSIDEprotected HSLFTableCell[][]cells
-
Constructor Summary
Constructors Modifier Constructor Description protectedHSLFTable(int numRows, int numCols)Create a new Table of the given number of rows and columnsprotectedHSLFTable(int numRows, int numCols, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)Create a new Table of the given number of rows and columnsprotectedHSLFTable(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)Create a Table object and initialize it from the supplied Record container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterInsert(HSLFSheet sh)Event which fires when a shape is inserted in the sheet.HSLFTableCellgetCell(int row, int col)doublegetColumnWidth(int col)intgetNumberOfColumns()intgetNumberOfRows()protected HSLFTableCellgetRelativeCell(HSLFTableCell origin, int row, int col)doublegetRowHeight(int row)protected voidinitTable()protected voidmoveAndScale(Rectangle2D anchorDest)Moves and scales thisShapeGroupto the specified anchor.voidsetColumnWidth(int col, double width)voidsetRowHeight(int row, double height)voidsetSheet(HSLFSheet sheet)Assign theSlideShowthis shape belongs to-
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFGroupShape
addShape, createAutoShape, createConnector, createFreeform, createGroup, createOleShape, createPicture, createSpContainer, createTable, createTextBox, getAnchor, getEscherChild, getHyperlink, getInteriorAnchor, getShapes, getShapeType, iterator, removeShape, setAnchor, setExteriorAnchor, setInteriorAnchor, spliterator
-
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
draw, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getSheet, getSpContainer, isPlaceholder, moveTo, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.hslf.usermodel.HSLFShapeContainer
createAutoShape, createConnector, createFreeform, createGroup, createOleShape, createPicture, createTextBox
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
-
Methods inherited from interface org.apache.poi.sl.usermodel.ShapeContainer
addShape, createTable, getShapes, removeShape
-
-
-
-
Field Detail
-
BORDERS_ALL
protected static final int BORDERS_ALL
- See Also:
- Constant Field Values
-
BORDERS_OUTSIDE
protected static final int BORDERS_OUTSIDE
- See Also:
- Constant Field Values
-
BORDERS_INSIDE
protected static final int BORDERS_INSIDE
- See Also:
- Constant Field Values
-
BORDERS_NONE
protected static final int BORDERS_NONE
- See Also:
- Constant Field Values
-
cells
protected HSLFTableCell[][] cells
-
-
Constructor Detail
-
HSLFTable
protected HSLFTable(int numRows, int numCols)Create a new Table of the given number of rows and columns- Parameters:
numRows- the number of rowsnumCols- 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 rowsnumCols- the number of columnsparent- 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-EscherSpContainercontainer which holds information about this shapeparent- the parent of the shape
-
-
Method Detail
-
getCell
public HSLFTableCell getCell(int row, int col)
- Specified by:
getCellin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
getNumberOfColumns
public int getNumberOfColumns()
- Specified by:
getNumberOfColumnsin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
getNumberOfRows
public int getNumberOfRows()
- Specified by:
getNumberOfRowsin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
afterInsert
protected void afterInsert(HSLFSheet sh)
Description copied from class:HSLFShapeEvent 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:
afterInsertin classHSLFShape- Parameters:
sh- - owning shape
-
initTable
protected void initTable()
-
setSheet
public void setSheet(HSLFSheet sheet)
Assign theSlideShowthis shape belongs to
-
getRowHeight
public double getRowHeight(int row)
- Specified by:
getRowHeightin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
setRowHeight
public void setRowHeight(int row, double height)- Specified by:
setRowHeightin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
getColumnWidth
public double getColumnWidth(int col)
- Specified by:
getColumnWidthin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
setColumnWidth
public void setColumnWidth(int col, double width)- Specified by:
setColumnWidthin interfaceTableShape<HSLFShape,HSLFTextParagraph>
-
getRelativeCell
protected HSLFTableCell getRelativeCell(HSLFTableCell origin, int row, int col)
-
moveAndScale
protected void moveAndScale(Rectangle2D anchorDest)
Description copied from class:HSLFGroupShapeMoves and scales thisShapeGroupto the specified anchor.- Overrides:
moveAndScalein classHSLFGroupShape
-
-