Java 类com.google.gwt.event.dom.client.TouchCancelEvent 实例源码

项目:gantt    文件:SvgArrowWidget.java   
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());
    }
}
项目:geomajas-project-client-gwt2    文件:GfxUtilImpl.java   
@Override
public List<HandlerRegistration> applyController(VectorObject shape, MapController mapController) {
    List<HandlerRegistration> registrations = new ArrayList<HandlerRegistration>();
    registrations.add(shape.addMouseDownHandler(mapController));
    registrations.add(shape.addMouseUpHandler(mapController));
    registrations.add(shape.addMouseMoveHandler(mapController));
    registrations.add(shape.addMouseOutHandler(mapController));
    registrations.add(shape.addMouseOverHandler(mapController));
    registrations.add(shape.addMouseWheelHandler(mapController));
    registrations.add(shape.addDoubleClickHandler(mapController));
    registrations.add(shape.addDomHandler(mapController, TouchStartEvent.getType()));
    registrations.add(shape.addDomHandler(mapController, TouchEndEvent.getType()));
    registrations.add(shape.addDomHandler(mapController, TouchMoveEvent.getType()));
    registrations.add(shape.addDomHandler(mapController, TouchCancelEvent.getType()));
    return registrations;
}
项目:empiria.player    文件:TouchHandlerInitializerTest.java   
@Test
public void shouldAddTouchCancelHandler() {
    // given
    TouchOnCancelHandler touchOnStartHandler = mock(TouchOnCancelHandler.class);

    // when
    testObj.addTouchCancelHandler(touchOnStartHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(any(TouchCancelHandlerImpl.class), eq(TouchCancelEvent.getType()));
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
@Override
public void onTouchCancel(TouchCancelEvent p_event)
{
  Touch touch = getTouch(p_event.getChangedTouches(), m_currentTouchEventId);
  if (touch != null) {
    m_currentTouchEventId = -1;
    onOut(Element.as(touch.getTarget()));
  }
}
项目:GraphemeColourSynaesthesiaApp    文件:SingleShotEventListner.java   
@Override
    public void onTouchCancel(TouchCancelEvent event) {
//        button.setText("onTouchCanceled");
//        event.preventDefault();
//        if (event.getTargetTouches().length() == 0) {
//            hasTargetTouch = false;
//            touchTarget = null;
//        }
    }
项目:LanguageMemoryApp    文件:SingleShotEventListner.java   
@Override
    public void onTouchCancel(TouchCancelEvent event) {
//        button.setText("onTouchCanceled");
//        event.preventDefault();
//        if (event.getTargetTouches().length() == 0) {
//            hasTargetTouch = false;
//            touchTarget = null;
//        }
    }
项目:touchkit    文件:VSwitch.java   
private void addHandlers() {
    addDomHandler(this, KeyUpEvent.getType());
    if (TouchEvent.isSupported()) {
        addDomHandler(this, TouchStartEvent.getType());
        addDomHandler(this, TouchMoveEvent.getType());
        addDomHandler(this, TouchEndEvent.getType());
        addDomHandler(this, TouchCancelEvent.getType());
    } else {
        addDomHandler(this, MouseDownEvent.getType());
        addDomHandler(this, MouseUpEvent.getType());
        addDomHandler(this, MouseMoveEvent.getType());
    }
    addDomHandler(this, FocusEvent.getType());
    addDomHandler(this, BlurEvent.getType());
}
项目:touchkit    文件:VSwitch.java   
public void onTouchCancel(TouchCancelEvent event) {
    if (isEnabled()) {
        handleMouseUp(true);
    }
}
项目:empiria.player    文件:TouchHandlersInitializer.java   
@Override
public void addTouchCancelHandler(final TouchOnCancelHandler touchCancelHandler, Widget listenOn) {
    listenOn.addDomHandler(new TouchCancelHandlerImpl(touchCancelHandler), TouchCancelEvent.getType());
}
项目:empiria.player    文件:TouchCancelHandlerImpl.java   
@Override
public void onTouchCancel(TouchCancelEvent event) {
    touchOnCancelHandler.onCancel(event.getNativeEvent());
}
项目:appinventor-extensions    文件:HandlerPanel.java   
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
  return addDomHandler(handler, TouchCancelEvent.getType());
}
项目:circuitjs1    文件:Scrollbar.java   
public void onTouchCancel(TouchCancelEvent event) {
//      GWT.log("touchcancel");;
        event.preventDefault();
        dragging = false;
    }
项目:putnami-web-toolkit    文件:AbstractInput.java   
@Override
public com.google.gwt.event.shared.HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
    return this.addDomHandler(handler, TouchCancelEvent.getType());
}
项目:putnami-web-toolkit    文件:ListItem.java   
@Override
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
    return this.addDomHandler(handler, TouchCancelEvent.getType());
}
项目:putnami-web-toolkit    文件:Anchor.java   
@Override
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
    return this.addDomHandler(handler, TouchCancelEvent.getType());
}
项目:gantt    文件:GanttWidget.java   
@Override
public void onTouchCancel(TouchCancelEvent event) {
    containerScrollStartPosY = -1;
    containerScrollStartPosX = -1;
    onCancelTouch(event.getNativeEvent());
}
项目:gantt    文件:GanttWidget.java   
/**
 * 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;
        }
    }
}
项目:gantt    文件:SvgArrowWidget.java   
@Override
public void onTouchCancel(TouchCancelEvent event) {
    GWT.log("SvgArrowWidget.onTouchCancel(TouchCancelEvent)");
    cancelMove(true, null);
}
项目:geomajas-project-client-gwt    文件:DomHelper.java   
public EventListenerHelper(Element e, GraphicsController gc, int eventMask) {
    this.e = e;
    this.hm = new HandlerManager(e);
    if ((Event.ONMOUSEDOWN & eventMask) > 0) {
        hm.addHandler(MouseDownEvent.getType(), gc);
    }
    if ((Event.ONMOUSEUP & eventMask) > 0) {
        hm.addHandler(MouseUpEvent.getType(), gc);
    }
    if ((Event.ONMOUSEOUT & eventMask) > 0) {
        hm.addHandler(MouseOutEvent.getType(), gc);
    }
    if ((Event.ONMOUSEOVER & eventMask) > 0) {
        hm.addHandler(MouseOverEvent.getType(), gc);
    }
    if ((Event.ONMOUSEMOVE & eventMask) > 0) {
        hm.addHandler(MouseMoveEvent.getType(), gc);
    }
    if ((Event.ONMOUSEWHEEL & eventMask) > 0) {
        hm.addHandler(MouseWheelEvent.getType(), gc);
    }
    if ((Event.ONDBLCLICK & eventMask) > 0) {
        hm.addHandler(DoubleClickEvent.getType(), gc);
    }
    if ((Event.ONTOUCHSTART & eventMask) > 0) {
        hm.addHandler(TouchStartEvent.getType(), gc);
    }
    if ((Event.ONTOUCHEND & eventMask) > 0) {
        hm.addHandler(TouchEndEvent.getType(), gc);
    }
    if ((Event.ONTOUCHMOVE & eventMask) > 0) {
        hm.addHandler(TouchMoveEvent.getType(), gc);
    }
    if ((Event.ONTOUCHCANCEL & eventMask) > 0) {
        hm.addHandler(TouchCancelEvent.getType(), gc);
    }
}
项目:geomajas-project-client-gwt2    文件:MapWidgetImpl.java   
@Override
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) {
    return addDomHandler(handler, TouchCancelEvent.getType());
}
项目:geomajas-project-client-gwt2    文件:AbstractController.java   
/**
 * Don't override this method, override {@link #onMapTouchCancel(TouchEvent)} instead.
 */
@Override
public void onTouchCancel(TouchCancelEvent event) {
    onMapTouchCancel(event);
}
项目:touchkit    文件:VNavigationButton.java   
@Override
public void onTouchCancel(TouchCancelEvent event) {
    touchStarted = false;
}
项目:touchkit    文件:TouchButton.java   
public void onTouchCancel(TouchCancelEvent event) {
    touchStarted = false;
}