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


Java SWT.BUTTON3屬性代碼示例

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


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

示例1: pressed

@Override
public void pressed(SWTSkinButtonUtility buttonUtility,
                    SWTSkinObject skinObject, int stateMask) {
	ToolBarItem item = (ToolBarItem) buttonUtility.getSkinObject().getData(
			"toolbaritem");
	boolean rightClick = (stateMask & (SWT.BUTTON3 | SWT.MOD4)) > 0;
	Object o = SelectedContentManager.convertSelectedContentToObject(null);
	item.triggerToolBarItem(rightClick
			? UIToolBarActivationListener.ACTIVATIONTYPE_RIGHTCLICK
			: UIToolBarActivationListener.ACTIVATIONTYPE_NORMAL, o);
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:11,代碼來源:ToolBarView.java

示例2: sendMouseEventToFX

private void sendMouseEventToFX(MouseEvent me, int embedMouseType) {
    if (scenePeer == null) {
        return;
    }

    Point los = toDisplay(me.x, me.y);
    boolean primaryBtnDown = (me.stateMask & SWT.BUTTON1) != 0;
    boolean middleBtnDown = (me.stateMask & SWT.BUTTON2) != 0;
    boolean secondaryBtnDown = (me.stateMask & SWT.BUTTON3) != 0;
    boolean shift = (me.stateMask & SWT.SHIFT) != 0;
    boolean control = (me.stateMask & SWT.CONTROL) != 0;
    boolean alt = (me.stateMask & SWT.ALT) != 0;
    boolean meta = (me.stateMask & SWT.COMMAND) != 0;
    int button = me.button;
    switch (embedMouseType) {
        case AbstractEvents.MOUSEEVENT_PRESSED:
            primaryBtnDown |= me.button == 1;
            middleBtnDown |= me.button == 2;
            secondaryBtnDown |= me.button == 3;
            break;
        case AbstractEvents.MOUSEEVENT_RELEASED:
            primaryBtnDown &= me.button != 1;
            middleBtnDown &= me.button != 2;
            secondaryBtnDown &= me.button != 3;
            break;
        case AbstractEvents.MOUSEEVENT_CLICKED:
            // Don't send click events to FX, as they are generated in Scene
            return;

        case AbstractEvents.MOUSEEVENT_MOVED:
        case AbstractEvents.MOUSEEVENT_DRAGGED:
        case AbstractEvents.MOUSEEVENT_ENTERED:
        case AbstractEvents.MOUSEEVENT_EXITED:
            // If this event was the result of mouse movement and has no
            // button associated with it, then we look at the state to
            // determine which button to report
            if (button == 0) {
                if ((me.stateMask & SWT.BUTTON1) != 0) {
                    button = 1;
                } else if ((me.stateMask & SWT.BUTTON2) != 0) {
                    button = 2;
                } else if ((me.stateMask & SWT.BUTTON3) != 0) {
                    button = 3;
                }
            }
            break;

        default:
            break;
    }

    scenePeer.mouseEvent(
            embedMouseType,
            SWTEvents.mouseButtonToEmbedMouseButton(button, me.stateMask),
            primaryBtnDown, middleBtnDown, secondaryBtnDown,
            me.x, me.y,
            los.x, los.y,
            shift, control, alt, meta,
            SWTEvents.getWheelRotation(me, embedMouseType),
            false);  // RT-32990: popup trigger not implemented
}
 
開發者ID:TRUEJASONFANS,項目名稱:JavaFX-FrameRateMeter,代碼行數:61,代碼來源:OldFXCanvas.java


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