public interface TextShape<S extends Shape<S,P>,P extends TextParagraph<S,P,? extends TextRun>> extends SimpleShape<S,P>, java.lang.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).
(这个枚举代表了处理 HSLF 运行类型(参见 org.apache.poi.hslf.record.TextHeaderAtom)和 XSLF 占位符(参见 org.apache.poi.xslf.usermodel.Placeholder)的折衷方案。)
|
Modifier and Type | Method and Description |
---|---|
TextRun |
appendText(java.lang.String text, boolean newParagraph)
Adds the supplied text onto the end of the TextParagraphs, creating a new RichTextRun for it to sit in.
(将提供的文本添加到 TextParagraphs 的末尾,创建一个新的 RichTextRun 供其放置。)
|
Insets2D |
getInsets() |
java.lang.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(java.awt.Graphics2D graphics)
Compute the cumulative height occupied by the text
(计算文本占用的累积高度)
|
java.util.List<P> |
getTextParagraphs() |
TextShape.TextPlaceholder |
getTextPlaceholder() |
java.lang.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.
(返回文本是否居中。)
|
java.awt.geom.Rectangle2D |
resizeToFitText()
Adjust the size of the shape so it encompasses the text inside it.
(调整形状的大小,使其包含其中的文本。)
|
java.awt.geom.Rectangle2D |
resizeToFitText(java.awt.Graphics2D graphics)
Adjust the size of the shape so it encompasses the text inside it.
(调整形状的大小,使其包含其中的文本。)
|
void |
setHorizontalCentered(java.lang.Boolean isCentered)
Sets if the paragraphs are horizontal centered
(设置段落是否水平居中)
|
void |
setInsets(Insets2D insets)
Sets the shape margins
(设置形状边距)
|
TextRun |
setText(java.lang.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(java.lang.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
java.lang.String getText()
TextRun setText(java.lang.String text)
text
- the text string used by this object.
(text - 此对象使用的文本字符串。)
TextRun appendText(java.lang.String text, boolean newParagraph)
text
- the text string to be appended.
(text - 要附加的文本字符串。)
newParagraph
- if true, a new paragraph will be added, which will contain the added text
(newParagraph - 如果为真,将添加一个新段落,其中将包含添加的文本)
java.util.List<P> getTextParagraphs()
Insets2D getInsets()
void setInsets(Insets2D insets)
insets
- the new shape margins
(insets - 新的形状边距)
double getTextHeight()
double getTextHeight(java.awt.Graphics2D graphics)
graphics
- a customized graphics context, e.g. which contains font mappings
(graphics - 自定义的图形上下文,例如包含字体映射)
VerticalAlignment getVerticalAlignment()
void setVerticalAlignment(VerticalAlignment vAlign)
vAlign
- - the type of alignment. A
null
values unsets this property.
(vAlign - - 对齐的类型。空值取消设置此属性。)
boolean isHorizontalCentered()
void setHorizontalCentered(java.lang.Boolean isCentered)
isCentered
- true, if the paragraphs are horizontal centered A
null
values unsets this property.
(isCentered - 如果段落水平居中,则为 true 空值取消设置此属性。)
boolean getWordWrap()
void setWordWrap(boolean wrap)
wrap
- whether to wrap words within the bounding rectangle
(wrap - 是否在边界矩形内换行)
TextShape.TextDirection getTextDirection()
void setTextDirection(TextShape.TextDirection orientation)
orientation
- vertical orientation of the text
(方向 - 文本的垂直方向)
java.lang.Double getTextRotation()
void setTextRotation(java.lang.Double rotation)
rotation
- the text rotation, or null to unset the rotation
(rotation - 文本旋转,或 null 取消设置旋转)
void setTextPlaceholder(TextShape.TextPlaceholder placeholder)
TextShape.TextPlaceholder getTextPlaceholder()
java.awt.geom.Rectangle2D resizeToFitText()
Rectangle2D
that is the bounds of this shape.
(一个 Rectangle2D,它是这个形状的边界。)
java.awt.geom.Rectangle2D resizeToFitText(java.awt.Graphics2D graphics)
graphics
- a customized graphics context, e.g. which contains font mappings
(graphics - 自定义的图形上下文,例如包含字体映射)
Rectangle2D
that is the bounds of this shape.
(一个 Rectangle2D,它是这个形状的边界。)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.