<commit_before>package com.hazelcast.stabilizer.visualiser;

import com.hazelcast.stabilizer.visualiser.data.Model;
import com.hazelcast.stabilizer.visualiser.io.ResultParserWorker;
import com.hazelcast.stabilizer.visualiser.ui.Chart;
import com.hazelcast.stabilizer.visualiser.ui.LoadedBenchmarks;
import com.hazelcast.stabilizer.visualiser.ui.ProbesCheckboxes;
import org.jfree.ui.ExtensionFileFilter;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;

public class Main {

    private JFrame frame;
    private Chart chartPanel;
    private Model model;

    public Main() {
        model = new Model();
        createUI();
        createMenu();
    }

    private void createMenu() {
        JMenuBar menuBar = new JMenuBar();
        JMenu menu = new JMenu("File");
        menu.setMnemonic(KeyEvent.VK_A);
        menuBar.add(menu);

        JMenuItem menuItem = new JMenuItem("Load...");
        menuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                final JFileChooser fc = new JFileChooser();
                fc.setFileFilter(new ExtensionFileFilter("XML Files", "xml"));
                int retVal = fc.showOpenDialog(null);
                if (retVal == JFileChooser.APPROVE_OPTION) {
                    File file = fc.getSelectedFile();
                    new ResultParserWorker(file, model).execute();
                }
            }
        });

        menu.add(menuItem);
        frame.setJMenuBar(menuBar);

    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new Main();
            }
        });
    }

    private void createUI() {
        frame = new JFrame("Stabilizer Workbench");

        frame.setSize(600, 400);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationByPlatform(true);
        frame.setVisible(true);
<commit_msg>1. Main frame now Exits on close 2. Explicit Exit item addded to the menu<commit_after>package com.hazelcast.stabilizer.visualiser;

import com.hazelcast.stabilizer.visualiser.data.Model;
import com.hazelcast.stabilizer.visualiser.io.ResultParserWorker;
import com.hazelcast.stabilizer.visualiser.ui.Chart;
import com.hazelcast.stabilizer.visualiser.ui.LoadedBenchmarks;
import com.hazelcast.stabilizer.visualiser.ui.ProbesCheckboxes;
import org.jfree.ui.ExtensionFileFilter;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;

public class Main {

    private JFrame frame;
    private Chart chartPanel;
    private Model model;

    public Main() {
        model = new Model();
        createUI();
        createMenu();
    }

    private void createMenu() {
        JMenuBar menuBar = new JMenuBar();
        JMenu menu = new JMenu("File");
        menu.setMnemonic(KeyEvent.VK_A);
        menuBar.add(menu);

        JMenuItem loadMenuItem = new JMenuItem("Load...");
        loadMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                final JFileChooser fc = new JFileChooser();
                fc.setFileFilter(new ExtensionFileFilter("XML Files", "xml"));
                int retVal = fc.showOpenDialog(null);
                if (retVal == JFileChooser.APPROVE_OPTION) {
                    File file = fc.getSelectedFile();
                    new ResultParserWorker(file, model).execute();
                }
            }
        });

        JMenuItem exitMenuItem = new JMenuItem("Exit");
        exitMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });

        menu.add(loadMenuItem);
        menu.add(exitMenuItem);
        frame.setJMenuBar(menuBar);

    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new Main();
            }
        });
    }

    private void createUI() {
        frame = new JFrame("Stabilizer Workbench");

        frame.setSize(600, 400);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationByPlatform(true);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

{'fraction_non_alphanumeric': 0.1035528596187175, 'fraction_numerical': 0.0032495667244367417, 'mean_word_length': 2.414940828402367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6080076', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1316, 'n_words': 260}