当前位置: 首页>>代码示例>>Java>>正文


Java KeyStroke.toString方法代码示例

本文整理汇总了Java中javax.swing.KeyStroke.toString方法的典型用法代码示例。如果您正苦于以下问题:Java KeyStroke.toString方法的具体用法?Java KeyStroke.toString怎么用?Java KeyStroke.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.KeyStroke的用法示例。


在下文中一共展示了KeyStroke.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: putActionDelegate

import javax.swing.KeyStroke; //导入方法依赖的package包/类
private void putActionDelegate(InputMap map, KeyStroke ks) {
    String binding = COPY_ACTION_DELEGATE+ks.toString();
    Action action = getCopyActionDelegate(map, ks);
    if (action != null) {
        getActionMap().put(binding, action);
        map.put(ks, binding);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:OutlineView.java

示例2: getExpandKeyStrokeText

import javax.swing.KeyStroke; //导入方法依赖的package包/类
private static String getExpandKeyStrokeText(KeyStroke keyStroke) {
    String expandKeyStrokeText;
    if (keyStroke.equals(KeyStroke.getKeyStroke(' '))) { //NOI18N
        expandKeyStrokeText = "SPACE"; // NOI18N
    } else if (keyStroke.equals(KeyStroke.getKeyStroke(new Character(' '), InputEvent.SHIFT_MASK))) { //NOI18N
        expandKeyStrokeText = "Shift-SPACE"; // NOI18N
    } else if (keyStroke.equals(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0))) {
        expandKeyStrokeText = "TAB"; // NOI18N
    } else if (keyStroke.equals(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0))) {
        expandKeyStrokeText = "ENTER"; // NOI18N
    } else {
        expandKeyStrokeText = keyStroke.toString();
    }
    return expandKeyStrokeText;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:CodeTemplateManagerOperation.java

示例3: getKeyStrokeText

import javax.swing.KeyStroke; //导入方法依赖的package包/类
/**
 * Creates a {@code String} that keeps the attributes given
 * {@code KeyStroke}. This {@code String} can be used to
 * store the key stroke in an XML-file.
 *
 * @param keyStroke The {@code KeyStroke}.
 * @return A {@code String} that produces a key stroke equal to the
 *         given {@code KeyStroke} if passed as a parameter to
 *         {@code getAWTKeyStroke(String)}.
 */
public static String getKeyStrokeText(KeyStroke keyStroke) {
    return (keyStroke == null) ? "" : keyStroke.toString();
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:14,代码来源:FreeColAction.java


注:本文中的javax.swing.KeyStroke.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。