Changeset 28857 in osm for applications/editors/josm/plugins/reltoolbox/src
- Timestamp:
- 2012-10-25T18:00:24+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/reltoolbox/src/relcontext
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
r28693 r28857 2 2 3 3 import org.openstreetmap.josm.actions.JosmAction; 4 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;5 4 import org.openstreetmap.josm.command.SequenceCommand; 6 5 import org.openstreetmap.josm.command.Command; … … 13 12 import org.openstreetmap.josm.tools.ImageProvider; 14 13 import org.openstreetmap.josm.gui.DefaultNameFormatter; 15 import org.openstreetmap.josm.data.osm.NameFormatter;16 14 import javax.swing.event.ListSelectionEvent; 17 15 import javax.swing.table.TableColumnModel; … … 313 311 return; 314 312 315 final NameFormatter formatter = DefaultNameFormatter.getInstance(); 316 Set<Relation> relations = new TreeSet<Relation>(new Comparator<Relation>() { 317 public int compare( Relation r1, Relation r2 ) { 318 int diff = r1.getDisplayName(formatter).compareTo(r2.getDisplayName(formatter)); 319 return diff != 0 ? diff : r1.compareTo(r2); 320 } 321 }); 313 Set<Relation> relations = new TreeSet<Relation>( 314 DefaultNameFormatter.getInstance().getRelationComparator()); 322 315 for( OsmPrimitive element : newSelection ) { 323 316 for( OsmPrimitive ref : element.getReferrers() ) { -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java
r28805 r28857 11 11 import org.openstreetmap.josm.Main; 12 12 import org.openstreetmap.josm.actions.JosmAction; 13 import org.openstreetmap.josm.data.osm.NameFormatter;14 13 import org.openstreetmap.josm.data.osm.Relation; 15 14 import org.openstreetmap.josm.gui.DefaultNameFormatter; … … 161 160 } 162 161 163 final NameFormatter formatter = DefaultNameFormatter.getInstance(); 164 Collections.sort(relations, new Comparator<Relation>() { 165 public int compare( Relation r1, Relation r2 ) { 166 return r1.getDisplayName(formatter).compareTo(r2.getDisplayName(formatter)); 167 } 168 }); 162 Collections.sort(relations, DefaultNameFormatter.getInstance().getRelationComparator()); 169 163 data.setRelations(relations); 170 164 }
Note:
See TracChangeset
for help on using the changeset viewer.