Ignore:
Timestamp:
2008-12-25T18:58:04+01:00 (15 years ago)
Author:
stoecker
Message:

fixed bug #1871, removed all deprecations

File:
1 edited

Legend:

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

    r1169 r1180  
    2525abstract public class JosmAction extends AbstractAction implements Destroyable {
    2626
    27     @Deprecated
    28     public KeyStroke shortcut;
    2927    protected Shortcut sc;
    3028
     
    3634        }
    3735        return sc;
    38     }
    39 
    40     @Deprecated
    41     public JosmAction(String name, String iconName, String tooltip, int shortcut, int modifier, boolean register) {
    42         super(name, iconName == null ? null : ImageProvider.get(iconName));
    43         setHelpId();
    44         if (shortcut != 0) {
    45             int group = Shortcut.GROUP_LAYER; //GROUP_NONE;
    46             if (((modifier & InputEvent.CTRL_MASK) != 0) || ((modifier & InputEvent.CTRL_DOWN_MASK) != 0)) {
    47                 group = Shortcut.GROUP_MENU;
    48             } else if (modifier == 0) {
    49                 group = Shortcut.GROUP_EDIT;
    50             }
    51             sc = Shortcut.registerShortcut("auto:"+name, name, shortcut, group);
    52             this.shortcut = sc.getKeyStroke();
    53             Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
    54             Main.contentPane.getActionMap().put(name, this);
    55         }
    56         putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));
    57         putValue("toolbar", iconName);
    58     if (register)
    59         Main.toolbar.register(this);
    6036    }
    6137
     
    8056        sc = shortcut;
    8157        if (sc != null) {
    82             this.shortcut = sc.getKeyStroke();
    8358            Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
    8459            Main.contentPane.getActionMap().put(name, this);
     
    9166
    9267    public void destroy() {
    93         if (shortcut != null) {
     68        if (sc != null) {
    9469            Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(sc.getKeyStroke());
    9570            Main.contentPane.getActionMap().remove(sc.getKeyStroke());
Note: See TracChangeset for help on using the changeset viewer.