Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Let Connection end at midpoint of ContainerShape
Let Connection end at midpoint of ContainerShape [message #1798834] Mon, 26 November 2018 13:47 Go to next message
Felix Buehler is currently offline Felix BuehlerFriend
Messages: 15
Registered: July 2017
Junior Member
Hey there!

I am trying to let a curved connection end at the midpoint of a ContainerShape. Currently we are using ChopBoxAnchors for the Start- and EndPoints of the connection.
The current situation looks like this:
index.php/fa/34404/0/

I'm trying to achieve that the CurvedConnection ends in the middle of the point.
One solution I found was replacing the ChopBoxAnchors by BoxRelativeAnchors and set
boxRelativeAnchor.setRelativeHeight(0.5);
boxRelativeAnchor.setRelativeWidth(0.5);

This way the graphic is corrected but the selection on the containerShape (which here is represented by an ellipse) is not working anymore because the selection always (or mostly) selects the curve.
As i read in different posts the GEF-ConnectionLayer seems to be always on top of the shape-layer.

Does anyone have a suggestion on how to solve the selection behavior (so that BoxRelativeAnchors could work) or a different approach?

Thanks in advance and best regards!
Felix

Re: Let Connection end at midpoint of ContainerShape [message #1798921 is a reply to message #1798834] Tue, 27 November 2018 13:16 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Felix,

not sure if that will really help in this case, but to change the selection for a user click you can implement the method getSelection in your tool behavior provider. Have you alread tried that?

Michael
Re: Let Connection end at midpoint of ContainerShape [message #1798972 is a reply to message #1798921] Wed, 28 November 2018 08:10 Go to previous messageGo to next message
Felix Buehler is currently offline Felix BuehlerFriend
Messages: 15
Registered: July 2017
Junior Member
Hi Michael!

I tried your suggestion. Unfortunately the getSelection is only called from the ShapeEditPart, not from the ConnectionEditPart. So I don't see a way to prevent the selection of connections here.

Is there a way to prevent the selection of connections completely?

Regards,
Felix
Re: Let Connection end at midpoint of ContainerShape [message #1799035 is a reply to message #1798972] Thu, 29 November 2018 08:39 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Felix,

sorry, you are right of course. Changing the selection only works for shapes. Maybe we should add that for connections as well...?

Selection of connections can be disabled by returning false in method isConnectionSelectionEnabled() in your tool behavior provider.

Michael
Re: Let Connection end at midpoint of ContainerShape [message #1799058 is a reply to message #1799035] Thu, 29 November 2018 12:59 Go to previous messageGo to next message
Felix Buehler is currently offline Felix BuehlerFriend
Messages: 15
Registered: July 2017
Junior Member
Hey Michael,

disabling connections by overwriting isConnectionSelectionEnabled() works. However, if I click at the location where a connection crosses a shape, nothing gets selected. My expectation would be, that the shape gets the selection.

It looks like a similar problem. In the select()-method of GrahpitiScrollingGraphicalViewer nothing is done in the else-bracket because the editpart is a FreeFormConnectionEditpart and the model a FreeFormConnection.

Is this a gap in graphiti or am I missing something?

Thanks a lot!
Felix

[Updated on: Thu, 29 November 2018 12:59]

Report message to a moderator

Re: Let Connection end at midpoint of ContainerShape [message #1799303 is a reply to message #1799058] Tue, 04 December 2018 13:22 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Felix,

this indeed looks like a gap. Would you file an enhancement bug against Graphiti for this?

Thanks,
Michael
Re: Let Connection end at midpoint of ContainerShape [message #1799737 is a reply to message #1799303] Thu, 13 December 2018 08:13 Go to previous message
Felix Buehler is currently offline Felix BuehlerFriend
Messages: 15
Registered: July 2017
Junior Member
Hi Michael,

I filed a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=542732

Thanks for your Support!
Felix
Previous Topic:Change Position of ContextButtonPad
Next Topic:Adding Combo On a Graphiti Container
Goto Forum:
  


Current Time: Tue Apr 16 11:41:05 GMT 2024

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

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

Back to the top