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


Java Event.ONTOUCHMOVE屬性代碼示例

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


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

示例1: onBrowserEvent

@Override
public void onBrowserEvent(com.google.gwt.user.client.Event event) {
    switch (event.getTypeInt()) {
        case Event.ONMOUSEDOWN:
        case Event.ONTOUCHSTART:
            // rezerwujemy touch dla siebie nic innego nie powinno obslugiwac tego zdarzenia np TouchPageSwitch
            eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
            pressed = true;
            setPosition(event);
            break;
        case Event.ONTOUCHEND:
        case Event.ONMOUSEUP:
            pressed = false;
            setPosition(event);
            break;
        case Event.ONTOUCHMOVE:
        case Event.ONMOUSEMOVE:
            setPosition(event);
        default:
            break;
    }
    super.onBrowserEvent(event);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:23,代碼來源:AbstractMediaScroll.java

示例2: onDragEvent

private void onDragEvent(Event event) {
    if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
        return;
    }

    switch (DOM.eventGetType(event)) {
        case Event.ONTOUCHSTART:
            if (event.getTouches().length() > 1) {
                return;
            }
        case Event.ONMOUSEDOWN:
            beginMovingWindow(event);
            break;
        case Event.ONMOUSEUP:
        case Event.ONTOUCHEND:
        case Event.ONTOUCHCANCEL:
        case Event.ONLOSECAPTURE:
            stopMovingWindow();
            break;
        case Event.ONMOUSEMOVE:
        case Event.ONTOUCHMOVE:
            moveWindow(event);
            break;
        default:
            break;
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:27,代碼來源:CubaFileUploadProgressWindow.java

示例3: onResizeEvent

private void onResizeEvent(Event event) {
    if (resizable && WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
        switch (event.getTypeInt()) {
            case Event.ONMOUSEDOWN:
            case Event.ONTOUCHSTART:
                showResizingCurtain();
                if (BrowserInfo.get().isIE()) {
                    resizeBox.getStyle().setVisibility(Style.Visibility.HIDDEN);
                }
                resizing = true;
                startX = WidgetUtil.getTouchOrMouseClientX(event);
                startY = WidgetUtil.getTouchOrMouseClientY(event);
                origW = getElement().getOffsetWidth();
                origH = getElement().getOffsetHeight();
                DOM.setCapture(getElement());
                event.preventDefault();
                break;
            case Event.ONMOUSEUP:
            case Event.ONTOUCHEND:
                setSize(event);
            case Event.ONTOUCHCANCEL:
                DOM.releaseCapture(getElement());
            case Event.ONLOSECAPTURE:
                hideResizingCurtain();
                if (BrowserInfo.get().isIE()) {
                    resizeBox.getStyle().clearVisibility();
                }
                resizing = false;
                break;
            case Event.ONMOUSEMOVE:
            case Event.ONTOUCHMOVE:
                if (resizing) {
                    setSize(event);
                    event.preventDefault();
                }
                break;
            default:
                event.preventDefault();
                break;
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:42,代碼來源:CubaFileUploadProgressWindow.java


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