Procházet zdrojové kódy

Restructured examples

Andreas Muelder před 9 roky
rodič
revize
ae18dd2545
25 změnil soubory, kde provedl 1160 přidání a 9286 odebrání
  1. 5 5
      examples/org.yakindu.sct.examples.clock/.classpath
  2. 1 1
      examples/org.yakindu.sct.examples.clock/.gitignore
  3. 29 29
      examples/org.yakindu.sct.examples.clock/.project
  4. 3 3
      examples/org.yakindu.sct.examples.clock/.settings/org.eclipse.core.resources.prefs
  5. 2 2
      examples/org.yakindu.sct.examples.clock/.settings/org.eclipse.core.runtime.prefs
  6. 11 11
      examples/org.yakindu.sct.examples.clock/.settings/org.eclipse.jdt.core.prefs
  7. 0 11
      examples/org.yakindu.sct.examples.clock/model/clock.sgen
  8. 0 7796
      examples/org.yakindu.sct.examples.clock/src-gen/Clock.c
  9. 0 234
      examples/org.yakindu.sct.examples.clock/src-gen/Clock.h
  10. 0 58
      examples/org.yakindu.sct.examples.clock/src-gen/ClockRequired.h
  11. 0 27
      examples/org.yakindu.sct.examples.clock/src-gen/sc_types.h
  12. 8 8
      examples/org.yakindu.sct.examples.trafficlight/.classpath
  13. 1 1
      examples/org.yakindu.sct.examples.trafficlight/.gitignore
  14. 40 40
      examples/org.yakindu.sct.examples.trafficlight/.project
  15. 3 3
      examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.core.resources.prefs
  16. 2 2
      examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.core.runtime.prefs
  17. 12 12
      examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.jdt.core.prefs
  18. 21 21
      examples/org.yakindu.sct.examples.trafficlight/assembly.xml
  19. 31 31
      examples/org.yakindu.sct.examples.trafficlight/GenModelJava.sgen
  20. 562 562
      examples/org.yakindu.sct.examples.trafficlight/TrafficLightWaiting.sct
  21. 133 133
      examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingDemoBase.java
  22. 83 83
      examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingDemoCycleBased.java
  23. 58 58
      examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/CrossingFigure.java
  24. 78 78
      examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/PedestrianLightFigure.java
  25. 77 77
      examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/TrafficLightFigure.java

+ 5 - 5
examples/org.yakindu.sct.examples.clock/.classpath

@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 1 - 1
examples/org.yakindu.sct.examples.clock/.gitignore

@@ -1,2 +1,2 @@
-/bin/
+/bin/
 /target/

+ 29 - 29
examples/org.yakindu.sct.examples.clock/.project

@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.yakindu.sct.examples.clock</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.yakindu.sct.builder.SCTBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
-		<nature>org.yakindu.sct.builder.SCTNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.examples.clock</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.yakindu.sct.builder.SCTBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+		<nature>org.yakindu.sct.builder.SCTNature</nature>
+	</natures>
+</projectDescription>

+ 3 - 3
examples/org.yakindu.sct.examples.clock/.settings/org.eclipse.core.resources.prefs

@@ -1,3 +1,3 @@
-eclipse.preferences.version=1
-encoding//model/clock.sct=UTF-8
-encoding/<project>=UTF-8
+eclipse.preferences.version=1
+encoding//model/clock.sct=UTF-8
+encoding/<project>=UTF-8

+ 2 - 2
examples/org.yakindu.sct.examples.clock/.settings/org.eclipse.core.runtime.prefs

@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n

+ 11 - 11
examples/org.yakindu.sct.examples.clock/.settings/org.eclipse.jdt.core.prefs

@@ -1,11 +1,11 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6

+ 0 - 11
examples/org.yakindu.sct.examples.clock/model/clock.sgen

@@ -1,11 +0,0 @@
-GeneratorModel for yakindu::c {
-	
-	statechart clock
-	{
-		feature Outlet {
-			targetProject =  "org.yakindu.sct.examples.clock" 
-			targetFolder =  "src-gen" 
-		}  
-		
-	}
-}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 7796
examples/org.yakindu.sct.examples.clock/src-gen/Clock.c


