public class CaretNode extends javafx.scene.shape.Path implements Caret, java.lang.Comparable<CaretNode>
Caret. Since only one Path object is used per caret, the model
and view were combined into one item to grant easier access to and modification of CSS-related
properties. Caution must be exercised when depending on Path-related properties in any way (e.g.
Node.boundsInLocalProperty(), Node.parentProperty(), etc.). Also, caretBoundsProperty()
is distinguishable from Node.boundsInLocalProperty().
This class adds the css property "-rtfx-blink-rate" (blinkRateProperty()}
| Type | Property | Description |
|---|---|---|
org.reactfx.SuspendableNo |
beingUpdated |
|
javafx.beans.property.ObjectProperty<javafx.util.Duration> |
blinkRate |
The blink rate of the caret.
|
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> |
caretBounds |
The selectionBoundsProperty of the caret in the Screen's coordinate system or
Optional.empty() if caret is not visible
in the viewport. |
javafx.beans.value.ObservableValue<java.lang.Integer> |
columnPosition |
The column position of the caret on its given line
|
javafx.beans.value.ObservableValue<java.util.OptionalInt> |
lineIndex |
The line index of a multi-line paragraph that contains this caret
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
paragraphIndex |
The paragraph index that contains this caret
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
position |
The position of the caret within the text
|
org.reactfx.value.Var<Caret.CaretVisibility> |
showCaret |
Whether to display the caret or not.
|
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visibleCaret.CaretVisibility| Constructor | Description |
|---|---|
CaretNode(java.lang.String name,
GenericStyledArea<?,?,?> area) |
|
CaretNode(java.lang.String name,
GenericStyledArea<?,?,?> area,
int startingPosition) |
|
CaretNode(java.lang.String name,
GenericStyledArea<?,?,?> area,
org.reactfx.SuspendableNo dependentBeingUpdated,
int startingPosition) |
| Modifier and Type | Method | Description |
|---|---|---|
org.reactfx.SuspendableNo |
beingUpdatedProperty() |
|
javafx.beans.property.ObjectProperty<javafx.util.Duration> |
blinkRateProperty() |
The blink rate of the caret.
|
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> |
caretBoundsProperty() |
The selectionBoundsProperty of the caret in the Screen's coordinate system or
Optional.empty() if caret is not visible
in the viewport. |
void |
clearTargetOffset() |
Clears the caret's x offset
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
columnPositionProperty() |
The column position of the caret on its given line
|
int |
compareTo(CaretNode o) |
|
void |
dispose() |
Disposes the caret and prevents memory leaks
|
boolean |
equals(java.lang.Object obj) |
|
GenericStyledArea<?,?,?> |
getArea() |
Gets the area with which this caret is associated.
|
javafx.util.Duration |
getBlinkRate() |
Gets the value of the property blinkRate.
|
java.util.Optional<javafx.geometry.Bounds> |
getCaretBounds() |
Gets the value of the property caretBounds.
|
java.lang.String |
getCaretName() |
Gets the name of this caret.
|
static java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> |
getClassCssMetaData() |
|
int |
getColumnPosition() |
Gets the value of the property columnPosition.
|
java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> |
getCssMetaData() |
|
java.util.OptionalInt |
getLineIndex() |
Gets the value of the property lineIndex.
|
int |
getParagraphIndex() |
Gets the value of the property paragraphIndex.
|
int |
getPosition() |
Gets the value of the property position.
|
Caret.CaretVisibility |
getShowCaret() |
Gets the value of the property showCaret.
|
org.fxmisc.richtext.ParagraphBox.CaretOffsetX |
getTargetOffset() |
Stores the caret's current column position, so that moving the caret vertically will keep it close to its
original offset in a line.
|
int |
hashCode() |
|
boolean |
isBeingUpdated() |
|
javafx.beans.value.ObservableValue<java.util.OptionalInt> |
lineIndexProperty() |
The line index of a multi-line paragraph that contains this caret
|
void |
moveBreaksBackwards(int numOfBreaks,
java.text.BreakIterator breakIterator) |
Moves the caret backwards by the number of breaks.
|
void |
moveBreaksForwards(int numOfBreaks,
java.text.BreakIterator breakIterator) |
Moves the caret forwards by the number of breaks.
|
void |
moveTo(int position) |
Moves the caret to the given position in the area.
|
void |
moveTo(int paragraphIndex,
int columnPosition) |
Moves the caret to the given position in the area.
|
void |
moveToAreaEnd() |
Moves the caret to the end of the area.
|
void |
moveToNextChar() |
Moves the caret forward one char in the text.
|
void |
moveToParEnd() |
Moves the caret to the end of the current paragraph.
|
void |
moveToParStart() |
Moves the caret to the beginning of the current paragraph.
|
void |
moveToPrevChar() |
Moves the caret backward one char in the text.
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
paragraphIndexProperty() |
The paragraph index that contains this caret
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
positionProperty() |
The position of the caret within the text
|
void |
setBlinkRate(javafx.util.Duration rate) |
Sets the value of the property blinkRate.
|
void |
setShowCaret(Caret.CaretVisibility value) |
Sets the value of the property showCaret.
|
org.reactfx.value.Var<Caret.CaretVisibility> |
showCaretProperty() |
Whether to display the caret or not.
|
java.lang.String |
toString() |
isVisible, moveSentenceBreaksBackwards, moveSentenceBreaksForwards, moveToAreaStart, moveWordBreaksBackwards, moveWordBreaksForwards, visiblePropertyaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBaselineOffset, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyclone, finalize, getClass, notify, notifyAll, wait, wait, waitfillRuleProperty, getElements, getFillRule, setFillRulefillProperty, getFill, getStroke, getStrokeDashArray, getStrokeDashOffset, getStrokeLineCap, getStrokeLineJoin, getStrokeMiterLimit, getStrokeType, getStrokeWidth, intersect, isSmooth, setFill, setSmooth, setStroke, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeType, setStrokeWidth, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract, unionpublic javafx.beans.property.ObjectProperty<javafx.util.Duration> blinkRateProperty
blinkRateProperty in interface CaretCaret.getBlinkRate(),
Caret.setBlinkRate(Duration)public final javafx.beans.value.ObservableValue<java.lang.Integer> positionProperty
positionProperty in interface CaretgetPosition()public final javafx.beans.value.ObservableValue<java.lang.Integer> paragraphIndexProperty
paragraphIndexProperty in interface CaretgetParagraphIndex()public final javafx.beans.value.ObservableValue<java.util.OptionalInt> lineIndexProperty
lineIndexProperty in interface CaretgetLineIndex()public final javafx.beans.value.ObservableValue<java.lang.Integer> columnPositionProperty
columnPositionProperty in interface CaretgetColumnPosition()public final org.reactfx.value.Var<Caret.CaretVisibility> showCaretProperty
showCaretProperty in interface CaretgetShowCaret(),
setShowCaret(Caret.CaretVisibility)public final javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> caretBoundsProperty
caretBoundsProperty in interface CaretgetCaretBounds()public final org.reactfx.SuspendableNo beingUpdatedProperty
beingUpdatedProperty in interface Caretpublic CaretNode(java.lang.String name,
GenericStyledArea<?,?,?> area)
public CaretNode(java.lang.String name,
GenericStyledArea<?,?,?> area,
int startingPosition)
public CaretNode(java.lang.String name,
GenericStyledArea<?,?,?> area,
org.reactfx.SuspendableNo dependentBeingUpdated,
int startingPosition)
public javafx.beans.property.ObjectProperty<javafx.util.Duration> blinkRateProperty()
blinkRateProperty in interface CaretCaret.getBlinkRate(),
Caret.setBlinkRate(Duration)public javafx.util.Duration getBlinkRate()
getBlinkRate in interface Caretpublic void setBlinkRate(javafx.util.Duration rate)
setBlinkRate in interface Caretpublic final int getPosition()
getPosition in interface Caretpublic final javafx.beans.value.ObservableValue<java.lang.Integer> positionProperty()
CaretpositionProperty in interface CaretgetPosition()public final int getParagraphIndex()
getParagraphIndex in interface Caretpublic final javafx.beans.value.ObservableValue<java.lang.Integer> paragraphIndexProperty()
CaretparagraphIndexProperty in interface CaretgetParagraphIndex()public final java.util.OptionalInt getLineIndex()
getLineIndex in interface Caretpublic final javafx.beans.value.ObservableValue<java.util.OptionalInt> lineIndexProperty()
CaretlineIndexProperty in interface CaretgetLineIndex()public final int getColumnPosition()
getColumnPosition in interface Caretpublic final javafx.beans.value.ObservableValue<java.lang.Integer> columnPositionProperty()
CaretcolumnPositionProperty in interface CaretgetColumnPosition()public final Caret.CaretVisibility getShowCaret()
getShowCaret in interface Caretpublic final void setShowCaret(Caret.CaretVisibility value)
setShowCaret in interface Caretpublic final org.reactfx.value.Var<Caret.CaretVisibility> showCaretProperty()
CaretCaret.CaretVisibility.AUTO.showCaretProperty in interface CaretgetShowCaret(),
setShowCaret(Caret.CaretVisibility)public final java.util.Optional<javafx.geometry.Bounds> getCaretBounds()
getCaretBounds in interface Caretpublic final javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> caretBoundsProperty()
CaretOptional.empty() if caret is not visible
in the viewport.caretBoundsProperty in interface CaretgetCaretBounds()public final void clearTargetOffset()
CaretclearTargetOffset in interface Caretpublic final org.fxmisc.richtext.ParagraphBox.CaretOffsetX getTargetOffset()
CaretgetTargetOffset in interface Caretpublic final boolean isBeingUpdated()
isBeingUpdated in interface Caretpublic final org.reactfx.SuspendableNo beingUpdatedProperty()
beingUpdatedProperty in interface Caretpublic GenericStyledArea<?,?,?> getArea()
Caretpublic final java.lang.String getCaretName()
CaretgetCaretName in interface Caretpublic void moveTo(int paragraphIndex,
int columnPosition)
CaretCaretSelectionBind,
it displaces the caret from the selection by positioning only the caret to the new location without
also affecting the CaretSelectionBind.getAnchorPosition() bounded selection's anchor} or the
Selection.getRange() selection}.
Caution: see TextEditingArea.getAbsolutePosition(int, int) to
know how the column index argument can affect the returned position.
public void moveTo(int position)
CaretCaretSelectionBind,
it displaces the caret from the selection by positioning only the caret to the new location without
also affecting the CaretSelectionBind.getAnchorPosition() bounded selection's anchor} or the
Selection.getRange() selection}.
public void moveToParStart()
CaretmoveToParStart in interface Caretpublic void moveToParEnd()
CaretmoveToParEnd in interface Caretpublic void moveToAreaEnd()
CaretmoveToAreaEnd in interface Caretpublic void moveToNextChar()
CaretmoveToNextChar in interface Caretpublic void moveToPrevChar()
CaretmoveToPrevChar in interface Caretpublic void moveBreaksBackwards(int numOfBreaks,
java.text.BreakIterator breakIterator)
CaretmoveBreaksBackwards in interface Caretpublic void moveBreaksForwards(int numOfBreaks,
java.text.BreakIterator breakIterator)
CaretmoveBreaksForwards in interface Caretpublic int compareTo(CaretNode o)
compareTo in interface java.lang.Comparable<CaretNode>public void dispose()
Caretpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class javafx.scene.shape.Pathpublic java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getCssMetaData()
getCssMetaData in class javafx.scene.shape.Shapepublic static java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getClassCssMetaData()