svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dalfile / src / org / gvsig / fmap / dal / store / dxf / DXFStoreParameters.java @ 24569
History | View | Annotate | Download (2.33 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.crs.CRSFactory; |
7 |
import org.gvsig.fmap.dal.DataStoreParameters; |
8 |
import org.gvsig.fmap.dal.DataTypes; |
9 |
import org.gvsig.fmap.dal.explorer.filesystem.FilesystemStoreParameters; |
10 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
11 |
|
12 |
public class DXFStoreParameters extends AbstractDataParameters implements |
13 |
DataStoreParameters, FilesystemStoreParameters { |
14 |
|
15 |
public DXFStoreParameters() {
|
16 |
super();
|
17 |
initialize(); |
18 |
} |
19 |
|
20 |
public DataStoreParameters initialize() {
|
21 |
this.addParameter("srsid", DataTypes.STRING, |
22 |
"SRS en el que se encuentra el fichero", "EPSG:23030"); |
23 |
this
|
24 |
.addParameter("filepath", DataTypes.STRING, "ruta al fichero", |
25 |
null);
|
26 |
return this; |
27 |
} |
28 |
|
29 |
public String getDataStoreName() { |
30 |
return DXFStoreProvider.NAME;
|
31 |
} |
32 |
|
33 |
public String getDescription() { |
34 |
return DXFStoreProvider.DESCRIPTION;
|
35 |
} |
36 |
|
37 |
public String getSRSID() { |
38 |
return (String) getAttribute("srsid"); |
39 |
} |
40 |
|
41 |
public void setSRSID(String srsid) { |
42 |
setAttribute("srsid", srsid);
|
43 |
} |
44 |
|
45 |
public IProjection getCRS() {
|
46 |
if (this.getSRSID() == null) { |
47 |
return null; |
48 |
} |
49 |
return CRSFactory.getCRS(this.getSRSID()); |
50 |
} |
51 |
|
52 |
public String getFileName() { |
53 |
return (String) getAttribute("filepath"); |
54 |
} |
55 |
|
56 |
public void setFileName(String file) { |
57 |
setAttribute("filepath", file);
|
58 |
} |
59 |
|
60 |
public boolean isValid() { |
61 |
if (getSRSID() == null || getSRSID().equals("")) { |
62 |
return false; |
63 |
} |
64 |
if (getFileName() == null) { |
65 |
return false; |
66 |
} |
67 |
return true; |
68 |
} |
69 |
|
70 |
public File getFile() { |
71 |
return new File(this.getFileName()); |
72 |
} |
73 |
|
74 |
public void setFile(File file) { |
75 |
this.setFileName(file.getPath());
|
76 |
} |
77 |
|
78 |
|
79 |
|
80 |
// public XMLEntity getXMLEntity() {
|
81 |
// XMLEntity xmlEntity = super.getXMLEntity();
|
82 |
// xmlEntity.putProperty("srsid", this.getSRSID());
|
83 |
// xmlEntity.putProperty("file", this.getFileName());
|
84 |
// return xmlEntity;
|
85 |
// }
|
86 |
//
|
87 |
// public void loadFromXMLEntity(XMLEntity xmlEntity)
|
88 |
// throws InitializeException {
|
89 |
// try {
|
90 |
// this.setSRSID(xmlEntity.getStringProperty("srsid"));
|
91 |
// this.setFileName(xmlEntity.getStringProperty("file"));
|
92 |
// } catch (NotExistInXMLEntity e) {
|
93 |
// throw new InitializeException(e);
|
94 |
// }
|
95 |
// }
|
96 |
|
97 |
|
98 |
// public DataParameters getCopy() throws DataException {
|
99 |
// DXFStoreParameters copy = new DXFStoreParameters();
|
100 |
// this.copyValuesTo(copy);
|
101 |
// return copy;
|
102 |
// }
|
103 |
|
104 |
} |