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 |
protected static POILogger |
logger |
| Modifier and Type | Method and Description |
|---|---|
void |
addTabStops(double positionInPoints,
TabStop.TabStopType tabStopType) |
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() |
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() |
java.lang.Double |
getIndent() |
int |
getIndentLevel() |
protected int |
getIndex() |
java.lang.Double |
getLeftMargin() |
java.lang.Double |
getLineSpacing() |
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() |
int |
getRunType()
Returns the type of the text, from the TextHeaderAtom.
|
protected int |
getShapeId() |
HSLFSheet |
getSheet() |
java.lang.Double |
getSpaceAfter() |
java.lang.Double |
getSpaceBefore() |
StyleTextProp9Atom |
getStyleTextProp9Atom()
Numbered List info
|
java.util.List<? extends TabStop> |
getTabStops() |
static java.lang.String |
getText(java.util.List<HSLFTextParagraph> paragraphs) |
TextParagraph.TextAlign |
getTextAlign() |
EscherTextboxWrapper |
getTextboxWrapper() |
TextRulerAtom |
getTextRuler() |
java.util.List<HSLFTextRun> |
getTextRuns() |
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() |
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) |
void |
setDirty()
marks this paragraph dirty, so its records will be renewed on save
|
void |
setIndent(java.lang.Double indent) |
void |
setIndentLevel(int level) |
protected void |
setIndex(int index)
Sets the index of the paragraph in the SLWT container
|
void |
setLeftMargin(java.lang.Double leftMargin) |
void |
setLineSpacing(java.lang.Double lineSpacing) |
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) |
void |
setSpaceBefore(java.lang.Double spaceBefore) |
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) |
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 static final POILogger logger
protected TextRulerAtom _ruler
protected final java.util.List<HSLFTextRun> _runs
protected HSLFTextShape _parentShape
public void addTextRun(HSLFTextRun run)
public java.util.List<HSLFTextRun> getTextRuns()
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)
index - public int getRunType()
TextHeaderAtompublic 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.lang.Double getLeftMargin()
getLeftMargin in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void setLeftMargin(java.lang.Double leftMargin)
setLeftMargin in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public java.lang.Double getRightMargin()
getRightMargin in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void setRightMargin(java.lang.Double rightMargin)
setRightMargin in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public java.lang.Double getIndent()
getIndent in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void setIndent(java.lang.Double indent)
setIndent in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public 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)
setTextAlign in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public TextParagraph.TextAlign getTextAlign()
getTextAlign in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public TextParagraph.FontAlign getFontAlign()
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>public void setBulletStyle(java.lang.Object... styles)
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)
setIndentLevel in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>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)
setLineSpacing in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public java.lang.Double getLineSpacing()
getLineSpacing in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void setSpaceBefore(java.lang.Double spaceBefore)
setSpaceBefore in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public java.lang.Double getSpaceBefore()
getSpaceBefore in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void setSpaceAfter(java.lang.Double spaceAfter)
setSpaceAfter in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public java.lang.Double getSpaceAfter()
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()
getTabStops in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void addTabStops(double positionInPoints,
TabStop.TabStopType tabStopType)
addTabStops in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>public void clearTabStops()
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)
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.Objectprotected 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()
isHeaderOrFooter in interface TextParagraph<HSLFShape,HSLFTextParagraph,HSLFTextRun>RoundTripHFPlaceholder12