1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package Launchers;
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 import Controllers.SettingsController;
40 import Utilities.LogToFile;
41 import Utilities.Severity;
42 import javafx.fxml.FXMLLoader;
43 import javafx.scene.Scene;
44 import javafx.stage.Modality;
45 import javafx.stage.Stage;
46 import javafx.stage.Window;
47
48 import java.io.IOException;
49
50
51
52
53 public class Settings extends Window {
54
55
56
57 public Settings(Window owner) {
58 Stage stage = new Stage();
59 FXMLLoader loader;
60
61 Scene root;
62 try {
63 loader = new FXMLLoader(getClass().getResource("/UI/Settings.fxml"));
64 root = new Scene(loader.load());
65 SettingsController settingsController = loader.getController();
66 settingsController.initUI(this);
67 stage.setScene(root);
68 stage.setTitle("Settings");
69 stage.initModality(Modality.APPLICATION_MODAL);
70 stage.initOwner(owner);
71 stage.setMinWidth(800);
72 stage.setMinHeight(674);
73 stage.showAndWait();
74 } catch (IOException e) {
75 LogToFile.log(e, Severity.SEVERE, "Error loading window. Please retry then reinstall application. If error persists, contact the developers.");
76 }
77
78 }
79
80 public Settings() {
81 Stage stage = new Stage();
82 FXMLLoader loader;
83
84 Scene root;
85 try {
86 loader = new FXMLLoader(getClass().getResource("/UI/Settings.fxml"));
87 root = new Scene(loader.load());
88 SettingsController settingsController = loader.getController();
89 settingsController.initUI(this);
90 stage.setScene(root);
91 stage.setTitle("Settings");
92 stage.initModality(Modality.APPLICATION_MODAL);
93 stage.setMinWidth(800);
94 stage.setMinHeight(674);
95 stage.showAndWait();
96 } catch (IOException e) {
97 LogToFile.log(e, Severity.SEVERE, "Error loading window. Please retry then reinstall application. If error persists, contact the developers.");
98 }
99
100 }
101
102 }