|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.poi.hslf.usermodel.HSLFShape
org.apache.poi.hslf.usermodel.HSLFSimpleShape
org.apache.poi.hslf.usermodel.HSLFTextShape
public abstract class HSLFTextShape
A common superclass of all shapes that can hold text.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextShape |
|---|
TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder |
| Field Summary | |
|---|---|
static int |
WrapByPoints
Specifies a wrapping rule that is equivalent to that of WrapSquare Excel 97, Excel 2000, Excel 2002, and Office Excel 2003 use this value. |
static int |
WrapNone
Specifies that a line of text will extend into or beyond a margin instead of continuing on subsequent lines. |
static int |
WrapSquare
Specifies that a line of text will continue on subsequent lines instead of extending into or beyond a margin. |
static int |
WrapThrough
Specifies a wrapping rule that is undefined and MUST be ignored. |
static int |
WrapTopBottom
Specifies a wrapping rule that is undefined and MUST be ignored. |
| Fields inherited from class org.apache.poi.hslf.usermodel.HSLFSimpleShape |
|---|
_hyperlink, DEFAULT_LINE_WIDTH |
| Constructor Summary | |
|---|---|
|
HSLFTextShape()
Create a new TextBox. |
protected |
HSLFTextShape(EscherContainerRecord escherRecord,
ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a TextBox object and initialize it from the supplied Record container. |
|
HSLFTextShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a new TextBox. |
| Method Summary | |
|---|---|
protected void |
afterInsert(HSLFSheet sh)
When a textbox is added to a sheet we need to tell upper-level PPDrawing about it. |
HSLFTextRun |
appendText(java.lang.String text,
boolean newParagraph)
|
double |
getBottomInset()
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. |
protected EscherTextboxWrapper |
getEscherTextboxWrapper()
|
RoundTripHFPlaceholder12 |
getHFPlaceholderAtom()
Return RoundTripHFPlaceholder12, the atom that describes a header/footer placeholder. |
java.util.List<HSLFHyperlink> |
getHyperlinks()
Returns the array of all hyperlinks in this text run |
Insets2D |
getInsets()
|
double |
getLeftInset()
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. |
TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> |
getMetroShape()
Get alternative representation of text shape stored as metro blob escher property. |
OEPlaceholderAtom |
getPlaceholderAtom()
Return OEPlaceholderAtom, the atom that describes a placeholder. |
java.lang.String |
getRawText()
Returns the raw text content of the shape. |
double |
getRightInset()
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. |
int |
getRunType()
Returns the type of the text, from the TextHeaderAtom. |
java.lang.String |
getText()
|
TextShape.TextDirection |
getTextDirection()
|
double |
getTextHeight()
|
int |
getTextId()
|
java.util.List<HSLFTextParagraph> |
getTextParagraphs()
|
TextShape.TextPlaceholder |
getTextPlaceholder()
|
java.lang.Double |
getTextRotation()
|
double |
getTopInset()
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. |
VerticalAlignment |
getVerticalAlignment()
|
boolean |
getWordWrap()
|
int |
getWordWrapEx()
Returns the value indicating word wrap. |
boolean |
isAlignToBaseline()
|
boolean |
isHorizontalCentered()
|
boolean |
isPlaceholder()
|
java.util.Iterator<HSLFTextParagraph> |
iterator()
|
java.awt.geom.Rectangle2D |
resizeToFitText()
Adjust the size of the shape so it encompasses the text inside it. |
void |
setAlignToBaseline(boolean alignToBaseline)
Sets the vertical alignment relative to the baseline |
void |
setBottomInset(double margin)
Sets the botom margin. |
protected void |
setDefaultTextProperties(HSLFTextParagraph _txtrun)
Set default properties for the TextRun. |
void |
setHorizontalCentered(java.lang.Boolean isCentered)
|
void |
setInsets(Insets2D insets)
|
void |
setLeftInset(double margin)
Sets the left margin. |
void |
setRightInset(double margin)
Sets the right margin. |
void |
setRunType(int type)
Changes the type of the text. |
void |
setSheet(HSLFSheet sheet)
Assign the SlideShow this shape belongs to |
HSLFTextRun |
setText(java.lang.String text)
|
void |
setTextDirection(TextShape.TextDirection orientation)
|
void |
setTextId(int id)
Sets text ID |
void |
setTextPlaceholder(TextShape.TextPlaceholder placeholder)
|
void |
setTextRotation(java.lang.Double rotation)
|
void |
setTopInset(double margin)
Sets the top margin. |
void |
setVerticalAlignment(VerticalAlignment vAlign)
|
void |
setWordWrap(boolean wrap)
|
void |
setWordWrapEx(int wrap)
Specifies how the text should be wrapped |
protected void |
storeText()
Saves the modified paragraphs/textrun to the records. |
| Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape |
|---|
draw, getAnchor, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.poi.sl.usermodel.SimpleShape |
|---|
createHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getShadow, getShapeType, getStrokeStyle, setFillColor, setPlaceholder, setShapeType, setStrokeStyle |
| Methods inherited from interface org.apache.poi.sl.usermodel.Shape |
|---|
draw, getAnchor, getParent, getSheet |
| Methods inherited from interface org.apache.poi.sl.draw.geom.IAdjustableShape |
|---|
getAdjustValue |
| Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape |
|---|
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
protected HSLFTextShape(EscherContainerRecord escherRecord,
ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
escherRecord - EscherSpContainer container which holds information about this shapeparent - the parent of the shapepublic HSLFTextShape(ShapeContainer<HSLFShape,HSLFTextParagraph> 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 HSLFTextShape()
| Method Detail |
|---|
protected void setDefaultTextProperties(HSLFTextParagraph _txtrun)
protected void afterInsert(HSLFSheet sh)
PPDrawing about it.
afterInsert in class HSLFShapesh - the sheet we are adding toprotected EscherTextboxWrapper getEscherTextboxWrapper()
public java.awt.geom.Rectangle2D resizeToFitText()
Rectangle2D that is the bounds of this shape.public int getRunType()
TextHeaderAtompublic void setRunType(int type)
TextHeaderAtompublic boolean isAlignToBaseline()
public void setAlignToBaseline(boolean alignToBaseline)
alignToBaseline - if true, vertical alignment is relative to baselinepublic boolean isHorizontalCentered()
isHorizontalCentered in interface TextShape<HSLFShape,HSLFTextParagraph>public void setHorizontalCentered(java.lang.Boolean isCentered)
setHorizontalCentered in interface TextShape<HSLFShape,HSLFTextParagraph>public VerticalAlignment getVerticalAlignment()
getVerticalAlignment in interface TextShape<HSLFShape,HSLFTextParagraph>public void setVerticalAlignment(VerticalAlignment vAlign)
setVerticalAlignment in interface TextShape<HSLFShape,HSLFTextParagraph>public double getBottomInset()
public void setBottomInset(double margin)
margin - the bottom margingetBottomInset()public double getLeftInset()
public void setLeftInset(double margin)
margin - the left margingetLeftInset()public double getRightInset()
public void setRightInset(double margin)
margin - the right margingetRightInset()public double getTopInset()
public void setTopInset(double margin)
margin - the top margingetTopInset()public int getWordWrapEx()
Wrap* constants defined in this class.public void setWordWrapEx(int wrap)
wrap - the value indicating how the text should be wrapped.
Must be one of the Wrap* constants defined in this class.public boolean getWordWrap()
getWordWrap in interface TextShape<HSLFShape,HSLFTextParagraph>public void setWordWrap(boolean wrap)
setWordWrap in interface TextShape<HSLFShape,HSLFTextParagraph>public int getTextId()
public void setTextId(int id)
id - of the textpublic java.util.List<HSLFTextParagraph> getTextParagraphs()
getTextParagraphs in interface TextShape<HSLFShape,HSLFTextParagraph>public void setSheet(HSLFSheet sheet)
HSLFShapeSlideShow this shape belongs to
setSheet in class HSLFShapesheet - owner of this shapepublic OEPlaceholderAtom getPlaceholderAtom()
OEPlaceholderAtom, the atom that describes a placeholder.
OEPlaceholderAtom or null if not foundpublic RoundTripHFPlaceholder12 getHFPlaceholderAtom()
RoundTripHFPlaceholder12, the atom that describes a header/footer placeholder.
Compare the RoundTripHFPlaceholder12.getPlaceholderId() with
Placeholder.HEADER or Placeholder.FOOTER, to find out
what kind of placeholder this is.
RoundTripHFPlaceholder12 or null if not foundpublic boolean isPlaceholder()
isPlaceholder in class HSLFShapepublic java.util.Iterator<HSLFTextParagraph> iterator()
iterator in interface java.lang.Iterable<HSLFTextParagraph>public Insets2D getInsets()
getInsets in interface TextShape<HSLFShape,HSLFTextParagraph>public void setInsets(Insets2D insets)
setInsets in interface TextShape<HSLFShape,HSLFTextParagraph>public double getTextHeight()
getTextHeight in interface TextShape<HSLFShape,HSLFTextParagraph>public TextShape.TextDirection getTextDirection()
getTextDirection in interface TextShape<HSLFShape,HSLFTextParagraph>public void setTextDirection(TextShape.TextDirection orientation)
setTextDirection in interface TextShape<HSLFShape,HSLFTextParagraph>public java.lang.Double getTextRotation()
getTextRotation in interface TextShape<HSLFShape,HSLFTextParagraph>public void setTextRotation(java.lang.Double rotation)
setTextRotation in interface TextShape<HSLFShape,HSLFTextParagraph>public java.lang.String getRawText()
public java.lang.String getText()
getText in interface TextShape<HSLFShape,HSLFTextParagraph>
public HSLFTextRun appendText(java.lang.String text,
boolean newParagraph)
appendText in interface TextShape<HSLFShape,HSLFTextParagraph>public HSLFTextRun setText(java.lang.String text)
setText in interface TextShape<HSLFShape,HSLFTextParagraph>protected void storeText()
public java.util.List<HSLFHyperlink> getHyperlinks()
null
if not found.public void setTextPlaceholder(TextShape.TextPlaceholder placeholder)
setTextPlaceholder in interface TextShape<HSLFShape,HSLFTextParagraph>public TextShape.TextPlaceholder getTextPlaceholder()
getTextPlaceholder in interface TextShape<HSLFShape,HSLFTextParagraph>public TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getMetroShape()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||