Browse Source

Removed currently unsupported generator features (EventBasedStatemachine, GenericInterfaceSupport).

Refactoring of trafficlight example.
markus.muehlbrandt@gmail.com 13 years ago
parent
commit
2e865ebae4

+ 0 - 1
examples/org.yakindu.sct.examples.trafficlight/GenModelJava.sgen

@@ -12,7 +12,6 @@ GeneratorModel for yakindu::java {
 		}
 
 		feature GeneralFeatures {
-			EventBasedStatemachine = false
 			InterfaceObserverSupport = false
 			TimerService = true
 			RuntimeService = true

+ 18 - 18
examples/org.yakindu.sct.examples.trafficlight/TrafficLightWaiting.sct

@@ -111,7 +111,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_w85ZURA_EeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_w85ZUhA_EeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_w85ZWxA_EeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_w85ZUxA_EeGQ0KsLDV4EFg" x="243" y="-1" width="185"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_w85ZUxA_EeGQ0KsLDV4EFg" x="247" y="8" width="262"/>
                 </children>
                 <children xmi:id="_iAUP0BBAEeGQ0KsLDV4EFg" type="State" element="_iAKe0BBAEeGQ0KsLDV4EFg">
                   <children xsi:type="notation:DecorationNode" xmi:id="_iAUP1BBAEeGQ0KsLDV4EFg" type="StateName">
@@ -144,7 +144,7 @@
                           <styles xsi:type="notation:ShapeStyle" xmi:id="_mjwl0RBAEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                           <styles xsi:type="notation:FontStyle" xmi:id="_mjwl0hBAEeGQ0KsLDV4EFg"/>
                           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_mjwl2xBAEeGQ0KsLDV4EFg"/>
-                          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_mjwl0xBAEeGQ0KsLDV4EFg" x="10" y="52" width="152" height="60"/>
+                          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_mjwl0xBAEeGQ0KsLDV4EFg" y="52" width="185" height="80"/>
                         </children>
                         <children xmi:id="_n6M0UBBAEeGQ0KsLDV4EFg" type="State" element="_n6DDUBBAEeGQ0KsLDV4EFg">
                           <children xsi:type="notation:DecorationNode" xmi:id="_n6M0VBBAEeGQ0KsLDV4EFg" type="StateName">
@@ -160,7 +160,7 @@
                           <styles xsi:type="notation:ShapeStyle" xmi:id="_n6M0URBAEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                           <styles xsi:type="notation:FontStyle" xmi:id="_n6M0UhBAEeGQ0KsLDV4EFg"/>
                           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_n6M0WxBAEeGQ0KsLDV4EFg"/>
-                          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_n6M0UxBAEeGQ0KsLDV4EFg" x="285" y="52" width="153" height="60"/>
+                          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_n6M0UxBAEeGQ0KsLDV4EFg" x="273" y="52" width="188" height="80"/>
                         </children>
                         <children xmi:id="_pqhicBBAEeGQ0KsLDV4EFg" type="Entry" element="_pqXxcBBAEeGQ0KsLDV4EFg">
                           <children xmi:id="_pqhicxBAEeGQ0KsLDV4EFg" type="BorderItemLabelContainer">
@@ -172,7 +172,7 @@
                             <layoutConstraint xsi:type="notation:Bounds" xmi:id="_pqhidRBAEeGQ0KsLDV4EFg"/>
                           </children>
                           <styles xsi:type="notation:ShapeStyle" xmi:id="_pqhicRBAEeGQ0KsLDV4EFg" fontName="Verdana" lineColor="4210752"/>
-                          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_pqhichBAEeGQ0KsLDV4EFg" x="76" y="8"/>
+                          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_pqhichBAEeGQ0KsLDV4EFg" x="88" y="7"/>
                         </children>
                         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_iBD2txBAEeGQ0KsLDV4EFg"/>
                       </children>
@@ -183,7 +183,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_iAUP0RBAEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_iAUP0hBAEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_iAUP2xBAEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_iAUP0xBAEeGQ0KsLDV4EFg" x="295" y="197" width="513" height="206"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_iAUP0xBAEeGQ0KsLDV4EFg" x="295" y="197" width="513" height="245"/>
                 </children>
                 <children xmi:id="_SKwP4BBBEeGQ0KsLDV4EFg" type="State" element="_SKct4BBBEeGQ0KsLDV4EFg">
                   <children xsi:type="notation:DecorationNode" xmi:id="_SKwP5BBBEeGQ0KsLDV4EFg" type="StateName">
@@ -199,7 +199,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_SKwP4RBBEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_SKwP4hBBEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_SKwP6xBBEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_SKwP4xBBEeGQ0KsLDV4EFg" x="462" y="514" width="178"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_SKwP4xBBEeGQ0KsLDV4EFg" x="442" y="514" width="218"/>
                 </children>
                 <children xmi:id="_fPRkMBBDEeGQ0KsLDV4EFg" type="State" element="_fO-pQBBDEeGQ0KsLDV4EFg">
                   <children xsi:type="notation:DecorationNode" xmi:id="_fPRkNBBDEeGQ0KsLDV4EFg" type="StateName">
@@ -215,7 +215,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_fPRkMRBDEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_fPRkMhBDEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_fPRkOxBDEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_fPRkMxBDEeGQ0KsLDV4EFg" x="3" y="514" width="170"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_fPRkMxBDEeGQ0KsLDV4EFg" x="3" y="514" width="222"/>
                 </children>
                 <children xmi:id="_12Y7ABBDEeGQ0KsLDV4EFg" type="State" element="_12GAEBBDEeGQ0KsLDV4EFg">
                   <children xsi:type="notation:DecorationNode" xmi:id="_12Y7BBBDEeGQ0KsLDV4EFg" type="StateName">
@@ -231,7 +231,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_12Y7ARBDEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_12Y7AhBDEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_12Y7CxBDEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_12Y7AxBDEeGQ0KsLDV4EFg" x="1" y="409" width="172"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_12Y7AxBDEeGQ0KsLDV4EFg" x="1" y="409" width="224"/>
                 </children>
                 <children xmi:id="_K-JX4RBEEeGQ0KsLDV4EFg" type="State" element="_K-JX7RBEEeGQ0KsLDV4EFg">
                   <children xsi:type="notation:DecorationNode" xmi:id="_K-JX4hBEEeGQ0KsLDV4EFg" type="StateName">
@@ -247,7 +247,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_K-JX6RBEEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_K-JX6hBEEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_K-JX6xBEEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_K-JX7BBEEeGQ0KsLDV4EFg" x="3" y="304" width="170"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_K-JX7BBEEeGQ0KsLDV4EFg" x="3" y="304" width="222"/>
                 </children>
                 <children xmi:id="_TfjYQRBEEeGQ0KsLDV4EFg" type="State" element="_TfjYTRBEEeGQ0KsLDV4EFg">
                   <children xsi:type="notation:DecorationNode" xmi:id="_TfjYQhBEEeGQ0KsLDV4EFg" type="StateName">
@@ -263,7 +263,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_TfjYSRBEEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_TfjYShBEEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_TfjYSxBEEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_TfjYTBBEEeGQ0KsLDV4EFg" x="1" y="179" width="172"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_TfjYTBBEEeGQ0KsLDV4EFg" x="1" y="179" width="224"/>
                 </children>
                 <children xmi:id="_xz9w8BBPEeGQ0KsLDV4EFg" type="Entry" element="_xz0nABBPEeGQ0KsLDV4EFg">
                   <children xmi:id="_xz9w8xBPEeGQ0KsLDV4EFg" type="BorderItemLabelContainer">
@@ -286,7 +286,7 @@
           <styles xsi:type="notation:ShapeStyle" xmi:id="_NPjBmxA-EeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
           <styles xsi:type="notation:FontStyle" xmi:id="_NPjBnBA-EeGQ0KsLDV4EFg"/>
           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_NPsyhRA-EeGQ0KsLDV4EFg"/>
-          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPsyhhA-EeGQ0KsLDV4EFg" x="4" y="43" width="856" height="696"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPsyhhA-EeGQ0KsLDV4EFg" x="4" y="43" width="856" height="716"/>
         </children>
         <children xmi:id="_MGCXkBBFEeGQ0KsLDV4EFg" type="State" element="_MF4mkBBFEeGQ0KsLDV4EFg">
           <children xsi:type="notation:DecorationNode" xmi:id="_MGCXlBBFEeGQ0KsLDV4EFg" type="StateName">
@@ -319,7 +319,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_BV6ncRBGEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_BV6nchBGEeGQ0KsLDV4EFg"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_BV6nexBGEeGQ0KsLDV4EFg"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_BV6ncxBGEeGQ0KsLDV4EFg" x="22" y="40" width="181" height="62"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_BV6ncxBGEeGQ0KsLDV4EFg" x="22" y="40" width="235" height="89"/>
                 </children>
                 <children xmi:id="_EUppcBBGEeGQ0KsLDV4EFg" type="Entry" element="_EUWHcBBGEeGQ0KsLDV4EFg">
                   <children xmi:id="_EUppcxBGEeGQ0KsLDV4EFg" type="BorderItemLabelContainer">
@@ -331,7 +331,7 @@
                     <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EUppdRBGEeGQ0KsLDV4EFg"/>
                   </children>
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_EUppcRBGEeGQ0KsLDV4EFg" fontName="Verdana" lineColor="4210752"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EUppchBGEeGQ0KsLDV4EFg" x="102" y="4"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_EUppchBGEeGQ0KsLDV4EFg" x="129" y="4"/>
                 </children>
                 <children xmi:id="_B7onYBzuEeGEC4raFz1JbQ" type="State" element="_B6YqMBzuEeGEC4raFz1JbQ">
                   <children xsi:type="notation:DecorationNode" xmi:id="_B7s40BzuEeGEC4raFz1JbQ" type="StateName">
@@ -347,7 +347,7 @@
                   <styles xsi:type="notation:ShapeStyle" xmi:id="_B7onYRzuEeGEC4raFz1JbQ" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
                   <styles xsi:type="notation:FontStyle" xmi:id="_B7onYhzuEeGEC4raFz1JbQ"/>
                   <styles xsi:type="notation:BooleanValueStyle" xmi:id="_B7uG8RzuEeGEC4raFz1JbQ"/>
-                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_B7onYxzuEeGEC4raFz1JbQ" x="22" y="150" width="181"/>
+                  <layoutConstraint xsi:type="notation:Bounds" xmi:id="_B7onYxzuEeGEC4raFz1JbQ" x="22" y="179" width="235"/>
                 </children>
                 <layoutConstraint xsi:type="notation:Bounds" xmi:id="_xHQAdBBFEeGQ0KsLDV4EFg"/>
               </children>
@@ -358,12 +358,12 @@
           <styles xsi:type="notation:ShapeStyle" xmi:id="_MGCXkRBFEeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15981773" lineColor="12632256"/>
           <styles xsi:type="notation:FontStyle" xmi:id="_MGCXkhBFEeGQ0KsLDV4EFg"/>
           <styles xsi:type="notation:BooleanValueStyle" xmi:id="_MGMIlBBFEeGQ0KsLDV4EFg"/>
-          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_MGCXkxBFEeGQ0KsLDV4EFg" x="945" y="208" width="270" height="367"/>
+          <layoutConstraint xsi:type="notation:Bounds" xmi:id="_MGCXkxBFEeGQ0KsLDV4EFg" x="945" y="208" width="328" height="446"/>
         </children>
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPjBixA-EeGQ0KsLDV4EFg"/>
       </children>
       <styles xsi:type="notation:ShapeStyle" xmi:id="_NPjBhRA-EeGQ0KsLDV4EFg" fontName="Verdana" fillColor="15790320" lineColor="12632256"/>
-      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPjBjBA-EeGQ0KsLDV4EFg" x="192" y="10" width="1279" height="783"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPjBjBA-EeGQ0KsLDV4EFg" x="192" y="10" width="1321" height="803"/>
     </children>
     <children xsi:type="notation:Shape" xmi:id="_NPsyjxA-EeGQ0KsLDV4EFg" type="StatechartText" fontName="Verdana" lineColor="4210752">
       <children xsi:type="notation:DecorationNode" xmi:id="_NPsykRA-EeGQ0KsLDV4EFg" type="StatechartName">
@@ -373,7 +373,7 @@
       <children xsi:type="notation:Shape" xmi:id="_NPsylBA-EeGQ0KsLDV4EFg" type="StatechartTextExpression" fontName="Verdana" lineColor="4210752">
         <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPsylRA-EeGQ0KsLDV4EFg"/>
       </children>
-      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPsylhA-EeGQ0KsLDV4EFg" x="10" y="10" width="183" height="215"/>
+      <layoutConstraint xsi:type="notation:Bounds" xmi:id="_NPsylhA-EeGQ0KsLDV4EFg" x="-7" y="10" width="183" height="411"/>
     </children>
     <styles xsi:type="notation:DiagramStyle" xmi:id="_NPjBghA-EeGQ0KsLDV4EFg"/>
     <edges xmi:id="_NPsyiBA-EeGQ0KsLDV4EFg" type="Transition" element="_NPsyhxA-EeGQ0KsLDV4EFg" source="_NPjBjhA-EeGQ0KsLDV4EFg" target="_NPjBmhA-EeGQ0KsLDV4EFg">
@@ -539,7 +539,7 @@
     <edges xmi:id="_P65-oBzuEeGEC4raFz1JbQ" type="Transition" element="_P6yC0BzuEeGEC4raFz1JbQ" source="_BV6ncBBGEeGQ0KsLDV4EFg" target="_B7onYBzuEeGEC4raFz1JbQ">
       <children xsi:type="notation:DecorationNode" xmi:id="_P66lsRzuEeGEC4raFz1JbQ" type="TransitionExpression">
         <styles xsi:type="notation:ShapeStyle" xmi:id="_P66lshzuEeGEC4raFz1JbQ"/>
-        <layoutConstraint xsi:type="notation:Location" xmi:id="_P66lsxzuEeGEC4raFz1JbQ" x="-11" y="-32"/>
+        <layoutConstraint xsi:type="notation:Location" xmi:id="_P66lsxzuEeGEC4raFz1JbQ" x="-7" y="-47"/>
       </children>
       <styles xsi:type="notation:ConnectorStyle" xmi:id="_P65-oRzuEeGEC4raFz1JbQ" lineColor="4210752"/>
       <styles xsi:type="notation:FontStyle" xmi:id="_P66lsBzuEeGEC4raFz1JbQ" fontName="Verdana"/>

+ 195 - 123
examples/org.yakindu.sct.examples.trafficlight/src-gen/org/yakindu/sct/examples/trafficlight/cyclebased/trafficlightwaiting/TrafficLightWaitingStatemachine.java

@@ -216,12 +216,17 @@ public class TrafficLightWaitingStatemachine
 		}
 		cycleStartTime = System.currentTimeMillis();
 		entryActionTrafficLightWaiting();
