public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing<XSSFShape>
POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
protected static String |
NAMESPACE_A |
protected static String |
NAMESPACE_C |
Modifier | Constructor and Description |
---|---|
protected |
XSSFDrawing()
Create a new SpreadsheetML drawing
|
|
XSSFDrawing(PackagePart part)
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.
|
XSSFClientAnchor |
createAnchor(int dx1,
int dy1,
int dx2,
int dy2,
int col1,
int row1,
int col2,
int row2) |
XSSFComment |
createCellComment(ClientAnchor anchor)
Creates a comment.
|
XSSFChart |
createChart(ClientAnchor anchor)
Creates a chart.
|
XSSFChart |
createChart(XSSFClientAnchor anchor)
Creates a chart.
|
protected POIXMLDocumentPart.RelationPart |
createChartRelationPart() |
XSSFConnector |
createConnector(XSSFClientAnchor anchor)
Creates a simple shape.
|
XSSFShapeGroup |
createGroup(XSSFClientAnchor anchor)
Creates a simple shape.
|
XSSFObjectData |
createObjectData(ClientAnchor anchor,
int storageId,
int pictureIndex) |
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.
|
List<XSSFChart> |
getCharts()
Returns all charts in this drawing.
|
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing |
getCTDrawing()
Return the underlying CTDrawing bean, the root element of the
SpreadsheetML Drawing part.
|
List<XSSFShape> |
getShapes() |
List<XSSFShape> |
getShapes(XSSFShapeGroup groupshape) |
XSSFSheet |
getSheet() |
XSSFChart |
importChart(XSSFChart srcChart)
Imports the chart from the
srcChart into this drawing. |
Iterator<XSSFShape> |
iterator() |
Spliterator<XSSFShape> |
spliterator() |
_invokeOnDocumentRead, addRelation, createHyperlink, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getReferenceRelationship, getReferenceRelationships, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeReferenceRelationship, removeRelation, removeRelation, removeRelation, setCommitted, toString
protected static final String NAMESPACE_A
protected static final String NAMESPACE_C
protected XSSFDrawing()
XSSFSheet.createDrawingPatriarch()
public XSSFDrawing(PackagePart part) throws IOException, org.apache.xmlbeans.XmlException
part
- the package part holding the drawing data, the content type
must be
application/vnd.openxmlformats-officedocument.drawing+xml
IOException
org.apache.xmlbeans.XmlException
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing getCTDrawing()
protected void commit() throws IOException
POIXMLDocumentPart
Sub-classes should override and add logic to marshal the "model" into Ooxml4J.
For example, the code saving a generic XML entry may look as follows:
protected void commit() throws IOException { PackagePart part = getPackagePart(); try (OutputStream out = part.getOutputStream()) { XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); } }
commit
in class POIXMLDocumentPart
IOException
- a subclass may throw an IOException if the changes can't be committedpublic XSSFClientAnchor createAnchor(int dx1, int dy1, int dx2, int dy2, int col1, int row1, int col2, int row2)
createAnchor
in interface Drawing<XSSFShape>
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<XSSFShape>
public XSSFChart createChart(XSSFClientAnchor anchor)
anchor
- the client anchor describes how this chart is attached to the
sheet.createChart(ClientAnchor)
protected POIXMLDocumentPart.RelationPart createChartRelationPart()
public XSSFChart createChart(ClientAnchor anchor)
anchor
- the client anchor describes how this chart is attached to the
sheet.public XSSFChart importChart(XSSFChart srcChart)
srcChart
into this drawing.srcChart
- the source chart to be cloned into this 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<XSSFShape>
anchor
- the client anchor describes how this comment is attached to
the sheet.public XSSFObjectData createObjectData(ClientAnchor anchor, int storageId, int pictureIndex)
createObjectData
in interface Drawing<XSSFShape>
public List<XSSFShape> getShapes(XSSFShapeGroup groupshape)
public Spliterator<XSSFShape> spliterator()
spliterator
in interface Iterable<XSSFShape>
public XSSFSheet getSheet()