Revision 24691 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLayerFileVectorial.java

View differences:

FLayerFileVectorial.java
4 4
import java.io.FileNotFoundException;
5 5

  
6 6
import org.cresques.cts.IProjection;
7
import org.gvsig.tools.exception.BaseException;
8 7
import org.gvsig.fmap.crs.CRSFactory;
8
import org.gvsig.fmap.dal.DALLocator;
9 9
import org.gvsig.fmap.dal.exception.InitializeException;
10
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
10 11
import org.gvsig.fmap.dal.exception.ReadException;
11 12
import org.gvsig.fmap.dal.feature.FeatureStore;
12 13
import org.gvsig.fmap.dal.impl.DefaultDataManager;
13
import org.gvsig.fmap.dal.operation.DataStoreOperationException;
14
import org.gvsig.fmap.dal.operation.DataStoreOperationNotSupportedException;
15 14
import org.gvsig.fmap.mapcontext.exceptions.DriverLayerException;
16 15
import org.gvsig.fmap.mapcontext.exceptions.FileLayerException;
17 16
import org.gvsig.fmap.mapcontext.exceptions.LegendLayerException;
......
24 23
import org.gvsig.fmap.mapcontext.rendering.legend.LegendFactory;
25 24
import org.gvsig.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy;
26 25
import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingStrategy;
26
import org.gvsig.tools.exception.BaseException;
27
import org.gvsig.tools.locator.LocatorException;
28
import org.gvsig.tools.operations.OperationException;
29
import org.gvsig.tools.operations.OperationNotSupportedException;
27 30

  
28 31
import com.iver.utiles.XMLEntity;
29 32
import com.iver.utiles.XMLException;
......
137 140
			throw new ProjectionLayerException(getName(),null);
138 141
		}
139 142
		try {
140
			this.setDataStore(DefaultDataManager.getManager().createStore(getFeatureStore().getParameters()));
143
			this.setDataStore(DALLocator.getDataManager().createStore(getFeatureStore().getParameters()));
141 144
		} catch (InitializeException e1) {
142 145
			throw new LoadLayerException(getName(),e1);
143 146
		} catch (ReadException e1) {
144 147
			throw new LoadLayerException(getName(),e1);
148
		} catch (ProviderNotRegisteredException e) {
149
			throw new LoadLayerException(getName(),e);
150
		} catch (LocatorException e) {
151
			throw new LoadLayerException(getName(),e);
145 152
		}
146
//			FeatureStore store = new VectorialFileAdapter(this.dataFile);
147
//			adapter.setDriver(this.fileDriver);
148
//
149
//			this.setSource(adapter);
150 153

  
151 154
			try {
152 155
				this.putLoadSelection();
......
178 181
			}
179 182
            if (obj!=null && ((Boolean)obj).booleanValue()) {
180 183
            	ILegend legend = null;
181
				try{
182
					legend = (ILegend) getFeatureStore().invokeOperation("defaultLegend", null);
183
				} catch (DataStoreOperationNotSupportedException e) {
184
					// Not suported
185
				} catch (DataStoreOperationException e) {
186
					throw new LegendLayerException(getName(),e);
187
				}
184
					try {
185
						legend = (ILegend) getFeatureStore().invokeOperation("defaultLegend", null);
186
					} catch (OperationNotSupportedException e) {
187
						throw new LegendLayerException(getName(),e);
188
					} catch (OperationException e) {
189
						throw new LegendLayerException(getName(),e);
190
					}
188 191

  
189 192
//            	WithDefaultLegend aux = (WithDefaultLegend) this.getRecordset().getDriver();
190 193
                this.setLegend((IVectorLegend)legend);
......
204 207
            ILabelingStrategy labeler=null;
205 208
			try {
206 209
				labeler = (ILabelingStrategy)getFeatureStore().invokeOperation("labelingStrategy",null);
207
			} catch (DataStoreOperationException e) {
208
				// TODO Auto-generated catch block
209
				e.printStackTrace();
210
			} catch (DataStoreOperationNotSupportedException e) {
210
			} catch (OperationNotSupportedException e) {
211 211
				throw new LegendLayerException(getName(),e);
212
			} catch (OperationException e) {
213
				throw new LegendLayerException(getName(),e);
212 214
			}
213
            if (labeler instanceof AttrInTableLabelingStrategy) {
215
			if (labeler instanceof AttrInTableLabelingStrategy) {
214 216
            	((AttrInTableLabelingStrategy) labeler).setLayer(this);
215 217
            }
216 218

  

Also available in: Unified diff