Class InputMapUtils


  • public final class InputMapUtils
    extends Object
    Tools to work with Swing InputMap.
    Since:
    5200
    • Method Detail

      • unassignCtrlShiftUpDown

        public static void unassignCtrlShiftUpDown​(JComponent cmp,
                                                   int condition)
        Unassign Ctrl-Shift/Alt-Shift Up/Down from the given component to allow global JOSM shortcuts to work in this component.
        Parameters:
        cmp - The Swing component
        condition - one of the following values:
        • JComponent.FOCUS_INPUTMAP_CREATED
        • JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
        • JComponent.WHEN_IN_FOCUSED_WINDOW
      • unassignPageUpDown

        public static void unassignPageUpDown​(JComponent cmp,
                                              int condition)
        Unassign PageUp/PageDown from the given component to allow global JOSM shortcuts to work in this component.
        Parameters:
        cmp - The Swing component
        condition - one of the following values:
        • JComponent.FOCUS_INPUTMAP_CREATED
        • JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
        • JComponent.WHEN_IN_FOCUSED_WINDOW
        Since:
        6557
      • enableEnter

        public static void enableEnter​(JButton b)
        Enable activating button on Enter (which is replaced with spacebar for certain Look-And-Feels).
        Parameters:
        b - Button
      • addSpacebarAction

        public static void addSpacebarAction​(JComponent c,
                                             Action a)
        Add an action activated with Spacebar key on a component.
        Parameters:
        c - The Swing component
        a - action activated with Spacebar key