本文整理汇总了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());
}
}
示例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();
}
}
}
示例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());
}
}
示例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;
}
示例5: addTouchMoveHandler
import com.google.gwt.event.dom.client.TouchMoveEvent; //导入依赖的package包/类
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler handler) {
return addDomHandler(handler, TouchMoveEvent.getType());
}
示例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());
}
示例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()));
}
示例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);
}
示例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!");
}
}
示例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()));
}
}
示例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));
}
}
示例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()));
}
示例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);
}
示例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());
}
示例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();
}
}