Class XDDFTextParagraph
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
XDDFTextParagraph
(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph paragraph, XDDFTextBody parent) -
Method Summary
Modifier and TypeMethodDescriptionappendField
(String id, String type, String text) Append a new text field.Append a line break.appendRegularRun
(String text) Append a new run of text.int
protected <R> Optional<R>
findDefinedParagraphProperty
(Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties, Boolean> isSet, Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties, R> getter) protected <R> Optional<R>
findDefinedRunProperty
(Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties, Boolean> isSet, Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties, R> getter) Returns the bullet size that is to be used within a paragraph.Returns where vertically on a line of text the actual words are positioned.Returns the vertical line spacing that is to be used within a paragraph.The amount of vertical white space after the paragraph.The amount of vertical white space before the paragraph.getTabStop
(int index) getText()
Returns the alignment that is applied to the paragraph.boolean
boolean
boolean
insertTabStop
(int index) boolean
iterator()
void
removeTabStop
(int index) void
setAfterLastRunProperties
(XDDFRunProperties properties) void
setBulletColor
(XDDFColor color) Set the color to be used on bullet characters within a given paragraph.void
Specifies the color to be used on bullet characters has to follow text color within a given paragraph.void
setBulletFont
(XDDFFont font) Set the font to be used on bullet characters within a given paragraph.void
Specifies the font to be used on bullet characters has to follow text font within a given paragraph.void
setBulletSize
(XDDFBulletSize size) Sets the bullet size that is to be used within a paragraph.void
setBulletStyle
(XDDFBulletStyle style) void
setDefaultRunProperties
(XDDFRunProperties properties) void
setDefaultTabSize
(Double points) Specifies the default size for a tab character within this paragraph.void
setEastAsianLineBreak
(Boolean value) void
setFontAlignment
(FontAlignment align) Determines where vertically on a line of text the actual words are positioned.void
setHangingPunctuation
(Boolean value) void
setIndentation
(Double points) Specifies the indentation size that will be applied to the first line of text in the paragraph.void
setLatinLineBreak
(Boolean value) void
setLineSpacing
(XDDFSpacing linespacing) This element specifies the vertical line spacing that is to be used within a paragraph.void
setMarginLeft
(Double points) Specifies the left margin of the paragraph.void
setMarginRight
(Double points) Specifies the right margin of the paragraph.void
setRightToLeft
(Boolean value) void
setSpaceAfter
(XDDFSpacing spaceAfter) Set the amount of vertical white space that will be present after the paragraph.void
setSpaceBefore
(XDDFSpacing spaceBefore) Set the amount of vertical white space that will be present before the paragraph.void
void
setTextAlignment
(TextAlignment align) Specifies the alignment that is to be applied to the paragraph.
-
Constructor Details
-
XDDFTextParagraph
@Internal protected XDDFTextParagraph(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph paragraph, XDDFTextBody parent)
-
-
Method Details
-
setText
-
getText
-
getParentBody
-
getTextRuns
-
iterator
-
appendLineBreak
Append a line break.- Returns:
- text run representing this line break ('\n').
-
appendField
Append a new text field.- Returns:
- the new text field.
-
appendRegularRun
Append a new run of text.- Returns:
- the new run of text.
-
getTextAlignment
Returns the alignment that is applied to the paragraph. If this attribute is omitted, then a value of left is implied.- Returns:
- alignment that is applied to the paragraph
-
setTextAlignment
Specifies the alignment that is to be applied to the paragraph. Possible values for this include left, right, centered, justified and distributed,- Parameters:
align
- text alignment
-
getFontAlignment
Returns where vertically on a line of text the actual words are positioned. This deals with vertical placement of the characters with respect to the baselines. If this attribute is omitted, then a value of baseline is implied.- Returns:
- alignment that is applied to the paragraph
-
setFontAlignment
Determines where vertically on a line of text the actual words are positioned. This deals with vertical placement of the characters with respect to the baselines. For instance having text anchored to the top baseline, anchored to the bottom baseline, centered in between, etc.- Parameters:
align
- text font alignment
-
getIndentation
- Returns:
- the indentation, in points, applied to the first line of text in the paragraph.
-
setIndentation
Specifies the indentation size that will be applied to the first line of text in the paragraph.- Parameters:
points
- the indentation in points. The valuenull
unsets the indentation for this paragraph.- Minimum inclusive =
- -4032
- Maximum inclusive =
- 4032
-
getMarginLeft
- Returns:
- the left margin, in points, of the paragraph.
-
setMarginLeft
Specifies the left margin of the paragraph. This is specified in addition to the text body inset and applies only to this text paragraph. That is the text body inset and the LeftMargin attributes are additive with respect to the text position.- Parameters:
points
- the margin in points. The valuenull
unsets the left margin for this paragraph.- Minimum inclusive =
- 0
- Maximum inclusive =
- 4032
-
getMarginRight
- Returns:
- the right margin, in points, of the paragraph.
-
setMarginRight
Specifies the right margin of the paragraph. This is specified in addition to the text body inset and applies only to this text paragraph. That is the text body inset and the RightMargin attributes are additive with respect to the text position.- Parameters:
points
- the margin in points. The valuenull
unsets the right margin for this paragraph.- Minimum inclusive =
- 0
- Maximum inclusive =
- 4032
-
getDefaultTabSize
- Returns:
- the default size for a tab character within this paragraph in points.
-
setDefaultTabSize
Specifies the default size for a tab character within this paragraph.- Parameters:
points
- the default tab size in points. The valuenull
unsets the default tab size for this paragraph.
-
getLineSpacing
Returns the vertical line spacing that is to be used within a paragraph. This may be specified in two different ways, percentage spacing or font points spacing:If line spacing is a percentage of normal line height, result is instance of XDDFSpacingPercent. If line spacing is expressed in points, result is instance of XDDFSpacingPoints.
- Returns:
- the vertical line spacing.
-
setLineSpacing
This element specifies the vertical line spacing that is to be used within a paragraph. This may be specified in two different ways, percentage spacing or font points spacing:If spacing is instance of XDDFSpacingPercent, then line spacing is a percentage of normal line height. If spacing is instance of XDDFSpacingPoints, then line spacing is expressed in points.
Examples:// spacing will be 120% of the size of the largest text on each line paragraph.setLineSpacing(new XDDFSpacingPercent(120)); // spacing will be 200% of the size of the largest text on each line paragraph.setLineSpacing(new XDDFSpacingPercent(200)); // spacing will be 48 points paragraph.setLineSpacing(new XDDFSpacingPoints(48.0));
- Parameters:
linespacing
- the vertical line spacing
-
getSpaceBefore
The amount of vertical white space before the paragraph. This may be specified in two different ways, percentage spacing or font points spacing:If spacing is a percentage of normal line height, result is instance of XDDFSpacingPercent. If spacing is expressed in points, result is instance of XDDFSpacingPoints.
- Returns:
- the vertical white space before the paragraph.
-
setSpaceBefore
Set the amount of vertical white space that will be present before the paragraph. This may be specified in two different ways, percentage spacing or font points spacing:If spacing is instance of XDDFSpacingPercent, then spacing is a percentage of normal line height. If spacing is instance of XDDFSpacingPoints, then spacing is expressed 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(new XDDFSpacingPercent(200)); // The spacing will be a size of 48 points paragraph.setSpaceBefore(new XDDFSpacingPoints(48.0));
- Parameters:
spaceBefore
- the vertical white space before the paragraph.
-
getSpaceAfter
The amount of vertical white space after the paragraph. This may be specified in two different ways, percentage spacing or font points spacing:If spacing is a percentage of normal line height, result is instance of XDDFSpacingPercent. If spacing is expressed in points, result is instance of XDDFSpacingPoints.
- Returns:
- the vertical white space after the paragraph.
-
setSpaceAfter
Set the amount of vertical white space that will be present after the paragraph. This may be specified in two different ways, percentage spacing or font points spacing:If spacing is instance of XDDFSpacingPercent, then spacing is a percentage of normal line height. If spacing is instance of XDDFSpacingPoints, then spacing is expressed 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(new XDDFSpacingPercent(200)); // The spacing will be a size of 48 points paragraph.setSpaceAfter(new XDDFSpacingPoints(48.0));
- Parameters:
spaceAfter
- the vertical white space after the paragraph.
-
getBulletColor
- Returns:
- the color of bullet characters within a given paragraph. A
null
value means to use the text font color.
-
setBulletColor
Set the color to be used on bullet characters within a given paragraph.- Parameters:
color
- the bullet color
-
setBulletColorFollowText
public void setBulletColorFollowText()Specifies the color to be used on bullet characters has to follow text color within a given paragraph. -
getBulletFont
- Returns:
- the font of bullet characters within a given paragraph. A
null
value means to use the text font font.
-
setBulletFont
Set the font to be used on bullet characters within a given paragraph.- Parameters:
font
- the bullet font
-
setBulletFontFollowText
public void setBulletFontFollowText()Specifies the font to be used on bullet characters has to follow text font within a given paragraph. -
getBulletSize
Returns the bullet size that is to be used within a paragraph. This may be specified in three different ways, follows text size, percentage size and font points size:If returned value is instance of XDDFBulletSizeFollowText, then bullet size is text size; If returned value is instance of XDDFBulletSizePercent, then bullet size is a percentage of the font size; If returned value is instance of XDDFBulletSizePoints, then bullet size is specified in points.
- Returns:
- the bullet size
-
setBulletSize
Sets the bullet size that is to be used within a paragraph. This may be specified in three different ways, follows text size, percentage size and font points size:If given value is instance of XDDFBulletSizeFollowText, then bullet size is text size; If given value is instance of XDDFBulletSizePercent, then bullet size is a percentage of the font size; If given value is instance of XDDFBulletSizePoints, then bullet size is specified in points.
- Parameters:
size
- the bullet size specification
-
getBulletStyle
-
setBulletStyle
-
hasEastAsianLineBreak
public boolean hasEastAsianLineBreak() -
setEastAsianLineBreak
-
hasLatinLineBreak
public boolean hasLatinLineBreak() -
setLatinLineBreak
-
hasHangingPunctuation
public boolean hasHangingPunctuation() -
setHangingPunctuation
-
isRightToLeft
public boolean isRightToLeft() -
setRightToLeft
-
addTabStop
-
insertTabStop
-
removeTabStop
public void removeTabStop(int index) -
getTabStop
-
getTabStops
-
countTabStops
public int countTabStops() -
getOrCreateBulletProperties
-
getBulletProperties
-
addDefaultRunProperties
- Since:
- 4.0.1
-
getDefaultRunProperties
-
setDefaultRunProperties
-
addAfterLastRunProperties
-
getAfterLastRunProperties
-
setAfterLastRunProperties
-
findDefinedParagraphProperty
-
findDefinedRunProperty
-