Top Description Inners Fields Constructors Methods
org.fxmisc.richtext

pack-priv Class ParagraphBox<PS, SEG, S>

extends Region
Class Inheritance
Type Parameters
<PS>
paragraph style type
<SEG>
segment type
<S>
segment style type
Static Imports
org.reactfx.util.Tuples.*

Node responsible for rendering a single paragraph in the viewport, which may include a paragraph graphic factory (an IntFunction that takes the paragraph's index as an argument and returns a node), and definitely includes the segments of the paragraph itself. The paragraph graphic factory is often used to display the paragraph's line number.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ParagraphBox.CaretOffsetX

An opaque class representing horizontal caret offset.

Field Summary

Modifier and TypeField and Description
private final Val<Node>
private final ObjectProperty<IntFunction<? extends Node>>
pack-priv final DoubleProperty
private final Var<Integer>
private final Val<Boolean>
private final ParagraphText<PS, SEG, S>
private final BooleanProperty
Inherited from javafx.scene.layout.Region:
USE_COMPUTED_SIZEUSE_PREF_SIZE

Constructor Summary

AccessConstructor and Description
pack-priv
ParagraphBox(Paragraph<PS, SEG, S> par, BiConsumer<TextFlow, PS> applyParagraphStyle, Function<StyledSegment<SEG, S>, Node> nodeFactory)

Method Summary

Modifier and TypeMethod and Description
public final ObservableSet<CaretNode>
protected double
computeMinWidth(double ignoredHeight)

Overrides javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region.

protected double
computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.

protected double
computePrefWidth(double ignoredHeight)

Overrides javafx.scene.layout.Region.computePrefWidth.

Computes the preferred width of this region for the given height.

pack-priv void
public <T extends Node & Caret> Bounds
getCaretBounds(T caret)

public <T extends Node & Caret> Bounds
public <T extends Node & Caret> ParagraphBox.CaretOffsetX
getCaretOffsetX(T caret)

public int
public int
public int
getCurrentLineIndex(int position)

public int
pack-priv Node
pack-priv double
public int
public int
pack-priv Paragraph<PS, SEG, S>
public Bounds
getRangeBoundsOnScreen(int from, int to)

public Optional<Bounds>
getSelectionBoundsOnScreen(Selection<PS, SEG, S> selection)

public ObjectProperty<IntFunction<? extends Node>>
public Property<Paint>
public CharacterHit
hit(Point2D pos)

public CharacterHit
hit(double x, double y)

pack-priv CharacterHit

Returns:

hit info for the given x and y coordinates
hitText
(ParagraphBox.CaretOffsetX x, double y)

Hits the embedded TextFlow at the given x and y offset.

pack-priv CharacterHit

Returns:

hit info for the given line and x coordinate
hitTextLine
(ParagraphBox.CaretOffsetX
x coordinate relative to the embedded TextFlow.
x
,
int
index of the line in the embedded TextFlow.
line
)

Hits the embedded TextFlow at the given line and x offset.

public Val<Integer>
public boolean
protected void
layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

public final ObservableMap<Selection<PS, SEG, S>, SelectionPath>
public void
setIndex(int index)

public EventStream<Either<Tuple2<Point2D, Integer>, Object>>
public String
toString()

Overrides javafx.scene.Node.toString.

Returns a string representation for the object.

public BooleanProperty
Inherited from javafx.scene.layout.Region:
backgroundPropertyborderPropertycacheShapePropertycenterShapePropertycomputeMaxHeightcomputeMaxWidthcomputeMinHeightgetBackgroundgetBordergetClassCssMetaDatagetCssMetaDatagetHeightgetInsetsgetMaxHeightgetMaxWidthgetMinHeightgetMinWidthgetOpaqueInsetsgetPaddinggetPrefHeightgetPrefWidthgetShapegetUserAgentStylesheetgetWidthheightPropertyinsetsPropertyisCacheShapeisCenterShapeisResizableisScaleShapeisSnapToPixellayoutInArealayoutInArealayoutInArealayoutInAreamaxHeightmaxHeightPropertymaxWidthmaxWidthPropertyminHeightminHeightPropertyminWidthminWidthPropertyopaqueInsetsPropertypaddingPropertypositionInAreapositionInAreaprefHeightprefHeightPropertyprefWidthprefWidthPropertyresizescaleShapePropertysetBackgroundsetBordersetCacheShapesetCenterShapesetHeightsetMaxHeightsetMaxSizesetMaxWidthsetMinHeightsetMinSizesetMinWidthsetOpaqueInsetssetPaddingsetPrefHeightsetPrefSizesetPrefWidthsetScaleShapesetShapesetSnapToPixelsetWidthshapePropertysnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYsnapToPixelPropertywidthProperty

Field Detail

graphicback to summary
private final Val<Node> graphic
graphicFactoryback to summary
private final ObjectProperty<IntFunction<? extends Node>> graphicFactory
graphicOffsetback to summary
pack-priv final DoubleProperty graphicOffset
indexback to summary
private final Var<Integer> index
isFoldedback to summary
private final Val<Boolean> isFolded
textback to summary
private final ParagraphText<PS, SEG, S> text
wrapTextback to summary
private final BooleanProperty wrapText

Constructor Detail

ParagraphBoxback to summary
pack-priv ParagraphBox(Paragraph<PS, SEG, S> par, BiConsumer<TextFlow, PS> applyParagraphStyle, Function<StyledSegment<SEG, S>, Node> nodeFactory)

Method Detail

caretsPropertyback to summary
public final ObservableSet<CaretNode> caretsProperty()
computeMinWidthback to summary
protected double computeMinWidth(double ignoredHeight)

Overrides javafx.scene.layout.Region.computeMinWidth.

Doc from javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region. Returns the sum of the left and right insets by default. region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Annotations
@Override
computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Doc from javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double ignoredHeight)

