<commit_before>package org.greencubes.patcher;

import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

import org.greencubes.util.I18n;
import org.greencubes.util.Util;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONTokener;

public class Main {
	
	private static boolean silent = true;
	private static JFrame frame = null;
	private static JLabel statusPane = null;
	
	public static void main(String[] args) {
		System.setProperty("awt.useSystemAAFontSettings","on");
		System.setProperty("swing.aatext", "true");
		System.setProperty("java.net.preferIPv4Stack", "true");
		if(args.length < 1)
			throw new IllegalArgumentException("You must specify path to patch file");
		JSONObject patchFile = null;
		File patchF = new File(args[0]);
		FileReader fr = null;
		try {
			fr = new FileReader(patchF);
			patchFile = new JSONObject(new JSONTokener(fr));
		} catch(Exception e) {
			error("Unable to read patch file '" + args[0] + "'!", "", e);
			return;
		} finally {
			Util.close(fr);
		}
		
		silent = patchFile.optBoolean("silent", silent);
		if(!silent) {
			ArrayList<BufferedImage> icons = new ArrayList<BufferedImage>();
			try {
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico32x32.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico48x48.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico64x64.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico128x128.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico256x256.png")));
			} catch(IOException e) {}
			frame = new JFrame("Patcher");
			frame.setIconImages(icons);
			frame.setUndecorated(true);
			frame.setMinimumSize(new Dimension(300, 80));
			frame.setMaximumSize(new Dimension(300, 80));
			final JPanel container;
			frame.add(container = new JPanel() {{
				Dimension d = new Dimension(300, 80);
				setPreferredSize(d);
				setBackground(new Color(71, 87, 85, 255));
				setBorder(BorderFactory.createLineBorder(new Color(35, 61, 58, 255), 1));
				setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
			}});
			frame.pack();
			frame.setLocationRelativeTo(null);
			frame.setVisible(true);<commit_msg>Use main launcher's color scheme<commit_after>package org.greencubes.patcher;

import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;

import org.greencubes.util.I18n;
import org.greencubes.util.Util;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONTokener;

public class Main {
	
	private static boolean silent = true;
	private static JFrame frame = null;
	private static JLabel statusPane = null;
	
	public static void main(String[] args) {
		System.setProperty("awt.useSystemAAFontSettings","on");
		System.setProperty("swing.aatext", "true");
		System.setProperty("java.net.preferIPv4Stack", "true");
		if(args.length < 1)
			throw new IllegalArgumentException("You must specify path to patch file");
		JSONObject patchFile = null;
		File patchF = new File(args[0]);
		FileReader fr = null;
		try {
			fr = new FileReader(patchF);
			patchFile = new JSONObject(new JSONTokener(fr));
		} catch(Exception e) {
			error("Unable to read patch file '" + args[0] + "'!", "", e);
			return;
		} finally {
			Util.close(fr);
		}
		
		silent = patchFile.optBoolean("silent", silent);
		if(!silent) {
			ArrayList<BufferedImage> icons = new ArrayList<BufferedImage>();
			try {
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico32x32.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico48x48.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico64x64.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico128x128.png")));
				icons.add(ImageIO.read(Main.class.getResource("/res/icons/gcico256x256.png")));
			} catch(IOException e) {}
			frame = new JFrame("Patcher");
			frame.setIconImages(icons);
			frame.setUndecorated(true);
			final JPanel container;
			frame.add(container = new JPanel() {{
				Dimension d = new Dimension(400, 100);
				setPreferredSize(d);
				setBackground(new Color(11, 24, 24, 255));
				setBorder(BorderFactory.createLineBorder(new Color(35, 61, 58, 255), 1));
				setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
			}});
			frame.pack();
			frame.setLocationRelativeTo(null);
			frame.setVisible(true);
{'fraction_non_alphanumeric': 0.14200614911606457, 'fraction_numerical': 0.022867025365103766, 'mean_word_length': 4.802675585284281, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '4922073', 'n_tokens_mistral': 1979, 'n_tokens_neox': 1720, 'n_words': 339}