<AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

<AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
Create implementation of NSAccessibilitySlider protocol https://developer.apple.com/documentation/appkit/nsaccessibilityslider

The implementation has the function performIncrement and performDecrement to increase/decrease the value of slider using the VoiceOver. To implement this functionality, I could think of  following two ways. I have chosen the first one here though it is more intrusive.
1. Make the AccessibleJSlider class implement the AccessibleAction interface. This makes AccessibleJSlider consistent with the AccessibleJSpinner class. It is more clear and the logic to increase/decrease Slider value can be changed easily. But this changes AccessibleJSlider class and will need a CSR.
2. Get the current Accessible Value from the component and  just increment/decrement it in SliderAccessibility.m  class itself and then set the current accessible value fro there only. This will not need any changes in AccessibleJSlider class, but this does not look correct way and I have not used this.

The changes can be easily tested by using a JSlider example, like the following example. VO should announce the correct the slider values. To change the slider values, use ctrl+opt+shift+down key to start interacting with the slider, then use ctrl+opt+up/down arrow keys to increment/decrement slider values.

      import javax.swing.JFrame;
      import javax.swing.JSlider;
     
      public class JSliderDemo{
          public static void main(String[] args) throws Exception {
              JFrame jframe = new JFrame("JSlider Demo");
              jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jframe.add(new JSlider());
     
              jframe.setLocationRelativeTo(null);
              jframe.pack();
              jframe.setVisible(true);
          }
      }

-------------

Commit messages:
 - Remove whitespaces
 - remove SpinboxAccessibility.m changes
 - Code cleanup
 - cleanup
 - 8262981: Create implementation for NSAccessibilitySlider protocol

Changes: https://git.openjdk.java.net/jdk/pull/2874/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2874&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262981
  Stats: 74 lines in 4 files changed: 68 ins; 1 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2874.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2874/head:pull/2874

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Alexander Zuev-3
On Mon, 8 Mar 2021 12:51:56 GMT, Pankaj Bansal <[hidden email]> wrote:

> Create implementation of NSAccessibilitySlider protocol https://developer.apple.com/documentation/appkit/nsaccessibilityslider
>
> The implementation has the function performIncrement and performDecrement to increase/decrease the value of slider using the VoiceOver. To implement this functionality, I could think of  following two ways. I have chosen the first one here though it is more intrusive.
> 1. Make the AccessibleJSlider class implement the AccessibleAction interface. This makes AccessibleJSlider consistent with the AccessibleJSpinner class. It is more clear and the logic to increase/decrease Slider value can be changed easily. But this changes AccessibleJSlider class and will need a CSR.
> 2. Get the current Accessible Value from the component and  just increment/decrement it in SliderAccessibility.m  class itself and then set the current accessible value fro there only. This will not need any changes in AccessibleJSlider class, but this does not look correct way and I have not used this.
>
> The changes can be easily tested by using a JSlider example, like the following example. VO should announce the correct the slider values. To change the slider values, use ctrl+opt+shift+down key to start interacting with the slider, then use ctrl+opt+up/down arrow keys to increment/decrement slider values.
>
>       import javax.swing.JFrame;
>       import javax.swing.JSlider;
>      
>       public class JSliderDemo{
>           public static void main(String[] args) throws Exception {
>               JFrame jframe = new JFrame("JSlider Demo");
>               jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>               jframe.add(new JSlider());
>      
>               jframe.setLocationRelativeTo(null);
>               jframe.pack();
>               jframe.setVisible(true);
>           }
>       }

src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m line 59:

> 57:     [rolesMap setObject:@"RadiobuttonAccessibility" forKey:@"radiobutton"];
> 58:     [rolesMap setObject:@"CheckboxAccessibility" forKey:@"checkbox"];
> 59:     [rolesMap setObject:@"SliderAccessibility" forKey:@"slider"];

Shouldn't you also increase the rolesMap initial capacity?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Sergey Bylokhov-2
In reply to this post by Pankaj Bansal-2
On Mon, 8 Mar 2021 12:51:56 GMT, Pankaj Bansal <[hidden email]> wrote:

