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
22 import Controllers.ReportsController;
23 import Utilities.LogToFile;
24 import Utilities.Severity;
25 import javafx.fxml.FXMLLoader;
26 import javafx.scene.Scene;
27 import javafx.stage.Modality;
28 import javafx.stage.Stage;
29 import javafx.stage.Window;
30
31 import java.io.IOException;
32
33 /**
34 * Created by patrick on 12/24/15.
35 */
36 public class Reports extends Window {
37
38 public Reports(Window owner) {
39 Stage stage = new Stage();
40 FXMLLoader loader;
41
42 Scene root;
43 try {
44 loader = new FXMLLoader(getClass().getResource("/UI/Reports.fxml"));
45 root = new Scene(loader.load());
46 ReportsController reportsController = loader.getController();
47 reportsController.initUI(this);
48 stage.setScene(root);
49 stage.setTitle("Reports");
50 stage.initModality(Modality.APPLICATION_MODAL);
51 stage.initOwner(owner);
52 stage.setMinWidth(415);
53 stage.setMinHeight(491);
54 stage.showAndWait();
55 } catch (IOException e) {
56 LogToFile.log(e, Severity.SEVERE, "Error loading window. Please retry then reinstall application. If error persists, contact the developers.");
57 }
58
59 }
60
61 }