Revision 28665 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/LayerFactory.java

View differences:

LayerFactory.java
44 44
	 */
45 45
	private Map layersToUseForStore = new HashMap();
46 46

  
47
    /**
48
     * Registra que clase tiene que usar para un {@link DataStore} determinado. <br>
49
     * Por defecto, si el
50
     *
51
     *
52
     * @param dataStoreName
53
     *            Nombre de registro del {@link DataStore} dentro del
54
     *            {@link DataManager}
55
     * @param layerClassToUse
56
     *            clase que implementa {@link SingleLayer}
57
     * @return
58
     */
47
	/**
48
	 * Registra que clase tiene que usar para un {@link DataStore} determinado. <br>
49
	 * Por defecto, si el
50
	 *
51
	 *
52
	 * @param dataStoreName
53
	 *            Nombre de registro del {@link DataStore} dentro del
54
	 *            {@link DataManager}
55
	 * @param layerClassToUse
56
	 *            clase que implementa {@link SingleLayer}
57
	 * @return
58
	 */
59 59

  
60 60
	public boolean registerLayerToUseForStore(String dataStoreName,
61 61
			Class layerClassToUse) {
......
64 64
		DataStoreParameters dsparams;
65 65
		try {
66 66
			dsparams = dm
67
					.createStoreParameters(dataStoreName);
67
			.createStoreParameters(dataStoreName);
68 68
		} catch (InitializeException e) {
69 69
			e.printStackTrace();
70 70
			return false;
......
139 139
		try{
140 140
			DataManager dataManager=DALLocator.getDataManager();
141 141
			DataStore dataStore=dataManager.createStore(storeParameters);
142
			return createLayer(layerName, dataStore);
143
		}catch (Exception e) {
144
			throw new LoadLayerException(layerName,e);
145
		}
146
	}
147

  
148
	/**
149
	 * Create a layer form a DataStore.
150
	 * @param layerName
151
	 * The name of the layer
152
	 * @param dataStore
153
	 * The datastore
154
	 * @return
155
	 * The layer to load
156
	 * @throws LoadLayerException
157
	 */
158
	public FLayer createLayer(String layerName, DataStore dataStore) throws LoadLayerException{
159
		try{	
142 160
			Class layerClass = this.getLayerClassFor(dataStore);
143 161
			if (layerClass == null) {
144 162
				throw new LoadLayerException("No_layer_class_to_use",

Also available in: Unified diff