Пример #1
0
  protected void installKeyboardActions() {
    InputMap map = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    SwingUtilities.replaceUIInputMap(optionPane, JComponent.WHEN_IN_FOCUSED_WINDOW, map);

    LazyActionMap.installLazyActionMap(optionPane, BasicOptionPaneUI.class, "OptionPane.actionMap");
  }
  protected void installKeyboardActions() {
    InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (inputMap != null) {
      SwingUtilities.replaceUIInputMap(desktop, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
    }
    inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    if (inputMap != null) {
      SwingUtilities.replaceUIInputMap(
          desktop, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, inputMap);
    }

    LazyActionMap.installLazyActionMap(desktop, BasicDesktopPaneUI.class, "DesktopPane.actionMap");
    registerKeyboardActions();
  }
Пример #3
0
 static void loadActionMap(LazyActionMap map) {
   map.put(new Actions(Actions.CLOSE));
   BasicLookAndFeel.installAudioActionMap(map);
 }
 static void loadActionMap(LazyActionMap map) {
   map.put(new Actions(Actions.RESTORE));
   map.put(new Actions(Actions.CLOSE));
   map.put(new Actions(Actions.MOVE));
   map.put(new Actions(Actions.RESIZE));
   map.put(new Actions(Actions.LEFT));
   map.put(new Actions(Actions.SHRINK_LEFT));
   map.put(new Actions(Actions.RIGHT));
   map.put(new Actions(Actions.SHRINK_RIGHT));
   map.put(new Actions(Actions.UP));
   map.put(new Actions(Actions.SHRINK_UP));
   map.put(new Actions(Actions.DOWN));
   map.put(new Actions(Actions.SHRINK_DOWN));
   map.put(new Actions(Actions.ESCAPE));
   map.put(new Actions(Actions.MINIMIZE));
   map.put(new Actions(Actions.MAXIMIZE));
   map.put(new Actions(Actions.NEXT_FRAME));
   map.put(new Actions(Actions.PREVIOUS_FRAME));
   map.put(new Actions(Actions.NAVIGATE_NEXT));
   map.put(new Actions(Actions.NAVIGATE_PREVIOUS));
 }