svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / feature / FeatureReferenceSelection.java @ 24346
History | View | Annotate | Download (3.21 KB)
1 | 23928 | cordinyana | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Gobernment (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 | package org.gvsig.fmap.data.feature; |
||
28 | |||
29 | import java.util.Iterator; |
||
30 | |||
31 | import org.gvsig.fmap.data.DataSelection; |
||
32 | 24346 | cordinyana | import org.gvsig.fmap.data.exceptions.DataException; |
33 | import org.gvsig.tools.observer.Observer; |
||
34 | 24268 | jjdelcerro | import org.gvsig.tools.observer.WeakReferencingObservable; |
35 | 24079 | jjdelcerro | import org.gvsig.tools.persistence.Persistent; |
36 | 23928 | cordinyana | |
37 | /**
|
||
38 | * Interface to manage selection of objects from an undetermined set. Allows to
|
||
39 | * add and remove values from the selection, as well as reversing the selection.
|
||
40 | 24079 | jjdelcerro | *
|
41 | 23928 | cordinyana | * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
|
42 | */
|
||
43 | public interface FeatureReferenceSelection extends DataSelection, Observer, |
||
44 | 24268 | jjdelcerro | WeakReferencingObservable, Persistent { |
45 | 23928 | cordinyana | |
46 | /**
|
||
47 | * Adds a feature to the selection.
|
||
48 | 24079 | jjdelcerro | *
|
49 | 23928 | cordinyana | * @param reference
|
50 | * the selected feature reference
|
||
51 | * @return true if the feature was not selected before selecting it
|
||
52 | */
|
||
53 | boolean select(FeatureReference reference);
|
||
54 | |||
55 | /**
|
||
56 | * Removes a feature from the selection.
|
||
57 | 24079 | jjdelcerro | *
|
58 | 23928 | cordinyana | * @param reference
|
59 | * the deselected feature reference
|
||
60 | * @return true if the feature was selected before deselecting it
|
||
61 | */
|
||
62 | boolean deselect(FeatureReference reference);
|
||
63 | |||
64 | /**
|
||
65 | * Selects all values.
|
||
66 | 24346 | cordinyana | *
|
67 | * @throws DataException
|
||
68 | * if there is an error selecting all values
|
||
69 | 23928 | cordinyana | */
|
70 | 24346 | cordinyana | void selectAll() throws DataException; |
71 | 23928 | cordinyana | |
72 | /**
|
||
73 | * Deselects all values.
|
||
74 | 24346 | cordinyana | *
|
75 | * @throws DataException
|
||
76 | * if there is an error deselecting all values
|
||
77 | 23928 | cordinyana | */
|
78 | 24346 | cordinyana | void deselectAll() throws DataException; |
79 | 23928 | cordinyana | |
80 | /**
|
||
81 | * Returns if a feature is selected.
|
||
82 | 24079 | jjdelcerro | *
|
83 | 23928 | cordinyana | * @param reference
|
84 | * to check
|
||
85 | * @return if it is selected
|
||
86 | */
|
||
87 | boolean isSelected(FeatureReference reference);
|
||
88 | |||
89 | /**
|
||
90 | * Reverses the selection. Currently selected objects will become the not
|
||
91 | * selected ones, so any other object will be a selected one.
|
||
92 | */
|
||
93 | void reverse();
|
||
94 | |||
95 | /**
|
||
96 | * Returns the number of selected values.
|
||
97 | 24079 | jjdelcerro | *
|
98 | 23928 | cordinyana | * @return the number of selected values
|
99 | */
|
||
100 | long getSelectedCount();
|
||
101 | |||
102 | /**
|
||
103 | * Returns an unmodifiable Iterator of selected feature references.
|
||
104 | 24079 | jjdelcerro | *
|
105 | 23928 | cordinyana | * @return the iterator of selected feature references
|
106 | */
|
||
107 | Iterator referenceIterator();
|
||
108 | } |