Changeset 4926 in josm
- Timestamp:
- 2012-02-13T21:53:14+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r4919 r4926 973 973 class SortAction extends AbstractAction implements TableModelListener { 974 974 public SortAction() { 975 putValue(SHORT_DESCRIPTION, tr("Sort the relation members"));975 String tooltip = tr("Sort the relation members"); 976 976 putValue(SMALL_ICON, ImageProvider.get("dialogs", "sort")); 977 977 putValue(NAME, tr("Sort")); 978 // Shortcut.register Shortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_HOME, Shortcut.GROUP_MNEMONIC) 978 Shortcut sc = Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), 979 KeyEvent.VK_END, Shortcut.GROUP_DIRECT2); 980 sc.setAccelerator(this); 981 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 979 982 updateEnabledState(); 980 983 } … … 998 1001 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "reverse")); 999 1002 putValue(NAME, tr("Reverse")); 1000 // Shortcut.register Shortcut("relationeditor:reverse", tr("Relation Editor: Reverse"), KeyEvent.VK_END, Shortcut.GROUP_MNEMONIC) 1003 // Shortcut.register Shortcut("relationeditor:reverse", tr("Relation Editor: Reverse"), 1004 // KeyEvent.VK_END, Shortcut.GROUP_DIRECT2) 1001 1005 updateEnabledState(); 1002 1006 } … … 1017 1021 class MoveUpAction extends AbstractAction implements ListSelectionListener { 1018 1022 public MoveUpAction() { 1019 putValue(SHORT_DESCRIPTION, tr("Move the currently selected members up"));1023 String tooltip = tr("Move the currently selected members up"); 1020 1024 putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup")); 1021 1025 // putValue(NAME, tr("Move Up")); 1022 putValue(ACCELERATOR_KEY,1023 Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_UP, Shortcut.GROUP_MNEMONIC)1024 .getKeyStroke()1025 );1026 Shortcut sc = Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), 1027 KeyEvent.VK_UP, Shortcut.GROUP_DIRECT2); 1028 sc.setAccelerator(this); 1029 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 1026 1030 setEnabled(false); 1027 1031 } … … 1038 1042 class MoveDownAction extends AbstractAction implements ListSelectionListener { 1039 1043 public MoveDownAction() { 1040 putValue(SHORT_DESCRIPTION, tr("Move the currently selected members down"));1044 String tooltip = tr("Move the currently selected members down"); 1041 1045 putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown")); 1042 1046 // putValue(NAME, tr("Move Down")); 1043 putValue(ACCELERATOR_KEY,1044 Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), KeyEvent.VK_DOWN, Shortcut.GROUP_MNEMONIC)1045 .getKeyStroke()1046 );1047 Shortcut sc = Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), 1048 KeyEvent.VK_DOWN, Shortcut.GROUP_DIRECT2); 1049 sc.setAccelerator(this); 1050 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 1047 1051 setEnabled(false); 1048 1052 } … … 1059 1063 class RemoveAction extends AbstractAction implements ListSelectionListener { 1060 1064 public RemoveAction() { 1061 putValue(SHORT_DESCRIPTION, tr("Remove the currently selected members from this relation"));1065 String tooltip = tr("Remove the currently selected members from this relation"); 1062 1066 putValue(SMALL_ICON, ImageProvider.get("dialogs", "remove")); 1063 1067 putValue(NAME, tr("Remove")); 1064 putValue(ACCELERATOR_KEY, 1065 Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_DELETE, 1066 Shortcut.GROUP_MNEMONIC).getKeyStroke()); 1068 Shortcut sc = Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), 1069 KeyEvent.VK_DELETE, Shortcut.GROUP_DIRECT2); 1070 sc.setAccelerator(this); 1071 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 1067 1072 setEnabled(false); 1068 1073 } … … 1395 1400 class DownloadIncompleteMembersAction extends AbstractAction implements TableModelListener { 1396 1401 public DownloadIncompleteMembersAction() { 1397 putValue(SHORT_DESCRIPTION, tr("Download all incomplete members"));1402 String tooltip = tr("Download all incomplete members"); 1398 1403 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincomplete")); 1399 1404 putValue(NAME, tr("Download Members")); 1400 putValue(ACCELERATOR_KEY, 1401 Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), KeyEvent.VK_HOME, Shortcut.GROUP_MNEMONIC) 1402 .getKeyStroke() 1403 ); 1404 1405 Shortcut sc = Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), 1406 KeyEvent.VK_HOME, Shortcut.GROUP_DIRECT2); 1407 sc.setAccelerator(this); 1408 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc)); 1405 1409 updateEnabledState(); 1406 1410 } … … 1431 1435 putValue(SMALL_ICON, ImageProvider.get("dialogs/relation", "downloadincompleteselected")); 1432 1436 putValue(NAME, tr("Download Members")); 1433 // Shortcut.register Shortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), KeyEvent.VK_K, Shortcut.GROUP_MNEMONIC); 1437 // Shortcut.register Shortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), 1438 // KeyEvent.VK_K, Shortcut.GROUP_DIRECT2) 1434 1439 updateEnabledState(); 1435 1440 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r4923 r4926 84 84 setupGroup(groups, load, Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MNEMONIC,KeyEvent.ALT_DOWN_MASK); 85 85 setupGroup(groups, load, Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK); 86 setupGroup(groups, load, Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_DIRECT3, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK); 86 87 87 88 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_NONE, -1); … … 93 94 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_MNEMONIC, KeyEvent.ALT_DOWN_MASK); 94 95 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK); 96 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT3, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK); 95 97 96 98 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_NONE, -1); … … 102 104 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_MNEMONIC, KeyEvent.ALT_DOWN_MASK); 103 105 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK); 106 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_DIRECT3, KeyEvent.META_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK); 104 107 105 108 return groups; -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r4923 r4926 58 58 setupGroup(groups, load, Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_MNEMONIC,KeyEvent.ALT_DOWN_MASK); 59 59 setupGroup(groups, load, Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK); 60 setupGroup(groups, load, Shortcut.GROUPS_DEFAULT+Shortcut.GROUP_DIRECT3, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK); 60 61 61 62 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_NONE, -1); … … 67 68 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_MNEMONIC, KeyEvent.ALT_DOWN_MASK); 68 69 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK); 70 setupGroup(groups, load, Shortcut.GROUPS_ALT1+Shortcut.GROUP_DIRECT3, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK); 69 71 70 72 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_NONE, -1); … … 76 78 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_MNEMONIC, KeyEvent.ALT_DOWN_MASK); 77 79 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_DIRECT2, KeyEvent.ALT_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK); 80 setupGroup(groups, load, Shortcut.GROUPS_ALT2+Shortcut.GROUP_DIRECT3, KeyEvent.META_DOWN_MASK | KeyEvent.CTRL_DOWN_MASK); 78 81 79 82 return groups; -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r4923 r4926 14 14 import java.util.Map; 15 15 16 import javax.swing.AbstractAction; 16 17 import javax.swing.AbstractButton; 17 18 import javax.swing.JMenu; … … 212 213 } 213 214 } 215 /** 216 * use this to set a actions's accelerator 217 */ 218 public void setAccelerator(AbstractAction action) { 219 if (getKeyStroke() != null) { 220 action.putValue(AbstractAction.ACCELERATOR_KEY, getKeyStroke()); 221 } 222 } 214 223 215 224 /** … … 309 318 */ 310 319 public static final int GROUP_DIRECT2 = 7; 311 public static final int GROUP__MAX = 8; 320 /** 321 * for direct access, remaining modifiers. 322 */ 323 public static final int GROUP_DIRECT3 = 8; 324 public static final int GROUP__MAX = 9; 312 325 public static final int GROUP_RESERVED = 1000; 313 326 public static final int GROUPS_DEFAULT = 0;
Note:
See TracChangeset
for help on using the changeset viewer.