@Inject
public TouchReservationHandler(@Assisted IsWidget widget, final EventsBus eventsBus) {
handlerRegistration = widget.asWidget().addDomHandler(new TouchStartHandler() {
@Override
public void onTouchStart(TouchStartEvent event) {
eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
}
}, TouchStartEvent.getType());
}
java类com.google.gwt.event.dom.client.TouchStartEvent的实例源码
TouchReservationHandler.java 文件源码
项目:empiria.player
阅读 22
收藏 0
点赞 0
评论 0
ListPanelComponent.java 文件源码
项目:WebConsole
阅读 19
收藏 0
点赞 0
评论 0
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()));
}
ListPanelComponent.java 文件源码
项目:WebConsole
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
event.stopPropagation();
startEvent = new PressStartEvent(event);
eventBus.fireEvent(startEvent);
this.fireEvent(startEvent);
}
InteractiveConsoleComponent.java 文件源码
项目:WebConsole
阅读 23
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
event.stopPropagation();
startEvent = new PressStartEvent(event);
eventBus.fireEvent(startEvent);
this.fireEvent(startEvent);
}
TabBarComponent.java 文件源码
项目:WebConsole
阅读 34
收藏 0
点赞 0
评论 0
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;
}
WebPlotView.java 文件源码
项目:firefly
阅读 25
收藏 0
点赞 0
评论 0
/**
* Create a new PlotView. This constructor is typically used when the
* PlotView <em>will</em> be placed insides a scrolled window.
*/
public WebPlotView() {
initWidgets();
_scrollingRootPanel.addDomHandler(new MouseDownHandler() {
public void onMouseDown(MouseDownEvent ev) {
if (_mpw != null) _mpw.selectSelf();
}
}, MouseDownEvent.getType());
_scrollingRootPanel.addDomHandler(new TouchStartHandler() {
public void onTouchStart(TouchStartEvent event) {
if (_mpw != null) _mpw.selectSelf();
}
}, TouchStartEvent.getType());
}
SvgArrowWidget.java 文件源码
项目:gantt
阅读 69
收藏 0
点赞 0
评论 0
@Override
public void setUpEventHandlers(boolean touchSupported,
boolean msTouchSupported) {
this.touchSupported = touchSupported;
this.msTouchSupported = msTouchSupported;
if (msTouchSupported) {
addDomHandler(pointerDownHandler, PointerDownEvent.getType());
addDomHandler(pointerUpHandler, PointerUpEvent.getType());
} else if (touchSupported) {
addDomHandler(touchStartHandler, TouchStartEvent.getType());
} else {
addHandler(mouseDownHandler, MouseDownEvent.getType());
}
registerMouseDownAndTouchDownEventListener(startingPoint);
registerMouseDownAndTouchDownEventListener(endingPoint);
}
GfxUtilImpl.java 文件源码
项目:geomajas-project-client-gwt2
阅读 20
收藏 0
点赞 0
评论 0
@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;
}
DrawingInteractionPanel.java 文件源码
项目:geomajas-project-client-gwt2
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
if (event.getTouches().length() == 1) {
dragging = true;
Element e = event.getRelativeElement();
startX = event.getTouches().get(0).getRelativeX(e);
startY = event.getTouches().get(0).getRelativeY(e);
}
// Stop the event from reaching the map controller: no panning while we're dragging the rectangle.
event.stopPropagation();
}
VSwitch.java 文件源码
项目:touchkit
阅读 22
收藏 0
点赞 0
评论 0
public void onTouchStart(TouchStartEvent event) {
if (isEnabled()) {
Touch touch = event.getTouches().get(0).cast();
handleMouseDown(touch.getPageX(), touch.getPageY());
event.stopPropagation();
}
}
TouchHandlersOnImageInitializer.java 文件源码
项目:empiria.player
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void addTouchOnImageStartHandler(final TouchOnImageStartHandler touchStartHandler, Widget listenOn) {
TouchStartHandlerOnImage touchStartHandlerOnImage = touchHandlerFactory.createTouchStartHandlerOnImage(touchStartHandler);
listenOn.addDomHandler(touchStartHandlerOnImage, TouchStartEvent.getType());
}
VideoFullScreenViewImpl.java 文件源码
项目:empiria.player
阅读 20
收藏 0
点赞 0
评论 0
@Inject
public VideoFullScreenViewImpl(EventsBus eventsBus) {
this.eventsBus = eventsBus;
initWidget(uiBinder.createAndBindUi(this));
container.addDomHandler(new TouchStartHandler() {
@Override
public void onTouchStart(TouchStartEvent event) {
VideoFullScreenViewImpl.this.eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
}
}, TouchStartEvent.getType());
}
TouchHandlersOnImageInitializerTest.java 文件源码
项目:empiria.player
阅读 22
收藏 0
点赞 0
评论 0
@Test
public void shouldAddTouchStartHandlerOnImage() {
// given
TouchOnImageStartHandler touchOnImageStartHandler = mock(TouchOnImageStartHandler.class);
TouchStartHandlerOnImage touchStartHandlerOnImage = mock(TouchStartHandlerOnImage.class);
when(touchHandlerFactory.createTouchStartHandlerOnImage(touchOnImageStartHandler)).thenReturn(touchStartHandlerOnImage);
// when
testObj.addTouchOnImageStartHandler(touchOnImageStartHandler, listenOn);
// then
verify(listenOn).addDomHandler(touchStartHandlerOnImage, TouchStartEvent.getType());
}
TouchReservationHandlerJUnitTest.java 文件源码
项目:empiria.player
阅读 26
收藏 0
点赞 0
评论 0
@Test
public void TouchReservationHandler() throws Exception {
TouchReservationHandler instance = new TouchReservationHandler(isWidget, eventsBus);
verify(isWidget.asWidget()).addDomHandler(Matchers.any(TouchStartHandler.class), typeCaptor.capture());
assertTrue(typeCaptor.getValue()
.equals(TouchStartEvent.getType()));
}
TouchHandlerInitializerTest.java 文件源码
项目:empiria.player
阅读 29
收藏 0
点赞 0
评论 0
@Test
public void shouldAddTouchStartHandler_ifNotIE() {
// given
TouchOnStartHandler touchOnStartHandler = mock(TouchOnStartHandler.class);
// when
testObj.addTouchStartHandler(touchOnStartHandler, listenOn);
// then
verify(listenOn).addDomHandler(any(TouchStartHandlerImpl.class), eq(TouchStartEvent.getType()));
}
ListItem.java 文件源码
项目:WebConsole
阅读 26
收藏 0
点赞 0
评论 0
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()));
}
}
EventDispatcherPanel.java 文件源码
项目:Wiab.pro
阅读 22
收藏 0
点赞 0
评论 0
@Override
boolean dispatch(TouchStartEvent event, Element context, WaveTouchStartHandler handler) {
return handler.onTouchStart(event, context);
}
Scrollbar.java 文件源码
项目:circuitjs1
阅读 23
收藏 0
点赞 0
评论 0
public void onTouchStart(TouchStartEvent event) {
// GWT.log("touchstart");
event.preventDefault();
dragging=false;
Touch t = event.getTouches().get(0);
doMouseDown(t.getRelativeX(getElement()), false);
}
SinglePageLayout.java 文件源码
项目:djvu-html5
阅读 23
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
if (isOnText(event)) {
enableScrollPageJump = false;
} else {
widget.getElement().focus();
super.onTouchStart(event);
}
}
UIHider.java 文件源码
项目:djvu-html5
阅读 20
收藏 0
点赞 0
评论 0
public UIHider(int uiHideDelay, Widget textLayer) {
this.uiHideDelay = uiHideDelay;
textLayer.addDomHandler(this, MouseMoveEvent.getType());
textLayer.addDomHandler(this, KeyDownEvent.getType());
textLayer.addDomHandler(this, ScrollEvent.getType());
textLayer.addDomHandler(this, TouchStartEvent.getType());
}
PanListener.java 文件源码
项目:djvu-html5
阅读 24
收藏 0
点赞 0
评论 0
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());
}
PanListener.java 文件源码
项目:djvu-html5
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
if (touchId != null || isMouseDown)
return;
Touch touch = event.getTouches().get(0);
touchId = touch.getIdentifier();
x = touch.getClientX();
y = touch.getClientY();
event.preventDefault();
}
WgtScroll.java 文件源码
项目:fullmetalgalaxy
阅读 28
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent p_event)
{
Touch touch = getTouch(p_event.getChangedTouches(), -1);
if (touch != null) {
m_currentTouchEventId = touch.getIdentifier();
onDown(Element.as(touch.getTarget()), touch.getClientX(), touch.getClientY());
}
}
SingleShotEventListner.java 文件源码
项目:GraphemeColourSynaesthesiaApp
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
// final JsArray<Touch> targetTouches = event.getTargetTouches();
// button.setText("onTouchStart:" + targetTouches.length());
// event.preventDefault();
// if (targetTouches.length() > 0) {
// touchTarget = targetTouches.shift().getTarget();
// hasTargetTouch = true;
// }
}
SingleShotEventListner.java 文件源码
项目:LanguageMemoryApp
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
// final JsArray<Touch> targetTouches = event.getTargetTouches();
// button.setText("onTouchStart:" + targetTouches.length());
// event.preventDefault();
// if (targetTouches.length() > 0) {
// touchTarget = targetTouches.shift().getTarget();
// hasTargetTouch = true;
// }
}
GanttWidget.java 文件源码
项目:gantt
阅读 24
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event) {
if (event.getTargetTouches().length() == 1) {
JavaScriptObject target = event.getNativeEvent().getEventTarget().cast();
containerScrollStartPosY = -1;
containerScrollStartPosX = -1;
if (target == container || target == content || (!isMovableSteps())) {
boolean preventDefaultAndReturn = false;
// store x,y position for 'manual' vertical scrolling
if (isContentOverflowingVertically()) {
containerScrollStartPosY = container.getScrollTop() + event.getTouches().get(0).getPageY();
preventDefaultAndReturn = true;
}
if (isContentOverflowingHorizontally()) {
containerScrollStartPosX = container.getScrollLeft() + event.getTouches().get(0).getPageX();
preventDefaultAndReturn = true;
}
if (preventDefaultAndReturn) {
event.preventDefault();
return;
}
}
GanttWidget.this.onTouchOrMouseDown(event.getNativeEvent());
}
event.preventDefault();
}
DrawingInteractionPanel.java 文件源码
项目:geomajas-project-client-gwt2
阅读 21
收藏 0
点赞 0
评论 0
public void onMapInitialized(MapInitializationEvent event) {
VectorContainer container = mapPresenter.getContainerManager().addScreenContainer();
rectangle = new Rectangle(60, 40, 200, 80);
rectangle.setFillColor("#CC9900");
rectangle.setFillOpacity(0.4);
text = new Text(70, 60, "Drag me...");
text.setFontFamily("Arial");
text.setFontSize(16);
text.setStrokeOpacity(0);
text.setFillColor("#000000");
container.add(text);
container.add(rectangle);
DragHandler dragHandler = new DragHandler();
rectangle.addMouseDownHandler(dragHandler);
rectangle.addMouseUpHandler(dragHandler);
rectangle.addMouseMoveHandler(dragHandler);
rectangle.addMouseOutHandler(dragHandler);
rectangle.addDomHandler(dragHandler, TouchMoveEvent.getType());
rectangle.addDomHandler(dragHandler, TouchStartEvent.getType());
rectangle.addDomHandler(dragHandler, TouchEndEvent.getType());
text.addMouseDownHandler(dragHandler);
text.addMouseUpHandler(dragHandler);
text.addMouseMoveHandler(dragHandler);
text.addMouseOutHandler(dragHandler);
}
Mouse.java 文件源码
项目:swarm
阅读 33
收藏 0
点赞 0
评论 0
private void addMouseDownHandlers()
{
m_container.addDomHandler(this, MouseWheelEvent.getType());
m_container.addDomHandler(this, MouseOverEvent.getType());
m_container.addDomHandler(this, MouseOutEvent.getType());
m_container.addDomHandler(this, MouseMoveEvent.getType());
m_container.addDomHandler(this, MouseUpEvent.getType());
m_container.addDomHandler(this, MouseDownEvent.getType());
m_container.addDomHandler(this, TouchStartEvent.getType());
m_container.addDomHandler(this, TouchEndEvent.getType());
m_container.addDomHandler(this, TouchMoveEvent.getType());
}
Mouse.java 文件源码
项目:swarm
阅读 27
收藏 0
点赞 0
评论 0
@Override
public void onTouchStart(TouchStartEvent event)
{
if( m_isMouseDown ) return;
Touch touch = event.getTouches().get(0);
onMouseOrTouchDown(event, touch.getRelativeX(m_container.getElement()), touch.getRelativeY(m_container.getElement()), true);
}
VSwitch.java 文件源码
项目:touchkit
阅读 24
收藏 0
点赞 0
评论 0
private void addHandlers() {
addDomHandler(this, KeyUpEvent.getType());
if (TouchEvent.isSupported()) {
addDomHandler(this, TouchStartEvent.getType());
addDomHandler(this, TouchMoveEvent.getType());
addDomHandler(this, TouchEndEvent.getType());
addDomHandler(this, TouchCancelEvent.getType());
} else {
addDomHandler(this, MouseDownEvent.getType());
addDomHandler(this, MouseUpEvent.getType());
addDomHandler(this, MouseMoveEvent.getType());
}
addDomHandler(this, FocusEvent.getType());
addDomHandler(this, BlurEvent.getType());
}