Просмотр исходного кода

Refactoring due to model changes.
Added lockable undo/redo actions .

markus.muehlbrandt@itemis.de 14 лет назад
Родитель
Сommit
184b733d71
54 измененных файлов с 1274 добавлено и 2461 удалено
  1. 3 0
      plugins/org.yakindu.sct.model.sgraph.edit/plugin.properties
  2. 0 238
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/AbstractStateItemProvider.java
  3. 3 24
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/FinalStateItemProvider.java
  4. 0 5
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/RegionItemProvider.java
  5. 0 24
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/SGraphItemProviderAdapterFactory.java
  6. 157 1
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/StateItemProvider.java
  7. 0 171
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/SubmachineStateItemProvider.java
  8. 4 5
      plugins/org.yakindu.sct.model.sgraph.resource/src/org/yakindu/sct/model/sgraph/resource/services/StateInjectionService.java
  9. 106 107
      plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore
  10. 77 69
      plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.genmodel
  11. 0 33
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/AbstractState.java
  12. 3 1
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/FinalState.java
  13. 0 9
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphFactory.java
  14. 103 277
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphPackage.java
  15. 88 2
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/State.java
  16. 0 64
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SubmachineState.java
  17. 0 357
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/AbstractStateImpl.java
  18. 2 1
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/FinalStateImpl.java
  19. 0 12
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SGraphFactoryImpl.java
  20. 37 48
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SGraphPackageImpl.java
  21. 384 1
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/StateImpl.java
  22. 0 168
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SubmachineStateImpl.java
  23. 105 106
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/sgraph.ecore
  24. 0 38
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphAdapterFactory.java
  25. 0 60
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphSwitch.java
  26. 12 95
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphValidator.java
  27. 0 6
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/builder/SGraphBuilder.java
  28. 14 11
      plugins/org.yakindu.sct.ui.editor/plugin.xml
  29. 1 3
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/StatePropertySectionFilter.java
  30. 22 3
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/edithelper/StateEditHelper.java
  31. 0 47
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/edithelper/SubmachineStateEditHelper.java
  32. 0 46
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/CompositeStateFigure.java
  33. 11 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/StateFigure.java
  34. 0 127
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/SubStatechartFigure.java
  35. 3 3
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/AbstractStateEditPart.java
  36. 15 6
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/StateEditPart.java
  37. 30 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/StateNameEditPart.java
  38. 0 48
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/SubmachineStateEditPart.java
  39. 0 70
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/SubmachineStateNameEditPart.java
  40. 0 77
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/AbstractStateViewFactory.java
  41. 34 4
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/StateViewFactory.java
  42. 0 26
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/SubmachineStateViewFactory.java
  43. 5 5
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/pictogram/OpenSubstatechartHandler.java
  44. 9 5
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/pictogram/PictogramEditPolicy.java
  45. 2 2
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/pictogram/SubchartPictogram.java
  46. 4 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/StatePropertySection.java
  47. 6 6
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/SubmachineSelectionDialogPropertyDescriptor.java
  48. 0 33
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/SubmachineStatePropertySection.java
  49. 1 1
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/SemanticHints.java
  50. 25 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramContributionItemProvider.java
  51. 4 5
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramEditPartProvider.java
  52. 3 5
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramViewProvider.java
  53. 0 5
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/utils/SemanticHintUtil.java
  54. 1 1
      plugins/org.yakindu.sct.ui.integration.stext/src/org/yakindu/sct/ui/integration/stext/StateExpressionProvider.java

+ 3 - 0
plugins/org.yakindu.sct.model.sgraph.edit/plugin.properties

@@ -130,3 +130,6 @@ _UI_CompositeState_orthogonal_feature = Orthogonal
 _UI_SubmachineState_substatechart_feature = Substatechart
 _UI_AbstractState_type = Abstract State
 _UI_State_orthogonal_feature = Orthogonal
+_UI_State_submachine_feature = Submachine
+_UI_State_simple_feature = Simple
+_UI_State_composite_feature = Composite

+ 0 - 238
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/AbstractStateItemProvider.java

@@ -1,238 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.model.sgraph.provider;
-
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.yakindu.sct.model.sgraph.AbstractState;
-import org.yakindu.sct.model.sgraph.SGraphFactory;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-
-/**
- * This is the item provider adapter for a {@link org.yakindu.sct.model.sgraph.AbstractState} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class AbstractStateItemProvider
-	extends VertexItemProvider
-	implements
-		IEditingDomainItemProvider,
-		IStructuredItemContentProvider,
-		ITreeItemContentProvider,
-		IItemLabelProvider,
-		IItemPropertySource {
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
-
-	/**
-	 * This constructs an instance from a factory and a notifier.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public AbstractStateItemProvider(AdapterFactory adapterFactory) {
-		super(adapterFactory);
-	}
-
-	/**
-	 * This returns the property descriptors for the adapted class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
-		if (itemPropertyDescriptors == null) {
-			super.getPropertyDescriptors(object);
-
-			addExpressionPropertyDescriptor(object);
-			addReactionsPropertyDescriptor(object);
-		}
-		return itemPropertyDescriptors;
-	}
-
-	/**
-	 * This adds a property descriptor for the Expression feature.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected void addExpressionPropertyDescriptor(Object object) {
-		itemPropertyDescriptors.add
-			(createItemPropertyDescriptor
-				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
-				 getResourceLocator(),
-				 getString("_UI_ExpressionElement_expression_feature"),
-				 getString("_UI_PropertyDescriptor_description", "_UI_ExpressionElement_expression_feature", "_UI_ExpressionElement_type"),
-				 SGraphPackage.Literals.EXPRESSION_ELEMENT__EXPRESSION,
-				 true,
-				 false,
-				 false,
-				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
-				 null,
-				 null));
-	}
-
-	/**
-	 * This adds a property descriptor for the Reactions feature.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected void addReactionsPropertyDescriptor(Object object) {
-		itemPropertyDescriptors.add
-			(createItemPropertyDescriptor
-				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
-				 getResourceLocator(),
-				 getString("_UI_ReactiveElement_reactions_feature"),
-				 getString("_UI_PropertyDescriptor_description", "_UI_ReactiveElement_reactions_feature", "_UI_ReactiveElement_type"),
-				 SGraphPackage.Literals.REACTIVE_ELEMENT__REACTIONS,
-				 false,
-				 false,
-				 false,
-				 null,
-				 null,
-				 null));
-	}
-
-	/**
-	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
-	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
-	 * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
-		if (childrenFeatures == null) {
-			super.getChildrenFeatures(object);
-			childrenFeatures.add(SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS);
-			childrenFeatures.add(SGraphPackage.Literals.SCOPED_ELEMENT__SCOPES);
-		}
-		return childrenFeatures;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	protected EStructuralFeature getChildFeature(Object object, Object child) {
-		// Check the type of the specified child object and return the proper feature to use for
-		// adding (see {@link AddCommand}) it as a child.
-
-		return super.getChildFeature(object, child);
-	}
-
-	/**
-	 * This returns the label text for the adapted class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public String getText(Object object) {
-		String label = ((AbstractState)object).getName();
-		return label == null || label.length() == 0 ?
-			getString("_UI_AbstractState_type") :
-			getString("_UI_AbstractState_type") + " " + label;
-	}
-
-	/**
-	 * This handles model notifications by calling {@link #updateChildren} to update any cached
-	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void notifyChanged(Notification notification) {
-		updateChildren(notification);
-
-		switch (notification.getFeatureID(AbstractState.class)) {
-			case SGraphPackage.ABSTRACT_STATE__EXPRESSION:
-				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
-				return;
-			case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS:
-			case SGraphPackage.ABSTRACT_STATE__SCOPES:
-				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
-				return;
-		}
-		super.notifyChanged(notification);
-	}
-
-	/**
-	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
-	 * that can be created under this object.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
-		super.collectNewChildDescriptors(newChildDescriptors, object);
-
-		newChildDescriptors.add
-			(createChildParameter
-				(SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS,
-				 SGraphFactory.eINSTANCE.createTransition()));
-
-		newChildDescriptors.add
-			(createChildParameter
-				(SGraphPackage.Literals.SCOPED_ELEMENT__SCOPES,
-				 SGraphFactory.eINSTANCE.createScope()));
-	}
-
-	/**
-	 * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
-		Object childFeature = feature;
-		Object childObject = child;
-
-		boolean qualify =
-			childFeature == SGraphPackage.Literals.VERTEX__OUTGOING_TRANSITIONS ||
-			childFeature == SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS;
-
-		if (qualify) {
-			return getString
-				("_UI_CreateChild_text2",
-				 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
-		}
-		return super.getCreateChildText(owner, feature, child, selection);
-	}
-
-}

+ 3 - 24
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/FinalStateItemProvider.java

@@ -16,12 +16,14 @@ import java.util.List;
 
 import org.eclipse.emf.common.notify.AdapterFactory;
 import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
 import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
 import org.eclipse.emf.edit.provider.IItemLabelProvider;
 import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
 import org.eclipse.emf.edit.provider.IItemPropertySource;
 import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
 import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
 import org.yakindu.sct.model.sgraph.FinalState;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
 
@@ -32,7 +34,7 @@ import org.yakindu.sct.model.sgraph.SGraphPackage;
  * @generated
  */
 public class FinalStateItemProvider
-	extends AbstractStateItemProvider
+	extends VertexItemProvider
 	implements
 		IEditingDomainItemProvider,
 		IStructuredItemContentProvider,
@@ -121,27 +123,4 @@ public class FinalStateItemProvider
 		super.collectNewChildDescriptors(newChildDescriptors, object);
 	}
 
-	/**
-	 * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
-		Object childFeature = feature;
-		Object childObject = child;
-
-		boolean qualify =
-			childFeature == SGraphPackage.Literals.VERTEX__OUTGOING_TRANSITIONS ||
-			childFeature == SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS;
-
-		if (qualify) {
-			return getString
-				("_UI_CreateChild_text2",
-				 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
-		}
-		return super.getCreateChildText(owner, feature, child, selection);
-	}
-
 }

+ 0 - 5
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/RegionItemProvider.java

@@ -221,11 +221,6 @@ public class RegionItemProvider
 			(createChildParameter
 				(SGraphPackage.Literals.REGION__VERTICES,
 				 SGraphFactory.eINSTANCE.createState()));
-
-		newChildDescriptors.add
-			(createChildParameter
-				(SGraphPackage.Literals.REGION__VERTICES,
-				 SGraphFactory.eINSTANCE.createSubmachineState()));
 	}
 
 }

+ 0 - 24
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/SGraphItemProviderAdapterFactory.java

@@ -337,29 +337,6 @@ public class SGraphItemProviderAdapterFactory extends SGraphAdapterFactory imple
 		return stateItemProvider;
 	}
 
-	/**
-	 * This keeps track of the one adapter used for all {@link org.yakindu.sct.model.sgraph.SubmachineState} instances.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected SubmachineStateItemProvider submachineStateItemProvider;
-
-	/**
-	 * This creates an adapter for a {@link org.yakindu.sct.model.sgraph.SubmachineState}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Adapter createSubmachineStateAdapter() {
-		if (submachineStateItemProvider == null) {
-			submachineStateItemProvider = new SubmachineStateItemProvider(this);
-		}
-
-		return submachineStateItemProvider;
-	}
-
 	/**
 	 * This returns the root adapter factory that contains this factory.
 	 * <!-- begin-user-doc -->
@@ -470,7 +447,6 @@ public class SGraphItemProviderAdapterFactory extends SGraphAdapterFactory imple
 		if (scopeItemProvider != null) scopeItemProvider.dispose();
 		if (synchronizationItemProvider != null) synchronizationItemProvider.dispose();
 		if (stateItemProvider != null) stateItemProvider.dispose();
-		if (submachineStateItemProvider != null) submachineStateItemProvider.dispose();
 	}
 
 }

+ 157 - 1
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/StateItemProvider.java

@@ -37,7 +37,7 @@ import org.yakindu.sct.model.sgraph.State;
  * @generated
  */
 public class StateItemProvider
-	extends AbstractStateItemProvider
+	extends VertexItemProvider
 	implements
 		IEditingDomainItemProvider,
 		IStructuredItemContentProvider,
@@ -72,11 +72,61 @@ public class StateItemProvider
 		if (itemPropertyDescriptors == null) {
 			super.getPropertyDescriptors(object);
 
+			addExpressionPropertyDescriptor(object);
+			addReactionsPropertyDescriptor(object);
 			addOrthogonalPropertyDescriptor(object);
+			addSubstatechartPropertyDescriptor(object);
+			addSubmachinePropertyDescriptor(object);
+			addSimplePropertyDescriptor(object);
+			addCompositePropertyDescriptor(object);
 		}
 		return itemPropertyDescriptors;
 	}
 
+	/**
+	 * This adds a property descriptor for the Expression feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addExpressionPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ExpressionElement_expression_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ExpressionElement_expression_feature", "_UI_ExpressionElement_type"),
+				 SGraphPackage.Literals.EXPRESSION_ELEMENT__EXPRESSION,
+				 true,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Reactions feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addReactionsPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_ReactiveElement_reactions_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_ReactiveElement_reactions_feature", "_UI_ReactiveElement_type"),
+				 SGraphPackage.Literals.REACTIVE_ELEMENT__REACTIONS,
+				 false,
+				 false,
+				 false,
+				 null,
+				 null,
+				 null));
+	}
+
 	/**
 	 * This adds a property descriptor for the Orthogonal feature.
 	 * <!-- begin-user-doc -->
@@ -99,6 +149,94 @@ public class StateItemProvider
 				 null));
 	}
 
+	/**
+	 * This adds a property descriptor for the Substatechart feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSubstatechartPropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_substatechart_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_substatechart_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__SUBSTATECHART,
+				 true,
+				 false,
+				 true,
+				 null,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Submachine feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSubmachinePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_submachine_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_submachine_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__SUBMACHINE,
+				 false,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Simple feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSimplePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_simple_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_simple_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__SIMPLE,
+				 true,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Composite feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addCompositePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_composite_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_composite_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__COMPOSITE,
+				 false,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
 	/**
 	 * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
 	 * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
@@ -111,6 +249,8 @@ public class StateItemProvider
 	public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
 		if (childrenFeatures == null) {
 			super.getChildrenFeatures(object);
+			childrenFeatures.add(SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS);
+			childrenFeatures.add(SGraphPackage.Literals.SCOPED_ELEMENT__SCOPES);
 			childrenFeatures.add(SGraphPackage.Literals.STATE__SUB_REGIONS);
 		}
 		return childrenFeatures;
@@ -166,9 +306,15 @@ public class StateItemProvider
 		updateChildren(notification);
 
 		switch (notification.getFeatureID(State.class)) {
+			case SGraphPackage.STATE__EXPRESSION:
 			case SGraphPackage.STATE__ORTHOGONAL:
+			case SGraphPackage.STATE__SUBMACHINE:
+			case SGraphPackage.STATE__SIMPLE:
+			case SGraphPackage.STATE__COMPOSITE:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
 				return;
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+			case SGraphPackage.STATE__SCOPES:
 			case SGraphPackage.STATE__SUB_REGIONS:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
 				return;
@@ -187,6 +333,16 @@ public class StateItemProvider
 	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
 		super.collectNewChildDescriptors(newChildDescriptors, object);
 
+		newChildDescriptors.add
+			(createChildParameter
+				(SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS,
+				 SGraphFactory.eINSTANCE.createTransition()));
+
+		newChildDescriptors.add
+			(createChildParameter
+				(SGraphPackage.Literals.SCOPED_ELEMENT__SCOPES,
+				 SGraphFactory.eINSTANCE.createScope()));
+
 		newChildDescriptors.add
 			(createChildParameter
 				(SGraphPackage.Literals.STATE__SUB_REGIONS,

+ 0 - 171
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/SubmachineStateItemProvider.java

@@ -1,171 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.model.sgraph.provider;
-
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-import org.yakindu.sct.model.sgraph.SubmachineState;
-
-/**
- * This is the item provider adapter for a {@link org.yakindu.sct.model.sgraph.SubmachineState} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class SubmachineStateItemProvider
-	extends AbstractStateItemProvider
-	implements
-		IEditingDomainItemProvider,
-		IStructuredItemContentProvider,
-		ITreeItemContentProvider,
-		IItemLabelProvider,
-		IItemPropertySource {
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
-
-	/**
-	 * This constructs an instance from a factory and a notifier.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public SubmachineStateItemProvider(AdapterFactory adapterFactory) {
-		super(adapterFactory);
-	}
-
-	/**
-	 * This returns the property descriptors for the adapted class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
-		if (itemPropertyDescriptors == null) {
-			super.getPropertyDescriptors(object);
-
-			addSubstatechartPropertyDescriptor(object);
-		}
-		return itemPropertyDescriptors;
-	}
-
-	/**
-	 * This adds a property descriptor for the Substatechart feature.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected void addSubstatechartPropertyDescriptor(Object object) {
-		itemPropertyDescriptors.add
-			(createItemPropertyDescriptor
-				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
-				 getResourceLocator(),
-				 getString("_UI_SubmachineState_substatechart_feature"),
-				 getString("_UI_PropertyDescriptor_description", "_UI_SubmachineState_substatechart_feature", "_UI_SubmachineState_type"),
-				 SGraphPackage.Literals.SUBMACHINE_STATE__SUBSTATECHART,
-				 true,
-				 false,
-				 true,
-				 null,
-				 null,
-				 null));
-	}
-
-	/**
-	 * This returns SubmachineState.gif.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object getImage(Object object) {
-		return overlayImage(object, getResourceLocator().getImage("full/obj16/SubmachineState"));
-	}
-
-	/**
-	 * This returns the label text for the adapted class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public String getText(Object object) {
-		String label = ((SubmachineState)object).getName();
-		return label == null || label.length() == 0 ?
-			getString("_UI_SubmachineState_type") :
-			getString("_UI_SubmachineState_type") + " " + label;
-	}
-
-	/**
-	 * This handles model notifications by calling {@link #updateChildren} to update any cached
-	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void notifyChanged(Notification notification) {
-		updateChildren(notification);
-		super.notifyChanged(notification);
-	}
-
-	/**
-	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
-	 * that can be created under this object.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
-		super.collectNewChildDescriptors(newChildDescriptors, object);
-	}
-
-	/**
-	 * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
-		Object childFeature = feature;
-		Object childObject = child;
-
-		boolean qualify =
-			childFeature == SGraphPackage.Literals.VERTEX__OUTGOING_TRANSITIONS ||
-			childFeature == SGraphPackage.Literals.REACTIVE_ELEMENT__LOCAL_REACTIONS;
-
-		if (qualify) {
-			return getString
-				("_UI_CreateChild_text2",
-				 new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) });
-		}
-		return super.getCreateChildText(owner, feature, child, selection);
-	}
-
-}

+ 4 - 5
plugins/org.yakindu.sct.model.sgraph.resource/src/org/yakindu/sct/model/sgraph/resource/services/StateInjectionService.java

@@ -13,7 +13,6 @@ package org.yakindu.sct.model.sgraph.resource.services;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EStructuralFeature;
-import org.yakindu.sct.model.sgraph.AbstractState;
 import org.yakindu.sct.model.sgraph.Declaration;
 import org.yakindu.sct.model.sgraph.SGraphFactory;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
@@ -32,10 +31,10 @@ import de.itemis.xtext.utils.gmf.resource.IMemberInjectionService;
  * 
  */
 public class StateInjectionService extends
