diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-15 23:08:33 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-15 23:08:33 +0000 |
| commit | d4c1ddcc90c1e2e8660598fc36b3772d2bff6816 (patch) | |
| tree | 28a0afc255e42f92adbca0d102e785301bc43a58 /sources/editors/VSSimulationEditor.java | |
| parent | 61599471a5978c1521b9c89c044ac2ce9a88c398 (diff) | |
1 Moved the stuff to trunk!
Diffstat (limited to 'sources/editors/VSSimulationEditor.java')
| -rw-r--r-- | sources/editors/VSSimulationEditor.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/sources/editors/VSSimulationEditor.java b/sources/editors/VSSimulationEditor.java new file mode 100644 index 0000000..c455d64 --- /dev/null +++ b/sources/editors/VSSimulationEditor.java @@ -0,0 +1,60 @@ +package 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.VSPrefs; + +public class VSSimulationEditor extends VSEditorFrame { + private boolean startNewVSSimulation; + + public VSSimulationEditor(VSPrefs prefs, Component relativeTo) { + super(prefs, relativeTo, prefs, prefs.getString("name") + + " - " + prefs.getString("lang.prefs")); + + startNewVSSimulation = true; + initialize(); + } + + public VSSimulationEditor(VSPrefs prefs, Component relativeTo, int prefsCategory) { + super(prefs, relativeTo, prefs, prefs.getString("name") + + " - " + prefs.getString("lang.prefs" + + (prefsCategory == ALL_PREFERENCES ? ".ext" : "")), + prefsCategory); + + startNewVSSimulation = false; + initialize(); + } + + private void initialize() { + super.infoArea.setText(prefs.getString("lang.prefs.info!")); + } + + public void actionPerformed(ActionEvent e) { + String actionCommand = e.getActionCommand(); + + if (actionCommand.equals(prefs.getString("lang.ok"))) { + super.actionPerformed(e); + prefsToEdit.saveFile(); + + frame.dispose(); + + if (startNewVSSimulation) + new VSSimulation(prefs, getFrame()); + + } else { + super.actionPerformed(e); + } + } + + public void newVSEditorInstance(VSPrefs prefs, VSPrefs prefsToEdit, int prefsCategory) { + new VSSimulationEditor(prefs, getFrame(), prefsCategory); + } +} |
