<commit_before>package com.github.athi.athifx.gui;

import com.github.athi.athifx.gui.configuration.AthiFXApplicationProperties;
import com.github.athi.athifx.gui.menu.Menu;
import com.github.athi.athifx.gui.navigation.navigator.NavigationPane;
import com.github.athi.athifx.injector.injection.AthiFXInjector;
import com.google.inject.Inject;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Font;
import javafx.stage.Stage;

/**
 * Created by Athi
 */
public class AthiFXApplication extends Application {

    @Inject
    private AthiFXApplicationProperties applicationConfiguration;

    @Inject
    private NavigationPane navigationPane;

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

    @Override
    public void start(Stage primaryStage) throws Exception {
        createApplicationLoadingScreen(primaryStage);
        Thread thread = new Thread(() -> {
            AthiFXInjector.createInjector(this);
            Platform.runLater(() -> {
                primaryStage.close();
                createMainApplicationScreen(primaryStage);
            });
        });
        thread.start();
    }

    private void createMainApplicationScreen(Stage primaryStage) {
        Font.loadFont(Thread.currentThread().getContextClassLoader().getResource("fonts/fontawesome-webfont.ttf").toExternalForm(), 12);
        primaryStage.setMaximized(true);

        AnchorPane applicationContent = new AnchorPane();
        applicationContent.setPrefWidth(800);
        applicationContent.setPrefHeight(600);

        Scene value = new Scene(applicationContent);
        value.getStylesheets().add(Thread.currentThread().getContextClassLoader().getResource("css/fontawesome-webfont.css").toExternalForm());

        primaryStage.setScene(value);

        Menu menu = new Menu();
        applicationContent.getChildren().addAll(menu, navigationPane);

        AnchorPane.setLeftAnchor(menu, 2.0);
        AnchorPane.setTopAnchor(menu, 2.0);
        AnchorPane.setBottomAnchor(menu, 2.0);

        AnchorPane.setLeftAnchor(navigationPane, 160.0);
        AnchorPane.setTopAnchor(navigationPane, 2.0);
        AnchorPane.setBottomAnchor(navigationPane, 2.0);
        AnchorPane.setRightAnchor(navigationPane, 2.0);

        // ITEMS, GROUPS and VIEWS
        navigationPane.setViewAsContent(applicationConfiguration.getViews().get(1L));
        primaryStage.show();
    }

    private void createApplicationLoadingScreen(Stage primaryStage) {
        AnchorPane root = new AnchorPane();
        root.setPrefHeight(100);
        root.setPrefWidth(400);
        primaryStage.setScene(new Scene(root));

        Label label = new Label("Loading application ...."); // A PROGRESSBAR ETC ETC
        root.getChildren().add(label);
        AnchorPane.setLeftAnchor(label, 2.0);<commit_msg>added FIXME - need to change the resource load.<commit_after>package com.github.athi.athifx.gui;

import com.github.athi.athifx.gui.configuration.AthiFXApplicationProperties;
import com.github.athi.athifx.gui.menu.Menu;
import com.github.athi.athifx.gui.navigation.navigator.NavigationPane;
import com.github.athi.athifx.injector.injection.AthiFXInjector;
import com.google.inject.Inject;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Font;
import javafx.stage.Stage;

/**
 * Created by Athi
 */
public class AthiFXApplication extends Application {

    @Inject
    private AthiFXApplicationProperties applicationConfiguration;

    @Inject
    private NavigationPane navigationPane;

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

    @Override
    public void start(Stage primaryStage) throws Exception {
        createApplicationLoadingScreen(primaryStage);
        Thread thread = new Thread(() -> {
            AthiFXInjector.createInjector(this);
            Platform.runLater(() -> {
                primaryStage.close();
                createMainApplicationScreen(primaryStage);
            });
        });
        thread.start();
    }

    private void createMainApplicationScreen(Stage primaryStage) {
        Font.loadFont(Thread.currentThread().getContextClassLoader().getResource("fonts/fontawesome-webfont.ttf").toExternalForm(), 12); // FIXME -- write it safer
        primaryStage.setMaximized(true);

        AnchorPane applicationContent = new AnchorPane();
        applicationContent.setPrefWidth(800);
        applicationContent.setPrefHeight(600);

        Scene value = new Scene(applicationContent);
        value.getStylesheets().add(Thread.currentThread().getContextClassLoader().getResource("css/fontawesome-webfont.css").toExternalForm()); // FIXME -- write it safer

        primaryStage.setScene(value);

        Menu menu = new Menu();
        applicationContent.getChildren().addAll(menu, navigationPane);

        AnchorPane.setLeftAnchor(menu, 2.0);
        AnchorPane.setTopAnchor(menu, 2.0);
        AnchorPane.setBottomAnchor(menu, 2.0);

        AnchorPane.setLeftAnchor(navigationPane, 160.0);
        AnchorPane.setTopAnchor(navigationPane, 2.0);
        AnchorPane.setBottomAnchor(navigationPane, 2.0);
        AnchorPane.setRightAnchor(navigationPane, 2.0);

        // ITEMS, GROUPS and VIEWS
        navigationPane.setViewAsContent(applicationConfiguration.getViews().get(1L));
        primaryStage.show();
    }

    private void createApplicationLoadingScreen(Stage primaryStage) {
        AnchorPane root = new AnchorPane();
        root.setPrefHeight(100);
        root.setPrefWidth(400);
        primaryStage.setScene(new Scene(root));

        Label label = new Label("Loading application ...."); // A PROGRESSBAR ETC ETC
        root.getChildren().add(label);
        AnchorPane.setLeftAnchor(label, 2.0);
{'fraction_non_alphanumeric': 0.10818030050083473, 'fraction_numerical': 0.011018363939899833, 'mean_word_length': 3.42140221402214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1091225', 'n_tokens_mistral': 1727, 'n_tokens_neox': 1619, 'n_words': 282}