-		sCITrafficLight.setRed(false);
-		sCITrafficLight.setYellow(false);
-		sCITrafficLight.setGreen(true);
-		sCIPedestrian.setRed(true);
-		sCIPedestrian.setGreen(false);
-		sCIPedestrian.setRequest(false);
+		sCITrafficLight.red = false;
+
+		sCITrafficLight.yellow = false;
+
+		sCITrafficLight.green = true;
+
+		sCIPedestrian.red = true;
+
+		sCIPedestrian.green = false;
+
+		sCIPedestrian.request = false;
 
 		nextStateIndex = 0;
 		stateVector[0] = State.Main_region_on_r1_StreetGreen;
@@ -242,7 +247,7 @@ public class TrafficLightWaitingStatemachine
 				getTimerService().resetTimer(waitOn_time_event_0);
 
 				getTimerService().resetTimer(pedWaiting_time_event_0);
-				sCIPedestrian.setRequest(false);
+				sCIPedestrian.request = false;
 
 				break;
 
@@ -251,7 +256,7 @@ public class TrafficLightWaitingStatemachine
 				getTimerService().resetTimer(waitOff_time_event_0);
 
 				getTimerService().resetTimer(pedWaiting_time_event_0);
-				sCIPedestrian.setRequest(false);
+				sCIPedestrian.request = false;
 
 				break;
 
