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

项目:empiria.player    文件:TouchReservationHandler.java   
@Inject
public TouchReservationHandler(@Assisted IsWidget widget, final EventsBus eventsBus) {
    handlerRegistration = widget.asWidget().addDomHandler(new TouchStartHandler() {

        @Override
        public void onTouchStart(TouchStartEvent event) {
            eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));

        }
    }, TouchStartEvent.getType());
}
项目:WebConsole    文件:ListPanelComponent.java   
private void registerHandlers() {
    if(BrowserUtils.isMobile) {
        registerHandler(this.addDomHandler(this, TouchStartEvent.getType()));
        registerHandler(this.addDomHandler(this, TouchEndEvent.getType()));
    } else {
        registerHandler(this.addDomHandler(this, MouseDownEvent.getType()));
        registerHandler(this.addDomHandler(this, MouseUpEvent.getType()));
        registerHandler(this.addDomHandler(this, MouseOutEvent.getType()));
    }
    registerHandler(this.addHandler(this, DragStartEvent.getType()));
    registerHandler(this.addHandler(this, DragMoveEvent.getType()));
    registerHandler(this.addHandler(this, DragEndEvent.getType()));
    registerHandler(this.addHandler(this, DragCancelEvent.getType()));
}
项目:WebConsole    文件:ListPanelComponent.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    event.stopPropagation();
    startEvent = new PressStartEvent(event);
    eventBus.fireEvent(startEvent);
    this.fireEvent(startEvent);
}
项目:WebConsole    文件:InteractiveConsoleComponent.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    event.stopPropagation();
    startEvent = new PressStartEvent(event);
    eventBus.fireEvent(startEvent);
    this.fireEvent(startEvent);
}
项目:WebConsole    文件:TabBarComponent.java   
private TabBarItemComponent createSystemTabItem(EnumSystemTabItemType itemType) {
    TabBarItem tabBarItem = null;
    TabBarItemComponent component = null;
    AutoBean<TabBarItem> TabBarItemBean = AutoBeanService.getInstance().getFactory().tabBarItem();
    tabBarItem = TabBarItemBean.as();
    switch (itemType) {
        case PREVIOUS:
            tabBarItem.setName("<");
            break;
        case NEXT:
            tabBarItem.setName(">");
            break;
    }
    component = new TabBarItemComponent(tabBarItem, itemType);
    // Add handlers as not created by usual mechanism
    if(BrowserUtils.isMobile) {
        systemTabHandlers.add(component.addDomHandler(this, TouchStartEvent.getType()));
        systemTabHandlers.add(component.addDomHandler(this, TouchEndEvent.getType()));
    } else {
        systemTabHandlers.add(component.addDomHandler(this, MouseDownEvent.getType()));
        systemTabHandlers.add(component.addDomHandler(this, MouseUpEvent.getType()));
        systemTabHandlers.add(component.addDomHandler(this, MouseOutEvent.getType()));
    }
    systemTabHandlers.add(component.addHandler(component, TapEvent.getType()));
    return component;
}
项目:firefly    文件:WebPlotView.java   
/**
 * Create a new PlotView.  This constructor is typically used when the
 * PlotView <em>will</em> be placed insides a scrolled window.
 */
