public class TextAreaSkin extends TextInputControlSkin<TextArea,TextAreaBehavior>
| Modifier and Type | Class and Description |
|---|---|
private class |
TextAreaSkin.ContentView |
TextInputControlSkin.ContextMenuItemcaretHandle, caretPath, caretVisible, copyMI, cutMI, deleteMI, displayCaret, fontMetrics, highlightFill, highlightTextFill, pasteMI, preload, promptTextFill, redoMI, selectAllMI, selectionHandle1, selectionHandle2, selectWordMI, separatorMI, SHOW_HANDLES, textFill, undoMI, vkTypeIS_TOUCH_SUPPORTED| Constructor and Description |
|---|
TextAreaSkin(TextArea textArea) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHighlight(java.util.List<? extends Node> nodes,
int start) |
private void |
addParagraphNode(int i,
java.lang.String string) |
double |
computeBaselineOffset(double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the baseline offset based on the first managed child.
|
private void |
createPromptNode() |
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.
|
void |
dispose()
Called by a Skinnable when the Skin is replaced on the Skinnable.
|
protected void |
downLines(int nLines,
boolean select,
boolean extendSelection) |
Bounds |
getCaretBounds() |
char |
getCharacter(int index)
Returns the character at a given offset.
|
Rectangle2D |
getCharacterBounds(int index)
Returns the bounds of the character at a given index.
|
HitInfo |
getIndex(double x,
double y) |
int |
getInsertionPoint(double x,
double y)
Returns the insertion point for a given location.
|
private int |
getInsertionPoint(Text paragraphNode,
double x,
double y) |
Point2D |
getMenuPosition() |
int |
getNextInsertionPoint(double x,
int from,
VerticalDirection scrollDirection) |
private int |
getNextInsertionPoint(Text paragraphNode,
double x,
int from,
VerticalDirection scrollDirection) |
protected PathElement[] |
getRangeShape(int start,
int end) |
private double |
getScrollLeftMax() |
private double |
getScrollTopMax() |
private double |
getTextLeft() |
private Text |
getTextNode() |
private double |
getTextTranslateX() |
private double |
getTextTranslateY() |
protected PathElement[] |
getUnderlineShape(int start,
int end) |
protected void |
invalidateMetrics() |
protected void |
layoutChildren(double contentX,
double contentY,
double contentWidth,
double contentHeight)
Called during the layout pass of the scenegraph.
|
void |
lineEnd(boolean select,
boolean extendSelection) |
void |
lineStart(boolean select,
boolean extendSelection) |
void |
nextCharacterVisually(boolean moveRight) |
void |
nextLine(boolean select) |
void |
nextPage(boolean select) |
void |
paragraphEnd(boolean goPastInitialNewline,
boolean goPastTrailingNewline,
boolean select) |
void |
paragraphStart(boolean previousIfAtStart,
boolean select) |
void |
positionCaret(HitInfo hit,
boolean select,
boolean extendSelection) |
void |
previousLine(boolean select) |
void |
previousPage(boolean select) |
protected java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
protected void |
removeHighlight(java.util.List<? extends Node> nodes) |
private void |
scrollBoundsToVisible(Rectangle2D bounds) |
private void |
scrollCaretToVisible() |
void |
scrollCharacterToVisible(int index)
Ensures that the character at a given index is visible.
|
private Point2D |
translateCaretPosition(Point2D p) |
private void |
updateFontMetrics() |
protected void |
updateHighlightFill() |
private void |
updatePrefViewportHeight() |
private void |
updatePrefViewportWidth() |
private void |
updateTextNodeCaretPos(int pos) |
executeAccessibleAction, forwardBiasProperty, getClassCssMetaData, getCssMetaData, handleInputMethodEvent, isForwardBias, isRTL, maskText, populateContextMenu, setCaretAnimating, setForwardBias, toggleUseVK, updateHighlightTextFill, updateTextFillgetBehavior, handleControlPropertyChanged, registerChangeListener, unregisterChangeListenercomputeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, getChildren, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpaceprivate final TextArea textArea
private final boolean USE_MULTIPLE_NODES
private double computedMinWidth
private double computedMinHeight
private double computedPrefWidth
private double computedPrefHeight
private double widthForComputedPrefHeight
private double characterWidth
private double lineHeight
private TextAreaSkin.ContentView contentView
private Group paragraphNodes
private Text promptNode
private ObservableBooleanValue usePromptText
private ObservableIntegerValue caretPosition
private Group selectionHighlightGroup
private ScrollPane scrollPane
private Bounds oldViewportBounds
private VerticalDirection scrollDirection
private Path characterBoundingPath
private Timeline scrollSelectionTimeline
private EventHandler<ActionEvent> scrollSelectionHandler
public static final int SCROLL_RATE
private double pressX
private double pressY
private boolean handlePressed
double targetCaretX
private static final Path tmpCaretPath
public TextAreaSkin(TextArea textArea)
protected void invalidateMetrics()
invalidateMetrics in class TextInputControlSkin<TextArea,TextAreaBehavior>protected void layoutChildren(double contentX,
double contentY,
double contentWidth,
double contentHeight)
SkinBaselayoutChildren in class SkinBase<TextArea>private void createPromptNode()
private void addParagraphNode(int i,
java.lang.String string)
public void dispose()
BehaviorSkinBaseSkin.getSkinnable() and Skin.getNode()
should return null following a call to dispose. Calling dispose twice
has no effect.dispose in interface Skin<TextArea>dispose in class BehaviorSkinBase<TextArea,TextAreaBehavior>public double computeBaselineOffset(double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBaseNode.getBaselineOffset().computeBaselineOffset in class SkinBase<TextArea>topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetpublic char getCharacter(int index)
TextInputControlSkingetCharacter in class TextInputControlSkin<TextArea,TextAreaBehavior>public int getInsertionPoint(double x,
double y)
TextInputControlSkingetInsertionPoint in class TextInputControlSkin<TextArea,TextAreaBehavior>public void positionCaret(HitInfo hit, boolean select, boolean extendSelection)
private double getScrollTopMax()
private double getScrollLeftMax()
private int getInsertionPoint(Text paragraphNode, double x, double y)
public int getNextInsertionPoint(double x,
int from,
VerticalDirection scrollDirection)
private int getNextInsertionPoint(Text paragraphNode, double x, int from, VerticalDirection scrollDirection)
public Rectangle2D getCharacterBounds(int index)
TextInputControlSkingetCharacterBounds in class TextInputControlSkin<TextArea,TextAreaBehavior>public void scrollCharacterToVisible(int index)
TextInputControlSkinscrollCharacterToVisible in class TextInputControlSkin<TextArea,TextAreaBehavior>private void scrollCaretToVisible()
private void scrollBoundsToVisible(Rectangle2D bounds)
private void updatePrefViewportWidth()
private void updatePrefViewportHeight()
private void updateFontMetrics()
protected void updateHighlightFill()
updateHighlightFill in class TextInputControlSkin<TextArea,TextAreaBehavior>private double getTextTranslateX()
private double getTextTranslateY()
private double getTextLeft()
private Text getTextNode()
public HitInfo getIndex(double x, double y)
public void nextCharacterVisually(boolean moveRight)
nextCharacterVisually in class TextInputControlSkin<TextArea,TextAreaBehavior>protected void downLines(int nLines,
boolean select,
boolean extendSelection)
public void previousLine(boolean select)
public void nextLine(boolean select)
public void previousPage(boolean select)
public void nextPage(boolean select)
public void lineStart(boolean select,
boolean extendSelection)
public void lineEnd(boolean select,
boolean extendSelection)
public void paragraphStart(boolean previousIfAtStart,
boolean select)
public void paragraphEnd(boolean goPastInitialNewline,
boolean goPastTrailingNewline,
boolean select)
private void updateTextNodeCaretPos(int pos)
protected PathElement[] getUnderlineShape(int start, int end)
getUnderlineShape in class TextInputControlSkin<TextArea,TextAreaBehavior>protected PathElement[] getRangeShape(int start, int end)
getRangeShape in class TextInputControlSkin<TextArea,TextAreaBehavior>protected void addHighlight(java.util.List<? extends Node> nodes, int start)
addHighlight in class TextInputControlSkin<TextArea,TextAreaBehavior>protected void removeHighlight(java.util.List<? extends Node> nodes)
removeHighlight in class TextInputControlSkin<TextArea,TextAreaBehavior>public void deleteChar(boolean previous)
public Point2D getMenuPosition()
getMenuPosition in class TextInputControlSkin<TextArea,TextAreaBehavior>public Bounds getCaretBounds()
protected java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute in class SkinBase<TextArea>Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)