Changeset 30072 in osm for applications/editors
- Timestamp:
- 2013-11-20T21:53:52+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/terracer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/terracer/build.xml
r29854 r30072 2 2 <project name="terracer" default="dist" basedir="."> 3 3 <property name="commit.message" value="applied #j5760 (patch by robome) - Order of housenumbers not correct"/> 4 <property name="plugin.main.version" value="6 162"/>4 <property name="plugin.main.version" value="6397"/> 5 5 <property name="plugin.author" value="Matt Amos"/> 6 6 <property name="plugin.class" value="terracer.TerracerPlugin"/> -
applications/editors/josm/plugins/terracer/src/terracer/TerracerAction.java
r29623 r30072 70 70 71 71 Collection<Command> commands; 72 73 private Collection<OsmPrimitive> primitives; 74 private TagCollection tagsInConflict; 72 75 73 76 public TerracerAction() { … … 315 318 * @throws UserCancelException 316 319 */ 317 public void terraceBuilding( Way outline,320 public void terraceBuilding(final Way outline, 318 321 Node init, 319 322 Way street, … … 457 460 } 458 461 459 Main.main.undoRedo.add(new SequenceCommand(tr("Terrace"), commands)); 462 Main.main.undoRedo.add(new SequenceCommand(tr("Terrace"), commands) { 463 @Override 464 public boolean executeCommand() { 465 boolean result = super.executeCommand(); 466 if (result) { 467 try { 468 // Build conflicts commands only after all primitives have been added to dataset to fix #8942 469 List<Command> conflictCommands = CombinePrimitiveResolverDialog.launchIfNecessary( 470 tagsInConflict, primitives, Collections.singleton(outline)); 471 if (!conflictCommands.isEmpty()) { 472 List<Command> newCommands = new ArrayList<Command>(commands); 473 newCommands.addAll(conflictCommands); 474 setSequence(newCommands.toArray(new Command[0])); 475 // Run conflicts commands 476 for (int i = 0; i < conflictCommands.size(); i++) { 477 result = conflictCommands.get(i).executeCommand(); 478 if (!result && !continueOnError) { 479 setSequenceComplete(false); 480 undoCommands(commands.size()+i-1); 481 return false; 482 } 483 } 484 } 485 } catch (UserCancelException e) { 486 // Ignore 487 } 488 } 489 return result; 490 } 491 }); 460 492 if (nb <= 1 && street != null) { 461 493 // Select the way (for quick selection of a new house (with the same way)) … … 483 515 boolean numberAdded = false; 484 516 if (houseNum != null) { 485 Collection<OsmPrimitive>primitives = Arrays.asList(new OsmPrimitive[]{houseNum, outline});517 primitives = Arrays.asList(new OsmPrimitive[]{houseNum, outline}); 486 518 487 519 TagCollection tagsToCopy = TagCollection.unionOfAllPrimitives(primitives).getTagsFor(houseNum.keySet()); 488 TagCollectiontagsInConflict = tagsToCopy.getTagsFor(tagsToCopy.getKeysWithMultipleValues());520 tagsInConflict = tagsToCopy.getTagsFor(tagsToCopy.getKeysWithMultipleValues()); 489 521 tagsToCopy = tagsToCopy.minus(tagsInConflict).minus(TagCollection.from(outline)); 490 522 … … 492 524 this.commands.add(new ChangePropertyCommand(outline, tag.getKey(), tag.getValue())); 493 525 } 494 495 this.commands.addAll(CombinePrimitiveResolverDialog.launchIfNecessary(496 tagsInConflict, primitives, Collections.singleton(outline)));497 526 498 527 buildingAdded = houseNum.hasKey("building");
Note:
See TracChangeset
for help on using the changeset viewer.