[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.technology.albireo] Re: Advice on getting started?

Cklewis wrote:
I thought it would be best to ask a few questions before diving into my project of combining swt and swing.

First, thanks for that snippet you posted Gordon. I noticed you used
"EmbeddedSwingComposite" like an object. Currently it is an abstract class, do you recommend making it non abstract and just putting in the code I want for createSwingComponent() to suit my own program?

Actually the snippet creates an anonymous subclass of EmbeddedSwingComposite. The subclass implements only the createSwingComponent() method. That's basically how it was intended to be used.


...

Basically: NetCanvas(My file) extends PCanvas(Piccolo) PCanvas(Piccolo) extends JComponent (swing)

So as of now, I'm thinking:
1)Use a swt component to hold the JComponent (NetCanvas) in it
2)Bring your examples folder into my workspace to use as helper classes for EmbeddedSwingComposite.
3)Making the EmbeddedSwingComposite non abstract and putting my code into createSwingComponent()

1 and 2 sound fine for now. See advice above for creating a subclass of EmbeddedSwingComposite (in your own folder) instead of 3. Implement the createSwingComponent() method to create your NetCanvas.



Does that sound about right? Also I notice James submitted some suggestions, do I need to fix anything major to the sample code as of right now?

I would focus on getting the original code working in your project first. But you definitely should take a look at his suggestions, especially if you are noticing problems.


We are working on getting the project approved and moving it forward. If all goes well, there should be an updated CVS code repository available in the future. Until then, it's a bit of pain, sorry. (And, there are no guarantees that the programming interfaces will stay the same.)


Also I'm still a little unclear on the things I need to schedule individually for swing and swt. What type of general things need to be scheduled by me?

It completely depends on what you are doing. Basically, you just need to try to make your AWT/Swing API calls on the AWT event thread and SWT API calls on the SWT event thread.