> Create implementation of NSAccessibilitySlider protocol https://developer.apple.com/documentation/appkit/nsaccessibilityslider
>
> The implementation has the function performIncrement and performDecrement to increase/decrease the value of slider using the VoiceOver. To implement this functionality, I could think of  following two ways. I have chosen the first one here though it is more intrusive.
> 1. Make the AccessibleJSlider class implement the AccessibleAction interface. This makes AccessibleJSlider consistent with the AccessibleJSpinner class. It is more clear and the logic to increase/decrease Slider value can be changed easily. But this changes AccessibleJSlider class and will need a CSR.
> 2. Get the current Accessible Value from the component and  just increment/decrement it in SliderAccessibility.m  class itself and then set the current accessible value fro there only. This will not need any changes in AccessibleJSlider class, but this does not look correct way and I have not used this.
>
> The changes can be easily tested by using a JSlider example, like the following example. VO should announce the correct the slider values. To change the slider values, use ctrl+opt+shift+down key to start interacting with the slider, then use ctrl+opt+up/down arrow keys to increment/decrement slider values.
>
>       import javax.swing.JFrame;
>       import javax.swing.JSlider;
>      
>       public class JSliderDemo{
>           public static void main(String[] args) throws Exception {
>               JFrame jframe = new JFrame("JSlider Demo");
>               jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>               jframe.add(new JSlider());
>      
>               jframe.setLocationRelativeTo(null);
>               jframe.pack();
>               jframe.setVisible(true);
>           }
>       }

If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Alexander Zuev-3
On Wed, 10 Mar 2021 01:00:33 GMT, Sergey Bylokhov <[hidden email]> wrote:

> If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work?

Haven't tested this functionality on Windows, on macOS with current JDK it does not work at all. After entering the JSlider interaction mode VoiceOver does not announce the a11y shortcuts and the attempt to invoke said shortcuts do nothing.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
On Wed, 10 Mar 2021 13:32:01 GMT, Alexander Zuev <[hidden email]> wrote:

> If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
In reply to this post by Alexander Zuev-3
On Wed, 10 Mar 2021 13:32:01 GMT, Alexander Zuev <[hidden email]> wrote:

> > If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work?
>
> Haven't tested this functionality on Windows, on macOS with current JDK it does not work at all. After entering the JSlider interaction mode VoiceOver does not announce the a11y shortcuts and the attempt to invoke said shortcuts do nothing.

Yes, as Alex pointed out, it does not work on MacOS. The VO only announces the value and user can not modify the slider values using VO shortcut keys.

I saw the windows code and I did not see anything where the current value of a component is being set. I tested this by running JAWS as well. When a JSlider is in focus, JAWS announces the slider values and then says "To increase or decrease, use the arrow keys". The keys are being handled by JAVA only and JAWS is not doing any part in it. To verify this, I commented the code to handle keys events in Java and slider value does not change. So looks like this does not work on Windows as well.

If these changes are too intrusive, I can go with the second approach of getting and setting the current values of slider in performincrement/performdecrement functions in SliderAccessibility.m. I am not sure if this will be correct approach, but it will be less intrusive and will not need a CSR.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
In reply to this post by Alexander Zuev-3
On Tue, 9 Mar 2021 21:27:39 GMT, Alexander Zuev <[hidden email]> wrote:

> Shouldn't you also increase the rolesMap initial capacity?

ok, I will do that in next commit.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Sergey Bylokhov-2
In reply to this post by Pankaj Bansal-2
On Wed, 10 Mar 2021 14:47:02 GMT, Pankaj Bansal <[hidden email]> wrote:

