<commit_before>package org.concord.energy3d.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.net.URL;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.CancellationException;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.SwingWorker;

import org.concord.energy3d.simulation.LocationData;

class GlobalMap extends JDialog {

	private static final long serialVersionUID = 1L;

	private final MapImageView mapImageView;

	public GlobalMap(final JFrame owner) {

		super(owner);
		setTitle("Total Supported Regions: " + (LocationData.getInstance().getCities().length - 1));
		setResizable(false);
		mapImageView = new MapImageViewWithLocations();
		final int m = 1;
		mapImageView.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(m, m, m, m), BorderFactory.createLineBorder(Color.LIGHT_GRAY)));
		mapImageView.setAlignmentX(0.5f);
		mapImageView.setText("Loading...");
		mapImageView.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
		getContentPane().setLayout(new BorderLayout());
		getContentPane().add(mapImageView, BorderLayout.CENTER);
		final JPanel bottomPanel = new JPanel();
		final JButton closeButton = new JButton("Close");
		closeButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(final ActionEvent e) {
				GlobalMap.this.dispose();
			}
		});
		bottomPanel.add(closeButton);
		getContentPane().add(bottomPanel, BorderLayout.SOUTH);

		final Map<String, ArrayList<String>> countries = new TreeMap<String, ArrayList<String>>();
		for (final String s : LocationData.getInstance().getCities()) {
			if (!s.equals("")) {
				final String[] t = s.split(",");
				t[0] = t[0].trim();
				if (t.length == 1) {
					final ArrayList<String> list = new ArrayList<String>();
					list.add(t[0]);
					countries.put(t[0], list);
				} else {
					t[1] = t[1].trim();
					if (t[1].length() == 2) {
						if (!countries.keySet().contains("United States")) {
							countries.put("United States", new ArrayList<String>());
						}
						final ArrayList<String> list = countries.get("United States");
						list.add(s);
					} else {
						if (!countries.keySet().contains((t[1]))) {
							countries.put(t[1], new ArrayList<String>());
						}
						final ArrayList<String> list = countries.get(t[1]);
						list.add(t[0]);
					}
				}
			}
		}

		final JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		getContentPane().add(topPanel, BorderLayout.NORTH);

		final JComboBox<String> regionsComboBox = new JComboBox<String>();
		final JComboBox<String> countriesComboBox = new JComboBox<String>();
		final JLabel regionsLabel = new JLabel("Regions:");
		final ItemListener listener = new ItemListener() {
			@Override
			public void itemStateChanged(final ItemEvent e) {<commit_msg>test for mac<commit_after>package org.concord.energy3d.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.net.URL;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.CancellationException;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.SwingWorker;

import org.concord.energy3d.simulation.LocationData;
import org.concord.energy3d.util.Config;

class GlobalMap extends JDialog {

	private static final long serialVersionUID = 1L;

	private final MapImageView mapImageView;

	public GlobalMap(final JFrame owner) {

		super(owner);
		setTitle("Total Supported Regions: " + (LocationData.getInstance().getCities().length - 1));
		setResizable(false);
		mapImageView = new MapImageViewWithLocations();
		final int m = 1;
		mapImageView.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(m, m, m, m), BorderFactory.createLineBorder(Color.LIGHT_GRAY)));
		mapImageView.setAlignmentX(0.5f);
		mapImageView.setText("Loading...");
		mapImageView.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
		getContentPane().setLayout(new BorderLayout());
		getContentPane().add(mapImageView, BorderLayout.CENTER);
		final JPanel bottomPanel = new JPanel();
		final JButton closeButton = new JButton("Close");
		closeButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(final ActionEvent e) {
				GlobalMap.this.dispose();
			}
		});
		bottomPanel.add(closeButton);
		getContentPane().add(bottomPanel, BorderLayout.SOUTH);

		final Map<String, ArrayList<String>> countries = new TreeMap<String, ArrayList<String>>();
		for (final String s : LocationData.getInstance().getCities()) {
			if (!s.equals("")) {
				final String[] t = s.split(",");
				t[0] = t[0].trim();
				if (t.length == 1) {
					final ArrayList<String> list = new ArrayList<String>();
					list.add(t[0]);
					countries.put(t[0], list);
				} else {
					t[1] = t[1].trim();
					if (t[1].length() == 2) {
						if (!countries.keySet().contains("United States")) {
							countries.put("United States", new ArrayList<String>());
						}
						final ArrayList<String> list = countries.get("United States");
						list.add(s);
					} else {
						if (!countries.keySet().contains((t[1]))) {
							countries.put(t[1], new ArrayList<String>());
						}
						final ArrayList<String> list = countries.get(t[1]);
						list.add(t[0]);
					}
				}
			}
		}

		final JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
		getContentPane().add(topPanel, BorderLayout.NORTH);

		final JComboBox<String> regionsComboBox = new JComboBox<String>();
		final JComboBox<String> countriesComboBox = new JComboBox<String>();
		final JLabel regionsLabel = new JLabel("Regions:");
		if (Config.isMac()) {
			regionsLabel.setFont(new Font(regionsLabel.getFont().getName(), Font.PLAIN, regionsLabel.getFont().getSize() - 2));
			regionsComboBox.setFont(new Font(regionsComboBox.getFont().getName(), Font.PLAIN, regionsComboBox.getFont().getSize() - 2));
			countriesComboBox.setFont(regionsComboBox.getFont());
		}
		final ItemListener listener = new ItemListener() {
			@Override
			public void itemStateChanged(final ItemEvent e) {
{'fraction_non_alphanumeric': 0.13656030286641427, 'fraction_numerical': 0.005813953488372093, 'mean_word_length': 4.833596214511041, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '6811587', 'n_tokens_mistral': 2638, 'n_tokens_neox': 2294, 'n_words': 469}