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

项目:WebConsole    文件:ConsoleDisplay.java   
public ConsoleDisplay() {
    super(new AbsolutePanel(), CLASS_NAME);
    getElement().setId("consoleDisplayWrapper");

    // Create display panel where screen is actually loaded
    display = new AbsolutePanel();
    display.addStyleName("portrait");
    display.getElement().setId("consoleDisplay");

    // Add display to the wrapper
    ((AbsolutePanel)getWidget()).add(display, 0, 0);

    // Add move handlers which are only used on this display component
    if(BrowserUtils.isMobile) {
        this.addDomHandler(this, TouchMoveEvent.getType());
    } else {
        this.addDomHandler(this, MouseMoveEvent.getType());
        this.addDomHandler(this, MouseOutEvent.getType());
    }
}
项目:gantt    文件:GanttWidget.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    if (event.getChangedTouches().length() == 1) {
        boolean preventDefaultAndReturn = false;
        // did we intend to scroll the container?
        // apply 'manual' vertical scrolling
        if (containerScrollStartPosY != -1) {
            container.setScrollTop(containerScrollStartPosY - event.getChangedTouches().get(0).getPageY());
            preventDefaultAndReturn = true;
        }
        if (containerScrollStartPosX != -1) {
            container.setScrollLeft(containerScrollStartPosX - event.getChangedTouches().get(0).getPageX());
            preventDefaultAndReturn = true;
        }
        if (preventDefaultAndReturn) {
            event.preventDefault();
            return;
        }

        if (GanttWidget.this.onTouchOrMouseMove(event.getNativeEvent())) {
            event.preventDefault();
        }
    }
}
项目: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;
}
项目:geomajas-project-client-gwt2    文件:MapWidgetImpl.java   
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
    return addDomHandler(handler, TouchMoveEvent.getType());
}
项目:empiria.player    文件:TouchHandlersOnImageInitializerTest.java   
@Test
public void shouldAddTouchMoveHandlerOnImage() {
    // given
    TouchOnImageMoveHandler touchOnImageMoveHandler = mock(TouchOnImageMoveHandler.class);
    TouchMoveHandlerOnImage touchMoveHandlerOnImage = mock(TouchMoveHandlerOnImage.class);
    when(touchHandlerFactory.createTouchMoveHandlerOnImage(touchOnImageMoveHandler)).thenReturn(touchMoveHandlerOnImage);

    // when
    testObj.addTouchOnImageMoveHandler(touchOnImageMoveHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(touchMoveHandlerOnImage, TouchMoveEvent.getType());
}
项目:empiria.player    文件:TouchHandlerInitializerTest.java   
@Test
public void shouldAddTouchMoveHandler_ifNotIE() {
    // given
    TouchOnMoveHandler touchOnMoveHandler = mock(TouchOnMoveHandler.class);

    // when
    testObj.addTouchMoveHandler(touchOnMoveHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(any(TouchMoveHandlerImpl.class), eq(TouchMoveEvent.getType()));
}
项目:WebConsole    文件:ConsoleDisplay.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    event.preventDefault();
    event.stopPropagation();
    lastMoveEvent = new PressMoveEvent(event);
    ConsoleUnitEventManager.getInstance().getEventBus().fireEvent(lastMoveEvent);
}
项目:WebConsole    文件:BrowserUtils.java   
private static void initMobile() {
    // Prevent window scrolling
    RootPanel.get().addDomHandler(new TouchMoveHandler() {
        public void onTouchMove(TouchMoveEvent e) {
                e.preventDefault();
        }
    }, TouchMoveEvent.getType());

    Window.scrollTo(0, 1);
    new Timer() {
        public void run() {
            Window.scrollTo(0, 1);
        }
    }.schedule(1000);

    // Determine current window orientation
    if (getWindowHeight() < getWindowWidth()) {
        windowOrientation = "landscape";
    }

    // Create a native orientation change handler as resize handler isn't reliable on iOS 3.x
    addNativeOrientationHandler();

   // If Apple device then check if loaded from bookmark
    if (!isBookmarked()) {
        Window.alert("Please add this page to your Home Screen to view in fullscreen!");
    }
}
项目:WebConsole    文件:ListItem.java   
private void registerHandlers() {
    if(BrowserUtils.isMobile) {
        registerHandler(this.addDomHandler(this, TouchStartEvent.getType()));
        registerHandler(this.addDomHandler(this, TouchEndEvent.getType()));
        registerHandler(this.addDomHandler(this, TouchMoveEvent.getType()));
    } else {
        registerHandler(this.addDomHandler(this, MouseDownEvent.getType()));
        registerHandler(this.addDomHandler(this, MouseUpEvent.getType()));
        registerHandler(this.addDomHandler(this, MouseOutEvent.getType()));
        registerHandler(this.addDomHandler(this, MouseMoveEvent.getType()));
    }
}
项目:WebConsole    文件:ListItem.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    if (startEvent != null) {
        event.preventDefault();
        event.stopPropagation();
        propagateEvent(new PressMoveEvent(event));
    }
}
项目:circuitjs1    文件:Scrollbar.java   
public void onTouchMove(TouchMoveEvent e) {
//      GWT.log("touchmove");
        e.preventDefault();
        Touch t = e.getTouches().get(0);
        doMouseMove(t.getRelativeX(getElement()));
    }
