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

Commentpane to swing component #696

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

toomasr
Copy link
Contributor

@toomasr toomasr commented Mar 23, 2020

I was bored yesterday and I was going through issues in Lizzie and I saw that wordwrap was requested for the comment pane in issue #676

I jumped into the code and realised that all components are converted into graphics and then those are stitched together for the UI.

As a thought exercise I extracted the comment pane into a separate component, JTextArea. I also had to extract the tree but I still left that as a graphics component.

It could be a step forward to having Java components rather than just graphics.

Another big change in this pull request is I'm skipping a lot of repaints for Leelaz. I saw that the UI sluggish because painting was happening very often when the engine is providing all kind of info. As most of the info you can ignore (it does not matter if the scores change 10 times a second or 2 times) then I'm skipping repaints unless there 700ms has passed since the previous one.

I realise that this is not the best pull request as it is based on my working tree that has other fixes in
it but I'm still submitting this as the component conversion can be taken separately if there is interest.

The same goes for the UI changes.

toomasr and others added 8 commits November 21, 2019 16:03
The GUI is repainted based on the how much chatter is coming
from Leelaz. This patch does only a repaint if 600ms has passed
since the previous.

This affects only paints from Leelaz.
After extracting the node tree for some
reason the pixels for Y are a little off.

This at least makes it work most of the time
OK.
@featurecat featurecat closed this Mar 23, 2020
@featurecat featurecat reopened this Mar 23, 2020
@featurecat
Copy link
Owner

Thanks for the PR. I'll review the changes. Although I'm a bit hesitant about the 700ms updating optimization. Because the engine updates 10 times per second is actually tweakable in the config. Once I take a closer look I'll be able to give better feedback.

@toomasr
Copy link
Contributor Author

toomasr commented Mar 23, 2020

Oh, if that is configurable then my patch is definitely not needed. Maybe should just consider different defaults and thats it.

@kaorahi kaorahi mentioned this pull request Sep 28, 2020
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