org.apache.poi.hslf.usermodel
Class RichTextRun

java.lang.Object
  extended by org.apache.poi.hslf.usermodel.RichTextRun

public class RichTextRun
extends java.lang.Object

Represents a run of text, all with the same style TODO: finish all the getters and setters to the font/character/paragraph properties (currently only has some of them)


Constructor Summary
RichTextRun(TextRun parent, int startAt, int len)
          Create a new wrapper around a (currently not) rich text string
RichTextRun(TextRun parent, int startAt, int len, TextPropCollection pStyle, TextPropCollection cStyle, boolean pShared, boolean cShared)
          Create a new wrapper around a rich text string
 
Method Summary
 TextPropCollection _getRawCharacterStyle()
          Internal Use Only - get the underlying character style collection.
 TextPropCollection _getRawParagraphStyle()
          Internal Use Only - get the underlying paragraph style collection.
 boolean _isCharacterStyleShared()
          Internal Use Only - are the Character styles shared?
 boolean _isParagraphStyleShared()
          Internal Use Only - are the Paragraph styles shared?
 int getAlignment()
          Returns the type of horizontal alignment for the text.
 char getBulletChar()
          Returns the bullet character
 int getBulletOffset()
          Returns the bullet offset
 java.awt.Color getFontColor()
           
 java.lang.String getFontName()
           
 int getFontSize()
           
 int getIndentLevel()
           
 int getLength()
          Get the length of the text
 java.lang.String getRawText()
          Fetch the text, in raw storage form
 java.lang.String getText()
          Fetch the text, in output suitable form
 int getTextOffset()
          Returns the text offset
 boolean isBold()
           
 boolean isBullet()
          Returns whether this rich text run has bullets
 boolean isItalic()
           
 boolean isUnderlined()
           
 void setAlignment(int align)
          Sets the type of horizontal alignment for the text.
 void setBold(boolean bold)
           
 void setBullet(boolean flag)
          Sets whether this rich text run has bullets
 void setBulletChar(char c)
          Sets the bullet character
 void setBulletOffset(int offset)
          Sets the bullet offset
 void setCharTextPropVal(java.lang.String propName, int val)
          Sets the value of the given Paragraph TextProp, add if required
 void setFlag(boolean isCharacter, int index, boolean value)
           
 void setFontColor(java.awt.Color color)
          Sets color of the text, as a java.awt.Color
 void setFontColor(int bgr)
          Sets color of the text, as a int bgr.
 void setFontName(java.lang.String fontName)
           
 void setFontSize(int fontSize)
           
 void setItalic(boolean italic)
           
 void setParaTextPropVal(java.lang.String propName, int val)
          Sets the value of the given Character TextProp, add if required
 void setText(java.lang.String text)
          Change the text
 void setTextOffset(int offset)
          Sets the text offset
 void setUnderlined(boolean underlined)
           
 void supplySlideShow(SlideShow ss)
          Supply the SlideShow we belong to
 void supplyTextProps(TextPropCollection pStyle, TextPropCollection cStyle, boolean pShared, boolean cShared)
          Supply (normally default) textprops, and if they're shared, when a run gets them
 void updateStartPosition(int startAt)
          Tells the RichTextRun its new position in the parent TextRun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RichTextRun

public RichTextRun(TextRun parent,
                   int startAt,
                   int len)
Create a new wrapper around a (currently not) rich text string

Parameters:
parent -
startAt -
len -

RichTextRun

public RichTextRun(TextRun parent,
                   int startAt,
                   int len,
                   TextPropCollection pStyle,
                   TextPropCollection cStyle,
                   boolean pShared,
                   boolean cShared)
Create a new wrapper around a rich text string

Parameters:
parent - The parent TextRun
startAt - The start position of this run
len - The length of this run
pStyle - The paragraph style property collection
cStyle - The character style property collection
pShared - The paragraph styles are shared with other runs
cShared - The character styles are shared with other runs
Method Detail

supplyTextProps

public void supplyTextProps(TextPropCollection pStyle,
                            TextPropCollection cStyle,
                            boolean pShared,
                            boolean cShared)
Supply (normally default) textprops, and if they're shared, when a run gets them


supplySlideShow

public void supplySlideShow(SlideShow ss)
Supply the SlideShow we belong to


getLength

public int getLength()
Get the length of the text


getText

public java.lang.String getText()
Fetch the text, in output suitable form


getRawText

public java.lang.String getRawText()
Fetch the text, in raw storage form


setText

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


updateStartPosition

public void updateStartPosition(int startAt)
Tells the RichTextRun its new position in the parent TextRun

Parameters:
startAt -

setFlag

public void setFlag(boolean isCharacter,
                    int index,
                    boolean value)

setParaTextPropVal

public void setParaTextPropVal(java.lang.String propName,
                               int val)
Sets the value of the given Character TextProp, add if required

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

setCharTextPropVal

public void setCharTextPropVal(java.lang.String propName,
                               int 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()

setBold

public void setBold(boolean bold)

isItalic

public boolean isItalic()

setItalic

public void setItalic(boolean italic)

isUnderlined

public boolean isUnderlined()

setUnderlined

public void setUnderlined(boolean underlined)

getFontSize

public int getFontSize()

setFontSize

public void setFontSize(int fontSize)

setFontName

public void setFontName(java.lang.String fontName)

getFontName

public java.lang.String getFontName()

getFontColor

public java.awt.Color getFontColor()
Returns:
font color as RGB value
See Also:
Color

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)
Sets color of the text, as a java.awt.Color


setAlignment

public void setAlignment(int align)
Sets the type of horizontal alignment for the text. One of the Align* constants defined in the TextBox class.

Parameters:
align - - the type of alignment

getAlignment

public int getAlignment()
Returns the type of horizontal alignment for the text. One of the Align* constants defined in the TextBox class.

Returns:
the type of alignment

getIndentLevel

public int getIndentLevel()
Returns:
indentation level

setBullet

public void setBullet(boolean flag)
Sets whether this rich text run has bullets


isBullet

public boolean isBullet()
Returns whether this rich text run has bullets


setBulletChar

public void setBulletChar(char c)
Sets the bullet character


getBulletChar

public char getBulletChar()
Returns the bullet character


setBulletOffset

public void setBulletOffset(int offset)
Sets the bullet offset


getBulletOffset

public int getBulletOffset()
Returns the bullet offset


setTextOffset

public void setTextOffset(int offset)
Sets the text offset


getTextOffset

public int getTextOffset()
Returns the text offset


_getRawParagraphStyle

public TextPropCollection _getRawParagraphStyle()
Internal Use Only - get the underlying paragraph style collection. For normal use, use the friendly setters and getters


_getRawCharacterStyle

public TextPropCollection _getRawCharacterStyle()
Internal Use Only - get the underlying character style collection. For normal use, use the friendly setters and getters


_isParagraphStyleShared

public boolean _isParagraphStyleShared()
Internal Use Only - are the Paragraph styles shared?


_isCharacterStyleShared

public boolean _isCharacterStyleShared()
Internal Use Only - are the Character styles shared?



Copyright 2008 The Apache Software Foundation or its licensors, as applicable.