<commit_before>package aguegu.dotmatrix;

import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSlider;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class DotMatrixRecordHeaderPanel extends JPanel
{
	private static final long serialVersionUID = 7530602456593370095L;

	private DotMatrixRecordPanel parent;

	private JSlider sliderBrightness;
	private JSlider sliderSmallSpan;
	private JSlider sliderBigSpan;

	private JCheckBox checkboxUpperLed;
	private JCheckBox checkboxBottomLed;

	private JRadioButton[] radiobuttonModes;

	private CL cl;

	public DotMatrixRecordHeaderPanel(DotMatrixRecordPanel dmrp)
	{
		parent = dmrp;

		this.setLayout(new FlowLayout(FlowLayout.LEFT));
		this.setBorder(new EmptyBorder(new Insets(0, 4, 0, 0)));
		
		JPanel panelMode = new JPanel(new FlowLayout(FlowLayout.LEFT));
		//panelMode.add(new JLabel("Mode:"));
		
		radiobuttonModes = new JRadioButton[3];
		ButtonGroup bgMode = new ButtonGroup();
		int i = 0;
		for (DMMode mode : DMMode.values())
		{
			radiobuttonModes[i] = new JRadioButton("<html><img src=file:"
					+ getClass().getResource(mode.toString().concat(".png"))
							.getPath() + "/></html>");
			radiobuttonModes[i].setActionCommand(mode.toString());
			radiobuttonModes[i].addActionListener(new ActionListenerMode());
			bgMode.add(radiobuttonModes[i]);
			panelMode.add(radiobuttonModes[i]);
			i++;
		}
		panelMode.setAlignmentX(LEFT_ALIGNMENT);

		JPanel panelAttachment = new JPanel(new FlowLayout(FlowLayout.LEFT));
		checkboxUpperLed = new JCheckBox("Upper Led");
		checkboxUpperLed.addActionListener(new ActionListenerAttachment());
		panelAttachment.add(checkboxUpperLed);

		checkboxBottomLed = new JCheckBox("Bottom Led");
		checkboxBottomLed.addActionListener(new ActionListenerAttachment());
		panelAttachment.add(checkboxBottomLed);
		panelAttachment.setAlignmentX(LEFT_ALIGNMENT);
		
		JPanel panelModeAndAttachment = new JPanel();
		panelModeAndAttachment.setLayout(new BoxLayout(panelModeAndAttachment,
				BoxLayout.Y_AXIS));
		panelModeAndAttachment.add(panelMode);
		panelModeAndAttachment.add(panelAttachment);

		cl = new CL();

		sliderBrightness = new JSlider(0, 255, 255);
		sliderBrightness.setMinorTickSpacing(0x20);
		sliderBrightness.setMajorTickSpacing(0x40);
		sliderBrightness.setPaintTicks(true);
		sliderBrightness.setSnapToTicks(true);
		sliderBrightness.addChangeListener(cl);
		sliderBrightness.setAlignmentX(LEFT_ALIGNMENT);

		sliderSmallSpan = new JSlider(0, 65535, 65535);
		sliderSmallSpan.setMinorTickSpacing(0x1000);
		sliderSmallSpan.setSnapToTicks(true);
		sliderSmallSpan.setPaintTicks(true);
		sliderSmallSpan.addChangeListener(cl);
		sliderSmallSpan.setAlignmentX(LEFT_ALIGNMENT);

		sliderBigSpan = new JSlider(0, 65535, 0);
		sliderBigSpan.setMinorTickSpacing(0x1000);
		sliderBigSpan.setSnapToTicks(true);
		sliderBigSpan.setPaintTicks(true);
		sliderBigSpan.addChangeListener(cl);
		sliderBigSpan.setAlignmentX(LEFT_ALIGNMENT);

		JPanel panelSliders = new JPanel();
		panelSliders.setLayout(new BoxLayout(panelSliders, BoxLayout.Y_AXIS));
		panelSliders.add(sliderBrightness);
		panelSliders.add(sliderSmallSpan);
		panelSliders.add(sliderBigSpan);

		this.add(panelModeAndAttachment);
		this.add(panelSliders);
	}

	private class CL implements ChangeListener
	{
		@Override
		public void stateChanged(ChangeEvent e)
		{
			if (e.getSource() instanceof JSlider)
			{<commit_msg>add labels in frame header panel<commit_after>package aguegu.dotmatrix;

import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSlider;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class DotMatrixRecordHeaderPanel extends JPanel
{
	private static final long serialVersionUID = 7530602456593370095L;

	private DotMatrixRecordPanel parent;

	private JSlider sliderBrightness;
	private JSlider sliderSmallSpan;
	private JSlider sliderBigSpan;

	private JCheckBox checkboxUpperLed;
	private JCheckBox checkboxBottomLed;

	private JRadioButton[] radiobuttonModes;

	private CL cl;

	public DotMatrixRecordHeaderPanel(DotMatrixRecordPanel dmrp)
	{
		parent = dmrp;

		this.setLayout(new FlowLayout(FlowLayout.LEFT));
		this.setBorder(new EmptyBorder(new Insets(0, 4, 0, 0)));
		
		JPanel panelMode = new JPanel(new FlowLayout(FlowLayout.LEFT));
		
		radiobuttonModes = new JRadioButton[3];
		ButtonGroup bgMode = new ButtonGroup();
		int i = 0;
		for (DMMode mode : DMMode.values())
		{
			radiobuttonModes[i] = new JRadioButton("<html><img src=file:"
					+ getClass().getResource(mode.toString().concat(".png"))
							.getPath() + "/></html>");
			radiobuttonModes[i].setActionCommand(mode.toString());
			radiobuttonModes[i].addActionListener(new ActionListenerMode());
			bgMode.add(radiobuttonModes[i]);
			panelMode.add(radiobuttonModes[i]);
			i++;
		}
		panelMode.setAlignmentX(LEFT_ALIGNMENT);

		JPanel panelAttachment = new JPanel(new FlowLayout(FlowLayout.LEFT));
		checkboxUpperLed = new JCheckBox("Upper Led");
		checkboxUpperLed.addActionListener(new ActionListenerAttachment());
		panelAttachment.add(checkboxUpperLed);

		checkboxBottomLed = new JCheckBox("Bottom Led");
		checkboxBottomLed.addActionListener(new ActionListenerAttachment());
		panelAttachment.add(checkboxBottomLed);
		panelAttachment.setAlignmentX(LEFT_ALIGNMENT);
		
		JPanel panelModeAndAttachment = new JPanel();
		panelModeAndAttachment.setLayout(new BoxLayout(panelModeAndAttachment,
				BoxLayout.Y_AXIS));
		panelModeAndAttachment.add(new JLabel("Mode:"));
		panelModeAndAttachment.add(panelMode);
		panelModeAndAttachment.add(panelAttachment);

		cl = new CL();

		sliderBrightness = new JSlider(0, 255, 255);
		sliderBrightness.setMinorTickSpacing(0x20);
		sliderBrightness.setMajorTickSpacing(0x40);
		sliderBrightness.setPaintTicks(true);
		sliderBrightness.setSnapToTicks(true);
		sliderBrightness.addChangeListener(cl);
		sliderBrightness.setAlignmentX(LEFT_ALIGNMENT);

		sliderSmallSpan = new JSlider(0, 65535, 65535);
		sliderSmallSpan.setMinorTickSpacing(0x1000);
		sliderSmallSpan.setSnapToTicks(true);
		sliderSmallSpan.setPaintTicks(true);
		sliderSmallSpan.addChangeListener(cl);
		sliderSmallSpan.setAlignmentX(LEFT_ALIGNMENT);

		sliderBigSpan = new JSlider(0, 65535, 0);
		sliderBigSpan.setMinorTickSpacing(0x1000);
		sliderBigSpan.setSnapToTicks(true);
		sliderBigSpan.setPaintTicks(true);
		sliderBigSpan.addChangeListener(cl);
		sliderBigSpan.setAlignmentX(LEFT_ALIGNMENT);

		JPanel panelSliders = new JPanel();
		panelSliders.setLayout(new BoxLayout(panelSliders, BoxLayout.Y_AXIS));
		panelSliders.add(new JLabel("Brightness:"));
		panelSliders.add(sliderBrightness);
		panelSliders.add(new JLabel("Time Span:"));
		panelSliders.add(sliderSmallSpan);
		panelSliders.add(sliderBigSpan);

		this.add(panelModeAndAttachment);
		this.add(panelSliders);
	}

	private class CL implements ChangeListener
	{
		@Override
		public void stateChanged(ChangeEvent e)
		{
			if (e.getSource() instanceof JSlider)
			{
{'fraction_non_alphanumeric': 0.10517286883082608, 'fraction_numerical': 0.01741884402216944, 'mean_word_length': 6.394146341463415, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3430069', 'n_tokens_mistral': 2739, 'n_tokens_neox': 2470, 'n_words': 412}