Selaa lähdekoodia

Merge branch 'master' into issue_239

.ui.examples to
org.yakindu.sct.examples - had already been renamed ...

Conflicts:
	examples/org.yakindu.sct.ui.examples/plugin.xml
Axel Terfloth 9 vuotta sitten
vanhempi
commit
f577884f9a

+ 37 - 2
plugins/org.yakindu.sct.doc.user/css/custom.css

@@ -114,9 +114,44 @@
 	z-index: 10;
 }
 
+body {
+	margin: 2%;
+}
+
 img {
-    max-width: 94%;
+    max-width: 60%;
     height: auto;
-    margin-left: 3%;
+    text-align: center;
     display: block;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+/* The class "scedit" is used in tables describing working with the statechart editor.
+   These tables typically consist of two columns with a textual description in the
+   left column and a screenshot on the right. */
+
+table.scedit {
+	width: auto;
+	border-collapse: collapse;
+}
+
+tr.scedit {
+	vertical-align: top;
+}
+
+table.scedit td {
+	border-color: #000;
+	border-radius: 0%;
+	border-style: solid;
+	border-width: 0px;
+	padding-bottom: 1ex;
+	vertical-align: top;
+}
+
+table.scedit img {
+	max-width: 100%;
+    margin-left: 0px;
+    margin-right: 0px;
+    box-shadow: 4px 4px 2px #bbb;
 }

BIN
plugins/org.yakindu.sct.doc.user/help/02_installation/images/macosx_install_010_applications.png


BIN
plugins/org.yakindu.sct.doc.user/help/02_installation/images/macosx_install_020_warning_internet.png


BIN
plugins/org.yakindu.sct.doc.user/help/02_installation/images/macosx_install_050_eclipse_splash.png


BIN
plugins/org.yakindu.sct.doc.user/help/02_installation/images/macosx_install_060_eclipse_workspace_dialog.png


BIN
plugins/org.yakindu.sct.doc.user/help/02_installation/images/macosx_install_070_eclipse_welcome.png


BIN
plugins/org.yakindu.sct.doc.user/help/02_installation/images/macosx_install_080_eclipse_workbench.png


+ 49 - 2
plugins/org.yakindu.sct.doc.user/help/02_installation/installation.textile

@@ -88,9 +88,56 @@ You can "proceed":../03_getting_started/getting_started.html now to create your
 
 h2(#InstallingOnMacOS). Installing on MacOS
 
-This chapter describes how to install YAKINDU Statechart Tools on a Mac under MacOS.
+This chapter describes how to install YAKINDU Statechart Tools on a Mac computer under MacOS.
 
-_*[To be done]*_
+h3. Unpacking the downloaded file
+
+When downloading the ZIP file containing the software distribution in a browser to your local disk, the _Archive Utility_ automatically unpacks it and then removes the ZIP file. Alternatively you can unpack the ZIP file manually by double-clicking it.
+
+Depending on the actual YAKINDU Statechart Tools software distribution file you downloaded, unpacking will provide you with one of the following application bundles:
+
+table. 
+| *YAKINDU SCT4C* | YAKINDU Statechart Tools for C and C++ development |
+| *YAKINDU SCT4Java* | YAKINDU Statechart Tools for Java development |
+| *YAKINDU SCT4* | YAKINDU Statechart Tools for C, C++, and Java development |
+
+Move the unpacked application bundle to your _Applications_ folder or to some other directory as you see fit. The screenshot below shows the _YAKINDU SCT4C_ application bundle having been moved to the _Applications_ folder.
+
+!images/macosx_install_010_applications.png(The YAKINDU Statecharts Tools application in the "Applications" directory)!
+
+There you are: You have installed YAKINDU Statechart Tools. Now you should start it.
+
+h3. Starting YAKINDU Statechart Tools
+
+Start YAKINDU Statechart Tools by running the executable you just copied to your _Applications_ folder, i. e. one of _YAKINDU SCT4C_, _YAKINDU SCT4Java_, or _YAKINDU SCT_.
+
+To do so, please double-click on the application symbol in the sample screenshot above.
+
+Upon the first start, MacOS will verify the application and show you the following warning, indicating that you downloaded the application from a potentially unsecure source:
+
+!images/macosx_install_020_warning_internet.png(MacOS warning)!
+
+Click _Open_ to continue starting the application. Subsequently starting YAKINDU Statechart Tools will not show this warning again.
+
+While YAKINDU Statechart Tools is starting up, it is showing a splash screen:
+
+!images/macosx_install_050_eclipse_splash.png(YAKINDU Statechart Tools starting up and showing a splash screen)!
+
+The software needs a _workspace_ directory where it stores its so-called projects along with other data. During the first startup, the _Workspace Launcher_ dialog asks you to specify the workspace directory in the _Workspace_ field. Please select a new and empty one.
+
+In the example below, we chose the _/Users/joedoe/workspace_ directory as our workspace. We also checked the _"Use this as the default and do not ask again"_ option. This is sensible, because on subsequent startups, YAKINDU Statechart Tools won't ask for a workspace directory again. Instead it will always use the one we chose once and forever. (You can still change the workspace later via _File → Switch Workspace_ in the main menu.)
+
+!images/macosx_install_060_eclipse_workspace_dialog.png(Selecting a workspace)!
+
+Click on the _OK_ button to proceed.
+
+On the first start, YAKINDU Statechart Tools presents a _Welcome_ window:
+
+!images/macosx_install_070_eclipse_welcome.png(YAKINDU Statechart Tools presenting the "Welcome" window)!
+
+You can browse the material shown here, if you want. When you are done, please close the _Welcome_ tab or click on _Workbench_ at the upper right. Both actions are leading to the workbench:
+
+!images/macosx_install_080_eclipse_workbench.png(The YAKINDU Statechart Tools workbench)!
 
 This is your working environment now. Congratulations, you have just installed YAKINDU Statechart Tools with Eclipse!
 

+ 40 - 60
plugins/org.yakindu.sct.doc.user/help/03_getting_started/getting_started.textile

@@ -150,14 +150,12 @@ As we have seen, the initial statechart is erroneous insofar as the state does n
 
 Remember the requirements of our light switch example? The first requirement demands the switch to be off initially. The erroneous state is reached from the initial state immediately, so it is appropriate to name it *Off*.
 
-table{width:100%}.
+table(scedit).
 | Double-click on the string @<name>@ in the state object. The string turns into a text input field with @<name>@ being highlighted: | !images/light_switch_230_statechart_editor_change_state_name_01.png(Changing a state's name [1])! |
 | Type the state's new name, i.&nbsp;e. @Off@: | !images/light_switch_230_statechart_editor_change_state_name_02.png(Changing a state's name [2])! |
 | Hit the @[Enter]@ key or click anywhere outside the text field. Bingo! The state now has a proper name and the error marker disappears: | !images/light_switch_230_statechart_editor_change_state_name_03.png(Changing a state's name [3])! |
-
-However, since the state box's size is smaller now than before while the box's left position remains unchanged, the graph looks crooked.
-
-table{width:100%}.
+| However, since the state box's size is smaller now than before while the box's left position remains unchanged, the graph looks crooked.
+|
 | We can improve it by dragging the state box a little bit to the right. When it is centered below the initial state symbol, a vertical blue line appears giving the user a visual hint: | !images/light_switch_230_statechart_editor_change_state_name_04.png(Changing a state's name [4])! |
 | Drop the state box at this very place, and everything looks much better now: | !images/light_switch_230_statechart_editor_change_state_name_05.png(Changing a state's name [5])! |
 | Alternatively, we could have used the state box's handles to resize it. However, we just deselect the box by clicking elsewhere: | !images/light_switch_230_statechart_editor_change_state_name_06.png(Changing a state's name [6])! |
@@ -166,55 +164,41 @@ table{width:100%}.
 
 h3. Creating a state
 
-With the *Off* state only the light switch statechart isn't complete yet. We also need an *On* state, and we going to create it now. In order to add another state, move the mouse pointer to the _Palette_ compartment at the right-hand side of the statechart editor. Click on the _State_ symbol in the palette without releasing the mouse button, and drag the symbol over to the editing area.
-
-!images/light_switch_240_statechart_editor_create_state_01.png(Creating a state [1])!
-
-Release the mouse button over a gray area, a region:
-
-!images/light_switch_240_statechart_editor_create_state_02.png(Creating a state [2])!
-
-The new state appears in the model graph:
-
-!images/light_switch_240_statechart_editor_create_state_03.png(Creating a state [3])!
-
-Rename the new state to *On*. Vertically align it to the *Off* state, if you like:
-
-!images/light_switch_240_statechart_editor_create_state_04.png(Creating a state [4])!
-
-You'll notice that the new state is showing an error marker. The reason is that it is not yet possible to reach the *On* state.
-
-Before we'll go on and fix that problem, here's another way to create a new state. When you are hovering with the mouse pointer over the main region, i.&nbsp;e. the rectangle with a gray background, a popup menu shows up. If you click on the 'S' symbol in that menu, a new state will be created. Other options in this menu are to create an initial state, a final state, or a choice.
-
-!images/light_switch_240_statechart_editor_create_state_05.png(Creating a state [5])!
+With the *Off* state only the light switch statechart isn't complete yet. We also need an *On* state, and we going to create it now.
+
+table(scedit).
+| In order to add another state, move the mouse pointer to the _Palette_ compartment at the right-hand side of the statechart editor. Click on the _State_ symbol in the palette without releasing the mouse button, and drag the symbol over to the editing area. | !images/light_switch_240_statechart_editor_create_state_01.png(Creating a state [1])!
+|
+| Release the mouse button over a gray area, a region: | !images/light_switch_240_statechart_editor_create_state_02.png(Creating a state [2])!
+|
+| The new state appears in the model graph: | !images/light_switch_240_statechart_editor_create_state_03.png(Creating a state [3])!
+|
+| Rename the new state to *On*. Vertically align it to the *Off* state, if you like: | !images/light_switch_240_statechart_editor_create_state_04.png(Creating a state [4])!
+|
+| You'll notice that the new state is showing an error marker. The reason is that it is not yet possible to reach the *On* state.
+|
+| Before we'll go on and fix that problem, here's another way to create a new state. When you are hovering with the mouse pointer over the main region, i.&nbsp;e. the rectangle with a gray background, a popup menu shows up. If you click on the 'S' symbol in that menu, a new state will be created. Other options in this menu are to create an initial state, a final state, or a choice. | !images/light_switch_240_statechart_editor_create_state_05.png(Creating a state [5])!
+|
 
 h3. Creating a transition
 
 As we have seen above, the *On* state is not reachable as of yet. So let's model switching the light switch from "off" to "on" as a transition leading from the *Off* state to the *On* state.
 
-In the _Palette_, click on the _Transition_ symbol. The symbol's background turn blue.
-
-!images/light_switch_250_statechart_editor_create_transition_01.png(Creating a transition [1])!
-
-Click on the *On* state, but don't release the mouse button. Drag the mouse pointer towards the *Off* state. A light gray line is shown as a preview of the transition to be established:
-
-!images/light_switch_250_statechart_editor_create_transition_02.png(Creating a transition [2])!
-
-Once the mouse pointer reaches the target state, it changes its shape:
-
-!images/light_switch_250_statechart_editor_create_transition_03.png(Creating a transition [3])!
-
-Releasing the mouse button establishes the transition. A text input field to specify event trigger, guard condition and effect appears. We want the transition to be triggered when the light switch is operated, so let's type @operate@ into the text field.
-
-!images/light_switch_250_statechart_editor_create_transition_04.png(Creating a transition [4])!
-
-If you suspect that something is not in order, because the input text is underlined in red, you are right. We will explain and deal with that in a minute.
-
-Clicking anywhere outside the text field terminates the editing mode:
-
-!images/light_switch_250_statechart_editor_create_transition_05.png(Creating a transition [5])!
-
-The event trigger _operate_ is flagged as an error. The reason is that an event with that name is not known yet. The screenshot below shows how to change that: 
+table(scedit).
+|In the _Palette_, click on the _Transition_ symbol. The symbol's background turn blue. | !images/light_switch_250_statechart_editor_create_transition_01.png(Creating a transition [1])!
+|
+| Click on the *On* state, but don't release the mouse button. Drag the mouse pointer towards the *Off* state. A light gray line is shown as a preview of the transition to be established: | !images/light_switch_250_statechart_editor_create_transition_02.png(Creating a transition [2])!
+|
+| Once the mouse pointer reaches the target state, it changes its shape: | !images/light_switch_250_statechart_editor_create_transition_03.png(Creating a transition [3])!
+|
+| Releasing the mouse button establishes the transition. A text input field to specify event trigger, guard condition and effect appears. We want the transition to be triggered when the light switch is operated, so let's type @operate@ into the text field. | !images/light_switch_250_statechart_editor_create_transition_04.png(Creating a transition [4])!
+|
+| If you suspect that something is not in order, because the input text is underlined in red, you are right. We will explain and deal with that in a minute.
+|
+| Clicking anywhere outside the text field terminates the editing mode: | !images/light_switch_250_statechart_editor_create_transition_05.png(Creating a transition [5])!
+|
+
+The event trigger _operate_ is flagged as an error. The reason is that an event with that name is not known yet. The screenshot below shows how to change that:
 
 !images/light_switch_260_statechart_editor_create_definitions_01.png(Creating definitions [1])!
 
@@ -232,17 +216,13 @@ Click anywhere outside of the text field, which terminates editing the definitio
 
 In its current state the model would not allow to turn the light switch off again, which is somewhat unsatisfactory. However, operating the light switch while it is on should turn it off. Let's model this by adding another transition. It should lead from the source state *On* to the target state *Off*.
 
-However, in order to not get two straight lines being close together in the graph, let's first make some room and turn the present line into an arc. Move the mouse pointer over the transition line, but not over the text. The mouse pointer changes its shape to indicate that you can insert a control point. Click and hold to add the control point, then drag it to an appropriate position.
-
-!images/light_switch_270_statechart_editor_create_transition_01.png(Creating another transition [1])!
-
-Now let's insert the second transition. This time we won't use the palette, but instead use another method. Hover the mouse pointer over the source state, i.&nbsp;e. *On*. An ingoing and an outgoing arrow appear, both with a handle.  Click and hold the handle of the outgoing arrow and drag it to the *Off* target state.
-
-!images/light_switch_270_statechart_editor_create_transition_02.png(Creating another transition [2])!
-
-Upon releasing the mouse button the transition is established. Type @operate@ as the transition's event trigger into the text field. Reshape the transition arrow to make the graph look nice.
-
-!images/light_switch_270_statechart_editor_create_transition_03.png(Creating another transition [3])!
+table(scedit).
+| However, in order to not get two straight lines being close together in the graph, let's first make some room and turn the present line into an arc. Move the mouse pointer over the transition line, but not over the text. The mouse pointer changes its shape to indicate that you can insert a control point. Click and hold to add the control point, then drag it to an appropriate position. | !images/light_switch_270_statechart_editor_create_transition_01.png(Creating another transition [1])!
+|
+| Now let's insert the second transition. This time we won't use the palette, but instead use another method. Hover the mouse pointer over the source state, i.&nbsp;e. *On*. An ingoing and an outgoing arrow appear, both with a handle.  Click and hold the handle of the outgoing arrow and drag it to the *Off* target state. | !images/light_switch_270_statechart_editor_create_transition_02.png(Creating another transition [2])!
+|
+| Upon releasing the mouse button the transition is established. Type @operate@ as the transition's event trigger into the text field. Reshape the transition arrow to make the graph look nice. | !images/light_switch_270_statechart_editor_create_transition_03.png(Creating another transition [3])!
+|
 
 
 

+ 7 - 6
plugins/org.yakindu.sct.simulation.core.sexec/src/org/yakindu/sct/simulation/core/sexec/interpreter/DefaultTimingService.java

@@ -50,7 +50,8 @@ public class DefaultTimingService implements ITimingService {
 		timerTasks = new HashMap<String, TimerTask>();
 	}
 
-	public void scheduleTimeEvent(ExecutionContext context, String eventName, boolean isPeriodical, long duration) {
+	public synchronized void scheduleTimeEvent(ExecutionContext context, String eventName, boolean isPeriodical,
+			long duration) {
 		TimeEventTask timeEventTask = new TimeEventTask(context, eventName);
 		timerTasks.put(eventName, timeEventTask);
 		if (isPeriodical) {
@@ -60,20 +61,20 @@ public class DefaultTimingService implements ITimingService {
 		}
 	}
 
-	public void unscheduleTimeEvent(String eventName) {
+	public synchronized void unscheduleTimeEvent(String eventName) {
 		TimerTask timerTask = timerTasks.get(eventName);
 		timerTask.cancel();
 	}
-
-	public void pause() {
+	
+	public synchronized void pause() {
 		throw new RuntimeException("Implement me");
 	}
 
-	public void resume() {
+	public synchronized void resume() {
 		throw new RuntimeException("Implement me");
 	}
 
-	public void stop() {
+	public synchronized void stop() {
 		Collection<TimerTask> values = timerTasks.values();
 		for (TimerTask timerTask : values) {
 			timerTask.cancel();

+ 0 - 1
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/model/presenter/DefaultDynamicNotationHandler.java

@@ -56,7 +56,6 @@ public class DefaultDynamicNotationHandler extends AbstractDynamicNotationHandle
 		if (this.currentContext != null)
 			this.currentContext.eAdapters().remove(visualizer);
 		visualizer.setHighlightingSupport(NULL_SUPPORT);
-		setHighlightingSupport(NULL_SUPPORT);
 	}
 
 	@Override

+ 12 - 10
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/model/presenter/SCTSourceDisplay.java

@@ -63,29 +63,31 @@ public class SCTSourceDisplay implements ISourceDisplay {
 
 	public void displaySource(IEditorPart editor) {
 		IDynamicNotationHandler notationHandler = handler.get(editor);
+		IHighlightingSupport support = (IHighlightingSupport) editor.getAdapter(IHighlightingSupport.class);
+		if (support == null)
+			return;
 		if (notationHandler == null) {
 			notationHandler = new DefaultDynamicNotationHandler();
-			IHighlightingSupport support = (IHighlightingSupport) editor.getAdapter(IHighlightingSupport.class);
-			if (support == null)
-				return;
-			notationHandler.setHighlightingSupport(support);
 			handler.put(editor, notationHandler);
+		} else {
+			notationHandler.setHighlightingSupport(new IHighlightingSupport.HighlightingSupportNullImpl());
 		}
-		if (notationHandler.getHighlightingSupport().isLocked()) {
-			notationHandler.getHighlightingSupport().releaseEditor();
+		if (support.isLocked()) {
+			support.releaseEditor();
 		}
-		notationHandler.getHighlightingSupport().lockEditor();
+		support.lockEditor();
+		notationHandler.setHighlightingSupport(support);
 		notationHandler.display(container.getExecutionContext());
 	}
 
-	public void terminate() {
+	public void terminate(boolean release) {
 		container = null;
 		debugElement = null;
 		Collection<IDynamicNotationHandler> values = handler.values();
 		for (IDynamicNotationHandler notationHandler : values) {
-			if (notationHandler.getHighlightingSupport().isLocked())
-				notationHandler.getHighlightingSupport().releaseEditor();
 			notationHandler.terminate();
+			if (release && notationHandler.getHighlightingSupport().isLocked())
+				notationHandler.getHighlightingSupport().releaseEditor();
 		}
 		handler.clear();
 	}

+ 3 - 2
plugins/org.yakindu.sct.simulation.ui/src/org/yakindu/sct/simulation/ui/model/presenter/SCTSourceDisplayDispatcher.java

@@ -52,7 +52,7 @@ public class SCTSourceDisplayDispatcher implements ISourceDisplay, IDebugEventSe
 			return;
 		if (newTarget != null && activeDebugTarget != newTarget){
 			if (activeSourceDisplay != null)
-				activeSourceDisplay.terminate();
+				activeSourceDisplay.terminate(false);
 			activeSourceDisplay = new SCTSourceDisplay(
 					(ISimulationEngine) newTarget.getAdapter(ISimulationEngine.class));
 		}
@@ -91,7 +91,8 @@ public class SCTSourceDisplayDispatcher implements ISourceDisplay, IDebugEventSe
 		if (source instanceof IDebugTarget) {
 			IDebugTarget target = (IDebugTarget) source;
 			if (target == activeDebugTarget) {
-				activeSourceDisplay.terminate();
+				activeSourceDisplay.terminate(true);
+				activeSourceDisplay = null;
 			}
 		}
 	}