本文整理匯總了Java中com.google.gwt.user.client.Event.ONTOUCHSTART屬性的典型用法代碼示例。如果您正苦於以下問題:Java Event.ONTOUCHSTART屬性的具體用法?Java Event.ONTOUCHSTART怎麽用?Java Event.ONTOUCHSTART使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONTOUCHSTART屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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;
}
}
示例3: 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;
}
}
}