1 /*
2 * Copyright (c) Patrick Magauran 2018.
3 * Licensed under the AGPLv3. All conditions of said license apply.
4 * This file is part of ABOS.
5 *
6 * ABOS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ABOS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with ABOS. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 package Launchers;/*
21 * Copyright (c) Patrick Magauran 2018.
22 * Licensed under the AGPLv3. All conditions of said license apply.
23 * This file is part of ABOS.
24 *
25 * ABOS is free software: you can redistribute it and/or modify
26 * it under the terms of the GNU Affero General Public License as published by
27 * the Free Software Foundation, either version 3 of the License, or
28 * (at your option) any later version.
29 *
30 * ABOS is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU Affero General Public License for more details.
34 *
35 * You should have received a copy of the GNU Affero General Public License
36 * along with ABOS. If not, see <http://www.gnu.org/licenses/>.
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 * Created by patrick on 12/24/15.
52 */
53 public class Settings extends Window {
54 //private final JPanel contentPanel = new JPanel();
55 //private JTabbedPane north;
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 }