RFR: JDK-8328190 : Convert AWTPanelSmoothWheel.html applet test to main [v4]

Harshitha Onkar honkar at openjdk.org
Thu Mar 21 01:20:28 UTC 2024


On Wed, 20 Mar 2024 16:57:24 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> @aivanov-jdk Semi-automated the test, it now passes when 5 or more  MouseWheelEvent of type: scrollType=WHEEL_UNIT_SCROLL & wheelRotation != 0 is recorded. Updated the instructions accordingly.
>
> I think we should update the instructions.
> 
> A high resolution mouse produces events like this:
> 
> java.awt.event.MouseWheelEvent[MOUSE_WHEEL,(164,90),absolute(1135,365),button=0,clickCount=0,scrollType=WHEEL_UNIT_SCROLL,scrollAmount=3,wheelRotation=0,preciseWheelRotation=0.25] on panel0
> java.awt.event.MouseWheelEvent[MOUSE_WHEEL,(164,90),absolute(1135,365),button=0,clickCount=0,scrollType=WHEEL_UNIT_SCROLL,scrollAmount=3,wheelRotation=0,preciseWheelRotation=0.25] on panel0
> java.awt.event.MouseWheelEvent[MOUSE_WHEEL,(164,90),absolute(1135,365),button=0,clickCount=0,scrollType=WHEEL_UNIT_SCROLL,scrollAmount=3,wheelRotation=0,preciseWheelRotation=0.25] on panel0
> java.awt.event.MouseWheelEvent[MOUSE_WHEEL,(133,46),absolute(1104,321),button=0,clickCount=0,scrollType=WHEEL_UNIT_SCROLL,scrollAmount=3,wheelRotation=1,preciseWheelRotation=1.0] on panel0
> 
> 
> Thus, `wheelRotation=0` while `preciseWheelRotation=0.25`. When it reaches, `preciseWheelRotation=1.0`, the event contains **`wheelRotation=1`**.
> 
> A regular mouse with mouse-wheel notches produces the following events:
> 
> java.awt.event.MouseWheelEvent[MOUSE_WHEEL,(90,115),absolute(1061,390),button=0,clickCount=0,scrollType=WHEEL_UNIT_SCROLL,scrollAmount=3,wheelRotation=1,preciseWheelRotation=1.0] on panel0
> java.awt.event.MouseWheelEvent[MOUSE_WHEEL,(176,76),absolute(1147,351),button=0,clickCount=0,scrollType=WHEEL_UNIT_SCROLL,scrollAmount=3,wheelRotation=1,preciseWheelRotation=1.0] on panel0
> 
> 
> As you can see, `scrollType=WHEEL_UNIT_SCROLL` is the same in both cases. The only difference is that high-resolution mouse produces events where **`preciseWheelRotation < 1.0`**.
> 
> This means that you should also track the value of `preciseWheelRotation`. Otherwise, the test will pass when a regular mouse is used.
> 
> You may show a warning to the user if you detect, let's say, 5 events with `wheelRotation=1` but none of the events had `wheelRotation=0` and `preciseWheelRotation < 1.0`.

@aivanov-jdk Since preciseWheelRotation amount depends on user's movement of the high-res mouse and there might be a need to look through logs for few events, it is better to convert this test from semi-automated to manual. Does this sound good? 
Updated the PR with the latest changes.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18312#discussion_r1533120961


More information about the client-libs-dev mailing list