public WebPlotView() {
    initWidgets();
    _scrollingRootPanel.addDomHandler(new MouseDownHandler() {
        public void onMouseDown(MouseDownEvent ev) {
            if (_mpw != null) _mpw.selectSelf();
        }
    }, MouseDownEvent.getType());

    _scrollingRootPanel.addDomHandler(new TouchStartHandler() {
        public void onTouchStart(TouchStartEvent event) {
            if (_mpw != null) _mpw.selectSelf();
        }
    }, TouchStartEvent.getType());

}
项目:gantt    文件:SvgArrowWidget.java   
@Override
public void setUpEventHandlers(boolean touchSupported,
        boolean msTouchSupported) {
    this.touchSupported = touchSupported;
    this.msTouchSupported = msTouchSupported;
    if (msTouchSupported) {
        addDomHandler(pointerDownHandler, PointerDownEvent.getType());
        addDomHandler(pointerUpHandler, PointerUpEvent.getType());
    } else if (touchSupported) {
        addDomHandler(touchStartHandler, TouchStartEvent.getType());
    } else {
        addHandler(mouseDownHandler, MouseDownEvent.getType());
    }
    registerMouseDownAndTouchDownEventListener(startingPoint);
    registerMouseDownAndTouchDownEventListener(endingPoint);
}
项目: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    文件:DrawingInteractionPanel.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    if (event.getTouches().length() == 1) {
        dragging = true;
        Element e = event.getRelativeElement();
        startX = event.getTouches().get(0).getRelativeX(e);
        startY = event.getTouches().get(0).getRelativeY(e);
    }
    // Stop the event from reaching the map controller: no panning while we're dragging the rectangle.
    event.stopPropagation();
}
项目:touchkit    文件:VSwitch.java   
public void onTouchStart(TouchStartEvent event) {
    if (isEnabled()) {
        Touch touch = event.getTouches().get(0).cast();
        handleMouseDown(touch.getPageX(), touch.getPageY());
        event.stopPropagation();
    }
}
项目:empiria.player    文件:TouchHandlersOnImageInitializer.java   
@Override
public void addTouchOnImageStartHandler(final TouchOnImageStartHandler touchStartHandler, Widget listenOn) {
    TouchStartHandlerOnImage touchStartHandlerOnImage = touchHandlerFactory.createTouchStartHandlerOnImage(touchStartHandler);
    listenOn.addDomHandler(touchStartHandlerOnImage, TouchStartEvent.getType());
}
项目:empiria.player    文件:VideoFullScreenViewImpl.java   
@Inject
public VideoFullScreenViewImpl(EventsBus eventsBus) {
    this.eventsBus = eventsBus;
    initWidget(uiBinder.createAndBindUi(this));
    container.addDomHandler(new TouchStartHandler() {

        @Override
        public void onTouchStart(TouchStartEvent event) {
            VideoFullScreenViewImpl.this.eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
        }
    }, TouchStartEvent.getType());
}
项目:empiria.player    文件:TouchHandlersOnImageInitializerTest.java   
@Test
public void shouldAddTouchStartHandlerOnImage() {
    // given
    TouchOnImageStartHandler touchOnImageStartHandler = mock(TouchOnImageStartHandler.class);
    TouchStartHandlerOnImage touchStartHandlerOnImage = mock(TouchStartHandlerOnImage.class);
    when(touchHandlerFactory.createTouchStartHandlerOnImage(touchOnImageStartHandler)).thenReturn(touchStartHandlerOnImage);

    // when
    testObj.addTouchOnImageStartHandler(touchOnImageStartHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(touchStartHandlerOnImage, TouchStartEvent.getType());
}
项目:empiria.player    文件:TouchReservationHandlerJUnitTest.java   
@Test
public void TouchReservationHandler() throws Exception {
    TouchReservationHandler instance = new TouchReservationHandler(isWidget, eventsBus);
    verify(isWidget.asWidget()).addDomHandler(Matchers.any(TouchStartHandler.class), typeCaptor.capture());
    assertTrue(typeCaptor.getValue()
            .equals(TouchStartEvent.getType()));

}
项目:empiria.player    文件:TouchHandlerInitializerTest.java   
@Test
public void shouldAddTouchStartHandler_ifNotIE() {
    // given
    TouchOnStartHandler touchOnStartHandler = mock(TouchOnStartHandler.class);

    // when
    testObj.addTouchStartHandler(touchOnStartHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(any(TouchStartHandlerImpl.class), eq(TouchStartEvent.getType()));
}
项目: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()));
    }
}
项目:Wiab.pro    文件:EventDispatcherPanel.java   
@Override
boolean dispatch(TouchStartEvent event, Element context, WaveTouchStartHandler handler) {
  return handler.onTouchStart(event, context);
}
项目:circuitjs1    文件:Scrollbar.java   
public void onTouchStart(TouchStartEvent event) {
//      GWT.log("touchstart");
        event.preventDefault();
        dragging=false;
        Touch t = event.getTouches().get(0);
        doMouseDown(t.getRelativeX(getElement()), false);
    }
项目:djvu-html5    文件:SinglePageLayout.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    if (isOnText(event)) {
        enableScrollPageJump = false;
    } else {
        widget.getElement().focus();
        super.onTouchStart(event);
    }
}
项目:djvu-html5    文件:UIHider.java   
public UIHider(int uiHideDelay, Widget textLayer) {
    this.uiHideDelay = uiHideDelay;
    textLayer.addDomHandler(this, MouseMoveEvent.getType());
    textLayer.addDomHandler(this, KeyDownEvent.getType());
    textLayer.addDomHandler(this, ScrollEvent.getType());
    textLayer.addDomHandler(this, TouchStartEvent.getType());
}
项目: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 onTouchStart(TouchStartEvent event) {
    if (touchId != null || isMouseDown)
        return;
    Touch touch = event.getTouches().get(0);
    touchId = touch.getIdentifier();
    x = touch.getClientX();
    y = touch.getClientY();
    event.preventDefault();
}
项目:fullmetalgalaxy    文件:WgtScroll.java   
@Override
public void onTouchStart(TouchStartEvent p_event)
{
  Touch touch = getTouch(p_event.getChangedTouches(), -1);
  if (touch != null) {
    m_currentTouchEventId = touch.getIdentifier();
    onDown(Element.as(touch.getTarget()), touch.getClientX(), touch.getClientY());
  }
}
项目:GraphemeColourSynaesthesiaApp    文件:SingleShotEventListner.java   
@Override
    public void onTouchStart(TouchStartEvent event) {
//        final JsArray<Touch> targetTouches = event.getTargetTouches();
//        button.setText("onTouchStart:" + targetTouches.length());
//        event.preventDefault();
//        if (targetTouches.length() > 0) {
//            touchTarget = targetTouches.shift().getTarget();
//            hasTargetTouch = true;
//        }
    }
