本文整理汇总了Java中com.google.gwt.event.dom.client.TouchEndEvent.preventDefault方法的典型用法代码示例。如果您正苦于以下问题:Java TouchEndEvent.preventDefault方法的具体用法?Java TouchEndEvent.preventDefault怎么用?Java TouchEndEvent.preventDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.TouchEndEvent
的用法示例。
在下文中一共展示了TouchEndEvent.preventDefault方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent p_event)
{
if (!m_hasTouchMoved) {
p_event.preventDefault();
Touch touch = p_event.getChangedTouches().get(0);
Element current = getElement();
Element parent = current.getParentElement();
int x = touch.getPageX() - current.getOffsetLeft() - parent.getOffsetLeft();
int y = touch.getPageY() - current.getOffsetTop() - parent.getOffsetTop();
onUp(UserAction.Touch, x, y);
}
}
示例2: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
public void onTouchEnd(TouchEndEvent event) {
// GWT.log("touchend");;
event.preventDefault();
if (enabled && dragging) {
dragging=false;
draw();
if (command!=null)
command.execute();
}
}
示例3: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent 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)
return;
}
touchId = null;
event.preventDefault();
}
示例4: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
// button.setText("onTouchEnd:" + event.getTouches().length() + ":" + event.getTargetTouches().length());
event.preventDefault();
// if (hasTargetTouch && event.getTargetTouches().length() == 0) {
eventFired();
// }
}
开发者ID:languageininteraction,项目名称:GraphemeColourSynaesthesiaApp,代码行数:9,代码来源:SingleShotEventListner.java
示例5: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
containerScrollStartPosY = -1;
containerScrollStartPosX = -1;
GanttWidget.this.onTouchOrMouseUp(event.getNativeEvent());
event.preventDefault();
}
示例6: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
if (touchStarted) {
event.preventDefault();
event.stopPropagation();
NativeEvent nativeEvent = event.getNativeEvent();
NativeEvent evt = Document.get().createClickEvent(1,
nativeEvent.getScreenX(), nativeEvent.getScreenY(),
nativeEvent.getClientX(), nativeEvent.getClientY(), false,
false, false, false);
getElement().dispatchEvent(evt);
touchStarted = false;
fastClickAt = new Date();
}
}
示例7: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
public void onTouchEnd(TouchEndEvent event) {
if (touchStarted) {
event.preventDefault();
event.stopPropagation();
NativeEvent nativeEvent = event.getNativeEvent();
NativeEvent evt = Document.get().createClickEvent(1,
nativeEvent.getScreenX(), nativeEvent.getScreenY(),
nativeEvent.getClientX(), nativeEvent.getClientY(), false,
false, false, false);
getElement().dispatchEvent(evt);
touchStarted = false;
fastClickAt = new Date();
}
}
示例8: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
event.preventDefault();
touchOnEndHandler.onEnd(touchToImageEvent.getTouchOnImageEvent(event));
}
示例9: onTouchEnd
import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
public void onTouchEnd(TouchEndEvent event) {
if (isEnabled()) {
handleMouseUp();
event.preventDefault();
}
}