@@ -329,7 +334,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -338,7 +343,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -376,16 +381,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -399,7 +409,7 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(waitOn_time_event_0, 500,
 						cycleStartTime);
-				sCIPedestrian.setRequest(true);
+				sCIPedestrian.request = true;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_PedWaiting_r1_waitOn;
@@ -426,7 +436,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -435,7 +445,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -473,16 +483,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -509,13 +524,15 @@ public class TrafficLightWaitingStatemachine
 				}
 
 				getTimerService().resetTimer(pedWaiting_time_event_0);
-				sCIPedestrian.setRequest(false);
+				sCIPedestrian.request = false;
 
 				getTimerService().setTimer(streetAttention_time_event_0,
 						(2 * 1000), cycleStartTime);
-				sCITrafficLight.setRed(false);
-				sCITrafficLight.setYellow(true);
-				sCITrafficLight.setGreen(false);
+				sCITrafficLight.red = false;
+
+				sCITrafficLight.yellow = true;
+
+				sCITrafficLight.green = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_StreetAttention;
@@ -527,7 +544,7 @@ public class TrafficLightWaitingStatemachine
 
 					getTimerService().setTimer(waitOff_time_event_0, 500,
 							cycleStartTime);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					nextStateIndex = 0;
 					stateVector[0] = State.Main_region_on_r1_PedWaiting_r1_waitOff;