>>> If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work?
>>
>> Haven't tested this functionality on Windows, on macOS with current JDK it does not work at all. After entering the JSlider interaction mode VoiceOver does not announce the a11y shortcuts and the attempt to invoke said shortcuts do nothing.
>
>> > If you need a new functionality and CSR I wonder how it currently works on Windows and macOS, or it does not work?
>>
>> Haven't tested this functionality on Windows, on macOS with current JDK it does not work at all. After entering the JSlider interaction mode VoiceOver does not announce the a11y shortcuts and the attempt to invoke said shortcuts do nothing.
>
> Yes, as Alex pointed out, it does not work on MacOS. The VO only announces the value and user can not modify the slider values using VO shortcut keys.
>
> I saw the windows code and I did not see anything where the current value of a component is being set. I tested this by running JAWS as well. When a JSlider is in focus, JAWS announces the slider values and then says "To increase or decrease, use the arrow keys". The keys are being handled by JAVA only and JAWS is not doing any part in it. To verify this, I commented the code to handle keys events in Java and slider value does not change. So looks like this does not work on Windows as well.
>
> If these changes are too intrusive, I can go with the second approach of getting and setting the current values of slider in performincrement/performdecrement functions in SliderAccessibility.m. I am not sure if this will be correct approach, but it will be less intrusive and will not need a CSR.

If it does not work on Windows then I suggest checking that the new functionality requested via CSR will help it as well.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Alexander Zuev-3
In reply to this post by Pankaj Bansal-2
On Wed, 10 Mar 2021 14:47:02 GMT, Pankaj Bansal <[hidden email]> wrote:

> If these changes are too intrusive, I can go with the second approach of getting and setting the current values of slider in performincrement/performdecrement functions in SliderAccessibility.m. I am not sure if this will be correct approach, but it will be less intrusive and will not need a CSR.

I would suggest to fix it properly by filing CSR for the functional change. The idea of new implementation is not only to make it compatible with the new Apple API, but also to make it cleaner, more consistent and easier to support in the future.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
In reply to this post by Sergey Bylokhov-2
On Wed, 10 Mar 2021 23:09:31 GMT, Sergey Bylokhov <[hidden email]> wrote:

> If it does not work on Windows then I suggest checking that the new functionality requested via CSR will help it as well.

I could not find any key shortcuts where JAWS will consume the key pressed and will be used to interact with the component like the VO is doing here. This similar functionality is present in JSpinner already and JAWS says similar thing when a Spinner is in focus "To set the value, press the arrow keys or type the value". When user presses the keys, it is consumed by Java and value is incremented/decremented as expected. But the value is not being set by JAWS like VO if used with VO keys. So I am not sure how to verify if the changes will be useful for windows as well. I think if there is a way user can interact with Spinner or Slider, then these changes should be useful and if it is not possible, it will not be useful in both. These changes does make the Slider more consistent with Spinner and easy to maintain and cleaner.
If you happen to have some idea about how can a user interact with Sliders or Spinners using JAWS, please let me know. I will definitely verify if the changes would be helpful for Windows.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Sergey Bylokhov-2
On Thu, 11 Mar 2021 17:10:01 GMT, Pankaj Bansal <[hidden email]> wrote:

> If you happen to have some idea about how can a user interact with Sliders or Spinners using JAWS, please let me know. I will definitely verify if the changes would be helpful for Windows.

How the native applications works under JAWS?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
On Fri, 12 Mar 2021 03:26:10 GMT, Sergey Bylokhov <[hidden email]> wrote:

> > If you happen to have some idea about how can a user interact with Sliders or Spinners using JAWS, please let me know. I will definitely verify if the changes would be helpful for Windows.
>
> How the native applications works under JAWS?

I tried running a Windows native settings app like "Display Settings" with JAWS. It has a Slider "Brightness". JAWS says same thing when the Slider was brought in focus like "To increase or decrease, use the arrow keys". When I press the arrow keys, the values change. But I don't know if the value changed because the Windows Native dialog handles the keys and changed the value, or JAWS consumed the event and then changed the value. It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO.  I am not sure how I can verify this on Windows native apps.
I did try to run the JSpinner with JAWS and I see that if Java does not handle the keys, the value in Spinner does not change. This means JAWS does not interact with the component and the accessibility functionality was added for MacOS only. Same thing is being done for JSlider.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol [v2]

