Community
Participate
Working Groups
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.
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.
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
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.
Thanks for the details
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.