Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drawing a line connected to a figure
Drawing a line connected to a figure [message #755974] Thu, 10 November 2011 11:09 Go to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi guys,

I would like to draw a line. The scenario should look like this:

The user selects "line creating tool" from the palette. The line could start only from the center of an existing figure, so the cursor should show "this is disabled" unless its over the figure.

Then user clicks and the line attaches itself to the center of the figure. After that user moves the cursor and so its determined the direction and length of the line. The line is drawn as feedback. Finally, the user clicks and the line is added to the graph.

How can I do that? I mean, do I have to create my own Tool for that? Its not about creating connections, right? Because a connection have always source AND target. So could somebody give me a kick how to realize this?

Thanks
Re: Drawing a line connected to a figure [message #756125 is a reply to message #755974] Fri, 11 November 2011 06:18 Go to previous message
Ludwig Moser is currently offline Ludwig Moser
Messages: 355
Registered: July 2009
Senior Member
i am not far enough into this to tell you if its a connection,
but i try to do something similar.

actually i added listeners to my figures to see if mouse is over. if it is you can enable the mousecursor and allow a polyline to be drawn (can a connection exist with source only? i dont know - i use a polyline) then a second mouselistener tracks mouse movement and clicks so you can preview the line and add new points on clicks.

hope that helps

greets
lumo
Previous Topic:Same EditPart in a hierarchy
Next Topic:GEF Moving BPMN Shapes
Goto Forum:
  


Current Time: Sat Oct 25 07:54:12 GMT 2014

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

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