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


Java InputEvent.BUTTON3_DOWN_MASK屬性代碼示例

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


在下文中一共展示了InputEvent.BUTTON3_DOWN_MASK屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setOldModifiers

/**
 * Sets old modifiers by the new ones.
 */
@SuppressWarnings("deprecation")
private void setOldModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_MASK;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:24,代碼來源:DragSourceDragEvent.java

示例2: initLegalButtonMask

@SuppressWarnings("deprecation")
private static synchronized void initLegalButtonMask() {
    if (LEGAL_BUTTON_MASK != 0) return;

    int tmpMask = 0;
    if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){
        if (Toolkit.getDefaultToolkit() instanceof SunToolkit) {
            final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
            for (int i = 0; i < buttonsNumber; i++){
                tmpMask |= InputEvent.getMaskForButton(i+1);
            }
        }
    }
    tmpMask |= InputEvent.BUTTON1_MASK|
        InputEvent.BUTTON2_MASK|
        InputEvent.BUTTON3_MASK|
        InputEvent.BUTTON1_DOWN_MASK|
        InputEvent.BUTTON2_DOWN_MASK|
        InputEvent.BUTTON3_DOWN_MASK;
    LEGAL_BUTTON_MASK = tmpMask;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:Robot.java

示例3: fromDisplayString

public static int fromDisplayString(String str) {
	int ret = 0;
	StringTokenizer toks = new StringTokenizer(str);
	while (toks.hasMoreTokens()) {
		String s = toks.nextToken();
		if (s.equals(Strings.get("ctrlMod")))
			ret |= InputEvent.CTRL_DOWN_MASK;
		else if (s.equals(Strings.get("altMod")))
			ret |= InputEvent.ALT_DOWN_MASK;
		else if (s.equals(Strings.get("shiftMod")))
			ret |= InputEvent.SHIFT_DOWN_MASK;
		else if (s.equals(Strings.get("button1Mod")))
			ret |= InputEvent.BUTTON1_DOWN_MASK;
		else if (s.equals(Strings.get("button2Mod")))
			ret |= InputEvent.BUTTON2_DOWN_MASK;
		else if (s.equals(Strings.get("button3Mod")))
			ret |= InputEvent.BUTTON3_DOWN_MASK;
		else
			throw new NumberFormatException("InputEventUtil");
	}
	return ret;
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:22,代碼來源:InputEventUtil.java

示例4: setNewModifiers

/**
 * Sets new modifiers by the old ones.
 * The mouse modifiers have higher priority than overlaying key
 * modifiers.
 */
private void setNewModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:25,代碼來源:DragSourceDragEvent.java

示例5: setNewModifiers

/**
 * Sets new modifiers by the old ones.
 * The mouse modifiers have higher priority than overlaying key
 * modifiers.
 */
@SuppressWarnings("deprecation")
private void setNewModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:26,代碼來源:DragSourceDragEvent.java

示例6: isRightMouseButton

static boolean isRightMouseButton(MouseEvent me) {
    int numButtons = ((Integer)getDefaultToolkit().getDesktopProperty("awt.mouse.numButtons")).intValue();
    switch (me.getID()) {
      case MouseEvent.MOUSE_PRESSED:
      case MouseEvent.MOUSE_RELEASED:
          return ((numButtons == 2 && me.getButton() == MouseEvent.BUTTON2) ||
                   (numButtons > 2 && me.getButton() == MouseEvent.BUTTON3));
      case MouseEvent.MOUSE_ENTERED:
      case MouseEvent.MOUSE_EXITED:
      case MouseEvent.MOUSE_CLICKED:
      case MouseEvent.MOUSE_DRAGGED:
          return ((numButtons == 2 && (me.getModifiersEx() & InputEvent.BUTTON2_DOWN_MASK) != 0) ||
                  (numButtons > 2 && (me.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) != 0));
    }
    return false;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:16,代碼來源:XToolkit.java

示例7: mapDragOperationFromModifiers

/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Prohibit multi-button drags.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK ||
          btns == InputEvent.BUTTON3_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:19,代碼來源:WMouseDragGestureRecognizer.java

示例8: setOldModifiers

/**
 * Sets old modifiers by the new ones.
 */
private void setOldModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_MASK;
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:23,代碼來源:DragSourceDragEvent.java

示例9: initLegalButtonMask

private static synchronized void initLegalButtonMask() {
    if (LEGAL_BUTTON_MASK != 0) return;

    int tmpMask = 0;
    if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){
        if (Toolkit.getDefaultToolkit() instanceof SunToolkit) {
            final int buttonsNumber = ((SunToolkit)(Toolkit.getDefaultToolkit())).getNumberOfButtons();
            for (int i = 0; i < buttonsNumber; i++){
                tmpMask |= InputEvent.getMaskForButton(i+1);
            }
        }
    }
    tmpMask |= InputEvent.BUTTON1_MASK|
        InputEvent.BUTTON2_MASK|
        InputEvent.BUTTON3_MASK|
        InputEvent.BUTTON1_DOWN_MASK|
        InputEvent.BUTTON2_DOWN_MASK|
        InputEvent.BUTTON3_DOWN_MASK;
    LEGAL_BUTTON_MASK = tmpMask;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:20,代碼來源:Robot.java

示例10: inputEventGetModifiersExText

public static String inputEventGetModifiersExText(int modifiers) {
    StringBuffer sb = new StringBuffer();

    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        sb.append("Ctrl+");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        sb.append("Meta+");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        sb.append("Alt+");
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        sb.append("Shift+");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        sb.append("Button1+");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        sb.append("Button2+");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        sb.append("Button3+");
    }
    String text = sb.toString();
    if (text.equals("")) {
        return text;
    }
    return text.substring(0, text.length() - 1);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:30,代碼來源:OSUtils.java

示例11: getButtonMask

public int getButtonMask() {
    if (button1Pressed) {
        return InputEvent.BUTTON1_DOWN_MASK;
    }
    if (button2Pressed) {
        return InputEvent.BUTTON2_DOWN_MASK;
    }
    if (button3Pressed) {
        return InputEvent.BUTTON3_DOWN_MASK;
    }
    return 0;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:12,代碼來源:EventQueueDevice.java

示例12: getModifiersText

static String getModifiersText(int modifiers) {
    StringBuilder buf = new StringBuilder();

    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0 ) {
        buf.append("shift ");
    }
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0 ) {
        buf.append("ctrl ");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0 ) {
        buf.append("meta ");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0 ) {
        buf.append("alt ");
    }
    if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0 ) {
        buf.append("altGraph ");
    }
    if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0 ) {
        buf.append("button1 ");
    }
    if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0 ) {
        buf.append("button2 ");
    }
    if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0 ) {
        buf.append("button3 ");
    }

    return buf.toString();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:30,代碼來源:AWTKeyStroke.java

