<Swing Dev> RFR: 8239137: JAWS does not always announce the value of JSliders in JColorChooser

Pankaj Bansal pankaj.b.bansal at oracle.com
Sat Aug 15 19:16:43 UTC 2020


Hello Phil,

Due to the changes in comments for functions during CSR review, a new 
webrev is created. This version only has changes in comments in 
constructor and stateChanged methods. Everything else is same as 
previous version webrev02.

webrev: http://cr.openjdk.java.net/~pbansal/8239137/webrev03/ 
<http://cr.openjdk.java.net/%7Epbansal/8239137/webrev03/>


PS: In CSR comment for stateChanged function, the NullPointerException 
was changed to {@code NullPointerException}, but it gives build error 
given below. I saw in other files, the Exception is without the {@code} 
tag after @throws. Also, I have added the {@code} around null in comment.

Build Error:

  client/open/src/java.desktop/share/classes/javax/swing/JSlider.java:1447: error: unexpected text
          * @throws {@code NullPointerException} if the parameter is null
1 error


Regards,

Pankaj


On 04/08/20 11:38 AM, Pankaj Bansal wrote:
> Hello Sergey,
>
> I have created the CSR. Please have a look.
>
> https://bugs.openjdk.java.net/browse/JDK-8251002
>
> Regards,
>
> Pankaj
>
>
> On 28/07/20 6:08 AM, Sergey Bylokhov wrote:
>> Looks fine. Please note you will need a CSR for this change.
>>
>> On 19.07.2020 11:28, Pankaj Bansal wrote:
>>> Hi All,
>>>
>>> Please review the following fix for jdk16.
>>>
>>> Bug : https://bugs.openjdk.java.net/browse/JDK-8239137
>>> webrev: http://cr.openjdk.java.net/~pbansal/8239137/webrev02/ 
>>> <http://cr.openjdk.java.net/%7Epbansal/8239137/webrev02/>
>>>
>>> Issue: The JAWS does not announce the value of JSlider in JColorChooser
>>>
>>> Cause: The JSlider and JSpinner are kept in Sync in JColorChooser by 
>>> changing the value of other component when one is used. eg, when we 
>>> change color value using JSlider, the JSpinner value is also changed 
>>> to keep the two in Sync. This results in two accessibility value 
>>> change events being sent to JAWS (one for JSlider and JSpinner each) 
>>> instead of just one for JSlider.
>>>
>>> The event in JSlider is being sent from setValue method, whereas in 
>>> case of JSpinner, the event is being sent from a AccessibleJSpinner 
>>> stateChanged method which is added as changeListener to JSpinner. 
>>> This results in situation where the event for JSpinner is always 
>>> being sent first whether we are using JSlider or JSpinner. It looks 
>>> like JAWS is not able to process all the events being sent quickly. 
>>> So, the JSlider event is not being processed properly by JAWS.
>>>
>>>
>>> Fix: The fix is to add the AccessibleJSlider as a ChangeListener on 
>>> the JSlider and then sending the accesssiblity value change event 
>>> from there instead of sending it from setValue method like being 
>>> done in JSpinner. This results in the accessibility events being 
>>> sent to JAWS in the order they are being changed. JAWS is able to 
>>> announce the value properly for JSlider and JSpinner.
>>>
>>> This can be tested by running any JColorchooser sample program (One 
>>> such sample program is attached in JBS). I have run full jtreg and 
>>> jck tests on mach5. The change is not breaking any test. Links in JBS.
>>>
>>> Regards
>>> Pankaj
>>>
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200816/337ed851/attachment.htm>


More information about the swing-dev mailing list