public class XWPFRun extends java.lang.Object implements ISDTContents, IRunElement, CharacterRun
Modifier and Type | Class and Description |
---|---|
static class |
XWPFRun.FontCharRange |
Constructor and Description |
---|
XWPFRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR r, IRunBody p) |
XWPFRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR r, XWPFParagraph p)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addBreak()
Specifies that a break shall be placed at the current location in the run content.
(指定中断应放置在运行内容中的当前位置。)
|
void |
addBreak(BreakClear clear)
Specifies that a break shall be placed at the current location in the run content.
(指定中断应放置在运行内容中的当前位置。)
|
void |
addBreak(BreakType type)
Specifies that a break shall be placed at the current location in the run content.
(指定中断应放置在运行内容中的当前位置。)
|
void |
addCarriageReturn()
Specifies that a carriage return shall be placed at the current location in the run content.
(指定应在运行内容中的当前位置放置回车符。)
|
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline |
addChart(java.lang.String chartRelId)
this method add chart template into document
(此方法将图表模板添加到文档中)
|
XWPFPicture |
addPicture(java.io.InputStream pictureData, int pictureType, java.lang.String filename, int width, int height)
Adds a picture to the run.
(将图片添加到运行中。)
|
void |
addTab()
Specifies that a tab shall be placed at the current location in the run content.
(指定标签应放置在运行内容中的当前位置。)
|
int |
getCharacterSpacing() |
java.lang.String |
getColor()
Get text color.
(获取文本颜色。)
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR |
getCTR()
Get the currently used CTR object
(获取当前使用的 CTR 对象)
|
XWPFDocument |
getDocument() |
java.util.List<XWPFPicture> |
getEmbeddedPictures()
Returns the embedded pictures of the run.
(返回运行的嵌入图片。)
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.STEm.Enum |
getEmphasisMark()
Get the emphasis mark value for the run.
(获取运行的强调标记值。)
|
java.lang.String |
getFontFamily()
Gets the fonts which shall be used to display the text contents of this run.
(获取用于显示本次运行的文本内容的字体。)
|
java.lang.String |
getFontFamily(XWPFRun.FontCharRange fcr)
Gets the font family for the specified font char range.
(获取指定字体字符范围的字体系列。)
|
java.lang.String |
getFontName()
Alias for
getFontFamily()
(getFontFamily() 的别名)
|
int |
getFontSize()
|
java.lang.Double |
getFontSizeAsDouble()
Specifies the font size which shall be applied to all non complex script characters in the contents of this run when displayed.
(指定在显示时应用于此运行内容中所有非复杂脚本字符的字体大小。)
|
int |
getKerning() |
java.lang.String |
getLang()
Get the language tag associated with this run, if any.
(获取与此运行关联的语言标签(如果有)。)
|
XWPFParagraph |
getParagraph()
|
IRunBody |
getParent()
Get the currently referenced paragraph/SDT object
(获取当前引用的段落/SDT 对象)
|
java.lang.String |
getPhonetic() |
java.lang.String |
getPictureText()
Returns text embedded in pictures
(返回图片中嵌入的文本)
|
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr |
getRunProperties(boolean create)
Get the run properties for the run.
(获取运行的运行属性。)
|
java.lang.String |
getStyle()
Return this run's style ID.
(返回此运行的样式 ID。)
|
java.lang.String |
getText(int pos)
Return the string content of this text run
(返回此文本运行的字符串内容)
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor.Enum |
getTextHightlightColor()
Gets the highlight color for the run
(获取运行的突出显示颜色)
|
int |
getTextPosition()
This element specifies the amount by which text shall be raised or lowered for this run in relation to the default baseline of the surrounding non-positioned text.
(此元素指定本次运行中文本相对于周围非定位文本的默认基线应升高或降低的量。)
|
int |
getTextScale()
Gets the current text scale value.
(获取当前文本比例值。)
|
UnderlinePatterns |
getUnderline()
Get the underline setting for the run.
(获取运行的下划线设置。)
|
java.lang.String |
getUnderlineColor()
Get the underline color for the run's underline, if any.
(获取运行下划线的下划线颜色(如果有)。)
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.STThemeColor.Enum |
getUnderlineThemeColor()
Get the underline theme color for the run's underline, if any.
(获取运行下划线的下划线主题颜色(如果有)。)
|
org.openxmlformats.schemas.officeDocument.x2006.sharedTypes.STVerticalAlignRun.Enum |
getVerticalAlignment()
Get the vertical alignment value
(获取垂直对齐值)
|
boolean |
isBold()
Whether the bold property shall be applied to all non-complex script characters in the contents of this run when displayed in a document
(当显示在文档中时,是否将粗体属性应用于本次运行内容中的所有非复杂脚本字符)
|
boolean |
isCapitalized() |
boolean |
isDoubleStrikeThrough()
Specifies that the contents of this run shall be displayed with a double horizontal line through the center of the line.
(指定此运行的内容应显示为一条穿过线中心的双水平线。)
|
boolean |
isEmbossed() |
boolean |
isHighlighted() |
boolean |
isImprinted() |
boolean |
isItalic()
Whether the italic property should be applied to all non-complex script characters in the contents of this run when displayed in a document.
(当显示在文档中时,是否应将斜体属性应用于此运行的内容中的所有非复杂脚本字符。)
|
boolean |
isShadowed() |
boolean |
isSmallCaps() |
boolean |
isStrike()
Deprecated.
(已弃用。)
|
boolean |
isStrikeThrough()
Specifies that the contents of this run shall be displayed with a single horizontal line through the center of the line.
(指定此运行的内容应显示为一条穿过线中心的水平线。)
|
boolean |
isVanish()
Get the vanish (hidden text) value
(获取消失(隐藏文本)值)
|
void |
removeBreak() |
void |
removeCarriageReturn() |
void |
removeTab() |
void |
setBold(boolean value)
Whether the bold property shall be applied to all non-complex script characters in the contents of this run when displayed in a document.
(当显示在文档中时,是否将粗体属性应用于本次运行内容中的所有非复杂脚本字符。)
|
void |
setCapitalized(boolean value) |
void |
setCharacterSpacing(int twips) |
void |
setColor(java.lang.String rgbStr)
Set text color.
(设置文本颜色。)
|
void |
setDoubleStrikethrough(boolean value)
Specifies that the contents of this run shall be displayed with a double horizontal line through the center of the line.
(指定此运行的内容应显示为一条穿过线中心的双水平线。)
|
void |
setEmbossed(boolean value) |
void |
setEmphasisMark(java.lang.String markType)
Set the emphasis mark for the run.
(设置运行的强调标记。)
|
void |
setFontFamily(java.lang.String fontFamily)
Specifies the fonts which shall be used to display the text contents of this run.
(指定用于显示本次运行的文本内容的字体。)
|
void |
setFontFamily(java.lang.String fontFamily, XWPFRun.FontCharRange fcr)
Specifies the fonts which shall be used to display the text contents of this run.
(指定用于显示本次运行的文本内容的字体。)
|
void |
setFontSize(double size)
Specifies the font size which shall be applied to all non complex script characters in the contents of this run when displayed.
(指定在显示时应用于此运行内容中所有非复杂脚本字符的字体大小。)
|
void |
setFontSize(int size)
Specifies the font size which shall be applied to all non complex script characters in the contents of this run when displayed.
(指定在显示时应用于此运行内容中所有非复杂脚本字符的字体大小。)
|
void |
setImprinted(boolean value) |
void |
setItalic(boolean value)
Whether the bold property shall be applied to all non-complex script characters in the contents of this run when displayed in a document
(当显示在文档中时,是否将粗体属性应用于本次运行内容中的所有非复杂脚本字符)
|
void |
setKerning(int kern) |
void |
setLang(java.lang.String lang)
Set the language tag associated with this run.
(设置与此运行关联的语言标签。)
|
void |
setShadow(boolean value) |
void |
setSmallCaps(boolean value) |
void |
setStrike(boolean value)
Deprecated.
(已弃用。)
|
void |
setStrikeThrough(boolean value)
Specifies that the contents of this run shall be displayed with a single horizontal line through the center of the line.
(指定此运行的内容应显示为一条穿过线中心的水平线。)
|
void |
setStyle(java.lang.String styleId)
Set the style ID for the run.
(设置运行的样式 ID。)
|
void |
setSubscript(VerticalAlign valign)
Specifies the alignment which shall be applied to the contents of this run in relation to the default appearance of the run's text.
(指定应用于该运行的内容的对齐方式,该对齐方式与运行文本的默认外观相关。)
|
void |
setText(java.lang.String value)
Sets the text of this text run
(设置此文本运行的文本)
|
void |
setText(java.lang.String value, int pos)
Sets the text of this text run in the
(设置此文本的文本运行在)
|
void |
setTextHighlightColor(java.lang.String colorName)
Set the highlight color for the run.
(设置运行的突出显示颜色。)
|
void |
setTextPosition(int val)
This element specifies the amount by which text shall be raised or lowered for this run in relation to the default baseline of the surrounding non-positioned text.
(此元素指定本次运行中文本相对于周围非定位文本的默认基线应升高或降低的量。)
|
void |
setTextScale(int percentage)
Set the text expand/collapse scale value.
(设置文本展开/折叠比例值。)
|
void |
setUnderline(UnderlinePatterns value)
Specifies that the contents of this run should be displayed along with an underline appearing directly below the character height.
(指定该运行的内容应与字符高度正下方的下划线一起显示。)
|
void |
setUnderlineColor(java.lang.String color)
Set the underline color for the run's underline, if any.
(为运行的下划线设置下划线颜色(如果有)。)
|
void |
setUnderlineThemeColor(java.lang.String themeColor)
Set the underline theme color for the run's underline, if any.
(为运行的下划线设置下划线主题颜色(如果有)。)
|
void |
setVanish(boolean value)
The vanish (hidden text) property for the run.
(运行的消失(隐藏文本)属性。)
|
void |
setVerticalAlignment(java.lang.String verticalAlignment)
Set the vertical alignment of the run.
(设置梯段的垂直对齐方式。)
|
java.lang.String |
text()
Returns the string version of the text, with tabs and carriage returns in place of their xml equivalents.
(返回文本的字符串版本,用制表符和回车代替它们的 xml 等效项。)
|
java.lang.String |
toString()
Returns the string version of the text and the phonetic string
(返回文本的字符串版本和拼音字符串)
|
public XWPFRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR r, IRunBody p)
r
- the CTR bean which holds the run attributes
(r - 保存运行属性的 CTR bean)
p
- the parent paragraph
(p - 父段落)
@Deprecated public XWPFRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR r, XWPFParagraph p)
@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR getCTR()
public IRunBody getParent()
@Deprecated public XWPFParagraph getParagraph()
getParent()
instead
public XWPFDocument getDocument()
XWPFDocument
instance, this run belongs to, or
null
if parent structure (paragraph > document) is not properly set.
(此运行所属的 XWPFDocument 实例,如果未正确设置父结构(段落 > 文档),则为 null。)
public java.lang.String getLang()
public void setLang(java.lang.String lang)
lang
- the language tag associated with this run
(lang - 与此运行关联的语言标记)
public boolean isBold()
isBold
in interface
CharacterRun
(接口 CharacterRun 中的 isBold)
true
if the bold property is applied
(如果应用了粗体属性,则为 true)
public void setBold(boolean value)
This formatting property is a toggle property, which specifies that its behavior differs between its use within a style definition and its use as direct formatting. When used as part of a style definition, setting this property shall toggle the current state of that property as specified up to this point in the hierarchy (i.e. applied to not applied, and vice versa). Setting it to false
(or an equivalent) shall result in the current setting remaining unchanged. However, when used as direct formatting, setting this property to true or false shall set the absolute state of the resulting property.
If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then bold shall not be applied to non-complex script characters.
(当显示在文档中时,是否将粗体属性应用于本次运行内容中的所有非复杂脚本字符。此格式属性是一个切换属性,它指定其行为在样式定义中的使用和作为直接格式的使用之间是不同的。当用作样式定义的一部分时,设置此属性应切换该属性的当前状态,如在层次结构中指定到此点(即应用到未应用,反之亦然)。将其设置为 false(或等效项)将导致当前设置保持不变。但是,当用作直接格式时,将此属性设置为 true 或 false 将设置结果属性的绝对状态。如果此元素不存在,则默认值为在样式层次结构中的上一层应用格式。如果此元素从未在样式层次结构中应用,则粗体不应应用于非复杂脚本字符。)setBold
in interface
CharacterRun
(接口 CharacterRun 中的 setBold)
value
-
true
if the bold property is applied to this run
(value - 如果粗体属性应用于此运行,则为 true)
public java.lang.String getColor()
public void setColor(java.lang.String rgbStr)
rgbStr
- - the desired color, in the hex form "RRGGBB".
(rgbStr - - 所需的颜色,十六进制格式“RRGGBB”。)
public java.lang.String getText(int pos)
null
if not set
(此文本的文本运行或 null 如果未设置)
public java.lang.String getPictureText()
public void setText(java.lang.String value)
value
- the literal text which shall be displayed in the document
(value - 应在文档中显示的文字文本)
public void setText(java.lang.String value, int pos)
value
- the literal text which shall be displayed in the document
(value - 应在文档中显示的文字文本)
pos
- - position in the text array (NB: 0 based)
(pos - - 在文本数组中的位置(NB:基于 0))
public boolean isItalic()
isItalic
in interface
CharacterRun
(接口 CharacterRun 中的 isItalic)
true
if the italic property is applied
(如果应用了斜体属性,则为真)
public void setItalic(boolean value)
This formatting property is a toggle property, which specifies that its behavior differs between its use within a style definition and its use as direct formatting. When used as part of a style definition, setting this property shall toggle the current state of that property as specified up to this point in the hierarchy (i.e. applied to not applied, and vice versa). Setting it to false
(or an equivalent) shall result in the current setting remaining unchanged. However, when used as direct formatting, setting this property to true or false shall set the absolute state of the resulting property.
If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then bold shall not be applied to non-complex script characters.
(当显示在文档中时,是否将粗体属性应用于此运行内容中的所有非复杂脚本字符 此格式属性是一个切换属性,它指定其行为在样式定义中的使用和作为直接格式化。当用作样式定义的一部分时,设置此属性应切换该属性的当前状态,如在层次结构中指定到此点(即应用到未应用,反之亦然)。将其设置为 false(或等效项)将导致当前设置保持不变。但是,当用作直接格式时,将此属性设置为 true 或 false 将设置结果属性的绝对状态。如果此元素不存在,则默认值为在样式层次结构中的上一层应用格式。如果此元素从未在样式层次结构中应用,则粗体不应应用于非复杂脚本字符。)setItalic
in interface
CharacterRun
(接口 CharacterRun 中的 setItalic)
value
-
true
if the italic property is applied to this run
(value - 如果斜体属性应用于此运行,则为 true)
public UnderlinePatterns getUnderline()
(@link UnderlinePatterns}
public void setUnderline(UnderlinePatterns value)
If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then an underline shall not be applied to the contents of this run.
(指定此运行的内容应与字符高度正下方的下划线一起显示。如果此元素不存在,则默认值为在样式层次结构中的上一层应用格式。如果此元素从未应用于样式层次结构,则不应将下划线应用于此运行的内容。)value
- - underline type
(value - - 下划线类型)
UnderlinePatterns} : all possible patterns that could be applied
public void setUnderlineColor(java.lang.String color)
color
- An RGB color value (e.g, "a0C6F3") or "auto".
(color - RGB 颜色值(例如,“a0C6F3”)或“auto”。)
public void setUnderlineThemeColor(java.lang.String themeColor)
themeColor
- A theme color name (see
STThemeColor.Enum
).
(themeColor - 主题颜色名称(参见 STThemeColor.Enum)。)
public org.openxmlformats.schemas.wordprocessingml.x2006.main.STThemeColor.Enum getUnderlineThemeColor()
STThemeColor.Enum
.
(STThemeColor.Enum。)
public java.lang.String getUnderlineColor()
public boolean isStrikeThrough()
isStrikeThrough
in interface
CharacterRun
(接口 CharacterRun 中的 isStrikeThrough)
true
if the strike property is applied
(如果应用了罢工属性,则为 true)
public void setStrikeThrough(boolean value)
This formatting property is a toggle property, which specifies that its behaviour differs between its use within a style definition and its use as direct formatting. When used as part of a style definition, setting this property shall toggle the current state of that property as specified up to this point in the hierarchy (i.e. applied to not applied, and vice versa). Setting it to false (or an equivalent) shall result in the current setting remaining unchanged. However, when used as direct formatting, setting this property to true or false shall set the absolute state of the resulting property.
If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then strikethrough shall not be applied to the contents of this run.
(指定此运行的内容应显示为一条穿过线中心的水平线。此格式属性是一个切换属性,它指定其行为在样式定义中的使用和作为直接格式的使用之间是不同的。当用作样式定义的一部分时,设置此属性应切换该属性的当前状态,如在层次结构中指定到此点(即应用到未应用,反之亦然)。将其设置为 false(或等效项)将导致当前设置保持不变。但是,当用作直接格式化时,将此属性设置为 true 或 false 将设置结果属性的绝对状态。如果此元素不存在,则默认值为在样式层次结构中的上一层应用格式。如果此元素从未应用于样式层次结构,则删除线不应应用于此运行的内容。)setStrikeThrough
in interface
CharacterRun
(接口 CharacterRun 中的 setStrikeThrough)
value
-
true
if the strike property is applied to this run
(value - 如果将罢工属性应用于此运行,则为 true)
@Deprecated public boolean isStrike()
@Deprecated public void setStrike(boolean value)
public boolean isDoubleStrikeThrough()
isDoubleStrikeThrough
in interface
CharacterRun
(接口 CharacterRun 中的 isDoubleStrikeThrough)
true
if the double strike property is applied
(如果应用了双重打击属性,则为 true)
public void setDoubleStrikethrough(boolean value)
setDoubleStrikethrough
in interface
CharacterRun
(接口 CharacterRun 中的 setDoubleStrikethrough)
for the rules about this
public boolean isSmallCaps()
isSmallCaps
in interface
CharacterRun
(接口 CharacterRun 中的 isSmallCaps)
public void setSmallCaps(boolean value)
setSmallCaps
in interface
CharacterRun
(接口 CharacterRun 中的 setSmallCaps)
public boolean isCapitalized()
isCapitalized
in interface
CharacterRun
(接口 CharacterRun 中的 isCapitalized)
public void setCapitalized(boolean value)
setCapitalized
in interface
CharacterRun
(接口 CharacterRun 中的 setCapitalized)
public boolean isShadowed()
isShadowed
in interface
CharacterRun
(接口 CharacterRun 中的 isShadowed)
public void setShadow(boolean value)
setShadow
in interface
CharacterRun
(接口 CharacterRun 中的 setShadow)
public boolean isImprinted()
isImprinted
in interface
CharacterRun
(isImprinted 在接口 CharacterRun 中)
public void setImprinted(boolean value)
setImprinted
in interface
CharacterRun
(接口 CharacterRun 中的 setImprinted)
public boolean isEmbossed()
isEmbossed
in interface
CharacterRun
(接口 CharacterRun 中的 isEmbossed)
public void setEmbossed(boolean value)
setEmbossed
in interface
CharacterRun
(界面 CharacterRun 中的 setEmbossed)
public void setSubscript(VerticalAlign valign)
If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then the text shall not be subscript or superscript relative to the default baseline location for the contents of this run.
(指定应用于该运行的内容的对齐方式,与运行文本的默认外观相关。这允许将文本重新定位为下标或上标,而无需更改运行属性的字体大小。如果此元素不存在,则默认值为在样式层次结构中的上一层应用格式。如果此元素从未在样式层次结构中应用,则文本不应是相对于本次运行内容的默认基线位置的下标或上标。)valign
- Type of vertical align to apply
(valign - 要应用的垂直对齐类型)
VerticalAlign
public int getKerning()
getKerning
in interface
CharacterRun
(接口 CharacterRun 中的 getKerning)
public void setKerning(int kern)
setKerning
in interface
CharacterRun
(接口 CharacterRun 中的 setKerning)
public boolean isHighlighted()
isHighlighted
in interface
CharacterRun
(接口 CharacterRun 中的 isHighlighted)
public int getCharacterSpacing()
getCharacterSpacing
in interface
CharacterRun
(接口 CharacterRun 中的 getCharacterSpacing)
public void setCharacterSpacing(int twips)
setCharacterSpacing
in interface
CharacterRun
(接口 CharacterRun 中的 setCharacterSpacing)
public java.lang.String getFontFamily()
public void setFontFamily(java.lang.String fontFamily)
Also sets the other font ranges, if they haven't been set before
(指定用于显示本次运行的文本内容的字体。指定一种字体,用于格式化父运行中 ASCII 范围 (0 - 127) 内的所有字符。还设置其他字体范围,如果它们之前没有设置过)fontFamily
- The font family to apply
(fontFamily - 要应用的字体系列)
XWPFRun.FontCharRange
public java.lang.String getFontName()
getFontFamily()
(getFontFamily() 的别名)
getFontName
in interface
CharacterRun
(接口 CharacterRun 中的 getFontName)
public java.lang.String getFontFamily(XWPFRun.FontCharRange fcr)
fcr
- the font char range, defaults to "ansi"
(fcr - 字体字符范围,默认为“ansi”)
public void setFontFamily(java.lang.String fontFamily, XWPFRun.FontCharRange fcr)
fontFamily
- The font family to apply
(fontFamily - 要应用的字体系列)
fcr
- FontCharRange or null for default handling
(fcr - FontCharRange 或 null 用于默认处理)
@Deprecated @Removal(version="6.0.0") public int getFontSize()
getFontSizeAsDouble()
getFontSize
in interface
CharacterRun
(接口 CharacterRun 中的 getFontSize)
public java.lang.Double getFontSizeAsDouble()
getFontSizeAsDouble
in interface
CharacterRun
(接口 CharacterRun 中的 getFontSizeAsDouble)
public void setFontSize(int size)
If this element is not present, the default value is to leave the value applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then any appropriate font size may be used for non complex script characters.
(指定在显示时应用于此运行内容中所有非复杂脚本字符的字体大小。如果此元素不存在,则默认值为在样式层次结构中的上一级应用该值。如果此元素从未在样式层次结构中应用,则任何适当的字体大小都可用于非复杂脚本字符。)setFontSize
in interface
CharacterRun
(接口 CharacterRun 中的 setFontSize)
size
- The font size as number of point measurements.
(size - 字体大小作为点测量的数量。)
setFontSize(double)
public void setFontSize(double size)
If this element is not present, the default value is to leave the value applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then any appropriate font size may be used for non complex script characters.
(指定在显示时应用于此运行内容中所有非复杂脚本字符的字体大小。如果此元素不存在,则默认值为在样式层次结构中的上一级应用该值。如果此元素从未在样式层次结构中应用,则任何适当的字体大小都可用于非复杂脚本字符。)setFontSize
in interface
CharacterRun
(接口 CharacterRun 中的 setFontSize)
size
- The font size as number of point measurements.
(size - 字体大小作为点测量的数量。)
setFontSize(int)
public int getTextPosition()
public void setTextPosition(int val)
If the val attribute is positive, then the parent run shall be raised above the baseline of the surrounding text by the specified number of half-points. If the val attribute is negative, then the parent run shall be lowered below the baseline of the surrounding text by the specified number of half-points.
If this element is not present, the default value is to leave the formatting applied at previous level in the style hierarchy. If this element is never applied in the style hierarchy, then the text shall not be raised or lowered relative to the default baseline location for the contents of this run.
(此元素指定本次运行中文本相对于周围非定位文本的默认基线应升高或降低的量。这允许在不改变内容字体大小的情况下重新定位文本。如果 val 属性为正,则父运行应高于周围文本的基线指定的半点数。如果 val 属性为负,则父运行应低于周围文本的基线指定的半点数。如果此元素不存在,则默认值为在样式层次结构中的上一层应用格式。如果此元素从未在样式层次结构中应用,则文本不应相对于本次运行内容的默认基线位置升高或降低。)val
- Positive values will raise the baseline of the text, negative values will lower it.
(val - 正值将提高文本的基线,负值将降低它。)
public void removeBreak()
public void addBreak()
addCarriageReturn()
public void addBreak(BreakType type)
The behavior of this break character (the location where text shall be restarted after this break) shall be determined by its type values.
(指定应在运行内容中的当前位置放置一个中断。换行符是一个特殊字符,用于覆盖将根据文档内容的正常布局执行的正常换行符。此中断字符的行为(在此中断之后应重新启动文本的位置)应由其类型值确定。)BreakType
public void addBreak(BreakClear clear)
The behavior of this break character (the location where text shall be restarted after this break) shall be determined by its type (in this case is BreakType.TEXT_WRAPPING as default) and clear attribute values.
(指定中断应放置在运行内容中的当前位置。换行符是一个特殊字符,用于覆盖将根据文档内容的正常布局执行的正常换行符。此中断字符的行为(在此中断之后应重新启动文本的位置)应由其类型(在这种情况下为 BreakType.TEXT_WRAPPING 作为默认值)和清除属性值确定。)BreakClear
public void addTab()
public void removeTab()
public void addCarriageReturn()
public void removeCarriageReturn()
public XWPFPicture addPicture(java.io.InputStream pictureData, int pictureType, java.lang.String filename, int width, int height) throws InvalidFormatException, java.io.IOException
pictureData
- The raw picture data
(pictureData - 原始图片数据)
pictureType
- The type of the picture, eg
Document.PICTURE_TYPE_JPEG
(pictureType - 图片的类型,例如 Document.PICTURE_TYPE_JPEG)
width
- width in EMUs. To convert to / from points use
Units
(width - EMU 中的宽度。要转换为/从点使用单位)
height
- height in EMUs. To convert to / from points use
Units
(height - EMU 中的高度。要转换为/从点使用单位)
InvalidFormatException
- If the format of the picture is not known.
(InvalidFormatException - 如果图片的格式未知。)
java.io.IOException
- If reading the picture-data from the stream fails.
(java.io.IOException - 如果从流中读取图片数据失败。)
Document.PICTURE_TYPE_EMF
,
Document.PICTURE_TYPE_WMF
,
Document.PICTURE_TYPE_PICT
,
Document.PICTURE_TYPE_JPEG
,
Document.PICTURE_TYPE_PNG
,
Document.PICTURE_TYPE_DIB
@Internal public org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline addChart(java.lang.String chartRelId) throws InvalidFormatException, java.io.IOException
chartRelId
- relation id of chart in document relation file
(chartRelId - 文档关系文件中图表的关系 ID)
InvalidFormatException
(无效格式异常)
java.io.IOException
(java.io.IOException)
public java.util.List<XWPFPicture> getEmbeddedPictures()
public void setStyle(java.lang.String styleId)
styleId
- ID (not name) of the style to set for the run, e.g. "BoldItalic" (not "Bold Italic").
(styleId - 为运行设置的样式的 ID(不是名称),例如“BoldItalic”(不是“Bold Italic”)。)
public java.lang.String getStyle()
public java.lang.String toString()
toString
in class
java.lang.Object
public java.lang.String text()
text
in interface
CharacterRun
(CharacterRun 界面中的文本)
public java.lang.String getPhonetic()
public void setTextScale(int percentage)
percentage
- The percentage to expand or compress the text
(百分比 - 扩展或压缩文本的百分比)
public int getTextScale()
public void setTextHighlightColor(java.lang.String colorName)
colorName
- The name of the color as defined in the ST_HighlightColor simple type (
STHightlightColor
)
(colorName - ST_HighlightColor 简单类型 (STHightlightColor) 中定义的颜色名称)
public org.openxmlformats.schemas.wordprocessingml.x2006.main.STHighlightColor.Enum getTextHightlightColor()
STHighlightColor
for the run.
(运行的 STHighlightColor。)
public boolean isVanish()
public void setVanish(boolean value)
value
- Set to true to make the run hidden text.
(value - 设置为 true 以使运行隐藏文本。)
public org.openxmlformats.schemas.officeDocument.x2006.sharedTypes.STVerticalAlignRun.Enum getVerticalAlignment()
STVerticalAlignRun.Enum
value (see 22.9.2.17 ST_VerticalAlignRun (Vertical Positioning Location))
(STVerticalAlignRun.Enum 值(参见 22.9.2.17 ST_VerticalAlignRun(垂直定位位置)))
public void setVerticalAlignment(java.lang.String verticalAlignment)
verticalAlignment
- Vertical alignment value, one of "baseline", "superscript", or "subscript".
(verticalAlignment - 垂直对齐值,“基线”、“上标”或“下标”之一。)
public org.openxmlformats.schemas.wordprocessingml.x2006.main.STEm.Enum getEmphasisMark()
STEm.Enum
emphasis mark type enumeration. See 17.18.24 ST_Em (Emphasis Mark Type).
(STEm.Enum 强调标记类型枚举。请参见 17.18.24 ST_Em(强调标记类型)。)
public void setEmphasisMark(java.lang.String markType)
markType
- Emphasis mark type name, e.g., "dot" or "none". See 17.18.24 ST_Em (Emphasis Mark Type)
(markType - 强调标记类型名称,例如,“dot”或“none”。请参阅 17.18.24 ST_Em(强调标记类型))
protected org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr getRunProperties(boolean create)
create
- If true, create the properties, if false, do not.
(create - 如果为 true,则创建属性,如果为 false,则不创建。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.