@@ -554,7 +571,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -563,7 +580,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -601,16 +618,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -637,13 +659,15 @@ public class TrafficLightWaitingStatemachine
 				}
 
 				getTimerService().resetTimer(pedWaiting_time_event_0);
-				sCIPedestrian.setRequest(false);
+				sCIPedestrian.request = false;
 
 				getTimerService().setTimer(streetAttention_time_event_0,
 						(2 * 1000), cycleStartTime);
-				sCITrafficLight.setRed(false);
-				sCITrafficLight.setYellow(true);
-				sCITrafficLight.setGreen(false);
+				sCITrafficLight.red = false;
+
+				sCITrafficLight.yellow = true;
+
+				sCITrafficLight.green = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_StreetAttention;
@@ -655,7 +679,7 @@ public class TrafficLightWaitingStatemachine
 
 					getTimerService().setTimer(waitOn_time_event_0, 500,
 							cycleStartTime);
-					sCIPedestrian.setRequest(true);
+					sCIPedestrian.request = true;
 
 					nextStateIndex = 0;
 					stateVector[0] = State.Main_region_on_r1_PedWaiting_r1_waitOn;
@@ -682,7 +706,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -691,7 +715,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -729,16 +753,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -750,9 +779,11 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(streetRed_time_event_0, (2 * 1000),
 						cycleStartTime);
-				sCITrafficLight.setRed(true);
-				sCITrafficLight.setYellow(false);
-				sCITrafficLight.setGreen(false);
+				sCITrafficLight.red = true;
+
+				sCITrafficLight.yellow = false;
+
+				sCITrafficLight.green = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_StreetRed;
@@ -777,7 +808,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -786,7 +817,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -824,16 +855,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -845,8 +881,9 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(pedestrianGreen_time_event_0,
 						(7 * 1000), cycleStartTime);
-				sCIPedestrian.setRed(false);
-				sCIPedestrian.setGreen(true);
+				sCIPedestrian.red = false;
+
+				sCIPedestrian.green = true;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_PedestrianGreen;
@@ -871,7 +908,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -880,7 +917,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -918,16 +955,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -939,8 +981,9 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(pedestrianRed_time_event_0,
 						(5 * 1000), cycleStartTime);
-				sCIPedestrian.setRed(true);
-				sCIPedestrian.setGreen(false);
+				sCIPedestrian.red = true;
+
+				sCIPedestrian.green = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_PedestrianRed;
@@ -965,7 +1008,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -974,7 +1017,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -1012,16 +1055,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -1033,9 +1081,11 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(streetPrepare_time_event_0,
 						(2 * 1000), cycleStartTime);
