Skip to main content



      Home
Home » Modeling » Eclipse Layout Kernel » Border node "inside" its container
Border node "inside" its container [message #1749900] Tue, 13 December 2016 10:51 Go to next message
Eclipse UserFriend
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
Re: Border node "inside" its container [message #1749906 is a reply to message #1749900] Tue, 13 December 2016 11:52 Go to previous messageGo to next message
Eclipse UserFriend
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 12:18 Go to previous messageGo to next message
Eclipse UserFriend
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?
Re: Border node "inside" its container [message #1749949 is a reply to message #1749900] Wed, 14 December 2016 04:17 Go to previous message
Eclipse UserFriend
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: Thu Apr 24 09:56:15 EDT 2025

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

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

Back to the top