Implement java.awt.Toolkit with SWT? [message #370858] |
Thu, 12 June 2003 10:07  |
Eclipse User |
|
|
|
Originally posted by: ted.stockwell.acxiom.com
Hi,
I just recently learned that I can replace a JVM's AWT implementation at
runtime by setting the "awt.toolkit" system property to a class that
implements java.awt.Toolkit.
Suddenly I can see how decent integration between SWT, AWT, and Swing can be
acheived: by creating an implementation of java.awt.Toolkit using SWT.
Once AWT and Swing are running on top of SWT then it would be fairly easy
and straight-forward to created a subclass of the SWT Composite class to
which AWT Components could be added and to create a subclass of the AWT
Container class to which SWT Controls could be added. Such a Toolkit would
be usable with any JVM on any platform for which there is an SWT
implementation.
I am seriously considering creating such a Toolkit. However, I'm wondering
if the SWT team has ever considered such an approach. And, if so, if there
are any pitfalls that I am not seeing yet.
Thanks,
ted stockwell
jlense.sf.net
|
|
|
Re: Implement java.awt.Toolkit with SWT? [message #370897 is a reply to message #370858] |
Fri, 13 June 2003 04:02  |
Eclipse User |
|
|
|
Originally posted by: ivanm.wizcom.bg
I'm not from OTI but nevertheless..
You'll have to reimplement the whole Java2D as well.
Or alternatively, you'll have to reuse the Java2D implementation from J2SE.
If you go for the second option, you'll have to find a way to create
Graphics2D objects from HWND handle (because you need to draw on SWT
controls with Graphics2D, as they will be your AWT peers). AFAIK, since J2SE
1.4 this is not so trivial.
"ted stockwell" <ted.stockwell@acxiom.com> wrote in message
news:bca1e6$387$1@rogue.oti.com...
> Hi,
>
> I just recently learned that I can replace a JVM's AWT implementation at
> runtime by setting the "awt.toolkit" system property to a class that
> implements java.awt.Toolkit.
>
> Suddenly I can see how decent integration between SWT, AWT, and Swing can
be
> acheived: by creating an implementation of java.awt.Toolkit using SWT.
> Once AWT and Swing are running on top of SWT then it would be fairly easy
> and straight-forward to created a subclass of the SWT Composite class to
> which AWT Components could be added and to create a subclass of the AWT
> Container class to which SWT Controls could be added. Such a Toolkit
would
> be usable with any JVM on any platform for which there is an SWT
> implementation.
>
> I am seriously considering creating such a Toolkit. However, I'm
wondering
> if the SWT team has ever considered such an approach. And, if so, if there
> are any pitfalls that I am not seeing yet.
>
> Thanks,
>
> ted stockwell
> jlense.sf.net
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.08699 seconds