public class XSSFSimpleShape extends XSSFShape implements java.lang.Iterable<XSSFTextParagraph>, SimpleShape, TextContainer
ShapeTypes
Modifier | Constructor and Description |
---|---|
protected |
XSSFSimpleShape(XSSFDrawing drawing,
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape ctShape) |
Modifier and Type | Method and Description |
---|---|
XSSFTextParagraph |
addNewTextParagraph()
Add a new paragraph run to this shape
|
XSSFTextParagraph |
addNewTextParagraph(java.lang.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> 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.
|
org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.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() |
java.lang.String |
getShapeName() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties |
getShapeProperties()
Returns xml bean with shape properties.
|
int |
getShapeType()
Gets the shape type, one of the constants defined in
ShapeTypes . |
java.lang.String |
getText()
Returns the text from all paragraphs in the shape.
|
TextAutofit |
getTextAutofit() |
XDDFTextBody |
getTextBody() |
TextDirection |
getTextDirection()
Gets the vertical orientation of the text
|
TextHorizontalOverflow |
getTextHorizontalOverflow()
Returns the type of horizontal overflow for the text.
|
java.util.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() |
java.util.Iterator<XSSFTextParagraph> |
iterator() |
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape |
prototype()
Prototype with the default structure of a new auto-shape.
|
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(java.lang.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) |
protected void |
setXfrm(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D t2d) |
getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFill
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnchor, getParent, isNoFill, setFillColor, setLineStyleColor, setNoFill
protected XSSFSimpleShape(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape ctShape)
protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape prototype()
@Internal public org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape getCTShape()
@Beta public XDDFTextBody getTextBody()
protected void setXfrm(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D t2d)
public java.util.Iterator<XSSFTextParagraph> iterator()
iterator
in interface java.lang.Iterable<XSSFTextParagraph>
public java.lang.String getText()
public void clearText()
public void setText(java.lang.String text)
text
- string representing the paragraph textpublic void setText(XSSFRichTextString str)
str
- rich text string representing the paragraph textpublic java.util.List<XSSFTextParagraph> getTextParagraphs()
public XSSFTextParagraph addNewTextParagraph()
public XSSFTextParagraph addNewTextParagraph(java.lang.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
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties getShapeProperties()
XSSFShape
getShapeProperties
in class XSSFShape
public java.lang.String getShapeName()
getShapeName
in interface Shape
public int getShapeId()
getShapeId
in interface SimpleShape
public <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 TextContainer
public <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
Copyright 2020 The Apache Software Foundation or its licensors, as applicable.