项目:firefly    文件:MarkerToolCmd.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    if (_mouseDown) drag(pv, spt);
}
项目:djvu-html5    文件:PanListener.java   
public PanListener(Widget widget) {
    this.widget = widget;
    widget.addDomHandler(this, MouseDownEvent.getType());
    widget.addDomHandler(this, MouseUpEvent.getType());
    widget.addDomHandler(this, MouseMoveEvent.getType());
    widget.addDomHandler(this, TouchStartEvent.getType());
    widget.addDomHandler(this, TouchEndEvent.getType());
    widget.addDomHandler(this, TouchMoveEvent.getType());
}
项目:djvu-html5    文件:PanListener.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    if (touchId == null)
        return;
    JsArray<Touch> touches = event.getTouches();
    for (int i = 0; i < touches.length(); i++) {
        Touch touch = touches.get(i);
        if (touch.getIdentifier() != touchId)
            continue;
        pan(touch.getClientX() - x, touch.getClientY() - y);
        x = touch.getClientX();
        y = touch.getClientY();
        event.preventDefault();
    }
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
@Override
public void onTouchMove(TouchMoveEvent p_event)
{
  Touch touch = getTouch(p_event.getChangedTouches(), m_currentTouchEventId);
  if (touch != null) {
    if (p_event.getTouches().length() < 2) {
      // A single finger touch shouldn't be propagated upwards.
      // This prevents iOS 'bounce-scroll' to happen
      p_event.preventDefault();
    }
    onMove(Element.as(touch.getTarget()), touch.getClientX(), touch.getClientY());
  }
}
项目:GraphemeColourSynaesthesiaApp    文件:SingleShotEventListner.java   
@Override
    public void onTouchMove(TouchMoveEvent event) {
//        final JsArray<Touch> targetTouches = event.getTargetTouches();
//        button.setText("onTouchMove:" + event.getTouches().length() + ":" + event.getTargetTouches().length());
////        event.preventDefault();
//        if (targetTouches.length() > 0) {
//            final EventTarget target = targetTouches.shift().getTarget();
//            hasTargetTouch = target.equals(touchTarget);
//            button.setText(targetTouches.length() + ":" + hasTargetTouch);
//        } else {
//            touchTarget = null;
//            hasTargetTouch = true;
//        }
    }
项目:LanguageMemoryApp    文件:SingleShotEventListner.java   
@Override
    public void onTouchMove(TouchMoveEvent event) {
//        final JsArray<Touch> targetTouches = event.getTargetTouches();
//        button.setText("onTouchMove:" + event.getTouches().length() + ":" + event.getTargetTouches().length());
////        event.preventDefault();
//        if (targetTouches.length() > 0) {
//            final EventTarget target = targetTouches.shift().getTarget();
//            hasTargetTouch = target.equals(touchTarget);
//            button.setText(targetTouches.length() + ":" + hasTargetTouch);
//        } else {
//            touchTarget = null;
//            hasTargetTouch = true;
//        }
    }
