Revision 15594 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/LayerFactory.java

View differences:

LayerFactory.java
71 71
import com.iver.cit.gvsig.fmap.DriverNotLoadedExceptionType;
72 72
import com.iver.cit.gvsig.fmap.LegendDriverExceptionType;
73 73
import com.iver.cit.gvsig.fmap.ProgressListener;
74
import com.iver.cit.gvsig.fmap.core.symbols.ISymbol;
74 75
import com.iver.cit.gvsig.fmap.drivers.ConnectionFactory;
75 76
import com.iver.cit.gvsig.fmap.drivers.DBException;
76 77
import com.iver.cit.gvsig.fmap.drivers.DBLayerDefinition;
......
198 199
			layer.setProjection(proj);
199 200
		}
200 201

  
201
//		try {
202

  
202 203
			// Le asignamos tambi?n una legenda por defecto acorde con
203 204
			// el tipo de shape que tenga. Tampoco s? si es aqu? el
204 205
			// sitio adecuado, pero en fin....
......
217 218
					adapter.stop();
218 219

  
219 220
			} else {
220
				layer.setLegend(LegendFactory.createSingleSymbolLegend(layer
221
						.getShapeType()));
221
				IVectorLegend leg = LegendFactory.createSingleSymbolLegend(layer
222
						.getShapeType());
223
				layer.setLegend(leg);
224
				
222 225
			}
223

  
224
//		} catch (LegendLayerException e) {
225
//			//this exception is caused in legend creation
226
//			LegendDriverExceptionType excepType =
227
//				new LegendDriverExceptionType("Error al construir la leyenda");
228
//			//TODO Para hacer esto extensible tiene que usarse puntos
229
//			//de extension, y comparar las clases de leyendas registradas
230
//			VectorialLegend legend = (VectorialLegend)
231
//				((WithDefaultLegend)d).getDefaultLegend();
232
//
233
//			excepType.setLegendLabelField(legend.getLabelField());
234
//			excepType.setLegendHeightField(legend.getLabelHeightField());
235
//			excepType.setLegendRotationField(legend.getLabelRotationField());
236
//			DriverException exception = new DriverException(e, excepType);
237
//			capa.setAvailable(false);
238
//			capa.addError(exception);
239
//
240
//		}
241
//
242
//		/*
243
//		 * catch(DriverException e){
244
//		 * ESTO HAY QUE CAPTURARLO,DE FORMA QUE CREATELAYER NO LANCE NINGUNA
245
//		 * EXCEPCION (A NO SER QUE SEA IRRECUPERABLE)
246
//		 * }
247
//		 */
248
//		catch(Exception e){
249
//			GenericDriverExceptionType type = new GenericDriverExceptionType();
250
//			DriverException exception = new DriverException(e, type);
251
//			capa.setAvailable(false);
252
//			capa.addError(exception);
253
//		}
254

  
255 226
	} catch (ReadDriverException e) {
256 227
		layer.setAvailable(false);
257 228
		layer.addError(e);
......
320 291
						.getShapeType()));
321 292
			}
322 293
		} catch (LegendLayerException e) {
323
//			this exception is caused in legend creation
324
//			LegendDriverExceptionType excepType =
325
//				new LegendDriverExceptionType("error al construir la leyenda, campo no encontrado");
326 294

  
327
			//TODO Para hacer esto extensible tiene que usarse puntos
328
			//de extension, y comparar las clases de leyendas registradas
329
//			VectorialLegend legend = (VectorialLegend)
330
//				((WithDefaultLegend)d).getDefaultLegend();
331
//			excepType.setDriverName(d.getName());
332
//			excepType.setLegendLabelField(legend.getLabelField());
333
//			excepType.setLegendHeightField(legend.getLabelHeightField());
334
//			excepType.setLegendRotationField(legend.getLabelRotationField());
335

  
336
//			DriverException exception = new DriverException(e, excepType);
337 295
			layer.setAvailable(false);
338 296
			layer.addError(e);
339
//		}
340
//			catch(Exception e){
341
//			GenericDriverExceptionType type = new GenericDriverExceptionType();
342
//			DriverException exception = new DriverException(e, type);
343
//			capa.setAvailable(false);
344
//			capa.addError(exception);
345
//		} catch (UnsupportedVersionDriverException e) {
346
//			capa.setAvailable(false);
347
//			capa.addError(e);
348
//		} catch (InitializeDriverException e) {
349
//			capa.setAvailable(false);
350
//			capa.addError(e);
297

  
351 298
		} catch (ReadDriverException e) {
352 299
			layer.setAvailable(false);
353 300
			layer.addError(e);

Also available in: Unified diff