[Blindmath] Using Java Draw2D in an SWT GUI

Carolyn MacLeod Carolyn_MacLeod at ca.ibm.com
Tue Jan 31 16:09:36 UTC 2012


Hello, list.

My name is Carolyn and I am on the Eclipse SWT Team.
I am the developer responsible for SWT Accessibility.

Ken Perry of Blinksoft asked me if I could help with an issue brought up 
by Richard Baldwin regarding SWT being accessible but largely incompatible 
with Swing/AWT.
I read several posts similar to this one: 
http://host.nfbnet.org/pipermail/blindmath_nfbnet.org/2012-January/004693.html

I wrote an SWT Snippet that I hope you will find useful: 
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet361.java
It shows how to host an AWT Canvas inside an SWT GUI, and use the GUI to 
initiate Java2D operations within the Canvas.
I randomly chose rotation and translation of the image, but you should be 
able to modify the snippet to do whatever Java2D operations you are 
teaching.
The "Print Image" button uses SWT to take a screen snapshot of the Canvas 
and print it to a printer.
I had not heard of a printer that embosses images before, and I think that 
is really cool!

I tried this snippet on Windows (XP) with JAWS (13) and on Mac OSX 
(Leopard) with VoiceOver, and on Linux (Ubuntu 10.04) with Orca and it 
worked on all 3 platforms.
It should work with other platform versions and screen readers as well.
The only glitch I encountered was on Windows, if the user tabs into the 
Canvas, they can't tab back out.
They need to use the button mnemonics to traverse out of the Canvas: alt+o 
for Open, alt+x and alt+y for translating X and Y, alt+r for Rotate, and 
alt+p for Print.
This was not an issue on Mac or Linux.

I cannot solve the deeper issues, like making SWT and AWT graphics 
interchangeable without performance penalties (there are technical 
issues),
or improving SWT's graphics support to the level of Java2D or more (we are 
a very small and very busy team, and we simply do not have the manpower).
Hopefully this snippet will give you a work-around that is both accessible 
and teaches the math you want to teach.

Carolyn


More information about the BlindMath mailing list