<commit_before>package rapanui.ui;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class ConclusionProcessView extends JPanel {
	private static final long serialVersionUID = 1L;

	public ConclusionProcessView(/* ConclusionProcess conclusion */) {
		initializeContent();
	}

	private void initializeContent() {
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		setOpaque(false);
		setBorder(new CompoundBorder(new EmptyBorder(5,0,5,0),
				new CompoundBorder(new LineBorder(Color.BLACK), new EmptyBorder(5,5,5,5))));

		String shortForm = "R = S;T"; // TODO: remove dummy data

		JPanel header = new JPanel();
		header.setBackground(Color.WHITE);
		header.setLayout(new BoxLayout(header, BoxLayout.X_AXIS));

		JPanel longForm = new JPanel();
		longForm.setOpaque(false);

		JSeparator separator = new JSeparator();

		header.add(new CollapseButton(longForm, separator));
		header.add(new JLabel(shortForm));
		header.add(Box.createHorizontalGlue());
		header.add(new SimpleLink("\u2B06", "Nach oben"));
		header.add(new SimpleLink("\u2B07", "Nach unten"));
		header.add(new SimpleLink("\u27F2", "Letzter Schritt rückgängig"));
		header.add(new SimpleLink("\u2718", "Folgerung entfernen"));

		JLabel initialTerm = ProofEnvironmentPanel.createMathematicalLabel("R ");
		initialTerm.setVerticalAlignment(SwingConstants.TOP);
		initialTerm.setHorizontalAlignment(SwingConstants.RIGHT);
		longForm.add(initialTerm); // TODO: remove dummy data

		JPanel secondColumn = new JPanel();
		secondColumn.setLayout(new BoxLayout(secondColumn, BoxLayout.Y_AXIS));
		secondColumn.setOpaque(false);
		longForm.add(secondColumn);

		JPanel thirdColumn = new JPanel();
		thirdColumn.setLayout(new BoxLayout(thirdColumn, BoxLayout.Y_AXIS));
		thirdColumn.setOpaque(false);
		longForm.add(thirdColumn);

		initialTerm.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
		secondColumn.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
		thirdColumn.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));

		initialTerm.setBorder(new LineBorder(Color.red));
		secondColumn.setBorder(new LineBorder(Color.red));
		thirdColumn.setBorder(new LineBorder(Color.red));

		// TODO: remove dummy data
		String[] steps = new String[] { "= R;I", "= R;(S;T)", "= (R;S);T", "= S;T"};
		String[] reasons = new String[] { "Neutralität von I", "nach Voraussetzung", "Assoziativität", "nach Voraussetzung" };

		for (int i = 0; i < steps.length; ++i) {
			secondColumn.add(ProofEnvironmentPanel.createMathematicalLabel(steps[i]));
			thirdColumn.add(new JLabel("(" + reasons[i] + ")"));
		}

		add(header);
		add(separator);
		add(longForm);
	}
}<commit_msg>revert ConclusionProcessView to GridBagLayout<commit_after>package rapanui.ui;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class ConclusionProcessView extends JPanel {
	private static final long serialVersionUID = 1L;

	private JPanel longForm;

	public ConclusionProcessView(/* ConclusionProcess conclusion */) {
		initializeContent();
	}

	private void initializeContent() {
		setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		setOpaque(false);
		setBorder(new CompoundBorder(new EmptyBorder(5,0,5,0),
				new CompoundBorder(new LineBorder(Color.BLACK), new EmptyBorder(5,5,5,5))));

		String shortForm = "R = S;T"; // TODO: remove dummy data

		JPanel header = new JPanel();
		header.setBackground(Color.WHITE);
		header.setLayout(new BoxLayout(header, BoxLayout.X_AXIS));

		longForm = new JPanel(new GridBagLayout());
		longForm.setOpaque(false);

		JSeparator separator = new JSeparator();

		header.add(new CollapseButton(longForm, separator));
		header.add(ProofEnvironmentPanel.createMathematicalLabel(shortForm));
		header.add(Box.createHorizontalGlue());
		header.add(new SimpleLink("\u2B06", "Nach oben"));
		header.add(new SimpleLink("\u2B07", "Nach unten"));
		header.add(new SimpleLink("\u27F2", "Letzter Schritt rückgängig"));
		header.add(new SimpleLink("\u2718", "Folgerung entfernen"));

		GridBagConstraints c = new GridBagConstraints();
		c.gridx = 0;
		c.gridy = 0;
		c.ipadx = 5;
		c.anchor = GridBagConstraints.EAST;
		c.weightx = 0.3;
		longForm.add(ProofEnvironmentPanel.createMathematicalLabel("R "), c);

		// TODO: remove dummy data
		String[] steps = new String[] { "= R;I", "= R;(S;T)", "= (R;S);T", "= S;T"};
		String[] reasons = new String[] { "Neutralität von I", "nach Voraussetzung", "Assoziativität", "nach Voraussetzung" };

		for (int i = 0; i < steps.length; ++i)
			addTransformation(steps[i], reasons[i]);

		add(header);
		add(separator);
		add(longForm);
	}

	private int line = 0; // TODO: remove and use model data
	private void addTransformation(String transformation, String reason) { // TODO: Transformation as parameter
		GridBagConstraints c = new GridBagConstraints();
		c.ipadx = 5;
		c.gridx = 1;
		c.anchor = GridBagConstraints.WEST;
		c.gridy = line;
		c.weightx = 0.35;
		longForm.add(ProofEnvironmentPanel.createMathematicalLabel(transformation), c);

		c.gridx = 2;
		c.weightx = 0;
		longForm.add(new JLabel("(" + reason + ")"), c);
		line++;
	}
}
{'fraction_non_alphanumeric': 0.1444379732090856, 'fraction_numerical': 0.011454086585129102, 'mean_word_length': 5.384138785625774, 'pattern_counts': {'":': 0, '<': 5, '<?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': '11320', 'n_tokens_mistral': 1881, 'n_tokens_neox': 1711, 'n_words': 357}