Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Native SWT drawing on Canvas with LWS
Native SWT drawing on Canvas with LWS [message #247666] Mon, 09 March 2009 13:25 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Hi there,

I have a GMF FigureCanvas, which is a Canvas populated by a
LightweightSystem with Figures.

For debugging purposes I want to draw native SWT drawings on top of the
LWS, i.e. simple lines, etc.

I added a paint listener to the canvas and draw on the GC that I get
from the PaintEvent.

However, the Figures from the LWS are drawn correctly, while my own
manual drawings are messed up. Only very small parts are shown and it
looks like the LWS Figures have priority and replace my own drawings.

Is there any reason for this? Any way to draw onto the canvas next to
the LWS? I heard something about double buffering of Canvases. Maybe I
have to disable this for the LWS? How?

Cheers,
Hauke
Re: Native SWT drawing on Canvas with LWS [message #247704 is a reply to message #247666] Wed, 11 March 2009 13:14 Go to previous message
Madhu Samuel is currently offline Madhu SamuelFriend
Messages: 199
Registered: July 2009
Senior Member
Hello Fuhrmann,

If you just want to draw in a draw2d figure, you can use the SWTGraphics
class. This is provided by Draw2d to give similar drawing capabilities of
swt's GC class.

Regards,
Madhu


Hauke Fuhrmann wrote:

> Hi there,

> I have a GMF FigureCanvas, which is a Canvas populated by a
> LightweightSystem with Figures.

> For debugging purposes I want to draw native SWT drawings on top of the
> LWS, i.e. simple lines, etc.

> I added a paint listener to the canvas and draw on the GC that I get
> from the PaintEvent.

> However, the Figures from the LWS are drawn correctly, while my own
> manual drawings are messed up. Only very small parts are shown and it
> looks like the LWS Figures have priority and replace my own drawings.

> Is there any reason for this? Any way to draw onto the canvas next to
> the LWS? I heard something about double buffering of Canvases. Maybe I
> have to disable this for the LWS? How?

> Cheers,
> Hauke


Previous Topic:"Empty figure" for GridLayout
Next Topic:GEF forks and git
Goto Forum:
  


Current Time: Sat Apr 20 01:47:11 GMT 2024

Powered by FUDForum. Page generated in 0.02694 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top