AWT/Java2d-Pipeline interaction design question...

Hi again,

I’ve been fascenated since a long time about the fact how flexible the Java2d-API works.

1.) Its possible to create Swing-containers which are fully accerlated and you can still add native AWT widgets to it.
No magic when using motif also for the swing-conainers, but whats going on when the OGL pipeline is enabled, its still possible when using the MToolkit to add Motif-Widgets to an OGL accerlated window, same for the d3d-pipelines. WoW!
I’ve always asked myself how this is archived? Is the motif-button really added to the OGL window or does java create a seperate window over the OGL context?

2.) The same for AWT: You can create a completly AWT based application, if you add some lightweight components you get accerlation withought any problems.
Same here, is there for any lightweight widget in an heavyweight enviroment (e.g. Frame->Panel->JPanel->Panel->JComponent) a seperate accerlated context.

It would really make me happy to know how the whole magic is done, from time to time I can’t take my head away from such thoughts :wink:

lg Clemens

Is this really so hard to answer for “our” java2d-gurus?
Since the code is open anyway I do not see any problems with confidelity or stuff like that…

would be soo great to know!

lg Clemens

Your question is too broad to answer, and is not really clearly formulated…

Since as you mentioned the code is opened, why not look yourself?

the only thing I want to know is how the mix&match of native AWT controls and accerlated lightweight areas is done.

I already looked at the code, but I can’t find the clue…

lg Clemens

I’m sorry, I don’t understand what you mean under “lightweight accelerated areas”.

If you mean how lightweight and heavyweight component play together, the answer (so far) is not too well.

If you put a canvas (heavyweight) into a swing container, they won’t work together well.

[quote]I’m sorry, I don’t understand what you mean under “lightweight accelerated areas”.

If you mean how lightweight and heavyweight component play together, the answer (so far) is not too well.

If you put a canvas (heavyweight) into a swing container, they won’t work together well.
[/quote]
How so? I’ve been doing that for a while as of late. Never had any problems with it.

Of course I understand that there are some limitations e.g. heavyweight is always heavier than lightweight and therefore is always visible.

What I ment how it is done that e.g. you can add an AWT-Button (lets say win32 or motif) to an accerlated OGL-JFrame.
As far as I know its just not possible to add a Motif/Win32 widgets to an OGL-window - so how is this done?

lg Clemens

[quote] How so? I’ve been doing that for a while as of late. Never had any problems with it.
[/quote]
Have you tried to show a lightweight Swing menu over the heavyweight component?
What happens is that since the heavyweight component (for example, a motif control) doesn’t know about lightweight ones (the reason they’re lightweight is that they don’t have any native representation in the underlying toolkit), so it doesn’t clip its rendering appropriately.

Not to mention that swing components are double-buffered, and heavyweight ones typically aren’t…

Well … Put a big AWT Panel in a JScrollPane and you’ll see for yourself.

well those problems are documented well, and can be considered as a general rule - heavyweight draws over lightweight ALL the time. I even saw software relying on this “feature” for displaying tooltips over a lightweight widget…

But how does it work at all that Java can add a win32-button to an OGL accerlated window…

lg Clemens