Revision 24759 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/gui/filter/FilterDialog.java
FilterDialog.java | ||
---|---|---|
57 | 57 |
import javax.swing.tree.DefaultTreeModel; |
58 | 58 |
|
59 | 59 |
import org.apache.log4j.Logger; |
60 |
import org.gvsig.fmap.data.DataException;
|
|
61 |
import org.gvsig.fmap.data.ReadException;
|
|
62 |
import org.gvsig.fmap.data.feature.Feature;
|
|
63 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor;
|
|
64 |
import org.gvsig.fmap.data.feature.FeatureCollection;
|
|
65 |
import org.gvsig.fmap.data.feature.FeatureStore;
|
|
60 |
import org.gvsig.fmap.dal.exception.DataException;
|
|
61 |
import org.gvsig.fmap.dal.feature.Feature;
|
|
62 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
|
|
63 |
import org.gvsig.fmap.dal.feature.FeatureQuery;
|
|
64 |
import org.gvsig.fmap.dal.feature.FeatureSet;
|
|
65 |
import org.gvsig.fmap.dal.feature.FeatureStore;
|
|
66 | 66 |
import org.gvsig.fmap.mapcontext.rendering.legend.NullValue; |
67 | 67 |
import org.gvsig.gui.beans.filterPanel.tableFilterQueryPanel.TableFilterQueryJPanel; |
68 | 68 |
|
... | ... | |
279 | 279 |
String[] fieldName = new String[] { |
280 | 280 |
((FeatureAttributeDescriptor)model.getDefaultFeatureType().get(row)).getName() |
281 | 281 |
}; |
282 |
FeatureCollection fc = (FeatureCollection) model.getDataCollection(fieldName, null, null); |
|
283 |
Iterator iterator = fc.iterator(); |
|
282 |
|
|
283 |
|
|
284 |
FeatureQuery query = model.createFeatureQuery(); |
|
285 |
query.setAttributeNames(fieldName); |
|
286 |
FeatureSet fs = model |
|
287 |
.getFeatureSet(query); |
|
288 |
Iterator iterator = fs.iterator(); |
|
284 | 289 |
while (iterator.hasNext()) { |
285 | 290 |
Feature feature = (Feature) iterator.next(); |
286 | 291 |
Object value=feature.get(row); |
... | ... | |
292 | 297 |
conjunto.add(value); |
293 | 298 |
} |
294 | 299 |
} |
295 |
fc.dispose();
|
|
300 |
fs.dispose();
|
|
296 | 301 |
Iterator it = conjunto.iterator(); |
297 | 302 |
|
298 | 303 |
while (it.hasNext()) { |
299 | 304 |
valuesListModel.addElement(it.next()); |
300 | 305 |
} |
301 |
} catch (ReadException e) {
|
|
306 |
} catch (DataException e) {
|
|
302 | 307 |
throwException(e); |
303 | 308 |
} |
304 | 309 |
} |
... | ... | |
318 | 323 |
|
319 | 324 |
jtreeRoot.removeAllChildren(); |
320 | 325 |
|
321 |
// try {
|
|
326 |
try { |
|
322 | 327 |
Iterator attributes=model.getDefaultFeatureType().iterator(); |
323 | 328 |
while (attributes.hasNext()) { |
324 | 329 |
FeatureAttributeDescriptor descriptor = (FeatureAttributeDescriptor) attributes.next(); |
... | ... | |
337 | 342 |
// } |
338 | 343 |
|
339 | 344 |
defaultTreeModel.setRoot(jtreeRoot); |
340 |
// } catch (FilterException e) {
|
|
341 |
// throwException(e);
|
|
342 |
// }
|
|
345 |
} catch (DataException e) {
|
|
346 |
throwException(e); |
|
347 |
} |
|
343 | 348 |
} |
344 | 349 |
|
345 | 350 |
/** |
Also available in: Unified diff