Package org.apache.poi.xslf.usermodel
Class XSLFSheet
java.lang.Object
org.apache.poi.ooxml.POIXMLDocumentPart
org.apache.poi.xslf.usermodel.XSLFSheet
- All Implemented Interfaces:
Iterable<XSLFShape>,ShapeContainer<XSLFShape,,XSLFTextParagraph> Sheet<XSLFShape,,XSLFTextParagraph> XSLFShapeContainer
- Direct Known Subclasses:
XSLFNotes,XSLFNotesMaster,XSLFSlide,XSLFSlideLayout,XSLFSlideMaster
@Beta
public abstract class XSLFSheet
extends POIXMLDocumentPart
implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidthis method will add chart into slide with default height, width, x and yvoidaddChart(XSLFChart chart, Rectangle2D rect2D) this method will add chart into slide with given height, width, x and yvoidThis method is not yet supported.protected intappendContent(XSLFSheet src) Append content to this sheet.buildShapes(org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape spTree, XSLFShapeContainer parent) voidclear()Removes all of the elements from this container (optional operation).protected final voidcommit()Save the content in the underlying package part.createOleShape(PictureData pictureData) createPicture(PictureData pictureData) createTable(int numRows, int numCols) protected voidderegisterShapeId(int shapeId) voiddraw(Graphics2D graphics) Render this sheet into the supplied graphics objectbooleangetPlaceholder(int idx) getPlaceholder(org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder ph) getPlaceholderDetails(Placeholder placeholder) protected abstract StringReturns an array containing all of the shapes in this sheetprotected org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShapeprotected XSLFTextShapegetTheme()abstract XmlObjectimportContent(XSLFSheet src) Set the contents of this sheet to be a copy of the source sheet.iterator()Returns an iterator over the shapes in this sheetprotected StringmapSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTColorMappingOverride cmapOver, String schemeColor) protected StringmapSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping cmap, String schemeColor) protected voidregisterShapeId(int shapeId) booleanremoveShape(XSLFShape xShape) Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.poi.sl.usermodel.Sheet
getMasterSheet
-
Constructor Details
-
XSLFSheet
protected XSLFSheet() -
XSLFSheet
- Since:
- 3.14-Beta1
-
-
Method Details
-
getSlideShow
- Specified by:
getSlideShowin interfaceSheet<XSLFShape,XSLFTextParagraph> - Returns:
- the XMLSlideShow this sheet belongs to
-
allocateShapeId
protected int allocateShapeId() -
registerShapeId
protected void registerShapeId(int shapeId) -
deregisterShapeId
protected void deregisterShapeId(int shapeId) -
buildShapes
protected static List<XSLFShape> buildShapes(org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape spTree, XSLFShapeContainer parent) -
getXmlObject
- Returns:
- top-level Xml bean representing this sheet
-
getShapes
Returns an array containing all of the shapes in this sheet- Specified by:
getShapesin interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Returns:
- a list of all shapes in this sheet
-
createAutoShape
- Specified by:
createAutoShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Specified by:
createAutoShapein interfaceXSLFShapeContainer
-
createFreeform
- Specified by:
createFreeformin interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Specified by:
createFreeformin interfaceXSLFShapeContainer
-
createTextBox
- Specified by:
createTextBoxin interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Specified by:
createTextBoxin interfaceXSLFShapeContainer
-
createConnector
- Specified by:
createConnectorin interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Specified by:
createConnectorin interfaceXSLFShapeContainer
-
createGroup
- Specified by:
createGroupin interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Specified by:
createGroupin interfaceXSLFShapeContainer
-
createPicture
- Specified by:
createPicturein interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Specified by:
createPicturein interfaceXSLFShapeContainer
-
createTable
-
createTable
- Specified by:
createTablein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>
-
createOleShape
- Specified by:
createOleShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>
-
iterator
Returns an iterator over the shapes in this sheet -
addShape
This method is not yet supported.- Specified by:
addShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph> - Throws:
UnsupportedOperationException- this method is not yet supported
-
removeShape
- Specified by:
removeShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>
-
clear
public void clear()Removes all of the elements from this container (optional operation). The container will be empty after this call returns.- Specified by:
clearin interfaceXSLFShapeContainer
-
getRootElementName
-
getSpTree
protected org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape getSpTree() -
commit
Description copied from class:POIXMLDocumentPartSave the content in the underlying package part. Default implementation is empty meaning that the package part is left unmodified.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); } }- Overrides:
commitin classPOIXMLDocumentPart- Throws:
IOException- a subclass may throw an IOException if the changes can't be committed
-
importContent
Set the contents of this sheet to be a copy of the source sheet. This method erases any existing shapes and replaces them with object from the source sheet.- Parameters:
src- the source sheet to copy data from- Returns:
- modified 'this'
-
appendContent
Append content to this sheet.- Parameters:
src- the source sheet- Returns:
- modified
this.
-
getTheme
- Returns:
- theme (shared styles) associated with this theme.
By default returns
nullwhich means that this sheet is theme-less. Sheets that support the notion of themes (slides, masters, layouts, etc.) should override this method and return the corresponding package part.
-
getTextShapeByType
-
getPlaceholder
-
getPlaceholder
@Internal public XSLFSimpleShape getPlaceholder(org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder ph) -
getPlaceholder
- Parameters:
idx- 0-based index of a placeholder in the sheet- Returns:
- placeholder
-
getPlaceholders
- Returns:
- all placeholder shapes in this sheet
-
getFollowMasterGraphics
public boolean getFollowMasterGraphics()- Specified by:
getFollowMasterGraphicsin interfaceSheet<XSLFShape,XSLFTextParagraph> - Returns:
- whether shapes on the master sheet should be shown. By default master graphics is turned off. Sheets that support the notion of master (slide, slideLayout) should override it and check this setting in the sheet XML
-
getBackground
- Specified by:
getBackgroundin interfaceSheet<XSLFShape,XSLFTextParagraph> - Returns:
- background for this sheet
-
draw
Render this sheet into the supplied graphics object- Specified by:
drawin interfaceSheet<XSLFShape,XSLFTextParagraph> - Parameters:
graphics- the graphics context to draw to
-
getPlaceholderDetails
- Specified by:
getPlaceholderDetailsin interfaceSheet<XSLFShape,XSLFTextParagraph>
-
addChart
this method will add chart into slide with default height, width, x and y- Parameters:
chart- xslf chart object- Since:
- 4.1.0
-
addChart
this method will add chart into slide with given height, width, x and y- Parameters:
chart- xslf chart object- Since:
- 4.1.0
-
mapSchemeColor
-
mapSchemeColor
-