Re: Review Request for 8062846 : Transparent JDialog will lose transparency upon iconify/deiconify sequence.

2016-02-01 Thread Alexandr Scherbatiy


  The fix looks good to me.

  Thanks,
  Alexandr.

On 1/28/2016 9:45 PM, Prem Balakrishnan wrote:


Hi*,*

Please review fix for JDK9,

*Bug: *https://bugs.openjdk.java.net/browse/JDK-8062946**

*Webrev: *http://cr.openjdk.java.net/~arapte/prem/8062946/webrev.00/ 



Issue:

Transparent JDialog will lose transparency upon iconify/deiconify 
sequence.


*Cause:*

Regression: due to 6780496: Javaw process taking up 80-90 percent of 
CPU time!


https://bugs.openjdk.java.net/browse/JDK-6780496

Intentionally when JDialog is iconified transparency is disabled,

And transparency is not enabled when JDialog is deiconified.

*Fix:*

Transparency is enabled when JDialog is deiconified.

Regards,
Prem





Re: Review request for JDK-8131751: Test javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java fails UnsupportedOperationException

2016-02-01 Thread Vikrant Agarwal
Thanks Alexander, I have updated the webrev for the same.

Updated Webrev:  http://cr.openjdk.java.net/~ntv/vikrant/8131751/webrev.01/

Bug: https://bugs.openjdk.java.net/browse/JDK-8131751

 

Best Regards,

Vikrant

 

From: Alexander Scherbatiy 
Sent: Thursday, January 28, 2016 11:13 PM
To: Vikrant Agarwal; swing-dev@openjdk.java.net
Subject: Re:  Review request for JDK-8131751: Test 
javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java fails 
UnsupportedOperationException

 


The fix looks good to me.

Just a small note: it could be better to get the graphics device from the frame 
itself (f.getGraphicsConfiguration().getDevice()).

Thanks,
Alexandr.

On 1/28/2016 2:32 AM, Vikrant Agarwal wrote:



Hi All,

Kindly review the fix for JDK9.

Bug: https://bugs.openjdk.java.net/browse/JDK-8131751

Webrev: http://cr.openjdk.java.net/~srastogi/8131751/webrev.00/

Issue: [TEST_BUG] Test javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java 
fails UnsupportedOperationException

Cause: test failed on those systems where PERPIXEL_TRANSLUCENT translucency is 
not supported as it is doing  f.setBackground(new Color(0, 0, 0, 0)); (making 
alpha value 0)

Fix: Added a check for checking support for PERPIXEL_TRANSLUCENT translucency 
before f.setBackground(new Color(0, 0, 0, 0));

Best Regards,

Vikrant Agarwal

 

 


Re: Review request for JDK-8131751: Test javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java fails UnsupportedOperationException

2016-02-01 Thread Alexandr Scherbatiy


 The fix looks good to me.

  Thanks,
  Alexandr.

On 2/1/2016 4:32 AM, Vikrant Agarwal wrote:


Thanks Alexander, I have updated the webrev for the same.

Updated Webrev: 
http://cr.openjdk.java.net/~ntv/vikrant/8131751/webrev.01/ 



*Bug:* https://bugs.openjdk.java.net/browse/JDK-8131751

Best Regards,

Vikrant

*From:*Alexander Scherbatiy
*Sent:* Thursday, January 28, 2016 11:13 PM
*To:* Vikrant Agarwal; swing-dev@openjdk.java.net
*Subject:* Re:  Review request for JDK-8131751: Test 
javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java fails 
UnsupportedOperationException



The fix looks good to me.

Just a small note: it could be better to get the graphics device from 
the frame itself (f.getGraphicsConfiguration().getDevice()).


Thanks,
Alexandr.

On 1/28/2016 2:32 AM, Vikrant Agarwal wrote:

Hi All,

Kindly review the fix for JDK9.

*Bug:* https://bugs.openjdk.java.net/browse/JDK-8131751

*Webrev:* http://cr.openjdk.java.net/~srastogi/8131751/webrev.00/


*Issue:* [TEST_BUG] Test
javax/swing/plaf/gtk/crash/RenderBadPictureCrash.java fails
UnsupportedOperationException

*Cause:* test failed on those systems where PERPIXEL_TRANSLUCENT
translucency is not supported as it is doing  f.setBackground(new
Color(0, 0, 0, 0)); (making alpha value 0)

*Fix:* Added a check for checking support for PERPIXEL_TRANSLUCENT
translucency before f.setBackground(new Color(0, 0, 0, 0));

Best Regards,

Vikrant Agarwal





Re: Review Request of 8146321: [macosx] JInternalFrame frame icon in wrong position on Mac L if icon is not ImageIcon

