- java.lang.Object
-
- javafx.scene.control.SkinBase<T>
-
- javafx.scene.control.skin.TextInputControlSkin<TextArea>
-
- javafx.scene.control.skin.TextAreaSkin
-
-
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 Summary
Constructors Constructor Description TextAreaSkin(TextArea control)Creates a new TextAreaSkin instance, installing the necessary child nodes into the Controlchildrenlist, as well as the necessary input mappings for handling key, mouse, etc events.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddHighlight(List<? extends Node> nodes, int start)Adds highlight for composed text from Input Method.doublecomputeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)Calculates the baseline offset based on the first managed child.voiddispose()Called by a Skinnable when the Skin is replaced on the Skinnable.BoundsgetCaretBounds()Gets theBoundsof the caret of the skinnedTextArea.Rectangle2DgetCharacterBounds(int index)Returns the bounds of the character at a given index.HitInfogetIndex(double x, double y)Performs a hit test, mapping point to index in the content.protected intgetInsertionPoint(double x, double y)Returns the insertion point for a given location.Point2DgetMenuPosition()Returns the position to be used for a context menu, based on the location of the caret handle or selection handles.protected PathElement[]getRangeShape(int start, int end)protected PathElement[]getUnderlineShape(int start, int end)protected voidinvalidateMetrics()Invalidates cached min and pref sizes for the TextInputControl.protected voidlayoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)Called during the layout pass of the scenegraph.voidmoveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select)Moves the caret by one of the given text unit, in the given direction.voidpositionCaret(HitInfo hit, boolean select)Moves the caret to the specified position.protected ObjectqueryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)This method is called by the assistive technology to request the value for an attribute.protected voidremoveHighlight(List<? extends Node> nodes)Removes highlight for composed text from Input Method.protected voidscrollCharacterToVisible(int index)Ensures that the character at a given index is visible.protected voidupdateHighlightFill()Called when highlightFill property changes.-
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
-
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
-
-
-
-
Constructor Detail
-
TextAreaSkin
public TextAreaSkin(TextArea control)
Creates a new TextAreaSkin instance, installing the necessary child nodes into the Controlchildrenlist, as well as the necessary input mappings for handling key, mouse, etc events.- Parameters:
control- The control that this skin should be installed onto.
-
-
Method Detail
-
invalidateMetrics
protected void invalidateMetrics()
Invalidates cached min and pref sizes for the TextInputControl.- Overrides:
invalidateMetricsin classTextInputControlSkin<TextArea>
-
layoutChildren
protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)Called during the layout pass of the scenegraph.- Overrides:
layoutChildrenin classSkinBase<TextArea>- Parameters:
contentX- the x positioncontentY- the y positioncontentWidth- the widthcontentHeight- the height
-
updateHighlightFill
protected void updateHighlightFill()
Called when highlightFill property changes.- Overrides:
updateHighlightFillin classTextInputControlSkin<TextArea>
-
getIndex
public HitInfo getIndex(double x, double y)
Performs a hit test, mapping point to index in the content.- Parameters:
x- the x coordinate of the point.y- the y coordinate of the point.- Returns:
- a
HitInfoobject describing the index and forward bias.
-
moveCaret
public void moveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select)
Moves the caret by one of the given text unit, in the given direction. Note that only certain combinations are valid, depending on the implementing subclass.- Specified by:
moveCaretin classTextInputControlSkin<TextArea>- Parameters:
unit- the unit of text to move by.dir- the direction of movement.select- whether to extends the selection to the new posititon.
-
getUnderlineShape
protected PathElement[] getUnderlineShape(int start, int end)
- Specified by:
getUnderlineShapein classTextInputControlSkin<TextArea>- Parameters:
start- the startend- the end- Returns:
- the path elements describing the shape of the underline for the given range.
-
getRangeShape
protected PathElement[] getRangeShape(int start, int end)
- Specified by:
getRangeShapein classTextInputControlSkin<TextArea>- Parameters:
start- the startend- the end- Returns:
- the path elements describing the bounding rectangles for the given range of text.
-
addHighlight
protected void addHighlight(List<? extends Node> nodes, int start)
Adds highlight for composed text from Input Method.- Specified by:
addHighlightin classTextInputControlSkin<TextArea>- Parameters:
nodes- the list of nodesstart- the start
-
removeHighlight
protected void removeHighlight(List<? extends Node> nodes)
Removes highlight for composed text from Input Method.- Specified by:
removeHighlightin classTextInputControlSkin<TextArea>- Parameters:
nodes- the list of nodes
-
getMenuPosition
public Point2D getMenuPosition()
Returns the position to be used for a context menu, based on the location of the caret handle or selection handles. This is supported only on touch displays and does not use the location of the mouse.- Overrides:
getMenuPositionin classTextInputControlSkin<TextArea>- Returns:
- the position to be used for this context menu
-
getCaretBounds
public Bounds getCaretBounds()
Gets theBoundsof the caret of the skinnedTextArea.- Returns:
- the
Boundsof the caret shape, relative to theTextArea.
-
queryAccessibleAttribute
protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
This method is called by the assistive technology to request the value for an attribute.This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
If a particular attribute is not handled, the superclass implementation must be called.- Overrides:
queryAccessibleAttributein classSkinBase<TextArea>- Parameters:
attribute- the requested attributeparameters- optional list of parameters- Returns:
- the value for the requested attribute
- See Also:
AccessibleAttribute,Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)
-
dispose
public void dispose()
Called by a Skinnable when the Skin is replaced on the Skinnable. This method allows a Skin to implement any logic necessary to clean up itself after the Skin is no longer needed. It may be used to release native resources. The methodsSkin.getSkinnable()andSkin.getNode()should return null following a call to dispose. Calling dispose twice has no effect.
-
computeBaselineOffset
public double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)Calculates the baseline offset based on the first managed child. If there is no such child, returnsNode.getBaselineOffset().- Overrides:
computeBaselineOffsetin classSkinBase<TextArea>- Parameters:
topInset- the pixel snapped top insetrightInset- the pixel snapped right insetbottomInset- the pixel snapped bottom insetleftInset- the pixel snapped left inset- Returns:
- baseline offset
-
getInsertionPoint
protected int getInsertionPoint(double x, double y)Returns the insertion point for a given location.- Overrides:
getInsertionPointin classTextInputControlSkin<TextArea>- Parameters:
x- the x locationy- the y location- Returns:
- the insertion point for a given location
-
positionCaret
public void positionCaret(HitInfo hit, boolean select)
Moves the caret to the specified position.- Parameters:
hit- the new position and forward bias of the caret.select- whether to extend selection to the new position.
-
getCharacterBounds
public Rectangle2D getCharacterBounds(int index)
Returns the bounds of the character at a given index.- Overrides:
getCharacterBoundsin classTextInputControlSkin<TextArea>- Parameters:
index- the index- Returns:
- the bounds of the character at a given index
-
scrollCharacterToVisible
protected void scrollCharacterToVisible(int index)
Ensures that the character at a given index is visible.- Overrides:
scrollCharacterToVisiblein classTextInputControlSkin<TextArea>- Parameters:
index- the index
-
-