Skip to main content



      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 04:54 Go to next message
Eclipse UserFriend
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 05:13 Go to previous messageGo to next message
Eclipse UserFriend
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().
Re: Changing a diagram element's color without changing its model [message #1823423 is a reply to message #1823416] Thu, 26 March 2020 07:35 Go to previous message
Eclipse UserFriend
Thank you, will test again :)
Previous Topic:How to disable palette
Next Topic:External Java Action Create Viewpoint Project
Goto Forum:
  


Current Time: Sat Jun 21 20:28:05 EDT 2025

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

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

Back to the top