當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionEvent.META_MASK屬性代碼示例

本文整理匯總了Java中java.awt.event.ActionEvent.META_MASK屬性的典型用法代碼示例。如果您正苦於以下問題:Java ActionEvent.META_MASK屬性的具體用法?Java ActionEvent.META_MASK怎麽用?Java ActionEvent.META_MASK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.event.ActionEvent的用法示例。


在下文中一共展示了ActionEvent.META_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.META_MASK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。