summaryrefslogtreecommitdiff
path: root/sources/simulator/VSSimulationCanvas.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-21 19:01:48 +0000
committerPaul Buetow <paul@buetow.org>2008-05-21 19:01:48 +0000
commitdb4ae1c41883f6f78d8107429f7f4871c45f47d5 (patch)
treed84d754176060afddc89b00d6cf7d4b97d3d049f /sources/simulator/VSSimulationCanvas.java
parent004458bb854fe4376fe35ec55d7f08853e08895b (diff)
Ok inline editor seems to work.
Diffstat (limited to 'sources/simulator/VSSimulationCanvas.java')
-rw-r--r--sources/simulator/VSSimulationCanvas.java25
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();
+ }
}