Spec-Zone.ru › OpenJavaFX 24

Interface SideDecorator

All Known Implementing Classes:
LineNumberDecorator
public interface SideDecorator
Provides a way to add side decorations to each paragraph in a 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 the Node returned will be used to size all other nodes for that side.
Since:
24

Method Summary

Modifier and Type Method Description
Node getMeasurementNode(int index)
Returns the special measurement node to use for sizing the pane that holds the side decorations.
Node getNode(int index)
Creates a Node to be added to the layout to the right or to the left of the given paragraph.
double getPrefWidth(double viewWidth)
Returns the width to size the pane which hosts the side decoration Nodes.

Method Details

getPrefWidth

double getPrefWidth(double viewWidth)
Returns the width to size the pane which hosts the side decoration 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)
Returns the special measurement node to use for sizing the pane that holds the side decorations. This method will only be called if 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)
Creates a Node to be added to the layout to the right or to the left of the given paragraph. This method may return null.
Parameters:
index - the paragraph index
Returns:
new instance Node

Report a bug or suggest an enhancement
Copyright © 2008, 2025, Oracle and/or its affiliates. All rights reserved.

© 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.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API