#8: Cleanup & Javadoc
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
This commit is contained in:
parent
7db1c83a08
commit
e3c8d87bc2
2 changed files with 18 additions and 8 deletions
|
@ -37,10 +37,17 @@ public class Main extends Application {
|
|||
@Override
|
||||
public void start(Stage 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 {
|
||||
|
||||
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);
|
||||
|
||||
loginStage.showAndWait();
|
||||
|
||||
if(controller.user != null){
|
||||
executeMainApplication(controller.user);
|
||||
}
|
||||
return controller.user;
|
||||
} catch (IOException exception) {
|
||||
exception.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,11 @@ import java.sql.Connection;
|
|||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* {@link Fixture} for {@link User}.
|
||||
*
|
||||
* @author Dominik Säume
|
||||
*/
|
||||
public class UserFixture implements Fixture<User> {
|
||||
private static final String SCHEMA = "/de/hitec/nhplus/login/database/User.sql";
|
||||
private static final String PERMISSION_SCHEMA = "/de/hitec/nhplus/login/database/UserPermission.sql";
|
||||
|
|
Loading…
Reference in a new issue