root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureReferenceSelection.java @ 38106
History | View | Annotate | Download (3.27 KB)
1 | 23928 | cordinyana | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | 31544 | cordinyana | * of the Valencian Government (CIT)
|
5 | 24079 | jjdelcerro | *
|
6 | 23928 | cordinyana | * This program is free software; you can redistribute it and/or
|
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | 24079 | jjdelcerro | *
|
11 | 23928 | cordinyana | * This program is distributed in the hope that it will be useful,
|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | 24079 | jjdelcerro | *
|
16 | 23928 | cordinyana | * You should have received a copy of the GNU General Public License
|
17 | * along with this program; if not, write to the Free Software
|
||
18 | 24079 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | 23928 | cordinyana | * MA 02110-1301, USA.
|
20 | 24079 | jjdelcerro | *
|
21 | 23928 | cordinyana | */
|
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 {DiSiD Technologies} {Implement data selection}
|
||
26 | */
|
||
27 | 24496 | jmvivo | package org.gvsig.fmap.dal.feature; |
28 | 23928 | cordinyana | |
29 | import java.util.Iterator; |
||
30 | |||
31 | 24496 | jmvivo | import org.gvsig.fmap.dal.DataSelection; |
32 | 24505 | jmvivo | import org.gvsig.fmap.dal.exception.DataException; |
33 | 33378 | cordinyana | import org.gvsig.tools.observer.ComplexObservable; |
34 | 24346 | cordinyana | import org.gvsig.tools.observer.Observer; |
35 | 24268 | jjdelcerro | import org.gvsig.tools.observer.WeakReferencingObservable; |
36 | 24079 | jjdelcerro | import org.gvsig.tools.persistence.Persistent; |
37 | 23928 | cordinyana | |
38 | /**
|
||
39 | * Interface to manage selection of objects from an undetermined set. Allows to
|
||
40 | * add and remove values from the selection, as well as reversing the selection.
|
||
41 | 24079 | jjdelcerro | *
|
42 | 23928 | cordinyana | * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
|
43 | */
|
||
44 | public interface FeatureReferenceSelection extends DataSelection, Observer, |
||
45 | 33378 | cordinyana | WeakReferencingObservable, ComplexObservable, Persistent { |
46 | 23928 | cordinyana | |
47 | /**
|
||
48 | * Adds a feature to the selection.
|
||
49 | 24079 | jjdelcerro | *
|
50 | 23928 | cordinyana | * @param reference
|
51 | * the selected feature reference
|
||
52 | * @return true if the feature was not selected before selecting it
|
||
53 | */
|
||
54 | boolean select(FeatureReference reference);
|
||
55 | |||
56 | /**
|
||
57 | * Removes a feature from the selection.
|
||
58 | 24079 | jjdelcerro | *
|
59 | 23928 | cordinyana | * @param reference
|
60 | * the deselected feature reference
|
||
61 | * @return true if the feature was selected before deselecting it
|
||
62 | */
|
||
63 | boolean deselect(FeatureReference reference);
|
||
64 | |||
65 | /**
|
||
66 | * Selects all values.
|
||
67 | 24346 | cordinyana | *
|
68 | * @throws DataException
|
||
69 | * if there is an error selecting all values
|
||
70 | 23928 | cordinyana | */
|
71 | 24346 | cordinyana | void selectAll() throws DataException; |
72 | 23928 | cordinyana | |
73 | /**
|
||
74 | * Deselects all values.
|
||
75 | 24346 | cordinyana | *
|
76 | * @throws DataException
|
||
77 | * if there is an error deselecting all values
|
||
78 | 23928 | cordinyana | */
|
79 | 24346 | cordinyana | void deselectAll() throws DataException; |
80 | 23928 | cordinyana | |
81 | /**
|
||
82 | * Returns if a feature is selected.
|
||
83 | 24079 | jjdelcerro | *
|
84 | 23928 | cordinyana | * @param reference
|
85 | * to check
|
||
86 | * @return if it is selected
|
||
87 | */
|
||
88 | boolean isSelected(FeatureReference reference);
|
||
89 | |||
90 | /**
|
||
91 | * Reverses the selection. Currently selected objects will become the not
|
||
92 | * selected ones, so any other object will be a selected one.
|
||
93 | */
|
||
94 | void reverse();
|
||
95 | |||
96 | /**
|
||
97 | * Returns the number of selected values.
|
||
98 | 24079 | jjdelcerro | *
|
99 | 23928 | cordinyana | * @return the number of selected values
|
100 | */
|
||
101 | long getSelectedCount();
|
||
102 | |||
103 | /**
|
||
104 | * Returns an unmodifiable Iterator of selected feature references.
|
||
105 | 24079 | jjdelcerro | *
|
106 | 23928 | cordinyana | * @return the iterator of selected feature references
|
107 | */
|
||
108 | Iterator referenceIterator();
|
||
109 | } |