org.apache.poi.xssf.usermodel
public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing
DEFAULT_XML_OPTIONS
Modifier | Constructor and Description |
---|---|
protected |
XSSFDrawing()
Create a new SpreadsheetML drawing
|
protected |
XSSFDrawing(PackagePart part,
PackageRelationship rel)
Construct a SpreadsheetML drawing from a package part
|
Modifier and Type | Method and Description |
---|---|
protected PackageRelationship |
addPictureReference(int pictureIndex)
Add the indexed picture to this drawing relations
|
protected void |
commit()
Save the content in the underlying package part.
|
XSSFComment |
createCellComment(ClientAnchor anchor)
Creates a cell comment.
|
XSSFConnector |
createConnector(XSSFClientAnchor anchor)
Creates a simple shape.
|
XSSFShapeGroup |
createGroup(XSSFClientAnchor anchor)
Creates a simple shape.
|
XSSFPicture |
createPicture(ClientAnchor anchor,
int pictureIndex) |
XSSFPicture |
createPicture(XSSFClientAnchor anchor,
int pictureIndex)
Creates a picture.
|
XSSFSimpleShape |
createSimpleShape(XSSFClientAnchor anchor)
Creates a simple shape.
|
XSSFTextBox |
createTextbox(XSSFClientAnchor anchor)
Constructs a textbox under the drawing.
|
CTDrawing |
getCTDrawing()
Return the underlying CTDrawing bean, the root element of the SpreadsheetML Drawing part.
|
addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelations, onDocumentCreate, onDocumentRead, onSave, read, removeRelation, toString
protected XSSFDrawing()
XSSFSheet.createDrawingPatriarch()
protected XSSFDrawing(PackagePart part, PackageRelationship rel) throws java.io.IOException, XmlException
part
- the package part holding the drawing data,
the content type must be application/vnd.openxmlformats-officedocument.drawing+xml
rel
- the package relationship holding this drawing,
the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawingjava.io.IOException
XmlException
@Internal public CTDrawing getCTDrawing()
protected void commit() throws java.io.IOException
POIXMLDocumentPart
protected void commit() throws IOException {
PackagePart part = getPackagePart();
OutputStream out = part.getOutputStream();
XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
bean.save(out, DEFAULT_XML_OPTIONS);
out.close();
}
commit
in class POIXMLDocumentPart
java.io.IOException
public XSSFTextBox createTextbox(XSSFClientAnchor anchor)
anchor
- the client anchor describes how this group is attached
to the sheet.public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
anchor
- the client anchor describes how this picture is attached to the sheet.pictureIndex
- the index of the picture in the workbook collection of pictures,
XSSFWorkbook.getAllPictures()
.public XSSFPicture createPicture(ClientAnchor anchor, int pictureIndex)
createPicture
in interface Drawing
protected PackageRelationship addPictureReference(int pictureIndex)
pictureIndex
- the index of the picture in the workbook collection of pictures,
XSSFWorkbook.getAllPictures()
.public XSSFSimpleShape createSimpleShape(XSSFClientAnchor anchor)
anchor
- the client anchor describes how this group is attached
to the sheet.public XSSFConnector createConnector(XSSFClientAnchor anchor)
anchor
- the client anchor describes how this group is attached
to the sheet.public XSSFShapeGroup createGroup(XSSFClientAnchor anchor)
anchor
- the client anchor describes how this group is attached
to the sheet.public XSSFComment createCellComment(ClientAnchor anchor)
createCellComment
in interface Drawing
anchor
- the client anchor describes how this comment is attached
to the sheet.Copyright 2014 The Apache Software Foundation or its licensors, as applicable.