/** * Removes the wrapped listener. * * @param eventSource the event source from which to remove the wrapped * listener * @param listener the listener to remove * @deprecated will be removed in GWT 2.0 along with the listener classes */ @Deprecated public static void remove(Widget eventSource, MouseWheelListener listener) { baseRemove(eventSource, listener, MouseWheelEvent.getType()); }
/** * Convenience method that returns <code>true</code> if {@link #getDeltaY()} * is a negative value (ie, the velocity is directed toward the top of the * screen). * * @return true if the velocity is directed toward the top of the screen */ public boolean isNorth() { return getDeltaY() < 0; }
/** * Get the change in the mouse wheel position along the Y-axis; negative if * the mouse wheel is moving north (toward the top of the screen) or positive * if the mouse wheel is moving south (toward the bottom of the screen). * * Note that delta values are not normalized across browsers or OSes. * * @return the delta of the mouse wheel along the y axis */ public int getDeltaY() { return getNativeEvent().getMouseWheelVelocityY(); }
@Override public void onMouseWheel(MouseWheelEvent event) { final boolean isNorth; if (event.getDeltaY() == 0) { isNorth = (getWheelDelta(event.getNativeEvent()) < 0); } else { isNorth = event.isNorth(); } Coordinate location = getLocation(event, RenderSpace.WORLD); scrollZoomTo(isNorth, location); }
@Override public void onMouseWheel(final MouseWheelEvent event) { final NodeMouseWheelEvent nevent = new NodeMouseWheelEvent(event); if (m_mediators.handleEvent(nevent)) { event.preventDefault(); event.stopPropagation(); } else { fireEvent(nevent); } } });
@Override public void onMouseWheel( MouseWheelEvent event ) { if( m_callback == null ) return; event.preventDefault(); int x = event.getRelativeX( m_canvas.getElement() ); int delta = event.getDeltaY(); if( delta > 0 ) delta = 1; else if( delta < 0 ) delta = -1; m_callback.onMouseWheel( m_cookie, event, x, delta ); }
int dsy = event.getDeltaY(); Mouse.deltaScrollX = 0; event.preventDefault(); });
@Override public void onMouseWheel(MouseWheelEvent event) { int wheelDeltaX = 0; int wheelDeltaY = 0; if (isScrollingEnabledX()) { wheelDeltaX = getMouseWheelVelocityX(event.getNativeEvent()) / 10; } if (isScrollingEnabledY()) { wheelDeltaY = getMouseWheelVelocityY(event.getNativeEvent()) / 10; } wheel(wheelDeltaX, wheelDeltaY, event.getClientX(), event.getClientY()); } }, MouseWheelEvent.getType());
public void onMouseWheel(MouseWheelEvent event) { event.preventDefault(); } });
new Point(mouseWheelEvent.getX() - getViewportBounds().getLeft(), mouseWheelEvent.getY() - getViewportBounds().getTop()); if (mouseWheelEvent.isNorth()) { newImageBounds = getViewportDataAreaBounds().transformProportional( new Point((mouseWheelEvent.getX() - getViewportBounds().getLeft()) / getViewportBounds().getWidth(), (mouseWheelEvent.getY() - getViewportBounds().getTop()) / getViewportBounds().getHeight());
if (mouseWheelEvent.isNorth()) { setBounds = this.currentSetDomainBoundsEvent.getBounds().transformProportional(
@Override public void onMouseWheel(MouseWheelEvent event) { final boolean isNorth; if (event.getDeltaY() == 0) { isNorth = (getWheelDelta(event.getNativeEvent()) < 0); } else { isNorth = event.isNorth(); } Coordinate location = getLocation(event, RenderSpace.WORLD); scrollZoomTo(isNorth, location); }
@Override public void onMouseWheel(final MouseWheelEvent event) { final NodeMouseWheelEvent nevent = new NodeMouseWheelEvent(event); if (m_mediators.handleEvent(nevent)) { event.preventDefault(); event.stopPropagation(); } else { fireEvent(nevent); } } });
@Override public void onMouseWheel( MouseWheelEvent event ) { if( m_callback == null ) return; event.preventDefault(); int x = event.getRelativeX( m_canvas.getElement() ); int delta = event.getDeltaY(); if( delta > 0 ) delta = 1; else if( delta < 0 ) delta = -1; m_callback.onMouseWheel( m_cookie, event, x, delta ); }
@Override public void onMouseWheel(MouseWheelEvent event) { int wheelDeltaX = 0; int wheelDeltaY = 0; if (isScrollingEnabledX()) { wheelDeltaX = getMouseWheelVelocityX(event.getNativeEvent()) / 10; } if (isScrollingEnabledY()) { wheelDeltaY = getMouseWheelVelocityY(event.getNativeEvent()) / 10; } wheel(wheelDeltaX, wheelDeltaY, event.getClientX(), event.getClientY()); } }, MouseWheelEvent.getType());
public void onMouseWheel(MouseWheelEvent event) { event.preventDefault(); } });
@Override public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) { return addDomHandler(handler, MouseWheelEvent.getType()); }
@Override public void onMouseWheel(MouseWheelEvent event) { final boolean isNorth; if (event.getDeltaY() == 0) { isNorth = (getWheelDelta(event.getNativeEvent()) < 0); } else { isNorth = event.isNorth(); } final Coordinate location = getLocation(event, RenderSpace.WORLD); if (intervalTimer != null) { intervalTimer.cancel(); } intervalTimer = new Timer() { @Override public void run() { scrollZoomTo(isNorth, location); } }; intervalTimer.schedule(intervalMillis); }
/** * Convenience method that returns <code>true</code> if {@link #getDeltaY()} * is a positive value (ie, the velocity is directed toward the bottom of the * screen). * * @return true if the velocity is directed toward the bottom of the screen */ public boolean isSouth() { return getDeltaY() > 0; }
public void onMouseWheel(MouseWheelEvent event) { getListener().onMouseWheel(getSource(event), new MouseWheelVelocity(Event.as(event.getNativeEvent()))); } }