Revision 83
org.gvsig.vectorediting/trunk/org.gvsig.vectorediting/org.gvsig.vectorediting.swing/org.gvsig.vectorediting.swing.impl/src/main/java/org/gvsig/vectorediting/swing/impl/DefaultEditingBehavior.java | ||
---|---|---|
374 | 374 |
private void finishService() { |
375 | 375 |
EditingService lastService = serviceStack.pop(); |
376 | 376 |
try { |
377 |
if (serviceStack.isEmpty()) { |
|
377 |
if (serviceStack.isEmpty() || !getActiveService().next().getTypes() |
|
378 |
.contains(EditingServiceParameter.TYPE.GEOMETRY)) { |
|
378 | 379 |
lastService.finishAndStore(); |
379 | 380 |
mapControl.rePaintDirtyLayers(); |
380 | 381 |
setActiveService(lastService); |
381 | 382 |
} |
382 |
else if (getActiveService().next().getTypes() |
|
383 |
else if (!serviceStack.isEmpty() && getActiveService().next().getTypes()
|
|
383 | 384 |
.contains(EditingServiceParameter.TYPE.GEOMETRY)) { |
384 |
Object geometry = lastService.finish(); |
|
385 |
getActiveService().value(geometry); |
|
385 |
Geometry geometry = lastService.finish(); |
|
386 |
if(geometry != null){ |
|
387 |
getActiveService().value(geometry); |
|
388 |
} else { |
|
389 |
lastService.finishAndStore(); |
|
390 |
mapControl.rePaintDirtyLayers(); |
|
391 |
setActiveService(lastService); |
|
392 |
} |
|
386 | 393 |
} |
387 | 394 |
lastService.stop(); |
388 | 395 |
lastService.start(); |
... | ... | |
391 | 398 |
showConsoleMessage(i18nManager.getTranslation("invalid_option")); |
392 | 399 |
} |
393 | 400 |
catch (FinishServiceException ex) { |
394 |
logger.error("", ex);
|
|
401 |
logger.error("Can't finish "+ lastService.getName(), ex);
|
|
395 | 402 |
} |
396 | 403 |
catch (StopServiceException ex) { |
397 |
logger.error("", ex);
|
|
404 |
logger.error("Can't stop "+ lastService.getName(), ex);
|
|
398 | 405 |
} |
399 | 406 |
catch (StartServiceException ex) { |
400 |
logger.error("", ex);
|
|
407 |
logger.error("Can't start "+ lastService.getName(), ex);
|
|
401 | 408 |
} |
402 | 409 |
getNextParameter(); |
403 | 410 |
} |
Also available in: Unified diff