MapTool 1.4, Swing, and High-DPI Support

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
Post Reply
ryushinji
Kobold
Posts: 7
Joined: Mon Dec 05, 2016 1:50 am

MapTool 1.4, Swing, and High-DPI Support

Post by ryushinji »

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.)


ryushinji
Kobold
Posts: 7
Joined: Mon Dec 05, 2016 1:50 am

Re: MapTool 1.4, Swing, and High-DPI Support

Post by ryushinji »

wolph42 wrote:search this forum for 'manifest'. the next release will have this implemented.
I'll do that. Do we have an ETA on when said release will go public and are we talking about the 1.4.0.x branch or the 1.4.1.x branch? I only ask so as to know what version to look for (and to get my group to move to from 1.3.b91...).

Thanks!

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: MapTool 1.4, Swing, and High-DPI Support

Post by JamzTheMan »

http://forums.rptools.net/viewtopic.php ... st#p264395

You don't have to wait for any MapTool release to implement this. You just need to place the manifest files where your java.exe is and run the regedit (although I suspect you may already have the setting placed in your registry). I've tested this on my Surface Pro and it works great!

In 1.4.1.x we will have an option set in the Launcher to set your registry for you and the manifest will come with the built in JRE. Right now it's in my test build @ maptool.nerps.net if you have issues doing it manually.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

Post Reply

Return to “MapTool 1.4”