Java Code Examples for com.google.gwt.user.client.Event#getMouseWheelVelocityY()

The following examples show how to use com.google.gwt.user.client.Event#getMouseWheelVelocityY() . 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 vote down vote up
/**
 * In safari, there is X velocity and Y velocity.  GWT code return the combination of the 2.
 * This code only return the Y velocity.
 * @return The y velocity of the mouse event and only the y velocity.
 */
public static int getMouseWheelVelocityYOnly(Event event) {
  if (!UserAgent.isSafari()) {
    return event.getMouseWheelVelocityY();
  } else {
    return nativeGetMouseWheelVelocityYOnly(event);
  }
}
 
Example 2
Source File: InputSlider.java    From putnami-web-toolkit with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void onMouseWheel(Event event) {
	this.killEvent(event);
	int velocityY = event.getMouseWheelVelocityY();
	if (velocityY > 0) {
		InputSlider.this.handleWidget.moveRight(1);
	} else {
		InputSlider.this.handleWidget.moveLeft(1);
	}
}
 
Example 3
Source File: EventWrapper.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
/**
 * In safari, there is X velocity and Y velocity.  GWT code return the combination of the 2.
 * This code only return the Y velocity.
 * @return The y velocity of the mouse event and only the y velocity.
 */
public static int getMouseWheelVelocityYOnly(Event event) {
  if (!UserAgent.isSafari()) {
    return event.getMouseWheelVelocityY();
  } else {
    return nativeGetMouseWheelVelocityYOnly(event);
  }
}