1
2
3
4
5
6
7
8
9
10
11
12 package sk.uniba.euromath.editor.textEditor;
13
14 import java.util.Collection;
15 import java.util.List;
16
17 /***
18 * TextPiece can have many small not overlapping selections within. Selection
19 * Intervals are within text piece, with end posibly one behind(0 <= start
20 * <= end < length). Every selection interval says what is selected -
21 * start and end are indexes of bounding characters
22 * <em> start included, end not included</em> in selection. Indexes are in
23 * rendered text or one behind.
24 *
25 * @author Martin Kollar 30.9.2005 Tomas Studva
26 */
27 public interface ITextPieceSelectionStatus {
28
29 /***
30 * Returns selection that relates to this text piece.
31 *
32 * @return list by copy, not overlapping Intervals within text piece.
33 */
34 public List<Interval> getSelectionIntervals();
35
36 /***
37 * Test if something is selected, but not everything
38 *
39 * @return <code>true</code>, if something is selected, but it is not
40 * fully selected
41 */
42 public boolean isPartlySelected();
43
44 /***
45 * Test if whole text is selected.
46 *
47 * @return <code>true</code>, if whole ITextPieceKeeper is selected
48 */
49 public boolean isFullySelected();
50
51 /***
52 * Sets what is selected
53 *
54 * @param intervals
55 * Collection of intervals, that are in range text and
56 * are not overlaping
57 */
58 public void setSelectionIntervals(Collection<Interval> intervals);
59
60 /***
61 * Clears the selection
62 */
63 public void clear();
64
65 /***
66 * Select whole text of keeper.
67 */
68 public void selectFull();
69
70 /***
71 * Adds interval to selection. After addition intervals are tidied to
72 * not overlap.
73 *
74 * @param interval
75 * Interval to add to selection
76 */
77 public void addSelectionInterval(Interval interval);
78
79 /***
80 * Subtracts interval from selection
81 *
82 * @param interval
83 * Interval to subtract
84 */
85 public void subtractSelectionInterval(Interval interval);
86
87 /***
88 * Makes XOR with this new interval
89 *
90 * @param intervals
91 * Interval to XOR with others
92 */
93 public void xorSelectionIntervals(Collection<Interval> intervals);
94 }