本文整理了Java中javax.swing.JDesktopPane.getInputMap()
方法的一些代码示例,展示了JDesktopPane.getInputMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDesktopPane.getInputMap()
方法的具体详情如下:
包路径:javax.swing.JDesktopPane
类名称: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;
}
});
内容来源于网络,如有侵权,请联系作者删除!