- Timestamp:
- 2017-09-30T14:40:47+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r12846 r12909 87 87 import org.openstreetmap.josm.tools.SubclassFilteredCollection; 88 88 import org.openstreetmap.josm.tools.Utils; 89 import org.openstreetmap.josm.tools.bugreport.BugReport; 89 90 90 91 /** … … 464 465 * 465 466 */ 466 privatestatic class SelectionListModel extends AbstractListModel<OsmPrimitive>467 static class SelectionListModel extends AbstractListModel<OsmPrimitive> 467 468 implements ActiveLayerChangeListener, SelectionChangedListener, DataSetListener { 468 469 … … 662 663 */ 663 664 public synchronized void sort() { 664 if (selection.size() <= Config.getPref().getInt("selection.no_sort_above", 100_000)) { 665 boolean quick = selection.size() > Config.getPref().getInt("selection.fast_sort_above", 10_000); 665 int size = selection.size(); 666 if (size > 1 && size <= Config.getPref().getInt("selection.no_sort_above", 100_000)) { 667 boolean quick = size > Config.getPref().getInt("selection.fast_sort_above", 10_000); 666 668 Comparator<OsmPrimitive> c = Config.getPref().getBoolean("selection.sort_relations_before_ways", true) 667 669 ? OsmPrimitiveComparator.orderingRelationsWaysNodes() 668 670 : OsmPrimitiveComparator.orderingWaysRelationsNodes(); 669 selection.sort(c.thenComparing(quick 670 ? OsmPrimitiveComparator.comparingUniqueId() 671 : OsmPrimitiveComparator.comparingNames())); 671 try { 672 selection.sort(c.thenComparing(quick 673 ? OsmPrimitiveComparator.comparingUniqueId() 674 : OsmPrimitiveComparator.comparingNames())); 675 } catch (IllegalArgumentException e) { 676 throw BugReport.intercept(e).put("size", size).put("quick", quick).put("selection", selection); 677 } 672 678 } 673 679 } -
trunk/src/org/openstreetmap/josm/tools/AlphanumComparator.java
r8928 r12909 9 9 * The Alphanum Algorithm is discussed at http://www.DaveKoelle.com 10 10 * 11 * Released under the MIT License - https://opensource.org/licenses/MIT 11 12 * 12 * This library is free software; you can redistribute it and/or modify it under 13 * the terms of the GNU Lesser General Public License as published by the Free 14 * Software Foundation; either version 2.1 of the License, or any later version. 13 * Copyright 2007-2017 David Koelle 15 14 * 16 * This library is distributed in the hope that it will be useful, but WITHOUT 17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 19 * details. 15 * Permission is hereby granted, free of charge, to any person obtaining 16 * a copy of this software and associated documentation files (the "Software"), 17 * to deal in the Software without restriction, including without limitation 18 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 19 * and/or sell copies of the Software, and to permit persons to whom the 20 * Software is furnished to do so, subject to the following conditions: 20 21 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * along with this library; if not, write to the Free Software Foundation, Inc., 23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 * The above copyright notice and this permission notice shall be included 23 * in all copies or substantial portions of the Software. 24 24 * 25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 28 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 29 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 30 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 31 * USE OR OTHER DEALINGS IN THE SOFTWARE. 25 32 */ 26 33 import java.io.Serializable; … … 37 44 * 38 45 * This is an updated version with enhancements made by Daniel Migowski, Andre 39 * Bogus, andDavid Koelle and others.46 * Bogus, David Koelle and others. 40 47 * 41 48 */
Note:
See TracChangeset
for help on using the changeset viewer.