Top Description Constructors Methods
javafx.scene.text

public abstract sealed Class CaretInfo

extends Object
permits PrismCaretInfo
Class Inheritance
Known Direct Subclasses
com.sun.javafx.text.PrismCaretInfo
Imports
javafx.geometry.Rectangle2D, com.sun.javafx.text.PrismCaretInfo

Provides the information associated with the caret.

Typically, the caret is represented by a single vertical line which visually indicates the position within the text. In some cases, where the caret is positioned between left-to-right and right-to-left text, two line segments will be shown, indicating the insertion position for both left-to-right and right-to-left character.

Since
25

Constructor Summary

AccessConstructor and Description
protected
CaretInfo()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract Rectangle2D

Returns:

the bounds of the caret segment
getSegmentAt
(int
the line index
index
)

Returns the geometry of the segment at the specified index.

public abstract int

Returns:

the number of segments representing the caret
getSegmentCount
()

Returns the number of segments representing the caret.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CaretInfoback to summary
protected CaretInfo()

Constructor for subclasses to call.

Method Detail

getSegmentAtback to summary
public abstract Rectangle2D getSegmentAt(int index)

Returns the geometry of the segment at the specified index.

Parameters
index:int

the line index

Returns:Rectangle2D

the bounds of the caret segment

Exceptions
IndexOutOfBoundsException:
if the index is out of range (index < 0 || index >= getSegmentCount())
getSegmentCountback to summary
public abstract int getSegmentCount()

Returns the number of segments representing the caret.

Returns:int

the number of segments representing the caret