javax.swing.JDesktopPane.getInputMap()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中javax.swing.JDesktopPane.getInputMap()方法的一些代码示例,展示了JDesktopPane.getInputMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDesktopPane.getInputMap()方法的具体详情如下:
包路径:javax.swing.JDesktopPane
类名称:JDesktopPane
方法名:getInputMap

JDesktopPane.getInputMap介绍

暂无

代码示例

代码示例来源:origin: chewiebug/GCViewer

@Override
  public Object invoke(Object o, Method method, Object[] args) throws Throwable {
    if (method.getName().equals("windowEnteredFullScreen")) {
      putValue(NAME, LocalisationHelper.getString("main_frame_menuitem_leave_fullscreen"));
      putValue(SHORT_DESCRIPTION, LocalisationHelper.getString("main_frame_menuitem_hint_leave_fullscreen"));
      gcViewer.getDesktopPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
                                     "leaveFullScreen");
      gcViewer.getDesktopPane().getActionMap().put("leaveFullScreen", OSXFullScreen.this);
    }
    if (method.getName().equals("windowExitedFullScreen")) {
      putValue(NAME, LocalisationHelper.getString("main_frame_menuitem_enter_fullscreen"));
      putValue(SHORT_DESCRIPTION, LocalisationHelper.getString("main_frame_menuitem_hint_enter_fullscreen"));
      gcViewer.getDesktopPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));
      gcViewer.getDesktopPane().getActionMap().remove("leaveFullScreen");
    }
    return null;
  }
});

代码示例来源:origin: com.mgmtp.gcviewer/gcviewer

@Override
  public Object invoke(Object o, Method method, Object[] args) throws Throwable {
    if (method.getName().equals("windowEnteredFullScreen")) {
      putValue(NAME, GCViewerGui.localStrings.getString("main_frame_menuitem_leave_fullscreen"));
      putValue(SHORT_DESCRIPTION, GCViewerGui.localStrings.getString("main_frame_menuitem_hint_leave_fullscreen"));
      gcViewer.getDesktopPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
                                     "leaveFullScreen");
      gcViewer.getDesktopPane().getActionMap().put("leaveFullScreen", OSXFullScreen.this);
    }
    if (method.getName().equals("windowExitedFullScreen")) {
      putValue(NAME, GCViewerGui.localStrings.getString("main_frame_menuitem_enter_fullscreen"));
      putValue(SHORT_DESCRIPTION, GCViewerGui.localStrings.getString("main_frame_menuitem_hint_enter_fullscreen"));
      gcViewer.getDesktopPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0));
      gcViewer.getDesktopPane().getActionMap().remove("leaveFullScreen");
    }
    return null;
  }
});

相关文章