Exemple #1
0
  /**
   * Checks if tags of two given ways differ, and presents the user a dialog to solve conflicts
   *
   * @param polygons ways to check
   * @return {@code true} if all conflicts are resolved, {@code false} if conflicts remain.
   */
  private boolean resolveTagConflicts(List<Multipolygon> polygons) {

    List<Way> ways = new ArrayList<Way>();

    for (Multipolygon pol : polygons) {
      ways.add(pol.outerWay);
      ways.addAll(pol.innerWays);
    }

    if (ways.size() < 2) {
      return true;
    }

    TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways);
    try {
      cmds.addAll(CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, ways));
      commitCommands(marktr("Fix tag conflicts"));
      return true;
    } catch (UserCancelException ex) {
      return false;
    }
  }