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


Java ActionEvent.ALT_MASK属性代码示例

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


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

示例1: isValidDefaultTypedAction

/**
 * Checks that the action will result in an insertion into document. 
 * Returns true for readonly docs as well.
 * 
 * @param evt action event
 * @return true, if the action event will result in insertion; readonly doc status is not 
 * checked.
 */
static boolean isValidDefaultTypedAction(ActionEvent evt) {
    // Check whether the modifiers are OK
    int mod = evt.getModifiers();
    boolean ctrl = ((mod & ActionEvent.CTRL_MASK) != 0);
    boolean alt = org.openide.util.Utilities.isMac() ? ((mod & ActionEvent.META_MASK) != 0) :
        ((mod & ActionEvent.ALT_MASK) != 0);
    return !(alt || ctrl);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:BaseKit.java

示例2: isValidDefaultTypedAction

/**
 * Copied from BaseKit
 */
static boolean isValidDefaultTypedAction(ActionEvent evt) {
    // Check whether the modifiers are OK
    int mod = evt.getModifiers();
    boolean ctrl = ((mod & ActionEvent.CTRL_MASK) != 0);
    boolean alt = org.openide.util.Utilities.isMac() ? ((mod & ActionEvent.META_MASK) != 0) :
        ((mod & ActionEvent.ALT_MASK) != 0);
    return !(alt || ctrl);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:MacroRecording.java

示例3: actionPerformed

/**
	 * This method is final so that you cannot override it and mess up the
	 * macro-recording part of it.  The actual meat of the action is in
	 * <code>actionPerformedImpl</code>.
	 *
	 * @param e The action being performed.
	 * @see #actionPerformedImpl
	 */
	@Override
	public final void actionPerformed(ActionEvent e) {

		JTextComponent textComponent = getTextComponent(e);
		if (textComponent instanceof RTextArea) {
			RTextArea textArea = (RTextArea)textComponent;
			//System.err.println("Recordable action: " + getMacroID());
			if (RTextArea.isRecordingMacro() && isRecordable()) {
				int mod = e.getModifiers();
				// We ignore keypresses involving ctrl/alt/meta if they are
				// "default" keypresses - i.e., they aren't some special
				// action like paste (e.g., paste would return Ctrl+V, but
				// its action would be "paste-action").
				String macroID = getMacroID();
//System.err.println(macroID);
//System.err.println("... " + (mod&ActionEvent.ALT_MASK));
//System.err.println("... " + (mod&ActionEvent.CTRL_MASK));
//System.err.println("... " + (mod&ActionEvent.META_MASK));
				if (!DefaultEditorKit.defaultKeyTypedAction.equals(macroID) || (
						(mod&ActionEvent.ALT_MASK)==0 &&
						(mod&ActionEvent.CTRL_MASK)==0 &&
						(mod&ActionEvent.META_MASK)==0)
					) {
					String command = e.getActionCommand();
					RTextArea.addToCurrentMacro(macroID, command);
					//System.err.println("... recording it!");
				}
			}
			actionPerformedImpl(e, textArea);
		}

	}
 
开发者ID:Thecarisma,项目名称:powertext,代码行数:40,代码来源:RecordableTextAction.java


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