com.aspose.slides
Class TextFrame

java.lang.Object
  extended by com.aspose.slides.Shape
      extended by com.aspose.slides.TextFrame
All Implemented Interfaces:
IShape, IShapeFormat, ITextBox

public final class TextFrame
extends Shape
implements ITextBox

Represents the TextFrame shape.


Method Summary
 TextFrame addTextFrame(java.lang.String text)
          Adds a new TextFrame to a shape.
 void fitTextToShape()
          Decreases Paragraph's SpaceWithin and/or FontHeight to fit text to a TextFrame's rectangle.
 int getAnchorText()
          Returns the anchor text in a TextFrame.
 int getDateTimePosition()
          Deprecated. Use getMetaCharacters() instead.
 EffectiveTabs getEffectiveTabs(int ParagraphNumber)
          Returns the list of tabulations for a paragraph, including implicitly generated.
 int getFontRotation()
          Returns additional rotation of text in a shape.
 int getFooterPosition()
          Deprecated. Use getMetaCharacters() instead.
 int getFrameType()
           
 int getGenericDatePosition()
          Deprecated. Use getMetaCharacters() instead.
 int getHeaderPosition()
          Deprecated. Use getMetaCharacters() instead.
 Links getLinks()
          Returns the list of all links in a frame.
 float getMarginBottom()
          Returns the bottom margin (mm) in a TextFrame.
 float getMarginLeft()
          Returns the left margin (mm) in a TextFrame.
 float getMarginRight()
          Returns the right margin (mm) in a TextFrame.
 float getMarginTop()
          Returns the top margin (mm) in a TextFrame.
 com.aspose.slides.ppt.LevelStyle getMasterStyle(short depth)
          Returns LevelStyle from master slide.
 MetaCharacters getMetaCharacters()
          Returns the collection of meta characters.
 Paragraphs getParagraphs()
          Returns the list of all paragraphs in a frame.
 Slide getSlide()
          Returns the parent Slide for a TextFrame.
 int getSlideNumberPosition()
          Deprecated. Use getMetaCharacters() instead.
 Tabs getTabs()
          Deprecated. Use TextRuler.Tabs property instead.
 java.lang.String getText()
          Returns the plain text for a TextFrame.
 TextRuler getTextRuler()
          Returns a TextRuler of a textframe.
 boolean isFitShapeToText()
          Determines whether the TextFrame size fitted to the text.
 boolean isRotateTextBy90Degrees()
          Determines whether the text of TextFrame is rotated by 90 degree.
 boolean isWrapText()
          Determines whether the text is wrapped at TextFrame's margins.
 void setAnchorText(int value)
          Sets the anchor text in a TextFrame.
 void setFitShapeToText(boolean value)
          Sets whether the TextFrame size fitted to the text.
 void setFontRotation(int value)
          Sets additional rotation of text in a shape.
 void setMarginBottom(float value)
          Sets the bottom margin (mm) in a TextFrame.
 void setMarginLeft(float value)
          Sets the left margin (mm) in a TextFrame.
 void setMarginRight(float value)
          Sets the right margin (mm) in a TextFrame.
 void setMarginTop(float value)
          Sets the top margin (mm) in a TextFrame.
 void setRotateTextBy90Degrees(boolean value)
          Sets whether the text of TextFrame is rotated by 90 degree.
 void setText(java.lang.String value)
          Sets the plain text for a TextFrame.
 void setWrapText(boolean value)
          Sets whether the text is wrapped at TextFrame's margins.
 void textChanged()
          Recalculates text parameters in a TextFrame.
 
