Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » Border node "inside" its container
Border node "inside" its container [message #1749900] Tue, 13 December 2016 15:51 Go to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Hi,

this post follows the discussion [1] on Capella forum. In Sirius, but more generally in GMF, it is possible to have a border node inside its container (like you can see in examples of above Capella post). This is done by using the BorderItemLocator.borderItemOffset [2].
When a layout is launched with ELK, I have the feeling that this aspect is ignored and border nodes are located at the border of its container (x == -10 for a border node of 10 pixels located at left side of its container).

Is it right?

I search quickly in ELK code and do not find how to consider this aspect.

Regards,

Laurent

[1] https://polarsys.org/forums/index.php/mv/msg/307/1072/#msg_1072
[2] org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator.borderItemOffset


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Border node "inside" its container [message #1749906 is a reply to message #1749900] Tue, 13 December 2016 16:52 Go to previous messageGo to next message
Christoph Daniel Schulze is currently offline Christoph Daniel SchulzeFriend
Messages: 98
Registered: September 2015
Member
Hi Laurent,

I assume that by "border node" you mean what ELK calls a "port": a dedicated small box which belongs to a node for edges to connect to.

ELK supports the notion of a port offset: the amount of space between the port and the node. My first impression is that this would be what you're looking for. ELK Layered should already calculate this offset automatically, but you can specify it explicitly on a port based on the borderItemOffset.

This kind of thing should probably be something added to our GmfDiagramLayoutConnector class which turns a GMF diagram into an ELK Graph to be processed by ELK, and applies the results back to the original diagram.

By the way, I bookmarked the thread you linked to and added myself to the CC list of the Bugzilla ticket referenced therein. I'll try to catch up on those as soon as I find the time.

Cheers,
Christoph Daniel
Re: Border node "inside" its container [message #1749909 is a reply to message #1749906] Tue, 13 December 2016 17:18 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Yes, when i said border node, I talk about what is named port in ELK.

Thanks, for your quick reply. Do you need a bugzilla instead of this post?


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Border node "inside" its container [message #1749949 is a reply to message #1749900] Wed, 14 December 2016 09:17 Go to previous message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 78
Registered: March 2015
Location: Kiel, Germany
Member

The code responsible for translating border items is GmfDiagramLayoutConnector#createPort(..):

https://github.com/eclipse/elk/blob/master/plugins/org.eclipse.elk.conn.gmf/src/org/eclipse/elk/conn/gmf/GmfDiagramLayoutConnector.java#L750

The default implementation computes the port position from the actual position of its figure. The offset from the border of the container node is then computed with the difference of the actual node position and the actual port position. You can implement a specialized behavior by subclassing GmfDiagramLayoutConnector and overriding createPort(..)
Previous Topic:Does ELK work on Mac?
Next Topic:what MrTree layout algorithm ID
Goto Forum:
  


Current Time: Tue Apr 23 06:37:40 GMT 2024

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

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

Back to the top