Changeset 5589 in josm for trunk/src/org/openstreetmap/josm/data/APIDataSet.java
- Timestamp:
- 2012-11-18T13:57:36+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r5266 r5589 55 55 public void init(DataSet ds) { 56 56 if (ds == null) return; 57 init(ds.allPrimitives()); 58 } 59 60 public void init(Collection<OsmPrimitive> primitives) { 57 61 toAdd.clear(); 58 62 toUpdate.clear(); 59 63 toDelete.clear(); 60 64 61 for (OsmPrimitive osm : ds.allPrimitives()) {65 for (OsmPrimitive osm :primitives) { 62 66 if (osm.get("josm/ignore") != null) { 63 67 continue; … … 140 144 public APIDataSet(Collection<OsmPrimitive> primitives) { 141 145 this(); 142 toAdd.clear(); 143 toUpdate.clear(); 144 toDelete.clear(); 145 for (OsmPrimitive osm: primitives) { 146 if (osm.isNewOrUndeleted() && !osm.isDeleted()) { 147 toAdd.addLast(osm); 148 } else if (osm.isModified() && !osm.isDeleted()) { 149 toUpdate.addLast(osm); 150 } else if (osm.isDeleted() && !osm.isNew() && osm.isModified() && osm.isVisible()) { 151 toDelete.addFirst(osm); 152 } 153 } 154 OsmPrimitiveComparator c = new OsmPrimitiveComparator(); 155 c.relationsFirst = true; 156 Collections.sort(toDelete, c); 157 Collections.sort(toAdd, c); 158 Collections.sort(toUpdate, c); 146 init(primitives); 159 147 } 160 148
Note:
See TracChangeset
for help on using the changeset viewer.