@Beta public abstract class XSLFTextShape extends XSLFSimpleShape implements TextContainer, TextShape<XSLFShape,XSLFTextParagraph>
XSLFShape.ReparseFactory<T extends org.apache.xmlbeans.XmlObject>TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder| Modifier and Type | Method and Description |
|---|---|
XSLFTextParagraph |
addNewTextParagraph()
add a new paragraph run to this shape
|
XSLFTextRun |
appendText(java.lang.String text,
boolean newParagraph) |
void |
clearText()
unset text from this shape
|
<R> java.util.Optional<R> |
findDefinedParagraphProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter) |
<R> java.util.Optional<R> |
findDefinedRunProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.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.
|
java.lang.String |
getText() |
TextShape.TextAutofit |
getTextAutofit() |
XDDFTextBody |
getTextBody() |
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() |
double |
getTextHeight(java.awt.Graphics2D graphics) |
java.util.List<XSLFTextParagraph> |
getTextParagraphs() |
TextShape.TextPlaceholder |
getTextPlaceholder() |
java.lang.Double |
getTextRotation() |
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() |
boolean |
getWordWrap() |
boolean |
isHorizontalCentered() |
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() |
java.awt.geom.Rectangle2D |
resizeToFitText(java.awt.Graphics2D graphics) |
void |
setBottomInset(double margin)
Sets the bottom margin.
|
void |
setHorizontalCentered(java.lang.Boolean isCentered) |
void |
setInsets(Insets2D insets) |
void |
setLeftInset(double margin)
Sets the left margin.
|
void |
setPlaceholder(Placeholder placeholder) |
void |
setRightInset(double margin)
Sets the right margin.
|
XSLFTextRun |
setText(java.lang.String 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) |
void |
setTextPlaceholder(TextShape.TextPlaceholder placeholder) |
void |
setTextRotation(java.lang.Double rotation) |
void |
setTopInset(double margin)
Sets the top margin.
|
void |
setVerticalAlignment(VerticalAlignment anchor) |
void |
setWordWrap(boolean wrap) |
createHyperlink, getAdjustValue, getAnchor, getFillColor, getFillStyle, getFlipHorizontal, getFlipVertical, getGeometry, getHyperlink, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLinePaint, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getRotation, getShadow, getShapeType, getStrokeStyle, getXfrm, setAnchor, setFillColor, setFlipHorizontal, setFlipVertical, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setRotation, setShapeType, setStrokeStyledraw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, selectProperty, setParentclone, equals, finalize, 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, setRotation@Beta public XDDFTextBody getTextBody()
public java.util.Iterator<XSLFTextParagraph> iterator()
iterator in interface java.lang.Iterable<XSLFTextParagraph>public java.lang.String getText()
getText in interface TextShape<XSLFShape,XSLFTextParagraph>public void clearText()
public XSLFTextRun setText(java.lang.String text)
setText in interface TextShape<XSLFShape,XSLFTextParagraph>public XSLFTextRun appendText(java.lang.String text, boolean newParagraph)
appendText in interface TextShape<XSLFShape,XSLFTextParagraph>public java.util.List<XSLFTextParagraph> getTextParagraphs()
getTextParagraphs in interface TextShape<XSLFShape,XSLFTextParagraph>public XSLFTextParagraph addNewTextParagraph()
public void setVerticalAlignment(VerticalAlignment anchor)
setVerticalAlignment in interface TextShape<XSLFShape,XSLFTextParagraph>public VerticalAlignment getVerticalAlignment()
getVerticalAlignment in interface TextShape<XSLFShape,XSLFTextParagraph>public void setHorizontalCentered(java.lang.Boolean isCentered)
setHorizontalCentered in interface TextShape<XSLFShape,XSLFTextParagraph>public boolean isHorizontalCentered()
isHorizontalCentered in interface TextShape<XSLFShape,XSLFTextParagraph>public void setTextDirection(TextShape.TextDirection orientation)
setTextDirection in interface TextShape<XSLFShape,XSLFTextParagraph>public TextShape.TextDirection getTextDirection()
getTextDirection in interface TextShape<XSLFShape,XSLFTextParagraph>public java.lang.Double getTextRotation()
getTextRotation in interface TextShape<XSLFShape,XSLFTextParagraph>public void setTextRotation(java.lang.Double rotation)
setTextRotation in interface TextShape<XSLFShape,XSLFTextParagraph>public 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)
setInsets in interface TextShape<XSLFShape,XSLFTextParagraph>public boolean getWordWrap()
getWordWrap in interface TextShape<XSLFShape,XSLFTextParagraph>public void setWordWrap(boolean wrap)
setWordWrap in interface TextShape<XSLFShape,XSLFTextParagraph>public 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)
setPlaceholder in interface SimpleShape<XSLFShape,XSLFTextParagraph>setPlaceholder in class XSLFShapePlaceholderDetails.setPlaceholder(Placeholder)public Placeholder getTextType()
public double getTextHeight()
getTextHeight in interface TextShape<XSLFShape,XSLFTextParagraph>public double getTextHeight(java.awt.Graphics2D graphics)
getTextHeight in interface TextShape<XSLFShape,XSLFTextParagraph>public java.awt.geom.Rectangle2D resizeToFitText()
resizeToFitText in interface TextShape<XSLFShape,XSLFTextParagraph>public java.awt.geom.Rectangle2D resizeToFitText(java.awt.Graphics2D graphics)
resizeToFitText in interface TextShape<XSLFShape,XSLFTextParagraph>public void setTextPlaceholder(TextShape.TextPlaceholder placeholder)
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 referencepublic <R> java.util.Optional<R> findDefinedParagraphProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties,R> getter)
findDefinedParagraphProperty in interface TextContainerpublic <R> java.util.Optional<R> findDefinedRunProperty(java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,java.lang.Boolean> isSet,
java.util.function.Function<org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties,R> getter)
findDefinedRunProperty in interface TextContainer