@Beta public abstract class XSLFSheet extends POIXMLDocumentPart implements XSLFShapeContainer, Sheet<XSLFShape,XSLFTextParagraph>
POIXMLDocumentPart.RelationPart
Modifier | Constructor and Description |
---|---|
protected |
XSLFSheet() |
protected |
XSLFSheet(PackagePart part) |
Modifier and Type | Method and Description |
---|---|
void |
addChart(XSLFChart chart)
this method will add chart into slide with default height, width, x and y
(此方法将使用默认高度、宽度、x 和 y 将图表添加到幻灯片中)
|
void |
addChart(XSLFChart chart, java.awt.geom.Rectangle2D rect2D)
this method will add chart into slide with given height, width, x and y
(此方法会将图表添加到具有给定高度、宽度、x 和 y 的幻灯片中)
|
void |
addShape(XSLFShape shape) |
protected int |
allocateShapeId() |
XSLFSheet |
appendContent(XSLFSheet src)
Append content to this sheet.
(将内容附加到此工作表。)
|
protected static java.util.List<XSLFShape> |
buildShapes(org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape spTree, XSLFShapeContainer parent) |
void |
clear()
Removes all of the elements from this container (optional operation).
(从此容器中移除所有元素(可选操作)。)
|
protected void |
commit()
Save the content in the underlying package part.
(将内容保存在底层包部分中。)
|
XSLFAutoShape |
createAutoShape()
create a new shape with a predefined geometry and add it to this shape container
(创建具有预定义几何形状的新形状并将其添加到此形状容器中)
|
XSLFConnectorShape |
createConnector()
create a connector
(创建连接器)
|
XSLFFreeformShape |
createFreeform()
create a new shape with a custom geometry
(使用自定义几何创建新形状)
|
XSLFGroupShape |
createGroup()
create a group of shapes belonging to this container
(创建一组属于该容器的形状)
|
XSLFObjectShape |
createOleShape(PictureData pictureData)
Create a new OLE object shape with the given pictureData as preview image
(使用给定的图片数据创建一个新的 OLE 对象形状作为预览图像)
|
XSLFPictureShape |
createPicture(PictureData pictureData)
create a picture belonging to this container
(创建属于该容器的图片)
|
XSLFTable |
createTable() |
XSLFTable |
createTable(int numRows, int numCols)
Create a new Table of the given number of rows and columns
(创建给定行数和列数的新表)
|
XSLFTextBox |
createTextBox()
create a text box
(创建一个文本框)
|
protected void |
deregisterShapeId(int shapeId) |
void |
draw(java.awt.Graphics2D graphics)
Render this sheet into the supplied graphics object
(将此工作表渲染到提供的图形对象中)
|
XSLFBackground |
getBackground() |
boolean |
getFollowMasterGraphics() |
XSLFSimpleShape |
getPlaceholder(org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder ph) |
XSLFTextShape |
getPlaceholder(int idx) |
XSLFSimpleShape |
getPlaceholder(Placeholder ph) |
XSLFPlaceholderDetails |
getPlaceholderDetails(Placeholder placeholder)
Get the placeholder details for the given placeholder type.
(获取给定占位符类型的占位符详细信息。)
|
XSLFTextShape[] |
getPlaceholders() |
protected abstract java.lang.String |
getRootElementName() |
java.util.List<XSLFShape> |
getShapes()
Returns an array containing all of the shapes in this sheet
(返回包含此工作表中所有形状的数组)
|
XMLSlideShow |
getSlideShow() |
protected org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape |
getSpTree() |
protected XSLFTextShape |
getTextShapeByType(Placeholder type) |
XSLFTheme |
getTheme() |
abstract org.apache.xmlbeans.XmlObject |
getXmlObject() |
XSLFSheet |
importContent(XSLFSheet src)
Set the contents of this sheet to be a copy of the source sheet.
(将此工作表的内容设置为源工作表的副本。)
|
java.util.Iterator<XSLFShape> |
iterator()
Returns an iterator over the shapes in this sheet
(返回此工作表中形状的迭代器)
|
protected java.lang.String |
mapSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTColorMappingOverride cmapOver, java.lang.String schemeColor) |
protected java.lang.String |
mapSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping cmap, java.lang.String schemeColor) |
protected void |
registerShapeId(int shapeId) |
boolean |
removeShape(XSLFShape xShape)
Removes the specified shape from this sheet, if it is present (optional operation).
(如果存在,则从此工作表中删除指定的形状(可选操作)。)
|
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, getTargetPart, isCommitted, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, removeRelation, setCommitted, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMasterSheet
protected XSLFSheet()
protected XSLFSheet(PackagePart part)
public XMLSlideShow getSlideShow()
getSlideShow
in interface
Sheet<XSLFShape,XSLFTextParagraph>
(界面Sheet中的getSlideShow
protected int allocateShapeId()
protected void registerShapeId(int shapeId)
protected void deregisterShapeId(int shapeId)
protected static java.util.List<XSLFShape> buildShapes(org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape spTree, XSLFShapeContainer parent)
public abstract org.apache.xmlbeans.XmlObject getXmlObject()
public java.util.List<XSLFShape> getShapes()
getShapes
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 getShapes
public XSLFAutoShape createAutoShape()
ShapeContainer
createAutoShape
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createAutoShape
createAutoShape
in interface
XSLFShapeContainer
(接口 XSLFShapeContainer 中的 createAutoShape)
public XSLFFreeformShape createFreeform()
ShapeContainer
createFreeform
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createFreeform
createFreeform
in interface
XSLFShapeContainer
(接口 XSLFShapeContainer 中的 createFreeform)
public XSLFTextBox createTextBox()
ShapeContainer
createTextBox
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createTextBox
createTextBox
in interface
XSLFShapeContainer
(接口 XSLFShapeContainer 中的 createTextBox)
public XSLFConnectorShape createConnector()
ShapeContainer
createConnector
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createConnector
createConnector
in interface
XSLFShapeContainer
(接口 XSLFShapeContainer 中的 createConnector)
public XSLFGroupShape createGroup()
ShapeContainer
createGroup
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createGroup
createGroup
in interface
XSLFShapeContainer
(接口 XSLFShapeContainer 中的 createGroup)
public XSLFPictureShape createPicture(PictureData pictureData)
ShapeContainer
createPicture
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口ShapeContainer中的createPicture
createPicture
in interface
XSLFShapeContainer
(接口 XSLFShapeContainer 中的 createPicture)
public XSLFTable createTable()
public XSLFTable createTable(int numRows, int numCols)
ShapeContainer
createTable
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createTable
numRows
- the number of rows
(numRows - 行数)
numCols
- the number of columns
(numCols - 列数)
public XSLFObjectShape createOleShape(PictureData pictureData)
ShapeContainer
createOleShape
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 createOleShape
pictureData
- the preview image
(pictureData - 预览图像)
public java.util.Iterator<XSLFShape> iterator()
iterator
in interface
java.lang.Iterable<XSLFShape>
(接口 java.lang.Iterable 中的迭代器
public void addShape(XSLFShape shape)
addShape
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 addShape
public boolean removeShape(XSLFShape xShape)
removeShape
in interface
ShapeContainer<XSLFShape,XSLFTextParagraph>
(接口 ShapeContainer 中的 removeShape
xShape
- shape to be removed from this sheet, if present
(xShape - 要从此工作表中删除的形状(如果存在))
java.lang.IllegalArgumentException
- if the type of the specified shape is incompatible with this sheet (optional)
(java.lang.IllegalArgumentException - 如果指定形状的类型与此工作表不兼容(可选))
public void clear()
clear
in interface
XSLFShapeContainer
(在接口 XSLFShapeContainer 中清除)
protected abstract java.lang.String getRootElementName()
protected org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape getSpTree()
protected final void commit() throws java.io.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(); OutputStream out = part.getOutputStream(); XmlObject bean = getXmlBean(); //the "model" which holds changes in memory bean.save(out, DEFAULT_XML_OPTIONS); out.close(); }(将内容保存在底层包部分中。默认实现是空的,这意味着包部分保持不变。子类应覆盖并添加逻辑以将“模型”编组到 Ooxml4J。例如,保存通用 XML 条目的代码可能如下所示: protected void commit() throws IOException { PackagePart part = getPackagePart();输出流输出 = part.getOutputStream(); XmlObject bean = getXmlBean(); //保存内存变化的“模型” bean.save(out, DEFAULT_XML_OPTIONS); out.close(); })
commit
in class
POIXMLDocumentPart
java.io.IOException
- a subclass may throw an IOException if the changes can't be committed
(java.io.IOException - 如果无法提交更改,子类可能会抛出 IOException)
public XSLFSheet importContent(XSLFSheet src)
src
- the source sheet to copy data from
(src - 要从中复制数据的源工作表)
public XSLFSheet appendContent(XSLFSheet src)
src
- the source sheet
(src - 源表)
this
.
(修改了这个。)
public XSLFTheme getTheme()
null
which 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.
(与此主题相关联的主题(共享样式)。默认情况下返回 null ,这意味着此工作表没有主题。支持主题概念(幻灯片、母版、布局等)的工作表应覆盖此方法并返回相应的包部分。)
protected XSLFTextShape getTextShapeByType(Placeholder type)
public XSLFSimpleShape getPlaceholder(Placeholder ph)
@Internal public XSLFSimpleShape getPlaceholder(org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder ph)
public XSLFTextShape getPlaceholder(int idx)
idx
- 0-based index of a placeholder in the sheet
(idx - 工作表中占位符的基于 0 的索引)
public XSLFTextShape[] getPlaceholders()
public boolean getFollowMasterGraphics()
getFollowMasterGraphics
in interface
Sheet<XSLFShape,XSLFTextParagraph>
(接口表中的getFollowMasterGraphics
public XSLFBackground getBackground()
getBackground
in interface
Sheet<XSLFShape,XSLFTextParagraph>
(接口表中的getBackground
public void draw(java.awt.Graphics2D graphics)
draw
in interface
Sheet<XSLFShape,XSLFTextParagraph>
(在界面Sheet中绘制
graphics
- the graphics context to draw to
(graphics - 要绘制到的图形上下文)
public XSLFPlaceholderDetails getPlaceholderDetails(Placeholder placeholder)
Sheet
getPlaceholderDetails
in interface
Sheet<XSLFShape,XSLFTextParagraph>
(接口表中的getPlaceholderDetails
placeholder
- the placeholder type
(placeholder - 占位符类型)
null
, if the placeholder isn't contained in the sheet
(占位符详细信息或 null,如果占位符不包含在工作表中)
public void addChart(XSLFChart chart)
chart
- xslf chart object
(chart - xslf 图表对象)
public void addChart(XSLFChart chart, java.awt.geom.Rectangle2D rect2D)
chart
- xslf chart object
(chart - xslf 图表对象)
protected java.lang.String mapSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTColorMappingOverride cmapOver, java.lang.String schemeColor)
protected java.lang.String mapSchemeColor(org.openxmlformats.schemas.drawingml.x2006.main.CTColorMapping cmap, java.lang.String schemeColor)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.