@Beta public abstract class XSLFTextShape extends XSLFSimpleShape implements org.apache.poi.xddf.usermodel.text.TextContainer, TextShape<XSLFShape,XSLFTextParagraph>
TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder| Modifier and Type | Method and Description |
|---|---|
XSLFTextParagraph |
addNewTextParagraph()
add a new paragraph run to this shape
|
XSLFTextRun |
appendText(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
|
<R> Optional<R> |
findDefinedParagraphProperty(Function<CTTextParagraphProperties,Boolean> isSet,
Function<CTTextParagraphProperties,R> getter) |
<R> Optional<R> |
findDefinedRunProperty(Function<CTTextCharacterProperties,Boolean> isSet,
Function<CTTextCharacterProperties,R> getter) |
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.
|
String |
getText()
Returns the text contained in this text frame, which has been made safe
for printing and other use.
|
TextShape.TextAutofit |
getTextAutofit() |
org.apache.poi.xddf.usermodel.text.XDDFTextBody |
getTextBody() |
TextShape.TextDirection |
getTextDirection() |
double |
getTextHeight()
Compute the cumulative height occupied by the text
|
double |
getTextHeight(Graphics2D graphics)
Compute the cumulative height occupied by the text
|
List<XSLFTextParagraph> |
getTextParagraphs() |
TextShape.TextPlaceholder |
getTextPlaceholder() |
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.
|
Iterator<XSLFTextParagraph> |
iterator() |
Rectangle2D |
resizeToFitText()
Adjust the size of the shape so it encompasses the text inside it.
|
Rectangle2D |
resizeToFitText(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(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(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(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) |
createHyperlink, getAdjustValue, getAnchor, getFillColor, getFillStyle, getFlipHorizontal, getFlipVertical, getGeometry, getHyperlink, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getRotation, getShadow, getShapeType, getStrokeStyle, setAnchor, setFillColor, setFlipHorizontal, setFlipVertical, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setRotation, setShapeType, setStrokeStyledraw, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getSheet, getXmlObject, isPlaceholder, setParentequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getPlaceholderDetails, getShadow, getShapeType, getStrokeStyle, isPlaceholder, setFillColor, setShapeType, setStrokeStyledraw, getAnchor, getParent, getShapeId, getShapeName, getSheetgetAdjustValuegetAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotationforEach, spliterator@Beta public org.apache.poi.xddf.usermodel.text.XDDFTextBody getTextBody()
public Iterator<XSLFTextParagraph> iterator()
iterator in interface Iterable<XSLFTextParagraph>public String getText()
TextShapegetText in interface TextShape<XSLFShape,XSLFTextParagraph>public void clearText()
public XSLFTextRun setText(String text)
TextShapesetText in interface TextShape<XSLFShape,XSLFTextParagraph>text - the text string used by this object.public XSLFTextRun appendText(String text, boolean newParagraph)
TextShapeappendText 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 List<XSLFTextParagraph> getTextParagraphs()
getTextParagraphs in interface TextShape<XSLFShape,XSLFTextParagraph>public XSLFTextParagraph addNewTextParagraph()
public void setVerticalAlignment(VerticalAlignment anchor)
TextShapesetVerticalAlignment in interface TextShape<XSLFShape,XSLFTextParagraph>anchor - - the type of alignment.
A null values unsets this property.public VerticalAlignment getVerticalAlignment()
TextShapegetVerticalAlignment in interface TextShape<XSLFShape,XSLFTextParagraph>public void setHorizontalCentered(Boolean isCentered)
TextShapesetHorizontalCentered in interface TextShape<XSLFShape,XSLFTextParagraph>isCentered - true, if the paragraphs are horizontal centered
A null values unsets this property.public boolean isHorizontalCentered()
TextShapeisHorizontalCentered in interface TextShape<XSLFShape,XSLFTextParagraph>public void setTextDirection(TextShape.TextDirection orientation)
TextShapesetTextDirection in interface TextShape<XSLFShape,XSLFTextParagraph>orientation - vertical orientation of the textpublic TextShape.TextDirection getTextDirection()
getTextDirection in interface TextShape<XSLFShape,XSLFTextParagraph>public Double getTextRotation()
TextShapegetTextRotation in interface TextShape<XSLFShape,XSLFTextParagraph>public void setTextRotation(Double rotation)
TextShapesetTextRotation 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)
TextShapesetInsets 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()
public void setPlaceholder(Placeholder placeholder)
SimpleShapesetPlaceholder in interface SimpleShape<XSLFShape,XSLFTextParagraph>setPlaceholder in class XSLFShapeplaceholder - the placeholder or null to remove the reference to the placeholderPlaceholderDetails.setPlaceholder(Placeholder)public Placeholder getTextType()
public double getTextHeight()
TextShapegetTextHeight in interface TextShape<XSLFShape,XSLFTextParagraph>public double getTextHeight(Graphics2D graphics)
TextShapegetTextHeight in interface TextShape<XSLFShape,XSLFTextParagraph>graphics - a customized graphics context, e.g. which contains font mappingspublic Rectangle2D resizeToFitText()
TextShaperesizeToFitText in interface TextShape<XSLFShape,XSLFTextParagraph>Rectangle2D that is the bounds of this shape.public Rectangle2D resizeToFitText(Graphics2D graphics)
TextShaperesizeToFitText in interface TextShape<XSLFShape,XSLFTextParagraph>graphics - a customized graphics context, e.g. which contains font mappingsRectangle2D that is the bounds of this shape.public void setTextPlaceholder(TextShape.TextPlaceholder placeholder)
TextShapesetTextPlaceholder in interface TextShape<XSLFShape,XSLFTextParagraph>public TextShape.TextPlaceholder getTextPlaceholder()
getTextPlaceholder in interface TextShape<XSLFShape,XSLFTextParagraph>public <R> Optional<R> findDefinedParagraphProperty(Function<CTTextParagraphProperties,Boolean> isSet, Function<CTTextParagraphProperties,R> getter)
findDefinedParagraphProperty in interface org.apache.poi.xddf.usermodel.text.TextContainerpublic <R> Optional<R> findDefinedRunProperty(Function<CTTextCharacterProperties,Boolean> isSet, Function<CTTextCharacterProperties,R> getter)
findDefinedRunProperty in interface org.apache.poi.xddf.usermodel.text.TextContainerCopyright © 2010 - 2020 Adobe. All Rights Reserved