Revision 37491 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/FLyrVect.java

View differences:

FLyrVect.java
74 74
import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
75 75
import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
76 76
import org.gvsig.fmap.mapcontext.MapContextLocator;
77
import org.gvsig.fmap.mapcontext.MapContextManager;
77 78
import org.gvsig.fmap.mapcontext.ViewPort;
78 79
import org.gvsig.fmap.mapcontext.exceptions.LegendLayerException;
79 80
import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
......
99 100
import org.gvsig.tools.ToolsLocator;
100 101
import org.gvsig.tools.dynobject.DynObjectSet;
101 102
import org.gvsig.tools.dynobject.DynStruct;
102
import org.gvsig.tools.dynobject.exception.DynMethodException;
103
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException;
104 103
import org.gvsig.tools.exception.BaseException;
105 104
import org.gvsig.tools.locator.LocatorException;
106 105
import org.gvsig.tools.observer.Observable;
......
280 279

  
281 280
        featureStore = (FeatureStore) dataStore;
282 281

  
282
        MapContextManager mapContextManager =
283
            MapContextLocator.getMapContextManager();
284
        
285
        //Set the legend
283 286
        IVectorLegend legend =
284
            (IVectorLegend) MapContextLocator.getMapContextManager().getLegend(dataStore);
287
            (IVectorLegend)mapContextManager.getLegend(dataStore);
285 288

  
286 289
        if (legend == null) {
287 290
            throw new LegendLayerException(this.getName());
......
289 292

  
290 293
        this.setLegend(legend);
291 294

  
292
        ILabelingStrategy labeler = null;
293
        try {
294
            labeler =
295
                (ILabelingStrategy) dataStore.invokeDynMethod("getLabeling",
296
                    null);
297
        } catch (DynMethodNotSupportedException e1) {
298
            labeler = null;
299
        } catch (DynMethodException e1) {
300
            logger.error("Can't load the specific lebeling strategy provided for the layer {}.",
301
                this.getName(),
302
                e1);
303
        }
295
        //Set the labeling strategy
296
        ILabelingStrategy labeler = 
297
            (ILabelingStrategy) mapContextManager.getLabelingStrategy(dataStore);
304 298

  
305 299
        if (labeler != null) {
306 300
            labeler.setLayer(this);

Also available in: Unified diff