Package org.apache.poi.xslf.usermodel
Class XSLFTableCell
- java.lang.Object
 - 
- org.apache.poi.xslf.usermodel.XSLFShape
 - 
- org.apache.poi.xslf.usermodel.XSLFSimpleShape
 - 
- org.apache.poi.xslf.usermodel.XSLFTextShape
 - 
- org.apache.poi.xslf.usermodel.XSLFTableCell
 
 
 
 
 
- 
- All Implemented Interfaces:
 java.lang.Iterable<XSLFTextParagraph>,IAdjustableShape,PlaceableShape<XSLFShape,XSLFTextParagraph>,Shape<XSLFShape,XSLFTextParagraph>,SimpleShape<XSLFShape,XSLFTextParagraph>,TableCell<XSLFShape,XSLFTextParagraph>,TextShape<XSLFShape,XSLFTextParagraph>,org.apache.poi.xddf.usermodel.text.TextContainer
public class XSLFTableCell extends XSLFTextShape implements TableCell<XSLFShape,XSLFTextParagraph>
Represents a cell of a table in a .pptx presentation 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TableCell
TableCell.BorderEdge 
- 
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextShape
TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder 
 - 
 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2DgetAnchor()Returns the anchor (the bounding box rectangle) of this shape.StrokeStyle.LineCapgetBorderCap(TableCell.BorderEdge edge)java.awt.ColorgetBorderColor(TableCell.BorderEdge edge)StrokeStyle.LineCompoundgetBorderCompound(TableCell.BorderEdge edge)StrokeStyle.LineDashgetBorderDash(TableCell.BorderEdge edge)StrokeStylegetBorderStyle(TableCell.BorderEdge edge)Return line style of given edge ornullif border is not definedjava.lang.DoublegetBorderWidth(TableCell.BorderEdge edge)java.awt.ColorgetFillColor()Returns the solid color fill.PaintStylegetFillPaint()intgetGridSpan()Get the number of columns to be spanned/mergedintgetRowSpan()Get the number of rows to be spanned/mergedTextShape.TextDirectiongetTextDirection()VerticalAlignmentgetVerticalAlignment()Returns the type of vertical alignment for the text.booleanisMerged()Return if this cell is part of a merged cell.voidremoveBorder(TableCell.BorderEdge edge)Remove all line attributes of the given border edgevoidsetAnchor(java.awt.geom.Rectangle2D anchor)There's no real anchor for table cells - this method is used to temporarily store the location of the cell for a later retrieval, e.g.voidsetBorderCap(TableCell.BorderEdge edge, StrokeStyle.LineCap cap)voidsetBorderColor(TableCell.BorderEdge edge, java.awt.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.voidsetBottomInset(double margin)Sets the bottom margin.voidsetFillColor(java.awt.Color color)Specifies a solid color fill.voidsetLeftInset(double margin)Sets the left margin.voidsetRightInset(double margin)Sets the right margin.voidsetTextDirection(TextShape.TextDirection orientation)sets the vertical orientationvoidsetTopInset(double margin)Sets the top margin.voidsetVerticalAlignment(VerticalAlignment anchor)Sets the type of vertical alignment for the text.- 
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFTextShape
addNewTextParagraph, appendText, clearText, findDefinedParagraphProperty, findDefinedRunProperty, getBottomInset, getInsets, getLeftInset, getRightInset, getText, getTextAutofit, getTextBody, getTextHeight, getTextHeight, getTextParagraphs, getTextPlaceholder, getTextRotation, getTextType, getTopInset, getWordWrap, isHorizontalCentered, iterator, resizeToFitText, resizeToFitText, setHorizontalCentered, setInsets, setPlaceholder, setText, setTextAutofit, setTextPlaceholder, setTextRotation, setWordWrap 
- 
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFSimpleShape
createHyperlink, getAdjustValue, getFillStyle, getFlipHorizontal, getFlipVertical, getGeometry, getHyperlink, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getRotation, getShadow, getShapeType, getStrokeStyle, setFlipHorizontal, setFlipVertical, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setRotation, setShapeType, setStrokeStyle 
- 
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getSheet, getXmlObject, isPlaceholder, setParent 
- 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.poi.sl.draw.geom.IAdjustableShape
getAdjustValue 
- 
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setFlipHorizontal, setFlipVertical, setRotation 
- 
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getShapeId, getShapeName, getSheet 
- 
Methods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
createHyperlink, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getPlaceholderDetails, getShadow, getShapeType, getStrokeStyle, isPlaceholder, setPlaceholder, setShapeType, setStrokeStyle 
- 
Methods inherited from interface org.apache.poi.sl.usermodel.TextShape
appendText, getInsets, getText, getTextHeight, getTextHeight, getTextParagraphs, getTextPlaceholder, getTextRotation, getWordWrap, isHorizontalCentered, resizeToFitText, resizeToFitText, setHorizontalCentered, setInsets, setText, setTextPlaceholder, setTextRotation, setWordWrap 
 - 
 
 - 
 
