org.apache.poi.xslf.usermodel
Class XSLFTableCell

java.lang.Object
  extended by org.apache.poi.xslf.usermodel.XSLFShape
      extended by org.apache.poi.xslf.usermodel.XSLFSimpleShape
          extended by org.apache.poi.xslf.usermodel.XSLFTextShape
              extended by 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>

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
 
Field Summary
 
Fields inherited from class org.apache.poi.xslf.usermodel.XSLFShape
PML_NS
 
Method Summary
 java.awt.geom.Rectangle2D getAnchor()
           
 StrokeStyle.LineCap getBorderCap(TableCell.BorderEdge edge)
           
 java.awt.Color getBorderColor(TableCell.BorderEdge edge)
           
 StrokeStyle.LineCompound getBorderCompound(TableCell.BorderEdge edge)
           
 StrokeStyle.LineDash getBorderDash(TableCell.BorderEdge edge)
           
 StrokeStyle getBorderStyle(TableCell.BorderEdge edge)
           
 java.lang.Double getBorderWidth(TableCell.BorderEdge edge)
           
protected  org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties getCellProperties(boolean create)
           
 java.awt.Color getFillColor()
           
 PaintStyle getFillPaint()
           
 int getGridSpan()
           
 int getRowSpan()
           
protected  org.apache.xmlbeans.XmlObject getShapeProperties()
          Return the shape specific (visual) properties
protected  org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody getTextBody(boolean create)
           
 TextShape.TextDirection getTextDirection()
           
 VerticalAlignment getVerticalAlignment()
           
protected  org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D getXfrm()
          Return a fake-xfrm which is used for calculating the text height
 boolean isMerged()
           
protected  org.apache.poi.xslf.usermodel.XSLFTableCell.XSLFCellTextParagraph newTextParagraph(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph p)
          Helper method to allow subclasses to provide their own text paragraph
 void removeBorder(TableCell.BorderEdge edge)
           
 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.
 void setBorderCap(TableCell.BorderEdge edge, StrokeStyle.LineCap cap)
           
 void setBorderColor(TableCell.BorderEdge edge, java.awt.Color color)
           
 void setBorderCompound(TableCell.BorderEdge edge, StrokeStyle.LineCompound compound)
           
 void setBorderDash(TableCell.BorderEdge edge, StrokeStyle.LineDash dash)
           
 void setBorderStyle(TableCell.BorderEdge edge, StrokeStyle style)
           
 void setBorderWidth(TableCell.BorderEdge edge, double width)
           
 void setBottomInset(double margin)
          Sets the bottom margin.
 void setFillColor(java.awt.Color color)
          Specifies a solid color fill.
 void setLeftInset(double margin)
          Sets the left margin.
 void setRightInset(double margin)
          Sets the right margin.
 void setTextDirection(TextShape.TextDirection orientation)
           
 void setTopInset(double margin)
          Sets the top margin.
 void setVerticalAlignment(VerticalAlignment anchor)
           
 
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFTextShape
addNewTextParagraph, appendText, clearText, getBottomInset, getInsets, getLeftInset, getRightInset, getText, getTextAutofit, getTextBodyPr, getTextBodyPr, 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, getLinePaint, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getRotation, getShadow, getShapeType, getStrokeStyle, getXfrm, isPlaceholder, 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, getCTPlaceholder, getGrpSpPr, getParent, getPlaceholder, getShapeId, getShapeName, getSheet, getSpStyle, getXmlObject, 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.usermodel.TextShape
appendText, getInsets, getText, getTextHeight, getTextHeight, getTextParagraphs, getTextPlaceholder, getTextRotation, getWordWrap, isHorizontalCentered, resizeToFitText, resizeToFitText, setHorizontalCentered, setInsets, setText, setTextPlaceholder, setTextRotation, setWordWrap
 
Methods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
createHyperlink, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getShadow, getShapeType, getStrokeStyle, setPlaceholder, setShapeType, setStrokeStyle
 
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getSheet
 
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 java.lang.Iterable
iterator
 

Method Detail

getTextBody

protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody getTextBody(boolean create)
Specified by:
getTextBody in class XSLFTextShape

getCellProperties

protected org.openxmlformats.schemas.drawingml.x2006.main.CTTableCellProperties getCellProperties(boolean create)

setLeftInset

public void setLeftInset(double margin)
Description copied from class: XSLFTextShape
Sets the left margin.

Overrides:
setLeftInset in class XSLFTextShape
Parameters:
margin - the left margin
See Also:
XSLFTextShape.getLeftInset()

setRightInset

public void setRightInset(double margin)
Description copied from class: XSLFTextShape
Sets the right margin.

Overrides:
setRightInset in class XSLFTextShape
Parameters:
margin - the right margin
See Also:
XSLFTextShape.getRightInset()

setTopInset

public void setTopInset(double margin)
Description copied from class: XSLFTextShape
Sets the top margin.

