[Blindmath] Converting java.awt.Graphics2D graphics to an SWT Display format

Steve Jacobson steve.jacobson at visi.com
Sat Dec 31 19:33:02 UTC 2011


Dick,

You are probably into Java more deeply than most of us are on this list.  Do you know about the Java Access list?  Someone there might have answers for you and 
you might be able to connect with some of the shakers and movers there as well.  It is a very low volume list.  The Mailto link to subscribe from message headers is

<mailto:sympa at java-mail-lists.kenai.com?subject=subscribe%20java-access>

and it also appears that sending a note to 

java-access-subscribe at java-mail-lists.kenai.com

might work.

What you have said in another note about SWT name conflicts illustrates the frustrations many of us have had with Java accessibility.  I can say from personal 
experience that SUN was aware of and started expending efforts toward making Java accessible well over a decade 
ago.  They had some very bright people involved in that effort, but in my opinion, there was little thought given to 
follow through.  Rather than using MSAA at the time, they opted to use a separate means to convey information to 
screen readers within Windows, that being the Windows Access Bridge.  Their reasoning was not wrong, they felt 
they could build a more robust interface than MSAA.  The problem was there was little insentive for screen readers to 
develop a separate interface to Java since there were no killer apps that could be used.  I know I was not alone in 
this, but in the late 90's I suggested that some investment be made to have Open Office and/or Star Office use the access bridge and be accessible.  My thought 
was that if there was an app that blind people really could use, there would be 
a reason for screen readers to spend the time on Windows Access Bridge.  I also felt, as did some others, that it would 
have been better to squeeze Java accessibility into MSAA for the short term because MSAA was already being 
supported by all screen readers.  Possibly using MSAA was not a reasonable alternative, I don't really know, all I know 
is that here we are over a decade later and there is still a good deal of struggling to make Java apps accessible.  
While the Windows Access Bridges seems to work in some cases, SWT seems to be the most solid approach to 
accessibility even if it is not necessarily the best approach to Java programming in general.  To hear of the conflicts 
that you describe in your note just adds to the frustration that we all feel that the work done to make Java accessible 
has not yielded more solid results considering the time that has elapsed.  

Best regards,

Steve Jacobson

On Sat, 31 Dec 2011 10:47:42 -0600, Richard Baldwin wrote:

>Thousands of programs and several complete libraries have been published
>that use Sun's java.awt.Graphics2D class for the creation of graphic
>information. I am personally responsible for publishing a few hundred of
>those programs myself.

>For reasons of accessibility, I am now programming using the SWT. I am
>searching for a relatively painless way to convert programs that have been
>developed using Sun's java.awt.Graphics2D class to a display format that
>can be used with SWT.

>ALTERNATIVE #1
>On the Sun Java side, I can create an off-screen image of type
>java.awt.Image and use any of the methods of the class named
>java.awt.Graphics2D to draw or otherwise deposit pictures onto the Image
>object. Normally then, I would call the drawImage method of the Graphics2D
>class in an overridden paint method to draw that image onto a
>java.awt.Canvas object for display in a java.awt.Frame or
>javax.swing.JFrame object.

>On the SWT Java side, apparently if I have an
>org.eclipse.swt.graphics.Image object, I can call the drawImage method of
>the GC class to display that image in a manner that is acceptable to SWT
>with no requirement for a java.awt.Frame object or a javax.swing.JFrame
>object.

>Question: How can I transfer the image from a java.awt.Image object to an
>org.eclipse.swt.graphics.Image object? A single method that receives
>references to one object of each type and makes the transfer would be very
>useful.

>OTHER ALTERNATIVES
>Question: Other than using code such as the following, does anyone know of
>a relatively painless way to convert programs that have been developed
>using Sun's Graphics2D class to a display format that can be used with SWT.

>    Composite comp =  new Composite(drawingShell,SWT.EMBEDDED);
>    java.awt.Frame frame = SWT_AWT.new_Frame(comp);

>In other words, how can I take advantage of Sun's Graphics2D API without
>including a java.awt.Frame object in my SWT program?

>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 at DickBaldwin.com
>http://www.austincc.edu/baldwin/
>_______________________________________________
>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/steve.jacobson%40visi.com








More information about the BlindMath mailing list