- 
- 
Method Detail
- 
setLeftInset
public void setLeftInset(double margin)
Description copied from class:XSLFTextShapeSets the left margin.- Overrides:
 setLeftInsetin classXSLFTextShape- Parameters:
 margin- the left margin- See Also:
 XSLFTextShape.getLeftInset()
 
- 
setRightInset
public void setRightInset(double margin)
Description copied from class:XSLFTextShapeSets the right margin.- Overrides:
 setRightInsetin classXSLFTextShape- Parameters:
 margin- the right margin- See Also:
 XSLFTextShape.getRightInset()
 
- 
setTopInset
public void setTopInset(double margin)
Description copied from class:XSLFTextShapeSets the top margin.- Overrides:
 setTopInsetin classXSLFTextShape- Parameters:
 margin- the top margin- See Also:
 XSLFTextShape.getTopInset()
 
- 
setBottomInset
public void setBottomInset(double margin)
Description copied from class:XSLFTextShapeSets the bottom margin.- Overrides:
 setBottomInsetin classXSLFTextShape- Parameters:
 margin- the bottom margin- See Also:
 XSLFTextShape.getBottomInset()
 
- 
removeBorder
public void removeBorder(TableCell.BorderEdge edge)
Description copied from interface:TableCellRemove all line attributes of the given border edge- Specified by:
 removeBorderin interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- the border edge to be cleared
 
- 
getBorderStyle
public StrokeStyle getBorderStyle(TableCell.BorderEdge edge)
Description copied from interface:TableCellReturn line style of given edge ornullif border is not defined- Specified by:
 getBorderStylein interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- the border edge- Returns:
 - line style of given edge or 
nullif border is not defined 
 
- 
setBorderStyle
public void setBorderStyle(TableCell.BorderEdge edge, StrokeStyle style)
Description copied from interface:TableCellSets theStrokeStyleof the given border edge. Anullproperty of the style is ignored.- Specified by:
 setBorderStylein interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- border edgestyle- the new stroke style
 
- 
getBorderWidth
public java.lang.Double getBorderWidth(TableCell.BorderEdge edge)
 
- 
setBorderWidth
public void setBorderWidth(TableCell.BorderEdge edge, double width)
Description copied from interface:TableCellConvenience method for setting the border width.- Specified by:
 setBorderWidthin interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- border edgewidth- the new border width
 
- 
setBorderColor
public void setBorderColor(TableCell.BorderEdge edge, java.awt.Color color)
Description copied from interface:TableCellConvenience method for setting the border color.- Specified by:
 setBorderColorin interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- border edgecolor- the new border color
 
- 
getBorderColor
public java.awt.Color getBorderColor(TableCell.BorderEdge edge)
 
- 
getBorderCompound
public StrokeStyle.LineCompound getBorderCompound(TableCell.BorderEdge edge)
 
- 
setBorderCompound
public void setBorderCompound(TableCell.BorderEdge edge, StrokeStyle.LineCompound compound)
Description copied from interface:TableCellConvenience method for setting the border line compound.- Specified by:
 setBorderCompoundin interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- border edgecompound- the new border line compound
 
- 
getBorderDash
public StrokeStyle.LineDash getBorderDash(TableCell.BorderEdge edge)
 
