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


Java TouchEndEvent类代码示例

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


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

示例1: registerHandlers

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
private void registerHandlers() {
	if(BrowserUtils.isMobile) {
		registerHandler(this.addDomHandler(this, TouchStartEvent.getType()));
		registerHandler(this.addDomHandler(this, TouchEndEvent.getType()));
	} else {
		registerHandler(this.addDomHandler(this, MouseDownEvent.getType()));
		registerHandler(this.addDomHandler(this, MouseUpEvent.getType()));
		registerHandler(this.addDomHandler(this, MouseOutEvent.getType()));
	}
	registerHandler(this.addHandler(this, DragStartEvent.getType()));
	registerHandler(this.addHandler(this, DragMoveEvent.getType()));
	registerHandler(this.addHandler(this, DragEndEvent.getType()));
	registerHandler(this.addHandler(this, DragCancelEvent.getType()));
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:15,代码来源:ListPanelComponent.java

示例2: createSystemTabItem

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
private TabBarItemComponent createSystemTabItem(EnumSystemTabItemType itemType) {
	TabBarItem tabBarItem = null;
	TabBarItemComponent component = null;
	AutoBean<TabBarItem> TabBarItemBean = AutoBeanService.getInstance().getFactory().tabBarItem();
	tabBarItem = TabBarItemBean.as();
	switch (itemType) {
		case PREVIOUS:
			tabBarItem.setName("<");
			break;
		case NEXT:
			tabBarItem.setName(">");
			break;
	}
	component = new TabBarItemComponent(tabBarItem, itemType);
	// Add handlers as not created by usual mechanism
	if(BrowserUtils.isMobile) {
		systemTabHandlers.add(component.addDomHandler(this, TouchStartEvent.getType()));
		systemTabHandlers.add(component.addDomHandler(this, TouchEndEvent.getType()));
	} else {
		systemTabHandlers.add(component.addDomHandler(this, MouseDownEvent.getType()));
		systemTabHandlers.add(component.addDomHandler(this, MouseUpEvent.getType()));
		systemTabHandlers.add(component.addDomHandler(this, MouseOutEvent.getType()));
	}
	systemTabHandlers.add(component.addHandler(component, TapEvent.getType()));
	return component;
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:27,代码来源:TabBarComponent.java

示例3: 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

示例4: applyController

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的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: shouldAddTouchEndHandlerOnImage

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
@Test
public void shouldAddTouchEndHandlerOnImage() {
    // given
    TouchOnImageEndHandler touchOnImageEndHandler = mock(TouchOnImageEndHandler.class);
    TouchEndHandlerOnImage touchEndHandlerOnImage = mock(TouchEndHandlerOnImage.class);
    when(touchHandlerFactory.createTouchEndHandlerOnImage(touchOnImageEndHandler)).thenReturn(touchEndHandlerOnImage);

    // when
    testObj.addTouchOnImageEndHandler(touchOnImageEndHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(touchEndHandlerOnImage, TouchEndEvent.getType());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:14,代码来源:TouchHandlersOnImageInitializerTest.java

示例6: shouldAddTouchEndHandler_ifNotIE

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
@Test
public void shouldAddTouchEndHandler_ifNotIE() {
    // given
    TouchOnEndHandler touchOnStartHandler = mock(TouchOnEndHandler.class);

    // when
    testObj.addTouchEndHandler(touchOnStartHandler, listenOn);

    // then
    verify(listenOn).addDomHandler(any(TouchEndHandlerImpl.class), eq(TouchEndEvent.getType()));
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:12,代码来源:TouchHandlerInitializerTest.java

示例7: registerHandlers

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的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

示例8: onTouchEnd

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
	if (startEvent != null) {
		event.stopPropagation();
		PressEndEvent endEvent = new PressEndEvent(startEvent);
		if (endEvent != null) {
			eventBus.fireEvent(startEvent);
			eventBus.fireEvent(endEvent);
		}
		reset();
	}
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:13,代码来源:ListItem.java

示例9: onTouchEnd

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent event) {
	event.stopPropagation();
	PressEndEvent endEvent = null;
	if (lastMoveEvent != null) {
		endEvent = new PressEndEvent(lastMoveEvent);
	} else if (startEvent != null) {
		endEvent = new PressEndEvent(startEvent);
	}
	if (endEvent != null) {
		eventBus.fireEvent(endEvent);
		this.fireEvent(endEvent);
	}
	reset();
}
 
开发者ID:openremote,项目名称:WebConsole,代码行数:16,代码来源:ListPanelComponent.java

示例10: 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

示例11: getPoint

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
private static Point getPoint(EventHandlingTarget drawPanelCanvas, HumanInputEvent<?> event) {
	Element e = drawPanelCanvas.getElement();
	if (event instanceof MouseEvent<?>) {
		return new Point(((MouseEvent<?>) event).getRelativeX(e), ((MouseEvent<?>) event).getRelativeY(e));
	}
	else if (event instanceof TouchEndEvent) {
		return new Point(((TouchEvent<?>) event).getChangedTouches().get(0).getRelativeX(e), ((TouchEvent<?>) event).getChangedTouches().get(0).getRelativeY(e));
	}
	else if (event instanceof TouchEvent<?>) {
		return new Point(((TouchEvent<?>) event).getTouches().get(0).getRelativeX(e), ((TouchEvent<?>) event).getTouches().get(0).getRelativeY(e));
	}
	else {
		throw new RuntimeException("Unknown Event Type: " + event);
	}
}
 
开发者ID:umlet,项目名称:umlet,代码行数:16,代码来源:EventHandlingUtils.java

示例12: getPointAbsolute

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
private static Point getPointAbsolute(HumanInputEvent<?> event) {
	if (event instanceof MouseEvent<?>) {
		return new Point(((MouseEvent<?>) event).getClientX(), ((MouseEvent<?>) event).getClientY());
	}
	else if (event instanceof TouchEndEvent) {
		return new Point(((TouchEvent<?>) event).getChangedTouches().get(0).getPageX(), ((TouchEvent<?>) event).getChangedTouches().get(0).getPageY());
	}
	else if (event instanceof TouchEvent<?>) {
		return new Point(((TouchEvent<?>) event).getTouches().get(0).getPageX(), ((TouchEvent<?>) event).getTouches().get(0).getPageY());
	}
	else {
		throw new RuntimeException("Unknown Event Type: " + event);
	}
}
 
开发者ID:umlet,项目名称:umlet,代码行数:15,代码来源:EventHandlingUtils.java

示例13: PanListener

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的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

示例14: 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

示例15: onTouchEnd

import com.google.gwt.event.dom.client.TouchEndEvent; //导入依赖的package包/类
@Override
public void onTouchEnd(TouchEndEvent p_event)
{
  Touch touch = getTouch(p_event.getChangedTouches(), m_currentTouchEventId);
  if (touch != null) {
    m_currentTouchEventId = -1;
    onUp(Element.as(touch.getTarget()));
  }
}
 
开发者ID:kroc702,项目名称:fullmetalgalaxy,代码行数:10,代码来源:WgtScroll.java


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