org.apache.poi.xssf.usermodel
Class XSSFDrawing
- java.lang.Object
-
- org.apache.poi.POIXMLDocumentPart
-
- org.apache.poi.xssf.usermodel.XSSFDrawing
-
- All Implemented Interfaces:
- Drawing
public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing
Represents a SpreadsheetML drawing
-
-
Field Summary
-
Fields inherited from class org.apache.poi.POIXMLDocumentPart
DEFAULT_XML_OPTIONS
-
-
Constructor Summary
Constructors Constructor and Description XSSFDrawing(PackagePart part, PackageRelationship rel)Construct a SpreadsheetML drawing from a package part
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description XSSFClientAnchorcreateAnchor(int dx1, int dy1, int dx2, int dy2, int col1, int row1, int col2, int row2)Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor.XSSFCommentcreateCellComment(ClientAnchor anchor)Creates a comment.XSSFChartcreateChart(ClientAnchor anchor)Creates a chart.XSSFChartcreateChart(XSSFClientAnchor anchor)Creates a chart.XSSFConnectorcreateConnector(XSSFClientAnchor anchor)Creates a simple shape.XSSFShapeGroupcreateGroup(XSSFClientAnchor anchor)Creates a simple shape.XSSFPicturecreatePicture(ClientAnchor anchor, int pictureIndex)Creates a picture.XSSFPicturecreatePicture(XSSFClientAnchor anchor, int pictureIndex)Creates a picture.XSSFSimpleShapecreateSimpleShape(XSSFClientAnchor anchor)Creates a simple shape.XSSFTextBoxcreateTextbox(XSSFClientAnchor anchor)Constructs a textbox under the drawing.java.util.List<XSSFChart>getCharts()Returns all charts in this drawing.org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawinggetCTDrawing()Return the underlying CTDrawing bean, the root element of the SpreadsheetML Drawing part.java.util.List<XSSFShape>getShapes()-
Methods inherited from class org.apache.poi.POIXMLDocumentPart
addRelation, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, toString
-
-
-
-
Constructor Detail
-
XSSFDrawing
public XSSFDrawing(PackagePart part, PackageRelationship rel) throws java.io.IOException, org.apache.xmlbeans.XmlException
Construct a SpreadsheetML drawing from a package part- Parameters:
part- the package part holding the drawing data, the content type must beapplication/vnd.openxmlformats-officedocument.drawing+xmlrel- the package relationship holding this drawing, the relationship type must be http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing- Throws:
java.io.IOExceptionorg.apache.xmlbeans.XmlException
-
-
Method Detail
-
getCTDrawing
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing getCTDrawing()
Return the underlying CTDrawing bean, the root element of the SpreadsheetML Drawing part.- Returns:
- the underlying CTDrawing bean
-
createAnchor
public XSSFClientAnchor createAnchor(int dx1, int dy1, int dx2, int dy2, int col1, int row1, int col2, int row2)
Description copied from interface:DrawingCreates a new client anchor and sets the top-left and bottom-right coordinates of the anchor.- Specified by:
createAnchorin interfaceDrawing- Parameters:
dx1- the x coordinate in EMU within the first cell.dy1- the y coordinate in EMU within the first cell.dx2- the x coordinate in EMU within the second cell.dy2- the y coordinate in EMU within the second cell.col1- the column (0 based) of the first cell.row1- the row (0 based) of the first cell.col2- the column (0 based) of the second cell.row2- the row (0 based) of the second cell.- Returns:
- the newly created client anchor
-
createTextbox
public XSSFTextBox createTextbox(XSSFClientAnchor anchor)
Constructs a textbox under the drawing.- Parameters:
anchor- the client anchor describes how this group is attached to the sheet.- Returns:
- the newly created textbox.
-
createPicture
public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex)
Creates a picture.- Parameters:
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().- Returns:
- the newly created picture shape.
-
createPicture
public XSSFPicture createPicture(ClientAnchor anchor, int pictureIndex)
Description copied from interface:DrawingCreates a picture.- Specified by:
createPicturein interfaceDrawing- Parameters:
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.- Returns:
- the newly created picture.
-
createChart
public XSSFChart createChart(XSSFClientAnchor anchor)
Creates a chart.- Parameters:
anchor- the client anchor describes how this chart is attached to the sheet.- Returns:
- the newly created chart
- See Also:
createChart(ClientAnchor)
-
createChart
public XSSFChart createChart(ClientAnchor anchor)
Description copied from interface:DrawingCreates a chart.- Specified by:
createChartin interfaceDrawing- Parameters:
anchor- the client anchor describes how this chart is attached to the sheet.- Returns:
- the newly created chart
-
createSimpleShape
public XSSFSimpleShape createSimpleShape(XSSFClientAnchor anchor)
Creates a simple shape. This includes such shapes as lines, rectangles, and ovals.- Parameters:
anchor- the client anchor describes how this group is attached to the sheet.- Returns:
- the newly created shape.
-
createConnector
public XSSFConnector createConnector(XSSFClientAnchor anchor)
Creates a simple shape. This includes such shapes as lines, rectangles, and ovals.- Parameters:
anchor- the client anchor describes how this group is attached to the sheet.- Returns:
- the newly created shape.
-
createGroup
public XSSFShapeGroup createGroup(XSSFClientAnchor anchor)
Creates a simple shape. This includes such shapes as lines, rectangles, and ovals.- Parameters:
anchor- the client anchor describes how this group is attached to the sheet.- Returns:
- the newly created shape.
-
createCellComment
public XSSFComment createCellComment(ClientAnchor anchor)
Creates a comment.- Specified by:
createCellCommentin interfaceDrawing- Parameters:
anchor- the client anchor describes how this comment is attached to the sheet.- Returns:
- the newly created comment.
-
getCharts
public java.util.List<XSSFChart> getCharts()
Returns all charts in this drawing.
-
getShapes
public java.util.List<XSSFShape> getShapes()
- Returns:
- list of shapes in this drawing
-
-
DataMelt 3.0 © DataMelt by jWork.ORG