本文整理汇总了Java中com.google.gwt.user.client.Event.ONMOUSEWHEEL属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ONMOUSEWHEEL属性的具体用法?Java Event.ONMOUSEWHEEL怎么用?Java Event.ONMOUSEWHEEL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONMOUSEWHEEL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asString
public static String asString(Event event) {
// Start with the event type string
String string = DOM.eventGetTypeString(event);
// Next type-specific fields
switch (event.getTypeInt()) {
case Event.ONKEYPRESS:
case Event.ONKEYUP:
case Event.ONKEYDOWN:
string += key(event) + modifiers(event);
break;
case Event.ONCLICK:
case Event.ONDBLCLICK:
case Event.ONMOUSEMOVE:
string += mousePoint(event) + modifiers(event);
break;
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
string += mousePoint(event) + mouseButtons(event) + modifiers(event);
break;
case Event.ONMOUSEOUT:
string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event);
break;
case Event.ONMOUSEOVER:
string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event);
break;
case Event.ONMOUSEWHEEL:
string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event);
break;
case Event.ONFOCUS:
case Event.ONBLUR:
case Event.ONCHANGE:
case Event.ONERROR:
case Event.ONLOAD:
case Event.ONLOSECAPTURE:
case Event.ONSCROLL:
break;
}
return string;
}
示例2: onPreviewNativeEvent
@Override
public void onPreviewNativeEvent(NativePreviewEvent previewEvent) {
if (autoHiders.isEmpty()) {
return;
}
// TODO(danilatos,user,user): Push signal down a layer - clean this up.
Event event = Event.as(previewEvent.getNativeEvent());
int lowLevelType = event.getTypeInt();
// TODO(danilatos): Insert this logic deeply rather than
// sprinkling it in event handlers. Also the return value
// of onEventPreview is the reverse of signal handlers.
SignalEvent signal = SignalEventImpl.create(event, false);
if (signal == null) {
return;
}
// Key events (excluding escape) and mousewheel events use hideTopmostAutoHiderForKeyEvent
if (lowLevelType == Event.ONMOUSEWHEEL || signal.isKeyEvent()) {
if (hideTopmostAutoHiderForKeyEvent(false)) {
// TODO(user): We don't call previewEvent.cancel() here, since for the floating-buttons
// menu we want, for example, space-bar to still shift focus to the next blip.
// The to-do is to audit the previewEvent.cancel call below and see why it's there (and if
// it's not needed, eliminate it).
return;
}
}
// Pressing escape at any time causes us to close and discard the event.
if (signal.getKeySignalType() == KeySignalType.NOEFFECT &&
event.getKeyCode() == KeyCodes.KEY_ESCAPE) {
if (hideTopmostAutoHiderForKeyEvent(true)) {
previewEvent.cancel();
return;
}
}
// Click events and mouse-wheel events that fall through use hideAllAfter.
if (lowLevelType == Event.ONMOUSEDOWN || lowLevelType == Event.ONMOUSEWHEEL) {
hideAllAfter(signal.getTarget());
}
// Otherwise we don't do anything and the event continues as usual.
}