当前位置: 首页>>代码示例>>Java>>正文


Java TouchMoveEvent类代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.TouchMoveEvent的典型用法代码示例。如果您正苦于以下问题:Java TouchMoveEvent类的具体用法?Java TouchMoveEvent怎么用?Java TouchMoveEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TouchMoveEvent类属于com.google.gwt.event.dom.client包,在下文中一共展示了TouchMoveEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ConsoleDisplay

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
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());
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:21,代码来源:ConsoleDisplay.java

示例2: onTouchMove

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@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();
        }
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:25,代码来源:GanttWidget.java

示例3: addMoveHandler

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
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());
    }
}
 
开发者ID:tltv,项目名称:gantt,代码行数:17,代码来源:SvgArrowWidget.java

示例4: applyController

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@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;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:17,代码来源:GfxUtilImpl.java

示例5: addTouchMoveHandler

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
	return addDomHandler(handler, TouchMoveEvent.getType());
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:5,代码来源:MapWidgetImpl.java

示例6: shouldAddTouchMoveHandlerOnImage

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@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());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:14,代码来源:TouchHandlersOnImageInitializerTest.java

示例7: shouldAddTouchMoveHandler_ifNotIE

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@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()));
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:12,代码来源:TouchHandlerInitializerTest.java

示例8: onTouchMove

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@Override
public void onTouchMove(TouchMoveEvent event) {
	event.preventDefault();
	event.stopPropagation();
	lastMoveEvent = new PressMoveEvent(event);
	ConsoleUnitEventManager.getInstance().getEventBus().fireEvent(lastMoveEvent);
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:8,代码来源:ConsoleDisplay.java

示例9: initMobile

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
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!");
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:29,代码来源:BrowserUtils.java

示例10: registerHandlers

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
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()));
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:13,代码来源:ListItem.java

示例11: onTouchMove

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@Override
public void onTouchMove(TouchMoveEvent event) {
	if (startEvent != null) {
		event.preventDefault();
		event.stopPropagation();
		propagateEvent(new PressMoveEvent(event));
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:9,代码来源:ListItem.java

示例12: onTouchMove

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
public void onTouchMove(TouchMoveEvent e) {
//	    GWT.log("touchmove");
	    e.preventDefault();
	    Touch t = e.getTouches().get(0);
	    doMouseMove(t.getRelativeX(getElement()));
	}
 
开发者ID:sharpie7,项目名称:circuitjs1,代码行数:7,代码来源:Scrollbar.java

示例13: onTouchMove

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@Override
public void onTouchMove(WebPlotView pv, ScreenPt spt, TouchMoveEvent ev) {
    if (_mouseDown) drag(pv, spt);
}
 
开发者ID:lsst,项目名称:firefly,代码行数:5,代码来源:MarkerToolCmd.java

示例14: PanListener

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
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());
}
 
开发者ID:mateusz-matela,项目名称:djvu-html5,代码行数:10,代码来源:PanListener.java

示例15: onTouchMove

import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@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();
	}
}
 
开发者ID:mateusz-matela,项目名称:djvu-html5,代码行数:16,代码来源:PanListener.java


注:本文中的com.google.gwt.event.dom.client.TouchMoveEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。