示例13: getModifiersExText

protected String getModifiersExText(int modifiers) {

        StringBuffer buf = new StringBuffer();
        if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
            buf.append("Meta");
            buf.append("+");
        }
        if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
            buf.append("Ctrl");
            buf.append("+");
        }
        if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
            buf.append("Alt");
            buf.append("+");
        }
        if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
            buf.append("Shift");
            buf.append("+");
        }
        if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
            buf.append("Alt Graph");
            buf.append("+");
        }
        if ((modifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
            buf.append("Button1");
            buf.append("+");
        }
        if ((modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
            buf.append("Button2");
            buf.append("+");
        }
        if ((modifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
            buf.append("Button3");
            buf.append("+");
        }
        return buf.toString();
    }
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:37,代碼來源:DeviceTest.java

示例14: processMouseEvent

void processMouseEvent(MouseEvent e) {
	int left = InputEvent.BUTTON1_DOWN_MASK;
	int middle = InputEvent.BUTTON2_DOWN_MASK;
	int right = InputEvent.BUTTON3_DOWN_MASK;
	//        log.info("e.getModifiersEx()="+HexString.toString(e.getModifiersEx()));
	if ((e.getModifiersEx() & (middle | right)) != 0) {
		setDesiredPositionFromMouseEvent(e);
	} else if ((e.getModifiersEx() & left) == left) {
		setBallLocationFromMouseEvent(e);
	}
}
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:11,代碼來源:LabyrinthBallController.java

示例15: toDisplayString

public static String toDisplayString(int mods) {
	ArrayList<String> arr = new ArrayList<String>();
	if ((mods & InputEvent.CTRL_DOWN_MASK) != 0)
		arr.add(Strings.get("ctrlMod"));
	if ((mods & InputEvent.ALT_DOWN_MASK) != 0)
		arr.add(Strings.get("altMod"));
	if ((mods & InputEvent.SHIFT_DOWN_MASK) != 0)
		arr.add(Strings.get("shiftMod"));
	if ((mods & InputEvent.BUTTON1_DOWN_MASK) != 0)
		arr.add(Strings.get("button1Mod"));
	if ((mods & InputEvent.BUTTON2_DOWN_MASK) != 0)
		arr.add(Strings.get("button2Mod"));
	if ((mods & InputEvent.BUTTON3_DOWN_MASK) != 0)
		arr.add(Strings.get("button3Mod"));

	if (arr.isEmpty())
		return "";

	Iterator<String> it = arr.iterator();
	if (it.hasNext()) {
		StringBuilder ret = new StringBuilder();
		ret.append(it.next());
		while (it.hasNext()) {
			ret.append(" ");
			ret.append(it.next());
		}
		return ret.toString();
	} else {
		return "";
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:31,代碼來源:InputEventUtil.java


注:本文中的java.awt.event.InputEvent.BUTTON3_DOWN_MASK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。