Procházet zdrojové kódy

Added substatecharts

Andreas Mülder před 14 roky
rodič
revize
3989a51a65
17 změnil soubory, kde provedl 903 přidání a 145 odebrání
  1. 4 0
      plugins/org.yakindu.sct.model.sgraph.edit/plugin.properties
  2. 95 0
      plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/StateItemProvider.java
  3. 7 0
      plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore
  4. 149 1
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphPackage.java
  5. 75 0
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/State.java
  6. 36 0
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SGraphPackageImpl.java
  7. 311 136
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/StateImpl.java
  8. 7 0
      plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/sgraph.ecore
  9. 34 0
      plugins/org.yakindu.sct.ui.editor/plugin.xml
  10. 3 3
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/StatechartDiagramPaletteFactory.java
  11. 127 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/editor/figures/SubStatechartFigure.java
  12. 6 3
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/EntryPropertySection.java
  13. 1 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/NamePropertySection.java
  14. 39 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/SubchartStatePropertySection.java
  15. 1 1
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramEditPartProvider.java
  16. 4 1
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/providers/StatechartDiagramViewProvider.java
  17. 4 0
      plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/utils/SemanticHintUtil.java

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

@@ -118,3 +118,7 @@ _UI_EntryKind_deepHistory_literal = DEEP_HISTORY
 _UI_Synchronization_type = Synchronization
 _UI_Region_priority_feature = Priority
 _UI_Transition_priority_feature = Priority
+_UI_State_substatechart_feature = Substatechart
+_UI_State_submachineState_feature = Submachine State
+_UI_State_compositeState_feature = Composite State
+_UI_State_simpleState_feature = Simple State

+ 95 - 0
plugins/org.yakindu.sct.model.sgraph.edit/src/org/yakindu/sct/model/sgraph/provider/StateItemProvider.java

@@ -74,6 +74,10 @@ public class StateItemProvider
 
 			addExpressionPropertyDescriptor(object);
 			addReactionsPropertyDescriptor(object);
+			addSubstatechartPropertyDescriptor(object);
+			addSubmachineStatePropertyDescriptor(object);
+			addCompositeStatePropertyDescriptor(object);
+			addSimpleStatePropertyDescriptor(object);
 		}
 		return itemPropertyDescriptors;
 	}
@@ -122,6 +126,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 State feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSubmachineStatePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_submachineState_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_submachineState_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__SUBMACHINE_STATE,
+				 false,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Composite State feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addCompositeStatePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_compositeState_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_compositeState_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__COMPOSITE_STATE,
+				 false,
+				 false,
+				 false,
+				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+				 null,
+				 null));
+	}
+
+	/**
+	 * This adds a property descriptor for the Simple State feature.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected void addSimpleStatePropertyDescriptor(Object object) {
+		itemPropertyDescriptors.add
+			(createItemPropertyDescriptor
+				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+				 getResourceLocator(),
+				 getString("_UI_State_simpleState_feature"),
+				 getString("_UI_PropertyDescriptor_description", "_UI_State_simpleState_feature", "_UI_State_type"),
+				 SGraphPackage.Literals.STATE__SIMPLE_STATE,
+				 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
@@ -192,6 +284,9 @@ public class StateItemProvider
 
 		switch (notification.getFeatureID(State.class)) {
 			case SGraphPackage.STATE__EXPRESSION:
+			case SGraphPackage.STATE__SUBMACHINE_STATE:
+			case SGraphPackage.STATE__COMPOSITE_STATE:
+			case SGraphPackage.STATE__SIMPLE_STATE:
 				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
 				return;
 			case SGraphPackage.STATE__LOCAL_REACTIONS:

+ 7 - 0
plugins/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore

@@ -43,6 +43,13 @@
     </eAnnotations>
     <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
         upperBound="-1" eType="#//Region" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachineState" 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="compositeState" 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="simpleState" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
   <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>

+ 149 - 1
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/SGraphPackage.java

@@ -447,6 +447,42 @@ public interface SGraphPackage extends EPackage {
 	 */
 	int STATE__SUB_REGIONS = VERTEX_FEATURE_COUNT + 4;
 
