package application;

import java.io.IOException;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;


public class ATGMain extends Application {

	private Stage primaryStage;
	private AnchorPane rootLayout;

	@Override
	public void start(Stage primaryStage) {
		try {
			this.primaryStage = primaryStage;
			this.primaryStage.setTitle("ATG Odds");
			this.primaryStage.setMaximized(true);

			initRootLayout();
		} catch(final Exception e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}

	public void initRootLayout() {
		try {
			// Load root layout from fxml file.
			final FXMLLoader loader = new FXMLLoader();
			loader.setLocation(ATGMain.class.getResource("../fxml/AtgMain.fxml"));
			rootLayout = (AnchorPane) loader.load();

			// Show the scene containing the root layout.
			final Scene scene = new Scene(rootLayout);
			primaryStage.setScene(scene);
			primaryStage.show();
		} catch (final IOException e) {
			throw new RuntimeException(e.getMessage(), e);
		}
	}


	public static void main(String[] args) {
		launch(args);
	}

}
