public class XSSFTextParagraph extends java.lang.Object implements java.lang.Iterable<XSSFTextRun>
| Modifier and Type | Method and Description |
|---|---|
XSSFTextRun |
addLineBreak()
Insert a line break
(插入换行符)
|
XSSFTextRun |
addNewTextRun()
Add a new run of text
(添加新的文本运行)
|
void |
addTabStop(double value)
Add a single tab stop to be used on a line of text when there are one or more tab characters present within the text.
(当文本中存在一个或多个制表符时,添加单个制表位以用于一行文本。)
|
ListAutoNumber |
getBulletAutoNumberScheme()
Returns the auto number scheme if this paragraph has automatic numbered bullets, otherwise returns ListAutoNumber.ARABIC_PLAIN
(如果此段落有自动编号的项目符号,则返回自动编号方案,否则返回 ListAutoNumber.ARABIC_PLAIN)
|
int |
getBulletAutoNumberStart()
Returns the starting number if this paragraph has automatic numbered bullets, otherwise returns 0
(如果此段落有自动编号的项目符号,则返回起始编号,否则返回 0)
|
java.lang.String |
getBulletCharacter() |
java.lang.String |
getBulletFont() |
java.awt.Color |
getBulletFontColor() |
double |
getBulletFontSize()
Returns the bullet size that is to be used within a paragraph.
(返回要在段落中使用的项目符号大小。)
|
double |
getDefaultTabSize() |
double |
getIndent() |
double |
getLeftMargin() |
int |
getLevel()
Returns the level of text properties that this paragraph will follow.
(返回此段落将遵循的文本属性级别。)
|
double |
getLineSpacing()
Returns the vertical line spacing that is to be used within a paragraph.
(返回要在段落中使用的垂直行距。)
|
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape |
getParentShape() |
double |
getRightMargin() |
double |
getSpaceAfter()
The amount of vertical white space after the paragraph This may be specified in two different ways, percentage spacing and font point spacing:
(段落后的垂直空白量这可以通过两种不同的方式指定,百分比间距和字体点间距:)
|
double |
getSpaceBefore()
The amount of vertical white space before the paragraph This may be specified in two different ways, percentage spacing and font point spacing:
(段落前的垂直空白量这可以通过两种不同的方式指定,百分比间距和字体点间距:)
|
double |
getTabStop(int idx) |
java.lang.String |
getText() |
TextAlign |
getTextAlign()
Returns the alignment that is applied to the paragraph.
(返回应用于段落的对齐方式。)
|
TextFontAlign |
getTextFontAlign()
Returns where vertically on a line of text the actual words are positioned.
(返回实际单词在文本行上的垂直位置。)
|
java.util.List<XSSFTextRun> |
getTextRuns() |
org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph |
getXmlObject() |
boolean |
isBullet()
Returns whether this paragraph has bullets
(返回此段落是否有项目符号)
|
boolean |
isBulletAutoNumber()
Returns whether this paragraph has automatic numbered bullets
(返回此段落是否有自动编号的项目符号)
|
java.util.Iterator<XSSFTextRun> |
iterator() |
void |
setBullet(boolean flag)
Set or unset this paragraph as a bullet point
(将此段落设置或取消设置为项目符号点)
|
void |
setBullet(ListAutoNumber scheme)
Set this paragraph as an automatic numbered bullet point
(将此段落设置为自动编号的项目符号点)
|
void |
setBullet(ListAutoNumber scheme, int startAt)
Set this paragraph as an automatic numbered bullet point
(将此段落设置为自动编号的项目符号点)
|
void |
setBulletCharacter(java.lang.String str) |
void |
setBulletFont(java.lang.String typeface) |
void |
setBulletFontColor(java.awt.Color color)
Set the color to be used on bullet characters within a given paragraph.
(设置要在给定段落中的项目符号字符上使用的颜色。)
|
void |
setBulletFontSize(double bulletSize)
Sets the bullet size that is to be used within a paragraph.
(设置要在段落中使用的项目符号大小。)
|
void |
setIndent(double value)
Specifies the indent size that will be applied to the first line of text in the paragraph.
(指定将应用于段落中第一行文本的缩进大小。)
|
void |
setLeftMargin(double value)
Specifies the left margin of the paragraph.
(指定段落的左边距。)
|
void |
setLevel(int level)
Specifies the particular level text properties that this paragraph will follow.
(指定此段落将遵循的特定级别文本属性。)
|
void |
setLineSpacing(double linespacing)
This element specifies the vertical line spacing that is to be used within a paragraph.
(此元素指定要在段落中使用的垂直行距。)
|
void |
setRightMargin(double value)
Specifies the right margin of the paragraph.
(指定段落的右边距。)
|
void |
setSpaceAfter(double spaceAfter)
Set the amount of vertical white space that will be present after the paragraph.
(设置段落后出现的垂直空白量。)
|
void |
setSpaceBefore(double spaceBefore)
Set the amount of vertical white space that will be present before the paragraph.
(设置段落前出现的垂直空白量。)
|
void |
setTextAlign(TextAlign align)
Specifies the alignment that is to be applied to the paragraph.
(指定要应用于段落的对齐方式。)
|
void |
setTextFontAlign(TextFontAlign align)
Determines where vertically on a line of text the actual words are positioned.
(确定实际单词在文本行上的垂直位置。)
|
java.lang.String |
toString() |
public java.lang.String getText()
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph getXmlObject()
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape getParentShape()
public java.util.List<XSSFTextRun> getTextRuns()
public java.util.Iterator<XSSFTextRun> iterator()
iterator in interface
java.lang.Iterable<XSSFTextRun>
(接口 java.lang.Iterable 中的迭代器
public XSSFTextRun addNewTextRun()
public XSSFTextRun addLineBreak()
public TextAlign getTextAlign()
public void setTextAlign(TextAlign align)
TextAlign.
(指定要应用于段落的对齐方式。可能的值包括左、右、居中、对齐和分布,请参阅 TextAlign。)
align - text align
(对齐 - 文本对齐)
public TextFontAlign getTextFontAlign()
public void setTextFontAlign(TextFontAlign align)
align - text font align
(align - 文本字体对齐)
public java.lang.String getBulletFont()
public void setBulletFont(java.lang.String typeface)
public java.lang.String getBulletCharacter()
public void setBulletCharacter(java.lang.String str)
public java.awt.Color getBulletFontColor()
null value means to use the text font color.
(给定段落中项目符号字符的颜色。空值表示使用文本字体颜色。)
public void setBulletFontColor(java.awt.Color color)
color - the bullet color
(color - 子弹颜色)
public double getBulletFontSize()
If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
(返回要在段落中使用的项目符号大小。这可以通过两种不同的方式指定,百分比间距和字体点间距: 如果 bulletSize >= 0,则 bulletSize 是字体大小的百分比。如果bulletSize < 0,则它以磅为单位指定大小)public void setBulletFontSize(double bulletSize)
If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
(设置要在段落中使用的项目符号大小。这可以通过两种不同的方式指定,百分比间距和字体点间距: 如果 bulletSize >= 0,则 bulletSize 是字体大小的百分比。如果bulletSize < 0,则它以磅为单位指定大小)public void setIndent(double value)
value - the indent in points, -1 to unset indent and use the default of 0.
(value - 以磅为单位的缩进,-1 取消设置缩进并使用默认值 0。)
public double getIndent()
public void setLeftMargin(double value)
value - the left margin of the paragraph, -1 to clear the margin and use the default of 0.
(value - 段落的左边距,-1 清除边距并使用默认值 0。)
public double getLeftMargin()
public void setRightMargin(double value)
value - the right margin of the paragraph, -1 to clear the margin and use the default of 0.
(value - 段落的右边距,-1 清除边距并使用默认值 0。)
public double getRightMargin()
public double getDefaultTabSize()
public double getTabStop(int idx)
public void addTabStop(double value)
value - the position of the tab stop relative to the left margin
(value - 制表位相对于左边距的位置)
public void setLineSpacing(double linespacing)
If linespacing >= 0, then linespacing is a percentage of normal line height If linespacing < 0, the absolute value of linespacing is the spacing in points
Examples:
// spacing will be 120% of the size of the largest text on each line
paragraph.setLineSpacing(120);
// spacing will be 200% of the size of the largest text on each line
paragraph.setLineSpacing(200);
// spacing will be 48 points
paragraph.setLineSpacing(-48.0);
(此元素指定要在段落中使用的垂直行距。这可以通过两种不同的方式指定,百分比间距和字体点间距: 如果行间距 >= 0,则行间距是正常行高的百分比 如果行间距 < 0,行间距的绝对值是以点为单位的间距示例://间距将是每行段落上最大文本大小的 120%.setLineSpacing(120); // 间距将是每行最大文本大小的 200%。paragraph.setLineSpacing(200); // 间距为 48 点 paragraph.setLineSpacing(-48.0);)
linespacing - the vertical line spacing
(linepacing - 垂直行距)
public double getLineSpacing()
If linespacing >= 0, then linespacing is a percentage of normal line height. If linespacing < 0, the absolute value of linespacing is the spacing in points
(返回要在段落中使用的垂直行距。这可以通过两种不同的方式指定,百分比间距和字体点间距: 如果行间距 >= 0,则行间距是正常行高的百分比。如果linespacing < 0,则linespacing的绝对值是以点为单位的间距)public void setSpaceBefore(double spaceBefore)
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value of linespacing is the spacing in points
Examples:
// The paragraph will be formatted to have a spacing before the paragraph text.
// The spacing will be 200% of the size of the largest text on each line
paragraph.setSpaceBefore(200);
// The spacing will be a size of 48 points
paragraph.setSpaceBefore(-48.0);
(设置段落之前将出现的垂直空白量。此空间以百分比或点数指定:如果 spaceBefore >= 0,则空间是法线高度的百分比。如果 spaceBefore < 0,则 linepacing 的绝对值是以磅为单位的间距示例: // 段落将被格式化为在段落文本之前有一个间距。 // 间距将是每行最大文本大小的 200%。paragraph.setSpaceBefore(200); // 间距将是 48 磅的大小 paragraph.setSpaceBefore(-48.0);)
spaceBefore - the vertical white space before the paragraph.
(spaceBefore - 段落前的垂直空白。)
public double getSpaceBefore()
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value of linespacing is the spacing in points
(段落前的垂直空白量 这可以通过两种不同的方式指定,百分比间距和字体点间距: 如果 spaceBefore >= 0,则间距是正常行高的百分比。如果 spaceBefore < 0,则 linepacing 的绝对值是以磅为单位的间距)public void setSpaceAfter(double spaceAfter)
If spaceAfter >= 0, then space is a percentage of normal line height. If spaceAfter < 0, the absolute value of linespacing is the spacing in points
Examples:
// The paragraph will be formatted to have a spacing after the paragraph text.
// The spacing will be 200% of the size of the largest text on each line
paragraph.setSpaceAfter(200);
// The spacing will be a size of 48 points
paragraph.setSpaceAfter(-48.0);
(设置段落后出现的垂直空白量。此空间以百分比或点数指定:如果 spaceAfter >= 0,则空间是法线高度的百分比。如果 spaceAfter < 0,则 linepacing 的绝对值是以磅为单位的间距示例: // 段落将被格式化为在段落文本之后有一个间距。 // 间距将是每行最大文本大小的 200%。paragraph.setSpaceAfter(200); // 间距将是 48 磅的大小 paragraph.setSpaceAfter(-48.0);)
spaceAfter - the vertical white space after the paragraph.
(spaceAfter - 段落后的垂直空白。)
public double getSpaceAfter()
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value of linespacing is the spacing in points
(段落后的垂直空白量 这可以通过两种不同的方式指定,百分比间距和字体点间距: 如果 spaceBefore >= 0,则间距是正常行高的百分比。如果 spaceBefore < 0,则 linepacing 的绝对值是以磅为单位的间距)public void setLevel(int level)
Note that the closest properties object to the text is used, therefore if there is a conflict between the text paragraph properties and the list style properties for this level then the text paragraph properties will take precedence.
(指定此段落将遵循的特定级别文本属性。此属性的值根据与该段落所属的文本主体相关联的样式列表中定义的相应级别段落属性来格式化文本(因此在父形状中)。请注意,使用最接近文本的属性对象,因此如果文本段落属性与此级别的列表样式属性之间存在冲突,则文本段落属性将优先。)level - the level (0 ... 4)
(level - 级别 (0 ... 4))
public int getLevel()
public boolean isBullet()
public void setBullet(boolean flag)
flag - whether text in this paragraph has bullets
(flag - 本段中的文本是否有项目符号)
public void setBullet(ListAutoNumber scheme, int startAt)
scheme - type of auto-numbering
(方案 - 自动编号的类型)
startAt - the number that will start number for a given sequence of automatically numbered bullets (1-based).
(startAt - 给定自动编号项目符号序列的起始编号(从 1 开始)。)
public void setBullet(ListAutoNumber scheme)
scheme - type of auto-numbering
(方案 - 自动编号的类型)
public boolean isBulletAutoNumber()
public int getBulletAutoNumberStart()
public ListAutoNumber getBulletAutoNumberScheme()
public java.lang.String toString()
toString in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.