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

Introduce new method areListenersPaused() to interface SelectionModel #324

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

stefanhahmann
Copy link
Collaborator

This PR introduces a new method areListenersPaused() to the interface SelectionModel

  • The method areListenersPaused() is used in BranchGraphSelectionAdapter to find out, if listeners have been paused outside of this method and only in case they are not perform
    • pause listeners
    • select the branch vertex
    • resume listeners
  • In case they are already paused, then they are neither paused again nor are they resumed after selecting the branch vertex
  • Without this change a selection of many branch spots at the same time caused that resumeListeners() was called with high frequency resulting in low performance, when selecting many branch spots at the same time

Resolves #322

* Use areListenersPaused() in BranchGraphSelectionAdapter to find out, if listeners have been paused outside of this method and only in case they are not: pause listeners, select the branch vertex and resume listeners
* Without this change a selection of many branch spots at the same time caused that resumeListeners() was called with high frequency resulting in low performance, when selecting many branch spots at the same time
Copy link
Contributor

@tinevez tinevez left a comment

Choose a reason for hiding this comment

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

Great finding and solution.
Would you care to add some javadocs to the 3 listener methods in the SelectionListener interface?

…tenersPaused() in the interface SelectionModel
@stefanhahmann
Copy link
Collaborator Author

Great finding and solution. Would you care to add some javadocs to the 3 listener methods in the SelectionListener interface?

Good idea. I tried my best to describe these 3 methods. Hopefully their function will be clearer with this in the future.

@stefanhahmann stefanhahmann merged commit f198ff5 into dev Sep 24, 2024
1 check passed
@tinevez tinevez deleted the seletion-on-branchspots-is-slow branch September 24, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants