[brailleblaster] Re: Advice requested on accessibility for the blind

  • From: Chris von See <chris@xxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Sat, 27 Aug 2011 09:44:31 -0700

Hi Richard -

I got a chance to take a look at your code... I'm not totally sure I understand if your goal is to make the program accessible or just to perform some action when the user selects something from the list, but here are some thoughts:

-- If your goal is accessibility, take a look at the org.eclipse.swt.accessibility package. Many controls have a getAccessible() method that returns an Accessible object which allows you to do various accessibility-related things. Look at the Accessible object's methods and in particular the types of accessibility-related listeners you can add, which would allow you to (for example) change the description that is spoken for each list item or create the relation between the list and a descriptive label ("labelA") so that the label is spoken when the list gains focus. Take a look at the snippets for the package at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/accessibility/package-summary.html to get some examples.

-- Using List.addSelectionListener() is the way you would be notified of user list item selection. SWT should speak each item as the user traverses the list. You can modify what's spoken by setting listeners via List.getAccessible().

-- If I'm reading your code correctly, you're creating your list using the Shell as the parent, and then immediately creating a "page" Composite with the same Shell as parent. I didn't run your code, but I *think* this will overlay your List with the contents of the "page" Composite. Try creating a "base" Composite with the shell as parent, then set a layout on that "base", add your list with the "base" as parent and then add your "page" Composite as another child of that same "base". Depending on what layout manager you use the controls will appear in different relative positions; you might try RowLayout with SWT.VERTICAL so that the list appears above the "page".

-- When the list item is changed you don't need to dispose your "page" Composite - just set the label and foreground color (for the text) or background color (for the background of the "page").

-- Instead of allocating red, green and blue Color objects using new Color(r, g, b), try using the static Color.RED, Color.GREEN and Color.BLUE - these have the same red, green and blue color settings as what you created. You also won't need to dispose these static Color objects when your program exits.

Hope this helps. I'll try to answer any other questions you may have, but I'll be in and out this weekend so it may take me a while to get back to you.


Cheers
Chris



On Aug 26, 2011, at 5:32 PM, Richard Baldwin wrote:

John,

This is my second attempt to send this. The previous attempt was rejected because the zip file was too large. I had included the SWT library in it, which is what made it so large. Since you probably have that already, I deleted it from the zip file and am going to try again with a much smaller zip file.

Thanks,
Dick Baldwin

On Fri, Aug 26, 2011 at 7:23 PM, Richard Baldwin <baldwin@xxxxxxxxxxxxxxx > wrote:
Hi John,

I'm afraid that given my current lack of knowledge of SWT, I would be completely overwhelmed by the BrailleBlaster code.

However, I have attached a zip file containing a simple page switcher program using SWT. If you could take the time to import it into Eclipse (or however you program using SWT) and let me know if the structure that I am using could be successfully navigated by a blind person, or how I should modify it to achieve that goal, I would greatly appreciate it.

The GUI contains a list of three items. (I could make it a Combo or three radio buttons.) When the user selects one of the items in the list, a Composite object opens below the list. Right now, the Composite page simply contains a label, but eventually I intend for each new page to be a significant GUI in its own right.

By the way, I had to rename a couple of build.bat files to get the zip file past the GMail virus police.

Thanks,
Dick Baldwin


On Fri, Aug 26, 2011 at 6:45 PM, John J. Boyer <john.boyer@xxxxxxxxxxxxxxxxx > wrote:
Dick,

Accessibility with SWT is almost automatic. BrailleBlaster does not use
any particular accessibility features now, though it might use the
accessibility package in SWT later. In the Bfailloeblasterr menu,
BBMenu.java there is a listener for each item. The event is not sent
until the enter key is pressed on that item. There are SWT widgets for
handling lists. These will be used later, for example in handling the
list of recent documents.

If you have Mercurial you can get the source of BrailleBlaster from its
googlecode page. BBMenu.java is in org.brailleblaster.wordprocessor I
could also send you this class privately as an attachmennt, if you wish.

John

On Fri, Aug 26, 2011 at 06:03:09PM -0500, Richard Baldwin wrote:
> I know this is off topic for this list, but I also know that there are > several excellent SWT programmers that frequent this list who probably know
> the answer to my question.
>
> The objective is to make it possible for a blind user of an SWT GUI to > navigate through a list of items, such as might be found in a Combo, a List, > or perhaps a set of Radio buttons, and cause an event to be fired for one
> and only one of the items in the list when that item is chosen.
>
> It looks to me like using the following code to register a listener on each > item in the list causes each item to fire an event when the arrow keys are
> used to traverse the list:
>
> addSelectionListener(new SelectionAdapter()
>
> I guess what I am looking for is something like an ActionListener in the AWT > and Swing that can be fired by pressing the Return key after the arrow keys
> have been used to choose a specific item.
>
> I am finding that learning the SWT and trying to achieve accessibility for
> blind users at the same time is something of a challenge.
>
> If you prefer to contact me and have this discussion off list, that will be
> OK with me.
>
> Thanks,
> Dick Baldwin
>
> --
> Richard G. Baldwin (Dick Baldwin)
> Home of Baldwin's on-line Java Tutorials
> http://www.DickBaldwin.com
>
> Professor of Computer Information Technology
> Austin Community College
> (512) 223-4758
> mailto:Baldwin@xxxxxxxxxxxxxxx
> http://www.austincc.edu/baldwin/

--
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities





--
Richard G. Baldwin (Dick Baldwin)
Home of Baldwin's on-line Java Tutorials
http://www.DickBaldwin.com

Professor of Computer Information Technology
Austin Community College
(512) 223-4758
mailto:Baldwin@xxxxxxxxxxxxxxx
http://www.austincc.edu/baldwin/



--
Richard G. Baldwin (Dick Baldwin)
Home of Baldwin's on-line Java Tutorials
http://www.DickBaldwin.com

Professor of Computer Information Technology
Austin Community College
(512) 223-4758
mailto:Baldwin@xxxxxxxxxxxxxxx
http://www.austincc.edu/baldwin/
<PageSwitcher01.zip>

Other related posts: