本文整理汇总了Java中com.google.gwt.event.dom.client.TouchMoveEvent.preventDefault方法的典型用法代码示例。如果您正苦于以下问题:Java TouchMoveEvent.preventDefault方法的具体用法?Java TouchMoveEvent.preventDefault怎么用?Java TouchMoveEvent.preventDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.TouchMoveEvent
的用法示例。
在下文中一共展示了TouchMoveEvent.preventDefault方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
}
}
示例2: 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);
}
示例3: 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));
}
}
示例4: 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()));
}
示例5: 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();
}
}
示例6: onTouchMove
import com.google.gwt.event.dom.client.TouchMoveEvent; //导入方法依赖的package包/类
@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());
}
}
示例7: onTouchMove
import com.google.gwt.event.dom.client.TouchMoveEvent; //导入方法依赖的package包/类
@Override
public void onTouchMove(TouchMoveEvent event) {
GWT.log("SvgArrowWidget.onTouchMove(TouchMoveEvent)");
if (event.getChangedTouches().length() == 1) {
handleMove(event.getNativeEvent());
event.preventDefault();
}
}
示例8: onTouchMove
import com.google.gwt.event.dom.client.TouchMoveEvent; //导入方法依赖的package包/类
public void onTouchMove(TouchMoveEvent event) {
if (isEnabled()) {
Touch touch = event.getTouches().get(0).cast();
handleMouseMove(touch.getPageX(), touch.getPageY());
if (dragging) {
event.preventDefault();
}
}
}
示例9: onTouchMove
import com.google.gwt.event.dom.client.TouchMoveEvent; //导入方法依赖的package包/类
@Override
public void onTouchMove(TouchMoveEvent event) {
event.preventDefault();
touchOnImageMoveHandler.onMove(touchToImageEvent.getTouchOnImageEvent(event));
}