Revision 24759 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/ClearSelectionExtension.java
ClearSelectionExtension.java | ||
---|---|---|
46 | 46 |
*/ |
47 | 47 |
package com.iver.cit.gvsig; |
48 | 48 |
|
49 |
import org.gvsig.fmap.data.DataCollection; |
|
50 |
import org.gvsig.fmap.data.DataException; |
|
51 |
import org.gvsig.fmap.data.ReadException; |
|
52 |
import org.gvsig.fmap.data.feature.FeatureStore; |
|
49 |
import org.gvsig.fmap.dal.exception.DataException; |
|
50 |
import org.gvsig.fmap.dal.exception.ReadException; |
|
51 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
53 | 52 |
import org.gvsig.fmap.mapcontext.MapContext; |
54 | 53 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
55 | 54 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
... | ... | |
101 | 100 |
// } catch (ReadException e) { |
102 | 101 |
// e.printStackTrace(); |
103 | 102 |
// } |
104 |
if (featureStore.getSelection().size() != 0) { |
|
103 |
try { |
|
104 |
if (featureStore.getFeatureSelection().getSize() != 0) { |
|
105 | 105 |
refresh = true; |
106 | 106 |
} |
107 |
featureStore.getSelection().clear(); |
|
107 |
featureStore.getFeatureSelection().deselectAll(); |
|
108 |
} catch (DataException e) { |
|
109 |
NotificationManager.addError(e); |
|
110 |
} |
|
108 | 111 |
// if (refresh) { |
109 | 112 |
// table.refresh(); |
110 | 113 |
// } |
111 | 114 |
table.getModel().setModified(true); |
112 | 115 |
} |
113 |
} |
|
116 |
else { |
|
117 |
} |
|
118 |
} |
|
114 | 119 |
} |
115 | 120 |
|
116 | 121 |
|
... | ... | |
128 | 133 |
FeatureStore featureStore; |
129 | 134 |
|
130 | 135 |
featureStore = ((FLyrVect)lyr).getFeatureStore(); |
131 |
if (featureStore.getSelection().size() != 0) {
|
|
136 |
if (featureStore.getFeatureSelection().getSize() != 0) {
|
|
132 | 137 |
refresh = true; |
133 | 138 |
} |
134 |
DataCollection dc=featureStore.createSelection(); |
|
135 |
featureStore.setSelection(dc); |
|
139 |
featureStore.getFeatureSelection().deselectAll(); |
|
136 | 140 |
} catch (ReadException e) { |
137 | 141 |
e.printStackTrace(); |
138 | 142 |
} catch (DataException e) { |
... | ... | |
194 | 198 |
if (lyrVect.isActive()) { |
195 | 199 |
if (lyrVect.isAvailable()){ |
196 | 200 |
try { |
197 |
if (lyrVect.getFeatureStore().getSelection().size() > 0) |
|
201 |
if (lyrVect.getFeatureStore().getFeatureSelection() |
|
202 |
.getSize() > 0) { |
|
198 | 203 |
return true; |
199 |
} catch (ReadException e) { |
|
204 |
} |
|
205 |
} catch (DataException e) { |
|
200 | 206 |
e.printStackTrace(); |
201 | 207 |
NotificationManager.addWarning("Capa " + lyrVect.getName() + " sin recordset correcto",e); |
202 | 208 |
} |
Also available in: Unified diff