Top Description Fields Constructors Methods
jfx.incubator.scene.control.richtext

public Class LineNumberDecorator

extends Object
implements SideDecorator
Class Inheritance
All Implemented Interfaces
jfx.incubator.scene.control.richtext.SideDecorator
Imports
java.text.DecimalFormat, java.util.Arrays, javafx.geometry.Pos, javafx.scene.Node, javafx.scene.control.Label

Side decorator which shows paragraph (line) numbers. The numbering starts at line 1.
Since
24

Field Summary

Modifier and TypeField and Description
private final DecimalFormat

Constructor Summary

AccessConstructor and Description
public
LineNumberDecorator()

Creates an instance with the Western-style group separator (comma).

public
LineNumberDecorator(DecimalFormat
the DecimalFormat to use
format
)

Creates an instance using the specified DecimalFormat.

Method Summary

Modifier and TypeMethod and Description
private Node
public Node
getMeasurementNode(int
the paragraph index at the top of the viewable area
index
)

Implements jfx.incubator.scene.control.richtext.SideDecorator.getMeasurementNode.

Returns the special measurement node to use for sizing the pane that holds the side decorations.

public Node
getNode(int
the paragraph index
index
)

Implements jfx.incubator.scene.control.richtext.SideDecorator.getNode.

Creates a Node to be added to the layout to the right or to the left of the given paragraph.

public double
getPrefWidth(double
width of the view
viewWidth
)

Implements jfx.incubator.scene.control.richtext.SideDecorator.getPrefWidth.

Returns the width to size the pane which hosts the side decoration Nodes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formatback to summary
private final DecimalFormat format

Constructor Detail

LineNumberDecoratorback to summary
public LineNumberDecorator()

Creates an instance with the Western-style group separator (comma).

LineNumberDecoratorback to summary
public LineNumberDecorator(DecimalFormat format)

Creates an instance using the specified DecimalFormat.

Parameters
format:DecimalFormat

the DecimalFormat to use

Method Detail

createNodeback to summary
private Node createNode(String text)
getMeasurementNodeback to summary
public Node getMeasurementNode(int index)

Implements jfx.incubator.scene.control.richtext.SideDecorator.getMeasurementNode.

Doc from jfx.incubator.scene.control.richtext.SideDecorator.getMeasurementNode.

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:int

the paragraph index at the top of the viewable area

Returns:Node

the measurement Node

Annotations
@Override
getNodeback to summary
public Node getNode(int index)

Implements jfx.incubator.scene.control.richtext.SideDecorator.getNode.

Doc from jfx.incubator.scene.control.richtext.SideDecorator.getNode.

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:int

the paragraph index

Returns:Node

new instance Node

Annotations
@Override
getPrefWidthback to summary
public double getPrefWidth(double viewWidth)

Implements jfx.incubator.scene.control.richtext.SideDecorator.getPrefWidth.

Doc from jfx.incubator.scene.control.richtext.SideDecorator.getPrefWidth.

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:double

width of the view

Returns:double

the preferred width

Annotations
@Override