<commit_before>package de.vogel612.helper;

import de.vogel612.helper.data.FilesetModel;
import de.vogel612.helper.ui.*;
import de.vogel612.helper.ui.jfx.*;

import java.nio.file.Path;
import java.nio.file.Paths;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class TranslationHelper extends Application {

    static final String ARGUMENT_MISMATCH = "Arguments do not match up. Please provide no more than a Path to the intended fileset";


    public static void main(String[] args) {
        if (args.length > 1) {
            // don't even bother!
            System.err.println(ARGUMENT_MISMATCH);
            return;
        }
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Stage rcStage = new Stage(StageStyle.UTILITY);
        rcStage.initOwner(primaryStage);
        LocaleChooser rc = new JFXLocaleChooserView(rcStage, getClass().getResource("/LocaleChooser.fxml"));
        Parameters params = getParameters();
        if (params.getUnnamed().size() != 0) { // should be 1..
            final Path resxFile = Paths.get(params.getUnnamed().get(0));
            // FIXME show project or resx overview depending on argument
//            rc.setFileset(resxFile);
        }

        Stage translationStage = new Stage(StageStyle.UTILITY);
        translationStage.initOwner(primaryStage);
        TranslationView tv = new JFXTranslationView(translationStage, getClass().getResource("/TranslationView.fxml"));

        FilesetModel m = new FilesetModel();
        OverviewView v = new JFXTranslationOverviewView(rc, m, tv, primaryStage, getClass().getResource("/TranslationOverviewView.fxml"));
        ProjectView pv = new JFXProjectView(primaryStage, getClass().getResource("/ProjectOverview.fxml"));
        OverviewPresenter p = new OverviewPresenter(v, pv);

        Platform.runLater(p::show);
        Platform.runLater(p::fileChoosing);
    }
}<commit_msg>Move around some initialization and give each view a separate stage<commit_after>package de.vogel612.helper;

import de.vogel612.helper.data.FilesetModel;
import de.vogel612.helper.ui.*;
import de.vogel612.helper.ui.jfx.*;

import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class TranslationHelper extends Application {

    static final String ARGUMENT_MISMATCH = "Arguments do not match up. Please provide no more than a Path to the intended fileset";


    public static void main(String[] args) {
        if (args.length > 1) {
            // don't even bother!
            System.err.println(ARGUMENT_MISMATCH);
            return;
        }
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {

        // FIXME show project or resx overview depending on argument
        // Parameters params = getParameters();
        // if (params.getUnnamed().size() != 0) { // must be 1..
        //     final Path resxFile = Paths.get(params.getUnnamed().get(0));
        //     rc.setFileset(resxFile);
        // }

        Stage overviewStage = new Stage(StageStyle.DECORATED);
        overviewStage.initOwner(primaryStage);

        TranslationView tv = prepareTranslationView(overviewStage);
        LocaleChooser rc = prepareLocaleChooser(overviewStage);

        OverviewView v = new JFXTranslationOverviewView(rc, new FilesetModel(), tv, overviewStage, getClass().getResource("/TranslationOverviewView.fxml"));
        ProjectView pv = new JFXProjectView(primaryStage, getClass().getResource("/ProjectOverview.fxml"));
        OverviewPresenter p = new OverviewPresenter(v, pv);

        Platform.runLater(p::show);
        Platform.runLater(p::fileChoosing);
    }

    private LocaleChooser prepareLocaleChooser(Stage overviewStage) throws IOException {
        Stage rcStage = new Stage(StageStyle.UTILITY);
        rcStage.initOwner(overviewStage);
        return new JFXLocaleChooserView(rcStage, getClass().getResource("/LocaleChooser.fxml"));
    }

    private TranslationView prepareTranslationView(Stage overviewStage) throws IOException {
        Stage translationStage = new Stage(StageStyle.UTILITY);
        translationStage.initOwner(overviewStage);
        return new JFXTranslationView(translationStage, getClass().getResource("/TranslationView.fxml"));
    }
}
{'fraction_non_alphanumeric': 0.10312913177611283, 'fraction_numerical': 0.007051564565888057, 'mean_word_length': 3.3477011494252875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '412918', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1211, 'n_words': 296}