RFR: JDK-8265441: IGV: select block nodes by clicking on it

Tobias Holenstein tholenstein at openjdk.org
Wed Oct 26 14:06:48 UTC 2022


On Wed, 26 Oct 2022 08:08:05 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> In "Cluster nodes into blocks" mode, it is now possible to select all nodes in a block by simply double-clicking in the block. The attached images illustrate the new behavior, after double-clicking on block B10. Similarly, the current node selection can be extended with all nodes of a block when holding the Ctrl/Cmd-key and double-clicking on a block.
>> 
>> ![select_block](https://user-images.githubusercontent.com/71546117/197827820-4edf3333-f0e8-4e77-849e-b8e09eaf67ef.png)
>> 
>> 
>> # Overview selection
>> new selection modes in **bold**. We refer to B4/B10 as _blocks_, and 86, 87, 88, ... as _nodes_
>> 
>> ## no key pressed
>> + `click on single node` : select single node, unselect all other nodes
>> + `click on edge` : select src/dest nodes, unselect all other nodes
>> + **`double-click on block` : select all nodes in block, unselect all other nodes**
>> + **`double-click outside of node/block` : unselect all nodes**
>> ## holding down Ctrl/Cmd
>> + `click on single node` : add node to current selection
>> + `click on edge` : invert the selection of src/dest nodes
>> + **`double-click on block` : add all nodes in block to current selection**
>> + `draw selection rectangle` : **invert** the selection of all nodes in rectangle
>>     - select unselected nodes, **unselect selected nodes**
>>     
>>     
>> # Implementation
>> The main functionality was implemented by extending `BlockWidget` with `DoubleClickHandler` and adding methods `handleDoubleClick` / `addToSelection`. We also needed to replace `setSelectedNodes` with `clearSelectedNodes` and `addSelectedNodes` in `InputGraphProvider` and the corresponding methods in `EditorTopComponent`. All code that used `setSelectedNodes` needed to be adjusted accordingly. 
>> 
>> In order for the `DoubleClickHandler` in `BlockWidget` to work, we needed to extend `selectAction` in `DiagramScene` to _invert_ the selection of the nodes in the rectangle (the `symmetricDiff` set).
>
> Okay, makes sense to me. Thanks for the explanation.

Thank you @TobiHartmann and @robcasloz for the reviews!

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

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


More information about the hotspot-compiler-dev mailing list