Java Code Examples for com.google.gwt.user.client.Event#ONMOUSEWHEEL
The following examples show how to use
com.google.gwt.user.client.Event#ONMOUSEWHEEL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EventWrapper.java From swellrt with Apache License 2.0 | 5 votes |
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; }
Example 2
Source File: InputSlider.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); if (!this.isStateValid()) { return; } switch (DOM.eventGetType(event)) { case Event.ONMOUSEDOWN: case Event.ONTOUCHSTART: this.handleWidget.setFocus(true); this.dragHandler.onMouseDown(event); break; case Event.ONMOUSEUP: case Event.ONTOUCHEND: this.dragHandler.onMouseUp(event); break; case Event.ONMOUSEMOVE: case Event.ONTOUCHMOVE: this.dragHandler.onMouseMove(event); break; case Event.ONMOUSEWHEEL: if (this.handleWidget.focused) { this.dragHandler.onMouseWheel(event); } break; default: break; } }
Example 3
Source File: EventWrapper.java From incubator-retired-wave with Apache License 2.0 | 5 votes |
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; }
Example 4
Source File: EventPreviewAutoHiderRegistrar.java From swellrt with Apache License 2.0 | 4 votes |
@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. }
Example 5
Source File: EventPreviewAutoHiderRegistrar.java From incubator-retired-wave with Apache License 2.0 | 4 votes |
@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. }