com.google.gwt.event.dom.client.TouchCancelEvent Java Examples

The following examples show how to use com.google.gwt.event.dom.client.TouchCancelEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SvgArrowWidget.java    From gantt with Apache License 2.0 6 votes vote down vote up
protected void addMoveHandler() {
    if (msTouchSupported) {
        moveRegisteration = addDomHandler(pointerMoveHandler,
                PointerMoveEvent.getType());
        touchCancelRegisteration = addDomHandler(pointerCancelHandler,
                PointerCancelEvent.getType());
    } else if (touchSupported) {
        moveRegisteration = addDomHandler(touchMoveHandler,
                TouchMoveEvent.getType());
        touchCancelRegisteration = addDomHandler(touchCancelHandler,
                TouchCancelEvent.getType());
    } else {
        moveRegisteration = addDomHandler(mouseMoveHandler,
                MouseMoveEvent.getType());
    }
}
 
Example #2
Source File: DragSourceSupport.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
@Override
public void onTouchCancel(TouchCancelEvent event) {
  Widget src = (Widget) event.getSource();
  onMouseLeave(src);
}
 
Example #3
Source File: HandlerPanel.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
  return addDomHandler(handler, TouchCancelEvent.getType());
}
 
Example #4
Source File: MockComponent.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
@Override
public final HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
  return handlers.addHandler(TouchCancelEvent.getType(), handler);
}
 
Example #5
Source File: AbstractInput.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public com.google.gwt.event.shared.HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
	return this.addDomHandler(handler, TouchCancelEvent.getType());
}
 
Example #6
Source File: ListItem.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
	return this.addDomHandler(handler, TouchCancelEvent.getType());
}
 
Example #7
Source File: Anchor.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
	return this.addDomHandler(handler, TouchCancelEvent.getType());
}
 
Example #8
Source File: GanttWidget.java    From gantt with Apache License 2.0 4 votes vote down vote up
@Override
public void onTouchCancel(TouchCancelEvent event) {
    containerScrollStartPosY = -1;
    containerScrollStartPosX = -1;
    onCancelTouch(event.getNativeEvent());
}
 
Example #9
Source File: GanttWidget.java    From gantt with Apache License 2.0 4 votes vote down vote up
/**
 * Reset listeners.
 */
public void resetListeners() {
    Event.sinkEvents(container, Event.ONSCROLL | Event.ONCONTEXTMENU);

    if (contextMenuHandlerRegistration == null) {
        contextMenuHandlerRegistration = addDomHandler(contextMenuHandler, ContextMenuEvent.getType());
    }

    if (scrollHandlerRegistration == null) {
        scrollHandlerRegistration = addHandler(scrollHandler, ScrollEvent.getType());
    }
    if (isMsTouchSupported()) {
        // IE10 pointer events (ms-prefixed events)
        if (pointerDownHandlerRegistration == null) {
            pointerDownHandlerRegistration = addDomHandler(msPointerDownHandler, PointerDownEvent.getType());
        }
        if (pointerUpHandlerRegistration == null) {
            pointerUpHandlerRegistration = addDomHandler(msPointerUpHandler, PointerUpEvent.getType());
        }
        if (pointerMoveHandlerRegistration == null) {
            pointerMoveHandlerRegistration = addDomHandler(msPointerMoveHandler, PointerMoveEvent.getType());
        }
        if (pointerCancelHandlerRegistration == null) {
            pointerCancelHandlerRegistration = addHandler(msPointerCancelHandler, PointerCancelEvent.getType());
        }
    } else if (touchSupported) {
        // touch events replaces mouse events
        if (touchStartHandlerRegistration == null) {
            touchStartHandlerRegistration = addDomHandler(touchStartHandler, TouchStartEvent.getType());
        }
        if (touchEndHandlerRegistration == null) {
            touchEndHandlerRegistration = addDomHandler(touchEndHandler, TouchEndEvent.getType());
        }
        if (touchMoveHandlerRegistration == null) {
            touchMoveHandlerRegistration = addDomHandler(touchMoveHandler, TouchMoveEvent.getType());
        }
        if (touchCancelHandlerRegistration == null) {
            touchCancelHandlerRegistration = addHandler(touchCancelHandler, TouchCancelEvent.getType());
        }

    } else {
        if (mouseDblClickHandlerRegistration == null) {
            mouseDblClickHandlerRegistration = addDomHandler(doubleClickHandler, DoubleClickEvent.getType());
        }
        if (mouseDownHandlerRegistration == null) {
            mouseDownHandlerRegistration = addDomHandler(mouseDownHandler, MouseDownEvent.getType());
        }
        if (mouseUpHandlerRegistration == null) {
            mouseUpHandlerRegistration = addDomHandler(mouseUpHandler, MouseUpEvent.getType());
        }
        if (isMovableSteps() || isResizableSteps()) {
            if (mouseMoveHandlerRegistration == null) {
                mouseMoveHandlerRegistration = addDomHandler(mouseMoveHandler, MouseMoveEvent.getType());
            }
        } else if (mouseMoveHandlerRegistration != null) {
            mouseMoveHandlerRegistration.removeHandler();
            mouseMoveHandlerRegistration = null;
        }
    }
}
 
Example #10
Source File: SvgArrowWidget.java    From gantt with Apache License 2.0 4 votes vote down vote up
@Override
public void onTouchCancel(TouchCancelEvent event) {
    GWT.log("SvgArrowWidget.onTouchCancel(TouchCancelEvent)");
    cancelMove(true, null);
}