+ 0 - 234
examples/org.yakindu.sct.examples.clock/src-gen/Clock.h

@@ -1,234 +0,0 @@
-#ifndef CLOCK_H_
-#define CLOCK_H_
-
-#include "sc_types.h"
-
-#ifdef __cplusplus
-extern "C" { 
-#endif 
-
-/*! \file Header of the state machine 'clock'.
-*/
-
-//! enumeration of all states 
-typedef enum {
-	clock_main_displays ,
-	clock_main_displays__region0_regular_beep_test ,
-	clock_main_displays__region0_regular_beep_test_regular_update ,
-	clock_main_displays__region0_regular_beep_test_regular_update__region0_sec ,
-	clock_main_displays__region0_regular_beep_test_regular_update__region0_min ,
-	clock_main_displays__region0_regular_beep_test_regular_update__region0_hr ,
-	clock_main_displays__region0_regular_beep_test_regular_update__region0_mode ,
-	clock_main_displays__region0_regular_beep_test_regular_time ,
-	clock_main_displays__region0_regular_beep_test_regular_date ,
-	clock_main_displays__region0_regular_beep_test_beep_test_off ,
-	clock_main_displays__region0_regular_beep_test_beep_test_beep ,
-	clock_main_displays__region0_wait ,
-	clock_main_alarms_beep ,
-	clock_main_alarms_beep_r1_alarm_1_beeps ,
-	clock_main_alarms_beep_r1_alarm_2_beeps ,
-	clock_main_alarms_beep_r1_both_beep ,
-	clock_main_stopwatch ,
-	clock_main_stopwatch_r1_zero ,
-	clock_main_stopwatch_r1_display_run ,
-	clock_main_stopwatch_r1_display_run_display_regular ,
-	clock_main_stopwatch_r1_display_run_display_lap ,
-	clock_main_stopwatch_r1_display_run_run_on ,
-	clock_main_stopwatch_r1_display_run_run_off ,
-	clock_main_settings ,
-	clock_main_settings_r1_alarm_1 ,
-	clock_main_settings_r1_alarm_1_r1_off ,
-	clock_main_settings_r1_alarm_1_r1_on ,
-	clock_main_settings_r1_update_1 ,
-	clock_main_settings_r1_update_1_r1_hr ,
-	clock_main_settings_r1_update_1_r1_min ,
-	clock_main_settings_r1_update_2 ,
-	clock_main_settings_r1_update_2_r1_hr ,
-	clock_main_settings_r1_update_2_r1_min ,
-	clock_main_settings_r1_alarm_2 ,
-	clock_main_settings_r1_alarm_2_r1_off ,
-	clock_main_settings_r1_alarm_2_r1_on ,
-	clock_main_settings_r1_chime ,
-	clock_main_settings_r1_chime_r1_off ,
-	clock_main_settings_r1_chime_r1_on ,
-	clock_alarm_1_disabled ,
-	clock_alarm_1_enabled ,
-	clock_alarm_2_disabled ,
-	clock_alarm_2_enabled ,
-	clock_chime___status_disabled ,
-	clock_chime___status_enabled ,
-	clock_chime___status_enabled_r1_quiet ,
-	clock_chime___status_enabled_r1_beep ,
-	clock_light_off ,
-	clock_light_on ,
-	clock_power_ok ,
-	clock_power_blink ,
-	Clock_last_state
-} ClockStates;
-
-//! Type definition of the data structure for the ClockIface interface scope.
-typedef struct {
-	sc_boolean a_p_raised;
-	sc_boolean b_p_raised;
-	sc_boolean b_r_raised;
-	sc_boolean c_p_raised;
-	sc_boolean c_r_raised;
-	sc_boolean d_p_raised;
-	sc_boolean d_r_raised;
-} ClockIface;
-
-//! Type definition of the data structure for the ClockIfaceClock interface scope.
-typedef struct {
-	sc_integer  second;
-	sc_integer  minute;
-	sc_integer  hour;
-	sc_integer  time;
-	sc_integer  al1_time;
-	sc_integer  al2_time;
-} ClockIfaceClock;
-
-//! Type definition of the data structure for the ClockIfaceStopwatch interface scope.
-typedef struct {
-	sc_integer  time;
-	sc_integer  lap;
-} ClockIfaceStopwatch;
-
-//! Type definition of the data structure for the ClockIfaceBattery interface scope.
-typedef struct {
-	sc_boolean low_raised;
-	sc_boolean replace_raised;
-	sc_integer  max_energy;
-	sc_real  min_energy;
-	sc_integer  energy;
-} ClockIfaceBattery;
-
-//! Type definition of the data structure for the ClockInternal interface scope.
-typedef struct {
-	sc_integer  delta;
-} ClockInternal;
-
-//! Type definition of the data structure for the ClockTimeEvents interface scope.
-typedef struct {
-	sc_boolean clock_main_displays__region0_regular_beep_test_regular_update_time_event_0_raised;
-	sc_boolean clock_main_displays__region0_regular_beep_test_regular_date_time_event_0_raised;
-	sc_boolean clock_main_displays__region0_wait_time_event_0_raised;
-	sc_boolean clock_main_alarms_beep_time_event_0_raised;
-	sc_boolean clock_main_stopwatch_r1_display_run_run_on_time_event_0_raised;
-	sc_boolean clock_chime___status_enabled_r1_beep_time_event_0_raised;
-	sc_boolean clock_time_event_0_raised;
-} ClockTimeEvents;
-
-
-//! the maximum number of orthogonal states defines the dimension of the state configuration vector.
-#define CLOCK_MAX_ORTHOGONAL_STATES 7
-//! dimension of the state configuration vector for history states
-#define CLOCK_MAX_HISTORY_STATES 10
-
-/*! Type definition of the data structure for the Clock state machine.
-This data structure has to be allocated by the client code. */
-typedef struct {
-	ClockStates stateConfVector[CLOCK_MAX_ORTHOGONAL_STATES];
-	ClockStates historyVector[CLOCK_MAX_HISTORY_STATES];
-	sc_ushort stateConfVectorPosition; 
-	
-	ClockIface iface;
-	ClockIfaceClock ifaceClock;
-	ClockIfaceStopwatch ifaceStopwatch;
-	ClockIfaceBattery ifaceBattery;
-	ClockInternal internal;
-	ClockTimeEvents timeEvents;
-} Clock;
-
-/*! Initializes the Clock state machine data structures. Must be called before first usage.*/
-extern void clock_init(Clock* handle);
-
-/*! Activates the state machine */
-extern void clock_enter(Clock* handle);
-
-/*! Deactivates the state machine */
-extern void clock_exit(Clock* handle);
-
-/*! Performs a 'run to completion' step. */
-extern void clock_runCycle(Clock* handle);
-
-/*! Raises a time event. */
-extern void clock_raiseTimeEvent(Clock* handle, sc_eventid evid);
-
-/*! Raises the in event 'a_p' that is defined in the default interface scope. */ 
-extern void clockIface_raise_a_p(Clock* handle);
-
-/*! Raises the in event 'b_p' that is defined in the default interface scope. */ 
-extern void clockIface_raise_b_p(Clock* handle);
-
-/*! Raises the in event 'b_r' that is defined in the default interface scope. */ 
-extern void clockIface_raise_b_r(Clock* handle);
-
-/*! Raises the in event 'c_p' that is defined in the default interface scope. */ 
-extern void clockIface_raise_c_p(Clock* handle);
-
-/*! Raises the in event 'c_r' that is defined in the default interface scope. */ 
-extern void clockIface_raise_c_r(Clock* handle);
-
-/*! Raises the in event 'd_p' that is defined in the default interface scope. */ 
-extern void clockIface_raise_d_p(Clock* handle);
-
-/*! Raises the in event 'd_r' that is defined in the default interface scope. */ 
-extern void clockIface_raise_d_r(Clock* handle);
-
-
-/*! Gets the value of the variable 'second' that is defined in the interface scope 'clock'. */ 
-extern sc_integer clockIfaceClock_get_second(Clock* handle);
-/*! Gets the value of the variable 'minute' that is defined in the interface scope 'clock'. */ 
-extern sc_integer clockIfaceClock_get_minute(Clock* handle);
-/*! Sets the value of the variable 'minute' that is defined in the interface scope 'clock'. */ 
-extern void clockIfaceClock_set_minute(Clock* handle, sc_integer value);
-/*! Gets the value of the variable 'hour' that is defined in the interface scope 'clock'. */ 
-extern sc_integer clockIfaceClock_get_hour(Clock* handle);
-/*! Sets the value of the variable 'hour' that is defined in the interface scope 'clock'. */ 
-extern void clockIfaceClock_set_hour(Clock* handle, sc_integer value);
-/*! Gets the value of the variable 'time' that is defined in the interface scope 'clock'. */ 
-extern sc_integer clockIfaceClock_get_time(Clock* handle);
-/*! Sets the value of the variable 'time' that is defined in the interface scope 'clock'. */ 
-extern void clockIfaceClock_set_time(Clock* handle, sc_integer value);
-/*! Gets the value of the variable 'al1_time' that is defined in the interface scope 'clock'. */ 
-extern sc_integer clockIfaceClock_get_al1_time(Clock* handle);
-/*! Sets the value of the variable 'al1_time' that is defined in the interface scope 'clock'. */ 
-extern void clockIfaceClock_set_al1_time(Clock* handle, sc_integer value);
-/*! Gets the value of the variable 'al2_time' that is defined in the interface scope 'clock'. */ 
-extern sc_integer clockIfaceClock_get_al2_time(Clock* handle);
-/*! Sets the value of the variable 'al2_time' that is defined in the interface scope 'clock'. */ 
-extern void clockIfaceClock_set_al2_time(Clock* handle, sc_integer value);
-
-/*! Gets the value of the variable 'time' that is defined in the interface scope 'stopwatch'. */ 
-extern sc_integer clockIfaceStopwatch_get_time(Clock* handle);
-/*! Sets the value of the variable 'time' that is defined in the interface scope 'stopwatch'. */ 
-extern void clockIfaceStopwatch_set_time(Clock* handle, sc_integer value);
-/*! Gets the value of the variable 'lap' that is defined in the interface scope 'stopwatch'. */ 
-extern sc_integer clockIfaceStopwatch_get_lap(Clock* handle);
-/*! Sets the value of the variable 'lap' that is defined in the interface scope 'stopwatch'. */ 
-extern void clockIfaceStopwatch_set_lap(Clock* handle, sc_integer value);
-
-/*! Raises the in event 'low' that is defined in the interface scope 'battery'. */ 
-extern void clockIfaceBattery_raise_low(Clock* handle);
-
-/*! Raises the in event 'replace' that is defined in the interface scope 'battery'. */ 
-extern void clockIfaceBattery_raise_replace(Clock* handle);
-
-/*! Gets the value of the variable 'max_energy' that is defined in the interface scope 'battery'. */ 
-extern sc_integer clockIfaceBattery_get_max_energy(Clock* handle);
-/*! Gets the value of the variable 'min_energy' that is defined in the interface scope 'battery'. */ 
-extern sc_real clockIfaceBattery_get_min_energy(Clock* handle);
-/*! Gets the value of the variable 'energy' that is defined in the interface scope 'battery'. */ 
-extern sc_integer clockIfaceBattery_get_energy(Clock* handle);
-/*! Sets the value of the variable 'energy' that is defined in the interface scope 'battery'. */ 
-extern void clockIfaceBattery_set_energy(Clock* handle, sc_integer value);
-
-
-/*! Checks if the specified state is active. */
-extern sc_boolean clock_isActive(Clock* handle, ClockStates state);
-
-#ifdef __cplusplus
-}
-#endif 
-
-#endif /* CLOCK_H_ */