-		AbstractXtextMemberInjectionService<AbstractState, SimpleScope> {
+		AbstractXtextMemberInjectionService<State, SimpleScope> {
 
 	@Override
-	public String getExpression(AbstractState object) {
+	public String getExpression(State object) {
 		return object.getExpression();
 	}
 
@@ -45,7 +44,7 @@ public class StateInjectionService extends
 	}
 
 	@Override
-	public void setFeatures(AbstractState original, SimpleScope rootAST) {
+	public void setFeatures(State original, SimpleScope rootAST) {
 		Scope localScope = SGraphFactory.eINSTANCE.createScope();
 		EList<Declaration> declarations = rootAST.getDeclarations();
 		localScope.getDeclarations().addAll(declarations);
@@ -54,7 +53,7 @@ public class StateInjectionService extends
 	}
 
 	public boolean isServiceFor(EObject object) {
-		return object instanceof AbstractState;
+		return object instanceof State;
 	}
 
 	public EStructuralFeature getSourceFeature() {

+ 106 - 107
plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore

@@ -1,107 +1,106 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="sgraph"
-    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
-  <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
-        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="ExactlyOneInitialState"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
-        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//AbstractState"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
-        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
-        containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
-        containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
-    <eLiterals name="initial" literal="INITIAL"/>
-    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
-    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
-        eType="#//Reaction" changeable="false" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
-        eType="#//Reaction" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Scope">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
-        eType="#//Declaration" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
-        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
-        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
-        derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
-        eType="#//Scope" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="AbstractState" abstract="true" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="NameIsNotEmpty"/>
-    </eAnnotations>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//AbstractState">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
-        upperBound="-1" eType="#//Region" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="SubmachineState" eSuperTypes="#//AbstractState">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="SubStatechartExists SubStatechartIsNotACycle"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
-  </eClassifiers>
-</ecore:EPackage>
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="sgraph"
+    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
+  <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
+        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="ExactlyOneInitialState"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
+        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
+        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
+        containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
+        containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
+    <eLiterals name="initial" literal="INITIAL"/>
+    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
+    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
+        eType="#//Reaction" changeable="false" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
+        eType="#//Reaction" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Scope">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
+        eType="#//Declaration" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
+        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
+        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
+        derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
+        eType="#//Scope" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="NameIsNotEmpty"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
+        upperBound="-1" eType="#//Region" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachine" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="simple" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="composite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+  </eClassifiers>
+</ecore:EPackage>

+ 77 - 69
plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.genmodel

@@ -1,69 +1,77 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
-    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2011 committers of YAKINDU and others.&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;Contributors:&#xD;&#xA;committers of YAKINDU - initial API and implementation&#xD;&#xA;"
-    modelDirectory="/org.yakindu.sct.model.sgraph/src" modelPluginID="org.yakindu.sct.model.sgraph"
-    modelName="SGraph" importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0">
-  <foreignModel>sgraph.ecore</foreignModel>
-  <genPackages prefix="SGraph" basePackage="org.yakindu.sct.model" disposableProviderFactory="true"
-      loadInitialization="true" ecorePackage="sgraph.ecore#/">
-    <genEnums typeSafeEnumCompatible="false" ecoreEnum="sgraph.ecore#//EntryKind">
-      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/initial"/>
-      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/shallowHistory"/>
-      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/deepHistory"/>
-    </genEnums>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Pseudostate"/>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Vertex">
-      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/parentRegion"/>
-      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/incomingTransitions"/>
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/outgoingTransitions"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//NamedElement">
-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//NamedElement/name"/>
-    </genClasses>
-    <genClasses ecoreClass="sgraph.ecore#//Region">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Region/vertices"/>
-    </genClasses>
-    <genClasses ecoreClass="sgraph.ecore#//Transition">
-      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//Transition/target"/>
-      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Transition/source"/>
-    </genClasses>
-    <genClasses ecoreClass="sgraph.ecore#//FinalState"/>
-    <genClasses ecoreClass="sgraph.ecore#//State">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//State/subRegions"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Variable"/>
-    <genClasses ecoreClass="sgraph.ecore#//Junction"/>
-    <genClasses ecoreClass="sgraph.ecore#//Event"/>
-    <genClasses ecoreClass="sgraph.ecore#//Choice"/>
-    <genClasses ecoreClass="sgraph.ecore#//Statechart">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Statechart/regions"/>
-    </genClasses>
-    <genClasses ecoreClass="sgraph.ecore#//Entry">
-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Entry/kind"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Trigger"/>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Effect"/>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//ExpressionElement">
-      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//ExpressionElement/expression"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Declaration"/>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//Reaction">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Reaction/trigger"/>
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Reaction/effect"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//ReactiveElement">
-      <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//ReactiveElement/reactions"/>
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//ReactiveElement/localReactions"/>
-    </genClasses>
-    <genClasses ecoreClass="sgraph.ecore#//Exit"/>
-    <genClasses ecoreClass="sgraph.ecore#//Scope">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Scope/declarations"/>
-      <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Scope/events"/>
-      <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Scope/variables"/>
-    </genClasses>
-    <genClasses image="false" ecoreClass="sgraph.ecore#//ScopedElement">
-      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//ScopedElement/scopes"/>
-    </genClasses>
-  </genPackages>
-</genmodel:GenModel>
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2011 committers of YAKINDU and others.&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;Contributors:&#xD;&#xA;committers of YAKINDU - initial API and implementation&#xD;&#xA;"
+    modelDirectory="/org.yakindu.sct.model.sgraph/src" modelPluginID="org.yakindu.sct.model.sgraph"
+    modelName="SGraph" importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0">
+  <foreignModel>sgraph.ecore</foreignModel>
+  <genPackages prefix="SGraph" basePackage="org.yakindu.sct.model" disposableProviderFactory="true"
+      loadInitialization="true" ecorePackage="sgraph.ecore#/">
+    <genEnums typeSafeEnumCompatible="false" ecoreEnum="sgraph.ecore#//EntryKind">
+      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/initial"/>
+      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/shallowHistory"/>
+      <genEnumLiterals ecoreEnumLiteral="sgraph.ecore#//EntryKind/deepHistory"/>
+    </genEnums>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Pseudostate"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Vertex">
+      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/parentRegion"/>
+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/incomingTransitions"/>
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Vertex/outgoingTransitions"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//NamedElement">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//NamedElement/name"/>
+    </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//Region">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Region/vertices"/>
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Region/priority"/>
+    </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//Transition">
+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//Transition/target"/>
+      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Transition/source"/>
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Transition/priority"/>
+    </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//FinalState"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Variable"/>
+    <genClasses ecoreClass="sgraph.ecore#//Junction"/>
+    <genClasses ecoreClass="sgraph.ecore#//Event"/>
+    <genClasses ecoreClass="sgraph.ecore#//Choice"/>
+    <genClasses ecoreClass="sgraph.ecore#//Statechart">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Statechart/regions"/>
+    </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//Entry">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//Entry/kind"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Trigger"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Effect"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//ExpressionElement">
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//ExpressionElement/expression"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Declaration"/>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//Reaction">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Reaction/trigger"/>
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Reaction/effect"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//ReactiveElement">
+      <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//ReactiveElement/reactions"/>
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//ReactiveElement/localReactions"/>
+    </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//Exit"/>
+    <genClasses ecoreClass="sgraph.ecore#//Scope">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//Scope/declarations"/>
+      <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Scope/events"/>
+      <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference sgraph.ecore#//Scope/variables"/>
+    </genClasses>
+    <genClasses image="false" ecoreClass="sgraph.ecore#//ScopedElement">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//ScopedElement/scopes"/>
+    </genClasses>
+    <genClasses ecoreClass="sgraph.ecore#//Synchronization"/>
+    <genClasses ecoreClass="sgraph.ecore#//State">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference sgraph.ecore#//State/subRegions"/>
+      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/orthogonal"/>
+      <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference sgraph.ecore#//State/substatechart"/>
+      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/submachine"/>
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/simple"/>
+      <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute sgraph.ecore#//State/composite"/>
+    </genClasses>
+  </genPackages>
+</genmodel:GenModel>

+ 0 - 33
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/AbstractState.java

@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.model.sgraph;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract State</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.yakindu.sct.model.sgraph.SGraphPackage#getAbstractState()
- * @model abstract="true"
- *        annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NameIsNotEmpty'"
- * @generated
- */
-public interface AbstractState extends Vertex, ExpressionElement, ReactiveElement, ScopedElement {
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
-
-} // AbstractState

+ 3 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/FinalState.java

@@ -10,6 +10,8 @@
  */
 package org.yakindu.sct.model.sgraph;
 
+import org.eclipse.emf.ecore.EObject;
+
 
 /**
  * <!-- begin-user-doc -->
@@ -21,7 +23,7 @@ package org.yakindu.sct.model.sgraph;
  * @model
  * @generated
  */
-public interface FinalState extends AbstractState {
+public interface FinalState extends Vertex {
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 0 - 9
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphFactory.java

@@ -135,15 +135,6 @@ public interface SGraphFactory extends EFactory {
 	 */
 	State createState();
 
-	/**
-	 * Returns a new object of class '<em>Submachine State</em>'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return a new object of class '<em>Submachine State</em>'.
-	 * @generated
-	 */
-	SubmachineState createSubmachineState();
-
 	/**
 	 * Returns the package supported by this factory.
 	 * <!-- begin-user-doc -->

+ 103 - 277
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphPackage.java

@@ -356,97 +356,6 @@ public interface SGraphPackage extends EPackage {
 	 */
 	int TRANSITION_FEATURE_COUNT = EXPRESSION_ELEMENT_FEATURE_COUNT + 5;
 
-	/**
-	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.impl.AbstractStateImpl <em>Abstract State</em>}' class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see org.yakindu.sct.model.sgraph.impl.AbstractStateImpl
-	 * @see org.yakindu.sct.model.sgraph.impl.SGraphPackageImpl#getAbstractState()
-	 * @generated
-	 */
-	int ABSTRACT_STATE = 22;
-
-	/**
-	 * The feature id for the '<em><b>Name</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__NAME = VERTEX__NAME;
-
-	/**
-	 * The feature id for the '<em><b>Parent Region</b></em>' container reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__PARENT_REGION = VERTEX__PARENT_REGION;
-
-	/**
-	 * The feature id for the '<em><b>Incoming Transitions</b></em>' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__INCOMING_TRANSITIONS = VERTEX__INCOMING_TRANSITIONS;
-
-	/**
-	 * The feature id for the '<em><b>Outgoing Transitions</b></em>' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__OUTGOING_TRANSITIONS = VERTEX__OUTGOING_TRANSITIONS;
-
-	/**
-	 * The feature id for the '<em><b>Expression</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__EXPRESSION = VERTEX_FEATURE_COUNT + 0;
-
-	/**
-	 * The feature id for the '<em><b>Reactions</b></em>' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__REACTIONS = VERTEX_FEATURE_COUNT + 1;
-
-	/**
-	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__LOCAL_REACTIONS = VERTEX_FEATURE_COUNT + 2;
-
-	/**
-	 * The feature id for the '<em><b>Scopes</b></em>' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE__SCOPES = VERTEX_FEATURE_COUNT + 3;
-
-	/**
-	 * The number of structural features of the '<em>Abstract State</em>' class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int ABSTRACT_STATE_FEATURE_COUNT = VERTEX_FEATURE_COUNT + 4;
-
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.impl.StateImpl <em>State</em>}' class.
 	 * <!-- begin-user-doc -->
@@ -455,7 +364,7 @@ public interface SGraphPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sgraph.impl.SGraphPackageImpl#getState()
 	 * @generated
 	 */
-	int STATE = 23;
+	int STATE = 22;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.impl.FinalStateImpl <em>Final State</em>}' class.
@@ -474,7 +383,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int FINAL_STATE__NAME = ABSTRACT_STATE__NAME;
+	int FINAL_STATE__NAME = VERTEX__NAME;
 
 	/**
 	 * The feature id for the '<em><b>Parent Region</b></em>' container reference.
@@ -483,7 +392,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int FINAL_STATE__PARENT_REGION = ABSTRACT_STATE__PARENT_REGION;
+	int FINAL_STATE__PARENT_REGION = VERTEX__PARENT_REGION;
 
 	/**
 	 * The feature id for the '<em><b>Incoming Transitions</b></em>' reference list.
@@ -492,7 +401,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int FINAL_STATE__INCOMING_TRANSITIONS = ABSTRACT_STATE__INCOMING_TRANSITIONS;
+	int FINAL_STATE__INCOMING_TRANSITIONS = VERTEX__INCOMING_TRANSITIONS;
 
 	/**
 	 * The feature id for the '<em><b>Outgoing Transitions</b></em>' containment reference list.
@@ -501,43 +410,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int FINAL_STATE__OUTGOING_TRANSITIONS = ABSTRACT_STATE__OUTGOING_TRANSITIONS;
-
-	/**
-	 * The feature id for the '<em><b>Expression</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int FINAL_STATE__EXPRESSION = ABSTRACT_STATE__EXPRESSION;
-
-	/**
-	 * The feature id for the '<em><b>Reactions</b></em>' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int FINAL_STATE__REACTIONS = ABSTRACT_STATE__REACTIONS;
-
-	/**
-	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int FINAL_STATE__LOCAL_REACTIONS = ABSTRACT_STATE__LOCAL_REACTIONS;
-
-	/**
-	 * The feature id for the '<em><b>Scopes</b></em>' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int FINAL_STATE__SCOPES = ABSTRACT_STATE__SCOPES;
+	int FINAL_STATE__OUTGOING_TRANSITIONS = VERTEX__OUTGOING_TRANSITIONS;
 
 	/**
 	 * The number of structural features of the '<em>Final State</em>' class.
@@ -546,7 +419,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int FINAL_STATE_FEATURE_COUNT = ABSTRACT_STATE_FEATURE_COUNT + 0;
+	int FINAL_STATE_FEATURE_COUNT = VERTEX_FEATURE_COUNT + 0;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.impl.DeclarationImpl <em>Declaration</em>}' class.
@@ -1182,7 +1055,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__NAME = ABSTRACT_STATE__NAME;
+	int STATE__NAME = VERTEX__NAME;
 
 	/**
 	 * The feature id for the '<em><b>Parent Region</b></em>' container reference.
@@ -1191,7 +1064,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__PARENT_REGION = ABSTRACT_STATE__PARENT_REGION;
+	int STATE__PARENT_REGION = VERTEX__PARENT_REGION;
 
 	/**
 	 * The feature id for the '<em><b>Incoming Transitions</b></em>' reference list.
@@ -1200,7 +1073,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__INCOMING_TRANSITIONS = ABSTRACT_STATE__INCOMING_TRANSITIONS;
+	int STATE__INCOMING_TRANSITIONS = VERTEX__INCOMING_TRANSITIONS;
 
 	/**
 	 * The feature id for the '<em><b>Outgoing Transitions</b></em>' containment reference list.
@@ -1209,7 +1082,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__OUTGOING_TRANSITIONS = ABSTRACT_STATE__OUTGOING_TRANSITIONS;
+	int STATE__OUTGOING_TRANSITIONS = VERTEX__OUTGOING_TRANSITIONS;
 
 	/**
 	 * The feature id for the '<em><b>Expression</b></em>' attribute.
@@ -1218,7 +1091,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__EXPRESSION = ABSTRACT_STATE__EXPRESSION;
+	int STATE__EXPRESSION = VERTEX_FEATURE_COUNT + 0;
 
 	/**
 	 * The feature id for the '<em><b>Reactions</b></em>' reference list.
@@ -1227,7 +1100,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__REACTIONS = ABSTRACT_STATE__REACTIONS;
+	int STATE__REACTIONS = VERTEX_FEATURE_COUNT + 1;
 
 	/**
 	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
@@ -1236,7 +1109,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__LOCAL_REACTIONS = ABSTRACT_STATE__LOCAL_REACTIONS;
+	int STATE__LOCAL_REACTIONS = VERTEX_FEATURE_COUNT + 2;
 
 	/**
 	 * The feature id for the '<em><b>Scopes</b></em>' containment reference list.
@@ -1245,7 +1118,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__SCOPES = ABSTRACT_STATE__SCOPES;
+	int STATE__SCOPES = VERTEX_FEATURE_COUNT + 3;
 
 	/**
 	 * The feature id for the '<em><b>Sub Regions</b></em>' containment reference list.
@@ -1254,7 +1127,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__SUB_REGIONS = ABSTRACT_STATE_FEATURE_COUNT + 0;
+	int STATE__SUB_REGIONS = VERTEX_FEATURE_COUNT + 4;
 
 	/**
 	 * The feature id for the '<em><b>Orthogonal</b></em>' attribute.
@@ -1263,116 +1136,52 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE__ORTHOGONAL = ABSTRACT_STATE_FEATURE_COUNT + 1;
-
-	/**
-	 * The number of structural features of the '<em>State</em>' class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int STATE_FEATURE_COUNT = ABSTRACT_STATE_FEATURE_COUNT + 2;
-
-	/**
-	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.impl.SubmachineStateImpl <em>Submachine State</em>}' class.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see org.yakindu.sct.model.sgraph.impl.SubmachineStateImpl
-	 * @see org.yakindu.sct.model.sgraph.impl.SGraphPackageImpl#getSubmachineState()
-	 * @generated
-	 */
-	int SUBMACHINE_STATE = 24;
-
-	/**
-	 * The feature id for the '<em><b>Name</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int SUBMACHINE_STATE__NAME = ABSTRACT_STATE__NAME;
+	int STATE__ORTHOGONAL = VERTEX_FEATURE_COUNT + 5;
 
 	/**
-	 * The feature id for the '<em><b>Parent Region</b></em>' container reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int SUBMACHINE_STATE__PARENT_REGION = ABSTRACT_STATE__PARENT_REGION;
-
-	/**
-	 * The feature id for the '<em><b>Incoming Transitions</b></em>' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int SUBMACHINE_STATE__INCOMING_TRANSITIONS = ABSTRACT_STATE__INCOMING_TRANSITIONS;
-
-	/**
-	 * The feature id for the '<em><b>Outgoing Transitions</b></em>' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int SUBMACHINE_STATE__OUTGOING_TRANSITIONS = ABSTRACT_STATE__OUTGOING_TRANSITIONS;
-
-	/**
-	 * The feature id for the '<em><b>Expression</b></em>' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 * @ordered
-	 */
-	int SUBMACHINE_STATE__EXPRESSION = ABSTRACT_STATE__EXPRESSION;
-
-	/**
-	 * The feature id for the '<em><b>Reactions</b></em>' reference list.
+	 * The feature id for the '<em><b>Substatechart</b></em>' reference.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int SUBMACHINE_STATE__REACTIONS = ABSTRACT_STATE__REACTIONS;
+	int STATE__SUBSTATECHART = VERTEX_FEATURE_COUNT + 6;
 
 	/**
-	 * The feature id for the '<em><b>Local Reactions</b></em>' containment reference list.
+	 * The feature id for the '<em><b>Submachine</b></em>' attribute.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int SUBMACHINE_STATE__LOCAL_REACTIONS = ABSTRACT_STATE__LOCAL_REACTIONS;
+	int STATE__SUBMACHINE = VERTEX_FEATURE_COUNT + 7;
 
 	/**
-	 * The feature id for the '<em><b>Scopes</b></em>' containment reference list.
+	 * The feature id for the '<em><b>Simple</b></em>' attribute.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int SUBMACHINE_STATE__SCOPES = ABSTRACT_STATE__SCOPES;
+	int STATE__SIMPLE = VERTEX_FEATURE_COUNT + 8;
 
 	/**
-	 * The feature id for the '<em><b>Substatechart</b></em>' reference.
+	 * The feature id for the '<em><b>Composite</b></em>' attribute.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int SUBMACHINE_STATE__SUBSTATECHART = ABSTRACT_STATE_FEATURE_COUNT + 0;
+	int STATE__COMPOSITE = VERTEX_FEATURE_COUNT + 9;
 
 	/**
-	 * The number of structural features of the '<em>Submachine State</em>' class.
+	 * The number of structural features of the '<em>State</em>' class.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 * @ordered
 	 */
-	int SUBMACHINE_STATE_FEATURE_COUNT = ABSTRACT_STATE_FEATURE_COUNT + 1;
+	int STATE_FEATURE_COUNT = VERTEX_FEATURE_COUNT + 10;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.EntryKind <em>Entry Kind</em>}' enum.
@@ -1382,7 +1191,7 @@ public interface SGraphPackage extends EPackage {
 	 * @see org.yakindu.sct.model.sgraph.impl.SGraphPackageImpl#getEntryKind()
 	 * @generated
 	 */
-	int ENTRY_KIND = 25;
+	int ENTRY_KIND = 23;
 
 
 	/**
@@ -1576,6 +1385,50 @@ public interface SGraphPackage extends EPackage {
 	 */
 	EAttribute getState_Orthogonal();
 
+	/**
+	 * Returns the meta object for the reference '{@link org.yakindu.sct.model.sgraph.State#getSubstatechart <em>Substatechart</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the reference '<em>Substatechart</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#getSubstatechart()
+	 * @see #getState()
+	 * @generated
+	 */
+	EReference getState_Substatechart();
+
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sgraph.State#isSubmachine <em>Submachine</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Submachine</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#isSubmachine()
+	 * @see #getState()
+	 * @generated
+	 */
+	EAttribute getState_Submachine();
+
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sgraph.State#isSimple <em>Simple</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Simple</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#isSimple()
+	 * @see #getState()
+	 * @generated
+	 */
+	EAttribute getState_Simple();
+
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sgraph.State#isComposite <em>Composite</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Composite</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#isComposite()
+	 * @see #getState()
+	 * @generated
+	 */
+	EAttribute getState_Composite();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sgraph.Variable <em>Variable</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1857,37 +1710,6 @@ public interface SGraphPackage extends EPackage {
 	 */
 	EClass getSynchronization();
 
-	/**
-	 * Returns the meta object for class '{@link org.yakindu.sct.model.sgraph.AbstractState <em>Abstract State</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return the meta object for class '<em>Abstract State</em>'.
-	 * @see org.yakindu.sct.model.sgraph.AbstractState
-	 * @generated
-	 */
-	EClass getAbstractState();
-
-	/**
-	 * Returns the meta object for class '{@link org.yakindu.sct.model.sgraph.SubmachineState <em>Submachine State</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return the meta object for class '<em>Submachine State</em>'.
-	 * @see org.yakindu.sct.model.sgraph.SubmachineState
-	 * @generated
-	 */
-	EClass getSubmachineState();
-
-	/**
-	 * Returns the meta object for the reference '{@link org.yakindu.sct.model.sgraph.SubmachineState#getSubstatechart <em>Substatechart</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return the meta object for the reference '<em>Substatechart</em>'.
-	 * @see org.yakindu.sct.model.sgraph.SubmachineState#getSubstatechart()
-	 * @see #getSubmachineState()
-	 * @generated
-	 */
-	EReference getSubmachineState_Substatechart();
-
 	/**
 	 * Returns the meta object for enum '{@link org.yakindu.sct.model.sgraph.EntryKind <em>Entry Kind</em>}'.
 	 * <!-- begin-user-doc -->
@@ -2078,6 +1900,38 @@ public interface SGraphPackage extends EPackage {
 		 */
 		EAttribute STATE__ORTHOGONAL = eINSTANCE.getState_Orthogonal();
 
+		/**
+		 * The meta object literal for the '<em><b>Substatechart</b></em>' reference feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EReference STATE__SUBSTATECHART = eINSTANCE.getState_Substatechart();
+
+		/**
+		 * The meta object literal for the '<em><b>Submachine</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute STATE__SUBMACHINE = eINSTANCE.getState_Submachine();
+
+		/**
+		 * The meta object literal for the '<em><b>Simple</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute STATE__SIMPLE = eINSTANCE.getState_Simple();
+
+		/**
+		 * The meta object literal for the '<em><b>Composite</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute STATE__COMPOSITE = eINSTANCE.getState_Composite();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sgraph.impl.VariableImpl <em>Variable</em>}' class.
 		 * <!-- begin-user-doc -->
@@ -2326,34 +2180,6 @@ public interface SGraphPackage extends EPackage {
 		 */
 		EClass SYNCHRONIZATION = eINSTANCE.getSynchronization();
 
-		/**
-		 * The meta object literal for the '{@link org.yakindu.sct.model.sgraph.impl.AbstractStateImpl <em>Abstract State</em>}' class.
-		 * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-		 * @see org.yakindu.sct.model.sgraph.impl.AbstractStateImpl
-		 * @see org.yakindu.sct.model.sgraph.impl.SGraphPackageImpl#getAbstractState()
-		 * @generated
-		 */
-		EClass ABSTRACT_STATE = eINSTANCE.getAbstractState();
-
-		/**
-		 * The meta object literal for the '{@link org.yakindu.sct.model.sgraph.impl.SubmachineStateImpl <em>Submachine State</em>}' class.
-		 * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-		 * @see org.yakindu.sct.model.sgraph.impl.SubmachineStateImpl
-		 * @see org.yakindu.sct.model.sgraph.impl.SGraphPackageImpl#getSubmachineState()
-		 * @generated
-		 */
-		EClass SUBMACHINE_STATE = eINSTANCE.getSubmachineState();
-
-		/**
-		 * The meta object literal for the '<em><b>Substatechart</b></em>' reference feature.
-		 * <!-- begin-user-doc -->
-		 * <!-- end-user-doc -->
-		 * @generated
-		 */
-		EReference SUBMACHINE_STATE__SUBSTATECHART = eINSTANCE.getSubmachineState_Substatechart();
-
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sgraph.EntryKind <em>Entry Kind</em>}' enum.
 		 * <!-- begin-user-doc -->

+ 88 - 2
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/State.java

@@ -22,14 +22,18 @@ import org.eclipse.emf.common.util.EList;
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sgraph.State#getSubRegions <em>Sub Regions</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sgraph.State#isOrthogonal <em>Orthogonal</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#getSubstatechart <em>Substatechart</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#isSubmachine <em>Submachine</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#isSimple <em>Simple</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#isComposite <em>Composite</em>}</li>
  * </ul>
  * </p>
  *
  * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState()
- * @model
+ * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='NameIsNotEmpty'"
  * @generated
  */
-public interface State extends AbstractState {
+public interface State extends Vertex, ExpressionElement, ReactiveElement, ScopedElement {
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -68,4 +72,86 @@ public interface State extends AbstractState {
 	 */
 	boolean isOrthogonal();
 
+	/**
+	 * Returns the value of the '<em><b>Substatechart</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Substatechart</em>' reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Substatechart</em>' reference.
+	 * @see #setSubstatechart(Statechart)
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_Substatechart()
+	 * @model
+	 * @generated
+	 */
+	Statechart getSubstatechart();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sgraph.State#getSubstatechart <em>Substatechart</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Substatechart</em>' reference.
+	 * @see #getSubstatechart()
+	 * @generated
+	 */
+	void setSubstatechart(Statechart value);
+
+	/**
+	 * Returns the value of the '<em><b>Submachine</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Submachine</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Submachine</em>' attribute.
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_Submachine()
+	 * @model transient="true" changeable="false" volatile="true" derived="true"
+	 * @generated
+	 */
+	boolean isSubmachine();
+
+	/**
+	 * Returns the value of the '<em><b>Simple</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Simple</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Simple</em>' attribute.
+	 * @see #setSimple(boolean)
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_Simple()
+	 * @model transient="true" volatile="true" derived="true"
+	 * @generated
+	 */
+	boolean isSimple();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.sct.model.sgraph.State#isSimple <em>Simple</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Simple</em>' attribute.
+	 * @see #isSimple()
+	 * @generated
+	 */
+	void setSimple(boolean value);
+
+	/**
+	 * Returns the value of the '<em><b>Composite</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Composite</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Composite</em>' attribute.
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_Composite()
+	 * @model transient="true" changeable="false" volatile="true" derived="true"
+	 * @generated
+	 */
+	boolean isComposite();
+
 } // State

+ 0 - 64
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SubmachineState.java

@@ -1,64 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.model.sgraph;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Submachine State</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- *   <li>{@link org.yakindu.sct.model.sgraph.SubmachineState#getSubstatechart <em>Substatechart</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.yakindu.sct.model.sgraph.SGraphPackage#getSubmachineState()
- * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='SubStatechartExists SubStatechartIsNotACycle'"
- * @generated
- */
-public interface SubmachineState extends AbstractState {
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
-
-	/**
-	 * Returns the value of the '<em><b>Substatechart</b></em>' reference.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Substatechart</em>' reference isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * @return the value of the '<em>Substatechart</em>' reference.
-	 * @see #setSubstatechart(Statechart)
-	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getSubmachineState_Substatechart()
-	 * @model
-	 * @generated
-	 */
-	Statechart getSubstatechart();
-
-	/**
-	 * Sets the value of the '{@link org.yakindu.sct.model.sgraph.SubmachineState#getSubstatechart <em>Substatechart</em>}' reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @param value the new value of the '<em>Substatechart</em>' reference.
-	 * @see #getSubstatechart()
-	 * @generated
-	 */
-	void setSubstatechart(Statechart value);
-
-} // SubmachineState

+ 0 - 357
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/AbstractStateImpl.java

@@ -1,357 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.model.sgraph.impl;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.EObjectResolvingEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.yakindu.sct.model.sgraph.AbstractState;
-import org.yakindu.sct.model.sgraph.ExpressionElement;
-import org.yakindu.sct.model.sgraph.Reaction;
-import org.yakindu.sct.model.sgraph.ReactiveElement;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-import org.yakindu.sct.model.sgraph.Scope;
-import org.yakindu.sct.model.sgraph.ScopedElement;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Abstract State</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.AbstractStateImpl#getExpression <em>Expression</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.AbstractStateImpl#getReactions <em>Reactions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.AbstractStateImpl#getLocalReactions <em>Local Reactions</em>}</li>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.AbstractStateImpl#getScopes <em>Scopes</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public abstract class AbstractStateImpl extends VertexImpl implements AbstractState {
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
-
-	/**
-	 * The default value of the '{@link #getExpression() <em>Expression</em>}' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getExpression()
-	 * @generated
-	 * @ordered
-	 */
-	protected static final String EXPRESSION_EDEFAULT = null;
-
-	/**
-	 * The cached value of the '{@link #getExpression() <em>Expression</em>}' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getExpression()
-	 * @generated
-	 * @ordered
-	 */
-	protected String expression = EXPRESSION_EDEFAULT;
-
-	/**
-	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> reactions;
-
-	/**
-	 * The cached value of the '{@link #getLocalReactions() <em>Local Reactions</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getLocalReactions()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Reaction> localReactions;
-
-	/**
-	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getScopes()
-	 * @generated
-	 * @ordered
-	 */
-	protected EList<Scope> scopes;
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected AbstractStateImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	protected EClass eStaticClass() {
-		return SGraphPackage.Literals.ABSTRACT_STATE;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public String getExpression() {
-		return expression;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public void setExpression(String newExpression) {
-		String oldExpression = expression;
-		expression = newExpression;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.ABSTRACT_STATE__EXPRESSION, oldExpression, expression));
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EList<Reaction> getReactions() {
-		if (reactions == null) {
-			reactions = new EObjectResolvingEList<Reaction>(Reaction.class, this, SGraphPackage.ABSTRACT_STATE__REACTIONS);
-		}
-		return reactions;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EList<Reaction> getLocalReactions() {
-		if (localReactions == null) {
-			localReactions = new EObjectContainmentEList<Reaction>(Reaction.class, this, SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS);
-		}
-		return localReactions;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EList<Scope> getScopes() {
-		if (scopes == null) {
-			scopes = new EObjectContainmentEList<Scope>(Scope.class, this, SGraphPackage.ABSTRACT_STATE__SCOPES);
-		}
-		return scopes;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
-		switch (featureID) {
-			case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS:
-				return ((InternalEList<?>)getLocalReactions()).basicRemove(otherEnd, msgs);
-			case SGraphPackage.ABSTRACT_STATE__SCOPES:
-				return ((InternalEList<?>)getScopes()).basicRemove(otherEnd, msgs);
-		}
-		return super.eInverseRemove(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object eGet(int featureID, boolean resolve, boolean coreType) {
-		switch (featureID) {
-			case SGraphPackage.ABSTRACT_STATE__EXPRESSION:
-				return getExpression();
-			case SGraphPackage.ABSTRACT_STATE__REACTIONS:
-				return getReactions();
-			case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS:
-				return getLocalReactions();
-			case SGraphPackage.ABSTRACT_STATE__SCOPES:
-				return getScopes();
-		}
-		return super.eGet(featureID, resolve, coreType);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@SuppressWarnings("unchecked")
-	@Override
-	public void eSet(int featureID, Object newValue) {
-		switch (featureID) {
-			case SGraphPackage.ABSTRACT_STATE__EXPRESSION:
-				setExpression((String)newValue);
-				return;
-			case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				getLocalReactions().addAll((Collection<? extends Reaction>)newValue);
-				return;
-			case SGraphPackage.ABSTRACT_STATE__SCOPES:
-				getScopes().clear();
-				getScopes().addAll((Collection<? extends Scope>)newValue);
-				return;
-		}
-		super.eSet(featureID, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eUnset(int featureID) {
-		switch (featureID) {
-			case SGraphPackage.ABSTRACT_STATE__EXPRESSION:
-				setExpression(EXPRESSION_EDEFAULT);
-				return;
-			case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS:
-				getLocalReactions().clear();
-				return;
-			case SGraphPackage.ABSTRACT_STATE__SCOPES:
-				getScopes().clear();
-				return;
-		}
-		super.eUnset(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public boolean eIsSet(int featureID) {
-		switch (featureID) {
-			case SGraphPackage.ABSTRACT_STATE__EXPRESSION:
-				return EXPRESSION_EDEFAULT == null ? expression != null : !EXPRESSION_EDEFAULT.equals(expression);
-			case SGraphPackage.ABSTRACT_STATE__REACTIONS:
-				return reactions != null && !reactions.isEmpty();
-			case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS:
-				return localReactions != null && !localReactions.isEmpty();
-			case SGraphPackage.ABSTRACT_STATE__SCOPES:
-				return scopes != null && !scopes.isEmpty();
-		}
-		return super.eIsSet(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
-		if (baseClass == ExpressionElement.class) {
-			switch (derivedFeatureID) {
-				case SGraphPackage.ABSTRACT_STATE__EXPRESSION: return SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION;
-				default: return -1;
-			}
-		}
-		if (baseClass == ReactiveElement.class) {
-			switch (derivedFeatureID) {
-				case SGraphPackage.ABSTRACT_STATE__REACTIONS: return SGraphPackage.REACTIVE_ELEMENT__REACTIONS;
-				case SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS: return SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS;
-				default: return -1;
-			}
-		}
-		if (baseClass == ScopedElement.class) {
-			switch (derivedFeatureID) {
-				case SGraphPackage.ABSTRACT_STATE__SCOPES: return SGraphPackage.SCOPED_ELEMENT__SCOPES;
-				default: return -1;
-			}
-		}
-		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
-		if (baseClass == ExpressionElement.class) {
-			switch (baseFeatureID) {
-				case SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION: return SGraphPackage.ABSTRACT_STATE__EXPRESSION;
-				default: return -1;
-			}
-		}
-		if (baseClass == ReactiveElement.class) {
-			switch (baseFeatureID) {
-				case SGraphPackage.REACTIVE_ELEMENT__REACTIONS: return SGraphPackage.ABSTRACT_STATE__REACTIONS;
-				case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS: return SGraphPackage.ABSTRACT_STATE__LOCAL_REACTIONS;
-				default: return -1;
-			}
-		}
-		if (baseClass == ScopedElement.class) {
-			switch (baseFeatureID) {
-				case SGraphPackage.SCOPED_ELEMENT__SCOPES: return SGraphPackage.ABSTRACT_STATE__SCOPES;
-				default: return -1;
-			}
-		}
-		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public String toString() {
-		if (eIsProxy()) return super.toString();
-
-		StringBuffer result = new StringBuffer(super.toString());
-		result.append(" (expression: ");
-		result.append(expression);
-		result.append(')');
-		return result.toString();
-	}
-
-} //AbstractStateImpl

+ 2 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/FinalStateImpl.java

@@ -11,6 +11,7 @@
 package org.yakindu.sct.model.sgraph.impl;
 
 import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
 import org.yakindu.sct.model.sgraph.FinalState;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
 
@@ -23,7 +24,7 @@ import org.yakindu.sct.model.sgraph.SGraphPackage;
  *
  * @generated
  */
-public class FinalStateImpl extends AbstractStateImpl implements FinalState {
+public class FinalStateImpl extends VertexImpl implements FinalState {
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 0 - 12
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SGraphFactoryImpl.java

@@ -28,7 +28,6 @@ import org.yakindu.sct.model.sgraph.SGraphPackage;
 import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.model.sgraph.Synchronization;
 import org.yakindu.sct.model.sgraph.Transition;
 
@@ -94,7 +93,6 @@ public class SGraphFactoryImpl extends EFactoryImpl implements SGraphFactory {
 			case SGraphPackage.SCOPE: return createScope();
 			case SGraphPackage.SYNCHRONIZATION: return createSynchronization();
 			case SGraphPackage.STATE: return createState();
-			case SGraphPackage.SUBMACHINE_STATE: return createSubmachineState();
 			default:
 				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
 		}
@@ -240,16 +238,6 @@ public class SGraphFactoryImpl extends EFactoryImpl implements SGraphFactory {
 		return state;
 	}
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public SubmachineState createSubmachineState() {
-		SubmachineStateImpl submachineState = new SubmachineStateImpl();
-		return submachineState;
-	}
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 37 - 48
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SGraphPackageImpl.java

@@ -211,20 +211,6 @@ public class SGraphPackageImpl extends EPackageImpl implements SGraphPackage {
 	 */
 	private EClass synchronizationEClass = null;
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	private EClass abstractStateEClass = null;
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	private EClass submachineStateEClass = null;
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -460,7 +446,7 @@ public class SGraphPackageImpl extends EPackageImpl implements SGraphPackage {
 	 */
 	public EClass getState() {
 		if (stateEClass == null) {
-			stateEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(SGraphPackage.eNS_URI).getEClassifiers().get(24);
+			stateEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(SGraphPackage.eNS_URI).getEClassifiers().get(23);
 		}
 		return stateEClass;
 	}
@@ -483,6 +469,42 @@ public class SGraphPackageImpl extends EPackageImpl implements SGraphPackage {
         return (EAttribute)getState().getEStructuralFeatures().get(1);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getState_Substatechart() {
+        return (EReference)getState().getEStructuralFeatures().get(2);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getState_Submachine() {
+        return (EAttribute)getState().getEStructuralFeatures().get(3);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getState_Simple() {
+        return (EAttribute)getState().getEStructuralFeatures().get(4);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getState_Composite() {
+        return (EAttribute)getState().getEStructuralFeatures().get(5);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -774,39 +796,6 @@ public class SGraphPackageImpl extends EPackageImpl implements SGraphPackage {
 		return synchronizationEClass;
 	}
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EClass getAbstractState() {
-		if (abstractStateEClass == null) {
-			abstractStateEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(SGraphPackage.eNS_URI).getEClassifiers().get(23);
-		}
-		return abstractStateEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EClass getSubmachineState() {
-		if (submachineStateEClass == null) {
-			submachineStateEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(SGraphPackage.eNS_URI).getEClassifiers().get(25);
-		}
-		return submachineStateEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EReference getSubmachineState_Substatechart() {
-        return (EReference)getSubmachineState().getEStructuralFeatures().get(0);
-	}
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 384 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/StateImpl.java

@@ -12,15 +12,24 @@ package org.yakindu.sct.model.sgraph.impl;
 
 import java.util.Collection;
 
+import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.common.notify.NotificationChain;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.EClass;
 import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
 import org.eclipse.emf.ecore.util.InternalEList;
+import org.yakindu.sct.model.sgraph.ExpressionElement;
+import org.yakindu.sct.model.sgraph.Reaction;
+import org.yakindu.sct.model.sgraph.ReactiveElement;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
+import org.yakindu.sct.model.sgraph.Scope;
+import org.yakindu.sct.model.sgraph.ScopedElement;
 import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
 
 /**
  * <!-- begin-user-doc --> An implementation of the model object '
@@ -28,20 +37,78 @@ import org.yakindu.sct.model.sgraph.State;
  * <p>
  * The following features are implemented:
  * <ul>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getExpression <em>Expression</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getReactions <em>Reactions</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getLocalReactions <em>Local Reactions</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getScopes <em>Scopes</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getSubRegions <em>Sub Regions</em>}</li>
  *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isOrthogonal <em>Orthogonal</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#getSubstatechart <em>Substatechart</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSubmachine <em>Submachine</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSimple <em>Simple</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isComposite <em>Composite</em>}</li>
  * </ul>
  * </p>
  *
  * @generated
  */
-public class StateImpl extends AbstractStateImpl implements State {
+public class StateImpl extends VertexImpl implements State {
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
 	 */
 	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
 
+	/**
+	 * The default value of the '{@link #getExpression() <em>Expression</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getExpression()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final String EXPRESSION_EDEFAULT = null;
+
+	/**
+	 * The cached value of the '{@link #getExpression() <em>Expression</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getExpression()
+	 * @generated
+	 * @ordered
+	 */
+	protected String expression = EXPRESSION_EDEFAULT;
+
+	/**
+	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getReactions()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<Reaction> reactions;
+
+	/**
+	 * The cached value of the '{@link #getLocalReactions() <em>Local Reactions</em>}' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getLocalReactions()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<Reaction> localReactions;
+
+	/**
+	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getScopes()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<Scope> scopes;
+
 	/**
 	 * The cached value of the '{@link #getSubRegions() <em>Sub Regions</em>}' containment reference list.
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -60,6 +127,46 @@ public class StateImpl extends AbstractStateImpl implements State {
 	 */
 	protected static final boolean ORTHOGONAL_EDEFAULT = false;
 
+	/**
+	 * The cached value of the '{@link #getSubstatechart() <em>Substatechart</em>}' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getSubstatechart()
+	 * @generated
+	 * @ordered
+	 */
+	protected Statechart substatechart;
+
+	/**
+	 * The default value of the '{@link #isSubmachine() <em>Submachine</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isSubmachine()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean SUBMACHINE_EDEFAULT = false;
+
+	/**
+	 * The default value of the '{@link #isSimple() <em>Simple</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isSimple()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean SIMPLE_EDEFAULT = false;
+
+	/**
+	 * The default value of the '{@link #isComposite() <em>Composite</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #isComposite()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean COMPOSITE_EDEFAULT = false;
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
@@ -77,6 +184,63 @@ public class StateImpl extends AbstractStateImpl implements State {
 		return SGraphPackage.Literals.STATE;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getExpression() {
+		return expression;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setExpression(String newExpression) {
+		String oldExpression = expression;
+		expression = newExpression;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.STATE__EXPRESSION, oldExpression, expression));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<Reaction> getReactions() {
+		if (reactions == null) {
+			reactions = new EObjectResolvingEList<Reaction>(Reaction.class, this, SGraphPackage.STATE__REACTIONS);
+		}
+		return reactions;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<Reaction> getLocalReactions() {
+		if (localReactions == null) {
+			localReactions = new EObjectContainmentEList<Reaction>(Reaction.class, this, SGraphPackage.STATE__LOCAL_REACTIONS);
+		}
+		return localReactions;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<Scope> getScopes() {
+		if (scopes == null) {
+			scopes = new EObjectContainmentEList<Scope>(Scope.class, this, SGraphPackage.STATE__SCOPES);
+		}
+		return scopes;
+	}
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
@@ -97,6 +261,82 @@ public class StateImpl extends AbstractStateImpl implements State {
 		return getSubRegions().size() > 1;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Statechart getSubstatechart() {
+		if (substatechart != null && substatechart.eIsProxy()) {
+			InternalEObject oldSubstatechart = (InternalEObject)substatechart;
+			substatechart = (Statechart)eResolveProxy(oldSubstatechart);
+			if (substatechart != oldSubstatechart) {
+				if (eNotificationRequired())
+					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SGraphPackage.STATE__SUBSTATECHART, oldSubstatechart, substatechart));
+			}
+		}
+		return substatechart;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public Statechart basicGetSubstatechart() {
+		return substatechart;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSubstatechart(Statechart newSubstatechart) {
+		Statechart oldSubstatechart = substatechart;
+		substatechart = newSubstatechart;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.STATE__SUBSTATECHART, oldSubstatechart, substatechart));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated NOT
+	 */
+	public boolean isSubmachine() {
+		return substatechart != null;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated NOT
+	 */
+	public boolean isSimple() {
+		return !isComposite() && !isSubmachine();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setSimple(boolean newSimple) {
+		// TODO: implement this method to set the 'Simple' attribute
+		// Ensure that you remove @generated or mark it @generated NOT
+		throw new UnsupportedOperationException();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public boolean isComposite() {
+		return getSubRegions().size() >= 1;
+	}
+
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * @generated
@@ -105,6 +345,10 @@ public class StateImpl extends AbstractStateImpl implements State {
 	public NotificationChain eInverseRemove(InternalEObject otherEnd,
 			int featureID, NotificationChain msgs) {
 		switch (featureID) {
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+				return ((InternalEList<?>)getLocalReactions()).basicRemove(otherEnd, msgs);
+			case SGraphPackage.STATE__SCOPES:
+				return ((InternalEList<?>)getScopes()).basicRemove(otherEnd, msgs);
 			case SGraphPackage.STATE__SUB_REGIONS:
 				return ((InternalEList<?>)getSubRegions()).basicRemove(otherEnd, msgs);
 		}
@@ -118,10 +362,27 @@ public class StateImpl extends AbstractStateImpl implements State {
 	@Override
 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
 		switch (featureID) {
+			case SGraphPackage.STATE__EXPRESSION:
+				return getExpression();
+			case SGraphPackage.STATE__REACTIONS:
+				return getReactions();
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+				return getLocalReactions();
+			case SGraphPackage.STATE__SCOPES:
+				return getScopes();
 			case SGraphPackage.STATE__SUB_REGIONS:
 				return getSubRegions();
 			case SGraphPackage.STATE__ORTHOGONAL:
 				return isOrthogonal();
+			case SGraphPackage.STATE__SUBSTATECHART:
+				if (resolve) return getSubstatechart();
+				return basicGetSubstatechart();
+			case SGraphPackage.STATE__SUBMACHINE:
+				return isSubmachine();
+			case SGraphPackage.STATE__SIMPLE:
+				return isSimple();
+			case SGraphPackage.STATE__COMPOSITE:
+				return isComposite();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -134,10 +395,27 @@ public class StateImpl extends AbstractStateImpl implements State {
 	@Override
 	public void eSet(int featureID, Object newValue) {
 		switch (featureID) {
+			case SGraphPackage.STATE__EXPRESSION:
+				setExpression((String)newValue);
+				return;
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+				getLocalReactions().clear();
+				getLocalReactions().addAll((Collection<? extends Reaction>)newValue);
+				return;
+			case SGraphPackage.STATE__SCOPES:
+				getScopes().clear();
+				getScopes().addAll((Collection<? extends Scope>)newValue);
+				return;
 			case SGraphPackage.STATE__SUB_REGIONS:
 				getSubRegions().clear();
 				getSubRegions().addAll((Collection<? extends Region>)newValue);
 				return;
+			case SGraphPackage.STATE__SUBSTATECHART:
+				setSubstatechart((Statechart)newValue);
+				return;
+			case SGraphPackage.STATE__SIMPLE:
+				setSimple((Boolean)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -149,9 +427,24 @@ public class StateImpl extends AbstractStateImpl implements State {
 	@Override
 	public void eUnset(int featureID) {
 		switch (featureID) {
+			case SGraphPackage.STATE__EXPRESSION:
+				setExpression(EXPRESSION_EDEFAULT);
+				return;
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+				getLocalReactions().clear();
+				return;
+			case SGraphPackage.STATE__SCOPES:
+				getScopes().clear();
+				return;
 			case SGraphPackage.STATE__SUB_REGIONS:
 				getSubRegions().clear();
 				return;
+			case SGraphPackage.STATE__SUBSTATECHART:
+				setSubstatechart((Statechart)null);
+				return;
+			case SGraphPackage.STATE__SIMPLE:
+				setSimple(SIMPLE_EDEFAULT);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -163,12 +456,102 @@ public class StateImpl extends AbstractStateImpl implements State {
 	@Override
 	public boolean eIsSet(int featureID) {
 		switch (featureID) {
+			case SGraphPackage.STATE__EXPRESSION:
+				return EXPRESSION_EDEFAULT == null ? expression != null : !EXPRESSION_EDEFAULT.equals(expression);
+			case SGraphPackage.STATE__REACTIONS:
+				return reactions != null && !reactions.isEmpty();
+			case SGraphPackage.STATE__LOCAL_REACTIONS:
+				return localReactions != null && !localReactions.isEmpty();
+			case SGraphPackage.STATE__SCOPES:
+				return scopes != null && !scopes.isEmpty();
 			case SGraphPackage.STATE__SUB_REGIONS:
 				return subRegions != null && !subRegions.isEmpty();
 			case SGraphPackage.STATE__ORTHOGONAL:
 				return isOrthogonal() != ORTHOGONAL_EDEFAULT;
+			case SGraphPackage.STATE__SUBSTATECHART:
+				return substatechart != null;
+			case SGraphPackage.STATE__SUBMACHINE:
+				return isSubmachine() != SUBMACHINE_EDEFAULT;
+			case SGraphPackage.STATE__SIMPLE:
+				return isSimple() != SIMPLE_EDEFAULT;
+			case SGraphPackage.STATE__COMPOSITE:
+				return isComposite() != COMPOSITE_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+		if (baseClass == ExpressionElement.class) {
+			switch (derivedFeatureID) {
+				case SGraphPackage.STATE__EXPRESSION: return SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION;
+				default: return -1;
+			}
+		}
+		if (baseClass == ReactiveElement.class) {
+			switch (derivedFeatureID) {
+				case SGraphPackage.STATE__REACTIONS: return SGraphPackage.REACTIVE_ELEMENT__REACTIONS;
+				case SGraphPackage.STATE__LOCAL_REACTIONS: return SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS;
+				default: return -1;
+			}
+		}
+		if (baseClass == ScopedElement.class) {
+			switch (derivedFeatureID) {
+				case SGraphPackage.STATE__SCOPES: return SGraphPackage.SCOPED_ELEMENT__SCOPES;
+				default: return -1;
+			}
+		}
+		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
+		if (baseClass == ExpressionElement.class) {
+			switch (baseFeatureID) {
+				case SGraphPackage.EXPRESSION_ELEMENT__EXPRESSION: return SGraphPackage.STATE__EXPRESSION;
+				default: return -1;
+			}
+		}
+		if (baseClass == ReactiveElement.class) {
+			switch (baseFeatureID) {
+				case SGraphPackage.REACTIVE_ELEMENT__REACTIONS: return SGraphPackage.STATE__REACTIONS;
+				case SGraphPackage.REACTIVE_ELEMENT__LOCAL_REACTIONS: return SGraphPackage.STATE__LOCAL_REACTIONS;
+				default: return -1;
+			}
+		}
+		if (baseClass == ScopedElement.class) {
+			switch (baseFeatureID) {
+				case SGraphPackage.SCOPED_ELEMENT__SCOPES: return SGraphPackage.STATE__SCOPES;
+				default: return -1;
+			}
+		}
+		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public String toString() {
+		if (eIsProxy()) return super.toString();
+
+		StringBuffer result = new StringBuffer(super.toString());
+		result.append(" (expression: ");
+		result.append(expression);
+		result.append(')');
+		return result.toString();
+	}
+
 } // StateImpl

+ 0 - 168
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SubmachineStateImpl.java

@@ -1,168 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.model.sgraph.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Submachine State</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- *   <li>{@link org.yakindu.sct.model.sgraph.impl.SubmachineStateImpl#getSubstatechart <em>Substatechart</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class SubmachineStateImpl extends AbstractStateImpl implements SubmachineState {
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public static final String copyright = "Copyright (c) 2011 committers of YAKINDU and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\nContributors:\r\ncommitters of YAKINDU - initial API and implementation\r\n";
-
-	/**
-	 * The cached value of the '{@link #getSubstatechart() <em>Substatechart</em>}' reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getSubstatechart()
-	 * @generated
-	 * @ordered
-	 */
-	protected Statechart substatechart;
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected SubmachineStateImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	protected EClass eStaticClass() {
-		return SGraphPackage.Literals.SUBMACHINE_STATE;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Statechart getSubstatechart() {
-		if (substatechart != null && substatechart.eIsProxy()) {
-			InternalEObject oldSubstatechart = (InternalEObject)substatechart;
-			substatechart = (Statechart)eResolveProxy(oldSubstatechart);
-			if (substatechart != oldSubstatechart) {
-				if (eNotificationRequired())
-					eNotify(new ENotificationImpl(this, Notification.RESOLVE, SGraphPackage.SUBMACHINE_STATE__SUBSTATECHART, oldSubstatechart, substatechart));
-			}
-		}
-		return substatechart;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Statechart basicGetSubstatechart() {
-		return substatechart;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public void setSubstatechart(Statechart newSubstatechart) {
-		Statechart oldSubstatechart = substatechart;
-		substatechart = newSubstatechart;
-		if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, SGraphPackage.SUBMACHINE_STATE__SUBSTATECHART, oldSubstatechart, substatechart));
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object eGet(int featureID, boolean resolve, boolean coreType) {
-		switch (featureID) {
-			case SGraphPackage.SUBMACHINE_STATE__SUBSTATECHART:
-				if (resolve) return getSubstatechart();
-				return basicGetSubstatechart();
-		}
-		return super.eGet(featureID, resolve, coreType);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eSet(int featureID, Object newValue) {
-		switch (featureID) {
-			case SGraphPackage.SUBMACHINE_STATE__SUBSTATECHART:
-				setSubstatechart((Statechart)newValue);
-				return;
-		}
-		super.eSet(featureID, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eUnset(int featureID) {
-		switch (featureID) {
-			case SGraphPackage.SUBMACHINE_STATE__SUBSTATECHART:
-				setSubstatechart((Statechart)null);
-				return;
-		}
-		super.eUnset(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public boolean eIsSet(int featureID) {
-		switch (featureID) {
-			case SGraphPackage.SUBMACHINE_STATE__SUBSTATECHART:
-				return substatechart != null;
-		}
-		return super.eIsSet(featureID);
-	}
-
-} //SubmachineStateImpl

+ 105 - 106
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/sgraph.ecore

@@ -1,106 +1,105 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="sgraph"
-    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
-  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
-        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
-        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="ExactlyOneInitialState"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
-        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
-        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//AbstractState"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
-        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
-  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
-        containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
-        containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
-    <eLiterals name="initial" literal="INITIAL"/>
-    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
-    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
-        eType="#//Reaction" changeable="false" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
-        eType="#//Reaction" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="Scope">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
-        eType="#//Declaration" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
-        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
-        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
-        derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
-        eType="#//Scope" containment="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
-  <eClassifiers xsi:type="ecore:EClass" name="AbstractState" abstract="true" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
-    <eAnnotations source="InjectMembers"/>
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="NameIsNotEmpty"/>
-    </eAnnotations>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//AbstractState">
-    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
-        upperBound="-1" eType="#//Region" containment="true"/>
-    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
-        changeable="false" volatile="true" transient="true" derived="true"/>
-  </eClassifiers>
-  <eClassifiers xsi:type="ecore:EClass" name="SubmachineState" eSuperTypes="#//AbstractState">
-    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
-      <details key="constraints" value="SubStatechartExists SubStatechartIsNotACycle"/>
-    </eAnnotations>
-    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
-  </eClassifiers>
-</ecore:EPackage>
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="sgraph"
+    nsURI="http://www.yakindu.org/sct/2.0.0" nsPrefix="sgraph">
+  <eClassifiers xsi:type="ecore:EClass" name="Pseudostate" abstract="true" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Vertex" abstract="true" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="IncomingTransitionCount OutgoingTransitionCount"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="parentRegion" ordered="false"
+        lowerBound="1" eType="#//Region" eOpposite="#//Region/vertices"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="incomingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" eOpposite="#//Transition/target"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingTransitions" ordered="false"
+        upperBound="-1" eType="#//Transition" containment="true" eOpposite="#//Transition/source"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="NamedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Region" eSuperTypes="#//NamedElement">
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="ExactlyOneInitialState"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="vertices" ordered="false"
+        upperBound="-1" eType="#//Vertex" containment="true" eOpposite="#//Vertex/parentRegion"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//ExpressionElement #//Reaction">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="target" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/incomingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="source" ordered="false"
+        lowerBound="1" eType="#//Vertex" eOpposite="#//Vertex/outgoingTransitions"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="FinalState" eSuperTypes="#//Vertex"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Event" abstract="true" eSuperTypes="#//Declaration"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Choice" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Statechart" eSuperTypes="#//NamedElement #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="regions" ordered="false"
+        lowerBound="1" upperBound="-1" eType="#//Region" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Entry" eSuperTypes="#//Pseudostate">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="kind" eType="#//EntryKind"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Trigger" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Effect" abstract="true"/>
+  <eClassifiers xsi:type="ecore:EClass" name="ExpressionElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="expression" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Declaration" abstract="true" eSuperTypes="#//NamedElement"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Reaction" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="trigger" eType="#//Trigger"
+        containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="effect" eType="#//Effect"
+        containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EEnum" name="EntryKind">
+    <eLiterals name="initial" literal="INITIAL"/>
+    <eLiterals name="shallowHistory" value="1" literal="SHALLOW_HISTORY"/>
+    <eLiterals name="deepHistory" value="2" literal="DEEP_HISTORY"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ReactiveElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="reactions" upperBound="-1"
+        eType="#//Reaction" changeable="false" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="localReactions" upperBound="-1"
+        eType="#//Reaction" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Exit" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="Scope">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="declarations" upperBound="-1"
+        eType="#//Declaration" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="events" upperBound="-1"
+        eType="#//Event" changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="variables" unique="false"
+        upperBound="-1" eType="#//Variable" changeable="false" volatile="true" transient="true"
+        derived="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="ScopedElement" abstract="true">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="scopes" upperBound="-1"
+        eType="#//Scope" containment="true"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="Synchronization" eSuperTypes="#//Pseudostate"/>
+  <eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Vertex #//ExpressionElement #//ReactiveElement #//ScopedElement">
+    <eAnnotations source="InjectMembers"/>
+    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
+      <details key="constraints" value="NameIsNotEmpty"/>
+    </eAnnotations>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
+        upperBound="-1" eType="#//Region" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="orthogonal" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachine" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="simple" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        volatile="true" transient="true" derived="true"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="composite" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true" derived="true"/>
+  </eClassifiers>
+</ecore:EPackage>

+ 0 - 38
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphAdapterFactory.java

@@ -14,7 +14,6 @@ import org.eclipse.emf.common.notify.Adapter;
 import org.eclipse.emf.common.notify.Notifier;
 import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
 import org.eclipse.emf.ecore.EObject;
-import org.yakindu.sct.model.sgraph.AbstractState;
 import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.Declaration;
 import org.yakindu.sct.model.sgraph.Effect;
@@ -34,7 +33,6 @@ import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.ScopedElement;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.model.sgraph.Synchronization;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.Trigger;
@@ -193,18 +191,10 @@ public class SGraphAdapterFactory extends AdapterFactoryImpl {
 				return createSynchronizationAdapter();
 			}
 			@Override
-			public Adapter caseAbstractState(AbstractState object) {
-				return createAbstractStateAdapter();
-			}
-			@Override
 			public Adapter caseState(State object) {
 				return createStateAdapter();
 			}
 			@Override
-			public Adapter caseSubmachineState(SubmachineState object) {
-				return createSubmachineStateAdapter();
-			}
-			@Override
 			public Adapter defaultCase(EObject object) {
 				return createEObjectAdapter();
 			}
@@ -546,34 +536,6 @@ public class SGraphAdapterFactory extends AdapterFactoryImpl {
 		return null;
 	}
 
-	/**
-	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.AbstractState <em>Abstract State</em>}'.
-	 * <!-- begin-user-doc -->
-	 * This default implementation returns null so that we can easily ignore cases;
-	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
-	 * <!-- end-user-doc -->
-	 * @return the new adapter.
-	 * @see org.yakindu.sct.model.sgraph.AbstractState
-	 * @generated
-	 */
-	public Adapter createAbstractStateAdapter() {
-		return null;
-	}
-
-	/**
-	 * Creates a new adapter for an object of class '{@link org.yakindu.sct.model.sgraph.SubmachineState <em>Submachine State</em>}'.
-	 * <!-- begin-user-doc -->
-	 * This default implementation returns null so that we can easily ignore cases;
-	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
-	 * <!-- end-user-doc -->
-	 * @return the new adapter.
-	 * @see org.yakindu.sct.model.sgraph.SubmachineState
-	 * @generated
-	 */
-	public Adapter createSubmachineStateAdapter() {
-		return null;
-	}
-
 	/**
 	 * Creates a new adapter for the default case.
 	 * <!-- begin-user-doc -->

+ 0 - 60
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphSwitch.java

@@ -13,7 +13,6 @@ package org.yakindu.sct.model.sgraph.util;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.util.Switch;
-import org.yakindu.sct.model.sgraph.AbstractState;
 import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.Declaration;
 import org.yakindu.sct.model.sgraph.Effect;
@@ -33,7 +32,6 @@ import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.ScopedElement;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.model.sgraph.Synchronization;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.Trigger;
@@ -143,11 +141,7 @@ public class SGraphSwitch<T> extends Switch<T> {
 			case SGraphPackage.FINAL_STATE: {
 				FinalState finalState = (FinalState)theEObject;
 				T result = caseFinalState(finalState);
-				if (result == null) result = caseAbstractState(finalState);
 				if (result == null) result = caseVertex(finalState);
-				if (result == null) result = caseExpressionElement(finalState);
-				if (result == null) result = caseReactiveElement(finalState);
-				if (result == null) result = caseScopedElement(finalState);
 				if (result == null) result = caseNamedElement(finalState);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
@@ -272,21 +266,9 @@ public class SGraphSwitch<T> extends Switch<T> {
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
-			case SGraphPackage.ABSTRACT_STATE: {
-				AbstractState abstractState = (AbstractState)theEObject;
-				T result = caseAbstractState(abstractState);
-				if (result == null) result = caseVertex(abstractState);
-				if (result == null) result = caseExpressionElement(abstractState);
-				if (result == null) result = caseReactiveElement(abstractState);
-				if (result == null) result = caseScopedElement(abstractState);
-				if (result == null) result = caseNamedElement(abstractState);
-				if (result == null) result = defaultCase(theEObject);
-				return result;
-			}
 			case SGraphPackage.STATE: {
 				State state = (State)theEObject;
 				T result = caseState(state);
-				if (result == null) result = caseAbstractState(state);
 				if (result == null) result = caseVertex(state);
 				if (result == null) result = caseExpressionElement(state);
 				if (result == null) result = caseReactiveElement(state);
@@ -295,18 +277,6 @@ public class SGraphSwitch<T> extends Switch<T> {
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
-			case SGraphPackage.SUBMACHINE_STATE: {
-				SubmachineState submachineState = (SubmachineState)theEObject;
-				T result = caseSubmachineState(submachineState);
-				if (result == null) result = caseAbstractState(submachineState);
-				if (result == null) result = caseVertex(submachineState);
-				if (result == null) result = caseExpressionElement(submachineState);
-				if (result == null) result = caseReactiveElement(submachineState);
-				if (result == null) result = caseScopedElement(submachineState);
-				if (result == null) result = caseNamedElement(submachineState);
-				if (result == null) result = defaultCase(theEObject);
-				return result;
-			}
 			default: return defaultCase(theEObject);
 		}
 	}
@@ -656,36 +626,6 @@ public class SGraphSwitch<T> extends Switch<T> {
 		return null;
 	}
 
-	/**
-	 * Returns the result of interpreting the object as an instance of '<em>Abstract State</em>'.
-	 * <!-- begin-user-doc -->
-	 * This implementation returns null;
-	 * returning a non-null result will terminate the switch.
-	 * <!-- end-user-doc -->
-	 * @param object the target of the switch.
-	 * @return the result of interpreting the object as an instance of '<em>Abstract State</em>'.
-	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
-	 * @generated
-	 */
-	public T caseAbstractState(AbstractState object) {
-		return null;
-	}
-
-	/**
-	 * Returns the result of interpreting the object as an instance of '<em>Submachine State</em>'.
-	 * <!-- begin-user-doc -->
-	 * This implementation returns null;
-	 * returning a non-null result will terminate the switch.
-	 * <!-- end-user-doc -->
-	 * @param object the target of the switch.
-	 * @return the result of interpreting the object as an instance of '<em>Submachine State</em>'.
-	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
-	 * @generated
-	 */
-	public T caseSubmachineState(SubmachineState object) {
-		return null;
-	}
-
 	/**
 	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
 	 * <!-- begin-user-doc -->

+ 12 - 95
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/util/SGraphValidator.java

@@ -18,7 +18,6 @@ import org.eclipse.emf.common.util.DiagnosticChain;
 import org.eclipse.emf.common.util.ResourceLocator;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.util.EObjectValidator;
-import org.yakindu.sct.model.sgraph.AbstractState;
 import org.yakindu.sct.model.sgraph.Choice;
 import org.yakindu.sct.model.sgraph.Declaration;
 import org.yakindu.sct.model.sgraph.Effect;
@@ -39,7 +38,6 @@ import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.ScopedElement;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.model.sgraph.Synchronization;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.Trigger;
@@ -177,12 +175,8 @@ public class SGraphValidator extends EObjectValidator {
 				return validateScopedElement((ScopedElement)value, diagnostics, context);
 			case SGraphPackage.SYNCHRONIZATION:
 				return validateSynchronization((Synchronization)value, diagnostics, context);
-			case SGraphPackage.ABSTRACT_STATE:
-				return validateAbstractState((AbstractState)value, diagnostics, context);
 			case SGraphPackage.STATE:
 				return validateState((State)value, diagnostics, context);
-			case SGraphPackage.SUBMACHINE_STATE:
-				return validateSubmachineState((SubmachineState)value, diagnostics, context);
 			case SGraphPackage.ENTRY_KIND:
 				return validateEntryKind((EntryKind)value, diagnostics, context);
 			default:
@@ -367,7 +361,6 @@ public class SGraphValidator extends EObjectValidator {
 		if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(finalState, diagnostics, context);
 		if (result || diagnostics != null) result &= validateVertex_IncomingTransitionCount(finalState, diagnostics, context);
 		if (result || diagnostics != null) result &= validateVertex_OutgoingTransitionCount(finalState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateAbstractState_NameIsNotEmpty(finalState, diagnostics, context);
 		return result;
 	}
 
@@ -388,7 +381,7 @@ public class SGraphValidator extends EObjectValidator {
 		if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(state, diagnostics, context);
 		if (result || diagnostics != null) result &= validateVertex_IncomingTransitionCount(state, diagnostics, context);
 		if (result || diagnostics != null) result &= validateVertex_OutgoingTransitionCount(state, diagnostics, context);
-		if (result || diagnostics != null) result &= validateAbstractState_NameIsNotEmpty(state, diagnostics, context);
+		if (result || diagnostics != null) result &= validateState_NameIsNotEmpty(state, diagnostics, context);
 		return result;
 	}
 
@@ -607,99 +600,23 @@ public class SGraphValidator extends EObjectValidator {
 		return result;
 	}
 
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * @generated
-	 */
-	public boolean validateAbstractState(AbstractState abstractState,
-			DiagnosticChain diagnostics, Map<Object, Object> context) {
-		if (!validate_NoCircularContainment(abstractState, diagnostics, context)) return false;
-		boolean result = validate_EveryMultiplicityConforms(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryDataValueConforms(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryProxyResolves(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_UniqueID(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryKeyUnique(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateVertex_IncomingTransitionCount(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateVertex_OutgoingTransitionCount(abstractState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateAbstractState_NameIsNotEmpty(abstractState, diagnostics, context);
-		return result;
-	}
-
-	/**
-	 * Validates the NameIsNotEmpty constraint of '<em>Abstract State</em>'.
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * 
-	 * @generated NOT
-	 */
-	public boolean validateAbstractState_NameIsNotEmpty(
-			AbstractState state, DiagnosticChain diagnostics,
-			Map<Object, Object> context) {
-		if ((state.getName() == null || state.getName().trim().length() == 0)
-				&& !(state instanceof FinalState)) {
-			return error(state, diagnostics, ISSUE_STATE_WITHOUT_NAME);
-		}
-		return true;
-	}
-
-	/**
-	 * <!-- begin-user-doc --> <!-- end-user-doc -->
-	 * @generated
-	 */
-	public boolean validateSubmachineState(SubmachineState submachineState,
-			DiagnosticChain diagnostics, Map<Object, Object> context) {
-		if (!validate_NoCircularContainment(submachineState, diagnostics, context)) return false;
-		boolean result = validate_EveryMultiplicityConforms(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryDataValueConforms(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryProxyResolves(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_UniqueID(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryKeyUnique(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateVertex_IncomingTransitionCount(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateVertex_OutgoingTransitionCount(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateAbstractState_NameIsNotEmpty(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateSubmachineState_SubStatechartExists(submachineState, diagnostics, context);
-		if (result || diagnostics != null) result &= validateSubmachineState_SubStatechartIsNotACycle(submachineState, diagnostics, context);
-		return result;
-	}
-
 	/**
 	 * Validates the SubStatechartExists constraint of '
 	 * <em>Submachine State</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
 	 * 
 	 * @generated NOT
 	 */
-	public boolean validateSubmachineState_SubStatechartExists(
-			SubmachineState submachineState, DiagnosticChain diagnostics,
-			Map<Object, Object> context) {
-		if ((submachineState.getSubstatechart() == null || submachineState
-				.getSubstatechart().eIsProxy())) {
-			return error(submachineState, diagnostics,
-					ISSUE_SUBMACHINESTATE_WITHOUT_SUBMACHINE);
-		}
-		return true;
-
-	}
-
-	/**
-	 * Validates the SubStatechartIsNotACycle constraint of '<em>Submachine State</em>'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public boolean validateSubmachineState_SubStatechartIsNotACycle(SubmachineState submachineState, DiagnosticChain diagnostics, Map<Object, Object> context) {
-		if ((submachineState.getSubstatechart() != null && !submachineState
-				.getSubstatechart().eIsProxy())) {
-			if(submachineState.eResource().getURI().equals(submachineState.getSubstatechart().eResource().getURI()))
-			return error(submachineState, diagnostics,
-					ISSUE_SUBMACHINESTATE__CYCLE);
-		}
-		return true;
-	}
+//	public boolean validateSubmachineState_SubStatechartExists(
+//			State submachineState, DiagnosticChain diagnostics,
+//			Map<Object, Object> context) {
+//		if ((submachineState.getSubstatechart() == null || submachineState
+//				.getSubstatechart().eIsProxy())) {
+//			return error(submachineState, diagnostics,
+//					ISSUE_SUBMACHINESTATE_WITHOUT_SUBMACHINE);
+//		}
+//		return true;
+//
+//	}
 
 	/**
 	 * <!-- begin-user-doc --> <!-- end-user-doc -->

+ 0 - 6
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/builder/SGraphBuilder.java

@@ -29,7 +29,6 @@ import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.Scope;
 import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.Trigger;
 import org.yakindu.sct.model.sgraph.Variable;
@@ -173,11 +172,6 @@ public class SGraphBuilder extends Function implements ISGraphExecutionBuilder {
 		return var;
 	}
 
-	@FunctionMethod("")
-	public Object build(RTRegion parent, SubmachineState state) {
-		throw new RuntimeException("Not yet implemented");
-	}
-
 	@FunctionMethod("")
 	public Object build(RTRegion parent, State state) {
 		RTState runtimeState = null;

+ 14 - 11
plugins/org.yakindu.sct.ui.editor/plugin.xml

@@ -87,8 +87,8 @@
             </param>
          </metamodelType>
           <metamodelType
-               eclass="SubmachineState"
-               edithelper="org.yakindu.sct.ui.editor.edithelper.SubmachineStateEditHelper"
+               eclass="State"
+               edithelper="org.yakindu.sct.ui.editor.edithelper.StateEditHelper"
                icon="icons/obj16/submachine-state-16.png"
                id="org.yakindu.sct.ui.editor.SubmachineState"
                kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
@@ -213,7 +213,7 @@
    <!-- Contribution Item Provider -->
    <extension point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders">
       <contributionItemProvider
-            class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider"
+            class="org.yakindu.sct.ui.editor.providers.StatechartDiagramContributionItemProvider"
             checkPluginLoaded="false">
          <Priority name="Low"/>
          <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
@@ -221,6 +221,17 @@
             <popupStructuredContributionCriteria objectClass="org.yakindu.sct.ui.editor.editparts.StatechartTextExpressionEditPart"/>
             <popupPredefinedItem id="editGroup" remove="true"/>
          </popupContribution>
+         <partContribution
+               class="org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor">
+            <partAction
+                  global="true"
+                  id="undo">
+            </partAction>
+            <partAction
+                  global="true"
+                  id="redo">
+            </partAction>
+         </partContribution>
       </contributionItemProvider>
    </extension>
    
@@ -482,14 +493,6 @@
             <input type="org.yakindu.sct.ui.editor.editparts.StatechartTextEditPart"/>
               <input type="org.yakindu.sct.ui.editor.editparts.StatechartNameEditPart"/>
          </propertySection>
-         <!-- Subchart model section -->
-          <propertySection
-            id="property.section.domain.submachine" 
-            tab="property.tab.domain"
-            class="org.yakindu.sct.ui.editor.propertysheets.SubmachineStatePropertySection">
-            <input type="org.yakindu.sct.ui.editor.editparts.SubmachineStateNameEditPart"/>
-            <input type="org.yakindu.sct.ui.editor.editparts.SubmachineStateEditPart"/>
-         </propertySection>
         <!-- Transition model section -->         
          <propertySection
             id="property.section.domain.transition" 

+ 1 - 3
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/StatePropertySectionFilter.java

@@ -4,14 +4,12 @@ import org.eclipse.jface.viewers.IFilter;
 import org.yakindu.sct.ui.editor.editparts.AbstractStateEditPart;
 import org.yakindu.sct.ui.editor.editparts.StateEditPart;
 import org.yakindu.sct.ui.editor.editparts.StateNameEditPart;
-import org.yakindu.sct.ui.editor.editparts.SubmachineStateEditPart;
 
 public class StatePropertySectionFilter implements IFilter {
 
 	public boolean select(Object toTest) {
 		return (toTest instanceof AbstractStateEditPart
-				|| toTest instanceof StateEditPart || toTest instanceof StateNameEditPart)
-				&& (!(toTest instanceof SubmachineStateEditPart));
+				|| toTest instanceof StateEditPart || toTest instanceof StateNameEditPart);
 	}
 
 }

+ 22 - 3
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/edithelper/StateEditHelper.java

@@ -14,10 +14,14 @@ import org.eclipse.gmf.runtime.common.core.command.ICommand;
 import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
 import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
 import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.widgets.Shell;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.SGraphFactory;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
 import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.ui.editor.dialogs.SelectSubmachineDialog;
 import org.yakindu.sct.ui.editor.editor.StatechartElementTypes;
 
 /**
@@ -33,7 +37,7 @@ public class StateEditHelper extends VertexEditHelper {
 	@Override
 	protected ICommand getConfigureCommand(ConfigureRequest req) {
 		SGraphFactory factory = SGraphFactory.eINSTANCE;
-		
+
 		// Composite State gets one region
 		if (StatechartElementTypes.COMPOSITE_STATE.equals(req
 				.getTypeToConfigure())) {
@@ -42,7 +46,7 @@ public class StateEditHelper extends VertexEditHelper {
 			return new SetValueCommand(new SetRequest(
 					req.getElementToConfigure(),
 					SGraphPackage.Literals.STATE__SUB_REGIONS, region));
-			
+
 			// Orthogonal State gets two regions
 		} else if (StatechartElementTypes.ORTHOGONAL_STATE.equals(req
 				.getTypeToConfigure())) {
@@ -55,8 +59,23 @@ public class StateEditHelper extends VertexEditHelper {
 					SGraphPackage.Literals.STATE__SUB_REGIONS,
 					com.google.common.collect.Lists.newArrayList(region,
 							region2)));
+
+			// Prompts the user to select a submachine resource
+		} else if (StatechartElementTypes.SUBMACHINE_STATE.equals(req
+				.getTypeToConfigure())) {
+			SelectSubmachineDialog dialog = new SelectSubmachineDialog(
+					new Shell());
+			if (Dialog.OK == dialog.open()) {
+				Statechart selectedSubmachine = dialog.getSelectedSubmachine();
+				if (selectedSubmachine != null) {
+					return new SetValueCommand(
+							new SetRequest(
+									req.getElementToConfigure(),
+									SGraphPackage.Literals.STATE__SUBSTATECHART,
+									selectedSubmachine));
+				}
+			}
 		}
 		return null;
-
 	}
 }

+ 0 - 47
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/edithelper/SubmachineStateEditHelper.java

@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.edithelper;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.widgets.Shell;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.ui.editor.dialogs.SelectSubmachineDialog;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class SubmachineStateEditHelper extends VertexEditHelper {
-
-	/**
-	 * Prompts the user to select the submachine resource
-	 */
-	@Override
-	protected ICommand getConfigureCommand(ConfigureRequest req) {
-		SelectSubmachineDialog dialog = new SelectSubmachineDialog(new Shell());
-		if (Dialog.OK == dialog.open()) {
-			Statechart selectedSubmachine = dialog.getSelectedSubmachine();
-			if (selectedSubmachine != null) {
-				return new SetValueCommand(new SetRequest(
-						req.getElementToConfigure(),
-						SGraphPackage.Literals.SUBMACHINE_STATE__SUBSTATECHART,
-						selectedSubmachine));
-			}
-		}
-		return null;
-	}
-}

+ 0 - 46
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/CompositeStateFigure.java

@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.editor.figures;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
-import org.yakindu.sct.ui.editor.editor.figures.utils.GridDataFactory;
-
-/**
- * Adds a Figure Compartment to the Statefigure.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class CompositeStateFigure extends StateFigure {
-
-	private Figure figureCompartmentPane;
-
-	public CompositeStateFigure(IMapMode mapMode) {
-		super(mapMode);
-	}
-
-	@Override
-	protected void createContents() {
-		super.createContents();
-		// Figure Compartment
-		figureCompartmentPane = new Figure();
-		figureCompartmentPane.setLayoutManager(new StackLayout());
-		this.add(figureCompartmentPane,
-				GridDataFactory.fillDefaults().grab(true, true).getData());
-
-	}
-
-	public Figure getFigureCompartmentPane() {
-		return figureCompartmentPane;
-	}
-}

+ 11 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/StateFigure.java

@@ -28,6 +28,7 @@ import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
 import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
 import org.eclipse.swt.graphics.Color;
 import org.yakindu.sct.ui.editor.editor.figures.utils.GridDataFactory;
+
 /**
  * 
  * @author andreas muelder
@@ -40,6 +41,7 @@ public class StateFigure extends RoundedRectangle {
 
 	private WrappingLabel nameFigure;
 	private Figure textCompartmentPane;
+	private Figure figureCompartmentPane;
 
 	public StateFigure(IMapMode mapMode) {
 		GridLayout layout = new GridLayout(1, false);
@@ -64,6 +66,11 @@ public class StateFigure extends RoundedRectangle {
 		textCompartmentPane.setLayoutManager(new StackLayout());
 		this.add(textCompartmentPane,
 				GridDataFactory.fillDefaults().grab(true, true).getData());
+
+		figureCompartmentPane = new Figure();
+		figureCompartmentPane.setLayoutManager(new StackLayout());
+		this.add(figureCompartmentPane,
+				GridDataFactory.fillDefaults().grab(true, true).getData());
 	}
 
 	public WrappingLabel getNameFigure() {
@@ -74,6 +81,10 @@ public class StateFigure extends RoundedRectangle {
 		return textCompartmentPane;
 	}
 
+	public Figure getFigureCompartmentPane() {
+		return figureCompartmentPane;
+	}
+
 	// ========= drawing related methods ============================
 
 	@Override

+ 0 - 127
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/SubStatechartFigure.java

@@ -1,127 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.editor.figures;
-
-import static org.yakindu.sct.ui.editor.editor.figures.utils.GraphicsUtil.fillVerticalGradientRoundedRectangle;
-import static org.yakindu.sct.ui.editor.editor.figures.utils.GraphicsUtil.mixColor;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.GridData;
-import org.eclipse.draw2d.GridLayout;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RoundedRectangle;
-import org.eclipse.draw2d.StackLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
-import org.eclipse.swt.graphics.Color;
-import org.yakindu.sct.ui.editor.editor.figures.utils.GridDataFactory;
-/**
- * 
- * @author andreas muelder
- * @author axel terfloth
- * 
- */
-public class SubStatechartFigure extends RoundedRectangle {
-
-	public static final int BLUR_SHADOW_WIDTH = 5;
-
-	private WrappingLabel nameFigure;
-	private Figure textCompartmentPane;
-
-	public SubStatechartFigure(IMapMode mapMode) {
-		GridLayout layout = new GridLayout(1, false);
-		this.setLayoutManager(layout);
-		this.setCornerDimensions(new Dimension(mapMode.DPtoLP(15), mapMode
-				.DPtoLP(15)));
-		this.setOutline(true);
-		createContents();
-	}
-
-	private void createContents() {
-		// Name Label
-		nameFigure = new WrappingLabel();
-		nameFigure.setAlignment(PositionConstants.CENTER);
-		this.add(
-				nameFigure,
-				GridDataFactory.fillDefaults()
-						.align(GridData.CENTER, GridData.CENTER)
-						.grab(true, false).getData());
-		// Text compartment
-		textCompartmentPane = new Figure();
-		textCompartmentPane.setLayoutManager(new StackLayout());
-		this.add(textCompartmentPane,
-				GridDataFactory.fillDefaults().grab(true, false).getData());
-	}
-
-	public WrappingLabel getNameFigure() {
-		return nameFigure;
-	}
-
-	public Figure getTextCompartmentPane() {
-		return textCompartmentPane;
-	}
-
-	// ========= drawing related methods ============================
-
-	@Override
-	public void paintFigure(Graphics graphics) {
-		drawBlurredShadow(graphics);
-		super.paintFigure(graphics);
-	}
-
-	/**
-	 * Fill the shape with a vertical color gradient. The gradient mixes a white
-	 * into the configured background color.
-	 */
-	@Override
-	protected void fillShape(Graphics graphics) {
-		Color c = mixColor(getBackgroundColor(), ColorConstants.white, 224);
-		fillVerticalGradientRoundedRectangle(graphics, getBounds(),
-				getCornerDimensions(), getBackgroundColor(), c);
-		c.dispose();
-	}
-
-	private void drawBlurredShadow(Graphics graphics) {
-		// draw the shadow...
-		graphics.pushState();
-
-		int size = MapModeUtil.getMapMode(this).DPtoLP(BLUR_SHADOW_WIDTH);
-		int step = MapModeUtil.getMapMode(this).DPtoLP(-1);
-
-		graphics.setForegroundColor(ColorConstants.gray);
-		graphics.setLineWidth(MapModeUtil.getMapMode(this).DPtoLP(2));
-		graphics.translate(size, size);
-		graphics.setClip(graphics.getClip(new Rectangle(getBounds())).expand(
-				size, size));
-		graphics.setAlpha(20);
-		outlineShape(graphics);
-		graphics.translate(step, step);
-		graphics.setAlpha(30);
-		outlineShape(graphics);
-		graphics.translate(step, step);
-		graphics.setAlpha(60);
-		outlineShape(graphics);
-		graphics.translate(step, step);
-		graphics.setAlpha(100);
-		outlineShape(graphics);
-		graphics.translate(step, step);
-		graphics.setAlpha(150);
-		outlineShape(graphics);
-
-		graphics.popState();
-	}
-
-}

+ 3 - 3
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/AbstractStateEditPart.java

@@ -22,7 +22,7 @@ import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
 import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
 import org.eclipse.gmf.runtime.notation.NotationPackage;
 import org.eclipse.gmf.runtime.notation.View;
-import org.yakindu.sct.model.sgraph.AbstractState;
+import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.ui.editor.editor.figures.StateFigure;
 import org.yakindu.sct.ui.editor.editor.figures.utils.MapModeUtils;
 import org.yakindu.sct.ui.editor.preferences.StatechartColorConstants;
@@ -95,8 +95,8 @@ public abstract class AbstractStateEditPart extends ShapeNodeEditPart {
 	}
 
 	@Override
-	public AbstractState resolveSemanticElement() {
-		return (AbstractState) super.resolveSemanticElement();
+	public State resolveSemanticElement() {
+		return (State) super.resolveSemanticElement();
 	}
 
 	@Override

+ 15 - 6
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/StateEditPart.java

@@ -10,6 +10,7 @@
  */
 package org.yakindu.sct.ui.editor.editparts;
 
+import java.util.Collections;
 import java.util.List;
 
 import org.eclipse.draw2d.GridData;
@@ -37,9 +38,10 @@ import org.eclipse.gmf.runtime.notation.Compartment;
 import org.eclipse.gmf.runtime.notation.Node;
 import org.eclipse.gmf.runtime.notation.NotationPackage;
 import org.eclipse.gmf.runtime.notation.View;
-import org.yakindu.sct.ui.editor.editor.figures.CompositeStateFigure;
 import org.yakindu.sct.ui.editor.editor.figures.StateFigure;
 import org.yakindu.sct.ui.editor.editor.figures.utils.GridDataFactory;
+import org.yakindu.sct.ui.editor.pictogram.PictogramEditPolicy;
+import org.yakindu.sct.ui.editor.pictogram.SubchartPictogram;
 
 /**
  * The EditPart for the State.
@@ -89,8 +91,8 @@ public class StateEditPart extends AbstractStateEditPart implements
 	}
 
 	@Override
-	public CompositeStateFigure createPrimaryShape() {
-		return new CompositeStateFigure(getMapMode());
+	public StateFigure createPrimaryShape() {
+		return new StateFigure(getMapMode());
 	}
 
 	@Override
@@ -107,6 +109,8 @@ public class StateEditPart extends AbstractStateEditPart implements
 						return UnexecutableCommand.INSTANCE;
 					}
 				});
+		installEditPolicy(PictogramEditPolicy.ROLE, new PictogramEditPolicy(
+				Collections.singletonList(new SubchartPictogram())));
 
 	}
 
@@ -233,8 +237,8 @@ public class StateEditPart extends AbstractStateEditPart implements
 		return getPrimaryShape().getFigureCompartmentPane();
 	}
 
-	public CompositeStateFigure getPrimaryShape() {
-		return (CompositeStateFigure) getFigure().getChildren().get(0);
+	public StateFigure getPrimaryShape() {
+		return (StateFigure) getFigure().getChildren().get(0);
 	}
 
 	@Override
@@ -245,7 +249,12 @@ public class StateEditPart extends AbstractStateEditPart implements
 			IFigure compartmentFigure = ((StateFigureCompartmentEditPart) childEditPart)
 					.getFigure();
 			pane.add(compartmentFigure);
-		} else {
+		} 
+//		else if (childEditPart instanceof SubmachineStateNameEditPart) {
+//			((SubmachineStateNameEditPart) childEditPart)
+//					.setLabel(getPrimaryShape().getNameFigure());
+//		} 
+		else {
 			super.addChildVisual(childEditPart, index);
 		}
 	}

+ 30 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/StateNameEditPart.java

@@ -11,9 +11,11 @@
 package org.yakindu.sct.ui.editor.editparts;
 
 import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.gmf.runtime.notation.View;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
 import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.ui.editor.DiagramActivator;
 
 import de.itemis.gmf.runtime.commons.editparts.TextAwareLabelEditPart;
@@ -44,4 +46,32 @@ public class StateNameEditPart extends TextAwareLabelEditPart {
 	public State resolveSemanticElement() {
 		return (State) super.resolveSemanticElement();
 	}
+	
+	@Override
+	protected void updateLabelText() {
+		if (resolveSemanticElement().getSubstatechart()!=null) {
+			StringBuilder builder = new StringBuilder();
+			builder.append(getEditText());
+			builder.append("::");
+			Statechart substatechart = resolveSemanticElement().getSubstatechart();
+			if (substatechart != null) {
+				builder.append(substatechart.getName());
+			} else {
+				builder.append("<Unknown>");
+			}
+			getWrappingLabel().setText(builder.toString());
+		}
+		else {
+			super.updateLabelText();
+		}
+		
+	};
+	
+	@Override
+	public void notifyChanged(Notification notification) {
+		super.notifyChanged(notification);
+		if (notification.getFeature() == SGraphPackage.Literals.STATE__SUBSTATECHART) {
+			updateLabelText();
+		}
+	}
 }

+ 0 - 48
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/SubmachineStateEditPart.java

@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.editparts;
-
-import java.util.Collections;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.yakindu.sct.ui.editor.pictogram.PictogramEditPolicy;
-import org.yakindu.sct.ui.editor.pictogram.SubchartPictogram;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class SubmachineStateEditPart extends AbstractStateEditPart {
-
-	public SubmachineStateEditPart(View view) {
-		super(view);
-	}
-	
-	@Override
-	protected void createDefaultEditPolicies() {
-		super.createDefaultEditPolicies();
-		installEditPolicy(PictogramEditPolicy.ROLE, new PictogramEditPolicy(
-				Collections.singletonList(new SubchartPictogram())));
-	}
-
-	@Override
-	protected void addChildVisual(EditPart childEditPart, int index) {
-		if (childEditPart instanceof SubmachineStateNameEditPart) {
-			((SubmachineStateNameEditPart) childEditPart)
-					.setLabel(getPrimaryShape().getNameFigure());
-		} else {
-			super.addChildVisual(childEditPart, index);
-		}
-	}
-
-}

+ 0 - 70
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editparts/SubmachineStateNameEditPart.java

@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.notation.View;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
-import org.yakindu.sct.ui.editor.DiagramActivator;
-
-import de.itemis.gmf.runtime.commons.editparts.TextAwareLabelEditPart;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class SubmachineStateNameEditPart extends TextAwareLabelEditPart {
-
-	public SubmachineStateNameEditPart(View view) {
-		super(view, SGraphPackage.Literals.NAMED_ELEMENT__NAME,
-				DiagramActivator.PLUGIN_ID);
-	}
-
-	public void setLabel(IFigure label) {
-		setFigure(label);
-	}
-
-	@Override
-	protected IFigure createFigure() {
-		return null;
-	}
-
-	@Override
-	public SubmachineState resolveSemanticElement() {
-		return (SubmachineState) super.resolveSemanticElement();
-	}
-
-	@Override
-	protected void updateLabelText() {
-		StringBuilder builder = new StringBuilder();
-		builder.append(getEditText());
-		builder.append("::");
-		Statechart substatechart = resolveSemanticElement().getSubstatechart();
-		if (substatechart != null) {
-			builder.append(substatechart.getName());
-		} else {
-			builder.append("<Unknown>");
-		}
-		getWrappingLabel().setText(builder.toString());
-	};
-
-	@Override
-	public void notifyChanged(Notification notification) {
-		super.notifyChanged(notification);
-		if (notification.getFeature() == SGraphPackage.Literals.SUBMACHINE_STATE__SUBSTATECHART) {
-			updateLabelText();
-		}
-	}
-}

+ 0 - 77
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/AbstractStateViewFactory.java

@@ -1,77 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.factories;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.ShapeStyle;
-import org.eclipse.gmf.runtime.notation.Style;
-import org.eclipse.gmf.runtime.notation.View;
-import org.yakindu.sct.ui.editor.preferences.StatechartColorConstants;
-import org.yakindu.sct.ui.editor.providers.SemanticHints;
-
-/**
- * Base Factory for States and Submachine States.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public abstract class AbstractStateViewFactory extends AbstractShapeViewFactory {
-
-	@Override
-	protected void decorateView(View containerView, View view,
-			IAdaptable semanticAdapter, String semanticHint, int index,
-			boolean persisted) {
-		super.decorateView(containerView, view, semanticAdapter, semanticHint,
-				index, persisted);
-
-		IAdaptable eObjectAdapter = null;
-		EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
-		if (eObject != null) {
-			eObjectAdapter = new EObjectAdapter(eObject);
-		}
-
-		FactoryUtils.createLabel(view, getStateNameSemanticHin1t());
-		getViewService().createNode(eObjectAdapter, view,
-				SemanticHints.STATE_TEXT_COMPARTMENT, ViewUtil.APPEND, true,
-				getPreferencesHint());
-
-		// Create states default styles
-		ShapeStyle style = (ShapeStyle) view
-				.getStyle(NotationPackage.Literals.SHAPE_STYLE);
-		style.setFillColor(FigureUtilities
-				.RGBToInteger(StatechartColorConstants.STATE_BG_COLOR.getRGB()));
-		style.setLineColor(FigureUtilities
-				.RGBToInteger(ColorConstants.lightGray.getRGB()));
-	}
-
-	protected String getStateNameSemanticHin1t() {
-		return SemanticHints.STATE_NAME;
-	}
-
-	@Override
-	protected List<Style> createStyles(View view) {
-		@SuppressWarnings("unchecked")
-		List<Style> styles = super.createStyles(view);
-		styles.add(NotationFactory.eINSTANCE.createFontStyle());
-		return styles;
-	}
-
-}

+ 34 - 4
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/StateViewFactory.java

@@ -10,13 +10,22 @@
  */
 package org.yakindu.sct.ui.editor.factories;
 
+import java.util.List;
+
 import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.ColorConstants;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
 import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
 import org.eclipse.gmf.runtime.notation.BooleanValueStyle;
 import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.ShapeStyle;
+import org.eclipse.gmf.runtime.notation.Style;
 import org.eclipse.gmf.runtime.notation.View;
+import org.yakindu.sct.ui.editor.preferences.StatechartColorConstants;
 import org.yakindu.sct.ui.editor.providers.SemanticHints;
 
 /**
@@ -24,8 +33,8 @@ import org.yakindu.sct.ui.editor.providers.SemanticHints;
  * @author muelder
  * 
  */
-public class StateViewFactory extends AbstractStateViewFactory {
-
+public class StateViewFactory extends AbstractShapeViewFactory {
+	
 	@SuppressWarnings("unchecked")
 	@Override
 	protected void decorateView(View containerView, View view,
@@ -33,14 +42,21 @@ public class StateViewFactory extends AbstractStateViewFactory {
 			boolean persisted) {
 		super.decorateView(containerView, view, semanticAdapter, semanticHint,
 				index, persisted);
+
 		IAdaptable eObjectAdapter = null;
 		EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
 		if (eObject != null) {
 			eObjectAdapter = new EObjectAdapter(eObject);
 		}
-		// Create figure compartment 
+		//State name
+		FactoryUtils.createLabel(view, SemanticHints.STATE_NAME);
+		//Text compartment
+		getViewService().createNode(eObjectAdapter, view,
+				SemanticHints.STATE_TEXT_COMPARTMENT, ViewUtil.APPEND, true,
+				getPreferencesHint());
+		//Figure compartment
 		getViewService().createNode(eObjectAdapter, view,
-				SemanticHints.COMPOSITE_STATE_FIGURE_COMPARTMENT, ViewUtil.APPEND, true,
+				SemanticHints.STATE_FIGURE_COMPARTMENT, ViewUtil.APPEND, true,
 				getPreferencesHint());
 
 		// Create a boolean value style that indicates the alignment of
@@ -50,6 +66,20 @@ public class StateViewFactory extends AbstractStateViewFactory {
 		layout.setBooleanValue(false);
 		view.getStyles().add(layout);
 
+		// Create states default styles
+		ShapeStyle style = (ShapeStyle) view
+				.getStyle(NotationPackage.Literals.SHAPE_STYLE);
+		style.setFillColor(FigureUtilities
+				.RGBToInteger(StatechartColorConstants.STATE_BG_COLOR.getRGB()));
+		style.setLineColor(FigureUtilities
+				.RGBToInteger(ColorConstants.lightGray.getRGB()));
 	}
 
+
+	@Override
+	protected List<Style> createStyles(View view) {
+		List<Style> styles = super.createStyles(view);
+		styles.add(NotationFactory.eINSTANCE.createFontStyle());
+		return styles;
+	}
 }

+ 0 - 26
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/SubmachineStateViewFactory.java

@@ -1,26 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.factories;
-
-import org.yakindu.sct.ui.editor.providers.SemanticHints;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class SubmachineStateViewFactory extends AbstractStateViewFactory {
-
-	@Override
-	protected String getStateNameSemanticHin1t() {
-		return SemanticHints.SUBMACHINE_STATE_NAME;
-	}
-}

+ 5 - 5
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/pictogram/OpenSubstatechartHandler.java

@@ -24,8 +24,8 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.eclipse.ui.part.FileEditorInput;
+import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor;
 
 /**
@@ -37,7 +37,7 @@ import org.yakindu.sct.ui.editor.editor.StatechartDiagramEditor;
 public class OpenSubstatechartHandler extends AbstractHandler {
 
 	public Object execute(ExecutionEvent event) throws ExecutionException {
-		SubmachineState selectedState = getSelectedSubmachineState(event);
+		State selectedState = getSelectedSubmachineState(event);
 		if (selectedState == null)
 			return null;
 		Statechart substatechart = selectedState.getSubstatechart();
@@ -56,15 +56,15 @@ public class OpenSubstatechartHandler extends AbstractHandler {
 		return null;
 	}
 
-	public static SubmachineState getSelectedSubmachineState(
+	public static State getSelectedSubmachineState(
 			final ExecutionEvent event) {
 		IGraphicalEditPart editPart = getSelectedEditPart(event);
 		if (editPart == null)
 			return null;
 		EObject semanticElement = editPart.resolveSemanticElement();
-		if (!(semanticElement instanceof SubmachineState))
+		if (!(semanticElement instanceof State))
 			return null;
-		return (SubmachineState) semanticElement;
+		return (State) semanticElement;
 	}
 
 	public static IGraphicalEditPart getSelectedEditPart(

+ 9 - 5
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/pictogram/PictogramEditPolicy.java

@@ -52,11 +52,11 @@ public class PictogramEditPolicy extends AbstractEditPolicy {
 
 	public static final String ROLE = "Pictograms";
 
-	protected static final int DEFAULT_Y_ABSOLUTE_OFFSET = -5;
+	protected static final int DEFAULT_Y_ABSOLUTE_OFFSET = -7;
 
 	protected static final double DEFAULT_Y_RELATIVE_OFFSET = 0.0;
 
-	protected static final int DEFAULT_X_ABSOLUTE_OFFSET = 5;
+	protected static final int DEFAULT_X_ABSOLUTE_OFFSET = -11;
 
 	protected static final double DEFAULT_X_RELATIVE_OFFSET = 0.0;
 
@@ -154,7 +154,7 @@ public class PictogramEditPolicy extends AbstractEditPolicy {
 							.getTranslated(
 									new Dimension(
 											(int) (relativeX * referenceBox.width)
-													+ absoluteX,
+													+  absoluteX + referenceBox.width - targetFigure.getBounds().width,
 											(int) (relativeY * referenceBox.height)
 													+ absoluteY
 													- targetFigure
@@ -171,7 +171,10 @@ public class PictogramEditPolicy extends AbstractEditPolicy {
 	 */
 	private static class PictogramContainerFigure extends Figure {
 		public PictogramContainerFigure() {
-			setLayoutManager(new FlowLayout());
+			FlowLayout layout = new FlowLayout();
+			layout.setMajorAlignment(FlowLayout.ALIGN_BOTTOMRIGHT);
+			layout.setMinorAlignment(FlowLayout.ALIGN_BOTTOMRIGHT);
+			setLayoutManager(layout);
 		}
 	}
 
@@ -186,7 +189,8 @@ public class PictogramEditPolicy extends AbstractEditPolicy {
 					.get(pictogram);
 			final boolean validContext = pictogram.getHandlerContextValidator()
 					.isValidContext(createExecutionEvent(null));
-			pictogramFigure.setEnabled(validContext);
+			
+			pictogramFigure.setVisible(validContext);
 			pictogramFigure.repaint();
 		}
 	}

+ 2 - 2
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/pictogram/SubchartPictogram.java

@@ -11,7 +11,7 @@
 package org.yakindu.sct.ui.editor.pictogram;
 
 import org.eclipse.core.commands.ExecutionEvent;
-import org.yakindu.sct.model.sgraph.SubmachineState;
+import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.ui.editor.StatechartImages;
 
 /**
@@ -31,7 +31,7 @@ public class SubchartPictogram extends Pictogram {
 	private static IHandlerContextValidator getHandlerExecutionContextValidator() {
 		return new IHandlerContextValidator() {
 			public boolean isValidContext(ExecutionEvent event) {
-				SubmachineState selectedState = OpenSubstatechartHandler
+				State selectedState = OpenSubstatechartHandler
 						.getSelectedSubmachineState(event);
 				if (selectedState.getSubstatechart() == null)
 					return false;

+ 4 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/StatePropertySection.java

@@ -41,5 +41,9 @@ public class StatePropertySection extends NamePropertySection {
 				getActiveEditorResource(),
 				IYakinduSctHelpContextIds.SC_PROPERTIES_STATE_EXPRESSION);
 		descriptors.add(expressionsDescriptor);
+		
+		// Submachine reference
+		SubmachineSelectionDialogPropertyDescriptor submachineDescriptor = new SubmachineSelectionDialogPropertyDescriptor();
+		descriptors.add(submachineDescriptor);
 	}
 }

+ 6 - 6
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/SubmachineSelectionDialogPropertyDescriptor.java

@@ -31,8 +31,8 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.yakindu.sct.model.sgraph.SGraphPackage;
+import org.yakindu.sct.model.sgraph.State;
 import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.ui.editor.dialogs.SelectSubmachineDialog;
 
 import de.itemis.gmf.runtime.commons.properties.descriptors.IFormPropertyDescriptor;
@@ -48,18 +48,18 @@ public class SubmachineSelectionDialogPropertyDescriptor implements
 	private final class UpdateLabelAdapter extends AdapterImpl {
 		@Override
 		public void notifyChanged(Notification msg) {
-			if (msg.getFeature() == SGraphPackage.Literals.SUBMACHINE_STATE__SUBSTATECHART) {
+			if (msg.getFeature() == SGraphPackage.Literals.STATE__SUBSTATECHART) {
 				updateLabel(submachine);
 			}
 		}
 	}
 
-	private SubmachineState submachine;
+	private State submachine;
 	private Label label;
 	private UpdateLabelAdapter updateLabelAdapter;
 
 	public void updateModelBinding(EObject eObject) {
-		this.submachine = (SubmachineState) eObject;
+		this.submachine = (State) eObject;
 		updateLabel(submachine);
 		if (updateLabelAdapter == null) {
 			updateLabelAdapter = new UpdateLabelAdapter();
@@ -68,7 +68,7 @@ public class SubmachineSelectionDialogPropertyDescriptor implements
 
 	}
 
-	private void updateLabel(SubmachineState state) {
+	private void updateLabel(State state) {
 		Statechart substatechart = submachine.getSubstatechart();
 		if (substatechart != null) {
 			label.setText(substatechart.eResource().getURI().toString());
@@ -108,7 +108,7 @@ public class SubmachineSelectionDialogPropertyDescriptor implements
 						SetValueCommand command = new SetValueCommand(
 								new SetRequest(
 										submachine,
-										SGraphPackage.Literals.SUBMACHINE_STATE__SUBSTATECHART,
+										SGraphPackage.Literals.STATE__SUBSTATECHART,
 										selectedSubmachine));
 						try {
 							OperationHistoryFactory.getOperationHistory()

+ 0 - 33
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/SubmachineStatePropertySection.java

@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.ui.editor.propertysheets;
-
-import java.util.List;
-
-import de.itemis.gmf.runtime.commons.properties.descriptors.IFormPropertyDescriptor;
-
-/**
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public class SubmachineStatePropertySection extends StatePropertySection {
-
-	@Override
-	protected void createPropertyDescriptors(
-			List<IFormPropertyDescriptor> descriptors) {
-		super.createPropertyDescriptors(descriptors);
-		// Submachine reference
-		SubmachineSelectionDialogPropertyDescriptor submachineDescriptor = new SubmachineSelectionDialogPropertyDescriptor();
-		descriptors.add(submachineDescriptor);
-	}
-
-}

+ 1 - 1
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/SemanticHints.java

@@ -32,11 +32,11 @@ public interface SemanticHints {
 	String STATE_NAME = "StateName";
 	String STATE_TEXT_COMPARTMENT = "StateTextCompartment";
 	String STATE_TEXT_COMPARTMENT_EXPRESSION = "StateTextCompartmentExpression";
+	String STATE_FIGURE_COMPARTMENT = "StateFigureCompartment";
 
 	String STATE = "State";
 	String SUBMACHINE_STATE = "SubmachineState";
 	String SUBMACHINE_STATE_NAME = "SubmachineStateName";
-	String COMPOSITE_STATE_FIGURE_COMPARTMENT = "StateFigureCompartment";
 
 	String CHOICE = "Choice";
 

+ 25 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramContributionItemProvider.java

@@ -0,0 +1,25 @@
+package org.yakindu.sct.ui.editor.providers;
+
+import org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.actions.ActionFactory;
+
+import de.itemis.gmf.runtime.commons.actions.LockableGlobalRedoAction;
+import de.itemis.gmf.runtime.commons.actions.LockableGlobalUndoAction;
+
+public class StatechartDiagramContributionItemProvider extends
+		DiagramContributionItemProvider {
+	
+	@Override
+	protected IAction createAction(String actionId,
+			IWorkbenchPartDescriptor partDescriptor) {
+		IWorkbenchPage workbenchPage = partDescriptor.getPartPage();
+		if (actionId.equals(ActionFactory.UNDO.getId()))
+			return new LockableGlobalUndoAction(workbenchPage);
+		if (actionId.equals(ActionFactory.REDO.getId()))
+			return new LockableGlobalRedoAction(workbenchPage);
+		return super.createAction(actionId, partDescriptor);
+	}
+}

+ 4 - 5
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramEditPartProvider.java

@@ -36,8 +36,6 @@ import org.yakindu.sct.ui.editor.editparts.StatechartDiagramEditPart;
 import org.yakindu.sct.ui.editor.editparts.StatechartNameEditPart;
 import org.yakindu.sct.ui.editor.editparts.StatechartTextEditPart;
 import org.yakindu.sct.ui.editor.editparts.StatechartTextExpressionEditPart;
-import org.yakindu.sct.ui.editor.editparts.SubmachineStateEditPart;
-import org.yakindu.sct.ui.editor.editparts.SubmachineStateNameEditPart;
 import org.yakindu.sct.ui.editor.editparts.SynchronizationEditPart;
 import org.yakindu.sct.ui.editor.editparts.TransitionEditPart;
 import org.yakindu.sct.ui.editor.editparts.TransitionExpressionEditPart;
@@ -79,13 +77,13 @@ public class StatechartDiagramEditPartProvider extends AbstractEditPartProvider
 		editParts.put(STATE_NAME, StateNameEditPart.class);
 		editParts.put(STATE_TEXT_COMPARTMENT,
 				StateTextCompartmentEditPart.class);
+		editParts.put(SUBMACHINE_STATE, StateEditPart.class);
+		editParts.put(SUBMACHINE_STATE_NAME, StateNameEditPart.class);
 		editParts.put(STATE_TEXT_COMPARTMENT_EXPRESSION,
 				StateTextCompartmentExpressionEditPart.class);
 		editParts.put(STATE, StateEditPart.class);
-		editParts.put(COMPOSITE_STATE_FIGURE_COMPARTMENT,
+		editParts.put(STATE_FIGURE_COMPARTMENT,
 				StateFigureCompartmentEditPart.class);
-		editParts.put(SUBMACHINE_STATE, SubmachineStateEditPart.class);
-		editParts.put(SUBMACHINE_STATE_NAME, SubmachineStateNameEditPart.class);
 		editParts.put(TRANSITION, TransitionEditPart.class);
 		editParts
 				.put(TRANSITION_EXPRESSION, TransitionExpressionEditPart.class);
@@ -100,6 +98,7 @@ public class StatechartDiagramEditPartProvider extends AbstractEditPartProvider
 
 	@Override
 	protected Class<? extends IGraphicalEditPart> getNodeEditPartClass(View view) {
+		System.out.println(view.getType());
 		return getClass(view.getType());
 	}
 

+ 3 - 5
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramViewProvider.java

@@ -27,7 +27,6 @@ import org.yakindu.sct.ui.editor.factories.StateTextCompartmentViewFactory;
 import org.yakindu.sct.ui.editor.factories.StateViewFactory;
 import org.yakindu.sct.ui.editor.factories.StatechartDiagramViewFactory;
 import org.yakindu.sct.ui.editor.factories.StatechartTextFactory;
-import org.yakindu.sct.ui.editor.factories.SubmachineStateViewFactory;
 import org.yakindu.sct.ui.editor.factories.TransitionViewFactory;
 import org.yakindu.sct.ui.editor.utils.SemanticHintUtil;
 
@@ -57,10 +56,9 @@ public class StatechartDiagramViewProvider extends AbstractViewProvider
 		factories.put(STATE, StateViewFactory.class);
 		factories.put(STATE_TEXT_COMPARTMENT,
 				StateTextCompartmentViewFactory.class);
-		factories.put(COMPOSITE_STATE_FIGURE_COMPARTMENT,
-				CompartmentViewFactory.class);
-		factories.put(SUBMACHINE_STATE, SubmachineStateViewFactory.class);
-	
+		factories.put(STATE_FIGURE_COMPARTMENT, CompartmentViewFactory.class);
+		factories.put(SUBMACHINE_STATE, StateViewFactory.class);
+
 		factories
 				.put(STATE_TEXT_COMPARTMENT_EXPRESSION, ShapeViewFactory.class);
 		factories.put(TRANSITION, TransitionViewFactory.class);

+ 0 - 5
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/utils/SemanticHintUtil.java

@@ -18,7 +18,6 @@ import org.yakindu.sct.model.sgraph.FinalState;
 import org.yakindu.sct.model.sgraph.Junction;
 import org.yakindu.sct.model.sgraph.Region;
 import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.SubmachineState;
 import org.yakindu.sct.model.sgraph.Transition;
 import org.yakindu.sct.model.sgraph.util.SGraphSwitch;
 import org.yakindu.sct.ui.editor.providers.SemanticHints;
@@ -52,10 +51,6 @@ public final class SemanticHintUtil implements SemanticHints {
 				return STATE;
 			}
 
-			public String caseSubmachineState(SubmachineState object) {
-				return SUBMACHINE_STATE;
-			};
-
 			@Override
 			public String caseRegion(Region object) {
 				return REGION;

+ 1 - 1
plugins/org.yakindu.sct.ui.integration.stext/src/org/yakindu/sct/ui/integration/stext/StateExpressionProvider.java

@@ -35,7 +35,7 @@ public class StateExpressionProvider extends AbstractExpressionsProvider
 	
 	@Override
 	protected EClass getType() {
-		return SGraphPackage.Literals.ABSTRACT_STATE;
+		return SGraphPackage.Literals.STATE;
 	}
 
 	@Override