Working on "Did You Know" popup box

Progress reports and musings from the developers on the current gaming tools.

Moderators: Azhrei, dorpond, trevor

Post Reply
User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Working on "Did You Know" popup box

Post by joshsziegler »

Ok, I've done a few documentation pull requests (based on existing info from the forums) and the one on UPnP discoveryTimeout. Now I'd like to tackle the hopefully easy "Did You Know" popup box (issue 34 in the Google Spreadsheet).

I used Abeille for the UPnP UI, but that was because the Setting UI already existed. Going forward, how should I create the UI for this Did You Know feature? I see open issues for an HTML and/or JavaFX based UI? I also see Swing is being phased out. Can I get some guidance?

Thanks!

User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Re: Working on "Did You Know" popup box

Post by joshsziegler »

I suppose GitHub Issues is a better place for this sort of question. Sorry for the spam.

https://github.com/RPTools/maptool/issues/35


User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Working on "Did You Know" popup box

Post by Jagged »

joshsziegler wrote:I suppose GitHub Issues is a better place for this sort of question. Sorry for the spam.

https://github.com/RPTools/maptool/issues/35


No, feel free to post development questions here.

The people that get the GitHub comments will be a smaller group than those with access to the Development or 1.4 sections. So feel free to post here to get the widest audience.

It might also encourage other contributors :)

PS: If you start working on an assignment, send a PM to RPTroll and he will add your name to the assignment list.

User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Re: Working on "Did You Know" popup box

Post by joshsziegler »

Ok, so should I not create an issue/ticket on GitHub then? Or just create one but keep the discussion on the forums?

I just found that the "Notify me when a reply is posted" emails were going to my spam folder. With that fixed, I should have fewer problems staying on top of forum replies. :)

User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Re: Working on "Did You Know" popup box

Post by joshsziegler »

I have the basic GUI created, which is based roughly on this: https://jdnc-incubator.java.net/documen ... theday.jpg

Now I have an implementation question. I assume we want this to handle internationalized text and maybe HTML, right? So where should the tips reside? Should they use the same i18N properties file, or something similar but separate? Is plain text fine, or do we want HTML?

User avatar
Azhrei
Site Admin
Posts: 12050
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Working on "Did You Know" popup box

Post by Azhrei »

I would suggest a separate properties file. That file could contain HTML, if necessary. Another benefit would be downloading the file from the rptools.net web site at startup so that updates wouldn't require the entire application to be downloaded. We could do an OPTIONS request to check the timestamp on the server, download the new file if necessary, and then cache it for future use.

(MapTool has a custom URLStreamHandler installed called "cp://" that will automatically search all classpath locations. Downloading the file and putting it into one of the classpath directories would mean future access would just be "cp://filename.properties".)