+ 0 - 58
examples/org.yakindu.sct.examples.clock/src-gen/ClockRequired.h

@@ -1,58 +0,0 @@
-#ifndef CLOCKREQUIRED_H_
-#define CLOCKREQUIRED_H_
-
-#include "sc_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif 
-
-
-
-/*! \file This header defines prototypes for all functions that are required by the state machine implementation.
-
-This is a state machine uses time events which require access to a timing service. Thus the function prototypes:
-	- clock_setTimer and
-	- clock_unsetTimer
-are defined.
-
-		
-These functions will be called during a 'run to completion step' (runCycle) of the statechart. 
-There are some constraints that have to be considered for the implementation of these functions:
-	- never call the statechart API functions from within these functions.
-	- make sure that the execution time is as short as possible.
- 
-*/
-
-
-
-
-
-
-
-
-//
-// This is a timed state machine that requires timer services
-// 
-
-//! This function has to set up timers for the time events that are required by the state machine.
-/*! 
-	This function will be called for each time event that is relevant for a state when a state will be entered.
-	\param evid An unique identifier of the event.
-	\time_ms The time in milli seconds
-	\periodic Indicates the the time event must be raised periodically until the timer is unset 
-*/
-extern void clock_setTimer(const sc_eventid evid, const sc_integer time_ms, const sc_boolean periodic);
-
-//! This function has to unset timers for the time events that are required by the state machine.
-/*! 
-	This function will be called for each time event taht is relevant for a state when a state will be left.
-	\param evid An unique identifier of the event.
-*/
-extern void clock_unsetTimer(const sc_eventid evid);
-
-#ifdef __cplusplus
-}
-#endif 
-
-#endif /* CLOCKREQUIRED_H_ */

