MapTool 1.4, Swing, and High-DPI Support
Posted: Mon Dec 05, 2016 5:29 am
Okay, so I checked this sub-forum before posting this, and did not find any threads regarding it.
I have very poor vision, and my current setup uses Windows 7's High DPI settings at 200% DPI on a 34" 3440x1440 21:9 ultrawide monitor in inverted color mode (e.g. white is black, black is white, et cetera).
Problem is, Swing (javax.swing.*) does not support high DPI screen settings at all, but JavaFX does. (I know this as I recently converted one of my own Java apps from utilizing Swing as its GUI windowing engine to utilizing JavaFX as its GUI engine so I could actually use it.)
After grabbing the latest revision of MapTool 1.4.x's SVN repo and cd'ing to trunk/maptool/src/main/java/net/rptools/maptool/client and running cat *.java | grep import| grep swing to search the client Java code for Swing imports, I get a bunch of results, which on a casual glance tells me the reason why MapTool 1.4.x (and likely priooor MapTool versions as well) do not properly support high DPI settings -- even when set at the OS level -- is due to it using Swing.
Right now, my workaround is to zoom in to 150%, start the server, and then zoom out, but this is a pain and I don't want to have to spend 30 seconds just to click a menu item.
Right now on my Windows 10 box I'm in the middle of building MapTool from source to verify all this (granted line 5 of build.gradle causes gradlew.bat to throw an error under JDK 1.8.0_112). However, I did download MapTool 1.4.0.,5 from the public downloads link from RPTools.net, and I still get the same symptoms when running the JAR file.
So, the questions aare:
1) Is there a Look and Feel theme somewhere on the forums here that can address these problems (which include all GUI elements except the chat box which can have its font size increased in Preferences>Accessibility)?
2) If not, is there anything stopping us from re-implementing MapTool's GUI using JavaFX so that it can support high DPI settings properly? (Note: I'm happy to assist in this effort myself, as I've done such a conversion myself before, but on a much smaller scale.)
If I am missing something, please do let me know, as if there's a way to fix this without rewriting the entire GUI, I'd prefer to take that route at this juncture. However, if re-wreiting MapTool's GUI is the only way to fix this, then so be it.
(Side note: after checking out the repo, the only way I was able to build the source was to remove line 5 of trunk/build.gradle. Not sure why as I was using the gradlew.bat wrapper provided in the repo, but this is really only an "issue" if I need to help contribute code changes to MapTool 1.4.x so that it can support high DPI settings properly.)
I have very poor vision, and my current setup uses Windows 7's High DPI settings at 200% DPI on a 34" 3440x1440 21:9 ultrawide monitor in inverted color mode (e.g. white is black, black is white, et cetera).
Problem is, Swing (javax.swing.*) does not support high DPI screen settings at all, but JavaFX does. (I know this as I recently converted one of my own Java apps from utilizing Swing as its GUI windowing engine to utilizing JavaFX as its GUI engine so I could actually use it.)
After grabbing the latest revision of MapTool 1.4.x's SVN repo and cd'ing to trunk/maptool/src/main/java/net/rptools/maptool/client and running cat *.java | grep import| grep swing to search the client Java code for Swing imports, I get a bunch of results, which on a casual glance tells me the reason why MapTool 1.4.x (and likely priooor MapTool versions as well) do not properly support high DPI settings -- even when set at the OS level -- is due to it using Swing.
Right now, my workaround is to zoom in to 150%, start the server, and then zoom out, but this is a pain and I don't want to have to spend 30 seconds just to click a menu item.
Right now on my Windows 10 box I'm in the middle of building MapTool from source to verify all this (granted line 5 of build.gradle causes gradlew.bat to throw an error under JDK 1.8.0_112). However, I did download MapTool 1.4.0.,5 from the public downloads link from RPTools.net, and I still get the same symptoms when running the JAR file.
So, the questions aare:
1) Is there a Look and Feel theme somewhere on the forums here that can address these problems (which include all GUI elements except the chat box which can have its font size increased in Preferences>Accessibility)?
2) If not, is there anything stopping us from re-implementing MapTool's GUI using JavaFX so that it can support high DPI settings properly? (Note: I'm happy to assist in this effort myself, as I've done such a conversion myself before, but on a much smaller scale.)
If I am missing something, please do let me know, as if there's a way to fix this without rewriting the entire GUI, I'd prefer to take that route at this juncture. However, if re-wreiting MapTool's GUI is the only way to fix this, then so be it.
(Side note: after checking out the repo, the only way I was able to build the source was to remove line 5 of trunk/build.gradle. Not sure why as I was using the gradlew.bat wrapper provided in the repo, but this is really only an "issue" if I need to help contribute code changes to MapTool 1.4.x so that it can support high DPI settings properly.)