|
|
|
@@ -6,6 +6,7 @@ import de.uniluebeck.mi.projmi6.model.Kasse; |
|
|
|
import de.uniluebeck.mi.projmi6.model.Mitarbeiter; |
|
|
|
import de.uniluebeck.mi.projmi6.model.OpsCode; |
|
|
|
import javafx.application.Application; |
|
|
|
import javafx.beans.property.ReadOnlyStringProperty; |
|
|
|
import javafx.collections.FXCollections; |
|
|
|
import javafx.concurrent.Task; |
|
|
|
import javafx.fxml.FXMLLoader; |
|
|
|
@@ -39,32 +40,32 @@ public class Main extends Application { |
|
|
|
protected Parent call() throws Exception { |
|
|
|
|
|
|
|
MainController mainController = new MainController(); |
|
|
|
System.out.println("Lade OPS-Codes..."); |
|
|
|
updateMessage("Lade OPS-Codes..."); |
|
|
|
mainController.getStammdaten().setOpsCodes(FXCollections.observableArrayList( |
|
|
|
DBHandler.getAllOpsCodes() |
|
|
|
)); |
|
|
|
|
|
|
|
System.out.println("Lade ICD-10-Codes..."); |
|
|
|
updateMessage("Lade ICD-10-Codes..."); |
|
|
|
mainController.getStammdaten().setIcd10Codes(FXCollections.observableArrayList( |
|
|
|
DBHandler.getAllIcd10Codes() |
|
|
|
)); |
|
|
|
|
|
|
|
System.out.println("Lade Krankenkassen..."); |
|
|
|
updateMessage("Lade Krankenkassen..."); |
|
|
|
mainController.getStammdaten().setKassen(FXCollections.observableArrayList( |
|
|
|
DBHandler.getAllKassen() |
|
|
|
)); |
|
|
|
|
|
|
|
System.out.println("Lade Mitarbeiter..."); |
|
|
|
updateMessage("Lade Mitarbeiter..."); |
|
|
|
mainController.getStammdaten().setMitarbeiter(FXCollections.observableArrayList( |
|
|
|
DBHandler.getAllMitarbeiter() |
|
|
|
)); |
|
|
|
|
|
|
|
System.out.println("Lade Stationen..."); |
|
|
|
updateMessage("Lade Stationen..."); |
|
|
|
mainController.getStammdaten().setStationen(FXCollections.observableArrayList( |
|
|
|
DBHandler.getAllStationen()) |
|
|
|
); |
|
|
|
|
|
|
|
System.out.println("Lade GUI..."); |
|
|
|
updateMessage("Lade GUI..."); |
|
|
|
FXMLLoader fxmlLoader = new FXMLLoader(); |
|
|
|
fxmlLoader.setLocation(getClass().getClassLoader().getResource("main.fxml")); |
|
|
|
fxmlLoader.setControllerFactory(mainController.getControllerFactory()); |
|
|
|
@@ -87,7 +88,7 @@ public class Main extends Application { |
|
|
|
|
|
|
|
primaryStage.getIcons().add(icon); |
|
|
|
|
|
|
|
Stage loadingMessage = createLoadWindow(); |
|
|
|
Stage loadingMessage = createLoadWindow(loadMainWindowTask.messageProperty()); |
|
|
|
|
|
|
|
loadMainWindowTask.setOnFailed(event -> { |
|
|
|
loadMainWindowTask.getException().printStackTrace(); |
|
|
|
@@ -102,6 +103,7 @@ public class Main extends Application { |
|
|
|
primaryStage.setScene(new Scene(root, 1000, 800)); |
|
|
|
primaryStage.show(); |
|
|
|
}); |
|
|
|
|
|
|
|
Thread thread = new Thread(loadMainWindowTask); |
|
|
|
thread.setDaemon(true); |
|
|
|
thread.start(); |
|
|
|
@@ -115,17 +117,20 @@ public class Main extends Application { |
|
|
|
* |
|
|
|
* @return the splash screen |
|
|
|
*/ |
|
|
|
public Stage createLoadWindow(){ |
|
|
|
public Stage createLoadWindow(ReadOnlyStringProperty progressMessage){ |
|
|
|
Text kis = new Text("KIS"); |
|
|
|
kis.setFont(Font.font(50)); |
|
|
|
|
|
|
|
Text gruppe6 = new Text("Gruppe 06"); |
|
|
|
gruppe6.setFont(Font.font(20)); |
|
|
|
|
|
|
|
VBox root = new VBox(gruppe6, new ImageView(icon), kis); |
|
|
|
Text progress = new Text(); |
|
|
|
progress.textProperty().bind(progressMessage); |
|
|
|
|
|
|
|
VBox root = new VBox(gruppe6, new ImageView(icon), kis, progress); |
|
|
|
root.setSpacing(20); |
|
|
|
root.setAlignment(Pos.CENTER); |
|
|
|
Scene scene = new Scene(root, 400, 400); |
|
|
|
Scene scene = new Scene(root, 400, 500); |
|
|
|
|
|
|
|
Stage stage = new Stage(StageStyle.UNDECORATED); |
|
|
|
stage.getIcons().add(icon); |
|
|
|
|