Class XSLFDiagram
- java.lang.Object
-
- org.apache.poi.xslf.usermodel.XSLFShape
-
- org.apache.poi.xslf.usermodel.XSLFGraphicFrame
-
- org.apache.poi.xslf.usermodel.XSLFDiagram
-
- All Implemented Interfaces:
GraphicalFrame<XSLFShape,XSLFTextParagraph>
,PlaceableShape<XSLFShape,XSLFTextParagraph>
,Shape<XSLFShape,XSLFTextParagraph>
@Beta public class XSLFDiagram extends XSLFGraphicFrame
Representation of a DrawingML DiagramThis class converts the diagram to an
XSLFGroupShape
accessible viagetGroupShape()
. The underlyingXSLFDiagramDrawing
used to create the group shape is accessible viagetDiagramDrawing()
.In pptx files, these diagrams are generated by creating SmartArt. When a pptx has SmartArt, a directory with the following structure is created:
ppt/ diagrams/ data#.xml drawing#.xml^ colors#.xml quickStyle#.xml layout#.xml rels/ data#.xml.rels drawing#.xml.rels
^The `drawing#.xml` file is not in the OpenXML spec. It was added as an extension by Microsoft, namespace: http://schemas.microsoft.com/office/drawing/2008/diagram
The drawing#.xml file contains the rendered output of the diagram. This class reads the underlying drawing#.xml and converts it to a
XSLFGroupShape
.The data, drawing, colors, and quickStyle files are in the OpenXML spec. These contain the instructions that define how to render the diagram. Rendering diagrams from these files is not trivial, they support for loops, if/elses, etc. Integrating such a change into POI would be quite sophisticated and challenging.
- Since:
- POI 5.2.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.xslf.usermodel.XSLFShape
XSLFShape.ReparseFactory<T extends XmlObject>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DRAWINGML_DIAGRAM_URI
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XSLFDiagramDrawing
getDiagramDrawing()
Returns the underlyingXSLFDiagramDrawing
used to create this diagram.org.apache.poi.xslf.usermodel.XSLFDiagram.XSLFDiagramGroupShape
getGroupShape()
Returns the diagram represented as a grouped shape.-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFGraphicFrame
getAnchor, getChart, getFallbackPicture, getFlipHorizontal, getFlipVertical, getRotation, getShapeType, hasChart, hasDiagram, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, fetchShapeProperty, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getSheet, getXmlObject, isPlaceholder, setParent, setPlaceholder
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getParent, getSheet
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getShapeId, getShapeName, getSheet
-
-
-
-
Field Detail
-
DRAWINGML_DIAGRAM_URI
public static final java.lang.String DRAWINGML_DIAGRAM_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDiagramDrawing
public XSLFDiagramDrawing getDiagramDrawing()
Returns the underlyingXSLFDiagramDrawing
used to create this diagram.NOTE: Modifying this drawing will not update the groupShape returned from
getGroupShape()
.
-
getGroupShape
public org.apache.poi.xslf.usermodel.XSLFDiagram.XSLFDiagramGroupShape getGroupShape()
Returns the diagram represented as a grouped shape.
-
-