Changeset 5002 in josm for trunk/src/org
- Timestamp:
- 2012-02-19T19:43:23+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r4982 r5002 382 382 383 383 public static void registerActionShortcut(Action action, Shortcut shortcut) { 384 registerActionShortcut(action, shortcut.getKeyStroke()); 385 } 386 387 public static void registerActionShortcut(Action action, KeyStroke keyStroke) { 384 KeyStroke keyStroke = shortcut.getKeyStroke(); 388 385 if (keyStroke == null) 389 386 return; … … 411 408 contentPanePrivate.getActionMap().remove(action); 412 409 } 413 414 410 415 411 /////////////////////////////////////////////////////////////////////////// -
trunk/src/org/openstreetmap/josm/command/PseudoCommand.java
r4918 r5002 15 15 abstract public class PseudoCommand { 16 16 /** 17 * Provide a description that can be presented in a list or tree view.18 * @deprecated This abstract method is deprecated.19 * On 2012-03-01, this abstract method will be removed.20 * At the same moment, the methods {@link #getDescrpitionText()} and {@link #getDescrpitionIcon()}21 * will be made abstract.22 * For a smooth transition, replace {@link #getDescription()} by implementations of23 * {@link #getDescrpitionText()} and {@link #getDescrpitionIcon()} as early as possible.24 * {@link #getDescription()} is no longer abstract and can therefore be removed.25 */26 @Deprecated27 public Object getDescription() {28 return null;29 }30 31 /**32 17 * Provides a description text representing this command. 33 18 */ 34 public String getDescriptionText() { 35 Object o = getDescription(); 36 if (o instanceof JLabel) { 37 return ((JLabel) o).getText(); 38 } else { 39 return o.toString(); 40 } 41 } 19 abstract public String getDescriptionText(); 42 20 43 21 /** … … 45 23 */ 46 24 public Icon getDescriptionIcon() { 47 Object o = getDescription(); 48 if (o instanceof JLabel) { 49 return ((JLabel) o).getIcon(); 50 } else { 51 return null; 52 } 25 return null; 53 26 } 54 27 -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r4993 r5002 290 290 KeyEvent.VK_F9, KeyEvent.VK_F10, KeyEvent.VK_F11, KeyEvent.VK_F12}; 291 291 292 /* old */293 @Deprecated public static final int GROUP_NONE = 0;294 @Deprecated public static final int GROUP_HOTKEY = 1;295 @Deprecated public static final int GROUP_MENU = 2;296 @Deprecated public static final int GROUP_EDIT = 3;297 @Deprecated public static final int GROUP_LAYER = 4;298 @Deprecated public static final int GROUP_DIRECT = 5;299 @Deprecated public static final int GROUP_MNEMONIC = 6;300 @Deprecated public static final int GROUP_DIRECT2 = 7;301 @Deprecated public static final int GROUP_DIRECT3 = 8;302 @Deprecated public static final int GROUPS_DEFAULT = 0;303 @Deprecated public static final int GROUPS_ALT1 = 100;304 @Deprecated public static final int GROUPS_ALT2 = 200;305 @Deprecated public static final int SHIFT_DEFAULT = 1;306 @Deprecated public static Shortcut registerShortcut(String shortText, String longText, int requestedKey, int requestedGroup, int modifier) {307 return registerShortcut(shortText, longText, requestedKey, requestedGroup, new Integer(modifier));308 }309 310 292 // bootstrap 311 293 private static boolean initdone = false; … … 324 306 groups.put(ALT_CTRL_SHIFT, KeyEvent.ALT_DOWN_MASK|KeyEvent.CTRL_DOWN_MASK|KeyEvent.SHIFT_DOWN_MASK); 325 307 326 /* old */327 groups.put(GROUPS_DEFAULT+GROUP_NONE, -1);328 groups.put(GROUPS_DEFAULT+GROUP_HOTKEY, KeyEvent.CTRL_DOWN_MASK);329 groups.put(GROUPS_DEFAULT+GROUP_MENU, KeyEvent.CTRL_DOWN_MASK);330 groups.put(GROUPS_DEFAULT+GROUP_EDIT, 0);331 groups.put(GROUPS_DEFAULT+GROUP_LAYER, KeyEvent.ALT_DOWN_MASK);332 groups.put(GROUPS_DEFAULT+GROUP_DIRECT, 0);333 groups.put(GROUPS_DEFAULT+GROUP_MNEMONIC,KeyEvent.ALT_DOWN_MASK);334 groups.put(GROUPS_DEFAULT+GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK);335 groups.put(GROUPS_DEFAULT+GROUP_DIRECT3, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);336 337 groups.put(GROUPS_ALT1+GROUP_NONE, -1);338 groups.put(GROUPS_ALT1+GROUP_HOTKEY, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);339 groups.put(GROUPS_ALT1+GROUP_MENU, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);340 groups.put(GROUPS_ALT1+GROUP_EDIT, KeyEvent.SHIFT_DOWN_MASK);341 groups.put(GROUPS_ALT1+GROUP_LAYER, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);342 groups.put(GROUPS_ALT1+GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK);343 groups.put(GROUPS_ALT1+GROUP_MNEMONIC, KeyEvent.ALT_DOWN_MASK);344 groups.put(GROUPS_ALT1+GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);345 groups.put(GROUPS_ALT1+GROUP_DIRECT3, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);346 347 groups.put(GROUPS_ALT2+GROUP_NONE, -1);348 groups.put(GROUPS_ALT2+GROUP_HOTKEY, KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK);349 groups.put(GROUPS_ALT2+GROUP_MENU, KeyEvent.CTRL_DOWN_MASK | KeyEvent.ALT_DOWN_MASK);350 groups.put(GROUPS_ALT2+GROUP_EDIT, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);351 groups.put(GROUPS_ALT2+GROUP_LAYER, KeyEvent.SHIFT_DOWN_MASK);352 groups.put(GROUPS_ALT2+GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK);353 groups.put(GROUPS_ALT2+GROUP_MNEMONIC, KeyEvent.ALT_DOWN_MASK);354 groups.put(GROUPS_ALT2+GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK);355 groups.put(GROUPS_ALT2+GROUP_DIRECT3, KeyEvent.META_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK);356 357 308 // (1) System reserved shortcuts 358 309 Main.platform.initSystemShortcuts(); … … 393 344 394 345 private static int findModifier(int group, Integer modifier) { 395 Integer defaultModifier = getGroupModifier(group);396 if(modifier != null) {397 if(modifier == SHIFT_DEFAULT) {398 defaultModifier |= KeyEvent.SHIFT_DOWN_MASK;399 } else {400 defaultModifier = modifier;401 }402 }403 else if (defaultModifier == null) { // garbage in, no shortcut out404 defaultModifier = getGroupModifier(NONE);405 }406 return defaultModifier;407 }408 409 /* NEW function:410 private static int findModifier(int group, Integer modifier) {411 346 if(modifier == null) { 412 347 modifier = getGroupModifier(group); … … 416 351 } 417 352 return modifier; 418 } */353 } 419 354 420 355 // shutdown handling
Note:
See TracChangeset
for help on using the changeset viewer.