Revision 499
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.duplicate/src/main/java/org/gvsig/vectorediting/lib/prov/duplicate/DuplicateEditingProvider.java | ||
---|---|---|
50 | 50 |
import org.gvsig.fmap.geom.primitive.Point; |
51 | 51 |
import org.gvsig.fmap.geom.primitive.Surface; |
52 | 52 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
53 |
import org.gvsig.tools.ToolsLocator; |
|
53 | 54 |
import org.gvsig.tools.dispose.DisposableIterator; |
54 | 55 |
import org.gvsig.tools.dynobject.DynObject; |
55 | 56 |
import org.gvsig.tools.exception.BaseException; |
... | ... | |
268 | 269 |
|
269 | 270 |
FeatureSelection featureSelection = |
270 | 271 |
(FeatureSelection) values.get(selection); |
272 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
271 | 273 |
|
272 | 274 |
try { |
273 | 275 |
featureSelection.accept(new Visitor() { |
... | ... | |
294 | 296 |
}); |
295 | 297 |
|
296 | 298 |
featureStore.getFeatureSelection().deselectAll(); |
299 |
featureSelection.dispose(); |
|
300 |
|
|
297 | 301 |
} catch (BaseException e) { |
298 | 302 |
throw new FinishServiceException(e); |
299 | 303 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.smoothline/src/main/java/org/gvsig/vectorediting/lib/prov/smoothline/SmoothLineEditingProvider.java | ||
---|---|---|
252 | 252 |
|
253 | 253 |
FeatureSelection featureSelection = |
254 | 254 |
(FeatureSelection) values.get(selection); |
255 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
255 | 256 |
|
257 |
|
|
256 | 258 |
final Integer stepsValue = (Integer) values.get(steps); |
257 | 259 |
|
258 | 260 |
final String algorithmValue = (String)values.get(algorithm); |
... | ... | |
308 | 310 |
}); |
309 | 311 |
|
310 | 312 |
featureStore.getFeatureSelection().deselectAll(); |
313 |
featureSelection.dispose(); |
|
311 | 314 |
|
312 | 315 |
} catch (BaseException e) { |
313 | 316 |
throw new FinishServiceException(e); |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.split/src/main/java/org/gvsig/vectorediting/lib/prov/split/SplitEditingProvider.java | ||
---|---|---|
47 | 47 |
import org.gvsig.fmap.geom.primitive.Point; |
48 | 48 |
import org.gvsig.fmap.geom.primitive.Primitive; |
49 | 49 |
import org.gvsig.fmap.geom.type.GeometryType; |
50 |
import org.gvsig.tools.ToolsLocator; |
|
50 | 51 |
import org.gvsig.tools.dispose.DisposableIterator; |
51 | 52 |
import org.gvsig.tools.dynobject.DynObject; |
52 | 53 |
import org.gvsig.tools.exception.BaseException; |
... | ... | |
225 | 226 |
return false; |
226 | 227 |
} |
227 | 228 |
} |
228 |
|
|
229 |
|
|
229 | 230 |
public Geometry finish() throws FinishServiceException { |
230 | 231 |
return null; |
231 | 232 |
} |
... | ... | |
240 | 241 |
FeatureSelection featureSelection = |
241 | 242 |
(FeatureSelection) values.get(selection); |
242 | 243 |
Geometry splitter = (Geometry) values.get(splitGeometry); |
244 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
243 | 245 |
|
244 | 246 |
DisposableIterator it = null; |
245 | 247 |
try { |
... | ... | |
270 | 272 |
|
271 | 273 |
MultiPrimitive multiPrimitive = |
272 | 274 |
(MultiPrimitive) geometryToBeSplitted; |
273 |
|
|
275 |
|
|
274 | 276 |
// Multigeometry composed by no splitted geometries. |
275 | 277 |
GeometryManager geoManager = GeometryLocator.getGeometryManager(); |
276 | 278 |
MultiPrimitive multiNoSplitted; |
... | ... | |
283 | 285 |
geoManager.createMultiCurve(editingProviderServices |
284 | 286 |
.getSubType(featureStore)); |
285 | 287 |
} |
286 |
|
|
288 |
|
|
287 | 289 |
for (int i = 0; i < multiPrimitive |
288 | 290 |
.getPrimitivesNumber(); i++) { |
289 |
|
|
291 |
|
|
290 | 292 |
Geometry geoSplitted = |
291 | 293 |
split(multiPrimitive.getPrimitiveAt(i), |
292 | 294 |
splitter); |
293 |
|
|
295 |
|
|
294 | 296 |
if (geoSplitted instanceof MultiPrimitive) { |
295 | 297 |
// If the result of split is a multiprimitive, |
296 | 298 |
// it has splitted |
... | ... | |
310 | 312 |
.addPrimitive((Primitive) geoSplitted); |
311 | 313 |
} |
312 | 314 |
} |
313 |
|
|
315 |
|
|
314 | 316 |
if(multiNoSplitted.getPrimitivesNumber() > 0){ |
315 | 317 |
// Not splitted geometries should be saved as multigeometry |
316 | 318 |
copyAlfanumericDataAndInsert(multiNoSplitted, |
317 | 319 |
feature); |
318 | 320 |
} |
319 | 321 |
} |
320 |
|
|
322 |
|
|
321 | 323 |
editingProviderServices.deleteFeatureFromFeatureStore( |
322 | 324 |
feature, featureStore); |
323 | 325 |
} |
... | ... | |
325 | 327 |
featureSelection.deselectAll(); |
326 | 328 |
featureStore.getFeatureSelection().deselectAll(); |
327 | 329 |
|
330 |
|
|
328 | 331 |
} catch (BaseException e) { |
329 | 332 |
throw new FinishServiceException(e); |
330 | 333 |
} finally { |
331 | 334 |
it.dispose(); |
335 |
featureSelection.dispose(); |
|
332 | 336 |
} |
333 | 337 |
} |
334 | 338 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.simplify/src/main/java/org/gvsig/vectorediting/lib/prov/simplify/SimplifyEditingProvider.java | ||
---|---|---|
48 | 48 |
import org.gvsig.fmap.geom.primitive.Polygon; |
49 | 49 |
import org.gvsig.fmap.geom.primitive.Surface; |
50 | 50 |
import org.gvsig.fmap.geom.type.GeometryType; |
51 |
import org.gvsig.tools.ToolsLocator; |
|
51 | 52 |
import org.gvsig.tools.dynobject.DynObject; |
52 | 53 |
import org.gvsig.tools.exception.BaseException; |
53 | 54 |
import org.gvsig.tools.service.spi.ProviderServices; |
... | ... | |
200 | 201 |
|
201 | 202 |
FeatureSelection featureSelection = |
202 | 203 |
(FeatureSelection) values.get(selection); |
204 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
203 | 205 |
|
206 |
|
|
204 | 207 |
final Double toleranceValue = (Double) values.get(tolerance); |
205 | 208 |
|
206 | 209 |
final EditingProviderServices editingProviderServices = |
... | ... | |
312 | 315 |
}); |
313 | 316 |
|
314 | 317 |
featureStore.getFeatureSelection().deselectAll(); |
318 |
featureSelection.dispose(); |
|
315 | 319 |
|
316 | 320 |
} catch (BaseException e) { |
317 | 321 |
throw new FinishServiceException(e); |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.remove/src/main/java/org/gvsig/vectorediting/lib/prov/remove/RemoveEditingProvider.java | ||
---|---|---|
35 | 35 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
36 | 36 |
import org.gvsig.fmap.geom.Geometry; |
37 | 37 |
import org.gvsig.fmap.geom.primitive.Point; |
38 |
import org.gvsig.tools.ToolsLocator; |
|
39 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
38 | 40 |
import org.gvsig.tools.dynobject.DynObject; |
39 | 41 |
import org.gvsig.tools.exception.BaseException; |
40 | 42 |
import org.gvsig.tools.service.spi.ProviderServices; |
... | ... | |
141 | 143 |
|
142 | 144 |
FeatureSelection featureSelection = |
143 | 145 |
(FeatureSelection) values.get(selection); |
146 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
144 | 147 |
|
148 |
|
|
145 | 149 |
try { |
146 | 150 |
featureSelection.accept(new Visitor() { |
147 | 151 |
|
... | ... | |
155 | 159 |
} |
156 | 160 |
}); |
157 | 161 |
|
158 |
featureStore.getFeatureSelection().deselectAll(); |
|
162 |
featureSelection.deselectAll(); |
|
163 |
featureSelection.dispose(); |
|
159 | 164 |
} catch (BaseException e) { |
160 | 165 |
throw new FinishServiceException(e); |
161 | 166 |
} |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.join/src/main/java/org/gvsig/vectorediting/lib/prov/join/JoinEditingProvider.java | ||
---|---|---|
38 | 38 |
import org.gvsig.fmap.geom.Geometry; |
39 | 39 |
import org.gvsig.fmap.geom.primitive.Point; |
40 | 40 |
import org.gvsig.fmap.geom.type.GeometryType; |
41 |
import org.gvsig.tools.ToolsLocator; |
|
41 | 42 |
import org.gvsig.tools.dispose.DisposableIterator; |
43 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
42 | 44 |
import org.gvsig.tools.dynobject.DynObject; |
43 | 45 |
import org.gvsig.tools.exception.BaseException; |
44 | 46 |
import org.gvsig.tools.service.spi.ProviderServices; |
... | ... | |
104 | 106 |
} |
105 | 107 |
|
106 | 108 |
public void stop() throws StopServiceException { |
109 |
DisposeUtils.disposeQuietly(featureSelection); |
|
107 | 110 |
featureSelection = null; |
108 | 111 |
} |
109 | 112 |
|
... | ... | |
173 | 176 |
} |
174 | 177 |
} |
175 | 178 |
} |
176 |
|
|
179 |
DisposeUtils.disposeQuietly(featureSelection); |
|
180 |
ToolsLocator.getDisposableManager().bind(fSelection); |
|
177 | 181 |
featureSelection = fSelection; |
178 | 182 |
return; |
179 | 183 |
} catch (DataException e) { |
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.splitline/src/main/java/org/gvsig/vectorediting/lib/prov/splitline/SplitLineEditingProvider.java | ||
---|---|---|
46 | 46 |
import org.gvsig.fmap.geom.primitive.Primitive; |
47 | 47 |
import org.gvsig.fmap.geom.type.GeometryType; |
48 | 48 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
49 |
import org.gvsig.tools.ToolsLocator; |
|
49 | 50 |
import org.gvsig.tools.dispose.DisposableIterator; |
50 | 51 |
import org.gvsig.tools.dynobject.DynObject; |
51 | 52 |
import org.gvsig.tools.exception.BaseException; |
... | ... | |
251 | 252 |
null); |
252 | 253 |
} |
253 | 254 |
} |
254 |
values.put(selection, value); |
|
255 |
return; |
|
255 |
values.put(selection, value);
|
|
256 |
return;
|
|
256 | 257 |
} |
257 | 258 |
} |
258 | 259 |
}); |
... | ... | |
293 | 294 |
|
294 | 295 |
FeatureSelection featureSelection = |
295 | 296 |
(FeatureSelection) values.get(selection); |
297 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
296 | 298 |
|
297 | 299 |
final Point pointValue = (Point) values.get(point); |
298 | 300 |
|
... | ... | |
344 | 346 |
List<Geometry> result = splitMultiCurve(multiCurve, projectedPoint); |
345 | 347 |
|
346 | 348 |
if (result != null && result.size() > 0) { |
347 |
|
|
349 |
|
|
348 | 350 |
// Deletes old feature |
349 | 351 |
editingProviderService |
350 | 352 |
.deleteFeatureFromFeatureStore(feature, |
351 | 353 |
featureStore); |
352 |
|
|
354 |
|
|
353 | 355 |
for (Geometry geometry : result) { |
354 | 356 |
// Copy alfanumeric data and insert new feature |
355 | 357 |
EditableFeature eFeature = |
356 | 358 |
editingProviderService.getFeatureCopyWithoutPK( |
357 | 359 |
featureStore, feature); |
358 |
|
|
360 |
|
|
359 | 361 |
eFeature.setDefaultGeometry(geometry); |
360 | 362 |
editingProviderService |
361 | 363 |
.insertFeatureIntoFeatureStore(eFeature, |
... | ... | |
367 | 369 |
}); |
368 | 370 |
|
369 | 371 |
featureStore.getFeatureSelection().deselectAll(); |
372 |
featureSelection.dispose(); |
|
370 | 373 |
|
371 | 374 |
} catch (BaseException e) { |
372 | 375 |
throw new FinishServiceException(e); |
... | ... | |
378 | 381 |
Point projectedPoint) throws GeometryOperationNotSupportedException, |
379 | 382 |
GeometryOperationException, CreateGeometryException, LocatorException, |
380 | 383 |
DataException { |
381 |
|
|
384 |
|
|
382 | 385 |
List<Geometry> result = new ArrayList<Geometry>(); |
383 |
|
|
386 |
|
|
384 | 387 |
Curve curveToSplit = null; |
385 | 388 |
|
386 | 389 |
for (int i = 0; i < multiCurveToSplit.getPrimitivesNumber(); i++) { |
... | ... | |
391 | 394 |
} |
392 | 395 |
|
393 | 396 |
Curve[] splitedCurves = splitCurve(curveToSplit, projectedPoint); |
394 |
|
|
397 |
|
|
395 | 398 |
for(int i = 0; i < splitedCurves.length; i++){ |
396 | 399 |
result.add(splitedCurves[i]); |
397 | 400 |
} |
... | ... | |
408 | 411 |
multiCurve.addCurve(multiCurveToSplit.getCurveAt(i)); |
409 | 412 |
} |
410 | 413 |
} |
411 |
|
|
414 |
|
|
412 | 415 |
if(multiCurve.getPrimitivesNumber() > 0){ |
413 | 416 |
result.add(multiCurve); |
414 | 417 |
} |
415 |
|
|
418 |
|
|
416 | 419 |
return result; |
417 | 420 |
} |
418 | 421 |
|
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.lib/org.gvsig.vectorediting.lib.prov/org.gvsig.vectorediting.lib.prov.move/src/main/java/org/gvsig/vectorediting/lib/prov/move/MoveEditingProvider.java | ||
---|---|---|
50 | 50 |
import org.gvsig.fmap.geom.primitive.Point; |
51 | 51 |
import org.gvsig.fmap.geom.primitive.Surface; |
52 | 52 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
53 |
import org.gvsig.tools.ToolsLocator; |
|
53 | 54 |
import org.gvsig.tools.dispose.DisposableIterator; |
54 | 55 |
import org.gvsig.tools.dynobject.DynObject; |
55 | 56 |
import org.gvsig.tools.exception.BaseException; |
... | ... | |
154 | 155 |
|
155 | 156 |
FeatureSelection featureSelection = |
156 | 157 |
(FeatureSelection) values.get(selection); |
158 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
159 |
|
|
157 | 160 |
Point firstPointValue = (Point) values.get(firstPoint); |
158 | 161 |
|
159 | 162 |
if (featureSelection != null && firstPointValue != null) { |
... | ... | |
270 | 273 |
|
271 | 274 |
FeatureSelection featureSelection = |
272 | 275 |
(FeatureSelection) values.get(selection); |
276 |
ToolsLocator.getDisposableManager().bind(featureSelection); |
|
273 | 277 |
|
278 |
|
|
274 | 279 |
try { |
275 | 280 |
featureSelection.accept(new Visitor() { |
276 | 281 |
|
... | ... | |
291 | 296 |
}); |
292 | 297 |
|
293 | 298 |
featureStore.getFeatureSelection().deselectAll(); |
299 |
featureSelection.dispose(); |
|
300 |
|
|
294 | 301 |
} catch (BaseException e) { |
295 | 302 |
throw new FinishServiceException(e); |
296 | 303 |
} |
Also available in: Unified diff