<Swing Dev> Review request for JDK-8139213 : Mac OS X Aqua Look and Feel: JOptionPane can truncate the first button.

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Wed Jan 20 11:33:49 UTC 2016


On 1/20/2016 8:11 AM, Rajeev Chamyal wrote:
>
> Hello Alexandr,
>
> Thanks for the review.
>
> Yes, we can call minimumLayoutSize(Container) of parent class but in 
> this case also again we need to check if any of the child components 
> are setting preferred size and compare it with the default values.
>
> And after this we need to find a delta that needs to be added to the 
> minimum size obtained from the parent class.
>
> The current webrev code I feel is much cleaner than getting the size 
> from parent class.
>

     The parent class also includes preffered sizes. It looks like it is 
possible to do something like:
     ---------------
     int kButtonLayoutSizeWidth = extraWidth
             + (kOKCancelButtonWidth * numChildren)
             + (numChildren - 1) * padding;
     int kButtonLayoutSizeHeight = extraHeight + kButtonHeight;

     Dimension size = super.minimumLayoutSize(c);
     size.width = Math.max(size.width, kButtonLayoutSizeWidth);
     size.height = Math.max(size.height, kButtonLayoutSizeHeight);
    ---------------

  Thanks,
  Alexandr.

> Regards,
>
> Rajeev Chamyal
>
> *From:*Alexander Scherbatiy
> *Sent:* 19 January 2016 21:00
> *To:* Rajeev Chamyal; Sergey Bylokhov; Prasanta Sadhukhan; 
> swing-dev at openjdk.java.net
> *Subject:* Re: Review request for JDK-8139213 : Mac OS X Aqua Look and 
> Feel: JOptionPane can truncate the first button.
>
> On 19/01/16 15:48, Rajeev Chamyal wrote:
>
>     Hello All,
>
>       
>
>     Gentle reminder for review.
>
>       
>
>     Regards,
>
>     Rajeev Chamyal
>
>       
>
>     -----Original Message-----
>
>     From: Rajeev Chamyal
>
>     Sent: 13 January 2016 16:37
>
>     To: Sergey Bylokhov; Alexander Scherbatiy; Prasanta Sadhukhan;swing-dev at openjdk.java.net  <mailto:swing-dev at openjdk.java.net>
>
>     Subject: Review request for JDK-8139213 : Mac OS X Aqua Look and Feel: JOptionPane can truncate the first button.
>
>       
>
>     Hello All,
>
>       
>
>     Please review the following fix for Jdk9:
>
>       
>
>     Bug :https://bugs.openjdk.java.net/browse/JDK-8139213
>
>     Webrev :http://cr.openjdk.java.net/~rchamyal/8139213/webrev.00/  <http://cr.openjdk.java.net/%7Erchamyal/8139213/webrev.00/>
>
>       
>
>     Issue : In Mac OS X Aqua LAF JOptionPane truncates the first button if multiple buttons are added to it.
>
>       
>
>     Cause: AquaButtonAreaLayout class is not overriding base class method minimumLayoutSize as a result it is not taking to account the default button width for Aqua LAF.
>
>     Hence it is calculating incorrect dimensions for JOptionPane which results in truncation of button.
>
>       
>
>     Fix: Overriding minimumLayoutSize in AquaButtonAreaLayout to consider default button width and height while calculating minimum size for JOptionPane.
>
>
>   Is it possible to call  the minimumLayoutSize(Container) from the 
> super class and adjust the returned size to take the default button 
> size into account?
>
>   Thanks,
>   Alexandr.
>
>       
>
>       
>
>     Regards,
>
>     Rajeev Chamyal
>




More information about the swing-dev mailing list