From db4ae1c41883f6f78d8107429f7f4871c45f47d5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 21 May 2008 19:01:48 +0000 Subject: Ok inline editor seems to work. --- sources/simulator/VSSimulationCanvas.java | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'sources/simulator/VSSimulationCanvas.java') diff --git a/sources/simulator/VSSimulationCanvas.java b/sources/simulator/VSSimulationCanvas.java index 3fb6add..bf3ec1c 100644 --- a/sources/simulator/VSSimulationCanvas.java +++ b/sources/simulator/VSSimulationCanvas.java @@ -162,16 +162,7 @@ public class VSSimulationCanvas extends Canvas implements Runnable, MouseMotionL this.processes = new LinkedList(); numProcesses = prefs.getInteger("sim.process.num"); - untilTime = prefs.getInteger("sim.seconds") * 1000; - recalcOnWindowChanged(); - - secondsSpaceing = (int) untilTime / 15000; - if (secondsSpaceing == 0) - secondsSpaceing = 1; - - threadSleep = (int) untilTime / 7500; - if (threadSleep == 0) - threadSleep = 1; + updateFromPrefs(); VSProcess.resetProcessCounter(); for (int i = 0; i < numProcesses; ++i) @@ -808,4 +799,18 @@ public class VSSimulationCanvas extends Canvas implements Runnable, MouseMotionL return arr; } + + public void updateFromPrefs() { + untilTime = prefs.getInteger("sim.seconds") * 1000; + + secondsSpaceing = (int) untilTime / 15000; + if (secondsSpaceing == 0) + secondsSpaceing = 1; + + threadSleep = (int) untilTime / 7500; + if (threadSleep == 0) + threadSleep = 1; + + recalcOnWindowChanged(); + } } -- cgit v1.2.3