diff options
author | Henrik Rentz-Reichert | 2018-01-26 17:07:44 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2018-01-26 17:07:44 +0000 |
commit | f9269fca01565289573b4e4303c6b1c8eaaf7bda (patch) | |
tree | 0ce36fac913a5cd3c378c6be34556f0fbcead1b4 | |
parent | a008fa139046f1b68c497edcaa1e89f3e2e34033 (diff) | |
download | org.eclipse.etrice-f9269fca01565289573b4e4303c6b1c8eaaf7bda.tar.gz org.eclipse.etrice-f9269fca01565289573b4e4303c6b1c8eaaf7bda.tar.xz org.eclipse.etrice-f9269fca01565289573b4e4303c6b1c8eaaf7bda.zip |
fixed problem with RefinedTransitions in diagrams
The StateGraphContext needs to provide also target transitions of
RefinedTransitions in addition to regular transitions.
Change-Id: Ifa3aba9365ebd4337b921de3c328219bf2d5c2ba
2 files changed, 22 insertions, 8 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.xtend b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.xtend index 64243cbfd..97ee76065 100644 --- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.xtend +++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.xtend @@ -21,6 +21,7 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph import org.eclipse.etrice.ui.behavior.fsm.editor.AbstractFSMDiagramTypeProvider import org.eclipse.etrice.ui.behavior.fsm.provider.BaseDiagramProvider import org.eclipse.etrice.ui.behavior.fsm.provider.GenModelProvider +import org.eclipse.etrice.core.fsm.fSM.RefinedTransition /** * StateGraphContext based on newfsmgen. @@ -52,7 +53,7 @@ class GenModelStateGraphContext implements IStateGraphContext { } override getChildren() { - graph.nodes.filter[it.subgraph != null].map[new GenModelStateGraphContext(it.subgraph, this) as IStateGraphContext].toList + graph.nodes.filter[it.subgraph !== null].map[new GenModelStateGraphContext(it.subgraph, this) as IStateGraphContext].toList } override getInitialPoint() { @@ -81,7 +82,10 @@ class GenModelStateGraphContext implements IStateGraphContext { } override getTransitions() { - graph.links.map[it.transition].filter(Transition).toList + val baseTransitions = graph.links.map[it.transition] + + // we take the union of Transitions and targets of RefinedTransitions + (baseTransitions.filter(Transition) + baseTransitions.filter(RefinedTransition).map[target]).toList } }
\ No newline at end of file diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.java b/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.java index 9aef9f550..c3fe947d4 100644 --- a/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.java +++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/xtend-gen/org/eclipse/etrice/ui/behavior/fsm/support/GenModelStateGraphContext.java @@ -10,11 +10,11 @@ */ package org.eclipse.etrice.ui.behavior.fsm.support; -import com.google.common.base.Objects; import com.google.common.collect.Iterables; import java.util.List; import org.eclipse.etrice.core.fsm.fSM.ChoicePoint; import org.eclipse.etrice.core.fsm.fSM.InitialTransition; +import org.eclipse.etrice.core.fsm.fSM.RefinedTransition; import org.eclipse.etrice.core.fsm.fSM.State; import org.eclipse.etrice.core.fsm.fSM.StateGraph; import org.eclipse.etrice.core.fsm.fSM.StateGraphNode; @@ -71,7 +71,7 @@ public class GenModelStateGraphContext implements IStateGraphContext { public List<IStateGraphContext> getChildren() { final Function1<Node, Boolean> _function = (Node it) -> { Graph _subgraph = it.getSubgraph(); - return Boolean.valueOf((!Objects.equal(_subgraph, null))); + return Boolean.valueOf((_subgraph != null)); }; final Function1<Node, IStateGraphContext> _function_1 = (Node it) -> { Graph _subgraph = it.getSubgraph(); @@ -129,9 +129,19 @@ public class GenModelStateGraphContext implements IStateGraphContext { @Override public List<Transition> getTransitions() { - final Function1<Link, TransitionBase> _function = (Link it) -> { - return it.getTransition(); - }; - return IterableExtensions.<Transition>toList(Iterables.<Transition>filter(ListExtensions.<Link, TransitionBase>map(this.graph.getLinks(), _function), Transition.class)); + List<Transition> _xblockexpression = null; + { + final Function1<Link, TransitionBase> _function = (Link it) -> { + return it.getTransition(); + }; + final List<TransitionBase> baseTransitions = ListExtensions.<Link, TransitionBase>map(this.graph.getLinks(), _function); + Iterable<Transition> _filter = Iterables.<Transition>filter(baseTransitions, Transition.class); + final Function1<RefinedTransition, Transition> _function_1 = (RefinedTransition it) -> { + return it.getTarget(); + }; + Iterable<Transition> _map = IterableExtensions.<RefinedTransition, Transition>map(Iterables.<RefinedTransition>filter(baseTransitions, RefinedTransition.class), _function_1); + _xblockexpression = IterableExtensions.<Transition>toList(Iterables.<Transition>concat(_filter, _map)); + } + return _xblockexpression; } } |