public class XSSFSimpleShape extends XSSFShape implements java.lang.Iterable<XSSFTextParagraph>, SimpleShape, TextContainer
ShapeTypes
(在 SpreadsheetML 绘图中表示具有预定义几何形状的形状。可能的形状类型在 ShapeTypes 中定义)
Modifier | Constructor and Description |
---|---|
protected |
XSSFSimpleShape(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape ctShape) |
Modifier and Type | Method and Description |
---|---|
XSSFTextParagraph |
addNewTextParagraph()
Add a new paragraph run to this shape
(将新段落添加到此形状)
|
XSSFTextParagraph |
addNewTextParagraph(java.lang.String text)
Add a new paragraph run to this shape, set to the provided string
(添加一个新的段落运行到这个形状,设置为提供的字符串)
|
XSSFTextParagraph |
addNewTextParagraph(XSSFRichTextString str)
Add a new paragraph run to this shape, set to the provided rich text string
(将新段落添加到此形状,设置为提供的富文本字符串)
|
void |
clearText()
Clear all text from this shape
(清除此形状中的所有文本)
|
<R> java.util.Optional<R> |
findDefinedParagraphProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter) |
<R> java.util.Optional<R> |
findDefinedRunProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,R> getter) |
double |
getBottomInset()
Returns the distance (in points) between the bottom of the text frame and the bottom of the inscribed rectangle of the shape that contains the text.
(返回文本框底部与包含文本的形状的内接矩形底部之间的距离(以磅为单位)。)
|
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape |
getCTShape() |
double |
getLeftInset()
Returns the distance (in points) between the left edge of the text frame and the left edge of the inscribed rectangle of the shape that contains the text.
(返回文本框左边缘与包含文本的形状的内接矩形左边缘之间的距离(以磅为单位)。)
|
double |
getRightInset()
Returns the distance (in points) between the right edge of the text frame and the right edge of the inscribed rectangle of the shape that contains the text.
(返回文本框的右边缘与包含文本的形状的内接矩形的右边缘之间的距离(以磅为单位)。)
|
int |
getShapeId() |
java.lang.String |
getShapeName() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties |
getShapeProperties()
Returns xml bean with shape properties.
(返回具有形状属性的 xml bean。)
|
int |
getShapeType()
Gets the shape type, one of the constants defined in
ShapeTypes .
(获取形状类型,它是 ShapeTypes 中定义的常量之一。)
|
java.lang.String |
getText()
Returns the text from all paragraphs in the shape.
(返回形状中所有段落的文本。)
|
TextAutofit |
getTextAutofit() |
XDDFTextBody |
getTextBody() |
TextDirection |
getTextDirection()
Gets the vertical orientation of the text
(获取文本的垂直方向)
|
TextHorizontalOverflow |
getTextHorizontalOverflow()
Returns the type of horizontal overflow for the text.
(返回文本的水平溢出类型。)
|
java.util.List<XSSFTextParagraph> |
getTextParagraphs()
Returns a collection of the XSSFTextParagraphs that are attached to this shape
(返回附加到此形状的 XSSFTextParagraphs 的集合)
|
TextVerticalOverflow |
getTextVerticalOverflow()
Returns the type of vertical overflow for the text.
(返回文本的垂直溢出类型。)
|
double |
getTopInset()
Returns the distance (in points) between the top of the text frame and the top of the inscribed rectangle of the shape that contains the text.
(返回文本框顶部与包含文本的形状的内接矩形顶部之间的距离(以磅为单位)。)
|
VerticalAlignment |
getVerticalAlignment()
Returns the type of vertical alignment for the text within the shape.
(返回形状内文本的垂直对齐类型。)
|
boolean |
getWordWrap() |
java.util.Iterator<XSSFTextParagraph> |
iterator() |
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape |
prototype()
Prototype with the default structure of a new auto-shape.
(具有新自动形状的默认结构的原型。)
|
void |
setBottomInset(double margin)
Sets the bottom inset.
(设置底部插图。)
|
void |
setLeftInset(double margin)
Sets the left inset.
(设置左插图。)
|
void |
setRightInset(double margin)
Sets the right inset.
(设置正确的插图。)
|
void |
setShapeType(int type)
Sets the shape types.
(设置形状类型。)
|
void |
setText(java.lang.String text)
Set a single paragraph of text on the shape.
(在形状上设置一个文本段落。)
|
void |
setText(XSSFRichTextString str)
Set a single paragraph of text on the shape.
(在形状上设置一个文本段落。)
|
void |
setTextAutofit(TextAutofit value)
Specifies that a shape should be auto-fit to fully contain the text described within it.
(指定应自动调整形状以完全包含其中描述的文本。)
|
void |
setTextDirection(TextDirection orientation)
Sets the vertical orientation of the text
(设置文本的垂直方向)
|
void |
setTextHorizontalOverflow(TextHorizontalOverflow overflow)
Sets the type of horizontal overflow for the text.
(设置文本的水平溢出类型。)
|
void |
setTextVerticalOverflow(TextVerticalOverflow overflow)
Sets the type of vertical overflow for the text.
(设置文本的垂直溢出类型。)
|
void |
setTopInset(double margin)
Sets the top inset.
(设置顶部插图。)
|
void |
setVerticalAlignment(VerticalAlignment anchor)
Sets the type of vertical alignment for the text within the shape.
(设置形状内文本的垂直对齐类型。)
|
void |
setWordWrap(boolean wrap) |
protected void |
setXfrm(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D t2d) |
getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFill
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnchor, getParent, isNoFill, setFillColor, setLineStyleColor, setNoFill
protected XSSFSimpleShape(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape ctShape)
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape prototype()
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape getCTShape()
@Beta public XDDFTextBody getTextBody()
protected void setXfrm(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D t2d)
public java.util.Iterator<XSSFTextParagraph> iterator()
iterator
in interface
java.lang.Iterable<XSSFTextParagraph>
(接口 java.lang.Iterable 中的迭代器
public java.lang.String getText()
public void clearText()
public void setText(java.lang.String text)
text
- string representing the paragraph text
(text - 表示段落文本的字符串)
public void setText(XSSFRichTextString str)
str
- rich text string representing the paragraph text
(str - 表示段落文本的富文本字符串)
public java.util.List<XSSFTextParagraph> getTextParagraphs()
public XSSFTextParagraph addNewTextParagraph()
public XSSFTextParagraph addNewTextParagraph(java.lang.String text)
public XSSFTextParagraph addNewTextParagraph(XSSFRichTextString str)
public void setTextHorizontalOverflow(TextHorizontalOverflow overflow)
overflow
- - the type of horizontal overflow. A
null
values unsets this property.
(overflow - - 水平溢出的类型。空值取消设置此属性。)
public TextHorizontalOverflow getTextHorizontalOverflow()
public void setTextVerticalOverflow(TextVerticalOverflow overflow)
overflow
- - the type of vertical overflow. A
null
values unsets this property.
(overflow - - 垂直溢出的类型。空值取消设置此属性。)
public TextVerticalOverflow getTextVerticalOverflow()
public void setVerticalAlignment(VerticalAlignment anchor)
anchor
- - the type of alignment. A
null
values unsets this property.
(anchor - - 对齐的类型。空值取消设置此属性。)
public VerticalAlignment getVerticalAlignment()
public void setTextDirection(TextDirection orientation)
orientation
- vertical orientation of the text A
null
values unsets this property.
(方向 - 文本的垂直方向 空值取消设置此属性。)
public TextDirection getTextDirection()
public double getBottomInset()
public double getLeftInset()
public double getRightInset()
public double getTopInset()
public void setBottomInset(double margin)
margin
- the bottom margin
(margin - 下边距)
getBottomInset()
public void setLeftInset(double margin)
margin
- the left margin
(margin - 左边距)
getLeftInset()
public void setRightInset(double margin)
margin
- the right margin
(margin - 右边距)
getRightInset()
public void setTopInset(double margin)
margin
- the top margin
(margin - 上边距)
getTopInset()
public boolean getWordWrap()
public void setWordWrap(boolean wrap)
wrap
- whether to wrap words within the bounding rectangle
(wrap - 是否在边界矩形内换行)
public void setTextAutofit(TextAutofit value)
value
- type of autofit
(value - 自动调整的类型)
public TextAutofit getTextAutofit()
public int getShapeType()
ShapeTypes
.
(获取形状类型,它是 ShapeTypes 中定义的常量之一。)
ShapeTypes
public void setShapeType(int type)
type
- the shape type, one of the constants defined in
ShapeTypes
.
(type - 形状类型,ShapeTypes 中定义的常量之一。)
ShapeTypes
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
XSSFShape
getShapeProperties
in class
XSSFShape
(XSSFShape 类中的 getShapeProperties)
public java.lang.String getShapeName()
getShapeName
in interface
Shape
(接口 Shape 中的 getShapeName)
public int getShapeId()
getShapeId
in interface
SimpleShape
(接口 SimpleShape 中的 getShapeId)
public <R> java.util.Optional<R> findDefinedParagraphProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter)
findDefinedParagraphProperty
in interface
TextContainer
(在接口 TextContainer 中查找DefinedParagraphProperty)
public <R> java.util.Optional<R> findDefinedRunProperty(java.util.function.Predicate<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties> isSet, java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,R> getter)
findDefinedRunProperty
in interface
TextContainer
(接口 TextContainer 中的 findDefinedRunProperty)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.