+	/**
+	 * The feature id for the '<em><b>Substatechart</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int STATE__SUBSTATECHART = VERTEX_FEATURE_COUNT + 5;
+
+	/**
+	 * The feature id for the '<em><b>Submachine State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int STATE__SUBMACHINE_STATE = VERTEX_FEATURE_COUNT + 6;
+
+	/**
+	 * The feature id for the '<em><b>Composite State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int STATE__COMPOSITE_STATE = VERTEX_FEATURE_COUNT + 7;
+
+	/**
+	 * The feature id for the '<em><b>Simple State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int STATE__SIMPLE_STATE = VERTEX_FEATURE_COUNT + 8;
+
 	/**
 	 * The number of structural features of the '<em>State</em>' class.
 	 * <!-- begin-user-doc -->
@@ -454,7 +490,7 @@ public interface SGraphPackage extends EPackage {
 	 * @generated
 	 * @ordered
 	 */
-	int STATE_FEATURE_COUNT = VERTEX_FEATURE_COUNT + 5;
+	int STATE_FEATURE_COUNT = VERTEX_FEATURE_COUNT + 9;
 
 	/**
 	 * The meta object id for the '{@link org.yakindu.sct.model.sgraph.impl.FinalStateImpl <em>Final State</em>}' class.
@@ -547,6 +583,42 @@ public interface SGraphPackage extends EPackage {
 	 */
 	int FINAL_STATE__SUB_REGIONS = STATE__SUB_REGIONS;
 
+	/**
+	 * The feature id for the '<em><b>Substatechart</b></em>' reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int FINAL_STATE__SUBSTATECHART = STATE__SUBSTATECHART;
+
+	/**
+	 * The feature id for the '<em><b>Submachine State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int FINAL_STATE__SUBMACHINE_STATE = STATE__SUBMACHINE_STATE;
+
+	/**
+	 * The feature id for the '<em><b>Composite State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int FINAL_STATE__COMPOSITE_STATE = STATE__COMPOSITE_STATE;
+
+	/**
+	 * The feature id for the '<em><b>Simple State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int FINAL_STATE__SIMPLE_STATE = STATE__SIMPLE_STATE;
+
 	/**
 	 * The number of structural features of the '<em>Final State</em>' class.
 	 * <!-- begin-user-doc -->
@@ -1374,6 +1446,50 @@ public interface SGraphPackage extends EPackage {
 	 */
 	EReference getState_SubRegions();
 
+	/**
+	 * 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#isSubmachineState <em>Submachine State</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Submachine State</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#isSubmachineState()
+	 * @see #getState()
+	 * @generated
+	 */
+	EAttribute getState_SubmachineState();
+
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sgraph.State#isCompositeState <em>Composite State</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Composite State</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#isCompositeState()
+	 * @see #getState()
+	 * @generated
+	 */
+	EAttribute getState_CompositeState();
+
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.sct.model.sgraph.State#isSimpleState <em>Simple State</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Simple State</em>'.
+	 * @see org.yakindu.sct.model.sgraph.State#isSimpleState()
+	 * @see #getState()
+	 * @generated
+	 */
+	EAttribute getState_SimpleState();
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.sct.model.sgraph.Variable <em>Variable</em>}'.
 	 * <!-- begin-user-doc -->
@@ -1837,6 +1953,38 @@ public interface SGraphPackage extends EPackage {
 		 */
 		EReference STATE__SUB_REGIONS = eINSTANCE.getState_SubRegions();
 
+		/**
+		 * 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 State</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute STATE__SUBMACHINE_STATE = eINSTANCE.getState_SubmachineState();
+
+		/**
+		 * The meta object literal for the '<em><b>Composite State</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute STATE__COMPOSITE_STATE = eINSTANCE.getState_CompositeState();
+
+		/**
+		 * The meta object literal for the '<em><b>Simple State</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute STATE__SIMPLE_STATE = eINSTANCE.getState_SimpleState();
+
 		/**
 		 * The meta object literal for the '{@link org.yakindu.sct.model.sgraph.impl.VariableImpl <em>Variable</em>}' class.
 		 * <!-- begin-user-doc -->

+ 75 - 0
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/State.java

@@ -21,6 +21,10 @@ import org.eclipse.emf.common.util.EList;
  * The following features are supported:
  * <ul>
  *   <li>{@link org.yakindu.sct.model.sgraph.State#getSubRegions <em>Sub Regions</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#getSubstatechart <em>Substatechart</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#isSubmachineState <em>Submachine State</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#isCompositeState <em>Composite State</em>}</li>
+ *   <li>{@link org.yakindu.sct.model.sgraph.State#isSimpleState <em>Simple State</em>}</li>
  * </ul>
  * </p>
  *
@@ -52,4 +56,75 @@ public interface State extends Vertex, ExpressionElement, ReactiveElement, Scope
 	 */
 	EList<Region> getSubRegions();
 
+	/**
+	 * 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 State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Submachine State</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 State</em>' attribute.
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_SubmachineState()
+	 * @model transient="true" changeable="false" volatile="true" derived="true"
+	 * @generated
+	 */
+	boolean isSubmachineState();
+
+	/**
+	 * Returns the value of the '<em><b>Composite State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Composite State</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 State</em>' attribute.
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_CompositeState()
+	 * @model transient="true" changeable="false" volatile="true" derived="true"
+	 * @generated
+	 */
+	boolean isCompositeState();
+
+	/**
+	 * Returns the value of the '<em><b>Simple State</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Simple State</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 State</em>' attribute.
+	 * @see org.yakindu.sct.model.sgraph.SGraphPackage#getState_SimpleState()
+	 * @model transient="true" changeable="false" volatile="true"
+	 * @generated
+	 */
+	boolean isSimpleState();
+
 } // State

