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

8263385: IGV: Graph is not opened in the window that has focus. #4078

Closed
wants to merge 1 commit into from

Conversation

@jyukutyo
Copy link
Contributor

@jyukutyo jyukutyo commented May 18, 2021

This pull request enables IGV opens a graph in the window that is focused.

At the moment IGV opens a graph in the window that has the graph and is found first. So in this pull request I used preferentially the active EditorTopComponent.

I tested the following scenarios manually:

  1. Open a graph, open clone, then open another graph (as described in the bug report). It replaces the clone graph with the last opened graph.
  2. Open a graph, open clone, swap tabs by dragging the clone graph, then open another graph. It replaces the clone graph with the last opened graph.
  3. Open a graph, open clone, change the focus from the clone graph to the first graph, then open another graph. It replaces the first graph with the last opened graph.
  4. Open a graph, open clone, open the same graph xml file from the toolbar, open a graph in the second folder, then open a graph in the first folder. It replaces the leftmost graph that was opened the first with the last opened graph.

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8263385: IGV: Graph is not opened in the window that has focus.

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4078/head:pull/4078
$ git checkout pull/4078

Update a local copy of the PR:
$ git checkout pull/4078
$ git pull https://git.openjdk.java.net/jdk pull/4078/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4078

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4078.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 18, 2021

👋 Welcome back ksakata! 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 openjdk bot commented May 18, 2021

@jyukutyo The following labels will be automatically applied to this pull request:

  • build
  • hotspot-compiler

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

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented May 18, 2021

/label remove build

@openjdk openjdk bot removed the build label May 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 18, 2021

@jyukutyo
The build label was successfully removed.

@jyukutyo jyukutyo marked this pull request as ready for review May 18, 2021
@openjdk openjdk bot added the rfr label May 18, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 18, 2021

Webrevs

@reinrich
Copy link
Contributor

@reinrich reinrich commented May 18, 2021

Hello Koichi,

thanks for taking care of this issue.

I've built and tested this pull request and found that it works in most cases.

Here's what did not work:

  1. Open Graph -> new Tab T1 is created
  2. Open Clone -> new Tab T2 is created
  3. Use the mouse to drag T2 down in the lower part of the window until the red frame indicates that the window will be split horizontally -> The window will be split horizontally. T2 is the lower window and has focus.
  4. Open another Graph in the outline
  5. IGV shows that graph in T1 even though T2 had focus. This is unexpected.

Despite that I think your change is good.

Unfortunately I can only test but not review the change itself as I am not familiar with IGV source code.

Thanks, Richard.

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented May 18, 2021

Thank you for confirming, Richard. I appreciate it.
I'll start to fix that behavior.

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented May 28, 2021

@reinrich That doesn’t seem doable. I've analyzed the code.
When splitting graph windows, each window has its own mode, model and sub model that are classes in OpenIDE and NetBeans. So when splitting horizontally, there are two mode objects. It needs to get the last active editor mode to show a selected graph.
The org.netbeans.core.windows.model.ModesSubModel class has the property named lastActiveEditorMode. This is the mode object that is last active mode and is an editor mode. But lastActiveEditorMode can be accessed only from those NetBeans internal classes such as org.netbeans.core.windows.Central or org.netbeans.core.windows.model.Model. Therefore, it doesn't seem to be able to get last active editor mode from the classes of IGV and show a graph in the window of the mode, I think.

Since this pull request can't satisfy the needs, I intend to close this PR.

https://github.com/apache/netbeans/blob/39496d3400eada7398a8428f05c90589aa1f3b74/platform/core.windows/src/org/netbeans/core/windows/model/ModesSubModel.java#L303

@reinrich
Copy link
Contributor

@reinrich reinrich commented Jun 8, 2021

@jyukutyo IMHO your change is still a worthwhile. Pity I'm not at all familiar with netbeans and IGV code. Otherwise I'd mark the PR as reviewed.

Copy link
Contributor

