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()); } }
@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; }
@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())); }
@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())); } }
@Override public void onTouchCancel(TouchCancelEvent event) { // button.setText("onTouchCanceled"); // event.preventDefault(); // if (event.getTargetTouches().length() == 0) { // hasTargetTouch = false; // touchTarget = null; // } }
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()); }
public void onTouchCancel(TouchCancelEvent event) { if (isEnabled()) { handleMouseUp(true); } }
@Override public void addTouchCancelHandler(final TouchOnCancelHandler touchCancelHandler, Widget listenOn) { listenOn.addDomHandler(new TouchCancelHandlerImpl(touchCancelHandler), TouchCancelEvent.getType()); }
@Override public void onTouchCancel(TouchCancelEvent event) { touchOnCancelHandler.onCancel(event.getNativeEvent()); }
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) { return addDomHandler(handler, TouchCancelEvent.getType()); }
public void onTouchCancel(TouchCancelEvent event) { // GWT.log("touchcancel");; event.preventDefault(); dragging = false; }
@Override public com.google.gwt.event.shared.HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) { return this.addDomHandler(handler, TouchCancelEvent.getType()); }
@Override public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) { return this.addDomHandler(handler, TouchCancelEvent.getType()); }
@Override public void onTouchCancel(TouchCancelEvent event) { containerScrollStartPosY = -1; containerScrollStartPosX = -1; onCancelTouch(event.getNativeEvent()); }
/** * 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; } } }
@Override public void onTouchCancel(TouchCancelEvent event) { GWT.log("SvgArrowWidget.onTouchCancel(TouchCancelEvent)"); cancelMove(true, null); }
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); } }
@Override public HandlerRegistration addTouchCancelHandler(TouchCancelHandler handler) { return addDomHandler(handler, TouchCancelEvent.getType()); }
/** * Don't override this method, override {@link #onMapTouchCancel(TouchEvent)} instead. */ @Override public void onTouchCancel(TouchCancelEvent event) { onMapTouchCancel(event); }
@Override public void onTouchCancel(TouchCancelEvent event) { touchStarted = false; }
public void onTouchCancel(TouchCancelEvent event) { touchStarted = false; }