- Timestamp:
- 2010-03-12T16:12:19+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r3114 r3123 18 18 import java.util.Collection; 19 19 import java.util.Collections; 20 import java.util.Comparator;21 20 import java.util.HashSet; 22 21 import java.util.LinkedList; 23 22 import java.util.List; 24 23 import java.util.Set; 24 import java.util.logging.Logger; 25 25 26 26 import javax.swing.AbstractAction; … … 47 47 import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting; 48 48 import org.openstreetmap.josm.data.SelectionChangedListener; 49 import org.openstreetmap.josm.data.osm.NameFormatter;50 49 import org.openstreetmap.josm.data.osm.Node; 51 50 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 65 64 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 66 65 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 67 import org.openstreetmap.josm.gui.DefaultNameFormatter;68 66 import org.openstreetmap.josm.gui.MapView; 69 67 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; … … 81 79 */ 82 80 public class SelectionListDialog extends ToggleDialog { 81 static private final Logger logger = Logger.getLogger(SelectionListDialog.class.getName()); 83 82 84 83 private JList lstPrimitives; … … 518 517 } 519 518 this.selection.addAll(selection); 520 sort();521 519 fireContentsChanged(this, 0, getSize()); 522 520 remember(selection); 523 }524 525 /**526 * Sorts the primitives in the list527 */528 public void sort() {529 Collections.sort(530 this.selection,531 new Comparator<OsmPrimitive>() {532 NameFormatter nf = DefaultNameFormatter.getInstance();533 534 public int compare(OsmPrimitive o1, OsmPrimitive o2) {535 if (o1.getType() != o2.getType())536 return o1.getType().compareTo(o2.getType());537 return o1.getDisplayName(nf).compareTo(o2.getDisplayName(nf));538 }539 }540 );541 521 } 542 522
Note:
See TracChangeset
for help on using the changeset viewer.