JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i);
/** * Get an array of {@link Touch touches} which have changed since the last * touch event fired. Note, that for {@link TouchEndEvent touch end events}, * the touch which has just ended will not be present in the array. Moreover, * if the touch which just ended was the last remaining touch, then a zero * length array will be returned. * * @return an array of touches */ public JsArray<Touch> getChangedTouches() { return getNativeEvent().getChangedTouches(); }
JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i);
/** * Get an array of {@link Touch touches} which have changed since the last * touch event fired. Note, that for {@link TouchEndEvent touch end events}, * the touch which has just ended will not be present in the array. Moreover, * if the touch which just ended was the last remaining touch, then a zero * length array will be returned. * * @return an array of touches */ public JsArray<Touch> getChangedTouches() { return getNativeEvent().getChangedTouches(); }
/** * Get an array of {@link Touch touches} which have changed since the last * touch event fired. Note, that for {@link TouchEndEvent touch end events}, * the touch which has just ended will not be present in the array. Moreover, * if the touch which just ended was the last remaining touch, then a zero * length array will be returned. * * @return an array of touches */ public JsArray<Touch> getChangedTouches() { return getNativeEvent().getChangedTouches(); }
public LightArray<Touch> getChangedTouches() { return new JsLightArray<Touch>(getNativeEvent().getChangedTouches()); }
@Override public void handleEvent(NativeEvent nativeEvent) { JsArray<Touch> touches = nativeEvent.getChangedTouches(); if (touches.length() > 0) { inDragSequence = true; // cancel touch events by default to prevent browser scrolling on iOS if (onPointerStart(eventFromTouch(rootElement, touches.get(0)), true)) nativeEvent.preventDefault(); } } });
@Override public void handleEvent(NativeEvent nativeEvent) { JsArray<Touch> touches = nativeEvent.getChangedTouches(); if (inDragSequence && touches.length() > 0) { // cancel touch events by default to prevent browser scrolling on iOS if (onPointerDrag(eventFromTouch(rootElement, touches.get(0)), true)) nativeEvent.preventDefault(); } else { nativeEvent.preventDefault(); } } });
@Override public void handleEvent(NativeEvent nativeEvent) { JsArray<Touch> touches = nativeEvent.getChangedTouches(); if (inDragSequence && touches.length() > 0) { inDragSequence = false; // cancel touch events by default to prevent browser scrolling on iOS if (onPointerEnd(eventFromTouch(rootElement, touches.get(0)), true)) nativeEvent.preventDefault(); } else { nativeEvent.preventDefault(); } } });
private Touch.Event[] toTouchEvents (Touch.Event.Kind kind, NativeEvent nevent) { // Convert the JsArray<Native Touch> to an array of Touch.Events JsArray<com.google.gwt.dom.client.Touch> nativeTouches = nevent.getChangedTouches(); int nativeTouchesLen = nativeTouches.length(); Touch.Event[] touches = new Touch.Event[nativeTouchesLen]; double time = plat.time(); for (int t = 0; t < nativeTouchesLen; t++) { com.google.gwt.dom.client.Touch touch = nativeTouches.get(t); float x = touch.getRelativeX(rootElement); float y = touch.getRelativeY(rootElement); Point xy = plat.graphics().transformMouse(x, y); int id = getTouchIdentifier(nevent, t); touches[t] = new Touch.Event(0, time, xy.x, xy.y, kind, id); } return touches; }
private Event.Impl[] toEvents(NativeEvent nativeEvent, Events.Flags flags) { // Convert the JsArray<Native Touch> to an array of Touch.Events JsArray<com.google.gwt.dom.client.Touch> nativeTouches = nativeEvent.getChangedTouches(); int nativeTouchesLen = nativeTouches.length(); Event.Impl[] touches = new Event.Impl[nativeTouchesLen]; for (int t = 0; t < nativeTouchesLen; t++) { com.google.gwt.dom.client.Touch touch = nativeTouches.get(t); float x = touch.getRelativeX(rootElement); float y = touch.getRelativeY(rootElement); Point xy = platform.graphics().transformMouse(x, y); int id = getTouchIdentifier(nativeEvent, t); touches[t] = new Event.Impl(flags, PlayN.currentTime(), xy.x, xy.y, id); } return touches; }
private Touch.Event[] toTouchEvents (Touch.Event.Kind kind, NativeEvent nevent) { // Convert the JsArray<Native Touch> to an array of Touch.Events JsArray<com.google.gwt.dom.client.Touch> nativeTouches = nevent.getChangedTouches(); int nativeTouchesLen = nativeTouches.length(); Touch.Event[] touches = new Touch.Event[nativeTouchesLen]; double time = plat.time(); for (int t = 0; t < nativeTouchesLen; t++) { com.google.gwt.dom.client.Touch touch = nativeTouches.get(t); float x = touch.getRelativeX(rootElement); float y = touch.getRelativeY(rootElement); Point xy = plat.graphics().transformMouse(x, y); int id = getTouchIdentifier(nevent, t); touches[t] = new Touch.Event(0, time, xy.x, xy.y, kind, id); } return touches; }
private void synthesizeAsyncTouchEnd(TouchEndEvent event) { final Element elem = mouseDownWidget.getElement(); NativeEvent n = event.getNativeEvent(); // TODO extract these properties from the original event final boolean bubbles = true; final boolean cancelable = true; final int detail = 0; final boolean ctrlKey = n.getCtrlKey(); final boolean altKey = n.getAltKey(); final boolean shiftKey = n.getShiftKey(); final boolean metaKey = n.getMetaKey(); final JsArray<Touch> changedTouches = n.getChangedTouches(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { // TODO determine if we need to set additional event properties elem.dispatchEvent(DOMUtil.createTouchEndEvent(bubbles, cancelable, detail, ctrlKey, altKey, shiftKey, metaKey, changedTouches)); } }); }
final JsArray< Touch > touches = e.getChangedTouches(); for ( int i = 0, j = touches.length() ; i < j ; i++ ) final JsArray< Touch > touches = e.getChangedTouches(); for ( int i = 0, j = touches.length() ; i < j ; i++ ) final JsArray< Touch > touches = e.getChangedTouches(); for ( int i = 0, j = touches.length() ; i < j ; i++ ) final JsArray< Touch > touches = e.getChangedTouches(); for ( int i = 0, j = touches.length() ; i < j ; i++ )
JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i);