Re: Programmatically clicking a JLabel in a JList

2016-06-10 Thread Pete Brunet
Thanks Andrej.

On 6/9/16 1:07 AM, Andrej Golovnin wrote:
> One more solution:
>
> MouseEvent clicked = 
> JLabel l = ...
>
> for (MouseListener ml : l.getMouseListeners()) {
> ml.mouseClicked(clicked);
> }
>
> But this solution only works if you don't have subclasses of JLabel
> which override the #processMouseEvent(MouseEvent)-method.
>
> On Thu, Jun 9, 2016 at 7:44 AM, Andrej Golovnin
>  wrote:
>> Hi Pete,
>>
>> you can either use java.awt.Robot or you can dispatch an event by
>> calling java.awt.Component.dispatchEvent(AWTEvent).
>>
>> Best regards,
>> Andrej Golovnin
>>
>> On Wed, Jun 8, 2016 at 10:46 PM, Pete Brunet  wrote:
>>> To add some accessibility support I need to programmatically click a
>>> JLabel in a JList.  If I can figure out the code path for when this
>>> happens with a real click I can probably do what I need to do but as of
>>> yet I haven't figured it out.  Does anyone on the list know at least
>>> part of the code path?
>>>
>>> Thanks, Pete



Re: Review Request JDK-8152419 JColorChooser throws Exception

2016-06-10 Thread Alexandr Scherbatiy


The fix looks good to me.

Thanks,
Alexandr.

On 6/10/2016 12:39 PM, Prem Balakrishnan wrote:


Hi Alexander,

Please review updated patch as per review comments.

http://cr.openjdk.java.net/~pkbalakr/8152419/webrev.02/ 



Regards,
Prem

*From:*Alexander Scherbatiy
*Sent:* Tuesday, May 31, 2016 4:04 PM
*To:* Prem Balakrishnan; Sergey Bylokhov; swing-dev@openjdk.java.net
*Subject:* Re: Review Request JDK-8152419 JColorChooser throws Exception

On 31/05/16 14:03, Prem Balakrishnan wrote:

Hi Alexander,

Please review the updated patch.

http://cr.openjdk.java.net/~pkbalakr/8152419/webrev.01/



Math.max(getWidth() - this.insets.left - this.insets.right, 
getWidth()) can give incorrect result for the case where a component 
size is 50x50 and insets are [10, 10, 10 , 10]. max(50-10-10, 50) = 50 
but the expected results is 30.


The correct formula should be max(width-insets.left-insets.right, 
minWidthValue) where minWidthValue is zero or some specified minimal 
value.


The DiagramComponent.paintComponent() code tries to create an array of 
size width*height and BufferedImage with component size. In this case 
it may be better just to check that the component size minus insets is
greater than zero. If it is less or equal to zero we can just return 
from the paintComponent() method.


Thanks,
Alexandr.


Regards,

Prem

*From:*Alexander Scherbatiy
*Sent:* Monday, May 30, 2016 9:42 PM
*To:* Prem Balakrishnan; Sergey Bylokhov; swing-dev@openjdk.java.net 


*Subject:* Re: Review Request JDK-8152419 JColorChooser throws Exception

On 30/05/16 12:39, Prem Balakrishnan wrote:

Hi*,*

Please review fix for JDK9,

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

*Webrev:*http://cr.openjdk.java.net/~pkbalakr/8152419/webrev.00/


*Issue:*

JColorChooser throws Exception(NegativeArraySizeException)

*Fix:*

Absolute value is passed while creating array.

   If component size is 10x10 and insets are [30, 30, 30, 30] the 
absolute value of the difference will be  abs(10 - 30 - 30)=50.
   It seems that the right component size should be zero or some 
minimal values which is max(width-insets.left-insets.right, 
minWidthValue).


  Thanks,
  Alexandr.


Regards,
Prem





Re: [9] Review request for JDK-8159135 [PIT] javax/swing/JMenuItem/8152981/MenuItemIconTest.java always fail

2016-06-10 Thread Alexandr Scherbatiy


On 6/10/2016 12:36 PM, Rajeev Chamyal wrote:


Hello All,

Please review the following fix.

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

Webrev : http://cr.openjdk.java.net/~rchamyal/8159135/webrev.00/ 



Issue : MenuItemIconTest fails on windows 10.

Cause : In windows 10  menu bar color is white and test checks for red 
color only.


Fix: checking for other color values(green and blue) also.

Is it possible to compare color using equals method like other 
objects:   Color.RED.equals(c)?


   Thanks,
   Alexandr.


Regards,

Rajeev Chamyal





Re: Review Request JDK-8152419 JColorChooser throws Exception

2016-06-10 Thread Prem Balakrishnan
Hi Alexander,

 

Please review updated patch as per review comments.