Overrides:
setTopInset in class XSLFTextShape
Parameters:
margin - the top margin
See Also:
XSLFTextShape.getTopInset()

setBottomInset

public void setBottomInset(double margin)
Description copied from class: XSLFTextShape
Sets the bottom margin.

Overrides:
setBottomInset in class XSLFTextShape
Parameters:
margin - the bottom margin
See Also:
XSLFTextShape.getBottomInset()

removeBorder

public void removeBorder(TableCell.BorderEdge edge)
Specified by:
removeBorder in interface TableCell<XSLFShape,XSLFTextParagraph>

getBorderStyle

public StrokeStyle getBorderStyle(TableCell.BorderEdge edge)
Specified by:
getBorderStyle in interface TableCell<XSLFShape,XSLFTextParagraph>

setBorderStyle

public void setBorderStyle(TableCell.BorderEdge edge,
                           StrokeStyle style)
Specified by:
setBorderStyle in interface TableCell<XSLFShape,XSLFTextParagraph>

getBorderWidth

public java.lang.Double getBorderWidth(TableCell.BorderEdge edge)

setBorderWidth

public void setBorderWidth(TableCell.BorderEdge edge,
                           double width)
Specified by:
setBorderWidth in interface TableCell<XSLFShape,XSLFTextParagraph>

setBorderColor

public void setBorderColor(TableCell.BorderEdge edge,
                           java.awt.Color color)
Specified by:
setBorderColor in interface TableCell<XSLFShape,XSLFTextParagraph>

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)
Specified by:
setBorderCompound in interface TableCell<XSLFShape,XSLFTextParagraph>

getBorderDash

public StrokeStyle.LineDash getBorderDash(TableCell.BorderEdge edge)

setBorderDash

public void setBorderDash(TableCell.BorderEdge edge,
                          StrokeStyle.LineDash dash)
Specified by:
setBorderDash in interface TableCell<XSLFShape,XSLFTextParagraph>

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:
setFillColor in interface SimpleShape<XSLFShape,XSLFTextParagraph>
Overrides:
setFillColor in class XSLFSimpleShape
Parameters:
color - the solid color fill. The value of null unsets the solidFIll attribute from the underlying xml

getFillColor

public java.awt.Color getFillColor()
Specified by:
getFillColor in interface SimpleShape<XSLFShape,XSLFTextParagraph>
Overrides:
getFillColor in class XSLFSimpleShape
Returns:
solid fill color of null if not set

getFillPaint

public PaintStyle getFillPaint()
Overrides:
getFillPaint in class XSLFShape

getGridSpan

public int getGridSpan()
Specified by:
getGridSpan in interface TableCell<XSLFShape,XSLFTextParagraph>

getRowSpan

public int getRowSpan()
Specified by:
getRowSpan in interface TableCell<XSLFShape,XSLFTextParagraph>

setVerticalAlignment

public void setVerticalAlignment(VerticalAlignment anchor)
Specified by:
setVerticalAlignment in interface TextShape<XSLFShape,XSLFTextParagraph>
Overrides:
setVerticalAlignment in class XSLFTextShape

getVerticalAlignment

public VerticalAlignment getVerticalAlignment()
Specified by:
getVerticalAlignment in interface TextShape<XSLFShape,XSLFTextParagraph>
Overrides:
getVerticalAlignment in class XSLFTextShape

setTextDirection

public void setTextDirection(TextShape.TextDirection orientation)
Specified by:
setTextDirection in interface TextShape<XSLFShape,XSLFTextParagraph>
Overrides:
setTextDirection in class XSLFTextShape
Since:
POI 3.15-beta2

getTextDirection

public TextShape.TextDirection getTextDirection()
Specified by:
getTextDirection in interface TextShape<XSLFShape,XSLFTextParagraph>
Overrides:
getTextDirection in class XSLFTextShape
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(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:
setAnchor in interface PlaceableShape<XSLFShape,XSLFTextParagraph>
Overrides:
setAnchor in class XSLFSimpleShape
Since:
POI 3.15-beta2

getAnchor

public java.awt.geom.Rectangle2D getAnchor()
Specified by:
getAnchor in interface PlaceableShape<XSLFShape,XSLFTextParagraph>
Specified by:
getAnchor in interface Shape<XSLFShape,XSLFTextParagraph>
Overrides:
getAnchor in class XSLFSimpleShape
Since:
POI 3.15-beta2

isMerged

public boolean isMerged()
Specified by:
isMerged in interface TableCell<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: XSLFTextShape
Helper method to allow subclasses to provide their own text paragraph

Overrides:
newTextParagraph in class XSLFTextShape
Parameters:
p - the xml reference
Returns:
a new text paragraph
Since:
POI 3.15-beta2

getShapeProperties

protected org.apache.xmlbeans.XmlObject getShapeProperties()
Description copied from class: XSLFShape
Return the shape specific (visual) properties

Overrides:
getShapeProperties in class XSLFShape
Returns:
the shape specific properties