From 222d028fac58233a451e2de875353252a3dc9f63 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 24 May 2008 21:06:15 +0000 Subject: PRocesses now get removed properly. Removed all VSSimulation* classes. --- sources/prefs/VSDefaultPrefs.java | 1 + sources/prefs/editors/VSSimulationEditor.java | 77 --------------------------- sources/prefs/editors/VSSimulatorEditor.java | 77 +++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 77 deletions(-) delete mode 100644 sources/prefs/editors/VSSimulationEditor.java create mode 100644 sources/prefs/editors/VSSimulatorEditor.java (limited to 'sources/prefs') diff --git a/sources/prefs/VSDefaultPrefs.java b/sources/prefs/VSDefaultPrefs.java index 25e3ef9..3446184 100644 --- a/sources/prefs/VSDefaultPrefs.java +++ b/sources/prefs/VSDefaultPrefs.java @@ -88,6 +88,7 @@ public class VSDefaultPrefs extends VSPrefs { initString("lang.prefs.protocols", "Protokolleinstellungen"); initString("lang.prefs.simulation", "Simulationseinstellungen"); initString("lang.process", "Prozess"); + initString("lang.process.add.new", "Neuen Prozess hinzufügen"); initString("lang.process.crash", "Prozess abstürzen"); initString("lang.process.remove", "Prozess entfernen"); initString("lang.process.edit", "Prozess editieren"); diff --git a/sources/prefs/editors/VSSimulationEditor.java b/sources/prefs/editors/VSSimulationEditor.java deleted file mode 100644 index 4637ec9..0000000 --- a/sources/prefs/editors/VSSimulationEditor.java +++ /dev/null @@ -1,77 +0,0 @@ -package prefs.editors; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.filechooser.*; -import java.util.*; -import java.io.File; - -import simulator.*; -import utils.*; -import prefs.*; - -public class VSSimulationEditor extends VSBetterEditor { - private VSSimulatorFrame simulatorFrame; - private VSSimulation simulation; - public static boolean TAKEOVER_BUTTON; - private boolean dontStartNewSimulation; - - public VSSimulationEditor(VSPrefs prefs, VSSimulatorFrame simulatorFrame, VSSimulation simulation) { - super(prefs, prefs, prefs.getString("lang.name") - + " - " + prefs.getString("lang.prefs")); - this.dontStartNewSimulation = true;//simulation != null; - this.simulatorFrame = simulatorFrame; - this.simulation = simulation; - } - - public VSSimulationEditor(VSPrefs prefs, VSSimulatorFrame simulatorFrame) { - super(prefs, prefs, prefs.getString("lang.name") - + " - " + prefs.getString("lang.prefs")); - this.simulatorFrame = simulatorFrame; - } - - protected void addToButtonPanelFront(JPanel buttonPanel) { - if (TAKEOVER_BUTTON) { - TAKEOVER_BUTTON = false; - JButton takeoverButton = new JButton( - prefs.getString("lang.takeover")); - takeoverButton.setMnemonic(prefs.getInteger("keyevent.takeover")); - takeoverButton.addActionListener(this); - buttonPanel.add(takeoverButton); - } - } - - public void actionPerformed(ActionEvent e) { - String actionCommand = e.getActionCommand(); - - if (actionCommand.equals(prefs.getString("lang.takeover"))) { - savePrefs(); - - if (simulation != null) { - if (expertModeChanged()) - simulation.fireExpertModeChanged(); - 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()) { - if (simulation != null) - simulation.fireExpertModeChanged(); - } - if (!dontStartNewSimulation) - simulatorFrame.addSimulation(new VSSimulation(prefsToEdit, simulatorFrame)); - else if (simulation != null) - simulation.updateFromPrefs(); - - } else { - super.actionPerformed(e); - } - } -} diff --git a/sources/prefs/editors/VSSimulatorEditor.java b/sources/prefs/editors/VSSimulatorEditor.java new file mode 100644 index 0000000..0ea2332 --- /dev/null +++ b/sources/prefs/editors/VSSimulatorEditor.java @@ -0,0 +1,77 @@ +package prefs.editors; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.filechooser.*; +import java.util.*; +import java.io.File; + +import simulator.*; +import utils.*; +import prefs.*; + +public class VSSimulatorEditor extends VSBetterEditor { + private VSSimulatorFrame simulatorFrame; + private VSSimulator simulation; + public static boolean TAKEOVER_BUTTON; + private boolean dontStartNewSimulation; + + public VSSimulatorEditor(VSPrefs prefs, VSSimulatorFrame simulatorFrame, VSSimulator simulation) { + super(prefs, prefs, prefs.getString("lang.name") + + " - " + prefs.getString("lang.prefs")); + this.dontStartNewSimulation = true;//simulation != null; + this.simulatorFrame = simulatorFrame; + this.simulation = simulation; + } + + public VSSimulatorEditor(VSPrefs prefs, VSSimulatorFrame simulatorFrame) { + super(prefs, prefs, prefs.getString("lang.name") + + " - " + prefs.getString("lang.prefs")); + this.simulatorFrame = simulatorFrame; + } + + protected void addToButtonPanelFront(JPanel buttonPanel) { + if (TAKEOVER_BUTTON) { + TAKEOVER_BUTTON = false; + JButton takeoverButton = new JButton( + prefs.getString("lang.takeover")); + takeoverButton.setMnemonic(prefs.getInteger("keyevent.takeover")); + takeoverButton.addActionListener(this); + buttonPanel.add(takeoverButton); + } + } + + public void actionPerformed(ActionEvent e) { + String actionCommand = e.getActionCommand(); + + if (actionCommand.equals(prefs.getString("lang.takeover"))) { + savePrefs(); + + if (simulation != null) { + if (expertModeChanged()) + simulation.fireExpertModeChanged(); + 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()) { + if (simulation != null) + simulation.fireExpertModeChanged(); + } + if (!dontStartNewSimulation) + simulatorFrame.addSimulation(new VSSimulator(prefsToEdit, simulatorFrame)); + else if (simulation != null) + simulation.updateFromPrefs(); + + } else { + super.actionPerformed(e); + } + } +} -- cgit v1.2.3