Class SelectionSegment

java.lang.Object
jfx.incubator.scene.control.richtext.SelectionSegment

public final class SelectionSegment extends Object
Text selection segment, comprised of the selection anchor and the caret positions. The main purpose of this class is to enable tracking of selection changes as a single entity.
Since:
24
  • Constructor Details Link icon

    • SelectionSegment Link icon

      public SelectionSegment(TextPos anchor, TextPos caret)
      Constructs the selection segment.
      Parameters:
      anchor - the anchor position, must not be null
      caret - the caret position, must not be null
  • Method Details Link icon

    • getAnchor Link icon

      public final TextPos getAnchor()
      Returns the selection anchor position.
      Returns:
      the anchor position
    • getCaret Link icon

      public final TextPos getCaret()
      Returns the caret position.
      Returns:
      the caret position
    • getMin Link icon

      public final TextPos getMin()
      Returns the position which is closer to the start of the document.
      Returns:
      the text position
    • getMax Link icon

      public TextPos getMax()
      Returns the position which is closer to the end of the document.
      Returns:
      the text position
    • isCollapsed Link icon

      public boolean isCollapsed()
      Returns true if the anchor and the caret are at the same position.
      Returns:
      true if the anchor and the caret are at the same position