@@ -27,16 +27,7 @@ public class MouseWheelEvent extends MouseEvent<MouseWheelHandler> {
2727 * this event.
2828 */
2929 private static final Type <MouseWheelHandler > TYPE = new Type <MouseWheelHandler >(
30- BrowserEvents .MOUSEWHEEL , new MouseWheelEvent ());
31-
32- static {
33- /**
34- * Hidden type used to ensure DOMMouseScroll gets registered in the type map.
35- * This is the special name used on Mozilla browsers for what everyone else
36- * calls 'mousewheel'.
37- */
38- new Type <MouseWheelHandler >("DOMMouseScroll" , new MouseWheelEvent ());
39- }
30+ BrowserEvents .WHEEL , new MouseWheelEvent ());
4031
4132 /**
4233 * Gets the event type associated with mouse wheel events.
@@ -61,18 +52,30 @@ public final Type<MouseWheelHandler> getAssociatedType() {
6152 }
6253
6354 /**
64- * Get the change in the mouse wheel position along the Y-axis; negative if
65- * the mouse wheel is moving north (toward the top of the screen) or positive
55+ * Get the sign of the change in the mouse wheel position along the Y-axis; -1 if
56+ * the mouse wheel is moving north (toward the top of the screen) or 1
6657 * if the mouse wheel is moving south (toward the bottom of the screen).
6758 *
68- * Note that delta values are not normalized across browsers or OSes.
69- *
70- * @return the delta of the mouse wheel along the y axis
59+ * @return the sign of the delta of the mouse wheel along the y axis
60+ * @deprecated use getNativeDeltaY() instead
7161 */
62+ @ Deprecated
7263 public int getDeltaY () {
7364 return getNativeEvent ().getMouseWheelVelocityY ();
7465 }
7566
67+ /**
68+ * Get the change in the mouse wheel position along the Y-axis; -1 if
69+ * the mouse wheel is moving north (toward the top of the screen) or 1
70+ * if the mouse wheel is moving south (toward the bottom of the screen).
71+ * Note that the return values are not normalized for browsers and OSs.
72+ *
73+ * @return the sign of the delta of the mouse wheel along the y axis
74+ */
75+ public double getNativeDeltaY () {
76+ return getNativeEvent ().getDeltaY ();
77+ }
78+
7679 /**
7780 * Convenience method that returns <code>true</code> if {@link #getDeltaY()}
7881 * is a negative value (ie, the velocity is directed toward the top of the
@@ -81,7 +84,7 @@ public int getDeltaY() {
8184 * @return true if the velocity is directed toward the top of the screen
8285 */
8386 public boolean isNorth () {
84- return getDeltaY () < 0 ;
87+ return getNativeDeltaY () < 0 ;
8588 }
8689
8790 /**
@@ -92,7 +95,7 @@ public boolean isNorth() {
9295 * @return true if the velocity is directed toward the bottom of the screen
9396 */
9497 public boolean isSouth () {
95- return getDeltaY () > 0 ;
98+ return getNativeDeltaY () > 0 ;
9699 }
97100
98101 @ Override
0 commit comments