2016-02-01 Thread Avik Niyogi
Hi All,
Please review the code changes made as per inputs provided:
cr.openjdk.java.net/~aniyogi/8146321/webrev.02 


With Regards,
Avik Niyogi
> On 20-Jan-2016, at 10:35 pm, Sergey Bylokhov  
> wrote:
> 
> On 20/01/16 18:43, Avik Niyogi wrote:
>> if ((icon.getIconWidth() > sMaxIconWidth
>> || icon.getIconHeight() > sMaxIconHeight)) {
>> final Graphics2D g2 = (Graphics2D) g;
>> final AffineTransform savedAT = g2.getTransform();
>> g2.scale((float)sMaxIconWidth/icon.getIconWidth(),
>> (float)sMaxIconWidth/icon.getIconHeight());
>> icon.paintIcon(frame, g2, x, y);
>> g2.setTransform(savedAT);
>> }
> 
> This code does not take into account that x,y whcih are passed to the 
> paintIcon should be adjusted, because after the scale they contain incorrect 
> starting points.
> 
>> 
>> then for a test code with the following:
>> 
>> import java.awt.*;
>> import javax.swing.*;
>> 
>> public class JInternalFrameBug {
>> 
>>public static void main(String[] args) {
>>   SwingUtilities.invokeLater(
>> new Runnable() {
>>public void run() {
>>   try {
>> 
>>  UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel"); }
>>   catch(Exception e) {
>>  System.out.println("This is not a Mac.");
>>  return;
>>   }
>>   JFrame f = new JFrame();
>>   f.setSize(400, 400);
>>   JDesktopPane dtp = new JDesktopPane();
>>   JInternalFrame jif = new JInternalFrame();
>>   jif.setTitle("Test");
>>   jif.setFrameIcon(new
>> ImageIcon("/Users/avniyogi/Downloads/FeedbinNotifier-master/FeedbinNotifier/Images.xcassets/AppIcon.appiconset/icon_128x...@2x.png"));
>>   jif.setSize(200, 200);
>>   jif.setVisible(true);
>>   dtp.add(jif);
>> 
>>   f.getContentPane().setLayout(new BorderLayout());
>>   f.getContentPane().add(dtp, "Center");
>>   f.setVisible(true);
>>}
>> });
>>}
>> }
>> 
>> results in this:
>> 
>> 
>> 
>>> On 20-Jan-2016, at 4:42 pm, Alexander Scherbatiy
>>> >> > wrote:
>>> 
>>> On 1/20/2016 7:59 AM, Avik Niyogi wrote:
 Hi All,
 A gentle reminder, please review my code changes as in the webrev
 below in the mail trail.
 With Regards,
 Avik Niyogi
> On 18-Jan-2016, at 3:01 pm, Avik Niyogi   > wrote:
> 
> Hi Sergey,
> 
> Please review the webrev taking inputs as per the discussion before:
> http://cr.openjdk.java.net/~aniyogi/8146321/webrev.01/
> 
>>> 
>>>   The idea was to scale the graphics that the drawn icon fits to the
>>> target sizes.
>>>   Something like:
>>>  
>>>  g2d.scale(targetIconWidth/icon.getWidth(),
>>> targetIconHeight/icon.getHeight());
>>>  icon.paintIcon(frame, g2d, x, y);
>>> -
>>> 
>>>  This should work not only for ImageIcon but for any type of icons.
>>> 
>>>  Thanks,
>>>  Alexandr.
> 
> With Regards,
> Avik Niyogi
> 
>> On 14-Jan-2016, at 12:55 pm, Avik Niyogi >  > wrote:
>> 
>> Hi Sergey,
>> I have verified it with the test case as well. If a test case
>> overrides these methods to imply a change with icons larger than
>> 16x16 it will show that for ImageIcon and Icon as before. The
>> resize of ImageIcon is only in case it has an image file that it
>> will try to fit. I had a similar query myself and have found out
>> that *getImage()* exists for ImageIcon class only and not Icon class.
>> Example:
>> private static void createImageIconUI(final String lookAndFeelString)
>>   throws Exception {
>> SwingUtilities.invokeAndWait(new Runnable() {
>>   @Override
>>   public void run() {
>>   desktopPane = new JDesktopPane();
>>   internalFrame = new JInternalFrame();
>>   frame = new JFrame();
>> internalFrame.setTitle(lookAndFeelString);
>>   titleImageIcon = new ImageIcon() {
>>   @Override
>>   public int getIconWidth() {
>>   return 16;
>>   }
>> 
>>   @Override
>>   public int getIconHeight() {
>>   return 16;
>>   }
>> 
>>   @Override