public class TextFieldSkin extends TextInputControlSkin<TextField,TextFieldBehavior>
| Modifier and Type | Field and Description |
|---|---|
static char |
BULLET |
protected ObservableDoubleValue |
textRight
Right edge of the text region sans padding
|
caretHandle, caretPath, caretVisible, displayCaret, fontMetrics, highlightFill, highlightTextFill, promptTextFill, selectionHandle1, selectionHandle2, SHOW_HANDLES, textFillIS_TOUCH_SUPPORTED| Constructor and Description |
|---|
TextFieldSkin(TextField textField)
Create a new TextFieldSkin.
|
TextFieldSkin(TextField textField,
TextFieldBehavior behavior) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHighlight(List<? extends Node> nodes,
int start) |
double |
computeBaselineOffset(double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the baseline offset based on the first managed child.
|
protected double |
computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the maximum allowable height of the Skin, based on the provided
width.
|
protected double |
computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the minimum allowable height of the Skin, based on the provided
width.
|
protected double |
computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred height of this
SkinBase. |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred width of this
SkinBase. |
void |
deleteChar(boolean previous)
Use this implementation instead of the one provided on TextInputControl
Simply calls into TextInputControl.deletePrevious/NextChar and responds appropriately
based on the return value.
|
Rectangle2D |
getCharacterBounds(int index)
Returns the bounds of the character at a given index.
|
protected HPos |
getHAlignment() |
HitInfo |
getIndex(double x,
double y) |
Point2D |
getMenuPosition() |
protected PathElement[] |
getRangeShape(int start,
int end) |
protected PathElement[] |
getUnderlineShape(int start,
int end) |
protected void |
handleControlPropertyChanged(String propertyReference)
Skin subclasses will override this method to handle changes in corresponding
control's properties.
|
protected void |
layoutChildren(double x,
double y,
double w,
double h)
Called during the layout pass of the scenegraph.
|
protected String |
maskText(String txt) |
void |
nextCharacterVisually(boolean moveRight) |
void |
positionCaret(HitInfo hit,
boolean select) |
protected Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
Object... parameters) |
protected void |
removeHighlight(List<? extends Node> nodes) |
void |
replaceText(int start,
int end,
String txt)
Use this implementation instead of the one provided on TextInputControl.
|
void |
scrollAfterDelete(double textMaxXOld,
double caretMaxXOld) |
protected int |
translateCaretPosition(int cp)
Function to translate the text control's "dot" into the caret
position in the Text node.
|
protected Point2D |
translateCaretPosition(Point2D p) |
protected void |
updateCaretOff() |
executeAccessibleAction, forwardBiasProperty, getCharacter, getClassCssMetaData, getCssMetaData, getInsertionPoint, handleInputMethodEvent, invalidateMetrics, isForwardBias, isRTL, populateContextMenu, scrollCharacterToVisible, setCaretAnimating, setForwardBias, toggleUseVK, updateHighlightFill, updateHighlightTextFill, updateTextFilldispose, getBehavior, registerChangeListener, unregisterChangeListenercomputeMaxWidth, computeMinWidth, consumeMouseEvents, getChildren, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpaceprotected ObservableDoubleValue textRight
public static final char BULLET
public TextFieldSkin(TextField textField)
textField - not nullpublic TextFieldSkin(TextField textField, TextFieldBehavior behavior)
protected int translateCaretPosition(int cp)
protected void handleControlPropertyChanged(String propertyReference)
BehaviorSkinBasehandleControlPropertyChanged in class BehaviorSkinBase<TextField,TextFieldBehavior>protected double computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBaseSkinBase. The default
implementation calculates this width as the width of the area occupied
by its managed children when they are positioned at their
current positions at their preferred widths.computePrefWidth in class SkinBase<TextField>height - the height that should be used if preferred width depends on ittopInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBasecomputeMinHeight in class SkinBase<TextField>width - The width of the Skin, in case this value might dictate
the minimum height.topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBaseSkinBase. The default
implementation calculates this height as the height of the area occupied
by its managed children when they are positioned at their current
positions at their preferred heights.computePrefHeight in class SkinBase<TextField>width - the width that should be used if preferred height depends on ittopInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBasecomputeMaxHeight in class SkinBase<TextField>width - The width of the Skin, in case this value might dictate
the maximum height.topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetpublic double computeBaselineOffset(double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBaseNode.getBaselineOffset().computeBaselineOffset in class SkinBase<TextField>topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected void updateCaretOff()
public void replaceText(int start,
int end,
String txt)
public void deleteChar(boolean previous)
public void scrollAfterDelete(double textMaxXOld,
double caretMaxXOld)
public HitInfo getIndex(double x, double y)
public void positionCaret(HitInfo hit, boolean select)
public Rectangle2D getCharacterBounds(int index)
TextInputControlSkingetCharacterBounds in class TextInputControlSkin<TextField,TextFieldBehavior>protected PathElement[] getUnderlineShape(int start, int end)
getUnderlineShape in class TextInputControlSkin<TextField,TextFieldBehavior>protected PathElement[] getRangeShape(int start, int end)
getRangeShape in class TextInputControlSkin<TextField,TextFieldBehavior>protected void addHighlight(List<? extends Node> nodes, int start)
addHighlight in class TextInputControlSkin<TextField,TextFieldBehavior>protected void removeHighlight(List<? extends Node> nodes)
removeHighlight in class TextInputControlSkin<TextField,TextFieldBehavior>public void nextCharacterVisually(boolean moveRight)
nextCharacterVisually in class TextInputControlSkin<TextField,TextFieldBehavior>protected void layoutChildren(double x,
double y,
double w,
double h)
SkinBaselayoutChildren in class SkinBase<TextField>protected HPos getHAlignment()
public Point2D getMenuPosition()
getMenuPosition in class TextInputControlSkin<TextField,TextFieldBehavior>protected String maskText(String txt)
maskText in class TextInputControlSkin<TextField,TextFieldBehavior>protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
queryAccessibleAttribute in class SkinBase<TextField>Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)Copyright © 2025. All rights reserved.