RFR: JDK-8290016: IGV: Fix graph panning when mouse dragged outside of window [v2]

Tobias Holenstein tholenstein at openjdk.org
Wed Jul 20 15:33:05 UTC 2022


On Mon, 18 Jul 2022 11:09:59 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixed locking in CustomizablePanAction
>
> src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/actions/CustomizablePanAction.java line 149:
> 
>> 147:             scrollPane = null;
>> 148:         }
>> 149:         return state ? State.REJECTED : State.REJECTED;
> 
> That does not look correct.

Thanks for catching that! You are right, this is not correct. 

I updated the PR to make the locking more clear:

`CustomizablePanAction` extends `WidgetAction.LockedAdapter` which is used for long-term actions like panning/moving. All methods return the `locked` state if `isLocked()` is true and `rejected` otherwise. 
The `locked` state means the event is processed and the processing has to stopped immediately (no other action should processed it). 
The `rejected` state the event is not processed by the action and has to be processed by other actions too.

In our case `CustomizablePanAction` should be `locked` when the user presses the mouse inside of the panning area (the graph). And `CustomizablePanAction` should be `unlocked` when the mouse button is released again. Leaving the panning area (`mouseExited`) and entering it again (`mouseEntered`) should not change the locking state as long as the user does not release the mouse.

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

PR: https://git.openjdk.org/jdk/pull/9470


More information about the hotspot-compiler-dev mailing list