|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 | |
---|---|
XSLFTextRun |
addLineBreak()
Insert a line break |
XSLFTextRun |
addNewTextRun()
Add a new run of text |
double |
draw(java.awt.Graphics2D graphics,
double x,
double y)
|
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()
|
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: |
double |
getTabStop(int idx)
|
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()
|
boolean |
isBullet()
Returns whether this paragraph has bullets |
java.util.Iterator<XSLFTextRun> |
iterator()
|
void |
setBullet(boolean flag)
|
void |
setBulletAutoNumber(ListAutoNumber scheme,
int startAt)
Specifies that automatic numbered bullet points should be applied to this paragraph |
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 |
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 XSLFTextRun addLineBreak()
public TextAlign getTextAlign()
public void setTextAlign(TextAlign align)
TextAlign
.
align
- text alignpublic 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 colorpublic double getBulletFontSize()
If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
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
public void setIndent(double value)
value
- the indent in points.public double getIndent()
public void setLeftMargin(double value)
value
- the left margin of the paragraphpublic double getLeftMargin()
public double getDefaultTabSize()
public double getTabStop(int idx)
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 boolean isBullet()
public void setBullet(boolean flag)
flag
- whether text in this paragraph has bulletspublic void setBulletAutoNumber(ListAutoNumber scheme, int startAt)
scheme
- type of auto-numberingstartAt
- the number that will start number for a given sequence of automatically
numbered bullets (1-based).public java.lang.String toString()
toString
in class java.lang.Object
public double draw(java.awt.Graphics2D graphics, double x, double y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |