HighlightTextFlows of a rendered document.
A drag selects from the anchor to the current position in document order (the order in which the flows appear in the scene graph). Each affected flow paints its part of the selection; the selected string joins the per-flow parts with line breaks.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private @Nullable TextSelection. | |
| private @Nullable TextSelection. | |
| private final List | |
| private boolean | |
| private final Region |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private Bounds | |
| public void | |
| private void | |
| private void | |
| private static int | |
| private static double | |
| public Optional | getSelectedText()
Returns: the selected text, joined with line breaks at block boundaries; empty if nothing is selected |
| private boolean | |
| public boolean | isPressOnSelection()
Returns: whether the current mouse press started on an existing selection (the consumer may start a drag-and-drop of the selected content then) |
| private static TextSelection. | |
| private static TextSelection. | |
| private @Nullable TextSelection. | positionAt(double x, double y)
Maps a point (in root coordinates) to the nearest flow and character index. |
| anchor | back to summary |
|---|---|
| private @Nullable TextSelection. | |
| extent | back to summary |
|---|---|
| private @Nullable TextSelection. | |
| flows | back to summary |
|---|---|
| private final List<HighlightTextFlow> flows | |
| pressOnSelection | back to summary |
|---|---|
| private boolean pressOnSelection | |
| root | back to summary |
|---|---|
| private final Region root | |
| TextSelection | back to summary |
|---|---|
| public TextSelection(Region root) | |
| applySelection | back to summary |
|---|---|
| private void applySelection() | |
| boundsInRoot | back to summary |
|---|---|
| private Bounds boundsInRoot(HighlightTextFlow flow) | |
| clear | back to summary |
|---|---|
| public void clear() | |
| collectFlows | back to summary |
|---|---|
| private void collectFlows() | |
| collectFlows | back to summary |
|---|---|
| private void collectFlows(Parent parent) | |
| compare | back to summary |
|---|---|
| private static int compare(TextSelection. | |
| distanceOutside | back to summary |
|---|---|
| private static double distanceOutside(double value, double min, double max) | |
| getSelectedText | back to summary |
|---|---|
| public Optional | |
| isInsideSelection | back to summary |
|---|---|
| private boolean isInsideSelection(@Nullable TextSelection. | |
| isPressOnSelection | back to summary |
|---|---|
public boolean isPressOnSelection()
| |
| max | back to summary |
|---|---|
| private static TextSelection. | |
| min | back to summary |
|---|---|
| private static TextSelection. | |
| positionAt | back to summary |
|---|---|
| private @Nullable TextSelection. Maps a point (in root coordinates) to the nearest flow and character index. | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | charIndex
Record Component accessed by charIndex(). |
| private final int | flowIndex
Record Component accessed by flowIndex(). |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public final int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| charIndex | back to summary |
|---|---|
| private final int charIndex Record Component accessed by charIndex(). | |
| flowIndex | back to summary |
|---|---|
| private final int flowIndex Record Component accessed by flowIndex(). | |
| FlowPosition | back to summary |
|---|---|
| private FlowPosition(int flowIndex, int charIndex) | |
| charIndex | back to summary |
|---|---|
| public int charIndex() Record Component getter of charIndex. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| flowIndex | back to summary |
|---|---|
| public int flowIndex() Record Component getter of flowIndex. | |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |