1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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;
init();
}
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;
init();
}
private void init() {
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);
}
}
|