Pankaj Bansal-2
In reply to this post by Pankaj Bansal-2
> Create implementation of NSAccessibilitySlider protocol https://developer.apple.com/documentation/appkit/nsaccessibilityslider
>
> The implementation has the function performIncrement and performDecrement to increase/decrease the value of slider using the VoiceOver. To implement this functionality, I could think of  following two ways. I have chosen the first one here though it is more intrusive.
> 1. Make the AccessibleJSlider class implement the AccessibleAction interface. This makes AccessibleJSlider consistent with the AccessibleJSpinner class. It is more clear and the logic to increase/decrease Slider value can be changed easily. But this changes AccessibleJSlider class and will need a CSR.
> 2. Get the current Accessible Value from the component and  just increment/decrement it in SliderAccessibility.m  class itself and then set the current accessible value fro there only. This will not need any changes in AccessibleJSlider class, but this does not look correct way and I have not used this.
>
> The changes can be easily tested by using a JSlider example, like the following example. VO should announce the correct the slider values. To change the slider values, use ctrl+opt+shift+down key to start interacting with the slider, then use ctrl+opt+up/down arrow keys to increment/decrement slider values.
>
>       import javax.swing.JFrame;
>       import javax.swing.JSlider;
>      
>       public class JSliderDemo{
>           public static void main(String[] args) throws Exception {
>               JFrame jframe = new JFrame("JSlider Demo");
>               jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>               jframe.add(new JSlider());
>      
>               jframe.setLocationRelativeTo(null);
>               jframe.pack();
>               jframe.setVisible(true);
>           }
>       }

Pankaj Bansal has updated the pull request incrementally with one additional commit since the last revision:

  increase initial capacity for rolesMap

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2874/files
  - new: https://git.openjdk.java.net/jdk/pull/2874/files/dac91ff1..a1944fee

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2874&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2874&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2874.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2874/head:pull/2874

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol [v2]

Pankaj Bansal-2
In reply to this post by Pankaj Bansal-2
On Wed, 10 Mar 2021 14:47:38 GMT, Pankaj Bansal <[hidden email]> wrote:

>> src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/CommonComponentAccessibility.m line 59:
>>
>>> 57:     [rolesMap setObject:@"RadiobuttonAccessibility" forKey:@"radiobutton"];
>>> 58:     [rolesMap setObject:@"CheckboxAccessibility" forKey:@"checkbox"];
>>> 59:     [rolesMap setObject:@"SliderAccessibility" forKey:@"slider"];
>>
>> Shouldn't you also increase the rolesMap initial capacity?
>
>> Shouldn't you also increase the rolesMap initial capacity?
>
> ok, I will do that in next commit.

Done

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Sergey Bylokhov-2
In reply to this post by Pankaj Bansal-2
On Sun, 14 Mar 2021 11:10:09 GMT, Pankaj Bansal <[hidden email]> wrote:

> It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO

Did you check this list of hotkeys?
https://www.freedomscientific.com/training/jaws/hotkeys
https://freedomscientific.github.io/VFO-standards-support/aria.html
Something like:
    RIGHT ARROW and UP ARROW increase the value of the slider.
    LEFT ARROW and DOWN ARROW decrease the value of the slider.
    HOME and END move to the minimum and maximum values of the slider.
    PAGE UP and PAGE DOWN increment or decrement the slider by a given amount.

=======================
My main point is that if we will change some shared code we should care about both supported platforms.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
On Wed, 17 Mar 2021 01:48:40 GMT, Sergey Bylokhov <[hidden email]> wrote:

> > It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO
>
> Did you check this list of hotkeys?
> https://www.freedomscientific.com/training/jaws/hotkeys
> https://freedomscientific.github.io/VFO-standards-support/aria.html
> Something like:
> RIGHT ARROW and UP ARROW increase the value of the slider.
> LEFT ARROW and DOWN ARROW decrease the value of the slider.
> HOME and END move to the minimum and maximum values of the slider.
> PAGE UP and PAGE DOWN increment or decrement the slider by a given amount.
>
> =======================
> My main point is that if we will change some shared code we should care about both supported platforms.

