Package com.levigo.jadice.document
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
-
Method Details
-
getBounds
Rectangle2D getBounds()returns the overall bounds of the selection. Note that there is no guarantee that the returnedRectangle2D
is the smallest bounding box that encloses theShape
s (returned bygetShape()
, only that theShape
s lie entirely within the indicatedRectangle2D
.- 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 thePage
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
-