Statistics
| Revision:

root / tags / v2_0_0_Build_2050 / libraries / org.gvsig.newlayer / org.gvsig.newlayer.prov / org.gvsig.newlayer.prov.shape / src / main / java / org / gvsig / newlayer / prov / shape / NewLayerShapeProvider.java @ 38695

History | View | Annotate | Download (2.2 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 * 
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 * 
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
21
 */
22
package org.gvsig.newlayer.prov.shape;
23

    
24
import org.gvsig.fmap.dal.DataStoreParameters;
25
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
26
import org.gvsig.newlayer.NewLayerService;
27
import org.gvsig.newlayer.prov.file.AbstractNewLayerFileProvider;
28

    
29
/**
30
 * NewLayer provider to create a shape file.
31
 * 
32
 * @author gvSIG Team
33
 * @version $Id$
34
 */
35
public class NewLayerShapeProvider extends AbstractNewLayerFileProvider {
36
   
37
    protected NewLayerShapeProvider(NewLayerService service) {
38
        super(service);
39
        this.storeName = "Shape";
40
    }
41

    
42
    @Override
43
    protected String getFileParameterName() {
44
        return "shpFile";
45
    }
46

    
47
    @Override
48
    protected String getFileExtension() {       
49
        return "shp";
50
    } 
51
    
52
    public NewFeatureStoreParameters getNewStoreParameters() {
53
        NewFeatureStoreParameters storeParameters =
54
            super.getNewStoreParameters();
55
        if (storeParameters != null){
56
            storeParameters.setDynValue("geometryType", null);
57
        }
58
        return storeParameters;
59
    }
60

    
61
    @Override
62
        public DataStoreParameters getOpenStoreParameters() {
63
                DataStoreParameters openStoreParameters = super
64
                                .getOpenStoreParameters();
65
                openStoreParameters.setDynValue("CRS", getNewStoreParameters()
66
                                .getDynValue("CRS"));
67
                return openStoreParameters;
68
        }
69
}