<Swing Dev> [12] JDK-7124285: Nothing heard from VoiceOver regarding the status of the progress bar
shashidhara.veerabhadraiah at oracle.com
shashidhara.veerabhadraiah at oracle.com
Sun Nov 11 13:30:24 UTC 2018
Hi Sergey, As I said earlier, it is all about the focus traversal policy
that is used for traversal of the components. The progress bar component
applies a different focus traversal policy compared to labels and
buttons component types.
The progress bar goes via the DefaultFocusTraversalPolicy(.java)
compared to other components which goes via the
ContainerOrderFocusTraversalPolicy(.java). Please see how the
implementation of the accept() method is implemented in those classes.
And as I said earlier, all component's default state of focusability is
true always. So progress bar, labels and buttons all of them are
focusable. The only difference is which focus traversal policy is
applied for which component type.
Because of the focus traversal policy that is applied to the progress
bar, we are forced to explicitly call the setFocusable() to true(though
the focusability is already set to true) and is not required for other
components like the labels and buttons because they apply a different
policy. FOCUS_TRAVERSABLE_SET(of Component class) should be set in order
to use the focusability as a trversal key type when we do traversing.
And that is set only by calling setFocusable() to true explicitly for
that component.
This fix works for both windows and mac. Mac may have a short cut to
ignore such things but we still need to solve the problem for windows
and for mac(for TAB key traversal case). TAB key is consumed by java
swing for traversal purpose and hence TAB key traversal is assumed to
work for accessibility case as well and it does work for with this fix.
So why deny that?
Hope this answers your question. Accessibility is a new area to explore
here for everyone I think and am also learning along with these fixes.
So please let me know if you have any more questions.
Thanks and regards,
Shashi
On 10/11/18 9:12 AM, Sergey Bylokhov wrote:
> On 07/11/2018 23:18, Shashidhara Veerabhadraiah wrote:
>> From the usability perspective of a disabled person, I don't think
>> one would know use the Ctrl+option+shift kind of traversal and they
>> would definitely prefer to be same across the platforms. i.e., TAB
>> key traversals(just the important visible UI element traversals). So
>> considering that, the solution should at least work in the usability
>> scenarios across the platforms!!
>
> No, instead he will use shortcuts of the VO, which will read content
> of all important accessible elements, even if the real UI components
> are non-focusable/non-editable.
>
> Try this example:
> EventQueue.invokeAndWait(() -> {
> JFrame f = new JFrame();
> f.setSize(300,300);
> f.setLocationRelativeTo(null);
> f.setLayout(new FlowLayout());
> f.add(new JLabel("text 1"));
> f.add(new JLabel("text 2"));
> f.add(new JLabel("text 3"));
> f.add(new JLabel("text 4"));
> JButton comp = new JButton("text 4");
> comp.setEnabled(false);
> f.add(comp);
> f.setVisible(true);
> });
>
>
> How did you read the content of the labels and button using "tab"?
>
>
More information about the swing-dev
mailing list