Revision 43075 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/FLayers.java

View differences:

FLayers.java
40 40
import org.slf4j.LoggerFactory;
41 41

  
42 42
import org.gvsig.compat.print.PrintAttributes;
43
import org.gvsig.fmap.dal.DataStore;
43 44
import org.gvsig.fmap.dal.exception.DataException;
44 45
import org.gvsig.fmap.dal.exception.ReadException;
46
import org.gvsig.fmap.dal.feature.FeatureStore;
45 47
import org.gvsig.fmap.geom.primitive.Envelope;
46 48
import org.gvsig.fmap.mapcontext.MapContext;
49
import org.gvsig.fmap.mapcontext.MapContextLocator;
47 50
import org.gvsig.fmap.mapcontext.MapContextRuntimeException;
48 51
import org.gvsig.fmap.mapcontext.Messages;
49 52
import org.gvsig.fmap.mapcontext.ViewPort;
......
197 200
            addLayer(layers.size(), layer);
198 201
        }
199 202
    }
203
    
204
    public void addLayer(DataStore store) {
205
        FLayer layer;
206
        try {
207
            layer = MapContextLocator.getMapContextManager().createLayer(
208
                    store.getName(),
209
                    store
210
            );
211
            
212
        } catch (LoadLayerException ex) {
213
            throw new RuntimeException("Can't create layer from store.", ex);
214
        }
215
        this.addLayer(layer);
216
    }
200 217

  
201 218
    /**
202 219
     * Adds a layer in an specified position in this node.

Also available in: Unified diff