Bug 495240 - Add a new bordered node style to have rotatable images according to the parent position
Summary: Add a new bordered node style to have rotatable images according to the paren...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Melanie Bats CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2016-06-02 03:31 EDT by Laurent Redor CLA
Modified: 2017-06-23 02:02 EDT (History)
1 user (show)

See Also:


Attachments
fr.obeo.dsl.viewpoint.diagram.extension.zip (28.16 KB, application/x-zip-compressed)
2016-06-02 03:37 EDT, Laurent Redor CLA
no flags Details
test.rotatable.design.zip (6.26 KB, application/x-zip-compressed)
2016-06-02 03:37 EDT, Laurent Redor CLA
no flags Details
test.rotatable.zip (2.89 KB, application/x-zip-compressed)
2016-06-02 03:37 EDT, 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-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.