org.apache.poi.xslf.usermodel
Class XSLFTextShape

java.lang.Object
  extended by org.apache.poi.xslf.usermodel.XSLFShape
      extended by org.apache.poi.xslf.usermodel.XSLFSimpleShape
          extended by org.apache.poi.xslf.usermodel.XSLFTextShape
Direct Known Subclasses:
XSLFAutoShape, XSLFTableCell

@Beta
public abstract class XSLFTextShape
extends XSLFSimpleShape

Represents a shape that can hold text.

Author:
Yegor Kozlov

Method Summary
 XSLFTextParagraph addNewTextParagraph()
           
 java.awt.Color getFillColor()
           
 double getMarginBottom()
          Returns the distance (in points) between the bottom of the text frame and the bottom of the inscribed rectangle of the shape that contains the text.
 double getMarginLeft()
          Returns the distance (in points) between the left edge of the text frame and the left edge of the inscribed rectangle of the shape that contains the text.
 double getMarginRight()
          Returns the distance (in points) between the right edge of the text frame and the right edge of the inscribed rectangle of the shape that contains the text.
 double getMarginTop()
          Returns the distance (in points) between the top of the text frame and the top of the inscribed rectangle of the shape that contains the text.
 java.lang.String getText()
           
 TextAutofit getTextAutofit()
           
protected abstract  org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody getTextBody(boolean create)
           
protected  org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties getTextBodyPr()
           
 TextDirection getTextDirection()
           
 java.util.List<XSLFTextParagraph> getTextParagraphs()
           
 VerticalAlignment getVerticalAlignment()
          Returns the type of vertical alignment for the text.
 boolean getWordWrap()
          Returns the value indicating word wrap.
 void setFillColor(java.awt.Color color)
          Specifies a solid color fill.
 void setMarginBottom(double margin)
          Sets the botom margin.
 void setMarginLeft(double margin)
          Sets the left margin.
 void setMarginRight(double margin)
          Sets the right margin.
 void setMarginTop(double margin)
          Sets the top margin.
 void setTextAutofit(TextAutofit value)
          Specifies that a shape should be auto-fit to fully contain the text described within it.
 void setTextDirection(TextDirection orientation)
           
 void setVerticalAlignment(VerticalAlignment anchor)
          Sets the type of vertical alignment for the text.
 void setWordWrap(boolean wrap)
          Specifies how the text should be wrapped
 
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFSimpleShape
getAnchor, getFlipHorizontal, getFlipVertical, getLineCap, getLineColor, getLineDash, getLineWidth, getNvPr, getRotation, getShapeId, getShapeName, getShapeType, getSheet, getSpPr, getXmlObject, setAnchor, setFlipHorizontal, setFlipVertical, setLineCap, setLineColor, setLineDash, setLineWidth, setRotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getText

public java.lang.String getText()

getTextParagraphs

public java.util.List<XSLFTextParagraph> getTextParagraphs()

addNewTextParagraph

public XSLFTextParagraph addNewTextParagraph()

setFillColor

public void setFillColor(java.awt.Color color)
Specifies a solid color fill. The shape is filled entirely with the specified color.

Parameters:
color - the solid color fill. The value of null unsets the solidFIll attribute from the underlying xml

getFillColor

public java.awt.Color getFillColor()
Returns:
solid fill color of null if not set

setVerticalAlignment

public void setVerticalAlignment(VerticalAlignment anchor)
Sets the type of vertical alignment for the text. One of the Anchor* constants defined in this class.

Parameters:
anchor - - the type of alignment. Default is VerticalAlignment.TOP

getVerticalAlignment

public VerticalAlignment getVerticalAlignment()
Returns the type of vertical alignment for the text.

Returns:
the type of alignment

setTextDirection

public void setTextDirection(TextDirection orientation)
Parameters:
orientation - vertical orientation of the text

getTextDirection

public TextDirection getTextDirection()
Returns:
vertical orientation of the text

getMarginBottom

public double getMarginBottom()
Returns the distance (in points) between the bottom of the text frame and the bottom of the inscribed rectangle of the shape that contains the text.

Returns:
the bottom margin or -1 if not set

getMarginLeft

public double getMarginLeft()
Returns the distance (in points) between the left edge of the text frame and the left edge of the inscribed rectangle of the shape that contains the text.

Returns:
the left margin

getMarginRight

public double getMarginRight()
Returns the distance (in points) between the right edge of the text frame and the right edge of the inscribed rectangle of the shape that contains the text.

Returns:
the right margin

getMarginTop

public double getMarginTop()
Returns the distance (in points) between the top of the text frame and the top of the inscribed rectangle of the shape that contains the text.

Returns:
the top margin

setMarginBottom

public void setMarginBottom(double margin)
Sets the botom margin.

Parameters:
margin - the bottom margin
See Also:
getMarginBottom()

setMarginLeft

public void setMarginLeft(double margin)
Sets the left margin.

Parameters:
margin - the left margin
See Also:
getMarginLeft()

setMarginRight

public void setMarginRight(double margin)
Sets the right margin.

Parameters:
margin - the right margin
See Also:
getMarginRight()

setMarginTop

public void setMarginTop(double margin)
Sets the top margin.

Parameters:
margin - the top margin
See Also:
getMarginTop()

getWordWrap

public boolean getWordWrap()
Returns the value indicating word wrap. One of the Wrap* constants defined in this class.

Returns:
the value indicating word wrap

setWordWrap

public void setWordWrap(boolean wrap)
Specifies how the text should be wrapped

Parameters:
wrap - the value indicating how the text should be wrapped

setTextAutofit

public void setTextAutofit(TextAutofit value)
Specifies that a shape should be auto-fit to fully contain the text described within it. Auto-fitting is when text within a shape is scaled in order to contain all the text inside

Parameters:
value - type of autofit

getTextAutofit

public TextAutofit getTextAutofit()
Returns:
type of autofit

getTextBodyPr

protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties getTextBodyPr()

getTextBody

protected abstract org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody getTextBody(boolean create)


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