Bug 508050 - Containers with 'Workspace Image' style do not take 'Size Computation Expression' into account.
Summary: Containers with 'Workspace Image' style do not take 'Size Computation Express...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 3.1.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-11-23 09:01 EST by Florent Latombe CLA
Modified: 2017-10-12 12:30 EDT (History)
3 users (show)

See Also:


Attachments
MWE project exhibiting the bug. (30.36 KB, application/zip)
2016-11-23 09:01 EST, Florent Latombe CLA
no flags Details
Workaround patch for Sirius 3.1.3. (180.89 KB, patch)
2016-11-28 09:45 EST, Florent Latombe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florent Latombe CLA 2016-11-23 09:01:11 EST
Created attachment 265546 [details]
MWE project exhibiting the bug.

A Container Mapping with a style 'Workspace Image' does not take the 'Size Computation Expression' value into account, i.e. created nodes in the diagrams always are of the same size.

This is a problem because end users may expect various default sizes for nodes representing their domain-specific concepts, e.g. a Container corresponding to an EPackage to be, by default, larger than a Container corresponding to an EClass.

Node Mappings with the exact same style do take this value into account, and Container Mappings with other styles do to. This leads me to believe this behavior is not expected.

Attached is a MWE project exhibiting the issue.

N.B.: This bug was encountered on Eclipse Mars with Sirius 3.1.3.201511201007.
Comment 1 Florent Latombe CLA 2016-11-23 09:43:43 EST
This seems to be very similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=497238

For a Node Mapping, disallowing the Resizings seems to "sort of" fix the issue. For Container Mappings however, it does not seem  to have any impact.
Comment 2 Julien Dupont CLA 2016-11-23 10:02:42 EST
Step to reproduce problem:
- Open containerworkspaceimagebug.odesign
- For mapping ContainerForEClass change the size computation expression to -1
- For mapping NodeForEClass change the size computation expression to -1
- Create a new representation and activate the layer NodeLayer

The result should be 2 images with same size. Ko the image corresponding to ContainerForEClass is more smaller that the image correspoding to NodeForEClass.

- Change in NodeForEClass the size computation expression to 45

The size of image should be reduced. KO

- Uncheck the 2 cases Allow Resizing (horizontally and vertically) Save

The size of image is reduced OK

- Change in NodeForEClass the size computation expression to 90

The size of image is bigger OK
Comment 3 Florent Latombe CLA 2016-11-28 09:45:44 EST
Created attachment 265612 [details]
Workaround patch for Sirius 3.1.3.

Attached is the patch I am using in my setup (Sirius 3.1.3) to circumvent the original issue for Containers.

Basically when interpreting a "Workspace Image" style, Sirius was expecting some DNode to set its width and height depending on the result of the "Size Computation Expression". I simply added support for DDiagramElementContainers which also have a width and height.
Comment 4 Laurent Fasani CLA 2016-11-30 04:11:15 EST
Thanks for the details
Comment 5 Maxime Porhel CLA 2016-11-30 09:48:54 EST
WorkspaceImage both inherits from NodeStyleDescription and ContainerStyleDescription. Property sections corresponding to both super types are displayed. 

We should add some property section filter hide the Node related properties when the parent is a ContainerMapping or a ConditionalContainerStyleDescription and to hide the Container related properties when the parent is a NodeMapping or a CondtionalNodeStyleDescription.