Revision 29289 branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dgn/DGNStoreProvider.java
DGNStoreProvider.java | ||
---|---|---|
25 | 25 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
26 | 26 |
import org.gvsig.fmap.dal.feature.FeatureType; |
27 | 27 |
import org.gvsig.fmap.dal.feature.exception.PerformEditingException; |
28 |
import org.gvsig.fmap.dal.feature.spi.FeatureData;
|
|
28 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider;
|
|
29 | 29 |
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider; |
30 | 30 |
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices; |
31 | 31 |
import org.gvsig.fmap.dal.feature.spi.memory.AbstractMemoryStoreProvider; |
... | ... | |
72 | 72 |
|
73 | 73 |
public static final String NAME = "DGN"; |
74 | 74 |
public static final String DESCRIPTION = "DGN file"; |
75 |
public static final String DYNCLASS_NAME = "DGNFile";
|
|
75 |
public static final String DYNCLASS_NAME = "DGNStore";
|
|
76 | 76 |
protected static DynClass DYNCLASS = null; |
77 | 77 |
|
78 | 78 |
public static final String NAME_FIELD_ID = "ID"; |
... | ... | |
106 | 106 |
|
107 | 107 |
|
108 | 108 |
|
109 |
private DGNStoreParameters getParameters() { |
|
109 |
private DGNStoreParameters getDGNParameters() {
|
|
110 | 110 |
return (DGNStoreParameters) this.parameters; |
111 | 111 |
} |
112 | 112 |
|
... | ... | |
118 | 118 |
throws InitializeException { |
119 | 119 |
super.initialize(store); |
120 | 120 |
|
121 |
this.dynObject = (DelegatedDynObject) ToolsLocator
|
|
121 |
this.metadata = (DelegatedDynObject) ToolsLocator
|
|
122 | 122 |
.getDynObjectManager().createDynObject(DYNCLASS); |
123 | 123 |
|
124 | 124 |
counterNewsOIDs = 0; |
125 | 125 |
// projection = CRSFactory.getCRS(getParameters().getSRSID()); |
126 | 126 |
|
127 |
File file = getParameters().getFile(); |
|
127 |
File file = getDGNParameters().getFile();
|
|
128 | 128 |
resource = this.createResource( |
129 | 129 |
FileResource.NAME, |
130 | 130 |
new Object[] { file.getAbsolutePath() } |
... | ... | |
132 | 132 |
|
133 | 133 |
resource.addConsumer(this); |
134 | 134 |
|
135 |
this.projection = this.getParameters().getSRS(); |
|
135 |
this.projection = this.getDGNParameters().getSRS();
|
|
136 | 136 |
|
137 | 137 |
|
138 | 138 |
try { |
... | ... | |
268 | 268 |
this.data = DGNData.data; |
269 | 269 |
this.store.setFeatureTypes(DGNData.fTypes, DGNData.defaultFType); |
270 | 270 |
this.legendBuilder = DGNData.legendBuilder; |
271 |
this.dynObject.setDynValue("Envelope", DGNData.getEnvelopeCopy());
|
|
272 |
this.dynObject
|
|
271 |
this.metadata.setDynValue("Envelope", DGNData.getEnvelopeCopy());
|
|
272 |
this.metadata
|
|
273 | 273 |
.setDynValue("DefaultSRS", this.projection.getAbrev()); |
274 | 274 |
this.counterNewsOIDs = this.data.size(); |
275 | 275 |
} catch (Exception e) { |
... | ... | |
291 | 291 |
try { |
292 | 292 |
params = (FilesystemServerExplorerParameters) manager |
293 | 293 |
.createServerExplorerParameters(FilesystemServerExplorer.NAME); |
294 |
params.setRoot(this.getParameters().getFile().getParent()); |
|
294 |
params.setRoot(this.getDGNParameters().getFile().getParent());
|
|
295 | 295 |
return manager.createServerExplorer(params); |
296 | 296 |
} catch (DataException e) { |
297 | 297 |
throw new ReadException(this.getName(), e); |
... | ... | |
303 | 303 |
|
304 | 304 |
|
305 | 305 |
|
306 |
public void performEditing(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator originalFeatureTypesUpdated) throws PerformEditingException {
|
|
306 |
public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator originalFeatureTypesUpdated) throws PerformEditingException {
|
|
307 | 307 |
// FIXME Exception |
308 | 308 |
throw new UnsupportedOperationException(); |
309 | 309 |
} |
... | ... | |
895 | 895 |
|
896 | 896 |
private void addShape(Geometry geometry, Object[] auxRow, |
897 | 897 |
FeatureType type, DGNReader dgnReader) throws DataException { |
898 |
FeatureData data = createFeatureData(type);
|
|
898 |
FeatureProvider data = createFeatureData(type);
|
|
899 | 899 |
for (int i=0;i<type.size();i++){ |
900 | 900 |
data.set(i, auxRow[i]); |
901 | 901 |
} |
... | ... | |
940 | 940 |
return true; |
941 | 941 |
} |
942 | 942 |
|
943 |
public int getFeatureReferenceOIDType() {
|
|
943 |
public int getOIDType() { |
|
944 | 944 |
return DataTypes.LONG; |
945 | 945 |
} |
946 | 946 |
|
... | ... | |
948 | 948 |
return false; |
949 | 949 |
} |
950 | 950 |
|
951 |
public void append(FeatureData featureData) {
|
|
951 |
public void append(FeatureProvider featureData) {
|
|
952 | 952 |
// FIXME Exception |
953 | 953 |
throw new UnsupportedOperationException(); |
954 | 954 |
} |
... | ... | |
987 | 987 |
|
988 | 988 |
public Envelope getEnvelope() throws DataException { |
989 | 989 |
this.open(); |
990 |
return (Envelope) this.dynObject.getDynValue("Envelope");
|
|
990 |
return (Envelope) this.metadata.getDynValue("Envelope");
|
|
991 | 991 |
} |
992 | 992 |
|
993 | 993 |
public Iterator getChilds() { |
... | ... | |
1022 | 1022 |
} |
1023 | 1023 |
|
1024 | 1024 |
public Object getSourceId() { |
1025 |
return this.getParameters().getFile(); |
|
1025 |
return this.getDGNParameters().getFile();
|
|
1026 | 1026 |
} |
1027 | 1027 |
|
1028 | 1028 |
} |
Also available in: Unified diff