Changeset 11172 in josm
- Timestamp:
- 2016-10-26T21:23:28+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r11170 r11172 8 8 import java.util.Arrays; 9 9 import java.util.Collection; 10 import java.util.Comparator; 10 11 import java.util.HashMap; 11 import java.util.LinkedList;12 12 import java.util.List; 13 13 import java.util.Map; … … 366 366 Main.platform.initSystemShortcuts(); 367 367 // (2) User defined shortcuts 368 List<Shortcut> newshortcuts = new LinkedList<>(); 369 for (String s : Main.pref.getAllPrefixCollectionKeys("shortcut.entry.")) { 370 newshortcuts.add(new Shortcut(s)); 371 } 372 373 for (Shortcut sc : newshortcuts) { 374 if (sc.isAssignedUser() 375 && findShortcut(sc.getAssignedKey(), sc.getAssignedModifier()) == null) { 376 shortcuts.add(sc); 377 } 378 } 379 // Shortcuts at their default values 380 for (Shortcut sc : newshortcuts) { 381 if (!sc.isAssignedUser() && sc.isAssignedDefault() 382 && findShortcut(sc.getAssignedKey(), sc.getAssignedModifier()) == null) { 383 shortcuts.add(sc); 384 } 385 } 386 // Shortcuts that were automatically moved 387 for (Shortcut sc : newshortcuts) { 388 if (!sc.isAssignedUser() && !sc.isAssignedDefault() 389 && findShortcut(sc.getAssignedKey(), sc.getAssignedModifier()) == null) { 390 shortcuts.add(sc); 391 } 392 } 368 Main.pref.getAllPrefixCollectionKeys("shortcut.entry.").stream() 369 .map(Shortcut::new) 370 .filter(sc -> findShortcut(sc.getAssignedKey(), sc.getAssignedModifier()) == null) 371 .sorted(Comparator.comparing(sc -> sc.isAssignedUser() ? 1 : sc.isAssignedDefault() ? 2 : 3)) 372 .forEachOrdered(shortcuts::add); 393 373 } 394 374
Note:
See TracChangeset
for help on using the changeset viewer.