/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
private int computeDelta(MouseWheelEvent mouseWheelEvent) { /* * If the user scrolls fast, multiple mouse wheels might be summed up to * one event. GWT seems to normalize the different deltas across browser * to a multiple of 3 (3, 6, 9... tested with IE, FF, Chrome). * * Here we normalize to 1, 2, 3... */ return Math.abs(mouseWheelEvent.getDeltaY() / 3); // integer division }
public double getNormalizedDeltaY() { return getOriginalEvent().getDeltaY(); }
public double getNormalizedDeltaY() { return getOriginalEvent().getDeltaY(); }
public double getNormalizedDeltaY() { return getOriginalEvent().getDeltaY(); }
public double getNormalizedDeltaY() { return getOriginalEvent().getDeltaY(); }
public double getNormalizedDeltaY() { return getOriginalEvent().getDeltaY(); }
@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 ) { 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) { 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(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(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); }
int dsy = event.getDeltaY();