|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hslf.model.Shape org.apache.poi.hslf.model.SimpleShape org.apache.poi.hslf.model.TextShape
public abstract class TextShape
A common superclass of all shapes that can hold text.
Field Summary | |
---|---|
protected static java.awt.font.FontRenderContext |
_frc
Used to calculate text bounds |
protected EscherTextboxWrapper |
_txtbox
Escher container which holds text attributes such as TextHeaderAtom, TextBytesAtom ot TextCharsAtom, StyleTextPropAtom etc. |
protected TextRun |
_txtrun
TextRun 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.SimpleShape |
---|
_clientData, _clientRecords, DEFAULT_LINE_WIDTH |
Fields inherited from class org.apache.poi.hslf.model.Shape |
---|
_escherContainer, _fill, _parent, _sheet, EMU_PER_CENTIMETER, EMU_PER_INCH, EMU_PER_POINT, logger, MASTER_DPI, PIXEL_DPI, POINT_DPI |
Constructor Summary | |
---|---|
|
TextShape()
Create a new TextBox. |
protected |
TextShape(EscherContainerRecord escherRecord,
Shape parent)
Create a TextBox object and initialize it from the supplied Record container. |
|
TextShape(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. |
TextRun |
createTextRun()
|
void |
draw(java.awt.Graphics2D graphics)
|
protected EscherTextboxWrapper |
getEscherTextboxWrapper()
|
int |
getHorizontalAlignment()
Gets the type of horizontal alignment for the text. |
float |
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. |
float |
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. |
float |
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. |
float |
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. |
OEPlaceholderAtom |
getPlaceholderAtom()
Return OEPlaceholderAtom , the atom that describes a placeholder. |
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. |
protected void |
initTextRun()
|
java.awt.geom.Rectangle2D |
resizeToFitText()
Adjust the size of the TextShape so it encompasses the text inside it. |
protected void |
setDefaultTextProperties(TextRun _txtrun)
Set default properties for the TextRun. |
void |
setHorizontalAlignment(int align)
Sets the type of horizontal alignment for the text. |
void |
setHyperlink(int linkId,
int beginIndex,
int endIndex)
Assigns a hyperlink to this text shape |
void |
setMarginBottom(float margin)
Sets the botom margin. |
void |
setMarginLeft(float margin)
Sets the left margin. |
void |
setMarginRight(float margin)
Sets the right margin. |
void |
setMarginTop(float 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 |
---|
createSpContainer, getClientDataRecord, getClientRecords, getFillColor, getFlipHorizontal, getFlipVertical, getLineColor, getLineDashing, getLineStyle, getLineWidth, getLogicalAnchor2D, getRotation, setFillColor, setHyperlink, setLineColor, setLineDashing, setLineStyle, setLineWidth, setRotation, updateClientData |
Methods inherited from class org.apache.poi.hslf.model.Shape |
---|
getAnchor, getAnchor2D, getEscherChild, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getHyperlink, getOutline, getParent, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setEscherProperty, setShapeId, 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
protected static final java.awt.font.FontRenderContext _frc
Constructor Detail |
---|
protected TextShape(EscherContainerRecord escherRecord, Shape parent)
escherRecord
- EscherSpContainer
container which holds information about this shapeparent
- the parent of the shapepublic TextShape(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 TextShape()
Method Detail |
---|
public TextRun createTextRun()
protected void setDefaultTextProperties(TextRun _txtrun)
public 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 toprotected EscherTextboxWrapper getEscherTextboxWrapper()
public java.awt.geom.Rectangle2D resizeToFitText()
Rectangle2D
that is the bounds of this TextShape
.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)
Align*
constants defined in this class.
align
- - the type of horizontal alignmentpublic int getHorizontalAlignment()
Align*
constants defined in this class.
public float getMarginBottom()
public void setMarginBottom(float margin)
margin
- the bottom margingetMarginBottom()
public float getMarginLeft()
public void setMarginLeft(float margin)
margin
- the left margingetMarginLeft()
public float getMarginRight()
public void setMarginRight(float margin)
margin
- the right margingetMarginRight()
public float getMarginTop()
public void setMarginTop(float 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 wrapped.
Must be one of the Wrap*
constants defined in this class.public int getTextId()
public void setTextId(int id)
id
- of the textpublic TextRun getTextRun()
public void setSheet(Sheet sheet)
Shape
SlideShow
this shape belongs to
setSheet
in class Shape
sheet
- owner of this shapeprotected void initTextRun()
public void draw(java.awt.Graphics2D graphics)
draw
in class SimpleShape
public OEPlaceholderAtom getPlaceholderAtom()
OEPlaceholderAtom
, the atom that describes a placeholder.
OEPlaceholderAtom
or null
if not foundpublic void setHyperlink(int linkId, int beginIndex, int endIndex)
linkId
- id of the hyperlink, @see org.apache.poi.hslf.usermodel.SlideShow#addHyperlink(Hyperlink)beginIndex
- the beginning index, inclusive.endIndex
- the ending index, exclusive.SlideShow.addHyperlink(Hyperlink)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |