APIdia Launch Partner
Top Description Constructors Methods
javafx.scene.text

public abstract sealed Class LayoutInfo

extends Object
permits PrismLayoutInfo
Class Inheritance
Known Direct Subclasses
com.sun.javafx.text.PrismLayoutInfo
Imports
java.util.List, javafx.geometry.Rectangle2D, com.sun.javafx.text.PrismLayoutInfo

Holds a snapshot of the text layout geometry in a Text or a TextFlow node, such as break up of the text into lines, as well as other shapes derived from the layout (selection, underline, etc.).

The information in this object is valid until the next layout cycle.

Since
25

Constructor Summary

AccessConstructor and Description
protected
LayoutInfo()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
public abstract CaretInfo

Returns:

the CaretInfo object
caretInfoAt
(int
the character index
charIndex
,
boolean
whether the caret is biased on the leading edge of the character
leading
)

Returns the information related to the caret at the specified character index and the character bias.

public abstract Rectangle2D

Returns:

the layout bounds
getLogicalBounds
(boolean
determines whether the line spacing after last text line should be included
includeLineSpacing
)

Returns the logical bounds of the layout.

public abstract List<Rectangle2D>

Returns:

the immutable list of Rectangle2D objects
getSelectionGeometry
(int
the start offset
start
,
int
the end offset
end
,
boolean
determines whether the result includes the line spacing
includeLineSpacing
)

Returns the geometry of the text selection, as an immutable list of Rectangle2D objects, for the given start and end offsets.

public abstract List<Rectangle2D>

Returns:

the immutable list of Rectangle2D objects
getStrikeThroughGeometry
(int
the start offset
start
,
int
the end offset
end
)

Returns the geometry of the strike-through shape, as an immutable list of Rectangle2D objects, for the given start and end offsets.

public abstract TextLineInfo

Returns:

the TextLineInfo object
getTextLine
(int
the line index
index
,
boolean
determines whether the result includes the line spacing
includeLineSpacing
)

Returns the TextLineInfo object which contains information about the text line at index index.

public abstract int

Returns:

the number of text lines
getTextLineCount
()

Returns the number of text lines in the layout.

public abstract List<TextLineInfo>

Returns:

the immutable list of TextLineInfo objects
getTextLines
(boolean
determines whether the result includes the line spacing
includeLineSpacing
)

Returns the immutable list of text lines in the layout.

public abstract List<Rectangle2D>

Returns:

the immutable list of Rectangle2D objects
getUnderlineGeometry
(int
the start offset
start
,
int
the end offset
end
)

Returns the geometry of the underline shape, as an immutable list of Rectangle2D objects, for the given start and end offsets.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LayoutInfoback to summary
protected LayoutInfo()

Constructor for subclasses to call.

Method Detail

caretInfoAtback to summary
public abstract CaretInfo caretInfoAt(int charIndex, boolean leading)

Returns the information related to the caret at the specified character index and the character bias.

Parameters
charIndex:int

the character index

leading:boolean

whether the caret is biased on the leading edge of the character

Returns:CaretInfo

the CaretInfo object

getLogicalBoundsback to summary
public abstract Rectangle2D getLogicalBounds(boolean includeLineSpacing)

Returns the logical bounds of the layout. Depending on includeLineSpacing, the return value may include the line spacing after the last line of text.

Parameters
includeLineSpacing:boolean

determines whether the line spacing after last text line should be included

Returns:Rectangle2D

the layout bounds

getSelectionGeometryback to summary
public abstract List<Rectangle2D> getSelectionGeometry(int start, int end, boolean includeLineSpacing)

Returns the geometry of the text selection, as an immutable list of Rectangle2D objects, for the given start and end offsets.

Parameters
start:int

the start offset

end:int

the end offset

includeLineSpacing:boolean

determines whether the result includes the line spacing

Returns:List<Rectangle2D>

the immutable list of Rectangle2D objects

getStrikeThroughGeometryback to summary
public abstract List<Rectangle2D> getStrikeThroughGeometry(int start, int end)

Returns the geometry of the strike-through shape, as an immutable list of Rectangle2D objects, for the given start and end offsets.

Parameters
start:int

the start offset

end:int

the end offset

Returns:List<Rectangle2D>

the immutable list of Rectangle2D objects

getTextLineback to summary
public abstract TextLineInfo getTextLine(int index, boolean includeLineSpacing)

Returns the TextLineInfo object which contains information about the text line at index index.

Parameters
index:int

the line index

includeLineSpacing:boolean

determines whether the result includes the line spacing

Returns:TextLineInfo

the TextLineInfo object

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

Returns the number of text lines in the layout.

Returns:int

the number of text lines

getTextLinesback to summary
public abstract List<TextLineInfo> getTextLines(boolean includeLineSpacing)

Returns the immutable list of text lines in the layout.

Parameters
includeLineSpacing:boolean

determines whether the result includes the line spacing

Returns:List<TextLineInfo>

the immutable list of TextLineInfo objects

getUnderlineGeometryback to summary
public abstract List<Rectangle2D> getUnderlineGeometry(int start, int end)

Returns the geometry of the underline shape, as an immutable list of Rectangle2D objects, for the given start and end offsets.

Parameters
start:int

the start offset

end:int

the end offset

Returns:List<Rectangle2D>

the immutable list of Rectangle2D objects