public class SelectionImpl<PS,SEG,S> extends java.lang.Object implements Selection<PS,SEG,S>, java.lang.Comparable<SelectionImpl<PS,SEG,S>>
Selection
.Type | Property and Description |
---|---|
javafx.beans.value.ObservableValue<java.lang.Boolean> |
beingUpdated |
javafx.beans.value.ObservableValue<java.lang.Integer> |
endColumnPosition |
javafx.beans.value.ObservableValue<java.lang.Integer> |
endParagraphIndex |
javafx.beans.value.ObservableValue<java.lang.Integer> |
endPosition |
javafx.beans.value.ObservableValue<java.lang.Integer> |
length
The length of the selection
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
paragraphSpan
The number of paragraphs the selection spans
|
javafx.beans.value.ObservableValue<javafx.scene.control.IndexRange> |
range
The start and end positions in the area as an
IndexRange . |
javafx.beans.value.ObservableValue<StyledDocument<PS,SEG,S>> |
selectedDocument |
javafx.beans.value.ObservableValue<java.lang.String> |
selectedText |
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> |
selectionBounds
The selectionBoundsProperty of the selection in the Screen's coordinate system if something is selected and visible in the
viewport, or
Optional.empty() if selection is not visible in the viewport. |
javafx.beans.value.ObservableValue<java.lang.Integer> |
startColumnPosition |
javafx.beans.value.ObservableValue<java.lang.Integer> |
startParagraphIndex |
javafx.beans.value.ObservableValue<java.lang.Integer> |
startPosition |
Selection.Direction
Constructor and Description |
---|
SelectionImpl(java.lang.String name,
GenericStyledArea<PS,SEG,S> area)
Creates a selection with both the start and end position at 0.
|
SelectionImpl(java.lang.String name,
GenericStyledArea<PS,SEG,S> area,
java.util.function.Consumer<SelectionPath> configurePath)
Creates a selection with customized configuration via
configurePath
with both the start and end position at 0. |
SelectionImpl(java.lang.String name,
GenericStyledArea<PS,SEG,S> area,
int startPosition,
int endPosition)
Creates a selection
|
Modifier and Type | Method and Description |
---|---|
javafx.beans.value.ObservableValue<java.lang.Boolean> |
beingUpdatedProperty() |
int |
compareTo(SelectionImpl<PS,SEG,S> o) |
void |
configureSelectionPath(SelectionPath path)
Configures a
SelectionPath that will be used to render a portion or all of this selection
on a single paragraph. |
void |
dispose()
Disposes the selection and prevents memory leaks
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
endColumnPositionProperty() |
javafx.beans.value.ObservableValue<java.lang.Integer> |
endParagraphIndexProperty() |
javafx.beans.value.ObservableValue<java.lang.Integer> |
endPositionProperty() |
boolean |
equals(java.lang.Object obj) |
GenericStyledArea<PS,SEG,S> |
getArea()
Gets the area with which this selection is associated
|
int |
getEndColumnPosition()
Gets the value of the property endColumnPosition.
|
int |
getEndParagraphIndex()
Gets the value of the property endParagraphIndex.
|
int |
getEndPosition()
Gets the value of the property endPosition.
|
int |
getLength()
Gets the value of the property length.
|
int |
getParagraphSpan()
Gets the value of the property paragraphSpan.
|
javafx.scene.control.IndexRange |
getRange()
Gets the value of the property range.
|
StyledDocument<PS,SEG,S> |
getSelectedDocument()
Gets the value of the property selectedDocument.
|
java.lang.String |
getSelectedText()
Gets the value of the property selectedText.
|
java.util.Optional<javafx.geometry.Bounds> |
getSelectionBounds()
Gets the value of the property selectionBounds.
|
java.lang.String |
getSelectionName()
Gets the name of this selection.
|
int |
getStartColumnPosition()
Gets the value of the property startColumnPosition.
|
int |
getStartParagraphIndex()
Gets the value of the property startParagraphIndex.
|
int |
getStartPosition()
Gets the value of the property startPosition.
|
int |
hashCode() |
boolean |
isBeingUpdated() |
javafx.beans.value.ObservableValue<java.lang.Integer> |
lengthProperty()
The length of the selection
|
javafx.beans.value.ObservableValue<java.lang.Integer> |
paragraphSpanProperty()
The number of paragraphs the selection spans
|
javafx.beans.value.ObservableValue<javafx.scene.control.IndexRange> |
rangeProperty()
The start and end positions in the area as an
IndexRange . |
void |
selectAll() |
javafx.beans.value.ObservableValue<StyledDocument<PS,SEG,S>> |
selectedDocumentProperty() |
javafx.beans.value.ObservableValue<java.lang.String> |
selectedTextProperty() |
javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> |
selectionBoundsProperty()
The selectionBoundsProperty of the selection in the Screen's coordinate system if something is selected and visible in the
viewport, or
Optional.empty() if selection is not visible in the viewport. |
void |
selectParagraph(int paragraphIndex) |
void |
selectRange(int startPosition,
int endPosition)
Selects the given range.
|
void |
selectRange(int startParagraphIndex,
int startColPosition,
int endParagraphIndex,
int endColPosition)
Selects the given range.
|
void |
selectWord(int wordPositionInArea) |
javafx.beans.value.ObservableValue<java.lang.Integer> |
startColumnPositionProperty() |
javafx.beans.value.ObservableValue<java.lang.Integer> |
startParagraphIndexProperty() |
javafx.beans.value.ObservableValue<java.lang.Integer> |
startPositionProperty() |
java.lang.String |
toString() |
void |
updateEndBy(int amount,
Selection.Direction direction) |
void |
updateEndByBreaksBackward(int numOfBreaks,
java.text.BreakIterator breakIterator) |
void |
updateEndByBreaksForward(int numOfBreaks,
java.text.BreakIterator breakIterator) |
void |
updateEndTo(int position) |
void |
updateEndTo(int paragraphIndex,
int columnPosition) |
void |
updateStartBy(int amount,
Selection.Direction direction) |
void |
updateStartByBreaksBackward(int numOfBreaks,
java.text.BreakIterator breakIterator) |
void |
updateStartByBreaksForward(int numOfBreaks,
java.text.BreakIterator breakIterator) |
void |
updateStartTo(int position) |
void |
updateStartTo(int paragraphIndex,
int columnPosition) |
public final javafx.beans.value.ObservableValue<javafx.scene.control.IndexRange> rangeProperty
rangeProperty
in interface Selection<PS,SEG,S>
getRange()
public final javafx.beans.value.ObservableValue<java.lang.Integer> lengthProperty
lengthProperty
in interface Selection<PS,SEG,S>
getLength()
public final javafx.beans.value.ObservableValue<java.lang.Integer> paragraphSpanProperty
paragraphSpanProperty
in interface Selection<PS,SEG,S>
getParagraphSpan()
public final javafx.beans.value.ObservableValue<StyledDocument<PS,SEG,S>> selectedDocumentProperty
selectedDocumentProperty
in interface Selection<PS,SEG,S>
getSelectedDocument()
public final javafx.beans.value.ObservableValue<java.lang.String> selectedTextProperty
selectedTextProperty
in interface Selection<PS,SEG,S>
getSelectedText()
public final javafx.beans.value.ObservableValue<java.lang.Integer> startPositionProperty
startPositionProperty
in interface Selection<PS,SEG,S>
getStartPosition()
public final javafx.beans.value.ObservableValue<java.lang.Integer> startParagraphIndexProperty
startParagraphIndexProperty
in interface Selection<PS,SEG,S>
getStartParagraphIndex()
public final javafx.beans.value.ObservableValue<java.lang.Integer> startColumnPositionProperty
startColumnPositionProperty
in interface Selection<PS,SEG,S>
getStartColumnPosition()
public final javafx.beans.value.ObservableValue<java.lang.Integer> endPositionProperty
endPositionProperty
in interface Selection<PS,SEG,S>
getEndPosition()
public final javafx.beans.value.ObservableValue<java.lang.Integer> endParagraphIndexProperty
endParagraphIndexProperty
in interface Selection<PS,SEG,S>
getEndParagraphIndex()
public final javafx.beans.value.ObservableValue<java.lang.Integer> endColumnPositionProperty
endColumnPositionProperty
in interface Selection<PS,SEG,S>
getEndColumnPosition()
public final javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> selectionBoundsProperty
selectionBoundsProperty
in interface Selection<PS,SEG,S>
getSelectionBounds()
public final javafx.beans.value.ObservableValue<java.lang.Boolean> beingUpdatedProperty
beingUpdatedProperty
in interface Selection<PS,SEG,S>
public SelectionImpl(java.lang.String name, GenericStyledArea<PS,SEG,S> area)
public SelectionImpl(java.lang.String name, GenericStyledArea<PS,SEG,S> area, java.util.function.Consumer<SelectionPath> configurePath)
configurePath
with both the start and end position at 0.public SelectionImpl(java.lang.String name, GenericStyledArea<PS,SEG,S> area, int startPosition, int endPosition)
public final javafx.scene.control.IndexRange getRange()
public final javafx.beans.value.ObservableValue<javafx.scene.control.IndexRange> rangeProperty()
Selection
IndexRange
.rangeProperty
in interface Selection<PS,SEG,S>
getRange()
public final int getLength()
public final javafx.beans.value.ObservableValue<java.lang.Integer> lengthProperty()
Selection
lengthProperty
in interface Selection<PS,SEG,S>
getLength()
public final int getParagraphSpan()
getParagraphSpan
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> paragraphSpanProperty()
Selection
paragraphSpanProperty
in interface Selection<PS,SEG,S>
getParagraphSpan()
public final javafx.beans.value.ObservableValue<StyledDocument<PS,SEG,S>> selectedDocumentProperty()
selectedDocumentProperty
in interface Selection<PS,SEG,S>
getSelectedDocument()
public final StyledDocument<PS,SEG,S> getSelectedDocument()
getSelectedDocument
in interface Selection<PS,SEG,S>
public final java.lang.String getSelectedText()
getSelectedText
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.String> selectedTextProperty()
selectedTextProperty
in interface Selection<PS,SEG,S>
getSelectedText()
public final int getStartPosition()
getStartPosition
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> startPositionProperty()
startPositionProperty
in interface Selection<PS,SEG,S>
getStartPosition()
public final int getStartParagraphIndex()
getStartParagraphIndex
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> startParagraphIndexProperty()
startParagraphIndexProperty
in interface Selection<PS,SEG,S>
getStartParagraphIndex()
public final int getStartColumnPosition()
getStartColumnPosition
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> startColumnPositionProperty()
startColumnPositionProperty
in interface Selection<PS,SEG,S>
getStartColumnPosition()
public final int getEndPosition()
getEndPosition
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> endPositionProperty()
endPositionProperty
in interface Selection<PS,SEG,S>
getEndPosition()
public final int getEndParagraphIndex()
getEndParagraphIndex
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> endParagraphIndexProperty()
endParagraphIndexProperty
in interface Selection<PS,SEG,S>
getEndParagraphIndex()
public final int getEndColumnPosition()
getEndColumnPosition
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Integer> endColumnPositionProperty()
endColumnPositionProperty
in interface Selection<PS,SEG,S>
getEndColumnPosition()
public final java.util.Optional<javafx.geometry.Bounds> getSelectionBounds()
getSelectionBounds
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.util.Optional<javafx.geometry.Bounds>> selectionBoundsProperty()
Selection
Optional.empty()
if selection is not visible in the viewport.selectionBoundsProperty
in interface Selection<PS,SEG,S>
getSelectionBounds()
public final boolean isBeingUpdated()
isBeingUpdated
in interface Selection<PS,SEG,S>
public final javafx.beans.value.ObservableValue<java.lang.Boolean> beingUpdatedProperty()
beingUpdatedProperty
in interface Selection<PS,SEG,S>
public GenericStyledArea<PS,SEG,S> getArea()
Selection
public java.lang.String getSelectionName()
Selection
getSelectionName
in interface Selection<PS,SEG,S>
public void selectRange(int startParagraphIndex, int startColPosition, int endParagraphIndex, int endColPosition)
Selection
Caution: see TextEditingArea.getAbsolutePosition(int, int)
to
know how the column index argument can affect the returned position.
selectRange
in interface Selection<PS,SEG,S>
public void selectRange(int startPosition, int endPosition)
Selection
selectRange
in interface Selection<PS,SEG,S>
public void updateStartBy(int amount, Selection.Direction direction)
updateStartBy
in interface Selection<PS,SEG,S>
public void updateEndBy(int amount, Selection.Direction direction)
updateEndBy
in interface Selection<PS,SEG,S>
public void updateStartTo(int position)
updateStartTo
in interface Selection<PS,SEG,S>
public void updateStartTo(int paragraphIndex, int columnPosition)
updateStartTo
in interface Selection<PS,SEG,S>
public void updateStartByBreaksForward(int numOfBreaks, java.text.BreakIterator breakIterator)
updateStartByBreaksForward
in interface Selection<PS,SEG,S>
public void updateStartByBreaksBackward(int numOfBreaks, java.text.BreakIterator breakIterator)
updateStartByBreaksBackward
in interface Selection<PS,SEG,S>
public void updateEndTo(int position)
updateEndTo
in interface Selection<PS,SEG,S>
public void updateEndTo(int paragraphIndex, int columnPosition)
updateEndTo
in interface Selection<PS,SEG,S>
public void updateEndByBreaksForward(int numOfBreaks, java.text.BreakIterator breakIterator)
updateEndByBreaksForward
in interface Selection<PS,SEG,S>
public void updateEndByBreaksBackward(int numOfBreaks, java.text.BreakIterator breakIterator)
updateEndByBreaksBackward
in interface Selection<PS,SEG,S>
public void selectParagraph(int paragraphIndex)
selectParagraph
in interface Selection<PS,SEG,S>
public void selectWord(int wordPositionInArea)
selectWord
in interface Selection<PS,SEG,S>
public void configureSelectionPath(SelectionPath path)
Selection
SelectionPath
that will be used to render a portion or all of this selection
on a single paragraph. When the selection is a multi-paragraph selection, one path will be used
to render that portion of the selection on a paragraph.configureSelectionPath
in interface Selection<PS,SEG,S>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(SelectionImpl<PS,SEG,S> o)
compareTo
in interface java.lang.Comparable<SelectionImpl<PS,SEG,S>>
public java.lang.String toString()
toString
in class java.lang.Object