Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Changing a diagram element's color without changing its model
Changing a diagram element's color without changing its model [message #1823410] Thu, 26 March 2020 08:54 Go to next message
Antoine Diamant-Berger is currently offline Antoine Diamant-BergerFriend
Messages: 2
Registered: March 2020
Junior Member
In the project I'm currently working on, we (so far) were capable of changing the colour of an object given an "external" input without changing the model it represents (does that make sense ?) .
We did that by accessing the "StyleSpec" of the representation, and changing its properties.

However, in newer releases, the StyleSpec (FlatContainerStyleSpec for example) have become unavailable, and we are stuck on earlier versions of Sirius.

Were the StyleSpec relocated from org.eclipse.sirius.diagram.business.internal.metamodel.spec ? Added to an other package/plugin/feature ? Any alternate ways of doing that ?
Did I miss anything ? Is what we did completely forbidden ?

Cheers
Re: Changing a diagram element's color without changing its model [message #1823416 is a reply to message #1823410] Thu, 26 March 2020 09:13 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 544
Registered: July 2009
Senior Member
As their full name indicate, the "spec" classes are internal. They correspond to customized implementations of the corresponding EMF EClasses. If you need to modify the diagram's model, use the corresponding EMF APIs instead (e.g. org.eclipse.sirius.diagram.FlatContainerStyle).

Note that if you modify the style features of an element, the customization will be lost on the next refresh, when Sirius re-applies the styling rules defined in the .odesign. To avoid that, you need to mark the feature as customized by adding its name to the style's getCustomFeatures().


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Changing a diagram element's color without changing its model [message #1823423 is a reply to message #1823416] Thu, 26 March 2020 11:35 Go to previous message
Antoine Diamant-Berger is currently offline Antoine Diamant-BergerFriend
Messages: 2
Registered: March 2020
Junior Member
Thank you, will test again :)
Previous Topic:How to disable palette
Next Topic:External Java Action Create Viewpoint Project
Goto Forum:
  


Current Time: Sat Oct 24 04:34:32 GMT 2020

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

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

Back to the top