|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.xslf.usermodel.XSLFShape
org.apache.poi.xslf.usermodel.XSLFSimpleShape
org.apache.poi.xslf.usermodel.XSLFTextShape
@Beta public abstract class XSLFTextShape
Represents a shape 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 |
---|
Fields inherited from class org.apache.poi.xslf.usermodel.XSLFShape |
---|
PML_NS |
Method Summary | |
---|---|
XSLFTextParagraph |
addNewTextParagraph()
add a new paragraph run to this shape |
XSLFTextRun |
appendText(java.lang.String text,
boolean newParagraph)
Adds the supplied text onto the end of the TextParagraphs, creating a new RichTextRun for it to sit in. |
void |
clearText()
unset text from this shape |
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. |
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. |
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. |
java.lang.String |
getText()
Returns the text contained in this text frame, which has been made safe for printing and other use. |
TextShape.TextAutofit |
getTextAutofit()
|
protected abstract org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody |
getTextBody(boolean create)
|
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties |
getTextBodyPr()
|
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties |
getTextBodyPr(boolean create)
|
TextShape.TextDirection |
getTextDirection()
|
double |
getTextHeight()
Compute the cumulative height occupied by the text |
double |
getTextHeight(java.awt.Graphics2D graphics)
Compute the cumulative height occupied by the text |
java.util.List<XSLFTextParagraph> |
getTextParagraphs()
|
TextShape.TextPlaceholder |
getTextPlaceholder()
|
java.lang.Double |
getTextRotation()
The text rotation can be independent specified from the shape rotation. |
Placeholder |
getTextType()
|
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()
Returns the type of vertical alignment for the text. |
boolean |
getWordWrap()
|
boolean |
isHorizontalCentered()
Returns if the text is centered. |
java.util.Iterator<XSLFTextParagraph> |
iterator()
|
protected XSLFTextParagraph |
newTextParagraph(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph p)
Helper method to allow subclasses to provide their own text paragraph |
java.awt.geom.Rectangle2D |
resizeToFitText()
Adjust the size of the shape so it encompasses the text inside it. |
java.awt.geom.Rectangle2D |
resizeToFitText(java.awt.Graphics2D graphics)
Adjust the size of the shape so it encompasses the text inside it. |
void |
setBottomInset(double margin)
Sets the bottom margin. |
void |
setHorizontalCentered(java.lang.Boolean isCentered)
Sets if the paragraphs are horizontal centered |
void |
setInsets(Insets2D insets)
Sets the shape margins |
void |
setLeftInset(double margin)
Sets the left margin. |
void |
setPlaceholder(Placeholder placeholder)
Specifies that the corresponding shape should be represented by the generating application as a placeholder. |
void |
setRightInset(double margin)
Sets the right margin. |
XSLFTextRun |
setText(java.lang.String text)
Sets (overwrites) the current text. |
void |
setTextAutofit(TextShape.TextAutofit value)
Specifies that a shape should be auto-fit to fully contain the text described within it. |
void |
setTextDirection(TextShape.TextDirection orientation)
sets the vertical orientation |
void |
setTextPlaceholder(TextShape.TextPlaceholder placeholder)
Sets the text placeholder |
void |
setTextRotation(java.lang.Double rotation)
Sets the text rotation. |
void |
setTopInset(double margin)
Sets the top margin. |
void |
setVerticalAlignment(VerticalAlignment anchor)
Sets the type of vertical alignment for the text. |
void |
setWordWrap(boolean wrap)
|
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape |
---|
draw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getCTPlaceholder, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParent |
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, 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 |
Method Detail |
---|
public java.util.Iterator<XSLFTextParagraph> iterator()
iterator
in interface java.lang.Iterable<XSLFTextParagraph>
public java.lang.String getText()
TextShape
getText
in interface TextShape<XSLFShape,XSLFTextParagraph>
public void clearText()
public XSLFTextRun setText(java.lang.String text)
TextShape
setText
in interface TextShape<XSLFShape,XSLFTextParagraph>
text
- the text string used by this object.
public XSLFTextRun appendText(java.lang.String text, boolean newParagraph)
TextShape
appendText
in interface TextShape<XSLFShape,XSLFTextParagraph>
text
- the text string to be appended.newParagraph
- if true, a new paragraph will be added,
which will contain the added textpublic java.util.List<XSLFTextParagraph> getTextParagraphs()
getTextParagraphs
in interface TextShape<XSLFShape,XSLFTextParagraph>
public XSLFTextParagraph addNewTextParagraph()
public void setVerticalAlignment(VerticalAlignment anchor)
TextShape
setVerticalAlignment
in interface TextShape<XSLFShape,XSLFTextParagraph>
anchor
- - the type of alignment.
A null
values unsets this property.public VerticalAlignment getVerticalAlignment()
TextShape
getVerticalAlignment
in interface TextShape<XSLFShape,XSLFTextParagraph>
public void setHorizontalCentered(java.lang.Boolean isCentered)
TextShape
setHorizontalCentered
in interface TextShape<XSLFShape,XSLFTextParagraph>
isCentered
- true, if the paragraphs are horizontal centered
A null
values unsets this property.public boolean isHorizontalCentered()
TextShape
isHorizontalCentered
in interface TextShape<XSLFShape,XSLFTextParagraph>
public void setTextDirection(TextShape.TextDirection orientation)
TextShape
setTextDirection
in interface TextShape<XSLFShape,XSLFTextParagraph>
orientation
- vertical orientation of the textpublic TextShape.TextDirection getTextDirection()
getTextDirection
in interface TextShape<XSLFShape,XSLFTextParagraph>
public java.lang.Double getTextRotation()
TextShape
getTextRotation
in interface TextShape<XSLFShape,XSLFTextParagraph>
public void setTextRotation(java.lang.Double rotation)
TextShape
setTextRotation
in interface TextShape<XSLFShape,XSLFTextParagraph>
rotation
- the text rotation, or null to unset the rotationpublic double getBottomInset()
public double getLeftInset()
public double getRightInset()
public double getTopInset()
public void setBottomInset(double margin)
margin
- the bottom margingetBottomInset()
public void setLeftInset(double margin)
margin
- the left margingetLeftInset()
public void setRightInset(double margin)
margin
- the right margingetRightInset()
public void setTopInset(double margin)
margin
- the top margingetTopInset()
public Insets2D getInsets()
getInsets
in interface TextShape<XSLFShape,XSLFTextParagraph>
public void setInsets(Insets2D insets)
TextShape
setInsets
in interface TextShape<XSLFShape,XSLFTextParagraph>
insets
- the new shape marginspublic boolean getWordWrap()
getWordWrap
in interface TextShape<XSLFShape,XSLFTextParagraph>
public void setWordWrap(boolean wrap)
setWordWrap
in interface TextShape<XSLFShape,XSLFTextParagraph>
wrap
- whether to wrap words within the bounding rectanglepublic void setTextAutofit(TextShape.TextAutofit value)
value
- type of autofitpublic TextShape.TextAutofit getTextAutofit()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties getTextBodyPr()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextBodyProperties getTextBodyPr(boolean create)
protected abstract org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody getTextBody(boolean create)
public void setPlaceholder(Placeholder placeholder)
XSLFShape
setPlaceholder
in interface SimpleShape<XSLFShape,XSLFTextParagraph>
setPlaceholder
in class XSLFSimpleShape
placeholder
- The shape to use as placeholder or null if no placeholder should be set.public Placeholder getTextType()
public double getTextHeight()
TextShape
getTextHeight
in interface TextShape<XSLFShape,XSLFTextParagraph>
public double getTextHeight(java.awt.Graphics2D graphics)
TextShape
getTextHeight
in interface TextShape<XSLFShape,XSLFTextParagraph>
graphics
- a customized graphics context, e.g. which contains font mappings
public java.awt.geom.Rectangle2D resizeToFitText()
TextShape
resizeToFitText
in interface TextShape<XSLFShape,XSLFTextParagraph>
Rectangle2D
that is the bounds of this shape.public java.awt.geom.Rectangle2D resizeToFitText(java.awt.Graphics2D graphics)
TextShape
resizeToFitText
in interface TextShape<XSLFShape,XSLFTextParagraph>
graphics
- a customized graphics context, e.g. which contains font mappings
Rectangle2D
that is the bounds of this shape.public void setTextPlaceholder(TextShape.TextPlaceholder placeholder)
TextShape
setTextPlaceholder
in interface TextShape<XSLFShape,XSLFTextParagraph>
public TextShape.TextPlaceholder getTextPlaceholder()
getTextPlaceholder
in interface TextShape<XSLFShape,XSLFTextParagraph>
protected XSLFTextParagraph newTextParagraph(org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph p)
p
- the xml reference
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |