Changeset 1084 in josm for trunk/src/org/openstreetmap/josm/actions/JosmAction.java
- Timestamp:
- 2008-11-18T19:53:53+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r1023 r1084 12 12 import org.openstreetmap.josm.tools.Destroyable; 13 13 import org.openstreetmap.josm.tools.ImageProvider; 14 import org.openstreetmap.josm.tools.Short Cut;14 import org.openstreetmap.josm.tools.Shortcut; 15 15 16 16 /** … … 26 26 27 27 @Deprecated 28 public KeyStroke short Cut;29 protected Short Cut sc;28 public KeyStroke shortcut; 29 protected Shortcut sc; 30 30 31 public Short Cut getShortCut() {31 public Shortcut getShortcut() { 32 32 if (sc == null) { 33 sc = Short Cut.registerShortCut("core:none", "No Shortcut", 0, ShortCut.GROUP_NONE);33 sc = Shortcut.registerShortcut("core:none", "No Shortcut", 0, Shortcut.GROUP_NONE); 34 34 sc.setAutomatic(); // as this shortcut is shared by all action that don't want to have a shortcut, 35 35 // we shouldn't allow the user to change it... … … 39 39 40 40 @Deprecated 41 public JosmAction(String name, String iconName, String tooltip, int short Cut, int modifier, boolean register) {41 public JosmAction(String name, String iconName, String tooltip, int shortcut, int modifier, boolean register) { 42 42 super(name, iconName == null ? null : ImageProvider.get(iconName)); 43 43 setHelpId(); 44 if (short Cut != 0) {45 int group = Short Cut.GROUP_LAYER; //GROUP_NONE;44 if (shortcut != 0) { 45 int group = Shortcut.GROUP_LAYER; //GROUP_NONE; 46 46 if (((modifier & InputEvent.CTRL_MASK) != 0) || ((modifier & InputEvent.CTRL_DOWN_MASK) != 0)) { 47 group = Short Cut.GROUP_MENU;47 group = Shortcut.GROUP_MENU; 48 48 } else if (modifier == 0) { 49 group = Short Cut.GROUP_EDIT;49 group = Shortcut.GROUP_EDIT; 50 50 } 51 sc = Short Cut.registerShortCut("auto:"+name, name, shortCut, group);52 this.short Cut = sc.getKeyStroke();51 sc = Shortcut.registerShortcut("auto:"+name, name, shortcut, group); 52 this.shortcut = sc.getKeyStroke(); 53 53 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name); 54 54 Main.contentPane.getActionMap().put(name, this); … … 69 69 * tooltip - a longer description of the action that will be displayed in the tooltip. Please note 70 70 * that html is not supported for menu action on some platforms 71 * short Cut - a ready-created shortcut object or null if you don't want a shortcut. But you always71 * shortcut - a ready-created shortcut object or null if you don't want a shortcut. But you always 72 72 * do want a shortcut, remember you can alway register it with group=none, so you 73 73 * won't be assigned a shurtcut unless the user configures one. If you pass null here, … … 75 75 * register - register this action for the toolbar preferences? 76 76 */ 77 public JosmAction(String name, String iconName, String tooltip, Short Cut shortCut, boolean register) {77 public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register) { 78 78 super(name, iconName == null ? null : ImageProvider.get(iconName)); 79 79 setHelpId(); 80 sc = short Cut;80 sc = shortcut; 81 81 if (sc != null) { 82 this.short Cut = sc.getKeyStroke();82 this.shortcut = sc.getKeyStroke(); 83 83 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name); 84 84 Main.contentPane.getActionMap().put(name, this); … … 91 91 92 92 public void destroy() { 93 if (short Cut != null) {93 if (shortcut != null) { 94 94 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(sc.getKeyStroke()); 95 95 Main.contentPane.getActionMap().remove(sc.getKeyStroke());
Note:
See TracChangeset
for help on using the changeset viewer.