I tried the hot keys with the both native dialog ("Display Settings" with a "Brightness" Slider ) and java applications.
Both Java and native dialog  are themselves handling the RIGHT ARROW, UP ARROW, LEFT ARROW, DOWN ARROW, HOME and END buttons for JSlider and user can change slider value using these keys without JAWS also. but they are not handling the PAGE UP and PAGE DOWN button.
PAGE UP and PAGE DOWN button don't work with JAWS either, meaning JAWS is not able to handle the keys and is not able to change component values for both native dialogs and Java application. Also, I am not able to find any component in Swing, where JAWS can change the component values using any hot key. Please correct me if I am wrong in this and JAWS can actually manipulate some component. Also, in the old implementation for MacOS , the VO can not change the Spinner/Slider values and we are adding this functionality now only.
In addition to this, the functionality we are adding in slider can be used with JAWS also if we decide to provide the support for the same later. Currently, I do not see JAWS being able to change any component value in swing, so it will not be able to change Slider value too.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Sergey Bylokhov-2
On Tue, 30 Mar 2021 09:46:45 GMT, Pankaj Bansal <[hidden email]> wrote:

>>> It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO
>>
>> Did you check this list of hotkeys?
>> https://www.freedomscientific.com/training/jaws/hotkeys
>> https://freedomscientific.github.io/VFO-standards-support/aria.html
>> Something like:
>>     RIGHT ARROW and UP ARROW increase the value of the slider.
>>     LEFT ARROW and DOWN ARROW decrease the value of the slider.
>>     HOME and END move to the minimum and maximum values of the slider.
>>     PAGE UP and PAGE DOWN increment or decrement the slider by a given amount.
>>
>> =======================
>> My main point is that if we will change some shared code we should care about both supported platforms.
>
>> > It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO
>>
>> Did you check this list of hotkeys?
>> https://www.freedomscientific.com/training/jaws/hotkeys
>> https://freedomscientific.github.io/VFO-standards-support/aria.html
>> Something like:
>> RIGHT ARROW and UP ARROW increase the value of the slider.
>> LEFT ARROW and DOWN ARROW decrease the value of the slider.
>> HOME and END move to the minimum and maximum values of the slider.
>> PAGE UP and PAGE DOWN increment or decrement the slider by a given amount.
>>
>> =======================
>> My main point is that if we will change some shared code we should care about both supported platforms.
>
> I tried the hot keys with the both native dialog ("Display Settings" with a "Brightness" Slider ) and java applications.
> Both Java and native dialog  are themselves handling the RIGHT ARROW, UP ARROW, LEFT ARROW, DOWN ARROW, HOME and END buttons for JSlider and user can change slider value using these keys without JAWS also. but they are not handling the PAGE UP and PAGE DOWN button.
> PAGE UP and PAGE DOWN button don't work with JAWS either, meaning JAWS is not able to handle the keys and is not able to change component values for both native dialogs and Java application. Also, I am not able to find any component in Swing, where JAWS can change the component values using any hot key. Please correct me if I am wrong in this and JAWS can actually manipulate some component. Also, in the old implementation for MacOS , the VO can not change the Spinner/Slider values and we are adding this functionality now only.
> In addition to this, the functionality we are adding in slider can be used with JAWS also if we decide to provide the support for the same later. Currently, I do not see JAWS being able to change any component value in swing, so it will not be able to change Slider value too.

Ok, please file a similar bug for the windows platform.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol [v3]

