RFR: JDK-8265441: IGV: select block nodes by clicking on it
Tobias Hartmann
thartmann at openjdk.org
Wed Oct 26 08:10:20 UTC 2022
On Tue, 25 Oct 2022 13:59:50 GMT, Tobias Holenstein <tholenstein 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.
>
> 
>
>
> # 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.
-------------
Marked as reviewed by thartmann (Reviewer).
PR: https://git.openjdk.org/jdk/pull/10854
More information about the hotspot-compiler-dev
mailing list