file Class color based on stereotype

11 months 5 days ago - 11 months 5 days ago #4828 by amoise
Is it possible to modifiy the entire class color based on the application of a specific stereotype with Modelio Open Source 3.7?

I would like to be able to do this:
edn.embarcadero.com/article/images/29874/actnote1-003.gif

Please Log in or Create an account to join the conversation.

11 months 12 hours ago #4837 by cde
Hi Amoise,

It is not possible to modify a class color based on its stereotype. A diagram theme/style is associated to a metaclass (in our example Class) not to sterotyped metaclass.

Something you can do is associate a colored icon to your stereotypes and display the stereotype on your classes with the "Text + Icon" option (in the Class' Symbol tab) :



You can also update the Modelio 3.x diagram theme to always display stereotypes with the "Text + Icon" option:



This way all your Classes will display their stereotypes with the "Text + Icon" option when they are created.

Hope this helps,
cde.
Attachments:

Please Log in or Create an account to join the conversation.

1 week 5 days ago - 1 week 5 days ago #5431 by beginner
You can do this but first yo must to define tool or part of your code you can use this;

IModelioServices modelioServices = YOURMODULE.getInstance().getModuleContext().getModelioServices();
IDiagramService diagramService = modelioServices.getDiagramService();
IDiagramHandle handle = diagramService.getDiagramHandle(YOURELEMENT.getDiagramElement().get(0));
IDiagramGraphic graph = handle.getDiagramGraphics(YOURELEMENT).get(0);

((IDiagramNode)graph).setFillColor("100, 100, 100");

"100, 100, 100" is RGB values. set what you want :)

Please Log in or Create an account to join the conversation.

Moderators: tmaebr
Time to create page: 0.244 seconds
^ Back to Top