|
Re: Conditional Style for relation based edges? [message #1690302 is a reply to message #1689986] |
Thu, 26 March 2015 13:08 |
|
Le 24/03/2015 21:16, Wilbert Alberts a écrit :
> Hi,
Hi Wilberts,
>
> Let's assume that I'm creating a metamodel for statemachines. In short:
>
> A Statemachine contains States
> States contain Transitions
> Transitions refer to a target State.
>
> (I know that there are better ways to model state machines but this one
> illustrates my problem best.)
>
> I am able to create a state diagram based on Node mapping representing
> the States. I use a relation based edge mapping for representing the
> Transitions.
> So the source and target mappings are the StateNodeMappings,
> The target finder for the relation based edge is: self.transitions.target
>
> This indeed results in visualising the state machine.
>
> NOW: suppose that I want to color self transitions red. I suppose that I
> should add a conditional style to the relation based edge mapping.
> However, the semantic element for that edge is the source state. How do
> I write a predicate for the conditional style that only applies to a
> subset of the transitions?
You can use the view variable in your predicate (and so navigate to
source, with sourceNode, and target , with targetNode, of this edge).
You have an example in ecoreTools [1] that uses this service [2].
>
> Does it even make sense to have a conditional style applied on a
> relation based edge (except for the fact that it might color all edges
> based on a property of the source state)?
>
> Greetings,
> Wilbert.
>
> (I know that in this case the solution is to use a element based edge
> based on the Transition itself and use the self.eContainer() als source
> finder expression. But I just want to know whether the reasoning above
> makes sense.)
>
>
Best regards,
[1]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/description/ecore.odesign#n94
[2]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/src/org/eclipse/emf/ecoretools/design/service/DesignServices.java#n255
--
Laurent Redor - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Laurent Redor - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.05407 seconds