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

ConsoleDisplay.java 文件源码 项目:WebConsole 阅读 21 收藏 0 点赞 0 评论 0
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());
    }
}
GanttWidget.java 文件源码 项目:gantt 阅读 23 收藏 0 点赞 0 评论 0
@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();
        }
    }
}
SvgArrowWidget.java 文件源码 项目:gantt 阅读 21 收藏 0 点赞 0 评论 0
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());
    }
}
GfxUtilImpl.java 文件源码 项目:geomajas-project-client-gwt2 阅读 21 收藏 0 点赞 0 评论 0
@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;
}
MapWidgetImpl.java 文件源码 项目:geomajas-project-client-gwt2 阅读 24 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
    return addDomHandler(handler, TouchMoveEvent.getType());
}
TouchHandlersOnImageInitializerTest.java 文件源码 项目:empiria.player 阅读 17 收藏 0 点赞 0 评论 0
@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());
}
TouchHandlerInitializerTest.java 文件源码 项目:empiria.player 阅读 21 收藏 0 点赞 0 评论 0
@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()));
}
ConsoleDisplay.java 文件源码 项目:WebConsole 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void onTouchMove(TouchMoveEvent event) {
    event.preventDefault();
    event.stopPropagation();
    lastMoveEvent = new PressMoveEvent(event);
    ConsoleUnitEventManager.getInstance().getEventBus().fireEvent(lastMoveEvent);
}
BrowserUtils.java 文件源码 项目:WebConsole 阅读 22 收藏 0 点赞 0 评论 0
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!");
    }
}
ListItem.java 文件源码 项目:WebConsole 阅读 24 收藏 0 点赞 0 评论 0
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()));
    }
}
ListItem.java 文件源码 项目:WebConsole 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void onTouchMove(TouchMoveEvent event) {
    if (startEvent != null) {
        event.preventDefault();
        event.stopPropagation();
        propagateEvent(new PressMoveEvent(event));
    }
}
Scrollbar.java 文件源码 项目:circuitjs1 阅读 33 收藏 0 点赞 0 评论 0
public void onTouchMove(TouchMoveEvent e) {
//      GWT.log("touchmove");
        e.preventDefault();
        Touch t = e.getTouches().get(0);
        doMouseMove(t.getRelativeX(getElement()));
    }
MarkerToolCmd.java 文件源码 项目:firefly 阅读 19 收藏 0 点赞 0 评论 0
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    if (_mouseDown) drag(pv, spt);
}
PanListener.java 文件源码 项目:djvu-html5 阅读 21 收藏 0 点赞 0 评论 0
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());
}
PanListener.java 文件源码 项目:djvu-html5 阅读 21 收藏 0 点赞 0 评论 0
@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();
    }
}
WgtScroll.java 文件源码 项目:fullmetalgalaxy 阅读 22 收藏 0 点赞 0 评论 0
@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());
  }
}
SingleShotEventListner.java 文件源码 项目:GraphemeColourSynaesthesiaApp 阅读 25 收藏 0 点赞 0 评论 0
@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;
//        }
    }
SingleShotEventListner.java 文件源码 项目:LanguageMemoryApp 阅读 24 收藏 0 点赞 0 评论 0
@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;
//        }
    }
SvgArrowWidget.java 文件源码 项目:gantt 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void onTouchMove(TouchMoveEvent event) {
    GWT.log("SvgArrowWidget.onTouchMove(TouchMoveEvent)");
    if (event.getChangedTouches().length() == 1) {
        handleMove(event.getNativeEvent());
        event.preventDefault();
    }
}
DrawingInteractionPanel.java 文件源码 项目:geomajas-project-client-gwt2 阅读 21 收藏 0 点赞 0 评论 0
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);
}
DrawingInteractionPanel.java 文件源码 项目:geomajas-project-client-gwt2 阅读 21 收藏 0 点赞 0 评论 0
@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);
        }
    }
}
Mouse.java 文件源码 项目:swarm 阅读 26 收藏 0 点赞 0 评论 0
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());
}
Mouse.java 文件源码 项目:swarm 阅读 22 收藏 0 点赞 0 评论 0
@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);
}
VSwitch.java 文件源码 项目:touchkit 阅读 24 收藏 0 点赞 0 评论 0
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());
}
VSwitch.java 文件源码 项目:touchkit 阅读 23 收藏 0 点赞 0 评论 0
public void onTouchMove(TouchMoveEvent event) {
    if (isEnabled()) {
        Touch touch = event.getTouches().get(0).cast();
        handleMouseMove(touch.getPageX(), touch.getPageY());
        if (dragging) {
            event.preventDefault();
        }
    }
}
TouchMoveHandlerOnImage.java 文件源码 项目:empiria.player 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void onTouchMove(TouchMoveEvent event) {
    event.preventDefault();
    touchOnImageMoveHandler.onMove(touchToImageEvent.getTouchOnImageEvent(event));
}
TouchHandlersOnImageInitializer.java 文件源码 项目:empiria.player 阅读 20 收藏 0 点赞 0 评论 0
@Override
public void addTouchOnImageMoveHandler(final TouchOnImageMoveHandler touchOnMoveHandler, Widget listenOn) {
    TouchMoveHandlerOnImage touchMoveHandlerOnImage = touchHandlerFactory.createTouchMoveHandlerOnImage(touchOnMoveHandler);
    listenOn.addDomHandler(touchMoveHandlerOnImage, TouchMoveEvent.getType());
}
TouchHandlersInitializer.java 文件源码 项目:empiria.player 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void addTouchMoveHandler(final TouchOnMoveHandler touchOnMoveHandler, Widget listenOn) {
    listenOn.addDomHandler(new TouchMoveHandlerImpl(touchOnMoveHandler), TouchMoveEvent.getType());
}
TouchMoveHandlerImpl.java 文件源码 项目:empiria.player 阅读 18 收藏 0 点赞 0 评论 0
@Override
public void onTouchMove(TouchMoveEvent event) {
    touchOnMoveHandler.onMove(event.getNativeEvent());
}
HandlerPanel.java 文件源码 项目:appinventor-extensions 阅读 22 收藏 0 点赞 0 评论 0
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
  return addDomHandler(handler, TouchMoveEvent.getType());
}


问题


面经


文章

微信
公众号

扫码关注公众号