algorithms-for-computing-li.../src/main/java/de/wwwu/awolf/App.java

62 lines
1.9 KiB
Java

package de.wwwu.awolf;
import de.wwwu.awolf.presenter.util.Logging;
import de.wwwu.awolf.view.ViewController;
import de.wwwu.awolf.view.services.GuiRegisterService;
import java.io.IOException;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
/**
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
*
* @Author: Armin Wolf
* @Email: a_wolf28@uni-muenster.de
* @Date: 28.05.2017.
*/
public class App extends Application {
private static final String TITLE = "Algorithmen zur Berechnung von Ausgleichsgeraden";
/**
* Maim Methode
*
* @param argv
*/
public static void main(String[] argv) {
Logging.logDebug("Start ....");
Application.launch(App.class, argv);
}
@Override
public void start(Stage primaryStage) throws Exception {
Platform.runLater(() -> {
try {
FXMLLoader fxmlLoader = new FXMLLoader(
ViewController.class.getResource("/views/MainFrame.fxml"));
Parent pane = fxmlLoader.load();
//register at presenter
new GuiRegisterService(fxmlLoader.getController()).start();
primaryStage.setTitle(TITLE);
Scene scene = new Scene(pane, 1200, 900);
scene.getStylesheets()
.add(ViewController.class.getResource("/style/style.css")
.toExternalForm());
primaryStage.setScene(scene);
primaryStage.setOnCloseRequest(e -> {
Platform.exit();
System.exit(0);
});
primaryStage.show();
} catch (IOException e) {
Logging.logError("Error reading FXML file. ", e);
}
});
}
}