Interface SideDecorator
- All Known Implementing Classes:
LineNumberDecorator
public interface SideDecorator
RichTextArea. The side decorations Nodes are added to either left or right side of each paragraph. Each side node will be resized to the height of the corresponding paragraph. The width of all the side nodes, in order to avoid complicated layout process, would be determined by the following process:
- if
getPrefWidth(double)method returns a value greater than 0, that will be the width of all the side nodes. - otherwise, the
getMeasurementNode(int)method is called. The preferred width of theNodereturned will be used to size all other nodes for that side.
- Since:
- 24
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
Node |
getMeasurementNode |
Returns the special measurement node to use for sizing the pane that holds the side decorations. |
Node |
getNode |
Creates a Node to be added to the layout to the right or to the left of the given paragraph. |
double |
getPrefWidth |
Returns the width to size the pane which hosts the side decoration Nodes. |
Method Details
getPrefWidth
double getPrefWidth(double viewWidth)
Nodes. When return value is 0 or negative, an alternative method to size the side pane hosting the decoration will be used: a special measurement Node will be obtained via getMeasurementNode(int), whose preferred width will be used instead.
- Parameters:
-
viewWidth- width of the view - Returns:
- the preferred width
getMeasurementNode
Node getMeasurementNode(int index)
getPrefWidth(double) returns 0 or negative value. The measurement node will not be displayed and will be discarded.- Parameters:
-
index- the paragraph index at the top of the viewable area - Returns:
- the measurement
Node
getNode
Node getNode(int index)
null.- Parameters:
-
index- the paragraph index - Returns:
- new instance
Node
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.