- 
setBorderDash
public void setBorderDash(TableCell.BorderEdge edge, StrokeStyle.LineDash dash)
Description copied from interface:TableCellConvenience method for setting the border line dash.- Specified by:
 setBorderDashin interfaceTableCell<XSLFShape,XSLFTextParagraph>- Parameters:
 edge- border edgedash- the new border line dash
 
- 
getBorderCap
public StrokeStyle.LineCap getBorderCap(TableCell.BorderEdge edge)
 
- 
setBorderCap
public void setBorderCap(TableCell.BorderEdge edge, StrokeStyle.LineCap cap)
 
- 
setFillColor
public void setFillColor(java.awt.Color color)
Specifies a solid color fill. The shape is filled entirely with the specified color.- Specified by:
 setFillColorin interfaceSimpleShape<XSLFShape,XSLFTextParagraph>- Overrides:
 setFillColorin classXSLFSimpleShape- Parameters:
 color- the solid color fill. The value ofnullunsets the solidFIll attribute from the underlying xml
 
- 
getFillColor
public java.awt.Color getFillColor()
Description copied from interface:SimpleShapeReturns the solid color fill.- Specified by:
 getFillColorin interfaceSimpleShape<XSLFShape,XSLFTextParagraph>- Overrides:
 getFillColorin classXSLFSimpleShape- Returns:
 - solid fill color of null if not set
 
 
- 
getFillPaint
public PaintStyle getFillPaint()
 
- 
getGridSpan
public int getGridSpan()
Description copied from interface:TableCellGet the number of columns to be spanned/merged- Specified by:
 getGridSpanin interfaceTableCell<XSLFShape,XSLFTextParagraph>- 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<XSLFShape,XSLFTextParagraph>- Returns:
 - the row span
 
 
- 
setVerticalAlignment
public void setVerticalAlignment(VerticalAlignment anchor)
Description copied from interface:TextShapeSets the type of vertical alignment for the text.- Specified by:
 setVerticalAlignmentin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
 setVerticalAlignmentin classXSLFTextShape- Parameters:
 anchor- - the type of alignment. Anullvalues unsets this property.
 
- 
getVerticalAlignment
public VerticalAlignment getVerticalAlignment()
Description copied from interface:TextShapeReturns the type of vertical alignment for the text.- Specified by:
 getVerticalAlignmentin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
 getVerticalAlignmentin classXSLFTextShape- Returns:
 - the type of vertical alignment
 
 
- 
setTextDirection
public void setTextDirection(TextShape.TextDirection orientation)
Description copied from interface:TextShapesets the vertical orientation- Specified by:
 setTextDirectionin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
 setTextDirectionin classXSLFTextShape- Parameters:
 orientation- vertical orientation of the text- Since:
 - POI 3.15-beta2
 
 
- 
getTextDirection
public TextShape.TextDirection getTextDirection()
- Specified by:
 getTextDirectionin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
 getTextDirectionin classXSLFTextShape- Returns:
 - vertical orientation of the text
 - Since:
 - POI 3.15-beta2
 
 
- 
setAnchor
public void setAnchor(java.awt.geom.Rectangle2D anchor)
There's no real anchor for table cells - this method is used to temporarily store the location of the cell for a later retrieval, e.g. for rendering- Specified by:
 setAnchorin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Overrides:
 setAnchorin classXSLFSimpleShape- Parameters:
 anchor- the position of this shape within the drawing canvas. The coordinates are expressed in points- Since:
 - POI 3.15-beta2
 
 
- 
getAnchor
public java.awt.geom.Rectangle2D getAnchor()
Description copied from interface:ShapeReturns the anchor (the bounding box rectangle) of this shape. All coordinates are expressed in points (72 dpi).- Specified by:
 getAnchorin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Specified by:
 getAnchorin interfaceShape<XSLFShape,XSLFTextParagraph>- Overrides:
 getAnchorin classXSLFSimpleShape- Returns:
 - the anchor of this shape
 - Since:
 - POI 3.15-beta2
 
 
- 
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<XSLFShape,XSLFTextParagraph>- Returns:
 - true if this a merged cell
 - Since:
 - POI 3.15-beta2
 
 
 - 
 
 -