Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 484392

Summary: Bordered node’s custom size not always taken into account
Product: [Modeling] Sirius Reporter: Vincent Sennedot <vincent.sennedot>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: CLOSED INVALID QA Contact:
Severity: major    
Priority: P3 CC: laurent.redor, maxime.porhel
Version: 3.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
Whiteboard:
Attachments:
Description Flags
Example for the bordered node size bug none

Description Vincent Sennedot CLA 2015-12-15 08:46:46 EST
The bordered node’s custom size is not always taken into account. 

I have a Block object with children Ports. The Block uses a container mapping and the Ports use bordered node mappings which have square style with a custom size.

When I create the Block’s representation, the existing Ports are created with the default size. But if the Block’s representation already exists when I create a Port, it will have the custom size.

The Ports created during the Block’s representation creation should have the custom size too.

This behavior is only detected with the diagram creation tool (“New” menu in the contextual menu of a diagram element), but if I create a new representation through the Project Explorer, it’s the good behavior.
Comment 1 Maxime Porhel CLA 2015-12-22 10:13:23 EST
Hi, thanks for your feedback.

Could you give us more information or provide a simple/sample reproduction case ? 

How do you specify you custom size: do you use Height/Width attributes of the SquareDescription or the SizeComputationExpression ? 

Regards
Comment 2 Vincent Sennedot CLA 2016-01-05 03:50:11 EST
Hi,

I've juste created an example with the basic family example.
The men are represented by container mappings and their parents are represented by bordered node mappings.

Thera
Comment 3 Vincent Sennedot CLA 2016-01-05 04:05:25 EST
Created attachment 258994 [details]
Example for the bordered node size bug

Sorry for the precedent post, it sends it before I finish it.

I've just created an example with the basic family example. The men are represented by container mappings and their parents are represented by bordered node mappings.

There are a diagram for the family and two diagrams for the man Elias:
 - The first Elias diagram is created from the “New Representation” button in Project Explorer and it works correctly
 - The second diagram is created with the diagram creation tool defined in the odesign and the bordered node take the size of the bordered node in the family diagram

But I’ve noticed if you delete the bordered node mapping from the family diagram in the odesign, the man diagrams are correctly created in both case.
Comment 4 Laurent Redor CLA 2016-01-26 08:49:28 EST
This is not a bug. It works as designed. When a diagram is created from another, if the elements represented in the new diagram are already in the existing diagram, we copy their layouts.

This is done with oes.diagram.ui.tools.internal.commands.InitializeLayoutCommand (called in oes.diagram.ui.tools.internal.actions.CreateRepresentationFromRepresentationCreationDescription.executeCreationCommand(Option<Command>, CreateRepresentationCommand)).

Unfortunately, there is currently no way to disable this behavior.
Comment 5 Maxime Porhel CLA 2016-04-01 10:13:53 EDT
As mentioned by Laurent, this described behavior works as designed thanks to the layout copy done from the diagram on which the new diagram creation was called. 

I close this issue as invalid. 

Feel free to open a new bugzilla if you need the capability to disable this behavior.