Bug 508178 - Improve enhancement 440296 by allowing end user to bypass the constraint
Summary: Improve enhancement 440296 by allowing end user to bypass the constraint
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-11-25 05:42 EST by Laurent Redor CLA
Modified: 2016-12-13 09:17 EST (History)
1 user (show)

See Also:


Attachments
automaticLayoutedDiagram.jpg (41.50 KB, image/jpeg)
2016-11-25 05:42 EST, Laurent Redor CLA
no flags Details
manualLayoutedDiagram.jpg (43.41 KB, image/jpeg)
2016-11-25 05:42 EST, Laurent Redor CLA
no flags Details
my.sample.design.zip (8.28 KB, application/x-zip-compressed)
2016-12-13 09:17 EST, Laurent Redor CLA
no flags Details
ModelingProjectSample.zip (1.60 KB, application/x-zip-compressed)
2016-12-13 09:17 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 Laurent Redor CLA 2016-11-25 05:42:12 EST
Created attachment 265580 [details]
automaticLayoutedDiagram.jpg

In some cases, it could be interesting to allow the end-user to bypass the constraint [1].
For example, imagine a diagram representing a flow with port "in" and port "out". Port "in" is constrained to the left side and port "out" is constrained to the right side. For a long flow an automatic layout will be something like"automaticLayoutedDiagram.jpg" and this is what is expected by the enhancement bug 440296. But it is impossible for the end-user to make something like "manualLayoutedDiagram.jpg".

The idea will be to have another option for the specifier to allow the end-user to bypass the constraint. The constraint will be used only for automatic creation (during a refresh of a diagram for example) or for "arrange" actions.

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#authorizedsides
Comment 1 Laurent Redor CLA 2016-11-25 05:42:28 EST
Created attachment 265581 [details]
manualLayoutedDiagram.jpg
Comment 2 Laurent Redor CLA 2016-12-13 09:16:44 EST
In the end, another approach has been choosen for the customer needs. Here is an explanation with sample that can be reused (but with some limitations).

The VSM authotizes all sides for border nodes and the creation tool locates the border nodes on a specific location at creation.

Steps to reproduce:
* Import the project my.sample.design in a workspace
* Launch a runtime
* Import the project ModelingProjectSample in the runtime
* Open the diagram "new Diagram": This diagram simulates functions (mapped on ecore.EPackage) with one green "in" port (mapped on a ecore.EClass named InClass) and one orange "out" port (mapped on a ecore.EClass named OutClass).
* Create a new function by using the tool "New function with 2 border nodes" with one click
* A new function appears with a default size and the border nodes are created with their default locations.
* Create a new function by using the tool "New function with 2 border nodes" with one click + a drag'n'drop (to define an initial size for the function)
* A new function appears with its defined size and the border nodes are created with their default locations.
* Create a new function by using the tool "New function with 2 border nodes correctly located" with one click
* A new function appears with a default size, the green border node is centered on the left side of the function and the orange border node is centered on the right side of the function
* Create a new function by using the tool "New function with 2 border nodes" with one click + a drag'n'drop (to define an initial size for the function)
* A new function appears with its defined size, the green border node is centered on the left side of the function and the orange border node is centered on the right side of the function

To do this the second tool directly creates the graphical views and uses a service, my.sample.design.Services.setLocationsOfPackageAndClasses(EPackage, AbstractDNode, AbstractDNode, AbstractDNode), to correctly locate the border nodes. This service uses internal code of Sirius. So it is not a target solution. But it is a good starting point to show how to locate graphical views during a creation tool.
Comment 3 Laurent Redor CLA 2016-12-13 09:17:09 EST
Created attachment 265849 [details]
my.sample.design.zip
Comment 4 Laurent Redor CLA 2016-12-13 09:17:30 EST
Created attachment 265850 [details]
ModelingProjectSample.zip