项目:LanguageMemoryApp    文件:SingleShotEventListner.java   
@Override
    public void onTouchStart(TouchStartEvent event) {
//        final JsArray<Touch> targetTouches = event.getTargetTouches();
//        button.setText("onTouchStart:" + targetTouches.length());
//        event.preventDefault();
//        if (targetTouches.length() > 0) {
//            touchTarget = targetTouches.shift().getTarget();
//            hasTargetTouch = true;
//        }
    }
项目:gantt    文件:GanttWidget.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    if (event.getTargetTouches().length() == 1) {
        JavaScriptObject target = event.getNativeEvent().getEventTarget().cast();
        containerScrollStartPosY = -1;
        containerScrollStartPosX = -1;

        if (target == container || target == content || (!isMovableSteps())) {
            boolean preventDefaultAndReturn = false;
            // store x,y position for 'manual' vertical scrolling
            if (isContentOverflowingVertically()) {
                containerScrollStartPosY = container.getScrollTop() + event.getTouches().get(0).getPageY();
                preventDefaultAndReturn = true;
            }
            if (isContentOverflowingHorizontally()) {
                containerScrollStartPosX = container.getScrollLeft() + event.getTouches().get(0).getPageX();
                preventDefaultAndReturn = true;
            }
            if (preventDefaultAndReturn) {
                event.preventDefault();
                return;
            }
        }
        GanttWidget.this.onTouchOrMouseDown(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);
}
项目: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 onTouchStart(TouchStartEvent event)
{
    if( m_isMouseDown )  return;

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

    onMouseOrTouchDown(event, touch.getRelativeX(m_container.getElement()), touch.getRelativeY(m_container.getElement()), true);
}
项目: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());
}
项目:empiria.player    文件:SimulationModule.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    touchController.setTouchReservation(true);
}
项目:empiria.player    文件:TouchStartHandlerOnImage.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    event.preventDefault();
    touchStartHandler.onStart(touchToImageEvent.getTouchOnImageEvent(event));
}
项目:empiria.player    文件:TouchHandlersInitializer.java   
@Override
public void addTouchStartHandler(final TouchOnStartHandler touchStartHandler, Widget listenOn) {
    listenOn.addDomHandler(new TouchStartHandlerImpl(touchStartHandler), TouchStartEvent.getType());

}
项目:empiria.player    文件:TouchStartHandlerImpl.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    touchStartHandler.onStart(event.getNativeEvent());
}
项目:appinventor-extensions    文件:HandlerPanel.java   
public HandlerRegistration addTouchStartHandler(TouchStartHandler handler) {
  return addDomHandler(handler, TouchStartEvent.getType());
}
项目:WebConsole    文件:ListItem.java   
@Override
public void onTouchStart(TouchStartEvent event) {
    event.stopPropagation();
    startEvent = new PressStartEvent(event);
}
项目:Wiab.pro    文件:EventDispatcherPanel.java   
@Override
void registerGwtHandler() {
  addDomHandler(this, TouchStartEvent.getType());
}
项目:Wiab.pro    文件:EventDispatcherPanel.java   
@Override
public void onTouchStart(TouchStartEvent event) {
  if (dispatch(event, event.getNativeEvent().getEventTarget().<Element>cast())) {
    event.stopPropagation();
  }
}
项目:firefly    文件:JwstFootprintCmd.java   
@Override
public void onTouchStart(WebPlotView pv, ScreenPt spt, TouchStartEvent ev) {
    _mouseDown = true;
    begin(pv, spt);
}
项目:firefly    文件:DistanceToolCmd.java   
@Override
public void onTouchStart(WebPlotView pv, ScreenPt spt, TouchStartEvent ev) {
    _mouseDown= true;
    begin(pv, spt);
}