diff options
Diffstat (limited to 'sources/simulator/VSSimulationCanvas.java')
| -rw-r--r-- | sources/simulator/VSSimulationCanvas.java | 25 |
1 files changed, 15 insertions, 10 deletions
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<VSProcess>(); 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(); + } } |
