Interface Selection


public interface Selection
Provides selection information for a given Page. The Selection contains information about the position of the page this selection belongs to (getPage()), the text fragment that has been selected (getSelectedText()) and a Shape providing a visual representation of the selection (getShape()).
  • Method Summary

    Modifier and Type
    Method
    Description
    returns the overall bounds of the selection.
    Provides the Page this selection belongs to.
    Provides the selected text.
    Provides a graphical representation of this selection.
    boolean
    Return whether the selection is still valid.
  • Method Details

    • getBounds

      Rectangle2D getBounds()
      returns the overall bounds of the selection. Note that there is no guarantee that the returned Rectangle2D is the smallest bounding box that encloses the Shapes (returned by getShape(), only that the Shapes lie entirely within the indicated Rectangle2D.
      Returns:
      the bounds of the selection.
    • getShape

      Shape getShape()
      Provides a graphical representation of this selection.
      Returns:
      the Shape representing a graphical selection of the selected text
    • getPage

      Page getPage()
      Provides the Page this selection belongs to.
      Returns:
      the Page this Selection belongs to
    • getSelectedText

      String getSelectedText()
      Provides the selected text.
      Returns:
      the selected text
    • isValid

      boolean isValid()
      Return whether the selection is still valid. A selection will become invalid if the page content it refers to changes.
      Returns:
      true if the selection is valid