/** * Get an array of all current {@link Touch touches}. 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> getTouches() { return getNativeEvent().getTouches(); } }
@Override public void handleEvent(NativeEvent nevent) { if (inTouchSequence) { dispatch(toTouchEvents(Touch.Event.Kind.END, nevent), nevent); // if there are no remaining active touches, note that this touch sequence has ended if (nevent.getTouches().length() == 0) inTouchSequence = false; } } });
@Override public void handleEvent(NativeEvent nevent) { if (inTouchSequence) { dispatch(toTouchEvents(Touch.Event.Kind.END, nevent), nevent); // if there are no remaining active touches, note that this touch sequence has ended if (nevent.getTouches().length() == 0) inTouchSequence = false; } } });
/** * Get an array of all current {@link Touch touches}. 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> getTouches() { return getNativeEvent().getTouches(); } }
/** * Get an array of all current {@link Touch touches}. 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> getTouches() { return getNativeEvent().getTouches(); } }
public LightArray<Touch> getTouches() { return new JsLightArray<Touch>(getNativeEvent().getTouches()); }
@Override public void handleEvent(NativeEvent nativeEvent) { if (inTouchSequence) { Events.Flags flags = new Events.Flags.Impl(); onTouchEnd(toEvents(nativeEvent, flags)); if (flags.getPreventDefault()) nativeEvent.preventDefault(); // if there are no remaining active touches, note that this touch sequence has ended if (nativeEvent.getTouches().length() == 0) inTouchSequence = false; } } });