<AWT Dev> Better support for external Toolkits/GraphicEnvs

Roman Kennke roman.kennke at aicas.com
Wed Jun 20 06:36:45 PDT 2007


Hi there,

At the moment I'm trying to get GNU Classpath's GTK peers (and a handful
of own peer/graphicsenv implementations for embedded systems) working
with OpenJDK. I'm encountering a couple of problems and I ask myself if
the OpenJDK project has any interest in patches to improve support for
external toolkits.

For example, there's a bunch of places with code like this:

    private void initPeer() {
        if (Toolkit.getDefaultToolkit() instanceof HeadlessToolkit){
            peer =
((HeadlessToolkit)Toolkit.getDefaultToolkit()).createKeyboardFocusManagerPeer(this);
        }
        if (Toolkit.getDefaultToolkit() instanceof SunToolkit){        
            peer =
((SunToolkit)Toolkit.getDefaultToolkit()).createKeyboardFocusManagerPeer(this);                  
        }
    }

Obviously, this wouldn't work with anything except the built-in
toolkits.

Other areas where I suspect big problems are fonts and probably images.
It seems like OpenJDK has no support for a pluggable font implementation
at all. However, the GTK peers rely on their own implementation (which
is abstracted behind an extension of FontPeer).

With the new FB-Toolkit project approved, I'd guess that there would be
interest in developing a clean(er) interface and allowing alternative
peers and graphics environments to be plugged in, is that correct? If so
I would prepare some patches soon.

/Roman
-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt




More information about the awt-dev mailing list