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

Odd truncation of Token type names in the GUI #135

Open
johann-petrak opened this issue Jan 21, 2021 · 14 comments
Open

Odd truncation of Token type names in the GUI #135

johann-petrak opened this issue Jan 21, 2021 · 14 comments

Comments

@johann-petrak
Copy link
Contributor

Running GATE 9.0-SNAPSHOT 0db9ddb on Windows 10 using AdoptOpenJDK 15.0.1

The annotation tree pane on the right of the GUI shows the annotation types truncated even though there would be plenty more space to show the whole type name (see screenshot)

@johann-petrak
Copy link
Contributor Author

Screenshot 2021-01-21 132200

@johann-petrak
Copy link
Contributor Author

May be related to HiDPI on my laptop running Windows 10, never seen this happen anywhere else.

I also tested if this is related to the Font and Font size used and discovered another problem: when I change the fonts in the configuration for all three possible element groups (text, menu, other), the font of the type names in that pane are unaffected.

@greenwoodma
Copy link
Contributor

My guess (I'll go digging shortly) is that when the checkbox is initially configured it's either given no prototype or a small one, and so once it's configured the size no longer updates properly.

@johann-petrak
Copy link
Contributor Author

Tested this now on two different laptops, both running Windows 10 on a HiDPI display with the following resolutions and settings:

  • 2880x1620 (scaling set to 200% which is the recommended default)
  • 3200x1800 (scaling set to 250% which is the recommended default)

Same symptoms on both.

@johann-petrak
Copy link
Contributor Author

johann-petrak commented Jan 22, 2021

Also tested on Windows 10 with a 1366x768 screen and 100% recommended scaling and it works fine there.

When setting to 125% the text gets truncated, so apparently no matter if the scaling is set to > 100% before or after the pane is shown the type name will be truncated.

@johann-petrak
Copy link
Contributor Author

johann-petrak commented Jan 22, 2021

(BTW, just to assert that this issue also existed already in GATE 8.6.1 with Java 15)

@greenwoodma
Copy link
Contributor

I realised I should probably have not closed it via the commit message given the way I was reproducing it was slightly different, so if it still doesn't work for you @johann-petrak feel free to reopen.

@johann-petrak
Copy link
Contributor Author

Tested with 9532ab9, problem is still there.

@johann-petrak johann-petrak reopened this Jan 22, 2021
@greenwoodma
Copy link
Contributor

If you manually select some text and add an annotation with a stupidly long type does it extend the column or truncate it as well? Just wondering if there is a difference in how it gets calculated for things added by an app versus added manually. There shouldn't be but if you could double check for me.

@johann-petrak
Copy link
Contributor Author

So far I tested this by running ANNIE on a tiny test document and the "SpaceToken" type name gets truncated.

I now added a new annotation with a much longer type name still. This made the coloured table entries longer so that "SpaceToken" is not visible, but the long type name is truncated. (situation A)

At that point the coloured texts still did not fill the whole width of the pane. So I added an even longer type at which point the name became longer than the width, a horizontal scroll bar appeared and that newest, longest type name now got shown fully, without truncation.

However when I just make the pane smaller after situation A, the name stays truncated.

@greenwoodma
Copy link
Contributor

all very weird. if I'm reading that right it means it's still broken but better than before?

It sounds as if it's still not getting the width right which is odd. I'm now calculating the width by getting the font from the label and asking explicitly how wide the text is in that font and then setting that as the minimum column width. I wonder if that doesn't include the borders and so is still causing truncation on the longest case. It doesn't for me (on a HiDPI screen) but I'm not sure how my scaling is set in comparison to yours, plus I know from previous experience the scaling in Java is broken anyway so chances are it's reporting the wrong size for the text and hence messing up the table. This is probably one of those "I've fixed it as much as I can" issues, but I'll keep digging.

@johann-petrak
Copy link
Contributor Author

johann-petrak commented Jan 22, 2021

The tests I have done before and after the change show exactly the same behaviour on Windows 10 / HiDPI, so no improvement. I just added the info about the additional tests I only did now in case it may help understand what is going on.

I now also tried to test this on Linux with a HiDPI screen but there the GATE app does not get scaled at all (so the truncation problem does not exist there, but everything is tiny)

@greenwoodma
Copy link
Contributor

Weird. I'll possibly roll that change back then as there is no point calculating widths if they don't help as they'll just slow the UI down.

@greenwoodma
Copy link
Contributor

no I didn't close it, I reverted a comment with close in the comment, sigh

@greenwoodma greenwoodma reopened this Jan 27, 2021
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

No branches or pull requests

2 participants