Pankaj Bansal-2
In reply to this post by Pankaj Bansal-2
> Create implementation of NSAccessibilitySlider protocol https://developer.apple.com/documentation/appkit/nsaccessibilityslider
>
> The implementation has the function performIncrement and performDecrement to increase/decrease the value of slider using the VoiceOver. To implement this functionality, I could think of  following two ways. I have chosen the first one here though it is more intrusive.
> 1. Make the AccessibleJSlider class implement the AccessibleAction interface. This makes AccessibleJSlider consistent with the AccessibleJSpinner class. It is more clear and the logic to increase/decrease Slider value can be changed easily. But this changes AccessibleJSlider class and will need a CSR.
> 2. Get the current Accessible Value from the component and  just increment/decrement it in SliderAccessibility.m  class itself and then set the current accessible value fro there only. This will not need any changes in AccessibleJSlider class, but this does not look correct way and I have not used this.
>
> The changes can be easily tested by using a JSlider example, like the following example. VO should announce the correct the slider values. To change the slider values, use ctrl+opt+shift+down key to start interacting with the slider, then use ctrl+opt+up/down arrow keys to increment/decrement slider values.
>
>       import javax.swing.JFrame;
>       import javax.swing.JSlider;
>      
>       public class JSliderDemo{
>           public static void main(String[] args) throws Exception {
>               JFrame jframe = new JFrame("JSlider Demo");
>               jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>               jframe.add(new JSlider());
>      
>               jframe.setLocationRelativeTo(null);
>               jframe.pack();
>               jframe.setVisible(true);
>           }
>       }

Pankaj Bansal has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:

 - Merge branch 'master' into JDK-8262981
 - increase initial capacity for rolesMap
 - Remove whitespaces
 - remove SpinboxAccessibility.m changes
 - Code cleanup
 - cleanup
 - 8262981: Create implementation for NSAccessibilitySlider protocol

-------------

Changes: https://git.openjdk.java.net/jdk/pull/2874/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2874&range=02
  Stats: 75 lines in 4 files changed: 68 ins; 1 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2874.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2874/head:pull/2874

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
In reply to this post by Sergey Bylokhov-2
On Wed, 31 Mar 2021 19:56:24 GMT, Sergey Bylokhov <[hidden email]> wrote:

> Ok, please file a similar bug for the windows platform.

I have created the bug for windows here https://bugs.openjdk.java.net/browse/JDK-8264598.
I have also created the CSR for the current issue.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
Reply | Threaded
Open this post in threaded view
|

Re: <AWT Dev> RFR: 8262981: Create implementation for NSAccessibilitySlider protocol

Pankaj Bansal-2
In reply to this post by Sergey Bylokhov-2
On Wed, 31 Mar 2021 19:56:24 GMT, Sergey Bylokhov <[hidden email]> wrote:

>>> > It looks like the Dialog must have handled the keys as there are no special keys mentioned for JAWS to interact with the component like the VO
>>>
>>> Did you check this list of hotkeys?
>>> https://www.freedomscientific.com/training/jaws/hotkeys
>>> https://freedomscientific.github.io/VFO-standards-support/aria.html
>>> Something like:
>>> RIGHT ARROW and UP ARROW increase the value of the slider.
>>> LEFT ARROW and DOWN ARROW decrease the value of the slider.
>>> HOME and END move to the minimum and maximum values of the slider.
>>> PAGE UP and PAGE DOWN increment or decrement the slider by a given amount.
>>>
>>> =======================
>>> My main point is that if we will change some shared code we should care about both supported platforms.
>>
>> I tried the hot keys with the both native dialog ("Display Settings" with a "Brightness" Slider ) and java applications.
>> Both Java and native dialog  are themselves handling the RIGHT ARROW, UP ARROW, LEFT ARROW, DOWN ARROW, HOME and END buttons for JSlider and user can change slider value using these keys without JAWS also. but they are not handling the PAGE UP and PAGE DOWN button.
>> PAGE UP and PAGE DOWN button don't work with JAWS either, meaning JAWS is not able to handle the keys and is not able to change component values for both native dialogs and Java application. Also, I am not able to find any component in Swing, where JAWS can change the component values using any hot key. Please correct me if I am wrong in this and JAWS can actually manipulate some component. Also, in the old implementation for MacOS , the VO can not change the Spinner/Slider values and we are adding this functionality now only.
>> In addition to this, the functionality we are adding in slider can be used with JAWS also if we decide to provide the support for the same later. Currently, I do not see JAWS being able to change any component value in swing, so it will not be able to change Slider value too.
>
> Ok, please file a similar bug for the windows platform.

@mrserb @azuev-java Any other comments on this? Can you please look at the CSR also?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2874
12