[Blindmath] Using Java Draw2D in an SWT GUI

Richard Baldwin baldwin at dickbaldwin.com
Tue Jan 31 18:01:14 UTC 2012


Thanks for responding to my concerns. I will definitely take a look at your
workabound and see how much it helps. Hopefully, I will be pleased with the
results.

I suspect, however, that simply providing compatibility at the AWT Canvas
level won't help much with my main concern. I already knew of one way to do
that. I also already knew how to embed AWT Frame objects in an SWT object.
Unfortunately, I don't know how to easily integrate events fired by those
AWT components into the SWT event handling system and I don't know how to
embed Swing JFrame objects and/or their events in SWT objects.

I know how to write new code that will play reasonably well with SWT. That
isn't my main concern. I really do believe in the OOP concept of "reuse,
don't reinvent," and my main concern is the lack of compatibility of SWT
with existing unmodified graphics libraries, which typically produce
graphic outputs in Swing JFrame objects. Until we can successfully embed
JFrame objects in SWT objects, and until we can easily integrate the event
handling mechanisms of the two systems, the use of those libraries without
modification of the libraries will probably be very difficult at best and
off limits at worst.

Hopefully someone will prove me wrong on this.

Dick Baldwin

On Tue, Jan 31, 2012 at 11:03 AM, Carolyn MacLeod <
Carolyn_MacLeod at ca.ibm.com> wrote:

> Thank-you, Michael!
> Carolyn
>
>
>
> From:
> "Michael Whapples" <mwhapples at aim.com>
> To:
> "Blind Math list for those interested in mathematics"
> <blindmath at nfbnet.org>
> Date:
> 31/01/2012 11:30 AM
> Subject:
> Re: [Blindmath] Using Java Draw2D in an SWT GUI
> Sent by:
> blindmath-bounces at nfbnet.org
>
>
>
> Hello,
> Thanks for taking the time to do this. I know you have asked questions on
> the orca-list about improving accessibility in SWT and eclipse and its
> certainly appreciated. In my oppinion SWT is one of the few, if not the
> best, GUI toolkits for making accessible applications which are also
> cross-platform.
>
> Regards
>
> Michael whapples
>
> -----Original Message-----
> From: Carolyn MacLeod
> Sent: Tuesday, January 31, 2012 4:09 PM
> To: blindmath at nfbnet.org
> Subject: [Blindmath] Using Java Draw2D in an SWT GUI
>
> 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
> _______________________________________________
> Blindmath mailing list
> Blindmath at nfbnet.org
> http://nfbnet.org/mailman/listinfo/blindmath_nfbnet.org
> To unsubscribe, change your list options or get your account info for
> Blindmath:
> http://nfbnet.org/mailman/options/blindmath_nfbnet.org/mwhapples%40aim.com
>
>
>
> _______________________________________________
> Blindmath mailing list
> Blindmath at nfbnet.org
> http://nfbnet.org/mailman/listinfo/blindmath_nfbnet.org
> To unsubscribe, change your list options or get your account info for
> Blindmath:
>
> http://nfbnet.org/mailman/options/blindmath_nfbnet.org/carolyn_macleod%40ca.ibm.com
>
>
>
>
> _______________________________________________
> Blindmath mailing list
> Blindmath at nfbnet.org
> http://nfbnet.org/mailman/listinfo/blindmath_nfbnet.org
> To unsubscribe, change your list options or get your account info for
> Blindmath:
>
> http://nfbnet.org/mailman/options/blindmath_nfbnet.org/baldwin%40dickbaldwin.com
>



-- 
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 at DickBaldwin.com
http://www.austincc.edu/baldwin/



More information about the BlindMath mailing list