RFR: 8263384: IGV: Outline should highlight the Graph that has focus

Xin Liu xliu at openjdk.java.net
Thu Jun 16 06:46:02 UTC 2022


On Wed, 15 Jun 2022 12:47:54 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> This changeset eases navigation within and across graph groups by highlighting the focused graph in the Outline window. If the user changes the focus to another graph window, or moves to the previous or next graph within the same window, the newly focused graph is automatically highlighted in the Outline window. This is implemented by maintaining a static map from opened graphs to their corresponding [NetBeans nodes](https://netbeans.apache.org/tutorials/nbm-selection-2.html). The Outline window uses the map to select, on a graph focus change, the NetBeans node of the newly focused graph that should be highlighted.
> 
> Tested manually by opening simultaneously tens of graphs from different groups and switching the focus randomly.

src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java line 221:

> 219:     public void resultChanged(LookupEvent lookupEvent) {
> 220:         // Highlight the focused graph, if available, in the outline.
> 221:         if (result.allItems().isEmpty()) {

It looks like you are confident that result is not NULL when resultChanged() is called.  I believe framework calls it after `componentOpened()`.  if so, is it possible to remove result = null in `componentClosed()`?

src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java line 221:

> 219:     public void resultChanged(LookupEvent lookupEvent) {
> 220:         // Highlight the focused graph, if available, in the outline.
> 221:         if (result.allItems().isEmpty()) {

It looks like you are confident that result is not NULL when resultChanged() is called.  I believe framework calls it after `componentOpened()`.  if so, is it possible to remove result = null in `componentClosed()`?

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

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


More information about the hotspot-compiler-dev mailing list