Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Rotate Diagram Element(Rotate Diagram Element)
Rotate Diagram Element [message #1822395] Thu, 05 March 2020 15:59 Go to next message
Antonio Garmendia is currently offline Antonio GarmendiaFriend
Messages: 93
Registered: May 2014
Member
Hello,

I would like to rotate a diagram element programmatically, specifically a Square shape. I would like to give the user this functionality, that is why I was thinking of using a Sirius Java Extension Java Call. That would be possible? Thanks in advance.

Cheers,
Anthony
Re: Rotate Diagram Element [message #1822528 is a reply to message #1822395] Mon, 09 March 2020 13:16 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Anthony,

Will you have some info stored in your model, in this case, you might simply create a set of conditional styles or style customizations ?

You might also take a look to the sample of rotatable port in the Composite Stucture Diagram of UML Designer: http://www.umldesigner.org/ref-doc/define-the-application.html#composite-structure-diagram

This is done thanks to https://github.com/ObeoNetwork/UML-Designer/tree/master/plugins/org.obeonetwork.gmf.runtime.diagram.ui.extension

The plugin org.obeonetwork.dsl.uml2.design declares the rotatable in its plugin.xml, the id is "org.obeonetwork.dsl.uml2.design.ui.extension.rotableNode.requiredInterface".

The odesign use a CustomStyleDescription with id "org.obeonetwork.dsl.uml2.design.ui.extension.rotableNode.requiredInterface" for the corresponding mappings.

Those rotatable ports are oriented regarding the first location of the first bendpoint of the edge connected to the interface.



Regards


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Rotate Diagram Element [message #1822557 is a reply to message #1822528] Mon, 09 March 2020 19:42 Go to previous messageGo to next message
Antonio Garmendia is currently offline Antonio GarmendiaFriend
Messages: 93
Registered: May 2014
Member
Hi Maxime,

Thanks for your response. The thing is that I do not have any information stored in my model. Currently, I am developing an editor for Petri nets, so I would like a feature that rotates the transitions (Square shape) 90 degrees depending on the user's wishes. That would be possible?

I have been searching in the Sirius API, but nothing so far. I just discover the SiriusGMFHelper.getGmfView, but currently I am just able to change the position of the element, but in the editor is not refreshed well.

Would you please give me any other hint or maybe some sample code I can look at? Thanks in advance.

Cheers,
Anthony
Re: Rotate Diagram Element [message #1822743 is a reply to message #1822557] Thu, 12 March 2020 15:27 Go to previous message
Antonio Garmendia is currently offline Antonio GarmendiaFriend
Messages: 93
Registered: May 2014
Member
Hello Maxime,

Finally, I implemented a solution based on your answer in this post [1]. I did not know that it is possible to add DAnnotation to the *.aird.

Cheers,
Anthony

[1] https://www.eclipse.org/forums/index.php/t/1066089/
Previous Topic:Generation of ID's
Next Topic:Issue when adding programmatically new diagrams to a representation
Goto Forum:
  


Current Time: Wed Apr 24 17:09:49 GMT 2024

Powered by FUDForum. Page generated in 0.03132 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top