Revision 20598 trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/file/dxf/DXFStore.java

View differences:

DXFStore.java
33 33
import org.gvsig.data.datastores.vectorial.IFeaturesWriter;
34 34
import org.gvsig.data.datastores.vectorial.base.MemoryStore;
35 35
import org.gvsig.data.datastores.vectorial.file.DataExplorerFileParameters;
36
import org.gvsig.data.datastores.vectorial.file.dbf.DBFDataExplorer;
37 36
import org.gvsig.data.exception.CloseException;
38 37
import org.gvsig.data.exception.InitializeException;
39 38
import org.gvsig.data.exception.OpenException;
......
257 256
			if (i<this.getFeatureCount()){
258 257
				feature=this.getFeature(i);
259 258
			}else{
260
				try {
261
					feature=featureManager.getFeature(i-originalSize,this);
262
				} catch (IsNotFeatureSettingException e) {
263
					throw new ReadException(this.getName(),e);
264
				}
259
				feature=featureManager.getFeature(i-originalSize,this);
265 260
			}
266 261
			if (featureManager == null || !featureManager.isDeleted(feature)){
267 262
				try {
268
						MemoryFeature auxfeature=new MemoryFeature(type,false);
263
						MemoryFeature auxfeature=new DXFFeature(type,false);
269 264
						auxfeature.loading();
270 265
//						auxfeature.setDefaultGeometry(feature.getDefaultGeometry());
271 266
						Iterator iterator=type.iterator();
272 267
						while (iterator.hasNext()) {
273 268
							IFeatureAttributeDescriptor fad = (IFeatureAttributeDescriptor) iterator.next();
274 269
							int index=((DefaultAttributeDescriptor)fad).originalPosition();
275
							auxfeature.set(index,feature.get(index));
270

  
271
							if (fad.getDataType().equals(IFeatureAttributeDescriptor.TYPE_GEOMETRY)){
272
								auxfeature.setGeometry(index,feature.get(index));
273
							} else {
274
								auxfeature.set(index,feature.get(index));
275
							}
276 276
						}
277 277
						if (filter==null || parser.match(auxfeature)){
278 278
							allFeatures.add(auxfeature);
279 279
						}
280 280
						auxfeature.stopLoading();
281 281

  
282
				} catch (ReadException e) {
283
					// TODO Auto-generated catch block
284
					e.printStackTrace();
282
				} catch (IsNotFeatureSettingException e) {
283
					throw new ReadException(this.getName(),e);
285 284
				}
286 285
			}
287 286

  
......
296 295
	public IFeature getFeatureByID(IFeatureID id) throws ReadException {
297 296
		if (this.alterMode){
298 297
    		if (featureManager.contains(id)) {
299
    			try {
300
					return featureManager.getFeature(id,this);
301
				} catch (IsNotFeatureSettingException e) {
302
					throw new ReadException(this.getName(),e);
303
				}
298
    			return featureManager.getFeature(id,this);
304 299
    		}
305 300
    	}
306 301
		return id.getFeature(featureType);
......
465 460

  
466 461
		for (int i = 0; i < features.size(); i++) {
467 462

  
468
			MemoryFeature feature = new MemoryFeature(featureType,true);
463
			MemoryFeature feature;
464
			try {
465
				feature = new DXFFeature(featureType,true);
466
			} catch (ReadException e1) {
467
				throw new OpenException(this.getName(),e1);
468
			}
469 469
//			auxRow[ID_FIELD_HEIGHTTEXT] = new Double(0.0);
470 470
//			auxRow[ID_FIELD_ROTATIONTEXT] = new Double(0.0);
471 471
//			auxRow[ID_FIELD_TEXT] = null;

Also available in: Unified diff