public interface TextShape<S extends Shape<S,P>,P extends TextParagraph<S,P,? extends TextRun>> extends SimpleShape<S,P>, Iterable<P>
Modifier and Type | Interface and Description |
---|---|
static class |
TextShape.TextAutofit
Specifies alist of auto-fit types.
|
static class |
TextShape.TextDirection
Vertical Text Types
|
static class |
TextShape.TextPlaceholder
This enum represents a compromise for the handling of
HSLF run types (see org.apache.poi.hslf.record.TextHeaderAtom) and
XSLF placeholders (see org.apache.poi.xslf.usermodel.Placeholder).
|
Modifier and Type | Method and Description |
---|---|
TextRun |
appendText(String text,
boolean newParagraph)
Adds the supplied text onto the end of the TextParagraphs,
creating a new RichTextRun for it to sit in.
|
Insets2D |
getInsets() |
String |
getText()
Returns the text contained in this text frame, which has been made safe
for printing and other use.
|
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<P> |
getTextParagraphs() |
TextShape.TextPlaceholder |
getTextPlaceholder() |
Double |
getTextRotation()
The text rotation can be independent specified from the shape rotation.
|
VerticalAlignment |
getVerticalAlignment()
Returns the type of vertical alignment for the text.
|
boolean |
getWordWrap() |
boolean |
isHorizontalCentered()
Returns if the text is centered.
|
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 |
setHorizontalCentered(Boolean isCentered)
Sets if the paragraphs are horizontal centered
|
void |
setInsets(Insets2D insets)
Sets the shape margins
|
TextRun |
setText(String text)
Sets (overwrites) the current text.
|
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 |
setVerticalAlignment(VerticalAlignment vAlign)
Sets the type of vertical alignment for the text.
|
void |
setWordWrap(boolean wrap) |
createHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getPlaceholderDetails, getShadow, getShapeType, getStrokeStyle, isPlaceholder, setFillColor, setPlaceholder, setShapeType, setStrokeStyle
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
getAdjustValue
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
forEach, iterator, spliterator
String getText()
TextRun setText(String text)
text
- the text string used by this object.TextRun appendText(String text, boolean newParagraph)
text
- the text string to be appended.newParagraph
- if true, a new paragraph will be added,
which will contain the added textInsets2D getInsets()
void setInsets(Insets2D insets)
insets
- the new shape marginsdouble getTextHeight()
double getTextHeight(Graphics2D graphics)
graphics
- a customized graphics context, e.g. which contains font mappingsVerticalAlignment getVerticalAlignment()
void setVerticalAlignment(VerticalAlignment vAlign)
vAlign
- - the type of alignment.
A null
values unsets this property.boolean isHorizontalCentered()
void setHorizontalCentered(Boolean isCentered)
isCentered
- true, if the paragraphs are horizontal centered
A null
values unsets this property.boolean getWordWrap()
void setWordWrap(boolean wrap)
wrap
- whether to wrap words within the bounding rectangleTextShape.TextDirection getTextDirection()
void setTextDirection(TextShape.TextDirection orientation)
orientation
- vertical orientation of the textDouble getTextRotation()
void setTextRotation(Double rotation)
rotation
- the text rotation, or null to unset the rotationvoid setTextPlaceholder(TextShape.TextPlaceholder placeholder)
TextShape.TextPlaceholder getTextPlaceholder()
Rectangle2D resizeToFitText()
Rectangle2D
that is the bounds of this shape.Rectangle2D resizeToFitText(Graphics2D graphics)
graphics
- a customized graphics context, e.g. which contains font mappingsRectangle2D
that is the bounds of this shape.Copyright © 2010 - 2020 Adobe. All Rights Reserved