Changeset 14211 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-08-31T23:28:55+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r14204 r14211 292 292 if (commands.isEmpty()) 293 293 return; 294 GuiHelper.runInEDTAndWait(new Runnable() { 295 @Override 296 public void run() { 297 DataSet ds = OsmDataManager.getInstance().getEditDataSet(); 298 if (ds != null) { 299 ds.beginUpdate(); 300 } 301 try { 302 for (int i = 1; i <= num; ++i) { 303 final Command c = commands.removeLast(); 304 c.undoCommand(); 305 redoCommands.addFirst(c); 306 fireEvent(new CommandUndoneEvent(UndoRedoHandler.this, c)); 307 if (commands.isEmpty()) { 308 break; 309 } 310 } 311 } finally { 312 if (ds != null) { 313 ds.endUpdate(); 294 GuiHelper.runInEDTAndWait(() -> { 295 DataSet ds = OsmDataManager.getInstance().getEditDataSet(); 296 if (ds != null) { 297 ds.beginUpdate(); 298 } 299 try { 300 for (int i = 1; i <= num; ++i) { 301 final Command c = commands.removeLast(); 302 c.undoCommand(); 303 redoCommands.addFirst(c); 304 fireEvent(new CommandUndoneEvent(UndoRedoHandler.this, c)); 305 if (commands.isEmpty()) { 306 break; 314 307 } 315 308 } 316 fireCommandsChanged(); 309 } finally { 310 if (ds != null) { 311 ds.endUpdate(); 312 } 317 313 } 318 314 fireCommandsChanged(); 319 315 }); 320 316 } -
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
r14209 r14211 3 3 4 4 import java.util.ArrayList; 5 import java.util.Comparator;6 5 import java.util.Date; 7 6 import java.util.List; … … 60 59 //sort segments by first waypoint 61 60 if (!segs.isEmpty()) { 62 segs.sort(new Comparator<List<WayPoint>>() { 63 @Override 64 public int compare(List<WayPoint> o1, List<WayPoint> o2) { 65 if (o1.isEmpty() || o2.isEmpty()) 66 return 0; 67 return Double.compare(o1.get(0).time, o2.get(0).time); 68 } 61 segs.sort((o1, o2) -> { 62 if (o1.isEmpty() || o2.isEmpty()) 63 return 0; 64 return Double.compare(o1.get(0).time, o2.get(0).time); 69 65 }); 70 66 trks.add(segs); … … 72 68 } 73 69 //sort tracks by first waypoint of first segment 74 trks.sort(new Comparator<List<List<WayPoint>>>() { 75 @Override 76 public int compare(List<List<WayPoint>> o1, List<List<WayPoint>> o2) { 77 if (o1.isEmpty() || o1.get(0).isEmpty() 78 || o2.isEmpty() || o2.get(0).isEmpty()) 79 return 0; 80 return Double.compare(o1.get(0).get(0).time, o2.get(0).get(0).time); 81 } 70 trks.sort((o1, o2) -> { 71 if (o1.isEmpty() || o1.get(0).isEmpty() 72 || o2.isEmpty() || o2.get(0).isEmpty()) 73 return 0; 74 return Double.compare(o1.get(0).get(0).time, o2.get(0).get(0).time); 82 75 }); 83 76
Note:
See TracChangeset
for help on using the changeset viewer.