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


Java TouchEndEvent.preventDefault方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:14,代码来源:WgtBoardBase.java

示例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();
	    }
	}
 
开发者ID:sharpie7,项目名称:circuitjs1,代码行数:11,代码来源:Scrollbar.java

示例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();
}
 
开发者ID:mateusz-matela,项目名称:djvu-html5,代码行数:14,代码来源:PanListener.java

示例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();
}
 
开发者ID:tltv,项目名称:gantt,代码行数:8,代码来源:GanttWidget.java

示例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();
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:16,代码来源:VNavigationButton.java

示例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();
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:15,代码来源:TouchButton.java

示例8: onTouchEnd

import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
    event.preventDefault();
    touchOnEndHandler.onEnd(touchToImageEvent.getTouchOnImageEvent(event));
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:6,代码来源:TouchEndHandlerOnImage.java

示例9: onTouchEnd

import com.google.gwt.event.dom.client.TouchEndEvent; //导入方法依赖的package包/类
public void onTouchEnd(TouchEndEvent event) {
    if (isEnabled()) {
        handleMouseUp();
        event.preventDefault();
    }
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:7,代码来源:VSwitch.java


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