Those people creating content for the DYK box could type their info into an editor or word processor, then "export" it as HTML for embedding into the properties file. (Maybe they do that now, I don't know.) That will automatically convert internationalized characters to their HTML entities. (Or rather, it should. :))

User avatar
Azhrei
Site Admin
Posts: 12050
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Working on "Did You Know" popup box

Post by Azhrei »

I've had some time over the holidays and I've been interested in seeing what's happening with JavaFX. :)

I've got the first few panels of a new "Start a Server" networking wizard completed using JFX. I plan to use a new library called portmapper (instead of the sbbi-upnp library we currently have) because the new one supports UPNP, NAT-PMP, and the latest-and-greatest PCP protocols. It also appears to still be under active development.

I built the UI using SceneBuilder8 (don't use earlier versions as they're outdated). It includes the ControlsFX 8.40.10 library, which means you need to be running Java 8u40+ for it to work properly. This may/should/might integrate better with the build system in general since SceneBuilder8 has Gradle support. (Less muss and fuss with updating an external tool like Abeille.)

I'm still learning what the best practices might be for creating translation files, CSS themes to control what the wizard panels look like, how best to save these settings under "profiles" so they can be reused later (possibly on other machines), and so on. I've been taking notes and making copious comments in my code with the hope that others who come along later will be able to (a) use my wizard as a template, but also (b) correct my assumptions if they know more about it than I do. :D

There shouldn't be too much trouble integrating individual panels like this with Swing as long as a few basic ideas are kept in mind, primarily that JFX updates happen on the JFX thread, just like Swing updates happen on its own thread.

User avatar
joshsziegler
Cave Troll
Posts: 38
Joined: Mon May 17, 2010 10:04 pm

Re: Working on "Did You Know" popup box

Post by joshsziegler »

Sounds good! Whenever you push your code up somewhere, let me know. I'm interested to see how it all works with the current codebase.

As for my work, my dissertation is taking all my time. I think I'll have some free time this month, but we'll see :(

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

Re: Working on "Did You Know" popup box

Post by JamzTheMan »

Azhrei wrote:I've had some time over the holidays and I've been interested in seeing what's happening with JavaFX. :)

I've got the first few panels of a new "Start a Server" networking wizard completed using JFX. I plan to use a new library called portmapper (instead of the sbbi-upnp library we currently have) because the new one supports UPNP, NAT-PMP, and the latest-and-greatest PCP protocols. It also appears to still be under active development.

I built the UI using SceneBuilder8 (don't use earlier versions as they're outdated). It includes the ControlsFX 8.40.10 library, which means you need to be running Java 8u40+ for it to work properly. This may/should/might integrate better with the build system in general since SceneBuilder8 has Gradle support. (Less muss and fuss with updating an external tool like Abeille.)

I'm still learning what the best practices might be for creating translation files, CSS themes to control what the wizard panels look like, how best to save these settings under "profiles" so they can be reused later (possibly on other machines), and so on. I've been taking notes and making copious comments in my code with the hope that others who come along later will be able to (a) use my wizard as a template, but also (b) correct my assumptions if they know more about it than I do. :D

There shouldn't be too much trouble integrating individual panels like this with Swing as long as a few basic ideas are kept in mind, primarily that JFX updates happen on the JFX thread, just like Swing updates happen on its own thread.


Cool beans.

Curious, in your research, did you see anything about the latest JavaFX having any support for HDPI? (High Density Pixel monitors)? I thought it was on the "list" but last I checked there still wasn't true support...
-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

User avatar
Azhrei
Site Admin
Posts: 12050
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Working on "Did You Know" popup box

Post by Azhrei »

JamzTheMan wrote:Curious, in your research, did you see anything about the latest JavaFX having any support for HDPI? (High Density Pixel monitors)? I thought it was on the "list" but last I checked there still wasn't true support...

Nope, haven't seen any mention of that, but I haven't really been looking at low-level graphics primitives. The stuff I've been dealing with has been high-level so far.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Working on "Did You Know" popup box

Post by Jagged »

Azhrei wrote:I built the UI using SceneBuilder8 (don't use earlier versions as they're outdated). It includes the ControlsFX 8.40.10 library, which means you need to be running Java 8u40+ for it to work properly. This may/should/might integrate better with the build system in general since SceneBuilder8 has Gradle support. (Less muss and fuss with updating an external tool like Abeille.)


Is that the best source for Scene Builder now?

When I did my Eclipse IDE write up, the link I provided was to Oracle, but I know they Open-Sourced it.

User avatar
Azhrei
Site Admin
Posts: 12050
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Working on "Did You Know" popup box

Post by Azhrei »

Jagged wrote:Is that the best source for Scene Builder now?

When I did my Eclipse IDE write up, the link I provided was to Oracle, but I know they Open-Sourced it.

Yes, it is. Oracle's downloads are all for SceneBuilder 2 or older. And they don't link to any open source location (that I could find, anyway).

I figured this out while trying to get ControlsFX into SB2. After reading numerous StackOverflow articles, I came across one with the above link.

Warning: there are also references to openfx-dialogs.jar (or something similar) floating around as a prerequisite for ControlsFX. The content of that jar is included in the Java download now so there's no need to grab and install it separately. (Yet another item learned by trial and error. :()

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Working on "Did You Know" popup box

Post by Jagged »

Thanks for the tips. I shall play and update the Eclipse instructions :)

Post Reply

Return to “Developer Notes”