-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmInterface.java
More file actions
103 lines (76 loc) · 3.11 KB
/
Copy pathmInterface.java
File metadata and controls
103 lines (76 loc) · 3.11 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import com.jfoenix.controls.JFXComboBox;
import functions.FMO;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import login.Main;
import login.user.users;
import java.io.*;
/**
* Created by Gigara
*/
public class mInterface {
public JFXComboBox dropd;
public Pane minterface;
public static Stage FMOStage;
public void initialize() throws IOException {
dropd.getItems().addAll("Log Out");
dropd.promptTextProperty().set(users.loggeduser);
}
public static void main(String[] args) {
}
public void logout(ActionEvent actionEvent) throws IOException {
((Node) (actionEvent.getSource())).getScene().getWindow().hide();
Main.primaryStage.show();
}
public void call(MouseEvent mouseEvent) throws IOException {
Pane callpane = FXMLLoader.load(getClass().getResource("functions/Call.fxml"));
minterface.getChildren().setAll(callpane);
}
public void officemove(MouseEvent mouseEvent) throws IOException {
Pane callpane = FXMLLoader.load(getClass().getResource("functions/OfficeMove.fxml"));
minterface.getChildren().setAll(callpane);
}
public void floorPlan(MouseEvent mouseEvent) throws IOException {
if (users.loggeduserType.equals("Admin")) {
Pane callpane = FXMLLoader.load(getClass().getResource("functions/FloorPlan.fxml"));
minterface.getChildren().setAll(callpane);
} else {
Alert err = new Alert(Alert.AlertType.ERROR);
err.initOwner(Main.primaryStage);
err.setTitle("Error");
err.setContentText("You Don't Have Access to this function");
err.setHeaderText(null);
err.showAndWait();
}
}
public void FMO(MouseEvent mouseEvent) throws Exception {
FMO.initialize();
}
public void reallocation(MouseEvent mouseEvent) throws IOException {
Pane callpane = FXMLLoader.load(getClass().getResource("functions/Call.fxml"));
minterface.getChildren().setAll(callpane);
}
public void assets(MouseEvent mouseEvent) throws IOException {
Pane assets = FXMLLoader.load(getClass().getResource("functions/FurnitureAssets.fxml"));
minterface.getChildren().setAll(assets);
}
public void newUser(MouseEvent mouseEvent) throws IOException {
if (users.loggeduserType.equals("Admin")) {
Pane signuppane = FXMLLoader.load(getClass().getResource("login/user/signup.fxml"));
minterface.getChildren().setAll(signuppane);
} else {
Alert err = new Alert(Alert.AlertType.ERROR);
err.initOwner(Main.primaryStage);
err.setTitle("Error");
err.setContentText("You Don't Have Access to this function");
err.setHeaderText(null);
err.showAndWait();
}
}
}