Methods inherited from class com.aspose.slides.Shape
addLink, clearLink, createShapeElements, createShapeElements, getAlternativeText, getAnimationSettings, getConnectionSites, getConnectionSitesRaw, getFillFormat, getHeight, getLineFormat, getLink, getMasterShapeId, getName, getParent, getPlaceholder, getProtection, getRotation, getShadowFormat, getShapeId, getShapeRectangle, getTags, getTextFrame, getThreeDFormat, getWidth, getX, getY, getZOrderPosition, hasExternalData, isFlipH, isFlipV, isHidden, isMasterTextHolder, isTextHolder, serialize, setAlternativeText, setFlipH, setFlipV, setHeight, setHidden, setName, setProtection, setRotation, setWidth, setX, setY, zOrder
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParagraphs

public Paragraphs getParagraphs()
Returns the list of all paragraphs in a frame.

Specified by:
getParagraphs in interface ITextBox
Returns:
The paragraph list.

getLinks

public Links getLinks()
               throws PptReadException
Returns the list of all links in a frame.

Returns:
The links list.
Throws:
PptReadException

getTabs

public Tabs getTabs()
Deprecated. Use TextRuler.Tabs property instead.

Returns the list of all tabulation defined for a frame or null if tabulations were not defined for this frame.

Returns:
The tabulations list.

getEffectiveTabs

public EffectiveTabs getEffectiveTabs(int ParagraphNumber)
                               throws java.lang.IndexOutOfBoundsException
Returns the list of tabulations for a paragraph, including implicitly generated.

Parameters:
ParagraphNumber - Index of a paragraph.
Returns:
the list of tabulations.
Throws:
java.lang.IndexOutOfBoundsException

getText

public java.lang.String getText()
Returns the plain text for a TextFrame.

Returns:
The plain text.

setText

public void setText(java.lang.String value)
Sets the plain text for a TextFrame.

Parameters:
value - The plain text.

getMetaCharacters

public MetaCharacters getMetaCharacters()
Returns the collection of meta characters. Key is a position of meta character in a TextFrame, and value is a type (MetaCharacterType) of meta character. Returns null if a TextFrame doesn't contain meta characters.

Returns:
collection of meta characters.

getSlideNumberPosition

public int getSlideNumberPosition()
Deprecated. Use getMetaCharacters() instead.

Returns the position of a SlideNumber meta character in a TextFrame. -1 if a TextFrame doesn't contain SlideNumber meta character. MS PowerPoint uses '*' as meta character.

Returns:
The position of a slide number meta character.

getDateTimePosition

public int getDateTimePosition()
Deprecated. Use getMetaCharacters() instead.

Returns the position of a DateTime meta character in a TextFrame. -1 if a TextFrame doesn't contain DateTime meta character. MS PowerPoint uses '*' as meta character.

Returns:
The position of a DateTime meta character.

getGenericDatePosition

public int getGenericDatePosition()
Deprecated. Use getMetaCharacters() instead.

Returns the position of a GenericDate meta character in a TextFrame. -1 if a TextFrame doesn't contain GenericDate meta character. MS PowerPoint uses '*' as meta character.

Returns:
The position of a GenericDate meta character.

getHeaderPosition

public int getHeaderPosition()
Deprecated. Use getMetaCharacters() instead.

Returns the position of a Header meta character in a TextFrame. -1 if a TextFrame doesn't contain Header meta character. MS PowerPoint uses '*' as meta character.

Returns:
The position of a Header meta character.

getFooterPosition

public int getFooterPosition()
Deprecated. Use getMetaCharacters() instead.

Returns the position of a Footer meta character in a TextFrame. -1 if a TextFrame doesn't contain Footer meta character. MS PowerPoint uses '*' as meta character.

Returns:
The position of a Footer meta character.

getMarginLeft

public float getMarginLeft()
Returns the left margin (mm) in a TextFrame.

Returns:
The left margin.

setMarginLeft

public void setMarginLeft(float value)
                   throws PptPropertyException
Sets the left margin (mm) in a TextFrame.

Parameters:
value - new left margin.
Throws:
PptPropertyException

getMarginRight

public float getMarginRight()
Returns the right margin (mm) in a TextFrame.

