Package org.apache.poi.hslf.usermodel
Class HSLFTableCell
java.lang.Object
org.apache.poi.hslf.usermodel.HSLFShape
org.apache.poi.hslf.usermodel.HSLFSimpleShape
org.apache.poi.hslf.usermodel.HSLFTextShape
org.apache.poi.hslf.usermodel.HSLFTextBox
org.apache.poi.hslf.usermodel.HSLFTableCell
- All Implemented Interfaces:
Iterable<HSLFTextParagraph>,IAdjustableShape,AutoShape<HSLFShape,,HSLFTextParagraph> PlaceableShape<HSLFShape,,HSLFTextParagraph> Shape<HSLFShape,,HSLFTextParagraph> SimpleShape<HSLFShape,,HSLFTextParagraph> TableCell<HSLFShape,,HSLFTextParagraph> TextBox<HSLFShape,,HSLFTextParagraph> TextShape<HSLFShape,HSLFTextParagraph>
public final class HSLFTableCell
extends HSLFTextBox
implements TableCell<HSLFShape,HSLFTextParagraph>
Represents a cell in a ppt table
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TableCell
TableCell.BorderEdgeNested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextShape
TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intFields inherited from class org.apache.poi.hslf.usermodel.HSLFTextShape
WrapByPoints, WrapNone, WrapSquare, WrapThrough, WrapTopBottomFields inherited from class org.apache.poi.hslf.usermodel.HSLFSimpleShape
_hyperlink, DEFAULT_LINE_WIDTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHSLFTableCell(EscherContainerRecord escherRecord, HSLFTable parent) Create a TableCell object and initialize it from the supplied Record container.HSLFTableCell(HSLFTable parent) Create a new TableCell. -
Method Summary
Modifier and TypeMethodDescriptionprotected HSLFLineaddLine(TableCell.BorderEdge edge) protected voidapplyLineProperties(TableCell.BorderEdge edge, HSLFLine other) protected EscherContainerRecordcreateSpContainer(boolean isChild) Create a new TextBox and initialize its internal structuresReturn line style of given edge ornullif border is not definedintGet the number of columns to be spanned/mergedintGet the number of rows to be spanned/mergedprotected HSLFTableCellgetSiblingCell(int row, int col) booleanisMerged()Return if this cell is part of a merged cell.voidRemove all line attributes of the given border edgevoidsetAnchor(Rectangle2D anchor) Sets the anchor (the bounding box rectangle) of this shape.voidsetBorderColor(TableCell.BorderEdge edge, Color color) Convenience method for setting the border color.voidsetBorderCompound(TableCell.BorderEdge edge, StrokeStyle.LineCompound compound) Convenience method for setting the border line compound.voidsetBorderDash(TableCell.BorderEdge edge, StrokeStyle.LineDash dash) Convenience method for setting the border line dash.voidsetBorderStyle(TableCell.BorderEdge edge, StrokeStyle style) Sets theStrokeStyleof the given border edge.voidsetBorderWidth(TableCell.BorderEdge edge, double width) Convenience method for setting the border width.protected voidsetGridSpan(int gridSpan) Set the gridSpan (aka col-span)protected voidsetRowSpan(int rowSpan) Set the rowSpanMethods inherited from class org.apache.poi.hslf.usermodel.HSLFTextBox
setDefaultTextPropertiesMethods inherited from class org.apache.poi.hslf.usermodel.HSLFTextShape
afterInsert, appendText, getBottomInset, getEscherTextboxWrapper, getHFPlaceholderAtom, getHyperlinks, getInsets, getLeftInset, getMetroShape, getPlaceholderAtom, getRawText, getRightInset, getRunType, getText, getTextDirection, getTextHeight, getTextHeight, getTextId, getTextParagraphs, getTextPlaceholder, getTextRotation, getTopInset, getVerticalAlignment, getWordWrap, getWordWrapEx, isAlignToBaseline, isHorizontalCentered, isPlaceholder, iterator, resizeToFitText, resizeToFitText, setAlignToBaseline, setBottomInset, setHorizontalCentered, setInsets, setLeftInset, setRightInset, setRunType, setSheet, setText, setTextDirection, setTextId, setTextPlaceholder, setTextRotation, setTopInset, setVerticalAlignment, setWordWrap, setWordWrapEx, storeTextMethods inherited from class org.apache.poi.hslf.usermodel.HSLFSimpleShape
createHyperlink, getAdjustValue, getFillColor, getGeometry, getHyperlink, getLineBackgroundColor, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getPlaceholder, getPlaceholderDetails, getShadow, getShadowAngle, getShadowColor, getShadowDistance, getStrokeStyle, setFillColor, setHyperlink, setLineBackgroundColor, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setPlaceholder, setStrokeStyleMethods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
draw, getAnchor, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getRotation, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.sl.draw.geom.IAdjustableShape
getAdjustValueMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getRotation, getSheet, setFlipHorizontal, setFlipVertical, setRotationMethods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getShapeId, getShapeName, getSheetMethods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
createHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getPlaceholderDetails, getShadow, getShapeType, getStrokeStyle, isPlaceholder, setFillColor, setPlaceholder, setShapeType, setStrokeStyleMethods inherited from interface org.apache.poi.sl.usermodel.TextShape
appendText, getInsets, getText, getTextDirection, getTextHeight, getTextHeight, getTextParagraphs, getTextPlaceholder, getTextRotation, getVerticalAlignment, getWordWrap, isHorizontalCentered, resizeToFitText, resizeToFitText, setHorizontalCentered, setInsets, setText, setTextDirection, setTextPlaceholder, setTextRotation, setVerticalAlignment, setWordWrap
-
Field Details
-
DEFAULT_WIDTH
protected static final int DEFAULT_WIDTH- See Also:
-
DEFAULT_HEIGHT
protected static final int DEFAULT_HEIGHT- See Also:
-
-
Constructor Details
-
HSLFTableCell
Create a TableCell object and initialize it from the supplied Record container.- Parameters:
escherRecord- EscherSpContainer which holds information about this shapeparent- the parent of the shape
-
HSLFTableCell
Create a new TableCell. This constructor is used when a new shape is created.- Parameters:
parent- the parent of this Shape. For example, if this text box is a cell in a table then the parent is Table.
-
-
Method Details
-
createSpContainer
Description copied from class:HSLFTextBoxCreate a new TextBox and initialize its internal structures- Overrides:
createSpContainerin classHSLFTextBox- Parameters:
isChild-trueif the Line is inside a group,falseotherwise- Returns:
- the created
EscherContainerRecordwhich holds shape data
-
setAnchor
Description copied from class:HSLFShapeSets the anchor (the bounding box rectangle) of this shape. All coordinates should be expressed in points (72 dpi).- Specified by:
setAnchorin interfacePlaceableShape<HSLFShape,HSLFTextParagraph> - Overrides:
setAnchorin classHSLFShape- Parameters:
anchor- new anchor
-
getBorderStyle
Description copied from interface:TableCellReturn line style of given edge ornullif border is not defined- Specified by:
getBorderStylein interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- the border edge- Returns:
- line style of given edge or
nullif border is not defined
-
setBorderStyle
Description copied from interface:TableCellSets theStrokeStyleof the given border edge. Anullproperty of the style is ignored.- Specified by:
setBorderStylein interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- border edgestyle- the new stroke style
-
getBorderWidth
-
setBorderWidth
Description copied from interface:TableCellConvenience method for setting the border width.- Specified by:
setBorderWidthin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- border edgewidth- the new border width
-
getBorderColor
-
setBorderColor
Description copied from interface:TableCellConvenience method for setting the border color.- Specified by:
setBorderColorin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- border edgecolor- the new border color
-
getBorderDash
-
setBorderDash
Description copied from interface:TableCellConvenience method for setting the border line dash.- Specified by:
setBorderDashin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- border edgedash- the new border line dash
-
getBorderCompound
-
setBorderCompound
Description copied from interface:TableCellConvenience method for setting the border line compound.- Specified by:
setBorderCompoundin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- border edgecompound- the new border line compound
-
addLine
-
removeBorder
Description copied from interface:TableCellRemove all line attributes of the given border edge- Specified by:
removeBorderin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Parameters:
edge- the border edge to be cleared
-
getSiblingCell
-
applyLineProperties
-
getParent
- Specified by:
getParentin interfacePlaceableShape<HSLFShape,HSLFTextParagraph> - Specified by:
getParentin interfaceShape<HSLFShape,HSLFTextParagraph> - Overrides:
getParentin classHSLFShape- Returns:
- the parent of this shape
-
setGridSpan
protected void setGridSpan(int gridSpan) Set the gridSpan (aka col-span)- Parameters:
gridSpan- the number of columns to be spanned/merged- Since:
- POI 3.15-beta2
-
setRowSpan
protected void setRowSpan(int rowSpan) Set the rowSpan- Parameters:
rowSpan- the number of rows to be spanned/merged- Since:
- POI 3.15-beta2
-
getGridSpan
public int getGridSpan()Description copied from interface:TableCellGet the number of columns to be spanned/merged- Specified by:
getGridSpanin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Returns:
- the grid span
-
getRowSpan
public int getRowSpan()Description copied from interface:TableCellGet the number of rows to be spanned/merged- Specified by:
getRowSpanin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Returns:
- the row span
-
isMerged
public boolean isMerged()Description copied from interface:TableCellReturn if this cell is part of a merged cell. The top/left cell of a merged region is not regarded as merged - its grid and/or row span is greater than one.- Specified by:
isMergedin interfaceTableCell<HSLFShape,HSLFTextParagraph> - Returns:
- true if this a merged cell
-