+ 36 - 0
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/SGraphPackageImpl.java

@@ -460,6 +460,42 @@ public class SGraphPackageImpl extends EPackageImpl implements SGraphPackage {
         return (EReference)getState().getEStructuralFeatures().get(0);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getState_Substatechart() {
+        return (EReference)getState().getEStructuralFeatures().get(1);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getState_SubmachineState() {
+        return (EAttribute)getState().getEStructuralFeatures().get(2);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getState_CompositeState() {
+        return (EAttribute)getState().getEStructuralFeatures().get(3);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getState_SimpleState() {
+        return (EAttribute)getState().getEStructuralFeatures().get(4);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 311 - 136
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/StateImpl.java

@@ -29,36 +29,49 @@ 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 '<em><b>State</b></em>'.
- * <!-- end-user-doc -->
+ * <!-- begin-user-doc --> An implementation of the model object '
+ * <em><b>State</b></em>'. <!-- end-user-doc -->
  * <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#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#getSubstatechart <em>
+ * Substatechart</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSubmachineState <em>
+ * Submachine State</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isCompositeState <em>
+ * Composite State</em>}</li>
+ * <li>{@link org.yakindu.sct.model.sgraph.impl.StateImpl#isSimpleState <em>
+ * Simple State</em>}</li>
  * </ul>
  * </p>
- *
+ * 
  * @generated
  */
 public class StateImpl extends VertexImpl implements State {
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- 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 -->
+	 * The default value of the '{@link #getExpression() <em>Expression</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getExpression()
 	 * @generated
 	 * @ordered
@@ -66,9 +79,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected static final String EXPRESSION_EDEFAULT = null;
 
 	/**
-	 * The cached value of the '{@link #getExpression() <em>Expression</em>}' attribute.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The cached value of the '{@link #getExpression() <em>Expression</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getExpression()
 	 * @generated
 	 * @ordered
@@ -76,9 +89,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected String expression = EXPRESSION_EDEFAULT;
 
 	/**
-	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}' reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The cached value of the '{@link #getReactions() <em>Reactions</em>}'
+	 * reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getReactions()
 	 * @generated
 	 * @ordered
@@ -86,9 +99,10 @@ public class StateImpl extends VertexImpl implements State {
 	protected EList<Reaction> reactions;
 
 	/**
-	 * The cached value of the '{@link #getLocalReactions() <em>Local Reactions</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The cached value of the '{@link #getLocalReactions()
+	 * <em>Local Reactions</em>}' containment reference list. <!--
+	 * begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getLocalReactions()
 	 * @generated
 	 * @ordered
@@ -96,9 +110,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected EList<Reaction> localReactions;
 
 	/**
-	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The cached value of the '{@link #getScopes() <em>Scopes</em>}'
+	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getScopes()
 	 * @generated
 	 * @ordered
@@ -106,9 +120,9 @@ public class StateImpl extends VertexImpl implements State {
 	protected EList<Scope> scopes;
 
 	/**
-	 * The cached value of the '{@link #getSubRegions() <em>Sub Regions</em>}' containment reference list.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * The cached value of the '{@link #getSubRegions() <em>Sub Regions</em>}'
+	 * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @see #getSubRegions()
 	 * @generated
 	 * @ordered
@@ -116,8 +130,51 @@ public class StateImpl extends VertexImpl implements State {
 	protected EList<Region> subRegions;
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * 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 #isSubmachineState()
+	 * <em>Submachine State</em>}' attribute. <!-- begin-user-doc --> <!--
+	 * end-user-doc -->
+	 * 
+	 * @see #isSubmachineState()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean SUBMACHINE_STATE_EDEFAULT = false;
+
+	/**
+	 * The default value of the '{@link #isCompositeState()
+	 * <em>Composite State</em>}' attribute. <!-- begin-user-doc --> <!--
+	 * end-user-doc -->
+	 * 
+	 * @see #isCompositeState()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean COMPOSITE_STATE_EDEFAULT = false;
+
+	/**
+	 * The default value of the '{@link #isSimpleState() <em>Simple State</em>}'
+	 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @see #isSimpleState()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final boolean SIMPLE_STATE_EDEFAULT = false;
+
+	/**
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	protected StateImpl() {
@@ -125,8 +182,8 @@ public class StateImpl extends VertexImpl implements State {
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
@@ -135,8 +192,8 @@ public class StateImpl extends VertexImpl implements State {
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public String getExpression() {
@@ -144,245 +201,363 @@ public class StateImpl extends VertexImpl implements State {
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- 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));
+			eNotify(new ENotificationImpl(this, Notification.SET,
+					SGraphPackage.STATE__EXPRESSION, oldExpression, expression));
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public EList<Reaction> getReactions() {
 		if (reactions == null) {
-			reactions = new EObjectResolvingEList<Reaction>(Reaction.class, this, SGraphPackage.STATE__REACTIONS);
+			reactions = new EObjectResolvingEList<Reaction>(Reaction.class,
+					this, SGraphPackage.STATE__REACTIONS);
 		}
 		return reactions;
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- 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);
+			localReactions = new EObjectContainmentEList<Reaction>(
+					Reaction.class, this, SGraphPackage.STATE__LOCAL_REACTIONS);
 		}
 		return localReactions;
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public EList<Scope> getScopes() {
 		if (scopes == null) {
-			scopes = new EObjectContainmentEList<Scope>(Scope.class, this, SGraphPackage.STATE__SCOPES);
+			scopes = new EObjectContainmentEList<Scope>(Scope.class, this,
+					SGraphPackage.STATE__SCOPES);
 		}
 		return scopes;
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	public EList<Region> getSubRegions() {
 		if (subRegions == null) {
-			subRegions = new EObjectContainmentEList<Region>(Region.class, this, SGraphPackage.STATE__SUB_REGIONS);
+			subRegions = new EObjectContainmentEList<Region>(Region.class,
+					this, SGraphPackage.STATE__SUB_REGIONS);
 		}
 		return subRegions;
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- 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 isSubmachineState() {
+		return getSubstatechart() != null;
+	}
+
+	/**
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated NOT
+	 */
+	public boolean isCompositeState() {
+		return getSubRegions() != null && getSubRegions().size() > 0;
+	}
+
+	/**
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
+	 * @generated
+	 */
+	public boolean isSimpleState() {
+		return getSubRegions() == null || getSubRegions().size() == 0;
+	}
+
+	/**
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+	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);
+		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);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@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__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__SUBSTATECHART:
+			if (resolve)
+				return getSubstatechart();
+			return basicGetSubstatechart();
+		case SGraphPackage.STATE__SUBMACHINE_STATE:
+			return isSubmachineState();
+		case SGraphPackage.STATE__COMPOSITE_STATE:
+			return isCompositeState();
+		case SGraphPackage.STATE__SIMPLE_STATE:
+			return isSimpleState();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@SuppressWarnings("unchecked")
 	@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__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;
 		}
 		super.eSet(featureID, newValue);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@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__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;
 		}
 		super.eUnset(featureID);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@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__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__SUBSTATECHART:
+			return substatechart != null;
+		case SGraphPackage.STATE__SUBMACHINE_STATE:
+			return isSubmachineState() != SUBMACHINE_STATE_EDEFAULT;
+		case SGraphPackage.STATE__COMPOSITE_STATE:
+			return isCompositeState() != COMPOSITE_STATE_EDEFAULT;
+		case SGraphPackage.STATE__SIMPLE_STATE:
+			return isSimpleState() != SIMPLE_STATE_EDEFAULT;
 		}
 		return super.eIsSet(featureID);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- 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;
+			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;
+			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;
+			case SGraphPackage.STATE__SCOPES:
+				return SGraphPackage.SCOPED_ELEMENT__SCOPES;
+			default:
+				return -1;
 			}
 		}
 		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- 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;
+			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;
+			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;
+			case SGraphPackage.SCOPED_ELEMENT__SCOPES:
+				return SGraphPackage.STATE__SCOPES;
+			default:
+				return -1;
 			}
 		}
 		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
 	}
 
 	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
+	 * <!-- begin-user-doc --> <!-- end-user-doc -->
+	 * 
 	 * @generated
 	 */
 	@Override
 	public String toString() {
-		if (eIsProxy()) return super.toString();
+		if (eIsProxy())
+			return super.toString();
 
 		StringBuffer result = new StringBuffer(super.toString());
 		result.append(" (expression: ");
@@ -391,4 +566,4 @@ public class StateImpl extends VertexImpl implements State {
 		return result.toString();
 	}
 
-} //StateImpl
+} // StateImpl

+ 7 - 0
plugins/org.yakindu.sct.model.sgraph/src/org/yakindu/sct/model/sgraph/impl/sgraph.ecore

@@ -42,6 +42,13 @@
     </eAnnotations>
     <eStructuralFeatures xsi:type="ecore:EReference" name="subRegions" ordered="false"
         upperBound="-1" eType="#//Region" containment="true"/>
+    <eStructuralFeatures xsi:type="ecore:EReference" name="substatechart" eType="#//Statechart"/>
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="submachineState" 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="compositeState" 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="simpleState" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+        changeable="false" volatile="true" transient="true"/>
   </eClassifiers>
   <eClassifiers xsi:type="ecore:EClass" name="Variable" abstract="true" eSuperTypes="#//Declaration"/>
   <eClassifiers xsi:type="ecore:EClass" name="Junction" eSuperTypes="#//Pseudostate"/>

+ 34 - 0
plugins/org.yakindu.sct.ui.editor/plugin.xml

@@ -62,6 +62,19 @@
                   value="State">
             </param>
          </metamodelType>
+          <metamodelType
+               eclass="SubchartState"
+               edithelper="org.yakindu.sct.ui.editor.edithelper.VertexEditHelper"
+               icon="icons/obj16/substatechart-32.png"
+               id="org.yakindu.sct.ui.editor.SubchartState"
+               kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
+               name="SubchartState">
+            <param
+                  name="semanticHint"
+                  value="SubchartState">
+            </param>
+         </metamodelType>
+         
          <metamodelType
                eclass="Transition"
                edithelper="org.yakindu.sct.ui.editor.edithelper.TransitionEditHelper"
@@ -261,6 +274,20 @@
                            <content>
                            </content>
                      </expand>
+            </entry>
+              <entry
+                  description="Creates a sub statechart"
+                  id="org.yakindu.sct.ui.editor.SubchartState"
+                  kind="tool"
+                  label="Substatechart"
+                  large_icon="icons/obj16/substatechart-32.png"
+                  path="/tools/"
+                  small_icon="icons/obj16/substatechart-16.png">
+                   <expand
+                         force="true">
+                           <content>
+                           </content>
+                     </expand>
             </entry>
              <entry
                    description="Creates a region"
@@ -400,6 +427,13 @@
             <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.subchart" 
+            tab="property.tab.domain"
+            class="org.yakindu.sct.ui.editor.propertysheets.SubchartStatePropertySection">
+            <input type="org.yakindu.sct.ui.editor.editparts.SubchartStateEditPart"/>
+         </propertySection>
         <!-- Transition model section -->         
          <propertySection
             id="property.section.domain.transition" 

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

@@ -19,8 +19,8 @@ import org.eclipse.gmf.runtime.emf.type.core.IElementType;
 
 /**
  * 
- * @author andreas muelder
- * 
+ * @author andreas muelder - Initial contribution and API
+ *
  */
 public class StatechartDiagramPaletteFactory extends PaletteFactory.Adapter {
 
@@ -29,7 +29,7 @@ public class StatechartDiagramPaletteFactory extends PaletteFactory.Adapter {
 		IElementType elementType = ElementTypeRegistry.getInstance().getType(
 				toolId);
 		if (elementType == null)
-			throw new IllegalStateException("No Tool for toolId " + toolId
+			throw new IllegalStateException("No Element Id for toolId " + toolId
 					+ " found!");
 		if (toolId.equals(StatechartElementTypes.TRANSITION.getId())) {
 			return new ConnectionCreationTool(elementType);

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

@@ -0,0 +1,127 @@
+/**
+ * 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();
+	}
+
+}

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

@@ -17,11 +17,14 @@ import de.itemis.gmf.runtime.commons.properties.descriptors.IFormPropertyDescrip
 public class EntryPropertySection extends NamePropertySection {
 
 	@Override
-	protected void createPropertyDescriptors(List<IFormPropertyDescriptor> descriptors) {
+	protected void createPropertyDescriptors(
+			List<IFormPropertyDescriptor> descriptors) {
 		super.createPropertyDescriptors(descriptors);
 		// Combo Property Descriptor for Entry Kind
-		ComboPropertyDescriptor comboDescriptor = new ComboPropertyDescriptor(SGraphPackage.Literals.ENTRY__KIND, "Entry Kind: ",
-				EntryKind.values(), IYakinduSctHelpContextIds.SC_PROPERTIES_ENTRY_ENTRYKIND);
+		ComboPropertyDescriptor comboDescriptor = new ComboPropertyDescriptor(
+				SGraphPackage.Literals.ENTRY__KIND, "Entry Kind: ",
+				EntryKind.values(),
+				IYakinduSctHelpContextIds.SC_PROPERTIES_ENTRY_ENTRYKIND);
 		descriptors.add(comboDescriptor);
 	}
 

+ 1 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/NamePropertySection.java

@@ -24,4 +24,5 @@ public abstract class NamePropertySection extends AbstractEditorPropertySection
 				SGraphPackage.Literals.NAMED_ELEMENT__NAME, "Name: ");
 		descriptors.add(nameDescriptor);
 	}
+	
 }

+ 39 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/propertysheets/SubchartStatePropertySection.java

@@ -0,0 +1,39 @@
+package org.yakindu.sct.ui.editor.propertysheets;
+
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Shell;
+
+import de.itemis.gmf.runtime.commons.properties.descriptors.IFormPropertyDescriptor;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class SubchartStatePropertySection extends NamePropertySection {
+
+	@Override
+	protected void createPropertyDescriptors(
+			List<IFormPropertyDescriptor> descriptors) {
+		super.createPropertyDescriptors(descriptors);
+//		TextDialogPropertyDescriptor descriptor = new TextDialogPropertyDescriptor(
+//				null, "Substatechart:");
+//		descriptors.add(descriptor);
+	}
+
+
+	protected static class OpenDialogSelectionListener implements SelectionListener {
+
+		public void widgetSelected(SelectionEvent e) {
+			MessageDialog.openQuestion(new Shell(), "BLA", "BLUB");
+		}
+
+		public void widgetDefaultSelected(SelectionEvent e) {
+		}
+
+	}
+}

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

@@ -42,7 +42,7 @@ import org.yakindu.sct.ui.editor.editparts.TransitionExpressionEditPart;
 
 /**
  * 
- * @author muelder
+ * @author andreas muelder - Initial contribution and API
  * 
  */
 public class StatechartDiagramEditPartProvider extends AbstractEditPartProvider

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

@@ -32,7 +32,7 @@ import org.yakindu.sct.ui.editor.utils.SemanticHintUtil;
 
 /**
  * 
- * @author andreas muelder
+ * @author andreas muelder - Initial contribution and API
  * 
  */
 public class StatechartDiagramViewProvider extends AbstractViewProvider
@@ -72,6 +72,9 @@ public class StatechartDiagramViewProvider extends AbstractViewProvider
 
 	private Class<?> getClass(String semanticHint) {
 		Class<?> factory = factories.get(semanticHint);
+		if(factory == null){
+			throw new IllegalStateException("No factory found for semantic hint " + semanticHint);
+		}
 		return factory;
 	}
 

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

@@ -80,6 +80,10 @@ public final class SemanticHintUtil implements SemanticHints {
 				return CHOICE;
 			};
 
+			public String defaultCase(EObject object) {
+				throw new IllegalStateException(
+						"No Semantic Hint found for object " + object);
+			};
 		}.doSwitch(semanticElement);
 	}
 }