public abstract class HSLFTextShape extends HSLFSimpleShape implements TextShape<HSLFShape,HSLFTextParagraph>
TextShape.TextAutofit, TextShape.TextDirection, TextShape.TextPlaceholder
Modifier and Type | Field and Description |
---|---|
static int |
WrapByPoints
Specifies a wrapping rule that is equivalent to that of WrapSquare Excel 97, Excel 2000, Excel 2002, and Office Excel 2003 use this value.
(指定与 WrapSquare 等效的环绕规则 Excel 97、Excel 2000、Excel 2002 和 Office Excel 2003 使用此值。)
|
static int |
WrapNone
Specifies that a line of text will extend into or beyond a margin instead of continuing on subsequent lines.
(指定一行文本将延伸到或超出边距,而不是在后续行上继续。)
|
static int |
WrapSquare
Specifies that a line of text will continue on subsequent lines instead of extending into or beyond a margin.
(指定一行文本将在后续行上继续,而不是延伸到或超出边距。)
|
static int |
WrapThrough
Specifies a wrapping rule that is undefined and MUST be ignored.
(指定一个未定义且必须被忽略的包装规则。)
|
static int |
WrapTopBottom
Specifies a wrapping rule that is undefined and MUST be ignored.
(指定一个未定义且必须被忽略的包装规则。)
|
_hyperlink, ADJUST_VALUES, DEFAULT_LINE_WIDTH
Modifier | Constructor and Description |
---|---|
|
HSLFTextShape()
Create a new TextBox.
(创建一个新的文本框。)
|
protected |
HSLFTextShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a TextBox object and initialize it from the supplied Record container.
(创建一个 TextBox 对象并从提供的 Record 容器初始化它。)
|
|
HSLFTextShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a new TextBox.
(创建一个新的文本框。)
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterInsert(HSLFSheet sh)
When a textbox is added to a sheet we need to tell upper-level
PPDrawing about it.
(当一个文本框被添加到工作表中时,我们需要告诉上层 PPDrawing 它。)
|
HSLFTextRun |
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 供其放置。)
|
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.
(返回文本框底部与包含文本的形状的内接矩形底部之间的距离(以磅为单位)。)
|
protected EscherTextboxWrapper |
getEscherTextboxWrapper() |
RoundTripHFPlaceholder12 |
getHFPlaceholderAtom()
Return
RoundTripHFPlaceholder12 , the atom that describes a header/footer placeholder.
(返回 RoundTripHFPlaceholder12,描述页眉/页脚占位符的原子。)
|
java.util.List<HSLFHyperlink> |
getHyperlinks()
Returns the array of all hyperlinks in this text run
(返回此文本运行中所有超链接的数组)
|
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.
(返回文本框左边缘与包含文本的形状的内接矩形左边缘之间的距离(以磅为单位)。)
|
TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> |
getMetroShape()
Get alternative representation of text shape stored as metro blob escher property.
(获取存储为 Metro blob escher 属性的文本形状的替代表示。)
|
OEPlaceholderAtom |
getPlaceholderAtom()
Return
OEPlaceholderAtom , the atom that describes a placeholder.
(返回 OEPlaceholderAtom,即描述占位符的原子。)
|
java.lang.String |
getRawText()
Returns the raw text content of the shape.
(返回形状的原始文本内容。)
|
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 |
getRunType()
Returns the type of the text, from the TextHeaderAtom.
(从 TextHeaderAtom 返回文本的类型。)
|
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
(计算文本占用的累积高度)
|
int |
getTextId() |
java.util.List<HSLFTextParagraph> |
getTextParagraphs() |
TextShape.TextPlaceholder |
getTextPlaceholder() |
java.lang.Double |
getTextRotation()
The text rotation can be independent specified from the shape rotation.
(文本旋转可以独立于形状旋转指定。)
|
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.
(返回文本的垂直对齐类型。)
|
boolean |
getWordWrap() |
int |
getWordWrapEx()
Returns the value indicating word wrap.
(返回表示自动换行的值。)
|
boolean |
isAlignToBaseline() |
boolean |
isHorizontalCentered()
Returns if the text is centered.
(返回文本是否居中。)
|
boolean |
isPlaceholder()
Checks if the shape is a placeholder.
(检查形状是否为占位符。)
|
java.util.Iterator<HSLFTextParagraph> |
iterator() |
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 |
setAlignToBaseline(boolean alignToBaseline)
Sets the vertical alignment relative to the baseline
(设置相对于基线的垂直对齐方式)
|
void |
setBottomInset(double margin)
Sets the botom margin.
(设置下边距。)
|
protected void |
setDefaultTextProperties(HSLFTextParagraph _txtrun)
Set default properties for the TextRun.
(设置 TextRun 的默认属性。)
|
void |
setHorizontalCentered(java.lang.Boolean isCentered)
Sets if the paragraphs are horizontal centered
(设置段落是否水平居中)
|
void |
setInsets(Insets2D insets)
Sets the shape margins
(设置形状边距)
|
void |
setLeftInset(double margin)
Sets the left margin.
(设置左边距。)
|
void |
setRightInset(double margin)
Sets the right margin.
(设置右边距。)
|
void |
setRunType(int type)
Changes the type of the text.
(更改文本的类型。)
|
void |
setSheet(HSLFSheet sheet)
Assign the
SlideShow this shape belongs to
(分配此形状所属的幻灯片)
|
HSLFTextRun |
setText(java.lang.String text)
Sets (overwrites) the current text.
(设置(覆盖)当前文本。)
|
void |
setTextDirection(TextShape.TextDirection orientation)
sets the vertical orientation
(设置垂直方向)
|
void |
setTextId(int id)
Sets text ID
(设置文本 ID)
|
void |
setTextPlaceholder(TextShape.TextPlaceholder placeholder)
Sets the text placeholder
(设置文本占位符)
|
void |
setTextRotation(java.lang.Double rotation)
Sets the text rotation.
(设置文本旋转。)
|
void |
setTopInset(double margin)
Sets the top margin.
(设置上边距。)
|
void |
setVerticalAlignment(VerticalAlignment vAlign)
Sets the type of vertical alignment for the text.
(设置文本的垂直对齐类型。)
|
void |
setWordWrap(boolean wrap) |
void |
setWordWrapEx(int wrap)
Specifies how the text should be wrapped
(指定文本应如何换行)
|
protected void |
storeText()
Saves the modified paragraphs/textrun to the records.
(将修改后的段落/textrun 保存到记录中。)
|
createHyperlink, createSpContainer, getAdjustValue, getFillColor, getGeometry, getHyperlink, getLineBackgroundColor, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getPlaceholder, getPlaceholderDetails, getShadow, getShadowAngle, getShadowColor, getShadowDistance, getStrokeStyle, setFillColor, setHyperlink, setLineBackgroundColor, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setPlaceholder, setStrokeStyle
draw, getAnchor, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getPlaceholderDetails, getShadow, getShapeType, getStrokeStyle, setFillColor, setPlaceholder, setShapeType, setStrokeStyle
draw, getAnchor, getParent, getShapeId, getShapeName, getSheet
getAdjustValue
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotation
public static final int WrapSquare
public static final int WrapByPoints
public static final int WrapNone
public static final int WrapTopBottom
public static final int WrapThrough
protected HSLFTextShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
escherRecord
-
EscherSpContainer
container which holds information about this shape
(escherRecord - 包含此形状信息的 EscherSpContainer 容器)
parent
- the parent of the shape
(parent - 形状的父级)
public HSLFTextShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
parent
- the parent of this Shape. For example, if this text box is a cell in a table then the parent is Table.
(parent - 此 Shape 的父级。例如,如果此文本框是表格中的一个单元格,则父级为表格。)
public HSLFTextShape()
protected void setDefaultTextProperties(HSLFTextParagraph _txtrun)
protected void afterInsert(HSLFSheet sh)
PPDrawing
about it.
(当一个文本框被添加到工作表中时,我们需要告诉上层 PPDrawing 它。)
afterInsert
in class
HSLFShape
sh
- the sheet we are adding to
(sh - 我们要添加到的工作表)
protected EscherTextboxWrapper getEscherTextboxWrapper()
public java.awt.geom.Rectangle2D resizeToFitText()
TextShape
resizeToFitText
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 resizeToFitText
Rectangle2D
that is the bounds of this shape.
(一个 Rectangle2D,它是这个形状的边界。)
public java.awt.geom.Rectangle2D resizeToFitText(java.awt.Graphics2D graphics)
TextShape
resizeToFitText
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 resizeToFitText
graphics
- a customized graphics context, e.g. which contains font mappings
(graphics - 自定义的图形上下文,例如包含字体映射)
Rectangle2D
that is the bounds of this shape.
(一个 Rectangle2D,它是这个形状的边界。)
public int getRunType()
TextHeaderAtom
public void setRunType(int type)
TextHeaderAtom
public boolean isAlignToBaseline()
public void setAlignToBaseline(boolean alignToBaseline)
alignToBaseline
- if true, vertical alignment is relative to baseline
(alignToBaseline - 如果为 true,则垂直对齐相对于基线)
public boolean isHorizontalCentered()
TextShape
isHorizontalCentered
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(界面 TextShape 中的 isHorizontalCentered
public void setHorizontalCentered(java.lang.Boolean isCentered)
TextShape
setHorizontalCentered
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(界面 TextShape 中的 setHorizontalCentered
isCentered
- true, if the paragraphs are horizontal centered A
null
values unsets this property.
(isCentered - 如果段落水平居中,则为 true 空值取消设置此属性。)
public VerticalAlignment getVerticalAlignment()
TextShape
getVerticalAlignment
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getVerticalAlignment
public void setVerticalAlignment(VerticalAlignment vAlign)
TextShape
setVerticalAlignment
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setVerticalAlignment
vAlign
- - the type of alignment. A
null
values unsets this property.
(vAlign - - 对齐的类型。空值取消设置此属性。)
public double getBottomInset()
public void setBottomInset(double margin)
margin
- the bottom margin
(margin - 下边距)
getBottomInset()
public double getLeftInset()
public void setLeftInset(double margin)
margin
- the left margin
(margin - 左边距)
getLeftInset()
public double getRightInset()
public void setRightInset(double margin)
margin
- the right margin
(margin - 右边距)
getRightInset()
public double getTopInset()
public void setTopInset(double margin)
margin
- the top margin
(margin - 上边距)
getTopInset()
public int getWordWrapEx()
Wrap*
constants defined in this class.
(表示自动换行的值。必须是此类中定义的 Wrap* 常量之一。)
public void setWordWrapEx(int wrap)
wrap
- the value indicating how the text should be wrapped. Must be one of the
Wrap*
constants defined in this class.
(wrap - 指示文本应如何换行的值。必须是此类中定义的 Wrap* 常量之一。)
public boolean getWordWrap()
getWordWrap
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getWordWrap
public void setWordWrap(boolean wrap)
setWordWrap
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setWordWrap
wrap
- whether to wrap words within the bounding rectangle
(wrap - 是否在边界矩形内换行)
public int getTextId()
public void setTextId(int id)
id
- of the text
(id - 文本)
public java.util.List<HSLFTextParagraph> getTextParagraphs()
getTextParagraphs
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getTextParagraphs
public void setSheet(HSLFSheet sheet)
HSLFShape
SlideShow
this shape belongs to
(分配此形状所属的幻灯片)
public OEPlaceholderAtom getPlaceholderAtom()
OEPlaceholderAtom
, the atom that describes a placeholder.
(返回 OEPlaceholderAtom,即描述占位符的原子。)
OEPlaceholderAtom
or
null
if not found
(OEPlaceholderAtom 或 null 如果未找到)
public RoundTripHFPlaceholder12 getHFPlaceholderAtom()
RoundTripHFPlaceholder12
, the atom that describes a header/footer placeholder. Compare the
RoundTripHFPlaceholder12.getPlaceholderId()
with
Placeholder.HEADER
or
Placeholder.FOOTER
, to find out what kind of placeholder this is.
(返回 RoundTripHFPlaceholder12,描述页眉/页脚占位符的原子。将 RoundTripHFPlaceholder12.getPlaceholderId() 与 Placeholder.HEADER 或 Placeholder.FOOTER 进行比较,找出这是什么类型的占位符。)
RoundTripHFPlaceholder12
or
null
if not found
(RoundTripHFPlaceholder12 或 null 如果未找到)
public boolean isPlaceholder()
SimpleShape
isPlaceholder
in interface
SimpleShape<HSLFShape,HSLFTextParagraph>
(接口 SimpleShape 中的 isPlaceholder
isPlaceholder
in class
HSLFSimpleShape
true
if the shape is a placeholder
(如果形状是占位符,则为真)
public java.util.Iterator<HSLFTextParagraph> iterator()
iterator
in interface
java.lang.Iterable<HSLFTextParagraph>
(接口 java.lang.Iterable 中的迭代器
public Insets2D getInsets()
getInsets
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getInsets
public void setInsets(Insets2D insets)
TextShape
setInsets
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setInsets
insets
- the new shape margins
(insets - 新的形状边距)
public double getTextHeight()
TextShape
getTextHeight
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getTextHeight
public double getTextHeight(java.awt.Graphics2D graphics)
TextShape
getTextHeight
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getTextHeight
graphics
- a customized graphics context, e.g. which contains font mappings
(graphics - 自定义的图形上下文,例如包含字体映射)
public TextShape.TextDirection getTextDirection()
getTextDirection
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getTextDirection
public void setTextDirection(TextShape.TextDirection orientation)
TextShape
setTextDirection
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setTextDirection
orientation
- vertical orientation of the text
(方向 - 文本的垂直方向)
public java.lang.Double getTextRotation()
TextShape
getTextRotation
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getTextRotation
public void setTextRotation(java.lang.Double rotation)
TextShape
setTextRotation
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setTextRotation
rotation
- the text rotation, or null to unset the rotation
(rotation - 文本旋转,或 null 取消设置旋转)
public java.lang.String getRawText()
public java.lang.String getText()
TextShape
getText
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getText
public HSLFTextRun appendText(java.lang.String text, boolean newParagraph)
TextShape
appendText
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 appendText
text
- the text string to be appended.
(text - 要附加的文本字符串。)
newParagraph
- if true, a new paragraph will be added, which will contain the added text
(newParagraph - 如果为真,将添加一个新段落,其中将包含添加的文本)
public HSLFTextRun setText(java.lang.String text)
TextShape
setText
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setText
text
- the text string used by this object.
(text - 此对象使用的文本字符串。)
protected void storeText()
public java.util.List<HSLFHyperlink> getHyperlinks()
null
if not found.
(此文本中所有超链接的数组运行,如果未找到,则返回 null。)
public void setTextPlaceholder(TextShape.TextPlaceholder placeholder)
TextShape
setTextPlaceholder
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 setTextPlaceholder
public TextShape.TextPlaceholder getTextPlaceholder()
getTextPlaceholder
in interface
TextShape<HSLFShape,HSLFTextParagraph>
(接口 TextShape 中的 getTextPlaceholder
public TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getMetroShape()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.