Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK-8290063: IGV: Give the graphs a unique number in the outline #10873

Closed
wants to merge 11 commits into from

Conversation

tobiasholenstein
Copy link
Contributor

@tobiasholenstein tobiasholenstein commented Oct 26, 2022

Some graphs may have the same name more than once in IGV. To make it clearer which graph is currently open, all graphs within a group are now enumerated with 1., 2., 3. , etc. Similarly, groups are enumerated with 1 -, 2 -, etc.

overview

The make it even further easier to distinguish different graphs and group, we can now rename them in two ways.
(A) To rename a group or graph:

  1. click on a graph or group once to select it (does not have to be opened).
  2. click a second time on the selected graph and wait 1-2 seconds.
  3. now you can rename the graph
  4. on Linux F2 works as a shortcut for renaming

rename_group

rename_graph

(B) To rename a group or graph:

  1. right-click on a graph or group once to select it (does not have to be opened).
  2. select "Rename.."
  3. now a window opens to rename the graph
  4. The shortcut for this RenameAction is ALT-CTRL-R or OPT-CMD-R on a mac keyboard

RenameAction

Rename

The numbering always starts at 1 and is continuous from 1 to N for N graphs. When a graph is deleted, the numbering of the following graphs changes. This implementation allows the keep the XML format unchanged, because the numbering is only local and not part of the name. However, if a graph/group is renamed, the name in the XML file will also change when it is saved.

Implementation

The renaming is simply enabled by overriding canRename() {return true;} in FolderNode and GraphNode

The numbering is implemented in getDisplayName() in Group and InputGraph by concatenating the index of the group/graph with the name.

When a group/graph is deleted the we trigger an update of the index in FolderNode -> destroyNodes(Node[] nodes) by calling node.setDisplayName(node.getDisplayName()) for all nodes.

Refresh the group/graph name in the EditorTopComponent of the opened graph is a bit tricky. It is implemented by adding a Listener to the getDisplayNameChangedEvent() of the currently opened InputGraph in DiagramViewModel. getDisplayNameChangedEvent() is fired whenever the name or the group name of the corresponding InputGraph is changed.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8290063: IGV: Give the graphs a unique number in the outline

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10873/head:pull/10873
$ git checkout pull/10873

Update a local copy of the PR:
$ git checkout pull/10873
$ git pull https://git.openjdk.org/jdk pull/10873/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10873

View PR using the GUI difftool:
$ git pr show -t 10873

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10873.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 26, 2022

👋 Welcome back tholenstein! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 26, 2022

@tobiasholenstein The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Oct 26, 2022
@tobiasholenstein tobiasholenstein force-pushed the JDK-8290063 branch 2 times, most recently from 9ff6e47 to 4d1d3b1 Compare October 27, 2022 11:09
@openjdk
Copy link

openjdk bot commented Oct 27, 2022

⚠️ @tobiasholenstein This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@tobiasholenstein tobiasholenstein marked this pull request as ready for review October 28, 2022 13:19
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 28, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 28, 2022

Webrevs

@TobiHartmann
Copy link
Member

It works well for me but I'm wondering if "click and wait for 1-2 seconds" (which is more like 3 seconds on my system) should be replaced by an entry in the right-click menu. For fast renaming, a shortcut (F2) can be used, which already works.

I spotted the following (existing) issue:

  • Open Phase 5
  • Delete Phase 2
  • The graph changes. Phase 6 is now displayed while the selection still shows Phase 5.

I don't think deleting a non-opened phase should affect the currently opened one, right?

@openjdk-notifier
Copy link

@tobiasholenstein Please do not rebase or force-push to an active PR as it invalidates existing review comments. All changes will be squashed into a single commit automatically when integrating. See OpenJDK Developers’ Guide for more information.

@tobiasholenstein
Copy link
Contributor Author

It works well for me but I'm wondering if "click and wait for 1-2 seconds" (which is more like 3 seconds on my system) should be replaced by an entry in the right-click menu. For fast renaming, a shortcut (F2) can be used, which already works.

I spotted the following (existing) issue:

  • Open Phase 5
  • Delete Phase 2
  • The graph changes. Phase 6 is now displayed while the selection still shows Phase 5.

I don't think deleting a non-opened phase should affect the currently opened one, right?

Thanks for testing @TobiHartmann !

I agree that a right-click menu is more convenient. I added this functionality and updated the PR.

The issue with the deleting is known and it already exists an bug report: https://bugs.openjdk.org/browse/JDK-8294066

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating. Looks good to me!

@openjdk
Copy link

openjdk bot commented Nov 2, 2022

@tobiasholenstein This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8290063: IGV: Give the graphs a unique number in the outline

Reviewed-by: thartmann, chagedorn

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 58 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 2, 2022
Copy link
Member

@chhagedorn chhagedorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement! Works as expected - looks good to me.

@tobiasholenstein
Copy link
Contributor Author

tobiasholenstein commented Nov 2, 2022

Thanks @chhagedorn and @TobiHartmann for the reviews!

@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 2, 2022
@openjdk
Copy link

openjdk bot commented Nov 2, 2022

@tobiasholenstein Your integration request cannot be fulfilled at this time, as the status check jcheck did not complete successfully

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 2, 2022
@tobiasholenstein
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 2, 2022

Going to push as commit a1c349f.
Since your change was applied there have been 58 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 2, 2022
@openjdk openjdk bot closed this Nov 2, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Nov 2, 2022
@openjdk
Copy link

openjdk bot commented Nov 2, 2022

@tobiasholenstein Pushed as commit a1c349f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
3 participants