Class CaretInfo
java.lang.Object
javafx.scene.text.CaretInfo
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Rectangle2D
getSegmentAt
(int index) Returns the geometry of the segment at the specified index.abstract int
Returns the number of segments representing the caret.
-
Constructor Details
-
CaretInfo
protected CaretInfo()Constructor for subclasses to call.
-
-
Method Details
-
getSegmentCount
public abstract int getSegmentCount()Returns the number of segments representing the caret.- Returns:
- the number of segments representing the caret
-
getSegmentAt
Returns the geometry of the segment at the specified index.- Parameters:
index
- the line index- Returns:
- the bounds of the caret segment
- Throws:
IndexOutOfBoundsException
- if the index is out of range(index < 0 || index >= getSegmentCount())
-