svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / FeatureReferenceSelection.java @ 40435
History | View | Annotate | Download (3.27 KB)
1 | 40435 | jjdelcerro | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
6 | * 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 | *
|
||
11 | * 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 | *
|
||
16 | * 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 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 {DiSiD Technologies} {Implement data selection}
|
||
26 | */
|
||
27 | package org.gvsig.fmap.dal.feature; |
||
28 | |||
29 | import java.util.Iterator; |
||
30 | |||
31 | import org.gvsig.fmap.dal.DataSelection; |
||
32 | import org.gvsig.fmap.dal.exception.DataException; |
||
33 | import org.gvsig.tools.observer.ComplexObservable; |
||
34 | import org.gvsig.tools.observer.Observer; |
||
35 | import org.gvsig.tools.observer.WeakReferencingObservable; |
||
36 | import org.gvsig.tools.persistence.Persistent; |
||
37 | |||
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 | *
|
||
42 | * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
|
||
43 | */
|
||
44 | public interface FeatureReferenceSelection extends DataSelection, Observer, |
||
45 | WeakReferencingObservable, ComplexObservable, Persistent { |
||
46 | |||
47 | /**
|
||
48 | * Adds a feature to the selection.
|
||
49 | *
|
||
50 | * @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 | *
|
||
59 | * @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 | *
|
||
68 | * @throws DataException
|
||
69 | * if there is an error selecting all values
|
||
70 | */
|
||
71 | void selectAll() throws DataException; |
||
72 | |||
73 | /**
|
||
74 | * Deselects all values.
|
||
75 | *
|
||
76 | * @throws DataException
|
||
77 | * if there is an error deselecting all values
|
||
78 | */
|
||
79 | void deselectAll() throws DataException; |
||
80 | |||
81 | /**
|
||
82 | * Returns if a feature is selected.
|
||
83 | *
|
||
84 | * @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 | *
|
||
99 | * @return the number of selected values
|
||
100 | */
|
||
101 | long getSelectedCount();
|
||
102 | |||
103 | /**
|
||
104 | * Returns an unmodifiable Iterator of selected feature references.
|
||
105 | *
|
||
106 | * @return the iterator of selected feature references
|
||
107 | */
|
||
108 | Iterator referenceIterator();
|
||
109 | } |