Discussion:
[Freecol-developers] Game Dialogs
w***@genial.ms
2015-09-18 19:28:46 UTC
Permalink
Hi,

I experimented a bit with replacing FreeColDialog cause of the problems
with JDialog.
I used JOptionPane.showInternalConfirmDialog and for me the dialog for
quitting the game from main menu actually did work and was correctly
behaving modal (prevented clicking the main menu while open).
This is showing it might actually work, which I wanted to let you know
(you can try the attached diff).
There just turned out to be some problem with the look and feel, the
buttons are showing class name+hash number.
It would also be difficult to get rid of the ugly green border and
title bar, as these methods are all-in-one affairs and difficult to
replace, maybe the look-and-feel can be set to allow this?

As for the non-modal dialogs, I wonder why the DialogCallback is
creating threads and polling every half second? Shouldn't it be enough
to set a listener for the dialog closing?
Not sure if its worth trying to change this or better to skip that and
only work on replacing those non-modal dialogs with panels.

(everything only after the release)


Greetings,

wintertime
Michael T. Pope
2015-09-19 00:23:13 UTC
Permalink
On Fri, 18 Sep 2015 21:28:46 +0200
Post by w***@genial.ms
I experimented a bit with replacing FreeColDialog cause of the problems
with JDialog.
I used JOptionPane.showInternalConfirmDialog and for me the dialog for
quitting the game from main menu actually did work and was correctly
behaving modal (prevented clicking the main menu while open).
Quite so. The modal case is the one that works:-).
Post by w***@genial.ms
There just turned out to be some problem with the look and feel, the
buttons are showing class name+hash number.
It would also be difficult to get rid of the ugly green border and
title bar, as these methods are all-in-one affairs and difficult to
replace, maybe the look-and-feel can be set to allow this?
I do not know. I have kicked the L&F a few times but do not pretend to
understand it.
Post by w***@genial.ms
As for the non-modal dialogs, I wonder why the DialogCallback is
creating threads and polling every half second? Shouldn't it be enough
to set a listener for the dialog closing?
IIRC there were intermittent hangs and/or missing calls (particularly when
several dialogs came up together) --- it was just not reliable. Hopefully,
again, this was just due to Java bugs at the time. In the end I got
exasperated and did an explicit implementation of the required
concurrency.
Post by w***@genial.ms
Not sure if its worth trying to change this or better to skip that and
only work on replacing those non-modal dialogs with panels.
If those non-modal dialogs become panels, surely that gets rid of all the
uses of DialogCallback anyway? No sense in fixing things twice.

Cheers,
Mike Pope

Loading...