项目:gantt    文件:SvgArrowWidget.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    GWT.log("SvgArrowWidget.onTouchMove(TouchMoveEvent)");
    if (event.getChangedTouches().length() == 1) {
        handleMove(event.getNativeEvent());
        event.preventDefault();
    }
}
项目:geomajas-project-client-gwt2    文件:DrawingInteractionPanel.java   
public void onMapInitialized(MapInitializationEvent event) {
    VectorContainer container = mapPresenter.getContainerManager().addScreenContainer();
    rectangle = new Rectangle(60, 40, 200, 80);
    rectangle.setFillColor("#CC9900");
    rectangle.setFillOpacity(0.4);

    text = new Text(70, 60, "Drag me...");
    text.setFontFamily("Arial");
    text.setFontSize(16);
    text.setStrokeOpacity(0);
    text.setFillColor("#000000");
    container.add(text);
    container.add(rectangle);

    DragHandler dragHandler = new DragHandler();
    rectangle.addMouseDownHandler(dragHandler);
    rectangle.addMouseUpHandler(dragHandler);
    rectangle.addMouseMoveHandler(dragHandler);
    rectangle.addMouseOutHandler(dragHandler);
    rectangle.addDomHandler(dragHandler, TouchMoveEvent.getType());
    rectangle.addDomHandler(dragHandler, TouchStartEvent.getType());
    rectangle.addDomHandler(dragHandler, TouchEndEvent.getType());
    text.addMouseDownHandler(dragHandler);
    text.addMouseUpHandler(dragHandler);
    text.addMouseMoveHandler(dragHandler);
    text.addMouseOutHandler(dragHandler);
}
项目:geomajas-project-client-gwt2    文件:DrawingInteractionPanel.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    if (dragging) {
        if (event.getTouches().length() == 1) {
            Element e = event.getRelativeElement();
            int deltaX = event.getTouches().get(0).getRelativeX(e) - startX;
            int deltaY = event.getTouches().get(0).getRelativeY(e) - startY;
            rectangle.setX(rectangle.getX() + deltaX);
            rectangle.setY(rectangle.getY() + deltaY);
            text.setX(text.getX() + deltaX);
            text.setY(text.getY() + deltaY);
        }
    }
}
项目:swarm    文件:Mouse.java   
private void addMouseDownHandlers()
{       
    m_container.addDomHandler(this, MouseWheelEvent.getType());
    m_container.addDomHandler(this, MouseOverEvent.getType());
    m_container.addDomHandler(this, MouseOutEvent.getType());
    m_container.addDomHandler(this, MouseMoveEvent.getType());
    m_container.addDomHandler(this, MouseUpEvent.getType());
    m_container.addDomHandler(this, MouseDownEvent.getType());
    m_container.addDomHandler(this, TouchStartEvent.getType());
    m_container.addDomHandler(this, TouchEndEvent.getType());
    m_container.addDomHandler(this, TouchMoveEvent.getType());
}
项目:swarm    文件:Mouse.java   
@Override
public void onTouchMove(TouchMoveEvent event)
{
    s_logger.log(Level.INFO, "move");

    Touch touch = event.getTouches().get(0);

    this.setMousePoint(touch.getRelativeX(m_container.getElement()), touch.getRelativeY(m_container.getElement()), m_mouseEvent.getPoint());
    m_mouseEvent.set(E_MouseEventType.MOUSE_MOVE, 0, Element.as(event.getNativeEvent().getEventTarget()), true);

    dispatchEvent(m_mouseEvent);
}
项目: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 onTouchMove(TouchMoveEvent event) {
    if (isEnabled()) {
        Touch touch = event.getTouches().get(0).cast();
        handleMouseMove(touch.getPageX(), touch.getPageY());
        if (dragging) {
            event.preventDefault();
        }
    }
}
项目:empiria.player    文件:TouchMoveHandlerOnImage.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    event.preventDefault();
    touchOnImageMoveHandler.onMove(touchToImageEvent.getTouchOnImageEvent(event));
}
项目:empiria.player    文件:TouchHandlersOnImageInitializer.java   
@Override
public void addTouchOnImageMoveHandler(final TouchOnImageMoveHandler touchOnMoveHandler, Widget listenOn) {
    TouchMoveHandlerOnImage touchMoveHandlerOnImage = touchHandlerFactory.createTouchMoveHandlerOnImage(touchOnMoveHandler);
    listenOn.addDomHandler(touchMoveHandlerOnImage, TouchMoveEvent.getType());
}
项目:empiria.player    文件:TouchHandlersInitializer.java   
@Override
public void addTouchMoveHandler(final TouchOnMoveHandler touchOnMoveHandler, Widget listenOn) {
    listenOn.addDomHandler(new TouchMoveHandlerImpl(touchOnMoveHandler), TouchMoveEvent.getType());
}
项目:empiria.player    文件:TouchMoveHandlerImpl.java   
@Override
public void onTouchMove(TouchMoveEvent event) {
    touchOnMoveHandler.onMove(event.getNativeEvent());
}
项目:appinventor-extensions    文件:HandlerPanel.java   
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
  return addDomHandler(handler, TouchMoveEvent.getType());
}
项目:firefly    文件:JwstFootprintCmd.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    if (_mouseDown) drag(pv, spt);
}
项目:firefly    文件:DistanceToolCmd.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    if (_mouseDown) drag(pv, spt);
}
项目:firefly    文件:SelectAreaCmd.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    if (_mouseDown) drag(pv, spt);
}
项目:firefly    文件:MagnifiedView.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    showMag(spt);
}
项目:firefly    文件:WebMouseReadoutPerm.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    move(pv, spt, true, true);
}
项目:firefly    文件:WebMouseReadout.java   
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    move(pv, spt, true, true);
}
项目:fullmetalgalaxy    文件:WgtBoardBase.java   
@Override
public void onTouchMove(TouchMoveEvent p_event) {
  m_hasTouchMoved = true;
}
项目:putnami-web-toolkit    文件:AbstractInput.java   
@Override
public com.google.gwt.event.shared.HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
    return this.addDomHandler(handler, TouchMoveEvent.getType());
}
项目:putnami-web-toolkit    文件:ListItem.java   
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
    return this.addDomHandler(handler, TouchMoveEvent.getType());
}
项目:putnami-web-toolkit    文件:Anchor.java   
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
    return this.addDomHandler(handler, TouchMoveEvent.getType());
}