<commit_before>package core;

import configuration.Settings;
import controller.MainController;
import eu.hansolo.enzo.notification.Notification;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class Driver extends Application {
    public static void main(final String[] args) {
        launch();
    }

    @Override
    public void init() {}

    @Override
    public void start(Stage primaryStage) throws Exception {
        // Load Config File:
        final Settings settings = new Settings();
        settings.loadFromFile();

        // Setup the primary stage:
        primaryStage.getIcons().add(new Image("icon.png"));

        // Setup Enzo:
        Notification.Notifier.setPopupLocation(primaryStage, Pos.BOTTOM_CENTER);

        // Add the first scene to the primary stage:
        final Scene scene = new Scene(new MainController(primaryStage).getView());

        scene.getStylesheets().add("global.css");
        scene.getRoot().getStyleClass().add("main-root");

        primaryStage.setTitle("Schillsaver - Powered by /g/entoomen\u00a9\u00ae");
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}<commit_msg>Adds the swapToNewScene and swapToPreviousScene functions.<commit_after>package core;

import configuration.Settings;
import controller.MainController;
import eu.hansolo.enzo.notification.Notification;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class Driver extends Application {
    /** The primary stage. */
    private Stage primaryStage;

    /** The previous scene. */
    private Scene previousScene;
    /** The current scene. */
    private Scene currentScene;

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

    @Override
    public void init() {}

    @Override
    public void start(final Stage primaryStage) throws Exception {
        this.primaryStage = primaryStage;

        // Load Config File:
        final Settings settings = new Settings();
        settings.loadFromFile();

        // Setup the primary stage:
        primaryStage.getIcons().add(new Image("icon.png"));

        // Setup Enzo:
        Notification.Notifier.setPopupLocation(primaryStage, Pos.BOTTOM_CENTER);

        // Add the first scene to the primary stage:
        final Scene scene = new Scene(new MainController(primaryStage).getView());

        primaryStage.setTitle("Schillsaver - Powered by /g/entoomen\u00a9\u00ae");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    /**
     * Swaps the current scene with a new scene, so that the new scene
     * is displayed.
     *
     * @param newScene
     *          The new scene.
     */
    public void swapToNewScene(final Scene newScene) {
        previousScene = currentScene;
        currentScene = newScene;

        if (currentScene.getStylesheets().size() == 0) {
            newScene.getStylesheets().add("global.css");
            newScene.getRoot().getStyleClass().add("main-root");
        }

        primaryStage.setScene(currentScene);
    }

    /**
     * Swaps the current and previous scenes, so that the previous scene
     * is displayed.
     */
    public void swapToPreviousScene() {
        final Scene temp = previousScene;
        previousScene = currentScene;
        currentScene = temp;

        primaryStage.setScene(currentScene);
    }
}
{'fraction_non_alphanumeric': 0.10301153954404728, 'fraction_numerical': 0.0030959752321981426, 'mean_word_length': 2.805139186295503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '471462', 'n_tokens_mistral': 973, 'n_tokens_neox': 937, 'n_words': 248}