本文整理汇总了Java中com.google.gwt.user.client.Event.ONTOUCHEND属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ONTOUCHEND属性的具体用法?Java Event.ONTOUCHEND怎么用?Java Event.ONTOUCHEND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONTOUCHEND属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBrowserEvent
@Override
public void onBrowserEvent(com.google.gwt.user.client.Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONTOUCHSTART:
// rezerwujemy touch dla siebie nic innego nie powinno obslugiwac tego zdarzenia np TouchPageSwitch
eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
pressed = true;
setPosition(event);
break;
case Event.ONTOUCHEND:
case Event.ONMOUSEUP:
pressed = false;
setPosition(event);
break;
case Event.ONTOUCHMOVE:
case Event.ONMOUSEMOVE:
setPosition(event);
default:
break;
}
super.onBrowserEvent(event);
}
示例2: onEventPreview
@Override
public boolean onEventPreview(Event event) {
int type = DOM.eventGetType(event);
if ((type == Event.ONCLICK || type == Event.ONTOUCHEND)
&& event.getEventTarget() != null) {
Element target = Element.as(event.getEventTarget());
if (target.getClassName() != null && target.getClassName().contains(CUBA_NOTIFICATION_MODALITY_CURTAIN)) {
hide();
return false;
}
}
if (type == Event.ONKEYDOWN && event.getKeyCode() == KeyCodes.KEY_ESCAPE) {
if (!getElement().getClassName().contains(TRAY_STYLE)) {
hide();
return false;
}
}
return super.onEventPreview(event);
}
示例3: onDragEvent
private void onDragEvent(Event event) {
if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
return;
}
switch (DOM.eventGetType(event)) {
case Event.ONTOUCHSTART:
if (event.getTouches().length() > 1) {
return;
}
case Event.ONMOUSEDOWN:
beginMovingWindow(event);
break;
case Event.ONMOUSEUP:
case Event.ONTOUCHEND:
case Event.ONTOUCHCANCEL:
case Event.ONLOSECAPTURE:
stopMovingWindow();
break;
case Event.ONMOUSEMOVE:
case Event.ONTOUCHMOVE:
moveWindow(event);
break;
default:
break;
}
}
示例4: onResizeEvent
private void onResizeEvent(Event event) {
if (resizable && WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONTOUCHSTART:
showResizingCurtain();
if (BrowserInfo.get().isIE()) {
resizeBox.getStyle().setVisibility(Style.Visibility.HIDDEN);
}
resizing = true;
startX = WidgetUtil.getTouchOrMouseClientX(event);
startY = WidgetUtil.getTouchOrMouseClientY(event);
origW = getElement().getOffsetWidth();
origH = getElement().getOffsetHeight();
DOM.setCapture(getElement());
event.preventDefault();
break;
case Event.ONMOUSEUP:
case Event.ONTOUCHEND:
setSize(event);
case Event.ONTOUCHCANCEL:
DOM.releaseCapture(getElement());
case Event.ONLOSECAPTURE:
hideResizingCurtain();
if (BrowserInfo.get().isIE()) {
resizeBox.getStyle().clearVisibility();
}
resizing = false;
break;
case Event.ONMOUSEMOVE:
case Event.ONTOUCHMOVE:
if (resizing) {
setSize(event);
event.preventDefault();
}
break;
default:
event.preventDefault();
break;
}
}
}