Package org.apache.poi.hslf.usermodel
Class HSLFTextRun
- java.lang.Object
-
- org.apache.poi.hslf.usermodel.HSLFTextRun
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextRun
TextRun.FieldType, TextRun.TextCap
-
-
Constructor Summary
Constructors Constructor Description HSLFTextRun(HSLFTextParagraph parentParagraph)Create a new wrapper around a rich text string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HSLFHyperlinkcreateHyperlink()TextPropCollectiongetCharacterStyle()TextRun.FieldTypegetFieldType()PaintStyle.SolidPaintgetFontColor()StringgetFontFamily()StringgetFontFamily(FontGroup fontGroup)intgetFontIndex()Gets the font indexHSLFFontInfogetFontInfo(FontGroup fontGroup)DoublegetFontSize()HSLFHyperlinkgetHyperlink()intgetLength()Get the length of the textHSLFTextParagraphgetParagraph()bytegetPitchAndFamily()StringgetRawText()Fetch the text, in raw storage formintgetSuperscript()Gets the subscript/superscript optionTextRun.TextCapgetTextCap()HSLFTextParagraphgetTextParagraph()booleanisBold()booleanisEmbossed()Is this text embossed?booleanisItalic()booleanisShadowed()Does the text have a shadow?booleanisStrikethrough()booleanisSubscript()booleanisSuperscript()booleanisUnderlined()voidsetBold(boolean bold)voidsetCharacterStyle(TextPropCollection characterStyle)voidsetCharTextPropVal(String propName, Integer val)Sets the value of the given Paragraph TextProp, add if requiredvoidsetEmbossed(boolean flag)Is this text embossed?voidsetFontColor(int bgr)Sets color of the text, as a int bgr.voidsetFontColor(Color color)voidsetFontColor(PaintStyle color)voidsetFontFamily(String typeface)voidsetFontFamily(String typeface, FontGroup fontGroup)voidsetFontIndex(int idx)Sets the font indexvoidsetFontInfo(FontInfo fontInfo, FontGroup fontGroup)voidsetFontSize(Double fontSize)voidsetItalic(boolean italic)voidsetShadowed(boolean flag)Does the text have a shadow?voidsetStrikethrough(boolean flag)voidsetSuperscript(int val)Sets the subscript/superscript optionvoidsetText(String text)Change the textvoidsetUnderlined(boolean underlined)voidupdateSheet()Supply the SlideShow we belong to
-
-
-
Constructor Detail
-
HSLFTextRun
public HSLFTextRun(HSLFTextParagraph parentParagraph)
Create a new wrapper around a rich text string- Parameters:
parentParagraph- the parent paragraph
-
-
Method Detail
-
getCharacterStyle
public TextPropCollection getCharacterStyle()
-
setCharacterStyle
public void setCharacterStyle(TextPropCollection characterStyle)
-
updateSheet
public void updateSheet()
Supply the SlideShow we belong to
-
getLength
public int getLength()
Get the length of the text
-
getRawText
public String getRawText()
Fetch the text, in raw storage form- Specified by:
getRawTextin interfaceTextRun
-
setText
public void setText(String text)
Change the text
-
setCharTextPropVal
public void setCharTextPropVal(String propName, Integer val)
Sets the value of the given Paragraph TextProp, add if required- Parameters:
propName- The name of the Paragraph TextPropval- The value to set for the TextProp
-
isUnderlined
public boolean isUnderlined()
- Specified by:
isUnderlinedin interfaceTextRun
-
setUnderlined
public void setUnderlined(boolean underlined)
- Specified by:
setUnderlinedin interfaceTextRun
-
isShadowed
public boolean isShadowed()
Does the text have a shadow?
-
setShadowed
public void setShadowed(boolean flag)
Does the text have a shadow?
-
isEmbossed
public boolean isEmbossed()
Is this text embossed?
-
setEmbossed
public void setEmbossed(boolean flag)
Is this text embossed?
-
isStrikethrough
public boolean isStrikethrough()
- Specified by:
isStrikethroughin interfaceTextRun
-
setStrikethrough
public void setStrikethrough(boolean flag)
- Specified by:
setStrikethroughin interfaceTextRun
-
getSuperscript
public int getSuperscript()
Gets the subscript/superscript option- Returns:
- the percentage of the font size. If the value is positive, it is superscript, otherwise it is subscript
-
setSuperscript
public void setSuperscript(int val)
Sets the subscript/superscript option- Parameters:
val- the percentage of the font size. If the value is positive, it is superscript, otherwise it is subscript
-
getFontSize
public Double getFontSize()
- Specified by:
getFontSizein interfaceTextRun
-
setFontSize
public void setFontSize(Double fontSize)
- Specified by:
setFontSizein interfaceTextRun
-
getFontIndex
public int getFontIndex()
Gets the font index
-
setFontIndex
public void setFontIndex(int idx)
Sets the font index
-
setFontFamily
public void setFontFamily(String typeface)
- Specified by:
setFontFamilyin interfaceTextRun
-
setFontFamily
public void setFontFamily(String typeface, FontGroup fontGroup)
- Specified by:
setFontFamilyin interfaceTextRun
-
setFontInfo
public void setFontInfo(FontInfo fontInfo, FontGroup fontGroup)
- Specified by:
setFontInfoin interfaceTextRun
-
getFontFamily
public String getFontFamily()
- Specified by:
getFontFamilyin interfaceTextRun
-
getFontFamily
public String getFontFamily(FontGroup fontGroup)
- Specified by:
getFontFamilyin interfaceTextRun
-
getFontInfo
public HSLFFontInfo getFontInfo(FontGroup fontGroup)
- Specified by:
getFontInfoin interfaceTextRun
-
getFontColor
public PaintStyle.SolidPaint getFontColor()
- Specified by:
getFontColorin interfaceTextRun- Returns:
- font color as PaintStyle
-
setFontColor
public void setFontColor(int bgr)
Sets color of the text, as a int bgr. (PowerPoint stores as BlueGreenRed, not the more usual RedGreenBlue)- See Also:
Color
-
setFontColor
public void setFontColor(Color color)
- Specified by:
setFontColorin interfaceTextRun
-
setFontColor
public void setFontColor(PaintStyle color)
- Specified by:
setFontColorin interfaceTextRun
-
getTextParagraph
public HSLFTextParagraph getTextParagraph()
-
getTextCap
public TextRun.TextCap getTextCap()
- Specified by:
getTextCapin interfaceTextRun
-
isSubscript
public boolean isSubscript()
- Specified by:
isSubscriptin interfaceTextRun
-
isSuperscript
public boolean isSuperscript()
- Specified by:
isSuperscriptin interfaceTextRun
-
getPitchAndFamily
public byte getPitchAndFamily()
- Specified by:
getPitchAndFamilyin interfaceTextRun
-
getHyperlink
public HSLFHyperlink getHyperlink()
- Specified by:
getHyperlinkin interfaceTextRun
-
createHyperlink
public HSLFHyperlink createHyperlink()
- Specified by:
createHyperlinkin interfaceTextRun
-
getFieldType
public TextRun.FieldType getFieldType()
- Specified by:
getFieldTypein interfaceTextRun
-
getParagraph
public HSLFTextParagraph getParagraph()
- Specified by:
getParagraphin interfaceTextRun
-
-