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

Event code cleanup #1427

Merged
merged 3 commits into from
Nov 15, 2023
Merged

Event code cleanup #1427

merged 3 commits into from
Nov 15, 2023

Conversation

lbergelson
Copy link
Contributor

I started to take a look at the event code a few weeks ago. I did a few things, none of them are huge changes but I think it makes them easier to use/discover and removes some boilerplate. It doesn't solve the problem of not knowing what they are meant to mean but it makes it a bit easier to discover the possible events and removes a bunch of them that were never used. Documenting what events should mean / is probably something worth looking at in the future.

* Cleanup some of the event code by taking advantage of newer java 17 features
  - make many event types records and delete some unused events / fields
  - fix some intellij complaints in event usage / IGVEventBus
* cleanup ViewChange constructors
* make all events be part of a sealed interface.  This doesn't have a real functional effect right now but it makes it easier to list / discover all the existing events that are used so there's less chance of duplicating functionality.  

Also as part of looking at this I found and fixed a bug where we were repainting AlignmentTrack twice in a row because of a missed break statement.

* Cleanup some of the event code by taking advantage of newer java 17 features
  - make most event types records and delete some unused events / fields
  - fix some intellij complaints in event usage / IGVEventBus
* fix a double repaint bug in AlignmentTrack due to a missing break
This isn't really a functional change but makes it a bit easier to find/understand what
event types are available.
repaint();
break;
}
case REFRESH -> repaint();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a silly bug here where on a RELOAD we would repaint twice since it would fall through without a break

@jrobinso jrobinso merged commit 41523e7 into master Nov 15, 2023
2 checks passed
@jrobinso jrobinso deleted the lb_cleanup_events branch November 15, 2023 19:05
jrobinso pushed a commit that referenced this pull request Dec 4, 2023
* Cleanup the IGV events

* Cleanup some of the event code by taking advantage of newer java 17 features
  - make most event types records and delete some unused events / fields
  - fix some intellij complaints in event usage / IGVEventBus
* fix a double repaint bug in AlignmentTrack due to a missing break

* Cleanup ViewChange and delete ZoomChange

* Make IGV events all implement sealed interface IGVEvent

This isn't really a functional change but makes it a bit easier to find/understand what
event types are available.
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