<commit_before>/**
 * 
 */
package urllistcompare.gui;

import urllistcompare.*;
import urllistcompare.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout.Alignment;

/**
 * This class provides a GUI to load the files, set up a URL List and access the
 * different functions.
 * 
 * @author <NAME> (<EMAIL>)
 *
 */
public class URLListCompare extends JFrame {

	public URLListCompare() {
		// Retrieve the top-level container
		
		Container cp = getContentPane();

		/*
		// Set the layout
		cp.setLayout(new BorderLayout());
		// */
		
		// MAIN PANEL
		/*
		JPanel pnl = new JPanel();
	    GroupLayout l = new GroupLayout(pnl);
	    pnl.setLayout(l);
	    l.setAutoCreateGaps(true);
	    l.setAutoCreateContainerGaps(true);
	    // */

		// TOP PANEL
		JPanel topPanel = new JPanel();
		GroupLayout topLayout = new GroupLayout(topPanel);
		topLayout.setAutoCreateGaps(true);
		topLayout.setAutoCreateContainerGaps(true);

		// Program Status
		JLabel programStatus = new JLabel("Program Status");
		JTextField statusIndicator = new JTextField("INACTIVE", 10);
		statusIndicator.setForeground(Color.red);
		statusIndicator.setBackground(Color.orange);
		statusIndicator.setEditable(false);

		// Extension
		JLabel extension = new JLabel("Extension");
		JTextField extensionIndicator = new JTextField("ON", 4);
		extensionIndicator.setForeground(new Color(85, 107, 47));
		extensionIndicator.setBackground(new Color(0, 255, 0));
		extensionIndicator.setEditable(false);
		JButton extensionToggle = new JButton("Toggle");
		extensionToggle
				.setToolTipText("Toggle file extensions in the URL List.");
		extensionToggle.setEnabled(true);
		extensionToggle.setPreferredSize(new Dimension(100, 20));

		// Load Files
		JButton loadFiles = new JButton("Load Files");
		loadFiles.setToolTipText(
				"Open the screen that manages the operations needed to load"
						+ " the input csv files and create a URL List.");
		loadFiles.setEnabled(true); // Default when opening the program
		loadFiles.setPreferredSize(new Dimension(100, 20));

		// Load Binary
		JButton loadBinary = new JButton("Load Binary");
		loadBinary.setToolTipText(
				"Open the screen that manages the operations needed to load"
						+ " the input binary file from a previous URL List.");
		loadBinary.setEnabled(true); // Default when opening the program
		loadBinary.setPreferredSize(new Dimension(100, 20));

		// Add elements to top panel layout
		// Horizontal
		GroupLayout.ParallelGroup topHGroup = topLayout.createParallelGroup(Alignment.CENTER);
		topHGroup.addGroup(topLayout.createSequentialGroup()
				.addGroup(topLayout.createParallelGroup()
						.addComponent(programStatus)
						.addComponent(extension))
				.addGroup(topLayout.createParallelGroup()
						.addComponent(statusIndicator)
						.addComponent(extensionIndicator))
				.addGroup(topLayout.createParallelGroup()
						.addComponent(extensionToggle))
				.addGroup(topLayout.createParallelGroup()
						.addComponent(loadFiles)
						.addComponent(loadBinary)));
		topLayout.setHorizontalGroup(topHGroup);
		topLayout.linkSize(SwingConstants.HORIZONTAL, loadBinary, loadFiles);
		
		// Vertical
        GroupLayout.SequentialGroup topVGroup = topLayout.createSequentialGroup();
        topVGroup.addGroup(topLayout.createParallelGroup()
        		.addComponent(programStatus)
        		.addComponent(statusIndicator)
        		.addComponent(loadFiles));
        topVGroup.addGroup(topLayout.createParallelGroup()
        		.addComponent(extension)
        		.addComponent(extensionIndicator)
        		.addComponent(extensionToggle)
        		.addComponent(loadBinary));
        topLayout.setVerticalGroup(topVGroup);
		
        // LAYOUT OF MAIN CONTAINER
        /*
		GroupLayout.ParallelGroup hGroup = l.createParallelGroup(Alignment.CENTER);
		hGroup.addGroup(l.createSequentialGroup()
				.addComponent(topPanel));
		l.setHorizontalGroup(hGroup);
		
		GroupLayout.ParallelGroup vGroup = l.createParallelGroup(Alignment.LEADING);
		vGroup.addGroup(l.createSequentialGroup()
				.addComponent(topPanel));
		l.setVerticalGroup(vGroup);
		
		// */
		
		cp.setLayout(topLayout);
        
        /*
		// Top Panel Add
		cp.add(topPanel, BorderLayout.NORTH);

		JPanel centerPanel = new JPanel(new GridLayout(4, 3));
		cp.add(centerPanel, BorderLayout.CENTER);
		cp.add(new JLabel("East"), BorderLayout.EAST);
		cp.add(new JLabel("West"), BorderLayout.WEST);

		JTextField hasHeaderA = new JTextField(7);
		hasHeaderA.setText("Header");
		hasHeaderA.setForeground(Color.red);
		hasHeaderA.setBackground(Color.orange);
		hasHeaderA.addMouseListener(new MouseAdapter() {
			@Override
			public void
				mouseClicked(MouseEvent e) {
				JTextField source = (JTextField) e.getSource();
				if (source.getText().equals("Header")) {
					source.setText("Toggled");
					source.setForeground(Color.green);
					source.setBackground(Color.white);
				} else {
					source.setText("Header");
					source.setForeground(Color.red);
					source.setBackground(Color.orange);
				}
			}
		});
		hasHeaderA.setEditable(false);
		centerPanel.add(hasHeaderA);
		// */

		// Exit the program when the close-window button clicked
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setTitle("URLListCompare"); // "super" JFrame sets title
		setSize(800, 600);
		setVisible(true); // "super" JFrame shows
	}

	/**
	 * @param args
	 */
	public static void
		main(String[] args) {<commit_msg>bugs corrected, still not working<commit_after>/**
 * 
 */
package urllistcompare.gui;

import urllistcompare.*;
import urllistcompare.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout.Alignment;

/**
 * This class provides a GUI to load the files, set up a URL List and access the
 * different functions.
 * 
 * @author <NAME> (rocco<EMAIL>)
 *
 */
public class URLListCompare extends JFrame {

	private final JLabel programStatus;
	private final JLabel extension;

	public URLListCompare() {

		programStatus = new JLabel("Program Status");
		extension = new JLabel("Extension");

		// Program Status
		JTextField statusIndicator = new JTextField("INACTIVE", 10);
		statusIndicator.setForeground(Color.red);
		statusIndicator.setBackground(Color.orange);
		statusIndicator.setEditable(false);

		// Extension
		JTextField extensionIndicator = new JTextField("ON", 4);
		extensionIndicator.setForeground(new Color(85, 107, 47));
		extensionIndicator.setBackground(new Color(0, 255, 0));
		extensionIndicator.setEditable(false);

		JButton extensionToggle = new JButton("Toggle");
		extensionToggle
				.setToolTipText("Toggle file extensions in the URL List.");
		extensionToggle.setEnabled(true);
		extensionToggle.setPreferredSize(new Dimension(100, 20));

		// Load Files
		JButton loadFiles = new JButton("Load Files");
		loadFiles.setToolTipText(
				"Open the screen that manages the operations needed to load"
						+ " the input csv files and create a URL List.");
		loadFiles.setEnabled(true); // Default when opening the program
		loadFiles.setPreferredSize(new Dimension(100, 20));

		// Load Binary
		JButton loadBinary = new JButton("Load Binary");
		loadBinary.setToolTipText(
				"Open the screen that manages the operations needed to load"
						+ " the input binary file from a previous URL List.");
		loadBinary.setEnabled(true); // Default when opening the program
		loadBinary.setPreferredSize(new Dimension(100, 20));

		JFrame frame = new JFrame();
		JPanel panel = new JPanel();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		GroupLayout layout = new GroupLayout(panel);
		panel.setLayout(layout);

		GroupLayout.ParallelGroup hGroup = layout
				.createParallelGroup(Alignment.LEADING);

		hGroup.addGroup(layout.createSequentialGroup()
				.addGroup(layout.createParallelGroup()
						.addComponent(programStatus).addComponent(extension))
				.addGroup(layout.createParallelGroup()
						.addComponent(statusIndicator)
						.addComponent(extensionIndicator))
				.addGroup(layout.createParallelGroup()
						.addComponent(extensionToggle))
				.addGroup(layout.createParallelGroup().addComponent(loadFiles)
						.addComponent(loadBinary)));
		layout.setHorizontalGroup(hGroup);
		layout.linkSize(SwingConstants.HORIZONTAL, loadBinary, loadFiles,
				statusIndicator, extensionIndicator, extensionToggle);

		// Vertical
		GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
		vGroup.addGroup(layout.createParallelGroup().addComponent(programStatus)
				.addComponent(statusIndicator).addComponent(loadFiles));
		vGroup.addGroup(layout.createParallelGroup().addComponent(extension)
				.addComponent(extensionIndicator).addComponent(extensionToggle)
				.addComponent(loadBinary));
		layout.setVerticalGroup(vGroup);
		layout.linkSize(SwingConstants.VERTICAL, loadBinary, loadFiles,
				statusIndicator, extensionIndicator, extensionToggle);

		// frame.add(panel);

		JPanel panel2 = new JPanel();
		BorderLayout fLayout = new BorderLayout();
		panel2.setLayout(fLayout);
		panel2.add(panel, BorderLayout.NORTH);
		panel2.add(new JLabel("second frame"), BorderLayout.SOUTH);
		frame.add(panel2);
		
		frame.setTitle("<NAME>'s URL List Compare");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(1024, 768);

		frame.setVisible(true);

	}

	/**
	 * @param args
	 */
	public static void
		main(String[] args) {
{'fraction_non_alphanumeric': 0.11334183131506267, 'fraction_numerical': 0.008604206500956023, 'mean_word_length': 4.343359818388195, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '5820128', 'n_tokens_mistral': 3181, 'n_tokens_neox': 2761, 'n_words': 594}