Ignore:
Timestamp:
2008-11-18T19:53:53+01:00 (15 years ago)
Author:
framm
Message:
  • cosmetics: rename ShortCut to Shortcut, and shortCut to shortcut
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r1023 r1084  
    1212import org.openstreetmap.josm.tools.Destroyable;
    1313import org.openstreetmap.josm.tools.ImageProvider;
    14 import org.openstreetmap.josm.tools.ShortCut;
     14import org.openstreetmap.josm.tools.Shortcut;
    1515
    1616/**
     
    2626
    2727        @Deprecated
    28         public KeyStroke shortCut;
    29         protected ShortCut sc;
     28        public KeyStroke shortcut;
     29        protected Shortcut sc;
    3030
    31         public ShortCut getShortCut() {
     31        public Shortcut getShortcut() {
    3232                if (sc == null) {
    33                         sc = ShortCut.registerShortCut("core:none", "No Shortcut", 0, ShortCut.GROUP_NONE);
     33                        sc = Shortcut.registerShortcut("core:none", "No Shortcut", 0, Shortcut.GROUP_NONE);
    3434                        sc.setAutomatic(); // as this shortcut is shared by all action that don't want to have a shortcut,
    3535                                           // we shouldn't allow the user to change it...
     
    3939
    4040        @Deprecated
    41         public JosmAction(String name, String iconName, String tooltip, int shortCut, int modifier, boolean register) {
     41        public JosmAction(String name, String iconName, String tooltip, int shortcut, int modifier, boolean register) {
    4242                super(name, iconName == null ? null : ImageProvider.get(iconName));
    4343                setHelpId();
    44                 if (shortCut != 0) {
    45                         int group = ShortCut.GROUP_LAYER; //GROUP_NONE;
     44                if (shortcut != 0) {
     45                        int group = Shortcut.GROUP_LAYER; //GROUP_NONE;
    4646                        if (((modifier & InputEvent.CTRL_MASK) != 0) || ((modifier & InputEvent.CTRL_DOWN_MASK) != 0)) {
    47                                 group = ShortCut.GROUP_MENU;
     47                                group = Shortcut.GROUP_MENU;
    4848                        } else if (modifier == 0) {
    49                                 group = ShortCut.GROUP_EDIT;
     49                                group = Shortcut.GROUP_EDIT;
    5050                        }
    51                         sc = ShortCut.registerShortCut("auto:"+name, name, shortCut, group);
    52                         this.shortCut = sc.getKeyStroke();
     51                        sc = Shortcut.registerShortcut("auto:"+name, name, shortcut, group);
     52                        this.shortcut = sc.getKeyStroke();
    5353                        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
    5454                        Main.contentPane.getActionMap().put(name, this);
     
    6969         * tooltip - a longer description of the action that will be displayed in the tooltip. Please note
    7070         *           that html is not supported for menu action on some platforms
    71          * shortCut - a ready-created shortcut object or null if you don't want a shortcut. But you always
     71         * shortcut - a ready-created shortcut object or null if you don't want a shortcut. But you always
    7272         *            do want a shortcut, remember you can alway register it with group=none, so you
    7373         *            won't be assigned a shurtcut unless the user configures one. If you pass null here,
     
    7575         * register - register this action for the toolbar preferences?
    7676         */
    77         public JosmAction(String name, String iconName, String tooltip, ShortCut shortCut, boolean register) {
     77        public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register) {
    7878                super(name, iconName == null ? null : ImageProvider.get(iconName));
    7979                setHelpId();
    80                 sc = shortCut;
     80                sc = shortcut;
    8181                if (sc != null) {
    82                         this.shortCut = sc.getKeyStroke();
     82                        this.shortcut = sc.getKeyStroke();
    8383                        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
    8484                        Main.contentPane.getActionMap().put(name, this);
     
    9191
    9292        public void destroy() {
    93                 if (shortCut != null) {
     93                if (shortcut != null) {
    9494                        Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(sc.getKeyStroke());
    9595                        Main.contentPane.getActionMap().remove(sc.getKeyStroke());
Note: See TracChangeset for help on using the changeset viewer.