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


Java WidgetUtil.getTouchOrMouseClientX方法代码示例

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


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

示例1: init

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
@Override
protected void init() {
    super.init();

    getWidget().tabContextMenuHandler = new CubaTabSheetWidget.TabContextMenuHandler() {
        @Override
        public void onContextMenu(int tabIndex, ContextMenuEvent event) {
            lastContextMenuX = WidgetUtil.getTouchOrMouseClientX(event.getNativeEvent());
            lastContextMenuY = WidgetUtil.getTouchOrMouseClientY(event.getNativeEvent());

            if (getState().hasActionsHandlers) {
                rpc.onTabContextMenu(tabIndex);

                event.stopPropagation();
                event.preventDefault();
            }
        }
    };
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:CubaTabSheetConnector.java

示例2: init

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
@Override
protected void init() {
    super.init();

    getWidget().contextMenuHandler = new CubaWindowWidget.ContextMenuHandler() {
        @Override
        public void onContextMenu(Event event) {
            lastContextMenuX = WidgetUtil.getTouchOrMouseClientX(event);
            lastContextMenuY = WidgetUtil.getTouchOrMouseClientY(event);

            if (getState().hasContextActionHandlers) {
                rpc.onWindowContextMenu();

                event.stopPropagation();
                event.preventDefault();
            }
        }
    };
    getWidget().clickOnModalityCurtain = () -> rpc.performCloseAction();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:21,代码来源:CubaWindowConnector.java

示例3: setSize

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
private void setSize(Event event) {
    if (!cursorInsideBrowserContentArea(event)) {
        // Only drag while cursor is inside the browser client area
        return;
    }

    int w = WidgetUtil.getTouchOrMouseClientX(event) - startX + origW;
    int h = WidgetUtil.getTouchOrMouseClientY(event) - startY + origH;

    w = Math.max(w, getMinWidth());
    h = Math.max(h, getMinHeight());

    setWidth(w + "px");
    setHeight(h + "px");
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:16,代码来源:CubaFileUploadProgressWindow.java

示例4: moveWindow

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
private void moveWindow(Event event) {
    if (dragging) {
        if (cursorInsideBrowserContentArea(event)) {
            // Only drag while cursor is inside the browser client area
            final int x = WidgetUtil.getTouchOrMouseClientX(event) - startX
                    + origX;
            final int y = WidgetUtil.getTouchOrMouseClientY(event) - startY
                    + origY;
            setPopupPosition(x, y);
        }

        event.preventDefault();
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:15,代码来源:CubaFileUploadProgressWindow.java

示例5: beginMovingWindow

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
private void beginMovingWindow(Event event) {
    if (draggable) {
        showDraggingCurtain();
        dragging = true;
        startX = WidgetUtil.getTouchOrMouseClientX(event);
        startY = WidgetUtil.getTouchOrMouseClientY(event);
        origX = getElement().getAbsoluteLeft();
        origY = getElement().getAbsoluteTop();
        DOM.setCapture(getElement());

        event.preventDefault();
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:14,代码来源:CubaFileUploadProgressWindow.java

示例6: onResizeEvent

import com.vaadin.client.WidgetUtil; //导入方法依赖的package包/类
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,代码行数:43,代码来源:CubaFileUploadProgressWindow.java


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