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:
Iterable<XSLFTextParagraph>,IAdjustableShape,PlaceableShape<XSLFShape,XSLFTextParagraph>,Shape<XSLFShape,XSLFTextParagraph>,SimpleShape<XSLFShape,XSLFTextParagraph>,TableCell<XSLFShape,XSLFTextParagraph>,TextShape<XSLFShape,XSLFTextParagraph>,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 class org.apache.poi.xslf.usermodel.XSLFShape
XSLFShape.ReparseFactory<T extends XmlObject>
-
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 Rectangle2DgetAnchor()StrokeStyle.LineCapgetBorderCap(TableCell.BorderEdge edge)ColorgetBorderColor(TableCell.BorderEdge edge)StrokeStyle.LineCompoundgetBorderCompound(TableCell.BorderEdge edge)StrokeStyle.LineDashgetBorderDash(TableCell.BorderEdge edge)XDDFLinePropertiesgetBorderProperties(TableCell.BorderEdge edge)StrokeStylegetBorderStyle(TableCell.BorderEdge edge)DoublegetBorderWidth(TableCell.BorderEdge edge)protected org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellPropertiesgetCellProperties(boolean create)ColorgetFillColor()PaintStylegetFillPaint()intgetGridSpan()intgetRowSpan()protected XmlObjectgetShapeProperties()Return the shape specific (visual) propertiesprotected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodygetTextBody(boolean create)TextShape.TextDirectiongetTextDirection()VerticalAlignmentgetVerticalAlignment()protected org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2DgetXfrm()Return a fake-xfrm which is used for calculating the text heightbooleanisMerged()protected org.apache.poi.xslf.usermodel.XSLFTableCell.XSLFCellTextParagraphnewTextParagraph(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph p)Helper method to allow subclasses to provide their own text paragraphvoidremoveBorder(TableCell.BorderEdge edge)voidsetAnchor(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, Color color)voidsetBorderCompound(TableCell.BorderEdge edge, StrokeStyle.LineCompound compound)voidsetBorderDash(TableCell.BorderEdge edge, StrokeStyle.LineDash dash)voidsetBorderProperties(TableCell.BorderEdge edge, XDDFLineProperties properties)voidsetBorderStyle(TableCell.BorderEdge edge, StrokeStyle style)voidsetBorderWidth(TableCell.BorderEdge edge, double width)voidsetBottomInset(double margin)Sets the bottom margin.voidsetFillColor(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)voidsetTopInset(double margin)Sets the top margin.voidsetVerticalAlignment(VerticalAlignment anchor)-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFTextShape
addNewTextParagraph, appendText, clearText, findDefinedParagraphProperty, findDefinedRunProperty, getBottomInset, getInsets, getLeftInset, getRightInset, getText, getTextAutofit, getTextBody, getTextBodyPr, getTextBodyPr, getTextHeight, getTextHeight, getTextParagraphs, getTextPlaceholder, getTextRotation, getTextType, getTopInset, getWordWrap, isHorizontalCentered, iterator, removeTextParagraph, resizeToFitText, resizeToFitText, setHorizontalCentered, setInsets, setPlaceholder, setText, setTextAutofit, setTextPlaceholder, setTextRotation, setWordWrap, spliterator
-
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, getLinePaint, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getRotation, getShadow, getShapeType, getStrokeStyle, getXfrm, 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, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParent
-
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.sl.draw.geom.IAdjustableShape
getAdjustValue
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
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
-
getTextBody
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody getTextBody(boolean create)
- Specified by:
getTextBodyin classXSLFTextShape
-
getCellProperties
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties getCellProperties(boolean create)
-
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()
-
getBorderProperties
public XDDFLineProperties getBorderProperties(TableCell.BorderEdge edge)
-
setBorderProperties
public void setBorderProperties(TableCell.BorderEdge edge, XDDFLineProperties properties)
-
removeBorder
public void removeBorder(TableCell.BorderEdge edge)
- Specified by:
removeBorderin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
getBorderStyle
public StrokeStyle getBorderStyle(TableCell.BorderEdge edge)
- Specified by:
getBorderStylein interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
setBorderStyle
public void setBorderStyle(TableCell.BorderEdge edge, StrokeStyle style)
- Specified by:
setBorderStylein interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
getBorderWidth
public Double getBorderWidth(TableCell.BorderEdge edge)
-
setBorderWidth
public void setBorderWidth(TableCell.BorderEdge edge, double width)
- Specified by:
setBorderWidthin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
setBorderColor
public void setBorderColor(TableCell.BorderEdge edge, Color color)
- Specified by:
setBorderColorin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
getBorderColor
public Color getBorderColor(TableCell.BorderEdge edge)
-
getBorderCompound
public StrokeStyle.LineCompound getBorderCompound(TableCell.BorderEdge edge)
-
setBorderCompound
public void setBorderCompound(TableCell.BorderEdge edge, StrokeStyle.LineCompound compound)
- Specified by:
setBorderCompoundin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
getBorderDash
public StrokeStyle.LineDash getBorderDash(TableCell.BorderEdge edge)
-
setBorderDash
public void setBorderDash(TableCell.BorderEdge edge, StrokeStyle.LineDash dash)
- Specified by:
setBorderDashin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
getBorderCap
public StrokeStyle.LineCap getBorderCap(TableCell.BorderEdge edge)
-
setBorderCap
public void setBorderCap(TableCell.BorderEdge edge, StrokeStyle.LineCap cap)
-
setFillColor
public void setFillColor(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 Color getFillColor()
- Specified by:
getFillColorin interfaceSimpleShape<XSLFShape,XSLFTextParagraph>- Overrides:
getFillColorin classXSLFSimpleShape- Returns:
- solid fill color of null if not set
-
getFillPaint
public PaintStyle getFillPaint()
- Overrides:
getFillPaintin classXSLFShape
-
getGridSpan
public int getGridSpan()
- Specified by:
getGridSpanin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
getRowSpan
public int getRowSpan()
- Specified by:
getRowSpanin interfaceTableCell<XSLFShape,XSLFTextParagraph>
-
setVerticalAlignment
public void setVerticalAlignment(VerticalAlignment anchor)
- Specified by:
setVerticalAlignmentin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
setVerticalAlignmentin classXSLFTextShape
-
getVerticalAlignment
public VerticalAlignment getVerticalAlignment()
- Specified by:
getVerticalAlignmentin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
getVerticalAlignmentin classXSLFTextShape
-
setTextDirection
public void setTextDirection(TextShape.TextDirection orientation)
- Specified by:
setTextDirectionin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
setTextDirectionin classXSLFTextShape- Since:
- POI 3.15-beta2
-
getTextDirection
public TextShape.TextDirection getTextDirection()
- Specified by:
getTextDirectionin interfaceTextShape<XSLFShape,XSLFTextParagraph>- Overrides:
getTextDirectionin classXSLFTextShape- Since:
- POI 3.15-beta2
-
getXfrm
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D getXfrm()
Return a fake-xfrm which is used for calculating the text height
-
setAnchor
public void setAnchor(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- Since:
- POI 3.15-beta2
-
getAnchor
public Rectangle2D getAnchor()
- Specified by:
getAnchorin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Specified by:
getAnchorin interfaceShape<XSLFShape,XSLFTextParagraph>- Overrides:
getAnchorin classXSLFSimpleShape- Since:
- POI 3.15-beta2
-
isMerged
public boolean isMerged()
- Specified by:
isMergedin interfaceTableCell<XSLFShape,XSLFTextParagraph>- Since:
- POI 3.15-beta2
-
newTextParagraph
protected org.apache.poi.xslf.usermodel.XSLFTableCell.XSLFCellTextParagraph newTextParagraph(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph p)
Description copied from class:XSLFTextShapeHelper method to allow subclasses to provide their own text paragraph- Overrides:
newTextParagraphin classXSLFTextShape- Parameters:
p- the xml reference- Returns:
- a new text paragraph
- Since:
- POI 3.15-beta2
-
getShapeProperties
protected XmlObject getShapeProperties()
Description copied from class:XSLFShapeReturn the shape specific (visual) properties- Overrides:
getShapePropertiesin classXSLFShape- Returns:
- the shape specific properties
-
-