Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Adapt shape appearance based on complex constraints
Adapt shape appearance based on complex constraints [message #1750155] Fri, 16 December 2016 14:08 Go to next message
Andreas Pleuss is currently offline Andreas PleussFriend
Messages: 18
Registered: June 2015
Junior Member
Hi,

I would like to change the color of a CallBehaviorAction in an ActivityDiagram depending on whether its called behavior (CallBehaviorAction.behavior) has a specific stereotype applied. For instance, all activites stereotyped as "SpecialActivity" are colored in red and, hence, a CallBehaviorAction calling a "SpecialActivity" should be colored in red as well.

I know that coloring can be handled by CSS but I suppose there is no CSS selector supported for such complex conditions (i.e., stereotype of a referenced element), is there? Otherwise, could anyone give me a hint what would be a good way how to achieve this programmatically?

Many thanks for your help,
Andreas
Re: Adapt shape appearance based on complex constraints [message #1751374 is a reply to message #1750155] Mon, 09 January 2017 13:42 Go to previous message
Benoit Maggi is currently offline Benoit MaggiFriend
Messages: 129
Registered: March 2013
Location: Bordeaux, France
Senior Member
Hi Andreas,

I believe that it's indeed impossible with a papyrus css selector.

:Warning: , there is no clean-official way to achieve what you want, but here is one way

We managed to achieve a similar goal in SysML 1.4 by branching a custom css engine.
You may find the sources here and in the the afferent plugin.xml
https://git.eclipse.org/c/papyrus/org.eclipse.papyrus-sysml.git/tree/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/css/

The main goal is to add a rule in this file (sadly we had to extends many other files)
https://git.eclipse.org/c/papyrus/org.eclipse.papyrus-sysml.git/tree/diagram/org.eclipse.papyrus.sysml14.diagram.common/src/org/eclipse/papyrus/sysml14/diagram/common/css/dom/GMFSYSMLElementAdapter.java

For example deprecated
with
public static final String DEPRECATED = "deprecated"; //$NON-NLS-1$
     and the related code 
 


we can call
[deprecated=true] {
	lineColor: orange;
}


in the css file.

Regards,
Benoit
Previous Topic:Custom Palette for Sequence Diagram Editor
Next Topic:Programmatically get a list of registered profiles...
Goto Forum:
  


Current Time: Thu Apr 25 02:18:53 GMT 2024

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

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

Back to the top