Bring Connection shape to front (z-index) [message #1749317] |
Mon, 05 December 2016 12:22  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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 .
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] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04639 seconds