Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Bring Connection shape to front (z-index)
Bring Connection shape to front (z-index) [message #1749317] Mon, 05 December 2016 12:22 Go to next message
Jerome Sivadier is currently offline Jerome SivadierFriend
Messages: 15
Registered: May 2015
Junior Member
Hi Michael,

In a new project I'm using rectangles to represent equipments with some ports, and connections to represent the linking between two equipments.

However on huge diagrams the connection shapes are stacked and when the user selects a connection I would like to bring it to the front in order to see the whole connection selected.

Any ideas on how I could achieve this? I have already had a look at the PeService#sendToFront() API which should be used for Shapes but there do not seem to be an entry point for Connections... In another thread you said connections are drawn on one single layer above the Shape one but there might be a GEF trick to bring a connection to the front (eg: take its container and set the connection figure as first child, then refresh).

Thanks!
Jérôme
Re: Bring Connection shape to front (z-index) [message #1749386 is a reply to message #1749317] Tue, 06 December 2016 07:45 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 Jérôme,

yes, the sendTo... methods only take shapes. And yes connections are rendered on a different GEF layer.

Without haveing a look into the concrete coding, I expect that the same thing we do in the sendTo... methods for shapes will also work for connections. Basically shapes are stored in ordered collections and drawn in the sequence they are stored in the collection. This means that the last shape is drawn last and thus appears on top.

The same should apply to connections, so placeing the connection in the end of the list should make it appear on top of other connections.

Michael
Re: Bring Connection shape to front (z-index) [message #1749392 is a reply to message #1749386] Tue, 06 December 2016 08:38 Go to previous messageGo to next message
Jerome Sivadier is currently offline Jerome SivadierFriend
Messages: 15
Registered: May 2015
Junior Member
Thanks for your answer Michael,

I've just tried the trick and I think it's supposed to work but I cannot find anywhere using the debugger instructions during refresh() for Connections ?! Looks like children shapes & connection decorators are updated during refresh but not Connections.

For the record my piece of code looks like this:
EList<Connection> parentConnections = connection.getParent().getConnections();
parentConnections.remove(connection);
parentConnections.add(connection);
diagramContainer.getDiagramBehavior().refreshContent();


I'll try to investigate a bit more, if you have any idea why the refresh behavior does not seem to update Connections...

Best,
Jérôme
Re: Bring Connection shape to front (z-index) [message #1749395 is a reply to message #1749392] Tue, 06 December 2016 08:56 Go to previous message
Jerome Sivadier is currently offline Jerome SivadierFriend
Messages: 15
Registered: May 2015
Junior Member
Edit: I though I had discovered where to look for the bug, actually not...

If you could spend some time on this issue Michael it would be really great! Test case is just to have 2 connections one above the other and to select the lowest one. I'd like to push the selected connection to the Front to see the selected shape Smile.

I'll investigate a bit more on this issue later on and try to find a fix, this will be a blocking issue for my project around mid-january.

Thx!

[Updated on: Tue, 06 December 2016 16:55]

Report message to a moderator

Previous Topic:Vertical alignment
Next Topic:Traverse diagram elements based on underlying EObject Properties
Goto Forum:
  


Current Time: Thu Apr 25 07:42:06 GMT 2024

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

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

Back to the top