Changeset 12520 in josm


Ignore:
Timestamp:
2017-07-26T23:53:08+02:00 (2 years ago)
Author:
Don-vip
Message:

see #11924 - fix remaining warnings about extended modifiers

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/InputMapUtils.java

    r10791 r12520  
    3535    public static void unassignCtrlShiftUpDown(JComponent cmp, int condition) {
    3636        InputMap inputMap = SwingUtilities.getUIInputMap(cmp, condition);
    37         inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK));
    38         inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK));
    39         inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK));
    40         inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK));
     37        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
     38        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
     39        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
     40        inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
    4141        SwingUtilities.replaceUIInputMap(cmp, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
    4242    }
  • trunk/src/org/openstreetmap/josm/tools/MultikeyActionsHandler.java

    r11366 r12520  
    198198
    199199    private static String formatMenuText(KeyStroke keyStroke, String index, String description) {
    200         String shortcutText = KeyEvent.getKeyModifiersText(keyStroke.getModifiers()) + '+'
    201                 + KeyEvent.getKeyText(keyStroke.getKeyCode()) + ',' + index;
     200        String shortcutText = Shortcut.getKeyText(keyStroke) + ',' + index;
    202201
    203202        return "<html><i>" + shortcutText + "</i>&nbsp;&nbsp;&nbsp;&nbsp;" + description;
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r12519 r12520  
    254254     */
    255255    public String getKeyText() {
    256         KeyStroke keyStroke = getKeyStroke();
     256        return getKeyText(getKeyStroke());
     257    }
     258
     259    /**
     260     * Returns a human readable text for the key stroke.
     261     * @param keyStroke key stroke to convert to human readable text
     262     * @return a human readable text for the key stroke
     263     * @since 12520
     264     */
     265    public static String getKeyText(KeyStroke keyStroke) {
    257266        if (keyStroke == null) return "";
    258267        String modifText = KeyEvent.getModifiersExText(keyStroke.getModifiers());
Note: See TracChangeset for help on using the changeset viewer.