- java.lang.Object
-
- javafx.scene.control.SkinBase<T>
-
- javafx.scene.control.skin.TextInputControlSkin<TextArea>
-
- javafx.scene.control.skin.TextAreaSkin
-
- All Implemented Interfaces:
-
Skin<T>
public class TextAreaSkin extends TextInputControlSkin<TextArea>
默认皮肤实现为TextArea控件。- 从以下版本开始:
- 9
- 另请参见:
-
TextArea
-
-
Property Summary
-
Properties inherited from class javafx.scene.control.skin.TextInputControlSkin
forwardBias, highlightFill, highlightTextFill, promptTextFill, textFill
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javafx.scene.control.skin.TextInputControlSkin
TextInputControlSkin.Direction, TextInputControlSkin.TextUnit
-
-
构造方法摘要
构造方法 Constructor 描述 TextAreaSkin(TextArea control)创建一个新的TextAreaSkin实例,将必需的子节点安装到Controlchildren列表中,以及处理密钥,鼠标等事件的必要输入映射。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected voidaddHighlight(List<? extends Node> nodes, int start)从输入法添加组合文本的高亮。doublecomputeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)基于第一个受管理的子节点计算基线偏移量。voiddispose()当Skinnable更换皮肤时,由Skinnable调用。BoundsgetCaretBounds()Rectangle2DgetCharacterBounds(int index)返回给定索引处字符的边界。HitInfogetIndex(double x, double y)执行命中测试,映射到内容中的索引。protected intgetInsertionPoint(double x, double y)返回给定位置的插入点。Point2DgetMenuPosition()根据插入符句柄或选择句柄的位置返回用于上下文菜单的位置。protected PathElement[]getRangeShape(int start, int end)protected PathElement[]getUnderlineShape(int start, int end)protected voidinvalidateMetrics()对TextInputControl的缓存最小和最小大小无效。protected voidlayoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)在场景图的布局过程中调用。voidmoveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select)按照给定的方向,以指定文本单位之一移动插入符号。voidpositionCaret(HitInfo hit, boolean select)将插入符号移动到指定的位置。protected ObjectqueryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)该方法由辅助技术调用以请求属性的值。protected voidremoveHighlight(List<? extends Node> nodes)从Input Method中删除组合文本的高亮。protected voidscrollCharacterToVisible(int index)确保给定索引处的字符是可见的。protected voidupdateHighlightFill()当highlightFill属性更改时调用。-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class javafx.scene.control.SkinBase
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, getChildren, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, registerChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners
-
Methods inherited from class javafx.scene.control.skin.TextInputControlSkin
executeAccessibleAction, forwardBiasProperty, getClassCssMetaData, getCssMetaData, getHighlightFill, getHighlightTextFill, getPromptTextFill, getTextFill, handleInputMethodEvent, highlightFillProperty, highlightTextFillProperty, isForwardBias, maskText, promptTextFillProperty, setCaretAnimating, setForwardBias, setHighlightFill, setHighlightTextFill, setPromptTextFill, setTextFill, textFillProperty, updateHighlightTextFill, updateTextFill
-
-
-
-
方法详细信息
-
invalidateMetrics
protected void invalidateMetrics()
对TextInputControl的缓存最小和最小大小无效。
-
layoutChildren
protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)在场景图的布局过程中调用。- 重写:
-
layoutChildren在SkinBase<TextArea> - 参数
-
contentX- x位置 -
contentY- y位置 -
contentWidth- 宽度 -
contentHeight- 高度
-
updateHighlightFill
protected void updateHighlightFill()
当highlightFill属性更改时调用。
-
getIndex
public HitInfo getIndex(double x, double y)
执行命中测试,映射到内容中的索引。- 参数
-
x- 点的x坐标。 -
y- 点的y坐标。 - 结果
-
描述索引和正向偏差的
HitInfo对象。
-
moveCaret
public void moveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select)
按照给定的方向,以指定文本单位之一移动插入符号。 请注意,只有某些组合有效,具体取决于实现的子类。- Specified by:
-
moveCaret在TextInputControlSkin<TextArea> - 参数
-
unit- 要移动的文本单位。 -
dir- 运动方向。 -
select- 是否将选择扩展到新的定位。
-
getUnderlineShape
protected PathElement[] getUnderlineShape(int start, int end)
- Specified by:
-
getUnderlineShape在TextInputControlSkin<TextArea> - 参数
-
start- 开始 -
end- 结束 - 结果
- 描述给定范围的下划线形状的路径元素。
-
getRangeShape
protected PathElement[] getRangeShape(int start, int end)
- Specified by:
-
getRangeShape在TextInputControlSkin<TextArea> - 参数
-
start- 开始 -
end- 结束 - 结果
- 描述给定范围文本的边界矩形的路径元素。
-
addHighlight
protected void addHighlight(List<? extends Node> nodes, int start)
从输入法添加组合文本的高亮。- Specified by:
-
addHighlight在TextInputControlSkin<TextArea> - 参数
-
nodes- 节点列表 -
start- 开始
-
removeHighlight
protected void removeHighlight(List<? extends Node> nodes)
从Input Method中删除组合文本的高亮。- Specified by:
-
removeHighlight在TextInputControlSkin<TextArea> - 参数
-
nodes- 节点列表
-
getMenuPosition
public Point2D getMenuPosition()
根据插入符句柄或选择句柄的位置返回用于上下文菜单的位置。 这仅在触摸显示器上支持,并且不使用鼠标的位置。- 重写:
-
getMenuPosition在TextInputControlSkin<TextArea> - 结果
- 用于此上下文菜单的位置
-
getCaretBounds
public Bounds getCaretBounds()
- 结果
-
相对于
Bounds,插入符号形状的TextArea。
-
queryAccessibleAttribute
protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
该方法由辅助技术调用以请求属性的值。子类通常覆盖此方法来实现特定角色所需的属性。
如果未处理特定属性,则必须调用超类实现。- 重写:
-
queryAccessibleAttribute在SkinBase<TextArea> - 参数
-
attribute- 请求的属性 -
parameters- 可选参数列表 - 结果
- 请求的属性的值
- 另请参见:
-
AccessibleAttribute,Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)
-
dispose
public void dispose()
当Skinnable更换皮肤时,由Skinnable调用。 该方法允许皮肤在不再需要皮肤后,实现任何必要的清理功能。 它可能用于释放本机资源。 方法Skin.getSkinnable()和Skin.getNode()应在调用处理后返回null。 呼叫处理两次无效。
-
computeBaselineOffset
public double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)基于第一个受管理的子节点计算基线偏移量。 如果没有这样的孩子,返回Node.getBaselineOffset()。- 重写:
-
computeBaselineOffset在SkinBase<TextArea> - 参数
-
topInset- 像素拍摄顶部插图 -
rightInset- 像素拍摄正确的插图 -
bottomInset- 像素啪嗒的底部插入 -
leftInset- 像素拍摄左边插图 - 结果
- 基线偏移
-
getInsertionPoint
protected int getInsertionPoint(double x, double y)返回给定位置的插入点。- 重写:
-
getInsertionPoint在TextInputControlSkin<TextArea> - 参数
-
x- x位置 -
y- y位置 - 结果
- 给定位置的插入点
-
positionCaret
public void positionCaret(HitInfo hit, boolean select)
将插入符号移动到指定的位置。- 参数
-
hit- 插入符号的新位置和向前偏移。 -
select- 是否将选择扩展到新位置。
-
getCharacterBounds
public Rectangle2D getCharacterBounds(int index)
返回给定索引处字符的边界。- 重写:
-
getCharacterBounds在TextInputControlSkin<TextArea> - 参数
-
index- 索引 - 结果
- 在给定索引处的字符的边界
-
scrollCharacterToVisible
protected void scrollCharacterToVisible(int index)
确保给定索引处的字符是可见的。- 重写:
-
scrollCharacterToVisible在TextInputControlSkin<TextArea> - 参数
-
index- the index
-
-