<commit_before>package de.felixroske.jfx.support;

import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 * @author <NAME>
 */
public abstract class AbstractJavaFxApplicationSupport extends Application {

	private static String[] savedArgs;

	private static Class<? extends AbstractFxmlView> savedInitialView;
	
	private static ConfigurableApplicationContext applicationContext;

	private static Stage stage;
	private static Scene scene; // = new Scene();
	
	@Override
	public void init() throws Exception {
		applicationContext = SpringApplication.run(getClass(), savedArgs);
		applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
	}
	
	@Override
	public void start(Stage stage) throws Exception {
		this.stage = stage;
		
		showView(savedInitialView);
	}
	
	public void showView(Class<? extends AbstractFxmlView> newView) {
		AbstractFxmlView view = applicationContext.getBean(newView);
		
//		Scene scene = new Scene(view.getView());
		
//		stage.setTitle(windowTitle);
		stage.setScene(scene);
		stage.setResizable(true);
		stage.centerOnScreen();
		stage.show();
	}
	
	@Override
	public void stop() throws Exception {

		super.stop();
		applicationContext.close();<commit_msg>NOT WORKING YET<commit_after>package de.felixroske.jfx.support;

import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 * @author <NAME>
 */
public abstract class AbstractJavaFxApplicationSupport extends Application {

	private static String[] savedArgs;

	private static Class<? extends AbstractFxmlView> savedInitialView;
	
	private static ConfigurableApplicationContext applicationContext;

	private static Stage stage;
	private static Scene scene; // = new Scene();
	
	@Override
	public void init() throws Exception {
		applicationContext = SpringApplication.run(getClass(), savedArgs);
		applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
	}
	
	@Override
	public void start(Stage stage) throws Exception {
		this.stage = stage;
		
		showView(savedInitialView);
	}
	
	public void showView(Class<? extends AbstractFxmlView> newView) {
		AbstractFxmlView view = applicationContext.getBean(newView);
		
		Scene scene = new Scene(view.getView());
		
//		stage.setTitle(windowTitle);
		stage.setScene(scene);
		stage.setResizable(true);
		stage.centerOnScreen();
		stage.show();
	}
	
	@Override
	public void stop() throws Exception {

		super.stop();
		applicationContext.close();
{'fraction_non_alphanumeric': 0.09911894273127753, 'fraction_numerical': 0.0, 'mean_word_length': 5.442080378250591, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '7490380', 'n_tokens_mistral': 811, 'n_tokens_neox': 741, 'n_words': 181}