|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.hslf.model.Shape
org.apache.poi.hslf.model.SimpleShape
org.apache.poi.hslf.model.TextBox
public class TextBox
Represents a TextFrame shape in PowerPoint.
Contains the text in a text frame as well as the properties and methods that control alignment and anchoring of the text.
Field Summary | |
---|---|
protected EscherTextboxWrapper |
_txtbox
Escher container which holds text attributes such as TextHeaderAtom, TextBytesAtom ot TextCharsAtom, StyleTextPropAtom etc. |
protected TextRun |
_txtrun
Low-level object which holds actual text and format data |
static int |
AlignCenter
|
static int |
AlignJustify
|
static int |
AlignLeft
How to align the text |
static int |
AlignRight
|
static int |
AnchorBottom
|
static int |
AnchorBottomBaseline
|
static int |
AnchorBottomCentered
|
static int |
AnchorBottomCenteredBaseline
|
static int |
AnchorMiddle
|
static int |
AnchorMiddleCentered
|
static int |
AnchorTop
How to anchor the text |
static int |
AnchorTopBaseline
|
static int |
AnchorTopCentered
|
static int |
AnchorTopCenteredBaseline
|
static int |
WrapByPoints
|
static int |
WrapNone
|
static int |
WrapSquare
How to wrap the text |
static int |
WrapThrough
|
static int |
WrapTopBottom
|
Fields inherited from class org.apache.poi.hslf.model.Shape |
---|
_escherContainer, _parent, _sheet, EMU_PER_CENTIMETER, EMU_PER_INCH, EMU_PER_POINT, logger, MASTER_DPI, PIXEL_DPI, POINT_DPI |
Constructor Summary | |
---|---|
|
TextBox()
Create a new TextBox. |
protected |
TextBox(EscherContainerRecord escherRecord,
Shape parent)
Create a TextBox object and initialize it from the supplied Record container. |
|
TextBox(Shape parent)
Create a new TextBox. |
Method Summary | |
---|---|
protected void |
afterInsert(Sheet sh)
When a textbox is added to a sheet we need to tell upper-level PPDrawing about it. |
protected EscherContainerRecord |
createSpContainer(boolean isChild)
Create a new textBox and initialize internal structures |
int |
getHorizontalAlignment()
|
int |
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. |
int |
getMarginLeft()
Returns the distance (in EMUs) between the left edge of the text frame and the left edge of the inscribed rectangle of the shape that contains the text. |
int |
getMarginRight()
Returns the distance (in EMUs) between the right edge of the text frame and the right edge of the inscribed rectangle of the shape that contains the text. |
int |
getMarginTop()
Returns the distance (in EMUs) 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()
Returns the text contained in this text frame. |
int |
getTextId()
|
TextRun |
getTextRun()
|
int |
getVerticalAlignment()
Returns the type of vertical alignment for the text. |
int |
getWordWrap()
Returns the value indicating word wrap. |
void |
resizeToFitText()
Adjust the size of the TextBox so it encompasses the text inside it. |
void |
setBackgroundColor(java.awt.Color color)
The color used to fill this shape. |
void |
setHorizontalAlignment(int align)
|
void |
setMarginBottom(int margin)
Sets the botom margin. |
void |
setMarginLeft(int margin)
Sets the left margin. |
void |
setMarginRight(int margin)
Sets the right margin. |
void |
setMarginTop(int margin)
Sets the top margin. |
void |
setSheet(Sheet sheet)
Assign the SlideShow this shape belongs to |
void |
setText(java.lang.String text)
Sets the text contained in this text frame. |
void |
setTextId(int id)
Sets text ID |
void |
setVerticalAlignment(int align)
Sets the type of vertical alignment for the text. |
void |
setWordWrap(int wrap)
Specifies how the text should be wrapped |
Methods inherited from class org.apache.poi.hslf.model.SimpleShape |
---|
getFillColor, getLineColor, getLineDashing, getLineStyle, getLineWidth, setFillColor, setLineColor, setLineDashing, setLineStyle, setLineWidth |
Methods inherited from class org.apache.poi.hslf.model.Shape |
---|
getAnchor, getColor, getEscherChild, getEscherProperty, getFill, getHyperlink, getParent, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setShapeType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AnchorTop
public static final int AnchorMiddle
public static final int AnchorBottom
public static final int AnchorTopCentered
public static final int AnchorMiddleCentered
public static final int AnchorBottomCentered
public static final int AnchorTopBaseline
public static final int AnchorBottomBaseline
public static final int AnchorTopCenteredBaseline
public static final int AnchorBottomCenteredBaseline
public static final int WrapSquare
public static final int WrapByPoints
public static final int WrapNone
public static final int WrapTopBottom
public static final int WrapThrough
public static final int AlignLeft
public static final int AlignCenter
public static final int AlignRight
public static final int AlignJustify
protected TextRun _txtrun
protected EscherTextboxWrapper _txtbox
Constructor Detail |
---|
protected TextBox(EscherContainerRecord escherRecord, Shape parent)
escherRecord
- EscherSpContainer
container which holds information about this shapeparent
- the parent of the shapepublic TextBox(Shape parent)
parent
- the parent of this Shape. For example, if this text box is a cell
in a table then the parent is Table.public TextBox()
Method Detail |
---|
protected EscherContainerRecord createSpContainer(boolean isChild)
createSpContainer
in class SimpleShape
isChild
- true
if the Line is inside a group, false
otherwise
EscherContainerRecord
which holds shape datapublic java.lang.String getText()
public void setText(java.lang.String text)
text
- the text string used by this object.protected void afterInsert(Sheet sh)
PPDrawing
about it.
afterInsert
in class Shape
sh
- the sheet we are adding topublic void resizeToFitText()
public int getVerticalAlignment()
Anchor*
constants defined in this class.
public void setVerticalAlignment(int align)
Anchor*
constants defined in this class.
align
- - the type of alignmentpublic void setHorizontalAlignment(int align)
public int getHorizontalAlignment()
public int getMarginBottom()
public void setMarginBottom(int margin)
margin
- the bottom margingetMarginBottom()
public int getMarginLeft()
public void setMarginLeft(int margin)
margin
- the left margingetMarginLeft()
public int getMarginRight()
public void setMarginRight(int margin)
margin
- the right margingetMarginRight()
public int getMarginTop()
public void setMarginTop(int margin)
margin
- the top margingetMarginTop()
public int getWordWrap()
Wrap*
constants defined in this class.
public void setWordWrap(int wrap)
wrap
- the value indicating how the text should be wrappedpublic int getTextId()
public void setTextId(int id)
id
- of the textpublic void setBackgroundColor(java.awt.Color color)
color
- the background colorpublic TextRun getTextRun()
public void setSheet(Sheet sheet)
Shape
SlideShow
this shape belongs to
setSheet
in class Shape
sheet
- owner of this shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |