Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Splitting connections
Splitting connections [message #1042685] Tue, 16 April 2013 18:59 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I'm implementing functionality for splitting a connection. If the
connection is a free form connection with connection points, I'd like to
move connection points to the appropriate resulting connections, so the
overall shape does not change (although there's a new node in-between).

To do so, I need to iterate over all the line segments of the
connection, but I cannot find out how to find the location of the start
and end anchors. I seems these are not stored in the connection or
anchors and instead are computed by the GEF implementation?

Another solution would be to have the context object provide the
"segment number" in addition to the x,y location, but that is not
implemented?

Hallvard
Re: Splitting connections [message #1046866 is a reply to message #1042685] Mon, 22 April 2013 13:29 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1635
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hallvard,

right, the location of the start and end anchors are not stored in the
connection. They are partly calcutaled and set on GEF leven, partly set as
relative coordinates on the shapes resp. their anchors. Each graphics
algorithm of an shape has relative coordinates stating its position relative
to the next upper active shape. Anchors are just like shapes, so they hold a
position and size you could use to compute the position. This is true for at
least Fixpoint and BoxRelative anchors, Chopbox anchors are always in the
middle of their parent.

The segment is currently not part of the context information, but maybe it
would make sense to add it?

Michael
Re: Splitting connections [message #1047033 is a reply to message #1046866] Mon, 22 April 2013 17:50 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 22.04.13 06.29, Michael Wenz wrote:
>
> right, the location of the start and end anchors are not stored in the
> connection. They are partly calculated and set on GEF level, partly set
> as relative coordinates on the shapes resp. their anchors. Each graphics
> algorithm of an shape has relative coordinates stating its position
> relative to the next upper active shape. Anchors are just like shapes,
> so they hold a position and size you could use to compute the position.
> This is true for at least Fixpoint and BoxRelative anchors, Chopbox
> anchors are always in the middle of their parent.

Would it make sense for the anchor to have an EOperation computing the
position? Then a client needn't duplicate logic that anyway needs to be
in Graphiti?

> The segment is currently not part of the context information, but maybe
> it would make sense to add it?

I think so, since it makes sense to implement operations that are
segment-aware. Should I file a bug?

Hallvard
Re: Splitting connections [message #1051822 is a reply to message #1047033] Mon, 29 April 2013 08:58 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1635
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Yes, please file that as an enhancement bug.

Michael
Re: Splitting connections [message #1052834 is a reply to message #1051822] Tue, 30 April 2013 16:04 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 29.04.13 01.58, Michael Wenz wrote:
> Yes, please file that as an enhancement bug.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=406929

Hallvard
Previous Topic:Direct editing for connection decorators?
Next Topic:How to draw feedback shapes?
Goto Forum:
  


Current Time: Sun Nov 23 16:29:53 GMT 2014

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

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