Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/provider/BaseDiagramProvider.xtend')
-rw-r--r--plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/provider/BaseDiagramProvider.xtend17
1 files changed, 15 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/provider/BaseDiagramProvider.xtend b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/provider/BaseDiagramProvider.xtend
index 3d3f28823..33cab8742 100644
--- a/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/provider/BaseDiagramProvider.xtend
+++ b/plugins/org.eclipse.etrice.ui.behavior.fsm/src/org/eclipse/etrice/ui/behavior/fsm/provider/BaseDiagramProvider.xtend
@@ -18,7 +18,9 @@ import java.util.Collection
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.util.EcoreUtil
import org.eclipse.etrice.core.fsm.fSM.ModelComponent
+import org.eclipse.etrice.core.fsm.fSM.StateGraph
import org.eclipse.etrice.ui.behavior.fsm.editor.AbstractFSMDiagramTypeProvider
+import org.eclipse.etrice.ui.behavior.fsm.support.util.FSMSupportUtil
import org.eclipse.etrice.ui.common.base.support.DiagramAccessBase
import org.eclipse.graphiti.mm.pictograms.PictogramElement
import org.eclipse.graphiti.mm.pictograms.PictogramLink
@@ -33,6 +35,7 @@ import org.eclipse.graphiti.services.Graphiti
class BaseDiagramProvider {
val Multimap<EObject, PictogramElement> baseDiagramBusinessObjs = ArrayListMultimap.create
+ val fsmHelpers = FSMSupportUtil.instance.FSMHelpers
new(AbstractFSMDiagramTypeProvider diagramTypeProvider) {
val diagramAccess = diagramTypeProvider.injector.getInstance(DiagramAccessBase)
@@ -53,14 +56,24 @@ class BaseDiagramProvider {
// create mapping from business object to pictogram elements
EcoreUtil.ExternalCrossReferencer.find(baseDiagram).forEach [ targetEObj, eFeatureSetting |
eFeatureSetting.map[getEObject].filter(PictogramLink).map[pictogramElement].forEach [ pe |
- baseDiagramBusinessObjs.put(targetEObj, pe)
+ put(mc, targetEObj, pe)
]
]
// base diagram resource not needed anymore
rs.resources.remove(baseDiagram.eResource)
}
- ]
+ ]
+ }
+
+ private def put(ModelComponent mc, EObject obj, PictogramElement value) {
+ if (obj instanceof StateGraph) {
+ if (fsmHelpers.isTopLevel(obj)) {
+ // to find the initial point of the TOP level we need the ModelComponent's stateMachine as a key
+ baseDiagramBusinessObjs.put(mc.stateMachine, value)
+ }
+ }
+ baseDiagramBusinessObjs.put(obj, value)
}
def Collection<PictogramElement> getPictograms(EObject roomObj) {

Back to the top