Changeset 8850 in josm for trunk/src/org
- Timestamp:
- 2015-10-10T15:15:14+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r8836 r8850 255 255 wayDataList.get(0).calcDirections(Direction.RIGHT); 256 256 double refHeading = wayDataList.get(0).heading; 257 EastNorth totSum = new EastNorth(0., 0.); 257 258 for (WayData w : wayDataList) { 258 259 w.calcDirections(Direction.RIGHT); 259 260 int directionOffset = angleToDirectionChange(w.heading - refHeading, TOLERANCE2); 260 261 w.calcDirections(Direction.RIGHT.changeBy(directionOffset)); 261 if (angleToDirectionChange(refHeading - w.heading, TOLERANCE2) != 0) throw new RuntimeException(); 262 } 263 EastNorth totSum = new EastNorth(0., 0.); 264 for (WayData w : wayDataList) { 262 if (angleToDirectionChange(refHeading - w.heading, TOLERANCE2) != 0) 263 throw new RuntimeException(); 265 264 totSum = EN.sum(totSum, w.segSum); 266 265 } … … 343 342 } 344 343 } 344 345 final Map<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX; 346 347 double average = 0; 345 348 for (Node n : cs) { 346 349 s.remove(n); 347 }348 349 final Map<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX;350 351 double average = 0;352 for (Node n : cs) {353 350 average += nC.get(n).doubleValue(); 354 351 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8840 r8850 652 652 for (int i : is) { 653 653 segSet.add(Pair.sort(new Pair<>(w.getNode(i), w.getNode(i+1)))); 654 }655 for (int i : is) {656 654 wnew.addNode(i + 1, n); 657 655 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r8836 r8850 243 243 long idToKeep = 0; 244 244 Relation relationToKeep = relFix.iterator().next(); 245 // Only one relation will be kept - the one with lowest positive ID, if such exist246 // or one "at random" if no such exists. Rest of the relations will be deleted247 for (Relation w: relFix) {248 if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) {249 idToKeep = w.getId();250 relationToKeep = w;251 }252 }253 254 245 // Find the relation that is member of one or more relations. (If any) 255 246 Relation relationWithRelations = null; … … 262 253 relationWithRelations = w; 263 254 relRef = rel; 255 } 256 // Only one relation will be kept - the one with lowest positive ID, if such exist 257 // or one "at random" if no such exists. Rest of the relations will be deleted 258 if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) { 259 idToKeep = w.getId(); 260 relationToKeep = w; 264 261 } 265 262 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r8836 r8850 253 253 long idToKeep = 0; 254 254 Way wayToKeep = ways.iterator().next(); 255 // Only one way will be kept - the one with lowest positive ID, if such exist256 // or one "at random" if no such exists. Rest of the ways will be deleted257 for (Way w: ways) {258 if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) {259 idToKeep = w.getId();260 wayToKeep = w;261 }262 }263 264 255 // Find the way that is member of one or more relations. (If any) 265 256 Way wayWithRelations = null; … … 273 264 relations = rel; 274 265 } 266 // Only one way will be kept - the one with lowest positive ID, if such exist 267 // or one "at random" if no such exists. Rest of the ways will be deleted 268 if (!w.isNew() && (idToKeep == 0 || w.getId() < idToKeep)) { 269 idToKeep = w.getId(); 270 wayToKeep = w; 271 } 275 272 } 276 273 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r8836 r8850 259 259 } 260 260 } 261 }262 263 for (SourceEntry def : defaults) {264 261 knownDefaults.add(def.url); 265 262 } -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r8540 r8850 503 503 } 504 504 } 505 } 506 for (Entry<Integer, Layer> e : layersMap.entrySet()) { 507 Layer l = e.getValue(); 508 if (l == null) { 509 continue; 510 } 511 512 l.setName(names.get(e.getKey())); 513 layers.add(l); 505 layer.setName(names.get(entry.getKey())); 506 layers.add(layer); 514 507 } 515 508 }
Note:
See TracChangeset
for help on using the changeset viewer.