<commit_before>package src.gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.EventQueue;
import java.awt.geom.AffineTransform;
import java.awt.Graphics2D;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.border.EmptyBorder;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import src.Main;

public class Dots extends JFrame implements MouseListener
{
	private JPanel contentPane;
	private BufferedImage img;
	private int clicks;
	private double[][] dotCoords;
	private double scaleFactor = 0.3;

	public Dots() throws IOException
    {
		clicks = 0;
		dotCoords = new double[4][2];
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(0, 0, 1620, 1080);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		// pulls image

		File file = null;
		JFileChooser fileChooser = new JFileChooser();
		FileNameExtensionFilter textFileOnlyFilter = new FileNameExtensionFilter(".jpg", "jpg", "jpg");
		fileChooser.setFileFilter(textFileOnlyFilter);
		int returnVal = fileChooser.showOpenDialog(new JFrame());
		if (returnVal == JFileChooser.APPROVE_OPTION) {
		}
		file = fileChooser.getSelectedFile();
		BufferedImage image = ImageIO.read(file);
		Image resizedImage = image.getScaledInstance((int) (4640 * scaleFactor), (int) (3480 * scaleFactor), Image.SCALE_SMOOTH);

		JLabel lblNewLabel1 = new JLabel(new ImageIcon(resizedImage));

		// 4:3 aspect ratio
		lblNewLabel1.setBounds(
			0,
			0,
			(int) (4640 * scaleFactor),
			(int) (3480 * scaleFactor)
		);
		contentPane.add(lblNewLabel1);
		addMouseListener(this);

		// Create a buffered image with transparency
		BufferedImage biToBeWritten = new BufferedImage(resizedImage.getWidth(null), resizedImage.getHeight(null), BufferedImage.TYPE_INT_ARGB);

		// Draw the image on to the buffered image
		Graphics2D bGr = biToBeWritten.createGraphics();
		bGr.drawImage(resizedImage, 0, 0, null);
		bGr.dispose();
		ImageIO.write(biToBeWritten, "jpg", file);
	}

    // already scales the dot coordinates to native area
	public void mousePressed(MouseEvent e)
    {
		System.out.println("x: " + e.getX());
		System.out.println("y: " + e.getY());

		dotCoords[clicks][0] = (e.getX() * (1 / scaleFactor));
		dotCoords[clicks][1] = (e.getY() * (1 / scaleFactor));
		clicks++;

		if (clicks == 4) {
			Main.updateDotsVars(dotCoords);
			this.dispose();
		}
	}

	// @Override
	// public void mouseClicked(MouseEvent arg0) {
	// 	// TODO Auto-generated method stub
	// }

	// @Override
	// public void mouseEntered(MouseEvent arg0) {
	// 	// TODO Auto-generated method stub
	// }

	// @Override
	// public void mouseExited(MouseEvent arg0) {
	// 	// TODO Auto-generated method stub
	// }

	// @Override
	// public void mouseReleased(MouseEvent arg0) {
	// 	// TODO Auto-generated method stub
	// }
}<commit_msg>uncomment @Override<commit_after>package src.gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.EventQueue;
import java.awt.geom.AffineTransform;
import java.awt.Graphics2D;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.border.EmptyBorder;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import src.Main;

public class Dots extends JFrame implements MouseListener
{
	private JPanel contentPane;
	private BufferedImage img;
	private int clicks;
	private double[][] dotCoords;
	private double scaleFactor = 0.3;

	public Dots() throws IOException
    {
		clicks = 0;
		dotCoords = new double[4][2];
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(0, 0, 1620, 1080);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		// pulls image

		File file = null;
		JFileChooser fileChooser = new JFileChooser();
		FileNameExtensionFilter textFileOnlyFilter = new FileNameExtensionFilter(".jpg", "jpg", "jpg");
		fileChooser.setFileFilter(textFileOnlyFilter);
		int returnVal = fileChooser.showOpenDialog(new JFrame());
		if (returnVal == JFileChooser.APPROVE_OPTION) {
		}
		file = fileChooser.getSelectedFile();
		BufferedImage image = ImageIO.read(file);
		Image resizedImage = image.getScaledInstance((int) (4640 * scaleFactor), (int) (3480 * scaleFactor), Image.SCALE_SMOOTH);

		JLabel lblNewLabel1 = new JLabel(new ImageIcon(resizedImage));

		// 4:3 aspect ratio
		lblNewLabel1.setBounds(
			0,
			0,
			(int) (4640 * scaleFactor),
			(int) (3480 * scaleFactor)
		);
		contentPane.add(lblNewLabel1);
		addMouseListener(this);

		// Create a buffered image with transparency
		BufferedImage biToBeWritten = new BufferedImage(resizedImage.getWidth(null), resizedImage.getHeight(null), BufferedImage.TYPE_INT_ARGB);

		// Draw the image on to the buffered image
		Graphics2D bGr = biToBeWritten.createGraphics();
		bGr.drawImage(resizedImage, 0, 0, null);
		bGr.dispose();
		ImageIO.write(biToBeWritten, "jpg", file);
	}

    // already scales the dot coordinates to native area
	public void mousePressed(MouseEvent e)
    {
		System.out.println("x: " + e.getX());
		System.out.println("y: " + e.getY());

		dotCoords[clicks][0] = (e.getX() * (1 / scaleFactor));
		dotCoords[clicks][1] = (e.getY() * (1 / scaleFactor));
		clicks++;

		if (clicks == 4) {
			Main.updateDotsVars(dotCoords);
			this.dispose();
		}
	}

	@Override
	public void mouseClicked(MouseEvent arg0) {}

	@Override
	public void mouseEntered(MouseEvent arg0) {}

	@Override
	public void mouseExited(MouseEvent arg0) {}

	@Override
	public void mouseReleased(MouseEvent arg0) {}
}
{'fraction_non_alphanumeric': 0.12277743715511956, 'fraction_numerical': 0.016860821581851624, 'mean_word_length': 4.683797909407666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '303922', 'n_tokens_mistral': 2378, 'n_tokens_neox': 2172, 'n_words': 485}