org.apache.poi.hslf.usermodel
Class HSLFTextRun

java.lang.Object
  extended by org.apache.poi.hslf.usermodel.HSLFTextRun
All Implemented Interfaces:
TextRun

public final class HSLFTextRun
extends java.lang.Object
implements TextRun

Represents a run of text, all with the same style


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextRun
TextRun.FieldType, TextRun.TextCap
 
Field Summary
protected  POILogger logger
           
 
Constructor Summary
HSLFTextRun(HSLFTextParagraph parentParagraph)
          Create a new wrapper around a rich text string
 
Method Summary
 HSLFHyperlink createHyperlink()
           
 TextPropCollection getCharacterStyle()
           
 TextRun.FieldType getFieldType()
           
protected  boolean getFlag(int index)
           
 PaintStyle.SolidPaint getFontColor()
           
 java.lang.String getFontFamily()
           
 int getFontIndex()
          Gets the font index
 java.lang.Double getFontSize()
           
 HSLFHyperlink getHyperlink()
           
 int getLength()
          Get the length of the text
 byte getPitchAndFamily()
           
 java.lang.String getRawText()
          Fetch the text, in raw storage form
 int getSuperscript()
          Gets the subscript/superscript option
 TextRun.TextCap getTextCap()
           
 HSLFTextParagraph getTextParagraph()
           
 boolean isBold()
           
 boolean isEmbossed()
          Is this text embossed?
 boolean isItalic()
           
 boolean isShadowed()
          Does the text have a shadow?
 boolean isStrikethrough()
           
 boolean isSubscript()
           
 boolean isSuperscript()
           
 boolean isUnderlined()
           
 void setBold(boolean bold)
           
 void setCharacterStyle(TextPropCollection characterStyle)
           
 void setCharTextPropVal(java.lang.String propName, java.lang.Integer val)
          Sets the value of the given Paragraph TextProp, add if required
 void setEmbossed(boolean flag)
          Is this text embossed?
protected  void setFlag(int index, boolean value)
           
 void setFontColor(java.awt.Color color)
           
 void setFontColor(int bgr)
          Sets color of the text, as a int bgr.
 void setFontColor(PaintStyle color)
           
 void setFontFamily(java.lang.String fontFamily)
           
 void setFontIndex(int idx)
          Sets the font index
 void setFontSize(java.lang.Double fontSize)
           
protected  void setHyperlink(HSLFHyperlink link)
          Sets the hyperlink - used when parsing the document
 void setItalic(boolean italic)
           
 void setShadowed(boolean flag)
          Does the text have a shadow?
 void setStrikethrough(boolean flag)
           
 void setSuperscript(int val)
          Sets the subscript/superscript option
 void setText(java.lang.String text)
          Change the text
 void setUnderlined(boolean underlined)
           
 void updateSheet()
          Supply the SlideShow we belong to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected POILogger logger
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 java.lang.String getRawText()
Fetch the text, in raw storage form

Specified by:
getRawText in interface TextRun

setText

public void setText(java.lang.String text)
Change the text

Specified by:
setText in interface TextRun

getFlag

protected boolean getFlag(int index)

setCharTextPropVal

public void setCharTextPropVal(java.lang.String propName,
                               java.lang.Integer val)
Sets the value of the given Paragraph TextProp, add if required

Parameters:
propName - The name of the Paragraph TextProp
val - The value to set for the TextProp

isBold

public boolean isBold()
Specified by:
isBold in interface TextRun

setBold

public void setBold(boolean bold)
Specified by:
setBold in interface TextRun

isItalic

public boolean isItalic()
Specified by:
isItalic in interface TextRun

setItalic

public void setItalic(boolean italic)
Specified by:
setItalic in interface TextRun

isUnderlined

public boolean isUnderlined()
Specified by:
isUnderlined in interface TextRun

setUnderlined

public void setUnderlined(boolean underlined)
Specified by:
setUnderlined in interface TextRun

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:
isStrikethrough in interface TextRun

setStrikethrough

public void setStrikethrough(boolean flag)
Specified by:
setStrikethrough in interface TextRun

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 java.lang.Double getFontSize()
Specified by:
getFontSize in interface TextRun

setFontSize

public void setFontSize(java.lang.Double fontSize)
Specified by:
setFontSize in interface TextRun

getFontIndex

public int getFontIndex()
Gets the font index


setFontIndex

public void setFontIndex(int idx)
Sets the font index


setFontFamily

public void setFontFamily(java.lang.String fontFamily)
Specified by:
setFontFamily in interface TextRun

getFontFamily

public java.lang.String getFontFamily()
Specified by:
getFontFamily in interface TextRun

getFontColor

public PaintStyle.SolidPaint getFontColor()
Specified by:
getFontColor in interface TextRun
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(java.awt.Color color)
Specified by:
setFontColor in interface TextRun

setFontColor

public void setFontColor(PaintStyle color)
Specified by:
setFontColor in interface TextRun

setFlag

protected void setFlag(int index,
                       boolean value)

getTextParagraph

public HSLFTextParagraph getTextParagraph()

getTextCap

public TextRun.TextCap getTextCap()
Specified by:
getTextCap in interface TextRun

isSubscript

public boolean isSubscript()
Specified by:
isSubscript in interface TextRun

isSuperscript

public boolean isSuperscript()
Specified by:
isSuperscript in interface TextRun

getPitchAndFamily

public byte getPitchAndFamily()
Specified by:
getPitchAndFamily in interface TextRun

setHyperlink

protected void setHyperlink(HSLFHyperlink link)
Sets the hyperlink - used when parsing the document

Parameters:
link - the hyperlink

getHyperlink

public HSLFHyperlink getHyperlink()
Specified by:
getHyperlink in interface TextRun

createHyperlink

public HSLFHyperlink createHyperlink()
Specified by:
createHyperlink in interface TextRun

getFieldType

public TextRun.FieldType getFieldType()
Specified by:
getFieldType in interface TextRun