summaryrefslogtreecommitdiff
path: root/sources/simulator/VSSimulation.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-19 15:34:21 +0000
committerPaul Buetow <paul@buetow.org>2008-05-19 15:34:21 +0000
commit50b3f80a19db06b9b7d662e83f662b2358e059a9 (patch)
treeaec6c19992b1fba9f3fead028a0b77312ce3c859 /sources/simulator/VSSimulation.java
parent5eb35a6da1ba939878c0351f35b4019fd406ffdd (diff)
Canvas seems to work finally.
Diffstat (limited to 'sources/simulator/VSSimulation.java')
-rw-r--r--sources/simulator/VSSimulation.java25
1 files changed, 10 insertions, 15 deletions
diff --git a/sources/simulator/VSSimulation.java b/sources/simulator/VSSimulation.java
index c6ef5c1..1481c70 100644
--- a/sources/simulator/VSSimulation.java
+++ b/sources/simulator/VSSimulation.java
@@ -58,6 +58,7 @@ public class VSSimulation extends VSFrame implements ActionListener {
setVisible(true);
thread = new Thread(simulationPanel);
+ thread.start();
//logging.start();
logging.logg(prefs.getString("lang.simulation.new"));
@@ -69,7 +70,6 @@ public class VSSimulation extends VSFrame implements ActionListener {
localTextFields.add("0000");
globalTextFields.add("0000");
}
-
}
private JMenuBar createJMenuBar() {
@@ -193,7 +193,13 @@ public class VSSimulation extends VSFrame implements ActionListener {
logging.setSimulationPanel(simulationPanel);
simulationPanel.setBackground(prefs.getColor("paintarea.background"));
- JScrollPane paintScrollPane = new JScrollPane(simulationPanel);
+ JPanel canvasPanel = new JPanel();
+ canvasPanel.setLayout(new GridLayout(1, 1, 3, 3));
+ canvasPanel.add(simulationPanel);
+ canvasPanel.setMinimumSize(new Dimension(0, 0));
+ canvasPanel.setMaximumSize(new Dimension(0, 0));
+
+ //JScrollPane paintScrollPane = new JScrollPane(simulationPanel);
JScrollPane textScrollPane = new JScrollPane(loggingArea);
JPanel toolsPanel = createToolsPanel();
@@ -204,7 +210,7 @@ public class VSSimulation extends VSFrame implements ActionListener {
splitPaneH.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
splitPaneH.setLeftComponent(createProcessPane());
- splitPaneH.setRightComponent(paintScrollPane);
+ splitPaneH.setRightComponent(canvasPanel);
splitPaneH.setContinuousLayout(true);
splitPaneH.setOneTouchExpandable(true);
@@ -834,7 +840,7 @@ public class VSSimulation extends VSFrame implements ActionListener {
pauseItem.setEnabled(true);
resetItem.setEnabled(false);
replayItem.setEnabled(true);
- registeredProhread();
+ simulationPanel.play();
} else if (source.getText().equals(prefs.getString("lang.pause"))) {
startItem.setEnabled(true);
@@ -856,18 +862,7 @@ public class VSSimulation extends VSFrame implements ActionListener {
resetItem.setEnabled(false);
replayItem.setEnabled(true);
simulationPanel.reset();
- registeredProhread();
- }
- }
-
- private void registeredProhread() {
- if (hasStarted) {
simulationPanel.play();
-
- } else {
- hasStarted = true;
- thread = new Thread(simulationPanel);
- thread.start();
}
}