+ 0 - 27
examples/org.yakindu.sct.examples.clock/src-gen/sc_types.h

@@ -1,27 +0,0 @@
-#ifndef SC_TYPES_H_
-#define SC_TYPES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif 
-
-#include <stdint.h>
-#include <stdbool.h>
- 				
-typedef int_fast16_t  sc_short;
-typedef uint_fast16_t sc_ushort;
-typedef int32_t       sc_integer; 
-typedef uint32_t      sc_uinteger; 
-typedef double        sc_real;
-typedef char*         sc_string;
-
-typedef void*         sc_eventid;
-
-#ifdef __cplusplus
-}
-#endif 
-#define sc_boolean bool
-#define bool_true true
-#define bool_false false
-
-#endif /* SC_TYPES_H_ */

+ 8 - 8
examples/org.yakindu.sct.examples.trafficlight/.classpath

@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-gen"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="src-gen"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 1 - 1
examples/org.yakindu.sct.examples.trafficlight/.gitignore

@@ -1,2 +1,2 @@
-/bin/
+/bin/
 /target/

+ 40 - 40
examples/org.yakindu.sct.examples.trafficlight/.project

@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.yakindu.sct.examples.trafficlight</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.yakindu.sct.builder.SCTBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.yakindu.sct.builder.SCTNature</nature>
-		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.yakindu.sct.examples.trafficlight</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.yakindu.sct.builder.SCTBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.yakindu.sct.builder.SCTNature</nature>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+	</natures>
+</projectDescription>

