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. It stores
19 * selection Intervals within text piece(0<=start<=end<length).
20 *
21 * @author Martin Kollar 30.9.2005
22 * Tomas Studva
23 */
24 public interface ITextPieceSelectionStatus {
25
26 /***
27 * Returns selection that relates to this text piece.
28 *
29 * @return list by copy, not overlapping Intervals within text piece.
30 */
31 public List<Interval> getSelectionIntervals();
32
33 /***
34 * Test if something is selected, but not everything
35 *
36 * @return <code>true</code>, if something is selected, but it is not fully selected
37 */
38 public boolean isPartlySelected();
39
40 /***
41 * Test if whole text is selected.
42 *
43 * @return <code>true</code>, if whole ITextPieceKeeper is selected
44 */
45 public boolean isFullySelected();
46
47 /***
48 * Sets what is selected
49 *
50 * @param intervals Collection of intervals, that are in range text and are
51 * not overlaping
52 */
53 public void setSelectionIntervals(Collection<Interval> intervals);
54
55 /***
56 * Clears the selection
57 */
58 public void clear();
59
60 /***
61 * Makes logical OR of interval and this.intervals. Holding property that intervlas are
62 * not overlaping.
63 * @param interval Interval to add to selection
64 */
65 public void addSelectionInterval(Interval interval);
66
67 /***
68 * Subtracts interval from selection
69 * @param interval Interval to subtract
70 */
71 public void subtractSelectionInterval(Interval interval);
72
73 /***
74 * Makes XOR with this new interval
75 *
76 * @param intervals Interval to XOR with others
77 */
78 public void xorSelectionIntervals(Collection<Interval> intervals);
79 }