Changeset 4104 in josm
- Timestamp:
- 2011-05-30T09:58:49+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r4100 r4104 72 72 sortDeleted(); 73 73 sortNew(); 74 sortUpdated(); 74 75 } 75 76 … … 133 134 ); 134 135 } 136 /* 137 * Sort list of updated elements, so it looks neat in the confirmation dialog. 138 */ 139 protected void sortUpdated() { 140 Collections.sort( 141 toUpdate, 142 new Comparator<OsmPrimitive>() { 143 public int compare(OsmPrimitive o1, OsmPrimitive o2) { 144 if (o1 instanceof Node && o2 instanceof Node) 145 return 0; 146 else if (o1 instanceof Node) 147 return -1; 148 else if (o2 instanceof Node) 149 return 1; 150 151 if (o1 instanceof Way && o2 instanceof Way) 152 return 0; 153 else if (o1 instanceof Way && o2 instanceof Relation) 154 return -1; 155 else if (o2 instanceof Way && o1 instanceof Relation) 156 return 1; 157 158 return 0; 159 } 160 } 161 ); 162 } 163 135 164 /** 136 165 * initializes the API data set with the modified primitives in <code>ds</code>
Note:
See TracChangeset
for help on using the changeset viewer.