+ 3 - 3
examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.core.resources.prefs

@@ -1,3 +1,3 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
-encoding/TrafficLightWaiting.sct=UTF-8
+eclipse.preferences.version=1
+encoding//model/TrafficLightWaiting.sct=UTF-8
+encoding/<project>=UTF-8

+ 2 - 2
examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.core.runtime.prefs

@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-line.separator=\n
+eclipse.preferences.version=1
+line.separator=\n

+ 12 - 12
examples/org.yakindu.sct.examples.trafficlight/.settings/org.eclipse.jdt.core.prefs

@@ -1,12 +1,12 @@
-#Wed Nov 23 12:16:41 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+#Wed Nov 23 12:16:41 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

+ 21 - 21
examples/org.yakindu.sct.examples.trafficlight/assembly.xml

@@ -1,22 +1,22 @@
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-  <id>content</id>
-  <formats>
-    <format>zip</format>
-  </formats>
-  <includeBaseDirectory>false</includeBaseDirectory>
-  <fileSets>
-    <fileSet>
-      <directory>${basedir}</directory>
-      <excludes>
-        <exclude>pom.xml</exclude>
-        <exclude>assembly.xml</exclude>
-        <exclude>target/**</exclude>
-        <exclude>bin/**</exclude>
-        <exclude>**/.svn/**</exclude>
-        <exclude>target</exclude>
-      </excludes>
-    </fileSet>
-  </fileSets>
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+  <id>content</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>${basedir}</directory>
+      <excludes>
+        <exclude>pom.xml</exclude>
+        <exclude>assembly.xml</exclude>
+        <exclude>target/**</exclude>
+        <exclude>bin/**</exclude>
+        <exclude>**/.svn/**</exclude>
+        <exclude>target</exclude>
+      </excludes>
+    </fileSet>
+  </fileSets>
 </assembly>

+ 31 - 31
examples/org.yakindu.sct.examples.trafficlight/GenModelJava.sgen

@@ -1,32 +1,32 @@
-GeneratorModel for yakindu::java {
-
-	statechart TrafficLightWaiting {
-	 	
-		feature Outlet {
-			targetProject = "org.yakindu.sct.examples.trafficlight"
-			targetFolder = "src-gen"
-		}
-
-		feature Naming {
-			basePackage = "org.yakindu.sct.examples.trafficlight.cyclebased"
-		}
-
-		feature GeneralFeatures {
-			RuntimeService = true
-			TimerService = true
-		}
-		
-		feature LicenseHeader {
-			licenseText = "
-Copyright (c) 2012 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
-�"
-		}
-	}
+GeneratorModel for yakindu::java {
+
+	statechart TrafficLightWaiting {
+	 	
+		feature Outlet {
+			targetProject = "org.yakindu.sct.examples.trafficlight"
+			targetFolder = "src-gen"
+		}
+
+		feature Naming {
+			basePackage = "org.yakindu.sct.examples.trafficlight.cyclebased"
+		}
+
+		feature GeneralFeatures {
+			RuntimeService = true
+			TimerService = true
+		}
+		
+		feature LicenseHeader {
+			licenseText = "
+Copyright (c) 2012 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
+�"
+		}
+	}
 }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 562 - 562
examples/org.yakindu.sct.examples.trafficlight/TrafficLightWaiting.sct


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

@@ -1,134 +1,134 @@
-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();
-			}
-
-		});
-	}
-
+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();
+			}
+
+		});
+	}
+
 }

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

@@ -1,83 +1,83 @@
-/**
- * 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.RuntimeService;
-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;
-	
-	private TimerService timer;
-
-	public static void main(String[] args) {
-
-		new CrossingDemoCycleBased().runTrafficLight();
-	}
-
-	@Override
-	protected void setUpAndRunStatemachine() {
-
-		statemachine = new TrafficLightWaitingStatemachine();
-		timer = new TimerService();
-		statemachine.setTimer(timer);
-		statemachine.init();
-		statemachine.enter();
-		
-		RuntimeService.getInstance().registerStatemachine(statemachine, 100);
-	}
-
-	@Override
-	protected void tearDownStatemachine() {
-		// End TimerHandler and RuntimeService.
-		timer.cancel();
-		RuntimeService.getInstance().cancelTimer();
-	}
-
-	@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
-	}
-
-}
+/**
+ * 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.RuntimeService;
+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;
+	
+	private TimerService timer;
+
+	public static void main(String[] args) {
+
+		new CrossingDemoCycleBased().runTrafficLight();
+	}
+
+	@Override
+	protected void setUpAndRunStatemachine() {
+
+		statemachine = new TrafficLightWaitingStatemachine();
+		timer = new TimerService();
+		statemachine.setTimer(timer);
+		statemachine.init();
+		statemachine.enter();
+		
+		RuntimeService.getInstance().registerStatemachine(statemachine, 100);
+	}
+
+	@Override
+	protected void tearDownStatemachine() {
+		// End TimerHandler and RuntimeService.
+		timer.cancel();
+		RuntimeService.getInstance().cancelTimer();
+	}
+
+	@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
+	}
+
+}

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

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

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

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

+ 77 - 77
examples/org.yakindu.sct.examples.trafficlight/src/org/yakindu/sct/examples/java/trafficlight/TrafficLightFigure.java

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