Changeset 4953 in josm for trunk/src/org


Ignore:
Timestamp:
2012-02-16T13:20:24+01:00 (8 years ago)
Author:
stoecker
Message:

fix some shortcut deprecations

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r4842 r4953  
    6969    public FilterDialog(){
    7070        super(tr("Filter"), "filter", tr("Filter objects and hide/disable them."),
    71                 Shortcut.registerShortcut("subwindow:filter", tr("Toggle: {0}", tr("Filter")), KeyEvent.VK_F, Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 162);
     71                Shortcut.registerShortcut("subwindow:filter", tr("Toggle: {0}", tr("Filter")),
     72                KeyEvent.VK_F, Shortcut.GROUP_LAYER+Shortcut.GROUPS_ALT1), 162);
    7273        build();
    7374
     
    8990    }
    9091
    91     private static final KeyStroke ENABLE_FILTER_SHORTCUT
    92     = Shortcut.registerShortcut("core_multikey:enableFilter", tr("Multikey: {0}", tr("Enable filter")), KeyEvent.VK_E, Shortcut.GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK).getKeyStroke();
    93 
    94     private static final KeyStroke HIDING_FILTER_SHORTCUT
    95     = Shortcut.registerShortcut("core_multikey:hidingFilter", tr("Multikey: {0}", tr("Hide filter")), KeyEvent.VK_H, Shortcut.GROUP_DIRECT, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK).getKeyStroke();
     92    private static final Shortcut ENABLE_FILTER_SHORTCUT
     93    = Shortcut.registerShortcut("core_multikey:enableFilter", tr("Multikey: {0}", tr("Enable filter")),
     94    KeyEvent.VK_E, Shortcut.GROUP_DIRECT2+Shortcut.GROUPS_ALT2);
     95
     96    private static final Shortcut HIDING_FILTER_SHORTCUT
     97    = Shortcut.registerShortcut("core_multikey:hidingFilter", tr("Multikey: {0}", tr("Hide filter")),
     98    KeyEvent.VK_H, Shortcut.GROUP_DIRECT2+Shortcut.GROUPS_ALT2);
    9699
    97100
    98101    protected final String[] columnToolTips = {
    99             tr("Enable filter ({0}+{1})", KeyEvent.getKeyModifiersText(ENABLE_FILTER_SHORTCUT.getModifiers()), KeyEvent.getKeyText(ENABLE_FILTER_SHORTCUT.getKeyCode())),
    100             tr("Hiding filter ({0}+{1})", KeyEvent.getKeyModifiersText(HIDING_FILTER_SHORTCUT.getModifiers()), KeyEvent.getKeyText(HIDING_FILTER_SHORTCUT.getKeyCode())),
     102            Main.platform.makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT),
     103            Main.platform.makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT),
    101104            null,
    102105            tr("Inverse filter"),
     
    334337        EnableFilterAction() {
    335338            putValue(SHORT_DESCRIPTION, tr("Enable filter"));
    336             putValue(ACCELERATOR_KEY, ENABLE_FILTER_SHORTCUT);
     339            ENABLE_FILTER_SHORTCUT.setAccelerator(this);
    337340        }
    338341
     
    353356        public HidingFilterAction() {
    354357            putValue(SHORT_DESCRIPTION, tr("Hiding filter"));
    355             putValue(ACCELERATOR_KEY, HIDING_FILTER_SHORTCUT);
     358            HIDING_FILTER_SHORTCUT.setAccelerator(this);
    356359        }
    357360
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r4942 r4953  
    443443            putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer."));
    444444            putValue("help", HelpUtil.ht("/Dialog/LayerList#ShowHideLayer"));
    445             putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:showHideLayer", tr("Multikey: {0}",
    446             tr("Show/hide layer")), KeyEvent.VK_S, Shortcut.GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK).getKeyStroke());
     445            Shortcut.registerShortcut("core_multikey:showHideLayer", tr("Multikey: {0}",
     446            tr("Show/hide layer")), KeyEvent.VK_S, Shortcut.GROUP_DIRECT+Shortcut.GROUPS_ALT1).setAccelerator(this);
    447447            if (init) {
    448448                updateEnabledState();
     
    631631            putValue(SMALL_ICON, ImageProvider.get("dialogs", "activate"));
    632632            putValue(SHORT_DESCRIPTION, tr("Activate the selected layer"));
    633             putValue(ACCELERATOR_KEY, Shortcut.registerShortcut("core_multikey:activateLayer", tr("Multikey: {0}",
    634             tr("Activate layer")), KeyEvent.VK_A, Shortcut.GROUP_DIRECT, KeyEvent.SHIFT_DOWN_MASK).getKeyStroke());
     633            Shortcut.registerShortcut("core_multikey:activateLayer", tr("Multikey: {0}",
     634            tr("Activate layer")), KeyEvent.VK_A, Shortcut.GROUP_DIRECT+Shortcut.GROUPS_ALT1).setAccelerator(this);
    635635            putValue("help", HelpUtil.ht("/Dialog/LayerList#ActivateLayer"));
    636636        }
Note: See TracChangeset for help on using the changeset viewer.