On 10/05/2013 10:12 AM, Michael T. Pope wrote:
> On Sat, 05 Oct 2013 08:19:20 +0200
> Michael Vehrs <[email protected]> wrote:
>> Unfortunately, swing does not follow the platform's UI conventions with
>> regard to button placement, which means that the new dialogs place their
>> buttons incorrectly. MigLayout does the right thing, but only if the
>> buttons are tagged appropriately.
> Tagging the buttons is not available within the JOptionPane, and I do not
> think we can control the placement much either.  Not without
> reimplementing much of JOptionPane that is.

What's the rationale for using JOptionPane rather than extending JDialog 
directly? JOptionPane provides shortcuts for several standard dialogs, 
but since our UI differs considerably from that of JOptionPane, it might 
not be worth the trouble.

>    However I think the order
> can be changed --- JOptionPane makes a button out of each member of an
> array of Objects passed to its constructor, so it is probably just a matter
> of changing the array order.  If the new buttons are backwards, that is my
> fault.  Following the discussion about modal/non-modal dialogs I thought it
> would be best if the "back out and think about it" option (usually
> "Cancel") was always the default, and it seemed better to have that always
> on the right.  I can switch it back easy enough if you have a clear
> preference.

The point is not that I prefer the OK button to be at the right, but 
that I expect it to be there because I use Gnome, and Gnome places the 
OK button on the right. As far as I understand, other desktop 
environments (Windows, for example) do it the other way around. 
MigLayout takes care of that nicely. In order to keep that feature, we 
would need to compile a list of rules for different desktop environments 
and sort the buttons accordingly.

>
> I am not even sure we have any UI conventions in force for the new dialogs.
> FreeColDialog is now a JOptionPane inside a JDialog, for which there is
> no entry in FreeColLookAndFeel.  This may be difficult if plaf requires a
> JComponent, as JDialog is not on that branch of the tree.
>
> Cheers,
> Mike Pope

I think it can be done via the BasicOptionPaneUI. It might even be 
possible to trick JOptionPane into using MigLayout using the 
BasicOptionPaneUI, specifically the addButtonComponents method.


Regards

Michael



------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to