diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-29 13:55:34 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-29 13:55:34 +0000 |
| commit | b8f2687296ad47626412e2a54f4916f7fabc4d6d (patch) | |
| tree | 247757bbb960ddceb5adefe89df2fd8115107bfc /sources/core/VSTask.java | |
| parent | cd2024527c84e3e0fd22072a16ac1ff18e6d406d (diff) | |
Only relevant message delivering works.
Diffstat (limited to 'sources/core/VSTask.java')
| -rw-r--r-- | sources/core/VSTask.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 0bc0d3f..1e3958d 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -45,6 +45,12 @@ public class VSTask implements Comparable { /** The simulation's default prefs. */ private VSPrefs prefs; + /** The message line, which gets drawn by the simulation canvas. this + * reference is needed here in order to remove the message line from + * the painting area if the message is not relevant + */ + private simulator.VSSimulatorCanvas.VSMessageLine messageLine; + /** The task is programmed. The task will be still in the task manager * after reset. */ @@ -189,12 +195,30 @@ public class VSTask implements Comparable { } /** + * Sets the message line. + * + * @messageLine the message line + */ + public void setMessageLine(simulator.VSSimulatorCanvas.VSMessageLine + messageLine) { + this.messageLine = messageLine; + } + + /** * Runs the task. */ public void run() { if (event.getProcess() == null) event.init(process); - event.onStart(); + + if (messageLine != null) { + System.out.println("FO"); + if (!event.onStart()) + process.getSimulatorCanvas().removeMessageLine(messageLine); + } else { + System.out.println("BA"); + event.onStart(); + } } /** |
