public final class HSLFTextParagraph extends java.lang.Object implements TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
TextParagraph.BulletStyle, TextParagraph.FontAlign, TextParagraph.TextAlign
Modifier and Type | Field and Description |
---|---|
protected HSLFTextShape |
_parentShape |
protected TextRulerAtom |
_ruler |
protected java.util.List<HSLFTextRun> |
_runs |
Modifier and Type | Method and Description |
---|---|
void |
addTabStops(double positionInPoints,
TabStop.TabStopType tabStopType)
Set the
TabStop collection |
void |
addTextRun(HSLFTextRun run) |
protected static HSLFTextRun |
appendText(java.util.List<HSLFTextParagraph> paragraphs,
java.lang.String text,
boolean newParagraph)
Adds the supplied text onto the end of the TextParagraphs,
creating a new RichTextRun for it to sit in.
|
protected static void |
applyCharacterStyles(java.util.List<HSLFTextParagraph> paragraphs,
java.util.List<TextPropCollection> charStyles) |
protected static void |
applyHyperlinks(java.util.List<HSLFTextParagraph> paragraphs) |
protected static void |
applyParagraphIndents(java.util.List<HSLFTextParagraph> paragraphs,
java.util.List<IndentProp> paraStyles) |
protected static void |
applyParagraphStyles(java.util.List<HSLFTextParagraph> paragraphs,
java.util.List<TextPropCollection> paraStyles) |
void |
clearTabStops()
Removes the tabstops of this paragraphs.
|
TextRulerAtom |
createTextRuler() |
protected static java.util.List<HSLFTextParagraph> |
findTextParagraphs(EscherTextboxWrapper wrapper,
HSLFSheet sheet)
Scans through the supplied record array, looking for
a TextHeaderAtom followed by one of a TextBytesAtom or
a TextCharsAtom.
|
static java.util.List<java.util.List<HSLFTextParagraph>> |
findTextParagraphs(PPDrawing ppdrawing,
HSLFSheet sheet)
For a given PPDrawing, grab all the TextRuns
|
protected static java.util.List<java.util.List<HSLFTextParagraph>> |
findTextParagraphs(Record[] records)
Scans through the supplied record array, looking for
a TextHeaderAtom followed by one of a TextBytesAtom or
a TextCharsAtom.
|
protected static void |
fixLineEndings(java.util.List<HSLFTextParagraph> paragraphs)
Check and add linebreaks to text runs leading other paragraphs
|
AutoNumberingScheme |
getAutoNumberingScheme() |
java.lang.Integer |
getAutoNumberingStartAt() |
java.lang.Character |
getBulletChar()
Returns the bullet character
|
java.awt.Color |
getBulletColor()
Returns the bullet color
|
java.lang.String |
getBulletFont()
Returns the bullet font
|
java.lang.Double |
getBulletSize()
Returns the bullet size, null if unset
|
TextParagraph.BulletStyle |
getBulletStyle() |
protected static java.awt.Color |
getColorFromColorIndexStruct(int rgb,
HSLFSheet sheet) |
java.lang.String |
getDefaultFontFamily() |
java.lang.Double |
getDefaultFontSize() |
java.lang.Double |
getDefaultTabSize() |
TextParagraph.FontAlign |
getFontAlign()
Returns the font alignment that is applied to the paragraph.
|
java.lang.Double |
getIndent() |
int |
getIndentLevel() |
protected int |
getIndex() |
java.lang.Double |
getLeftMargin() |
java.lang.Double |
getLineSpacing()
Returns the vertical line spacing that is to be used within a paragraph.
|
TextPropCollection |
getParagraphStyle() |
HSLFTextShape |
getParentShape() |
protected <T extends TextProp> |
getPropVal(TextPropCollection props,
java.lang.String propName)
Fetch the value of the given Paragraph related TextProp.
|
static java.lang.String |
getRawText(java.util.List<HSLFTextParagraph> paragraphs) |
Record[] |
getRecords()
Returns records that make up the list of text paragraphs
(there can be misc InteractiveInfo, TxInteractiveInfo and other records)
|
java.lang.Double |
getRightMargin()
Specifies the right margin of the paragraph.
|
int |
getRunType()
Returns the type of the text, from the TextHeaderAtom.
|
protected int |
getShapeId() |
HSLFSheet |
getSheet() |
java.lang.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:
|
java.lang.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:
|
StyleTextProp9Atom |
getStyleTextProp9Atom()
Numbered List info
|
java.util.List<? extends TabStop> |
getTabStops()
Get the
TabStops - the list can't be and it's entries shouldn't be modified. |
static java.lang.String |
getText(java.util.List<HSLFTextParagraph> paragraphs) |
TextParagraph.TextAlign |
getTextAlign()
Returns the alignment that is applied to the paragraph.
|
EscherTextboxWrapper |
getTextboxWrapper() |
TextRulerAtom |
getTextRuler() |
java.util.List<HSLFTextRun> |
getTextRuns()
Fetch the text runs that are contained within this block of text
|
boolean |
isBullet()
Returns whether this rich text run has bullets
|
boolean |
isDirty() |
boolean |
isDrawingBased()
Is this Text Run one from a
PPDrawing , or is it
one from the SlideListWithText ? |
boolean |
isHeaderOrFooter()
Convenience method to determine if this text paragraph is part of
the slide header or footer
|
java.util.Iterator<HSLFTextRun> |
iterator() |
void |
setBullet(boolean flag)
Sets whether this rich text run has bullets
|
void |
setBulletChar(java.lang.Character c)
Sets the bullet character
|
void |
setBulletColor(java.awt.Color color)
Sets the bullet color
|
void |
setBulletFont(java.lang.String typeface)
Sets the bullet font
|
void |
setBulletSize(java.lang.Double size)
Sets the bullet size
|
void |
setBulletStyle(java.lang.Object... styles)
Sets the bullet styles.
|
void |
setDirty()
marks this paragraph dirty, so its records will be renewed on save
|
void |
setIndent(java.lang.Double indent)
Specifies the indent size that will be applied to the first line of text in the paragraph.
|
void |
setIndentLevel(int level)
Specifies the particular level text properties that this paragraph will follow.
|
protected void |
setIndex(int index)
Sets the index of the paragraph in the SLWT container
|
void |
setLeftMargin(java.lang.Double leftMargin)
Specifies the left margin of the paragraph.
|
void |
setLineSpacing(java.lang.Double lineSpacing)
This element specifies the vertical line spacing that is to be used within a paragraph.
|
void |
setParagraphStyle(TextPropCollection paragraphStyle) |
void |
setParagraphTextPropVal(java.lang.String propName,
java.lang.Integer val)
Sets the value of the given Paragraph TextProp, add if required
|
void |
setParentShape(HSLFTextShape parentShape) |
protected void |
setPropVal(TextPropCollection props,
java.lang.String name,
java.lang.Integer val)
Returns the named TextProp, either by fetching it (if it exists) or
adding it (if it didn't)
|
void |
setRightMargin(java.lang.Double rightMargin) |
void |
setRunType(int runType) |
protected void |
setShapeId(int id) |
void |
setSpaceAfter(java.lang.Double spaceAfter)
Set the amount of vertical white space that will be present after the paragraph.
|
void |
setSpaceBefore(java.lang.Double spaceBefore)
Set the amount of vertical white space that will be present before the paragraph.
|
void |
setStyleTextProp9Atom(StyleTextProp9Atom styleTextProp9Atom)
Numbered List info
|
static HSLFTextRun |
setText(java.util.List<HSLFTextParagraph> paragraphs,
java.lang.String text)
Sets (overwrites) the current text.
|
void |
setTextAlign(TextParagraph.TextAlign align)
Specifies the alignment that is to be applied to the paragraph.
|
java.util.Spliterator<HSLFTextRun> |
spliterator() |
protected static void |
storeText(java.util.List<HSLFTextParagraph> paragraphs)
Saves the modified paragraphs/textrun to the records.
|
static void |
supplySheet(java.util.List<HSLFTextParagraph> paragraphs,
HSLFSheet sheet)
Supply the Sheet we belong to, which might have an assigned SlideShow
Also passes it on to our child RichTextRuns
|
static java.lang.String |
toExternalString(java.lang.String rawText,
int runType)
Converts raw text from the text paragraphs to a formatted string,
i.e.
|
protected static java.lang.String |
toInternalString(java.lang.String s)
Returns a new string with line breaks converted into internal ppt
representation
|
java.lang.String |
toString() |
protected TextRulerAtom _ruler
protected final java.util.List<HSLFTextRun> _runs
protected HSLFTextShape _parentShape
public void addTextRun(HSLFTextRun run)
public java.util.List<HSLFTextRun> getTextRuns()
TextParagraph
getTextRuns
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public TextPropCollection getParagraphStyle()
public void setParagraphStyle(TextPropCollection paragraphStyle)
public static void supplySheet(java.util.List<HSLFTextParagraph> paragraphs, HSLFSheet sheet)
public HSLFSheet getSheet()
protected int getShapeId()
protected void setShapeId(int id)
id
- Shape IDprotected int getIndex()
protected void setIndex(int index)
public int getRunType()
TextHeaderAtom
public void setRunType(int runType)
public boolean isDrawingBased()
PPDrawing
, or is it
one from the SlideListWithText
?public TextRulerAtom getTextRuler()
public TextRulerAtom createTextRuler()
public Record[] getRecords()
public void setStyleTextProp9Atom(StyleTextProp9Atom styleTextProp9Atom)
public StyleTextProp9Atom getStyleTextProp9Atom()
public java.util.Iterator<HSLFTextRun> iterator()
iterator
in interface java.lang.Iterable<HSLFTextRun>
public java.util.Spliterator<HSLFTextRun> spliterator()
spliterator
in interface java.lang.Iterable<HSLFTextRun>
public java.lang.Double getLeftMargin()
getLeftMargin
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setLeftMargin(java.lang.Double leftMargin)
TextParagraph
setLeftMargin
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
leftMargin
- the left margin (in points) or null to unsetpublic java.lang.Double getRightMargin()
TextParagraph
getRightMargin
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setRightMargin(java.lang.Double rightMargin)
setRightMargin
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
rightMargin
- the right margin (in points) of the paragraphpublic java.lang.Double getIndent()
getIndent
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setIndent(java.lang.Double indent)
TextParagraph
setIndent
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
indent
- the indent (in points) applied to the first line of text in the paragraphpublic java.lang.String getDefaultFontFamily()
getDefaultFontFamily
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public java.lang.Double getDefaultFontSize()
getDefaultFontSize
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setTextAlign(TextParagraph.TextAlign align)
TextParagraph
TextParagraph.TextAlign
.setTextAlign
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
align
- text alignpublic TextParagraph.TextAlign getTextAlign()
TextParagraph
TextParagraph.TextAlign.LEFT
then.getTextAlign
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public TextParagraph.FontAlign getFontAlign()
TextParagraph
TextParagraph.FontAlign.AUTO
getFontAlign
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public AutoNumberingScheme getAutoNumberingScheme()
public java.lang.Integer getAutoNumberingStartAt()
public TextParagraph.BulletStyle getBulletStyle()
getBulletStyle
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
null
then no bullets are usedpublic void setBulletStyle(java.lang.Object... styles)
TextParagraph
setBulletStyle
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public HSLFTextShape getParentShape()
getParentShape
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setParentShape(HSLFTextShape parentShape)
public int getIndentLevel()
getIndentLevel
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setIndentLevel(int level)
TextParagraph
setIndentLevel
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
level
- the level (0 ... 4)public void setBullet(boolean flag)
public boolean isBullet()
public void setBulletChar(java.lang.Character c)
public java.lang.Character getBulletChar()
public void setBulletSize(java.lang.Double size)
public java.lang.Double getBulletSize()
public void setBulletColor(java.awt.Color color)
public java.awt.Color getBulletColor()
public void setBulletFont(java.lang.String typeface)
public java.lang.String getBulletFont()
public void setLineSpacing(java.lang.Double lineSpacing)
TextParagraph
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);
setLineSpacing
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
lineSpacing
- the vertical line spacingpublic java.lang.Double getLineSpacing()
TextParagraph
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
getLineSpacing
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setSpaceBefore(java.lang.Double spaceBefore)
TextParagraph
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);
setSpaceBefore
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
spaceBefore
- the vertical white space before the paragraph, null to unsetpublic java.lang.Double getSpaceBefore()
TextParagraph
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value in points
getSpaceBefore
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void setSpaceAfter(java.lang.Double spaceAfter)
TextParagraph
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);
setSpaceAfter
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
spaceAfter
- the vertical white space after the paragraph, null to unsetpublic java.lang.Double getSpaceAfter()
TextParagraph
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
getSpaceAfter
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public java.lang.Double getDefaultTabSize()
getDefaultTabSize
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public java.util.List<? extends TabStop> getTabStops()
TextParagraph
TabStops
- the list can't be and it's entries shouldn't be modified.
Opposed to other properties, this method is not cascading to the master sheet,
if the property is not defined on the normal slide level, i.e. the tabstops on
different levels aren't merged.getTabStops
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
null
if no tabstops are definedpublic void addTabStops(double positionInPoints, TabStop.TabStopType tabStopType)
TextParagraph
TabStop
collectionaddTabStops
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
public void clearTabStops()
TextParagraph
clearTabStops
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
protected <T extends TextProp> T getPropVal(TextPropCollection props, java.lang.String propName)
protected void setPropVal(TextPropCollection props, java.lang.String name, java.lang.Integer val)
props
- the TextPropCollection to fetch from / add intoname
- the name of the TextProp to fetch/addval
- the value, null if unsetprotected static void fixLineEndings(java.util.List<HSLFTextParagraph> paragraphs)
protected static void storeText(java.util.List<HSLFTextParagraph> paragraphs)
protected static HSLFTextRun appendText(java.util.List<HSLFTextParagraph> paragraphs, java.lang.String text, boolean newParagraph)
text
- the text string used by this object.public static HSLFTextRun setText(java.util.List<HSLFTextParagraph> paragraphs, java.lang.String text)
text
- the text string used by this object.public static java.lang.String getText(java.util.List<HSLFTextParagraph> paragraphs)
public static java.lang.String getRawText(java.util.List<HSLFTextParagraph> paragraphs)
public java.lang.String toString()
toString
in class java.lang.Object
protected static java.lang.String toInternalString(java.lang.String s)
public static java.lang.String toExternalString(java.lang.String rawText, int runType)
rawText
- the raw textrunType
- the run type of the shape, paragraph or headerAtom.
use -1 if unknownpublic static java.util.List<java.util.List<HSLFTextParagraph>> findTextParagraphs(PPDrawing ppdrawing, HSLFSheet sheet)
protected static java.util.List<HSLFTextParagraph> findTextParagraphs(EscherTextboxWrapper wrapper, HSLFSheet sheet)
wrapper
- an EscherTextboxWrapperprotected static java.util.List<java.util.List<HSLFTextParagraph>> findTextParagraphs(Record[] records)
records
- the records to build fromprotected static void applyHyperlinks(java.util.List<HSLFTextParagraph> paragraphs)
protected static void applyCharacterStyles(java.util.List<HSLFTextParagraph> paragraphs, java.util.List<TextPropCollection> charStyles)
protected static void applyParagraphStyles(java.util.List<HSLFTextParagraph> paragraphs, java.util.List<TextPropCollection> paraStyles)
protected static void applyParagraphIndents(java.util.List<HSLFTextParagraph> paragraphs, java.util.List<IndentProp> paraStyles)
public EscherTextboxWrapper getTextboxWrapper()
protected static java.awt.Color getColorFromColorIndexStruct(int rgb, HSLFSheet sheet)
public void setParagraphTextPropVal(java.lang.String propName, java.lang.Integer val)
propName
- The name of the Paragraph TextPropval
- The value to set for the TextProppublic void setDirty()
public boolean isDirty()
public boolean isHeaderOrFooter()
TextParagraph
isHeaderOrFooter
in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>
RoundTripHFPlaceholder12
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.