public class XSSFSimpleShape extends XSSFShape implements Iterable<XSSFTextParagraph>, SimpleShape, org.apache.poi.xddf.usermodel.text.TextContainer
ShapeTypes
Modifier and Type | Method and Description |
---|---|
XSSFTextParagraph |
addNewTextParagraph()
Add a new paragraph run to this shape
|
XSSFTextParagraph |
addNewTextParagraph(String text)
Add a new paragraph run to this shape, set to the provided string
|
XSSFTextParagraph |
addNewTextParagraph(XSSFRichTextString str)
Add a new paragraph run to this shape, set to the provided rich text
string
|
void |
clearText()
Clear all 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.
|
CTShape |
getCTShape() |
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.
|
int |
getShapeId() |
String |
getShapeName() |
int |
getShapeType()
Gets the shape type, one of the constants defined in
ShapeTypes . |
String |
getText()
Returns the text from all paragraphs in the shape.
|
TextAutofit |
getTextAutofit() |
org.apache.poi.xddf.usermodel.text.XDDFTextBody |
getTextBody() |
TextDirection |
getTextDirection()
Gets the vertical orientation of the text
|
TextHorizontalOverflow |
getTextHorizontalOverflow()
Returns the type of horizontal overflow for the text.
|
List<XSSFTextParagraph> |
getTextParagraphs()
Returns a collection of the XSSFTextParagraphs that are attached to this
shape
|
TextVerticalOverflow |
getTextVerticalOverflow()
Returns the type of vertical overflow for the text.
|
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 within the shape.
|
boolean |
getWordWrap() |
Iterator<XSSFTextParagraph> |
iterator() |
void |
setBottomInset(double margin)
Sets the bottom inset.
|
void |
setLeftInset(double margin)
Sets the left inset.
|
void |
setRightInset(double margin)
Sets the right inset.
|
void |
setShapeType(int type)
Sets the shape types.
|
void |
setText(String text)
Set a single paragraph of text on the shape.
|
void |
setText(XSSFRichTextString str)
Set a single paragraph of text on the shape.
|
void |
setTextAutofit(TextAutofit value)
Specifies that a shape should be auto-fit to fully contain the text
described within it.
|
void |
setTextDirection(TextDirection orientation)
Sets the vertical orientation of the text
|
void |
setTextHorizontalOverflow(TextHorizontalOverflow overflow)
Sets the type of horizontal overflow for the text.
|
void |
setTextVerticalOverflow(TextVerticalOverflow overflow)
Sets the type of vertical overflow for the text.
|
void |
setTopInset(double margin)
Sets the top inset.
|
void |
setVerticalAlignment(VerticalAlignment anchor)
Sets the type of vertical alignment for the text within the shape.
|
void |
setWordWrap(boolean wrap) |
getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFill
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
getAnchor, getParent, isNoFill, setFillColor, setLineStyleColor, setNoFill
@Beta public org.apache.poi.xddf.usermodel.text.XDDFTextBody getTextBody()
public Iterator<XSSFTextParagraph> iterator()
iterator
in interface Iterable<XSSFTextParagraph>
public String getText()
public void clearText()
public void setText(String text)
text
- string representing the paragraph textpublic void setText(XSSFRichTextString str)
str
- rich text string representing the paragraph textpublic List<XSSFTextParagraph> getTextParagraphs()
public XSSFTextParagraph addNewTextParagraph()
public XSSFTextParagraph addNewTextParagraph(String text)
public XSSFTextParagraph addNewTextParagraph(XSSFRichTextString str)
public void setTextHorizontalOverflow(TextHorizontalOverflow overflow)
overflow
- - the type of horizontal overflow. A null
values
unsets this property.public TextHorizontalOverflow getTextHorizontalOverflow()
public void setTextVerticalOverflow(TextVerticalOverflow overflow)
overflow
- - the type of vertical overflow. A null
values
unsets this property.public TextVerticalOverflow getTextVerticalOverflow()
public void setVerticalAlignment(VerticalAlignment anchor)
anchor
- - the type of alignment. A null
values unsets
this property.public VerticalAlignment getVerticalAlignment()
public void setTextDirection(TextDirection orientation)
orientation
- vertical orientation of the text A null
values
unsets this property.public TextDirection getTextDirection()
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 boolean getWordWrap()
public void setWordWrap(boolean wrap)
wrap
- whether to wrap words within the bounding rectanglepublic void setTextAutofit(TextAutofit value)
value
- type of autofitpublic TextAutofit getTextAutofit()
public int getShapeType()
ShapeTypes
.ShapeTypes
public void setShapeType(int type)
type
- the shape type, one of the constants defined in
ShapeTypes
.ShapeTypes
public String getShapeName()
getShapeName
in interface Shape
public int getShapeId()
getShapeId
in interface SimpleShape
public <R> Optional<R> findDefinedParagraphProperty(Function<CTTextParagraphProperties,Boolean> isSet, Function<CTTextParagraphProperties,R> getter)
findDefinedParagraphProperty
in interface org.apache.poi.xddf.usermodel.text.TextContainer
public <R> Optional<R> findDefinedRunProperty(Function<CTTextCharacterProperties,Boolean> isSet, Function<CTTextCharacterProperties,R> getter)
findDefinedRunProperty
in interface org.apache.poi.xddf.usermodel.text.TextContainer
Copyright © 2010 - 2020 Adobe. All Rights Reserved