APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.jfx.incubator.scene.control.richtext

public Class SelectionHelper

extends Object
Class Inheritance
Imports
javafx.scene.shape.LineTo, .MoveTo, .PathElement

Selection Helper encapsulates the logic required to generate selection shapes. The goal is to find out which shapes correspond to the top-most and bottom-most text rows (in the presence of wrapping). These shapes (#) should be added to selection as is. Any space in between (x) would generate a single rectangular block that fills the width of the container. Additional shapes (#) will be added when necessary to make the selection appear contiguious. These shapes are positioned to the left or to the right of the selected text depending on the direction of text. TODO RTL text
----***--***####
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx
####**----------
TODO this class can be static because everything happens in the FX app thread.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface

Field Summary

Modifier and TypeField and Description
private double
private double
private double
private double
private static final double
private final double
private final FxPathBuilder
private final double
private double
private double
private double
private double

Constructor Summary

AccessConstructor and Description
public
SelectionHelper(FxPathBuilder b, double left, double right)

Method Summary

Modifier and TypeMethod and Description
private void
adjust(PathElement[] elements, double px, double py, double dx, double dy)

adjusts for line spacing and left padding

private void
determineBottomXLimits(double x, double y)

private void
determineBottomYLimits(double x, double y)

private void
determineTopXLimits(double x, double y)

private void
determineTopYLimits(double x, double y)

public void
generate(PathElement[] top, PathElement[] bottom, boolean topLTR, boolean bottomLTR, double leftPadding, double lineSpacing)

private void
generateMiddle(boolean topLTR, boolean bottomLTR, double lineSpacing)

private boolean
isNear(double a, double b)

private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bottomDnback to summary
private double bottomDn
bottomLeftback to summary
private double bottomLeft
bottomRightback to summary
private double bottomRight
bottomUpback to summary
private double bottomUp
EPSILONback to summary
private static final double EPSILON
leftback to summary
private final double left
pathBuilderback to summary
private final FxPathBuilder pathBuilder
topDnback to summary
private double topDn
topLeftback to summary
private double topLeft
topRightback to summary
private double topRight
topUpback to summary
private double topUp

Constructor Detail

SelectionHelperback to summary
public SelectionHelper(FxPathBuilder b, double left, double right)

Method Detail

adjustback to summary
private void adjust(PathElement[] elements, double px, double py, double dx, double dy)

adjusts for line spacing and left padding

determineBottomXLimitsback to summary
private void determineBottomXLimits(double x, double y)
determineBottomYLimitsback to summary
private void determineBottomYLimits(double x, double y)
determineTopXLimitsback to summary
private void determineTopXLimits(double x, double y)
determineTopYLimitsback to summary
private void determineTopYLimits(double x, double y)
generateback to summary
public void generate(PathElement[] top, PathElement[] bottom, boolean topLTR, boolean bottomLTR, double leftPadding, double lineSpacing)
generateMiddleback to summary
private void generateMiddle(boolean topLTR, boolean bottomLTR, double lineSpacing)
isNearback to summary
private boolean isNear(double a, double b)
processback to summary
private void process(PathElement[] elements, SelectionHelper.PathHandler h)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
com.sun.jfx.incubator.scene.control.richtext back to summary

protected Interface SelectionHelper.PathHandler

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
processPoint(double x, double y)

Method Detail

processPointback to summary
public void processPoint(double x, double y)