Changeset 5564 in josm for trunk/src


Ignore:
Timestamp:
2012-11-04T11:22:18+01:00 (12 years ago)
Author:
jttt
Message:

sort markers by time after merging (so that Jump to next/previous marker actions works as expected)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r5502 r5564  
    1818import java.util.ArrayList;
    1919import java.util.Collection;
     20import java.util.Collections;
     21import java.util.Comparator;
    2022import java.util.List;
    2123
     
    199201        MarkerLayer layer = (MarkerLayer)from;
    200202        data.addAll(layer.data);
     203        Collections.sort(data, new Comparator<Marker>() {
     204            @Override
     205            public int compare(Marker o1, Marker o2) {
     206                return Double.compare(o1.time, o2.time);
     207            }
     208        });
    201209    }
    202210
Note: See TracChangeset for help on using the changeset viewer.