Bug 495240

Summary: Add a new bordered node style to have rotatable images according to the parent position
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Melanie Bats <melanie.bats>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: pierre-charles.david
Version: unspecifiedKeywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/86859
Whiteboard:
Attachments:
Description Flags
fr.obeo.dsl.viewpoint.diagram.extension.zip
none
test.rotatable.design.zip
none
test.rotatable.zip none

Description Laurent Redor CLA 2016-06-02 03:31:42 EDT
We can have a style on bordered nodes where we can specify :
* one image, it takes this image for north side and rotate it (90° for east side, 180° for south side, 270° for west side)
* or several images, for example with 4 images, it displays one image on a specific side (one on the north, one on the east, one on the south and the last on the west)
Comment 1 Laurent Redor CLA 2016-06-02 03:36:45 EDT
An example was done, few years ago, to make this outside of Sirius (named Viewpoint before), you will find the code in attachment:
* fr.obeo.dsl.viewpoint.diagram.extension.zip contains the source of a simple plug-in which extends Obeo Designer with a new extension point to configure rotatable bordered nodes. The code is under the Eclipse Public License.
* test.rotatable.design.zip contains a simple example of a diagram definition which uses this extension.
* test.rotatable.zip contains an example diagram using the definition in test.rotatable.design.zip.

The extension works like this:
1- Create your VSM (.odesign model) as usual. Make sure to use "Custom Style" for the bordered nodes you want to make "rotatable" and give the style element a globally unique identifier (see the styles "rotatable1picture" and "rotatable4pictures" in the example VSM).
2- In the plugin.xml of the VSM project, use the extension point fr.obeo.dsl.viewpoint.diagram.extension.rotatableBorderedNode to specify the image(s) to use for the style. If you specify a single image for the "top" position, it will be automatically rotated of the appropriate angle depending on which side of its container the bordered node is placed. You can also specify a different image for each of the 4 sides (top, bottom, left, right). The test.rotatable.design project contains examples of both usages.
Comment 2 Laurent Redor CLA 2016-06-02 03:37:13 EDT
Created attachment 262181 [details]
fr.obeo.dsl.viewpoint.diagram.extension.zip
Comment 3 Laurent Redor CLA 2016-06-02 03:37:35 EDT
Created attachment 262182 [details]
test.rotatable.design.zip
Comment 4 Laurent Redor CLA 2016-06-02 03:37:51 EDT
Created attachment 262183 [details]
test.rotatable.zip
Comment 5 Eclipse Genie CLA 2016-12-09 11:52:40 EST
New Gerrit change created: https://git.eclipse.org/r/86859
Comment 6 Pierre-Charles David CLA 2017-04-10 08:59:08 EDT
Moving to 5.1.