http://cr.openjdk.java.net/~pkbalakr/8152419/webrev.02/ 

 

Regards,
Prem

 

From: Alexander Scherbatiy 
Sent: Tuesday, May 31, 2016 4:04 PM
To: Prem Balakrishnan; Sergey Bylokhov; swing-dev@openjdk.java.net
Subject: Re: Review Request JDK-8152419 JColorChooser throws Exception

 

On 31/05/16 14:03, Prem Balakrishnan wrote:

Hi Alexander,

 

Please review the updated patch.

http://cr.openjdk.java.net/~pkbalakr/8152419/webrev.01/


Math.max(getWidth() - this.insets.left - this.insets.right, getWidth()) can 
give incorrect result for the case where a component size is 50x50 and insets 
are [10, 10, 10 , 10]. max(50-10-10, 50) = 50 but the expected results is 30.

The correct formula should be max(width-insets.left-insets.right, 
minWidthValue) where minWidthValue is zero or some specified minimal value.

The DiagramComponent.paintComponent() code tries to create an array of size 
width*height and BufferedImage with component size. In this case it may be 
better just to check that the component size minus insets is
greater than zero. If it is less or equal to zero we can just return from the 
paintComponent() method.

Thanks,
Alexandr.




 

 

Regards,

Prem

 

From: Alexander Scherbatiy 
Sent: Monday, May 30, 2016 9:42 PM
To: Prem Balakrishnan; Sergey Bylokhov; HYPERLINK 
"mailto:swing-dev@openjdk.java.net"swing-dev@openjdk.java.net
Subject: Re: Review Request JDK-8152419 JColorChooser throws Exception

 

On 30/05/16 12:39, Prem Balakrishnan wrote:

Hi,

Please review fix for JDK9,

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

Webrev: http://cr.openjdk.java.net/~pkbalakr/8152419/webrev.00/ 

 

  

Issue:

JColorChooser throws Exception(NegativeArraySizeException)

 

Fix:

Absolute value is passed while creating array.

   If component size is 10x10 and insets are [30, 30, 30, 30] the absolute 
value of the difference will be  abs(10 - 30 - 30)=50.
   It seems that the right component size should be zero or some minimal values 
which is max(width-insets.left-insets.right, minWidthValue).

  Thanks,
  Alexandr.




 

Regards,
Prem

 

 

 


[9] Review request for JDK-8159135 [PIT] javax/swing/JMenuItem/8152981/MenuItemIconTest.java always fail

2016-06-10 Thread Rajeev Chamyal
Hello All,

 

Please review the following fix.

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

Webrev : http://cr.openjdk.java.net/~rchamyal/8159135/webrev.00/

 

Issue : MenuItemIconTest fails on windows 10.

Cause : In windows 10  menu bar color is white and test checks for red color 
only.

Fix: checking for other color values(green and blue) also.

 

Regards,

Rajeev Chamyal


Re: Fix for JDK-8065861 : Pressing Esc does not set 'canceled' property of ProgressMonitor

2016-06-10 Thread Alexandr Scherbatiy


The fix looks good to me.

Thanks,
Alexandr.

On 6/10/2016 8:50 AM, Ajit Ghaisas wrote:

Hi,

 Thanks Alex for spotting probable exceptions in code changes.
  I have corrected the code to address them.

  Here is the updated webrev. Request you to review.
  http://cr.openjdk.java.net/~aghaisas/8065861/webrev.01/

Regards,
Ajit



-Original Message-
From: Alexandr Scherbatiy
Sent: Thursday, June 09, 2016 8:56 PM
To: Ajit Ghaisas; Sergey Bylokhov; Rajeev Chamyal; swing-dev@openjdk.java.net
Subject: Re: Fix for JDK-8065861 : Pressing Esc does not set 'canceled' 
property of ProgressMonitor

On 6/8/2016 5:35 PM, Ajit Ghaisas wrote:

Hi,

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

Issue :
Pressing Esc does not set 'canceled' property of ProgressMonitor

Analysis :
ProgressMonitor option pane only gets hidden on pressing Escape key.
It is not truly canceled as isCanceled() method continues to return false.

Fix :
On Pressing Escape key JOptionPane.CLOSED_OPTION value is set in JOptionPane 
from BasicOptionPaneUI.java.
This value is used as a condition in isCanceled() to identify ProgressMonitor 
is canceled by pressing Escape key.

Please review the webrev:
http://cr.openjdk.java.net/~aghaisas/8065861/webrev.00/

   The updated code calls methods from 'v' object before it is checked to 
the null which can lead to the NPE. The cancelOption[0] also can throw the IOBE 
before the arrays length checking.

Thanks,
Alexandr.

On review completion, I will raise a CCC request for documentation change.

Regards,
Ajit