#8: Cleanup & Javadoc
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
This commit is contained in:
parent
7db1c83a08
commit
fb5e2a1ab9
1 changed files with 11 additions and 6 deletions
|
@ -37,10 +37,17 @@ public class Main extends Application {
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) {
|
public void start(Stage primaryStage) {
|
||||||
this.primaryStage = primaryStage;
|
this.primaryStage = primaryStage;
|
||||||
executePassword();
|
User user = executeLogin();
|
||||||
|
if(user != null){
|
||||||
|
executeMainApplication(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executePassword() {
|
/**
|
||||||
|
* Executes the login.
|
||||||
|
* @return User The {@link User} object for the logged-in {@link User}. Is {@code null}, if the login was not successful,
|
||||||
|
*/
|
||||||
|
private User executeLogin() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
FXMLLoader loader = new FXMLLoader(Main.class.getResource("/de/hitec/nhplus/login/LoginView.fxml"));
|
FXMLLoader loader = new FXMLLoader(Main.class.getResource("/de/hitec/nhplus/login/LoginView.fxml"));
|
||||||
|
@ -55,12 +62,10 @@ public class Main extends Application {
|
||||||
controller.initialize(loginStage);
|
controller.initialize(loginStage);
|
||||||
|
|
||||||
loginStage.showAndWait();
|
loginStage.showAndWait();
|
||||||
|
return controller.user;
|
||||||
if(controller.user != null){
|
|
||||||
executeMainApplication(controller.user);
|
|
||||||
}
|
|
||||||
} catch (IOException exception) {
|
} catch (IOException exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue