Revision 423 trunk/applications/appgvSIG/src/com/iver/cit/gvsig/Abrir.java

View differences:

Abrir.java
6 6
import org.cresques.cts.ProjectionPool;
7 7

  
8 8
import com.hardcode.driverManager.DriverLoadException;
9
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
9 10
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
10 11
import com.iver.cit.gvsig.fmap.drivers.dgn.DGNDriver;
11 12
import com.iver.cit.gvsig.fmap.drivers.shp.DemoSHPDriver;
......
51 52
			
52 53
			try {
53 54
				lyr = LayerFactory.createLayer(fopen.getDriverName(), fich, proj);
54

  
55
				lyr.setVisible(true);
56
				lyr.setName(layerName);
55
				
57 56
				if (lyr != null )
58 57
				{
59
					try {
58
					try 
59
					{
60
						if (lyr instanceof FLyrVect)
61
						{
62
							FLyrVect lyrVect = (FLyrVect) lyr;
63
							lyrVect.setLegend(LegendFactory.createSingleSymbolLegend());
64
						}
65
						lyr.setVisible(true);
66
						lyr.setName(layerName);						
60 67
						theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
61 68
					} catch (CancelationException e) {
62 69
						// TODO Auto-generated catch block
......
69 76
				}    		
70 77
				
71 78
			} catch (DriverLoadException e) {
79
				e.printStackTrace();				
80
			} catch (DriverIOException e) {
81
				// TODO Auto-generated catch block
72 82
				e.printStackTrace();
73 83
			}
74 84
		} // for

Also available in: Unified diff