root / branches / v2_0_0_prep / libraries / libFMap_dalfile / src / org / gvsig / fmap / dal / store / dxf / DXFStoreParameters.java @ 36009
History | View | Annotate | Download (2.67 KB)
1 |
package org.gvsig.fmap.dal.store.dxf; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
|
5 |
import org.cresques.cts.IProjection; |
6 |
import org.gvsig.fmap.dal.DataStoreParameters; |
7 |
import org.gvsig.fmap.dal.FileHelper; |
8 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
9 |
import org.gvsig.fmap.dal.feature.FeatureType; |
10 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
11 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
12 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
13 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
14 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
15 |
|
16 |
public class DXFStoreParameters extends AbstractDataParameters implements |
17 |
DataStoreParameters, FilesystemStoreParameters, |
18 |
NewFeatureStoreParameters { |
19 |
|
20 |
public static final String PARAMETERS_DEFINITION_NAME = "DXFStoreParameters"; |
21 |
|
22 |
private static final String FILE_PARAMTER_NAME = "File"; |
23 |
private static final String CRS_PARAMTER_NAME = "CRS"; |
24 |
|
25 |
private DelegatedDynObject parameters;
|
26 |
|
27 |
|
28 |
public DXFStoreParameters() {
|
29 |
this(PARAMETERS_DEFINITION_NAME);
|
30 |
} |
31 |
|
32 |
protected DXFStoreParameters(String parametersDefinitionName) { |
33 |
this(parametersDefinitionName, DXFStoreProvider.NAME);
|
34 |
} |
35 |
|
36 |
public DXFStoreParameters(String parametersDefinitionName, String name) { |
37 |
super();
|
38 |
this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName);
|
39 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name);
|
40 |
} |
41 |
|
42 |
public String getDataStoreName() { |
43 |
return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME); |
44 |
} |
45 |
|
46 |
public String getDescription() { |
47 |
return this.getDynClass().getDescription(); |
48 |
} |
49 |
|
50 |
protected DelegatedDynObject getDelegatedDynObject() {
|
51 |
return parameters;
|
52 |
} |
53 |
|
54 |
public void setCRS(String srs) { |
55 |
setDynValue(CRS_PARAMTER_NAME, srs); |
56 |
} |
57 |
|
58 |
public void setCRS(IProjection srs) { |
59 |
setDynValue(CRS_PARAMTER_NAME, srs); |
60 |
} |
61 |
|
62 |
public IProjection getCRS() {
|
63 |
return (IProjection) getDynValue(CRS_PARAMTER_NAME);
|
64 |
} |
65 |
|
66 |
public String getFileName() { |
67 |
if( this.getFile() == null ) { |
68 |
return null; |
69 |
} |
70 |
return this.getFile().getPath(); |
71 |
} |
72 |
|
73 |
public boolean isValid() { |
74 |
if (getCRS() == null ) { |
75 |
return false; |
76 |
} |
77 |
if (getFileName() == null) { |
78 |
return false; |
79 |
} |
80 |
return true; |
81 |
} |
82 |
|
83 |
public File getFile() { |
84 |
return (File) this.getDynValue(FILE_PARAMTER_NAME); |
85 |
} |
86 |
|
87 |
public void setFile(File file) { |
88 |
this.setDynValue(FILE_PARAMTER_NAME, file);
|
89 |
} |
90 |
|
91 |
public void setFile(String file) { |
92 |
this.setDynValue(FILE_PARAMTER_NAME, file);
|
93 |
} |
94 |
|
95 |
public EditableFeatureType getDefaultFeatureType() {
|
96 |
throw new UnsupportedOperationException(); |
97 |
} |
98 |
|
99 |
public void setDefaultFeatureType(FeatureType defaultFeatureType) { |
100 |
throw new UnsupportedOperationException(); |
101 |
} |
102 |
} |