|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.xslf.usermodel.XSLFTextParagraph
@Beta public class XSLFTextParagraph
Represents a paragraph of text within the containing text body. The paragraph is the highest level text separation mechanism.
Method Summary | |
---|---|
void |
addLineBreak()
|
XSLFTextRun |
addNewTextRun()
|
double |
getIndent()
|
double |
getLeftMargin()
|
int |
getLevel()
|
double |
getLineSpacing()
Returns the vertical line spacing that is to be used within a paragraph. |
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: |
java.lang.String |
getText()
|
TextAlign |
getTextAlign()
Returns the alignment that is applied to the paragraph. |
java.util.List<XSLFTextRun> |
getTextRuns()
|
org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph |
getXmlObject()
|
java.util.Iterator<XSLFTextRun> |
iterator()
|
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 |
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.lang.String getText()
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph getXmlObject()
public java.util.List<XSLFTextRun> getTextRuns()
public java.util.Iterator<XSLFTextRun> iterator()
iterator
in interface java.lang.Iterable<XSLFTextRun>
public XSLFTextRun addNewTextRun()
public void addLineBreak()
public TextAlign getTextAlign()
public void setTextAlign(TextAlign align)
TextAlign
.
align
- text alignpublic void setIndent(double value)
value
- the indent in points. The value of -1 unsets the indent attribute
from the underlying xml bean.public double getIndent()
public void setLeftMargin(double value)
value
- the left margin of the paragraphpublic double getLeftMargin()
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);
linespacing
- the vertical line spacingpublic 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
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
- the vertical white space before the paragraph.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
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
- the vertical white space after the paragraph.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
public void setLevel(int level)
level
- the level (0 ... 4)public int getLevel()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |