<commit_before>package it.backbox.gui;

import it.backbox.bean.File;
import it.backbox.gui.bean.Size;
import it.backbox.gui.bean.TableTask;
import it.backbox.gui.utility.ColorTableCellRenderer;
import it.backbox.gui.utility.GuiUtility;
import it.backbox.gui.utility.SizeTableRowSorter;
import it.backbox.progress.ProgressListener;
import it.backbox.progress.ProgressManager;
import it.backbox.transaction.TransactionManager;
import it.backbox.transaction.TransactionManager.CompleteTransactionListener;
import it.backbox.transaction.task.Task;
import it.backbox.transaction.task.Transaction;
import it.backbox.utility.BackBoxHelper;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.sql.SQLException;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JSpinner;
import javax.swing.JTable;
import javax.swing.KeyStroke;
import javax.swing.ListSelectionModel;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.DefaultTableModel;

import net.miginfocom.swing.MigLayout;

import org.apache.commons.configuration.ConfigurationException;

public class BackBoxGui {
	private static Logger _log = Logger.getLogger("it.backbox");

	private static BackBoxGui window;
	private JFrame frmBackBox;
	private JTable table;
	private PasswordDialog pwdDialog;
	private ConfigurationDialog configurationDialog;
	private PreferencesDialog preferencesDialog;
	private JLabel lblStatus;
	private NewConfDialog newConfDialog;
	private JTable tablePreview;
	private JButton btnConnect;
	private JLabel lblEtaValue;
	private JButton btnBackup;
	private JButton btnRestore;
	private LoadingDialog loadingDialog;
	private JButton btnClear;
	private JButton btnStart;
	private JButton btnStop;
	private DetailsDialog detailsDialog;
	private JMenuItem mntmUploadDb;
	private JMenuItem mntmDownloadDb;
	private JSpinner spnCurrentUploadSpeed;
	private JMenuItem mntmNewConfiguration;
	private JMenuItem mntmConfiguration;
	
	protected BackBoxHelper helper;
	private ArrayList<String> fileKeys;
	private Map<String, Integer> taskKeys;
	private List<TableTask> tasksPending;
	private boolean connected = false;
	private boolean running = false;
	private boolean pending = false;
	private boolean pendingDone = false;
	private String backupFolder;

	/**
	 * Launch the application.
	 * @throws Exception 
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					window = new BackBoxGui();
					window.frmBackBox.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	
	private void setSpeed(int uploadSpeed) {
		spnCurrentUploadSpeed.setValue(uploadSpeed / 1024);
		ProgressManager.getInstance().setSpeed(ProgressManager.UPLOAD_ID, uploadSpeed);
		ProgressManager.getInstance().setSpeed(ProgressManager.DOWNLOAD_ID, uploadSpeed);
	}
	
	public void connect() {<commit_msg>set system look&feel at startup<commit_after>package it.backbox.gui;

import it.backbox.bean.File;
import it.backbox.gui.bean.Size;
import it.backbox.gui.bean.TableTask;
import it.backbox.gui.utility.ColorTableCellRenderer;
import it.backbox.gui.utility.GuiUtility;
import it.backbox.gui.utility.SizeTableRowSorter;
import it.backbox.progress.ProgressListener;
import it.backbox.progress.ProgressManager;
import it.backbox.transaction.TransactionManager;
import it.backbox.transaction.TransactionManager.CompleteTransactionListener;
import it.backbox.transaction.task.Task;
import it.backbox.transaction.task.Transaction;
import it.backbox.utility.BackBoxHelper;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.sql.SQLException;
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JSpinner;
import javax.swing.JTable;
import javax.swing.KeyStroke;
import javax.swing.ListSelectionModel;
import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.DefaultTableModel;

import net.miginfocom.swing.MigLayout;

import org.apache.commons.configuration.ConfigurationException;

public class BackBoxGui {
	private static Logger _log = Logger.getLogger("it.backbox");

	private static BackBoxGui window;
	private JFrame frmBackBox;
	private JTable table;
	private PasswordDialog pwdDialog;
	private ConfigurationDialog configurationDialog;
	private PreferencesDialog preferencesDialog;
	private JLabel lblStatus;
	private NewConfDialog newConfDialog;
	private JTable tablePreview;
	private JButton btnConnect;
	private JLabel lblEtaValue;
	private JButton btnBackup;
	private JButton btnRestore;
	private LoadingDialog loadingDialog;
	private JButton btnClear;
	private JButton btnStart;
	private JButton btnStop;
	private DetailsDialog detailsDialog;
	private JMenuItem mntmUploadDb;
	private JMenuItem mntmDownloadDb;
	private JSpinner spnCurrentUploadSpeed;
	private JMenuItem mntmNewConfiguration;
	private JMenuItem mntmConfiguration;
	
	protected BackBoxHelper helper;
	private ArrayList<String> fileKeys;
	private Map<String, Integer> taskKeys;
	private List<TableTask> tasksPending;
	private boolean connected = false;
	private boolean running = false;
	private boolean pending = false;
	private boolean pendingDone = false;
	private String backupFolder;

	/**
	 * Launch the application.
	 * @throws Exception 
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
					window = new BackBoxGui();
					window.frmBackBox.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	
	private void setSpeed(int uploadSpeed) {
		spnCurrentUploadSpeed.setValue(uploadSpeed / 1024);
		ProgressManager.getInstance().setSpeed(ProgressManager.UPLOAD_ID, uploadSpeed);
		ProgressManager.getInstance().setSpeed(ProgressManager.DOWNLOAD_ID, uploadSpeed);
	}
	
	public void connect() {
{'fraction_non_alphanumeric': 0.08865853658536585, 'fraction_numerical': 0.000975609756097561, 'mean_word_length': 5.967714528462192, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7239949', 'n_tokens_mistral': 2511, 'n_tokens_neox': 2427, 'n_words': 549}