Overrides javafx.scene.layout.Region.computePrefWidth.

Doc from javafx.scene.layout.Region.computePrefWidth.

Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Annotations
@Override
disposeback to summary
pack-priv void dispose()
getCaretBoundsback to summary
public <T extends Node & Caret> Bounds getCaretBounds(T caret)
getCaretBoundsOnScreenback to summary
public <T extends Node & Caret> Bounds getCaretBoundsOnScreen(T caret)
getCaretOffsetXback to summary
public <T extends Node & Caret> ParagraphBox.CaretOffsetX getCaretOffsetX(T caret)
getCurrentLineEndPositionback to summary
public int getCurrentLineEndPosition(Caret caret)
getCurrentLineIndexback to summary
public int getCurrentLineIndex(Caret caret)
getCurrentLineIndexback to summary
public int getCurrentLineIndex(int position)
getCurrentLineStartPositionback to summary
public int getCurrentLineStartPosition(Caret caret)
getGraphicback to summary
pack-priv Node getGraphic()
getGraphicPrefWidthback to summary
pack-priv double getGraphicPrefWidth()
getIndexback to summary
public int getIndex()
getLineCountback to summary
public int getLineCount()
getParagraphback to summary
pack-priv Paragraph<PS, SEG, S> getParagraph()
getRangeBoundsOnScreenback to summary
public Bounds getRangeBoundsOnScreen(int from, int to)
getSelectionBoundsOnScreenback to summary
public Optional<Bounds> getSelectionBoundsOnScreen(Selection<PS, SEG, S> selection)
graphicFactoryPropertyback to summary
public ObjectProperty<IntFunction<? extends Node>> graphicFactoryProperty()
highlightTextFillPropertyback to summary
public Property<Paint> highlightTextFillProperty()
hitback to summary
public CharacterHit hit(Point2D pos)
hitback to summary
public CharacterHit hit(double x, double y)
hitTextback to summary
pack-priv CharacterHit hitText(ParagraphBox.CaretOffsetX x, double y)

Hits the embedded TextFlow at the given x and y offset.

Returns:CharacterHit

hit info for the given x and y coordinates

hitTextLineback to summary
pack-priv CharacterHit hitTextLine(ParagraphBox.CaretOffsetX x, int line)

Hits the embedded TextFlow at the given line and x offset.

Parameters
x:ParagraphBox.CaretOffsetX

x coordinate relative to the embedded TextFlow.

line:int

index of the line in the embedded TextFlow.

Returns:CharacterHit

hit info for the given line and x coordinate

indexPropertyback to summary
public Val<Integer> indexProperty()
isFoldedback to summary
public boolean isFolded()
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Doc from javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

Subclasses should override this function to layout content as needed.

Annotations
@Override
selectionsPropertyback to summary
public final ObservableMap<Selection<PS, SEG, S>, SelectionPath> selectionsProperty()
setIndexback to summary
public void setIndex(int index)
stationaryIndicesback to summary
public EventStream<Either<Tuple2<Point2D, Integer>, Object>> stationaryIndices(Duration delay)
toStringback to summary
public String toString()

Overrides javafx.scene.Node.toString.

Doc from javafx.scene.Node.toString.

Returns a string representation for the object.

Annotations
@Override
wrapTextPropertyback to summary
public BooleanProperty wrapTextProperty()
org.fxmisc.richtext back to summary

public Class ParagraphBox.CaretOffsetX

extends Object
Class Inheritance

An opaque class representing horizontal caret offset. Although it is just a wrapper around double, its purpose is to increase type safety.

Field Summary

Modifier and TypeField and Description
private final double

Constructor Summary

AccessConstructor and Description
private
CaretOffsetX(double value)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

valueback to summary
private final double value

Constructor Detail

CaretOffsetXback to summary
private CaretOffsetX(double value)