-				sCITrafficLight.setRed(true);
-				sCITrafficLight.setYellow(true);
-				sCITrafficLight.setGreen(false);
+				sCITrafficLight.red = true;
+
+				sCITrafficLight.yellow = true;
+
+				sCITrafficLight.green = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_StreetPrepare;
@@ -1060,7 +1110,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOn_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -1069,7 +1119,7 @@ public class TrafficLightWaitingStatemachine
 					getTimerService().resetTimer(waitOff_time_event_0);
 
 					getTimerService().resetTimer(pedWaiting_time_event_0);
-					sCIPedestrian.setRequest(false);
+					sCIPedestrian.request = false;
 
 					break;
 
@@ -1107,16 +1157,21 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setGreen(false);
-			sCITrafficLight.setYellow(false);
-			sCIPedestrian.setRed(false);
-			sCIPedestrian.setGreen(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.green = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCIPedestrian.red = false;
+
+			sCIPedestrian.green = false;
 
 			getTimerService().setTimer(yellowOn_time_event_0, 500,
 					cycleStartTime);
-			sCITrafficLight.setYellow(true);
-			sCIPedestrian.setRequest(true);
+			sCITrafficLight.yellow = true;
+
+			sCIPedestrian.request = true;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_off_r1_YellowOn;
@@ -1126,12 +1181,17 @@ public class TrafficLightWaitingStatemachine
 				stateVector[0] = State.$NullState$;
 				getTimerService().resetTimer(streetPrepare_time_event_0);
 
-				sCITrafficLight.setRed(false);
-				sCITrafficLight.setYellow(false);
-				sCITrafficLight.setGreen(true);
-				sCIPedestrian.setRed(true);
-				sCIPedestrian.setGreen(false);
-				sCIPedestrian.setRequest(false);
+				sCITrafficLight.red = false;
+
+				sCITrafficLight.yellow = false;
+
+				sCITrafficLight.green = true;
+
+				sCIPedestrian.red = true;
+
+				sCIPedestrian.green = false;
+
+				sCIPedestrian.request = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_on_r1_StreetGreen;
@@ -1164,12 +1224,17 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setYellow(false);
-			sCITrafficLight.setGreen(true);
-			sCIPedestrian.setRed(true);
-			sCIPedestrian.setGreen(false);
-			sCIPedestrian.setRequest(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCITrafficLight.green = true;
+
+			sCIPedestrian.red = true;
+
+			sCIPedestrian.green = false;
+
+			sCIPedestrian.request = false;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_on_r1_StreetGreen;
@@ -1181,8 +1246,9 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(yellowOff_time_event_0, 500,
 						cycleStartTime);
-				sCITrafficLight.setYellow(false);
-				sCIPedestrian.setRequest(false);
+				sCITrafficLight.yellow = false;
+
+				sCIPedestrian.request = false;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_off_r1_YellowOff;
@@ -1213,12 +1279,17 @@ public class TrafficLightWaitingStatemachine
 					break;
 			}
 
-			sCITrafficLight.setRed(false);
-			sCITrafficLight.setYellow(false);
-			sCITrafficLight.setGreen(true);
-			sCIPedestrian.setRed(true);
-			sCIPedestrian.setGreen(false);
-			sCIPedestrian.setRequest(false);
+			sCITrafficLight.red = false;
+
+			sCITrafficLight.yellow = false;
+
+			sCITrafficLight.green = true;
+
+			sCIPedestrian.red = true;
+
+			sCIPedestrian.green = false;
+
+			sCIPedestrian.request = false;
 
 			nextStateIndex = 0;
 			stateVector[0] = State.Main_region_on_r1_StreetGreen;
@@ -1230,8 +1301,9 @@ public class TrafficLightWaitingStatemachine
 
 				getTimerService().setTimer(yellowOn_time_event_0, 500,
 						cycleStartTime);
-				sCITrafficLight.setYellow(true);
-				sCIPedestrian.setRequest(true);
+				sCITrafficLight.yellow = true;
+
+				sCIPedestrian.request = true;
 
 				nextStateIndex = 0;
 				stateVector[0] = State.Main_region_off_r1_YellowOn;

+ 0 - 134
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingDemoBase.java

@@ -1,134 +0,0 @@
-package org.yakindu.sct.examples.java.trafficlight;
-
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.LightweightSystem;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class cares about setting up the UI of the pesestrian crossing and
- * delegates the state machine handling to the concrete subcasses.
- * 
- * @author terfloth
- */
-public abstract class CrossingDemoBase {
-
-	protected Shell shell;
-	protected Display display;
-	protected CrossingFigure crossing;
-	protected TrafficLightFigure trafficLightFigure;
-	protected PedestrianLightFigure pedestrianLightFigure;
-
-	public CrossingDemoBase() {
-		super();
-	}
-
-	protected abstract void setUpAndRunStatemachine();
-
-	protected abstract void tearDownStatemachine();
-
-	protected abstract void readStatemachineOutput();
-
-	protected abstract void pedestrianRequestButtonClicked();
-
-	protected abstract void onOffButtonClicked();
-
-	public void runTrafficLight() {
-
-		setUpAndRunStatemachine();
-		createUIContent();
-
-		shell.open();
-		while (!shell.isDisposed()) {
-			// update traffic lights
-			readStatemachineOutput();
-
-			crossing.repaint();
-
-			if (!display.readAndDispatch()) {
-				display.sleep();
-			}
-		}
-
-		tearDownStatemachine();
-	}
-
-	protected void createUIContent() {
-		display = Display.getDefault();
-		shell = new Shell(display);
-		shell.setSize(400, 400);
-		shell.setText("Traffic Light Demo");
-		GridLayout shellLayout = new GridLayout();
-		shellLayout.numColumns = 1;
-		shell.setLayout(shellLayout);
-
-		LightweightSystem lws = createLightweightsystem(shell);
-		createButtonComposite(shell);
-
-		crossing = new CrossingFigure();
-		lws.setContents(crossing);
-		trafficLightFigure = new TrafficLightFigure();
-		crossing.add(trafficLightFigure);
-		crossing.getLayoutManager().setConstraint(trafficLightFigure,
-				new Rectangle(275, 75, 35, 90));
-
-		pedestrianLightFigure = new PedestrianLightFigure();
-		crossing.add(pedestrianLightFigure);
-		crossing.getLayoutManager().setConstraint(pedestrianLightFigure,
-				new Rectangle(50, 10, 70, 20));
-	}
-
-	protected LightweightSystem createLightweightsystem(Shell shell) {
-
-		FigureCanvas canvas = new FigureCanvas(shell);
-		GridData canvasGridData = new GridData();
-		canvasGridData.horizontalAlignment = GridData.FILL;
-		canvasGridData.verticalAlignment = GridData.FILL;
-		canvasGridData.grabExcessVerticalSpace = true;
-		canvasGridData.grabExcessHorizontalSpace = true;
-		canvas.setLayoutData(canvasGridData);
-		LightweightSystem lws = new LightweightSystem(canvas);
-		return lws;
-	}
-
-	protected void createButtonComposite(Shell shell) {
-		// create a composite to hold the buttons
-		Composite buttonComposite = new Composite(shell, SWT.NO_SCROLL);
-		GridData buttonCompositeGridData = new GridData();
-		buttonCompositeGridData.horizontalAlignment = GridData.FILL;
-		buttonCompositeGridData.grabExcessHorizontalSpace = true;
-		buttonComposite.setLayoutData(buttonCompositeGridData);
-		FillLayout buttonCompositeLayout = new FillLayout();
-		buttonCompositeLayout.type = SWT.HORIZONTAL;
-		buttonComposite.setLayout(new FillLayout());
-
-		// create a button and event handlers
-
-		Button pedestrianRequest = new Button(buttonComposite, SWT.PUSH);
-		pedestrianRequest.setText("pedestrian request");
-		pedestrianRequest.addListener(SWT.Selection, new Listener() {
-			public void handleEvent(final org.eclipse.swt.widgets.Event event) {
-				pedestrianRequestButtonClicked();
-			}
-
-		});
-
-		Button onOff = new Button(buttonComposite, SWT.PUSH);
-		onOff.setText("on / off");
-		onOff.addListener(SWT.Selection, new Listener() {
-			public void handleEvent(final org.eclipse.swt.widgets.Event event) {
-				onOffButtonClicked();
-			}
-
-		});
-	}
-
-}

+ 0 - 95
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingDemoCycleBased.java

@@ -1,95 +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.examples.java.trafficlight;
-
-import org.yakindu.sct.examples.trafficlight.cyclebased.TimerService;
-import org.yakindu.sct.examples.trafficlight.cyclebased.trafficlightwaiting.TrafficLightWaitingStatemachine;
-
-/**
- * Example to show how to integrate the generated statemachine code into
- * existing projects.
- * 
- * @author a.nyssen - initial API and implementation
- * @author m.muehlbrandt - adaptions to new statemachine code.
- * @author terfloth - refactoring
- */
-
-public class CrossingDemoCycleBased extends CrossingDemoBase {
-
-	private TrafficLightWaitingStatemachine statemachine;
-
-	public static void main(String[] args) {
-
-		new CrossingDemoCycleBased().runTrafficLight();
-	}
-
-	@Override
-	protected void setUpAndRunStatemachine() {
-
-		statemachine = new TrafficLightWaitingStatemachine();
-
-		Thread thread = new Thread() {
-			@Override
-			public void run() {
-				// Initialize the statemachine. Define TimerHandler and
-				// enterSequence. A default TimerHandler generated by the Java
-				// Generator is used in this case. You can add your own
-				// implementation of a TimerHandler. It has to implement the
-				// ITimerHandler Interface.
-				statemachine.setTimerService(new TimerService());
-				statemachine.enter();
-				while (!isInterrupted()) {
-					statemachine.runCycle();
-					try {
-						Thread.sleep(100);
-					} catch (InterruptedException e) {
-						interrupt();
-					}
-				}
-			}
-		};
-		thread.start();
-	}
-
-	@Override
-	protected void tearDownStatemachine() {
-		// End TimerHandler and timing thread.
-		statemachine.getTimerService().cancel();
-	}
-
-	@Override
-	protected void readStatemachineOutput() {
-		trafficLightFigure.setRed(statemachine.getSCITrafficLight()
-				.getRed());
-		trafficLightFigure.setYellow(statemachine.getSCITrafficLight()
-				.getYellow());
-		trafficLightFigure.setGreen(statemachine.getSCITrafficLight()
-				.getGreen());
-
-		pedestrianLightFigure.setWhite(statemachine.getSCIPedestrian()
-				.getRequest());
-		pedestrianLightFigure.setRed(statemachine.getSCIPedestrian()
-				.getRed());
-		pedestrianLightFigure.setGreen(statemachine.getSCIPedestrian()
-				.getGreen());
-	}
-
-	@Override
-	protected void pedestrianRequestButtonClicked() {
-		statemachine.raisePedestrianRequest(); // raise event in statemachine
-	}
-
-	@Override
-	protected void onOffButtonClicked() {
-		statemachine.raiseOnOff(); // raise event in statemachine
-	}
-
-}

+ 0 - 67
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingDemoEventBased.java

@@ -1,67 +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.examples.java.trafficlight;
-
-/**
- * Example to show how to integrate the generated statemachine code into
- * existing projects. It uses the event based statemachine approach and the
- * generated RuntimeService to execute it.
- * 
- * @author a.nyssen - initial API and implementation
- * @author m.muehlbrandt - adaptions to new statemachine code.
- * @author terfloth - refactoring
- */
-
-// FIXME: commented out because templates for event based statemachine are currently under refactoring.
-public class CrossingDemoEventBased // extends CrossingDemoBase
-{
-
-	// public static void main(String[] args) {
-	//
-	// new CrossingDemoCycleBased().runTrafficLight();
-	// }
-	//
-	// @Override
-	// protected void setUpAndRunStatemachine() {
-	//
-	// statemachine = new TrafficLightWaitingEventBasedStatemachine();
-	//
-	// statemachine.setTimerService(new TimerService());
-	// statemachine.enter();
-	// }
-	//
-	// @Override
-	// protected void tearDownStatemachine() {
-	// // End TimerHandler and timing thread.
-	// statemachine.getTimerService().cancel();
-	// }
-	//
-	// @Override
-	// protected void readStatemachineOutput() {
-	// trafficLightFigure.setRed(statemachine.getInterfaceTrafficLight().getVarRed());
-	// trafficLightFigure.setYellow(statemachine.getInterfaceTrafficLight().getVarYellow());
-	// trafficLightFigure.setGreen(statemachine.getInterfaceTrafficLight().getVarGreen());
-	//
-	// pedestrianLightFigure.setWhite(statemachine.getInterfacePedestrian().getVarRequest());
-	// pedestrianLightFigure.setRed(statemachine.getInterfacePedestrian().getVarRed());
-	// pedestrianLightFigure.setGreen(statemachine.getInterfacePedestrian().getVarGreen());
-	// }
-	//
-	// @Override
-	// protected void pedestrianRequestButtonClicked() {
-	// statemachine.raisePedestrianRequest(); // raise event in statemachine
-	// }
-	//
-	// @Override
-	// protected void onOffButtonClicked() {
-	// statemachine.raiseOnOff(); // raise event in statemachine
-	// }
-}

+ 0 - 58
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingFigure.java

@@ -1,58 +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.examples.java.trafficlight;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.XYLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * Draw2d figure for the crossing. Used by CrossingDemo. 
- * 
- * @author a.nyssen
- *
- */
-public class CrossingFigure extends Figure {
-
-	public CrossingFigure() {
-		this.setLayoutManager(new XYLayout());
-
-	}
-
-	@Override
-	protected void paintFigure(Graphics graphics) {
-		Rectangle bounds = getBounds();
-
-		graphics
-				.setBackgroundColor(org.eclipse.draw2d.ColorConstants.lightGreen); // street
-																					// is
-																					// within
-																					// countryside
-																					// :-)
-		graphics.fillRectangle(bounds);
-
-		// paint street
-		graphics.setBackgroundColor(ColorConstants.lightGray);
-		graphics.fillRectangle(bounds.x + bounds.width / 3, bounds.y,
-				bounds.width / 3, bounds.height);
-
-		// paint crossing
-		graphics.setBackgroundColor(ColorConstants.white);
-		for (int i = 0; i <= 10; i += 2) {
-			graphics.fillRectangle(bounds.x + bounds.width / 3 + i
-					* bounds.width / 33, bounds.y + bounds.height / 11,
-					bounds.width / 30, bounds.height / 10);
-		}
-
-	}
-}

+ 0 - 78
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/PedestrianLightFigure.java

@@ -1,78 +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.examples.java.trafficlight;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * Draw2d figure for the pedestrian traffic light. Used by CrossingDemo. 
- * 
- * @author a.nyssen
- *
- */
-public class PedestrianLightFigure extends Figure {
-
-	boolean white = false;
-	boolean red = false;
-	boolean green = false;
-
-	public boolean isWhite() {
-		return white;
-	}
-
-	public void setWhite(boolean white) {
-		this.white = white;
-	}
-
-	public boolean isRed() {
-		return red;
-	}
-
-	public void setRed(boolean red) {
-		this.red = red;
-	}
-
-	public boolean isGreen() {
-		return green;
-	}
-
-	public void setGreen(boolean green) {
-		this.green = green;
-	}
-
-	@Override
-	protected void paintFigure(Graphics graphics) {
-		Rectangle bounds = getBounds().getShrinked(new Insets(4, 4, 4, 4));
-
-		graphics.setBackgroundColor(ColorConstants.darkGray);
-		graphics.fillRectangle(getBounds());
-
-		graphics.setBackgroundColor(white ? ColorConstants.white
-				: ColorConstants.black);
-		graphics.fillRectangle(bounds.x, bounds.y, bounds.width / 5,
-				bounds.width / 5);
-
-		graphics.setBackgroundColor(red ? ColorConstants.red
-				: ColorConstants.black);
-		graphics.fillOval(bounds.x + 2 * bounds.width / 5, bounds.y,
-				bounds.width / 5, bounds.width / 5);
-
-		graphics.setBackgroundColor(green ? ColorConstants.green
-				: ColorConstants.black);
-		graphics.fillOval(bounds.x + 4 * bounds.width / 5, bounds.y,
-				bounds.width / 5, bounds.width / 5);
-
-	}
-}

+ 0 - 77
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/TrafficLightFigure.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.examples.java.trafficlight;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * Draw2d figure for the traffic light. Used by CrossingDemo. 
- * 
- * @author a.nyssen
- *
- */
-public class TrafficLightFigure extends Figure {
-
-	private boolean red = false;
-	private boolean yellow = false;
-	private boolean green = false;
-
-	public boolean isRed() {
-		return red;
-	}
-
-	public void setRed(boolean red) {
-		this.red = red;
-	}
-
-	public boolean isYellow() {
-		return yellow;
-	}
-
-	public void setYellow(boolean yellow) {
-		this.yellow = yellow;
-	}
-
-	public boolean isGreen() {
-		return green;
-	}
-
-	public void setGreen(boolean green) {
-		this.green = green;
-	}
-
-	@Override
-	protected void paintFigure(Graphics graphics) {
-		Rectangle bounds = getBounds().getShrinked(new Insets(10, 10, 10, 10));
-
-		graphics.setBackgroundColor(ColorConstants.darkGray);
-		graphics.fillRectangle(getBounds());
-
-		graphics.setBackgroundColor(red ? ColorConstants.red
-				: ColorConstants.black);
-		graphics.fillOval(bounds.x, bounds.y, bounds.height / 5,
-				bounds.height / 5);
-
-		graphics.setBackgroundColor(yellow ? ColorConstants.yellow
-				: ColorConstants.black);
-		graphics.fillOval(bounds.x, bounds.y + 2 * bounds.height / 5,
-				bounds.height / 5, bounds.height / 5);
-
-		graphics.setBackgroundColor(green ? ColorConstants.green
-				: ColorConstants.black);
-		graphics.fillOval(bounds.x, bounds.y + 4 * bounds.height / 5,
-				bounds.height / 5, bounds.height / 5);
-	}
-}

+ 28 - 11
plugins/org.yakindu.sct.generator.java/library/FeatureTypeLibrary.xmi

@@ -1,15 +1,32 @@
 <?xml version="1.0" encoding="ASCII"?>
-<sgen:FeatureTypeLibrary xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen" xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore" name="Core">
-  <types name="Naming" optional="true">
-    <parameters name="basePackage"/>
-    <parameters name="implementationSuffix" optional="true"/>
+<sgen:FeatureTypeLibrary
+    xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen"
+    xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore"
+    name="Core">
+  <types name="Naming"
+      optional="true">
+    <parameters
+        name="basePackage"/>
+    <parameters
+        name="implementationSuffix"
+        optional="true"/>
   </types>
-  <types name="GeneralFeatures" optional="true">
-    <parameters name="EventBasedStatemachine" optional="true" parameterType="BOOLEAN"/>
-    <parameters name="InterfaceObserverSupport" optional="true" parameterType="BOOLEAN"/>
-    <parameters name="RuntimeService" optional="true" parameterType="BOOLEAN"/>
-    <parameters name="TimerService" optional="true" parameterType="BOOLEAN"/>
-    <parameters name="GenericInterfaceSupport" optional="true" parameterType="BOOLEAN"/>
-    <parameters name="StatemachineFactorySupport" optional="true" parameterType="BOOLEAN"/>
+  <types name="GeneralFeatures"
+      optional="true">
+    <parameters
+        name="InterfaceObserverSupport"
+        optional="true"
+        parameterType="BOOLEAN"/>
+    <parameters
+        name="RuntimeService"
+        optional="true"
+        parameterType="BOOLEAN"/>
+    <parameters
+        name="TimerService"
+        optional="true"
+        parameterType="BOOLEAN"/>
   </types>
 </sgen:FeatureTypeLibrary>