<commit_before>package dr.app.bss;

import jam.panels.OptionsPanel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;

import dr.app.gui.components.RealNumberField;

/**
 * @author <NAME>
 * @version $Id$
 */
public class ClockRateModelEditor {

	// Data
	private PartitionDataList dataList = null;
	private int row;

	// Settings
	private OptionsPanel optionPanel;
	private JComboBox<String> clockCombo;
	private RealNumberField[] clockParameterFields;
	
	// Buttons
	private JButton done;
	private JButton cancel;

	// Window
	private JDialog window;
	private Frame owner;

	public ClockRateModelEditor(PartitionDataList dataList, int row) {

		this.dataList = dataList;
		this.row = row;

		clockParameterFields = new RealNumberField[PartitionData.clockParameterNames.length];
		window = new JDialog(owner, "Setup clock rate model for partition "
				+ (row + 1));
		optionPanel = new OptionsPanel(12, 12, SwingConstants.CENTER);

		clockCombo = new JComboBox<String>();
		clockCombo.setOpaque(false);

		for (String clockModel : PartitionData.clockModels) {
			clockCombo.addItem(clockModel);
		}// END: fill loop

		clockCombo.addItemListener(new ListenClockCombo());

		for (int i = 0; i < PartitionData.clockParameterNames.length; i++) {
			
			switch (i) {

			case 0:// clockrate
				clockParameterFields[i] = new RealNumberField(0.0, Double.MAX_VALUE);
				break;

			case 1: // ucld.mean
				clockParameterFields[i] = new RealNumberField(-Double.MAX_VALUE, Double.MAX_VALUE);
				break;

			case 2:// ucld.stdev
				clockParameterFields[i] = new RealNumberField(0.0, Double.MAX_VALUE);
				break;

			case 3: // ucld.offset
				clockParameterFields[i] = new RealNumberField(-Double.MAX_VALUE, Double.MAX_VALUE);
				break;

			case 4: // uced.mean<commit_msg>Removing a Java 7 thing (generics in Swing).<commit_after>package dr.app.bss;

import jam.panels.OptionsPanel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;

import dr.app.gui.components.RealNumberField;

/**
 * @author <NAME>
 * @version $Id$
 */
public class ClockRateModelEditor {

	// Data
	private PartitionDataList dataList = null;
	private int row;

	// Settings
	private OptionsPanel optionPanel;
	private JComboBox clockCombo;
	private RealNumberField[] clockParameterFields;
	
	// Buttons
	private JButton done;
	private JButton cancel;

	// Window
	private JDialog window;
	private Frame owner;

	public ClockRateModelEditor(PartitionDataList dataList, int row) {

		this.dataList = dataList;
		this.row = row;

		clockParameterFields = new RealNumberField[PartitionData.clockParameterNames.length];
		window = new JDialog(owner, "Setup clock rate model for partition "
				+ (row + 1));
		optionPanel = new OptionsPanel(12, 12, SwingConstants.CENTER);

		clockCombo = new JComboBox();
		clockCombo.setOpaque(false);

		for (String clockModel : PartitionData.clockModels) {
			clockCombo.addItem(clockModel);
		}// END: fill loop

		clockCombo.addItemListener(new ListenClockCombo());

		for (int i = 0; i < PartitionData.clockParameterNames.length; i++) {
			
			switch (i) {

			case 0:// clockrate
				clockParameterFields[i] = new RealNumberField(0.0, Double.MAX_VALUE);
				break;

			case 1: // ucld.mean
				clockParameterFields[i] = new RealNumberField(-Double.MAX_VALUE, Double.MAX_VALUE);
				break;

			case 2:// ucld.stdev
				clockParameterFields[i] = new RealNumberField(0.0, Double.MAX_VALUE);
				break;

			case 3: // ucld.offset
				clockParameterFields[i] = new RealNumberField(-Double.MAX_VALUE, Double.MAX_VALUE);
				break;

			case 4: // uced.mean
{'fraction_non_alphanumeric': 0.10806488462417181, 'fraction_numerical': 0.007082476582133882, 'mean_word_length': 4.345543345543345, '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': '963491', 'n_tokens_mistral': 1537, 'n_tokens_neox': 1379, 'n_words': 328}