Ticket #14566: prevent_same_layer.diff

File prevent_same_layer.diff, 1.2 KB (added by bagage, 9 years ago)

patch proposal v2

  • src/org/openstreetmap/josm/plugins/conflation/config/SettingsDialog.java

    diff --git a/src/org/openstreetmap/josm/plugins/conflation/config/SettingsDialog.java b/src/org/openstreetmap/josm/plugins/conflation/config/SettingsDialog.java
    index 1f42538..e3bc80d 100644
    a b public class SettingsDialog extends ExtendedDialog {  
    616616        int numWays = 0;
    617617        int numRelations = 0;
    618618
     619        // if subject and reference sets are the same, hint user that this must be wrong
     620        if (subjectLayer != null && subjectLayer == referenceLayer && ! subjectSelection.isEmpty()) {
     621            boolean identicalSet = (subjectSelection.size() == referenceSelection.size() && subjectSelection.containsAll(referenceSelection));
     622            if (identicalSet) {
     623                JOptionPane.showMessageDialog(Main.parent,
     624                        tr("Reference and subject sets should be different."), tr("Warning"),
     625                        JOptionPane.WARNING_MESSAGE);
     626            }
     627        }
     628
    619629        if (!subjectSelection.isEmpty()) {
    620630            for (OsmPrimitive p : subjectSelection) {
    621631                if (p instanceof Node) {