@reinrich reinrich left a comment

I've tested the fix. It works as expected except for a negligible detail of the bug (see PR comment from May 18).

So this looks good to me.

Thanks, Richard.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 2, 2021

@jyukutyo 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:

8263385: IGV: Graph is not opened in the window that has focus.

Reviewed-by: rrich, 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 805 new commits pushed to the master branch:

  • dfd6b2b: Merge
  • 6401633: 8269722: NPE in HtmlDocletWriter
  • 9acb2a6: 8270109: ProblemList 4 SA tests on macOS-aarch64
  • f46a917: 6766844: ByteArrayInputStream#read with a byte array of length 0 not consistent with InputStream when at EOF
  • 9e75f92: 8269738: AssertionError when combining pattern matching and function closure
  • 168af2e: 8269828: corrections in some instruction patterns for KNL x86 platform
  • fa08cc6: 8268766: Desugaring of pattern matching enum switch should be improved
  • 4f70759: 8270006: Switches with 'case null:' should be exhaustive
  • 8f798b8: 8269746: C2: assert(!in->is_CFG()) failed: CFG Node with no controlling input?
  • 5832882: 8269827: JMH tests for AES/GCM byte[] and bytebuffers
  • ... and 795 more: https://git.openjdk.java.net/jdk/compare/f4227879b0504bc4656bd84153b13b04c007aa66...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@reinrich, @chhagedorn) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Jul 2, 2021
@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented Jul 8, 2021

Thank you for the review, Richard. I’m sorry for the delayed response.

I'd like to hear the thoughts of other people about this PR and the remaining issue. If they agree with this PR, I will definitely move it forward.

Copy link
Member

@chhagedorn chhagedorn left a comment

I was not even aware of the clone feature - it's nice!

Fix looks good and a manual test worked. I could not reproduce the wrong behavior as mentioned by @reinrich. Nevertheless, even when this is not fixed/not fixable, I think it's still worth to move forward with this PR given that it's a simple fix.

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented Jul 9, 2021

Thank you for reviewing the whole of this PR, Christian. Your comment indeed encouraged me.
I'll submit a request for merging.

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented Jul 9, 2021

/integrate

@openjdk openjdk bot added the sponsor label Jul 9, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 9, 2021

@jyukutyo
Your change (at version 7a7c203) is now ready to be sponsored by a Committer.

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented Jul 19, 2021

Could someone possibly sponsor this pull request?

Thanks,
Koichi

@kelthuzadx
Copy link
Member

@kelthuzadx kelthuzadx commented Jul 19, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Jul 19, 2021

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

  • e7cdfeb: 8270862: Fix problem list entries for 32-bit
  • f8ec3b6: 8270801: Print VM arguments with java -Xlog:arguments
  • a5c9094: Merge
  • 2dddcce: 8270858: Problem List java/awt/Window/MultiWindowApp/MultiWindowAppTest.java on Linux
  • 1350e2b: 8270556: Exclude security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA
  • 58f1ada: 8269636: Change outputStream's print_raw() and print_raw_cr() second parameter to size_t type
  • 67dc1c5: 8270837: fix typos in test TestSigParse.java
  • 1d8d72d: 8270540: G1: Refactor range checking in G1BlockOffsetTablePart::block_start* to asserts
  • 90c219f: 8270547: java.util.Random contains unnecessary @SuppressWarnings("exports")
  • 4927ee4: 8270814: ProblemList the failing serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor* tests
  • ... and 894 more: https://git.openjdk.java.net/jdk/compare/f4227879b0504bc4656bd84153b13b04c007aa66...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Jul 19, 2021
@openjdk openjdk bot added integrated and removed ready labels Jul 19, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 19, 2021

@kelthuzadx @jyukutyo Pushed as commit edff556.

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

@jyukutyo
Copy link
Contributor Author

@jyukutyo jyukutyo commented Jul 19, 2021

Thank you for sponsoring it, Yi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants