diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-22 21:51:39 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-22 21:51:39 +0000 |
| commit | c7048c1fcccd0a599134b03fd326e064c56c6813 (patch) | |
| tree | 2ff2974c7cdfc6d0a08fbce9ad45bb9bcc0cb0d7 | |
| parent | 83ffbb7e36e0c6502c90a358eb8fbb1ab354db15 (diff) | |
Simulator frame closes now, if you press 'cancel'
| -rw-r--r-- | sources/prefs/editors/VSEditorFrame.java | 1 | ||||
| -rw-r--r-- | sources/prefs/editors/VSSimulationEditor.java | 4 | ||||
| -rw-r--r-- | sources/simulator/VSSimulatorFrame.java | 13 |
3 files changed, 15 insertions, 3 deletions
diff --git a/sources/prefs/editors/VSEditorFrame.java b/sources/prefs/editors/VSEditorFrame.java index db76313..5cdecf1 100644 --- a/sources/prefs/editors/VSEditorFrame.java +++ b/sources/prefs/editors/VSEditorFrame.java @@ -57,6 +57,7 @@ public class VSEditorFrame extends VSFrame implements ActionListener { dispose(); } else if (actionCommand.equals(prefs.getString("lang.cancel"))) { + editor.actionPerformed(e); dispose(); } else { diff --git a/sources/prefs/editors/VSSimulationEditor.java b/sources/prefs/editors/VSSimulationEditor.java index a45cfa5..ca43962 100644 --- a/sources/prefs/editors/VSSimulationEditor.java +++ b/sources/prefs/editors/VSSimulationEditor.java @@ -56,6 +56,10 @@ public class VSSimulationEditor extends VSBetterEditor { } simulation.updateFromPrefs(); + } else if (actionCommand.equals(prefs.getString("lang.cancel"))) { + if (!dontStartNewSimulation) + simulatorFrame.dispose(); + } else if (actionCommand.equals(prefs.getString("lang.ok"))) { savePrefs(); if (expertModeChanged()) { diff --git a/sources/simulator/VSSimulatorFrame.java b/sources/simulator/VSSimulatorFrame.java index 66af743..0a5ae6a 100644 --- a/sources/simulator/VSSimulatorFrame.java +++ b/sources/simulator/VSSimulatorFrame.java @@ -33,6 +33,7 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener { private Vector<VSSimulation> simulations; private VSSimulation currentSimulation; private JTabbedPane tabbedPane; + //private JSlider speedSlider; public VSSimulatorFrame(VSPrefs prefs, Component relativeTo) { super(prefs.getString("lang.name"), relativeTo); @@ -181,6 +182,12 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener { pane.add(toolBar, BorderLayout.PAGE_START); pane.add(tabbedPane, BorderLayout.CENTER); + /* + speedSlider = new JSlider(JSlider.HORIZONTAL, + 0, 200, (int) (100 * prefs.getFloat("sim.clock.speed"))); + toolBar.add(speedSlider); + */ + return pane; } @@ -191,9 +198,9 @@ public class VSSimulatorFrame extends VSFrame implements ActionListener { globalPrefsItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { VSPrefs simulationPrefs = currentSimulation.getPrefs(); - new VSEditorFrame(prefs, VSSimulatorFrame.this, - new VSSimulationEditor(simulationPrefs, VSSimulatorFrame.this, - currentSimulation)); + VSSimulationEditor simulationEditor = new VSSimulationEditor( + simulationPrefs, VSSimulatorFrame.this, currentSimulation); + new VSEditorFrame(prefs, VSSimulatorFrame.this, simulationEditor); } }); menuEdit.add(globalPrefsItem); |
