Ignore:
Timestamp:
2009-07-08T21:50:32+02:00 (17 years ago)
Author:
Gubaer
Message:

new: replaced global conflict list by conflict list per layer, similar to datasets

Location:
trunk/src/org/openstreetmap/josm/data
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r1747 r1750  
    55
    66import org.openstreetmap.josm.Main;
     7import org.openstreetmap.josm.data.coor.CachedLatLon;
    78import org.openstreetmap.josm.data.coor.EastNorth;
    8 import org.openstreetmap.josm.data.coor.CachedLatLon;
    99import org.openstreetmap.josm.data.coor.LatLon;
    1010import org.openstreetmap.josm.data.coor.LatLon.CoordinateFormat;
    11 import org.openstreetmap.josm.data.projection.Projection;
    1211import org.openstreetmap.josm.data.osm.visitor.Visitor;
    13 import org.openstreetmap.josm.data.osm.Node;
    1412
    1513/**
    … …  
    2523        if(coor != null)
    2624        {
    27             if(this.coor == null)
     25            if(this.coor == null) {
    2826                this.coor = new CachedLatLon(coor);
    29             else
     27            } else {
    3028                this.coor.setCoor(coor);
     29            }
    3130        }
    3231    }
    … …  
    3938        if(eastNorth != null)
    4039        {
    41             if(coor != null)
     40            if(coor != null) {
    4241                coor.setEastNorth(eastNorth);
    43             else
     42            } else {
    4443                coor = new CachedLatLon(eastNorth);
     44            }
    4545        }
    4646    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java

    r1701 r1750  
    1010import java.util.logging.Logger;
    1111
     12import org.openstreetmap.josm.data.conflict.ConflictCollection;
    1213import org.openstreetmap.josm.data.osm.DataSet;
    1314import org.openstreetmap.josm.data.osm.Node;
    … …  
    3132     * round than merged)
    3233     */
    33     private Map<OsmPrimitive, OsmPrimitive> conflicts;
     34    private ConflictCollection conflicts;
     35
    3436
    3537    private final DataSet myDataSet;
    … …  
    6870            relshash.put(r.id, r);
    6971        }
    70         conflicts = new HashMap<OsmPrimitive, OsmPrimitive>();
     72        conflicts = new ConflictCollection();
    7173        merged = new HashMap<OsmPrimitive, OsmPrimitive>();
    7274    }
    … …  
    113115                        // differences in deleted state have to be merged manually
    114116                        //
    115                         conflicts.put(my, other);
     117                        conflicts.add(my, other);
    116118                    } else {
    117119                        // copy the technical attributes from other
    … …  
    158160            fixRelation(r);
    159161        }
    160         for (OsmPrimitive osm : conflicts.values())
     162        for (OsmPrimitive osm : conflicts.getMyConflictParties())
    161163            if (osm instanceof Way) {
    162164                fixWay((Way)osm);
    … …  
    235237                    // because it was deleted on the server.
    236238                    //
    237                     conflicts.put(my,other);
     239                    conflicts.add(my,other);
    238240                } else if (my.incomplete) {
    239241                    // my is incomplete, other completes it
    … …  
    250252                    // differences in deleted state have to be resolved manually
    251253                    //
    252                     conflicts.put(my,other);
     254                    conflicts.add(my,other);
    253255                } else if (! my.modified && other.modified) {
    254256                    // my not modified. We can assume that other is the most recent version.
    … …  
    278280                    // resolve the differences
    279281                    // =>  create a conflict
    280                     conflicts.put(my,other);
     282                    conflicts.add(my,other);
    281283                } else {
    282284                    // clone from other, but keep the modified flag. Clone will mainly copy
    … …  
    326328     * @return the map of conflicts
    327329     */
    328     public Map<OsmPrimitive, OsmPrimitive> getConflicts() {
     330    public ConflictCollection getConflicts() {
    329331        return conflicts;
    330332    }
Note: See TracChangeset for help on using the changeset viewer.