From b8f2687296ad47626412e2a54f4916f7fabc4d6d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 29 May 2008 13:55:34 +0000 Subject: Only relevant message delivering works. --- sources/core/VSTask.java | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'sources/core/VSTask.java') 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. */ @@ -188,13 +194,31 @@ public class VSTask implements Comparable { return process; } + /** + * 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(); + } } /** -- cgit v1.2.3