Returns:
The right margin.

setMarginRight

public void setMarginRight(float value)
                    throws PptPropertyException
Sets the right margin (mm) in a TextFrame.

Parameters:
value - new right margin.
Throws:
PptPropertyException

getMarginTop

public float getMarginTop()
Returns the top margin (mm) in a TextFrame.

Returns:
The top margin.

setMarginTop

public void setMarginTop(float value)
                  throws PptPropertyException
Sets the top margin (mm) in a TextFrame.

Parameters:
value - new top margin.
Throws:
PptPropertyException

getMarginBottom

public float getMarginBottom()
Returns the bottom margin (mm) in a TextFrame.

Returns:
The bottom margin.

setMarginBottom

public void setMarginBottom(float value)
                     throws PptPropertyException
Sets the bottom margin (mm) in a TextFrame.

Parameters:
value - new bottom margin.
Throws:
PptPropertyException

getAnchorText

public int getAnchorText()
Returns the anchor text in a TextFrame.

Returns:
The text anchor. See AnchorText.

setAnchorText

public void setAnchorText(int value)
Sets the anchor text in a TextFrame.

Parameters:
value - new text anchor. See AnchorText.

isWrapText

public boolean isWrapText()
Determines whether the text is wrapped at TextFrame's margins.

Returns:
true if text is wrapped.

setWrapText

public void setWrapText(boolean value)
Sets whether the text is wrapped at TextFrame's margins.

Parameters:
value - true to wrap the text.

isFitShapeToText

public boolean isFitShapeToText()
Determines whether the TextFrame size fitted to the text.

Returns:
true if TextFrame size fitted to the text.

setFitShapeToText

public void setFitShapeToText(boolean value)
Sets whether the TextFrame size fitted to the text.

Parameters:
value - true to fit TextFrame's size to the text.

isRotateTextBy90Degrees

public boolean isRotateTextBy90Degrees()
Determines whether the text of TextFrame is rotated by 90 degree.

Returns:
True if text of TextFrame is rotated by 90 degree.

setRotateTextBy90Degrees

public void setRotateTextBy90Degrees(boolean value)
Sets whether the text of TextFrame is rotated by 90 degree.

Parameters:
value - True to rotate text of TextFrame by 90 degree.

getFontRotation

public int getFontRotation()
Returns additional rotation of text in a shape. Can be 0, 90, 180 or 270 degrees.

Returns:
additional rotation of text in a shape. See FontRotationAngle.

setFontRotation

public void setFontRotation(int value)
Sets additional rotation of text in a shape. Can be 0, 90, 180 or 270 degrees.

Parameters:
value - additional rotation of text in a shape. See FontRotationAngle.

addTextFrame

public TextFrame addTextFrame(java.lang.String text)
                       throws PptEditException
Adds a new TextFrame to a shape. If shape already has TextFrame then do nothing.

Overrides:
addTextFrame in class Shape
Parameters:
text - Default text for a new TextFrame.
Throws:
PptEditException

fitTextToShape

public void fitTextToShape()
Decreases Paragraph's SpaceWithin and/or FontHeight to fit text to a TextFrame's rectangle. SpaceWithin decrement affects only line-based intervals and can decrease them down to 80 percent.


getTextRuler

public TextRuler getTextRuler()
Returns a TextRuler of a textframe.

Specified by:
getTextRuler in interface ITextBox
Returns:
a TextRuler of a textframe.

getMasterStyle

public com.aspose.slides.ppt.LevelStyle getMasterStyle(short depth)
Returns LevelStyle from master slide.

Parameters:
depth - Depth level of text.
Returns:
LevelStyle object.

getFrameType

public int getFrameType()

getSlide

public Slide getSlide()
Returns the parent Slide for a TextFrame.

Specified by:
getSlide in interface ITextBox
Returns:
the parent Slide.

textChanged

public void textChanged()
Recalculates text parameters in a TextFrame.