com.levigo.jadice.document
Interface Selection

All Known Subinterfaces:
Result

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
 Rectangle2D getBounds()
          returns the overall bounds of the selection.
 Page getPage()
          Provides the Page this selection belongs to.
 String getSelectedText()
          Provides the selected text.
 Shape getShape()
          Provides a graphical representation of this selection.
 boolean isValid()
          Return whether the selection is still valid.
 

Method Detail

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


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.