Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » start connection on mouse click
start connection on mouse click [message #242220] Tue, 08 April 2008 12:36 Go to next message
Eclipse UserFriend
Originally posted by: christianstre.gmx.de

Hello,
I'm trying to start a connection when clicking a node. The problem is
that selection and dragging of nodes must be available too. So it should
only happen when clicking a special part of the node (for example some
small rectangles on the edges).

I don't know how to start. I could paint the "start connection
rectangles" on the figures, but then I would have to check the
coordinates of the click by myself. There must be a better way.

Somebody has an idea or an example?

(Drag'n'drop instead of clicking source and target separately would be
okay too.)

Thanks.
Re: start connection on mouse click [message #242238 is a reply to message #242220] Tue, 08 April 2008 16:25 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Christian,

Can you describe the problem comparing to what is demonstrated in the GEF
Shapes example?

Cheers...
Anthony

"Christian Strempfer" <christianstre@gmx.de> wrote in message
news:ftfouc$oi7$1@build.eclipse.org...
> Hello,
> I'm trying to start a connection when clicking a node. The problem is that
> selection and dragging of nodes must be available too. So it should only
> happen when clicking a special part of the node (for example some small
> rectangles on the edges).
>
> I don't know how to start. I could paint the "start connection rectangles"
> on the figures, but then I would have to check the coordinates of the
> click by myself. There must be a better way.
>
> Somebody has an idea or an example?
>
> (Drag'n'drop instead of clicking source and target separately would be
> okay too.)
>
> Thanks.
Re: start connection on mouse click [message #242244 is a reply to message #242238] Tue, 08 April 2008 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christianstre.gmx.de

Hello Anthony,
in the Shapes Editor it could be something like this:

I create two rectangles. This rectangles should have a (visible) spot in
their center. When I click this spot a "dashed connection" will be
started. A second click on the second shape will complete the connection.
This should also work if I have selected the selection tool instead
of the connection tool.


My intention is to keep the control simple and have only one tool
instead of two (one for selections and one for connections).

My questions are:
How should I implement the spots in the center of the shapes?
How can I notice a click on the spot (not on the shape)?
And how can I switch to the connection tool and back to the selection
tool afterwards?

Thanks.
Christian.


Anthony Hunter wrote:
> Hi Christian,
>
> Can you describe the problem comparing to what is demonstrated in the GEF
> Shapes example?
>
> Cheers...
> Anthony
>
> "Christian Strempfer" <christianstre@gmx.de> wrote in message
> news:ftfouc$oi7$1@build.eclipse.org...
>> Hello,
>> I'm trying to start a connection when clicking a node. The problem is that
>> selection and dragging of nodes must be available too. So it should only
>> happen when clicking a special part of the node (for example some small
>> rectangles on the edges).
>>
>> I don't know how to start. I could paint the "start connection rectangles"
>> on the figures, but then I would have to check the coordinates of the
>> click by myself. There must be a better way.
>>
>> Somebody has an idea or an example?
>>
>> (Drag'n'drop instead of clicking source and target separately would be
>> okay too.)
>>
>> Thanks.
>
>
Re: start connection on mouse click [message #242256 is a reply to message #242244] Wed, 09 April 2008 05:10 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
ConnectionDragCreationTool is what you looking for?

--

- Prakash

Eclipse Tips: http://blog.cypal-solutions.com
Eclipse Search: http://www.cypal.in/eclipsesearch


Christian Strempfer wrote:
> Hello Anthony,
> in the Shapes Editor it could be something like this:
>
> I create two rectangles. This rectangles should have a (visible) spot in
> their center. When I click this spot a "dashed connection" will be
> started. A second click on the second shape will complete the connection.
> This should also work if I have selected the selection tool instead of
> the connection tool.
>
>
> My intention is to keep the control simple and have only one tool
> instead of two (one for selections and one for connections).
>
> My questions are:
> How should I implement the spots in the center of the shapes?
> How can I notice a click on the spot (not on the shape)?
> And how can I switch to the connection tool and back to the selection
> tool afterwards?
>
> Thanks.
> Christian.
>
>
> Anthony Hunter wrote:
>> Hi Christian,
>>
>> Can you describe the problem comparing to what is demonstrated in the
>> GEF Shapes example?
>>
>> Cheers...
>> Anthony
>>
>> "Christian Strempfer" <christianstre@gmx.de> wrote in message
>> news:ftfouc$oi7$1@build.eclipse.org...
>>> Hello,
>>> I'm trying to start a connection when clicking a node. The problem is
>>> that selection and dragging of nodes must be available too. So it
>>> should only happen when clicking a special part of the node (for
>>> example some small rectangles on the edges).
>>>
>>> I don't know how to start. I could paint the "start connection
>>> rectangles" on the figures, but then I would have to check the
>>> coordinates of the click by myself. There must be a better way.
>>>
>>> Somebody has an idea or an example?
>>>
>>> (Drag'n'drop instead of clicking source and target separately would
>>> be okay too.)
>>>
>>> Thanks.
>>
>>
Re: start connection on mouse click [message #242280 is a reply to message #242256] Wed, 09 April 2008 07:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christianstre.gmx.de

I could use that, but the edit parts must be movable. So I still have to
differ between clicks on the special spots and clicks on the edit part
itself.

Prakash G.R. wrote:
> ConnectionDragCreationTool is what you looking for?
>
Re: start connection on mouse click [message #242301 is a reply to message #242280] Wed, 09 April 2008 13:40 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Make that special spot as an edit part itself.

--

- Prakash

Eclipse Tips: http://blog.cypal-solutions.com
Eclipse Search: http://www.cypal.in/eclipsesearch

Christian Strempfer wrote:
> I could use that, but the edit parts must be movable. So I still have to
> differ between clicks on the special spots and clicks on the edit part
> itself.
>
> Prakash G.R. wrote:
>> ConnectionDragCreationTool is what you looking for?
>>
Re: start connection on mouse click [message #242306 is a reply to message #242220] Wed, 09 April 2008 17:44 Go to previous message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

did you see the logic example? they have small props on the edge of the figure on which only the connection would start or terminate, well that will not solve the whole thing you are searching for but will solve some of the parts of your doubt..,
Previous Topic:is JFace TreeViewer is identical to GEF one?
Next Topic:Alternate target feedback for TreeContainerEditPolicy
Goto Forum:
  


Current Time: Thu Mar 28 17:38:59 GMT 2024

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

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

Back to the top