Bug 495659 - Tree routing style issue when elements have different styles.
Summary: Tree routing style issue when elements have different styles.
Status: ASSIGNED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Laurent Redor CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-06-08 05:28 EDT by Julien Dupont CLA
Modified: 2022-06-17 13:07 EDT (History)
2 users (show)

See Also:


Attachments
Use case (24.28 KB, application/zip)
2016-06-08 05:28 EDT, Julien Dupont CLA
no flags Details
Bad Layout (22.82 KB, image/png)
2016-06-08 05:28 EDT, Julien Dupont CLA
no flags Details
Ordered Tree Layout Problem edge alignment (22.48 KB, image/png)
2016-06-08 05:29 EDT, Julien Dupont CLA
no flags Details
Use case (21.74 KB, application/x-zip-compressed)
2017-01-06 10:13 EST, Laurent Redor CLA
no flags Details
Use case (21.73 KB, application/x-zip-compressed)
2017-01-11 10:23 EST, Laurent Redor CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Dupont CLA 2016-06-08 05:28:17 EDT
Created attachment 262299 [details]
Use case

Using Composite Layout or Tree Ordered Layout with conditional style with image size different is to be problematic.
The image is different and there are an anchor problem. 
As you can see on the screenshot, the opened diagram does not correspond to the layout definition.
To reproduce problem, use the example joined:
Create a new diagram representation on the root package present in directory sample. The edge is positioned as the screenshot. KO!

You can replace the composite Layout by the OrderedTreeLayout.
Children Expression: feature:eSubpackages
Node mapping: Package

With this layout there is a second problem, you can't aligned the edges!
As you can see on screenshot OrderedTreeLayoutProblemAligned.png
Comment 1 Julien Dupont CLA 2016-06-08 05:28:45 EDT
Created attachment 262300 [details]
Bad Layout
Comment 2 Julien Dupont CLA 2016-06-08 05:29:33 EDT
Created attachment 262301 [details]
Ordered Tree Layout Problem edge alignment
Comment 3 Julien Dupont CLA 2016-06-08 05:34:02 EDT
Warning! It would be necessary to create several time the representation to have the problem layouting. You can see that the layouting is different each time you create a representation. The behavior seem ramdom.
Comment 4 Maxime Porhel CLA 2016-06-09 04:16:56 EDT
I rename the issue: 
. from Composite Layout and Tree ordered Tree Layout have problem with conditional style
. to Tree routing style issue when elements have different styles.

On the attached images the nodes layout seems correct: the nodes are correctly located. 
The issue appears around the tree routing of the edges: one horizontal segment is not aligned with its siblings. The corresponding edge target a node with a square style while the other elements of the same level have an image style. 

This makes me think we should look at the DTreeRouter, DForestRouter, but also on the bendpoints and anchors set on the different nodes. 

Test case: we will have to complete the test data with a tree showing on the same level at least one node of each possible style with different sizes and also a list and a container.



Possible workaround: use the same kind of style for the whole layouted tree (only WorkspaceImage, only BundledImages or only squares like un Capella).
Comment 5 Julien Dupont CLA 2016-08-01 05:18:49 EDT
A workaround is to create the diagram representation, save it and reopen the representation. The layout is ok.
Comment 6 Laurent Redor CLA 2017-01-06 10:13:05 EST
Created attachment 266163 [details]
Use case

I replace the original use case with a new one with the 2 kinds of diagram detailed in initial description:
* DiagramWithCompositeLayout
* DiagramWithOrderedTreeLayout
Comment 7 Laurent Redor CLA 2017-01-06 10:14:58 EST
Julien: I did not reproduce the problem for the OrderedTreeLayout. Can you try with the new use case to see if I make a mistake?
Comment 8 Laurent Redor CLA 2017-01-06 10:16:28 EST
My mistake! I reproduce when trying a second time.
Comment 9 Eclipse Genie CLA 2017-01-11 06:18:11 EST
New Gerrit change created: https://git.eclipse.org/r/88448
Comment 10 Laurent Redor CLA 2017-01-11 09:56:20 EST
At least for OrderedTreeLayout, there are 2 problems:
* 1- Wrong horizontal segments. They are not all aligned.
* 2- Impossible to align the horizontal segment.

For "1", the problem exists only if a child is smaller than its parent.

If all children are bigger that its parent, there is no longer the problem "1". But the "2" already exists: if you move one horizontal segment, the other are not aligned. This problem only exists if the children have not the same size.
Comment 11 Laurent Redor CLA 2017-01-11 10:23:35 EST
Created attachment 266252 [details]
Use case

This project (fr.obeo.layout.design.zip) replaces the previous one. It added a new diagram kind "DiagramWithOrderedTreeLayoutWithBigSquare". This diagram makes it possible to see that problem 1 does not exist if all children are bigger than their parent.