Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.exportto / org.gvsig.exportto.swing / org.gvsig.exportto.swing.prov / org.gvsig.exportto.swing.prov.shape / src / main / java / org / gvsig / export / shape / service / ExportShapeParametersImpl.java @ 44270

History | View | Annotate | Download (1.76 KB)

1
package org.gvsig.export.shape.service;
2

    
3
import java.io.File;
4
import org.apache.commons.io.FilenameUtils;
5
import org.gvsig.export.ExportAttributes;
6
import org.gvsig.export.ExportLocator;
7
import org.gvsig.export.dbf.service.ExportDBFService;
8
import org.gvsig.export.spi.AbstractExportParametersGeometry;
9
import org.gvsig.export.spi.AttributeNamesTranslator;
10
import org.gvsig.fmap.dal.feature.FeatureType;
11

    
12
/**
13
 *
14
 * @author jjdelcerro
15
 */
16
public class ExportShapeParametersImpl
17
        extends AbstractExportParametersGeometry
18
        implements ExportShapeParameters {
19

    
20
    private String encoding;
21
    private File file;
22
    private boolean useSimplifiedExport = true;
23

    
24
    @Override
25
    public String getServiceName() {
26
        return ExportShapeServiceFactory.SERVICE_NAME;
27
    }
28
    
29
    @Override
30
    public String getEncoding() {
31
        return this.encoding;
32
    }
33

    
34
    @Override
35
    public void setEncoding(String encoding) {
36
        this.encoding = encoding;
37
    }
38

    
39
    @Override
40
    public File getFile() {
41
        return this.file;
42
    }
43

    
44
    @Override
45
    public void setFile(File file) {
46
        this.file = new File(FilenameUtils.removeExtension(file.getAbsolutePath()) + ".shp");
47
    }
48

    
49
    @Override
50
    public boolean getUseSimplifiedExport() {
51
        return this.useSimplifiedExport;
52
    }
53

    
54
    public void setUseSimplifiedExport(boolean useSimplifiedExport) {
55
        this.useSimplifiedExport = useSimplifiedExport;
56
    }
57

    
58
    @Override
59
    public void setSourceFeatureType(FeatureType sourceFeatureType) {
60
        super.setSourceFeatureType(sourceFeatureType);
61
        AttributeNamesTranslator attr = ExportLocator.getServiceManager().createAttributeNamesTranslator(ExportDBFService.MAX_FIELD_NAME_LENGTH);
62
        this.getExportAttributes().setNamesTranslator(attr);
63

    
64
    }
65

    
66
}