<commit_before>/**
 * 
 */
package fr.onagui.gui;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.util.Set;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;

/**
 * @author <NAME>
 */
public class LexicalisationPanel extends JPanel {
	
	/** To make Java happy */
	private static final long serialVersionUID = 6375338505045030509L;
	
	private JTextArea prefLabels= null;
	private JTextArea altLabels= null;
	private JTextArea fragURI=null;
	
	public static final String EMPTY_LABEL = Messages.getString("LexicalisationPanel.NoInfoLabel"); //$NON-NLS-1$
	private static final int COLUMN_WIDTH = 5;
	
	public LexicalisationPanel() {
		prefLabels = new JTextArea(EMPTY_LABEL, 2, COLUMN_WIDTH);
		altLabels = new JTextArea(EMPTY_LABEL, 5, COLUMN_WIDTH);
		fragURI = new JTextArea(EMPTY_LABEL, 1, COLUMN_WIDTH);
		prefLabels.setEditable(false);
		altLabels.setEditable(false);
		fragURI.setEditable(false);
		prefLabels.setLineWrap(true);
		altLabels.setLineWrap(true);
		fragURI.setLineWrap(true);
		JScrollPane prefLabelScrollPane = new JScrollPane(prefLabels);
		JScrollPane altLabelScrollPane = new JScrollPane(altLabels);
		JScrollPane fragURIScrollPane = new JScrollPane(fragURI);
		prefLabelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		altLabelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		fragURIScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		
		setLayout(new GridLayout(3,1));
		JPanel fragPanel = new JPanel(new BorderLayout());
		fragPanel.add(new JLabel("FragURI:"), BorderLayout.NORTH); //$NON-NLS-1$
		fragPanel.add(fragURI, BorderLayout.CENTER);
		JPanel prefPanel = new JPanel(new BorderLayout());
		prefPanel.add(new JLabel("PrefLabels:"), BorderLayout.NORTH); //$NON-NLS-1$
		prefPanel.add(prefLabels, BorderLayout.CENTER);
		JPanel altPanel = new JPanel(new BorderLayout());
		altPanel.add(new JLabel("AltLabels:"), BorderLayout.NORTH); //$NON-NLS-1$
		altPanel.add(altLabels, BorderLayout.CENTER);
		add(fragPanel);
		add(prefPanel);
		add(altPanel);
		
		setBorder(new TitledBorder(Messages.getString("LexicalisationPanel.LexiconPanelMainTitle"))); //$NON-NLS-1$
	}
	
	/**
	 * @param fragURI the fragURI to set
	 */
	void setFragURI(String fragURI) {
		if(fragURI == null) this.fragURI.setText(EMPTY_LABEL);
		else this.fragURI.setText(fragURI);
	}

	private void setLabelsToPanel(JTextArea labelPan, Set<String> labels) {
		if(labels == null || labels.isEmpty()) labelPan.setText(EMPTY_LABEL);<commit_msg>Modification des libellés dans la partie lexique<commit_after>/**
 * 
 */
package fr.onagui.gui;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.util.Set;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;

/**
 * @author <NAME>
 */
public class LexicalisationPanel extends JPanel {
	
	/** To make Java happy */
	private static final long serialVersionUID = 6375338505045030509L;
	
	private JTextArea prefLabels= null;
	private JTextArea altLabels= null;
	private JTextArea fragURI=null;
	
	public static final String EMPTY_LABEL = Messages.getString("LexicalisationPanel.NoInfoLabel"); //$NON-NLS-1$
	private static final int COLUMN_WIDTH = 5;
	
	public LexicalisationPanel() {
		prefLabels = new JTextArea(EMPTY_LABEL, 2, COLUMN_WIDTH);
		altLabels = new JTextArea(EMPTY_LABEL, 5, COLUMN_WIDTH);
		fragURI = new JTextArea(EMPTY_LABEL, 1, COLUMN_WIDTH);
		prefLabels.setEditable(false);
		altLabels.setEditable(false);
		fragURI.setEditable(false);
		prefLabels.setLineWrap(true);
		altLabels.setLineWrap(true);
		fragURI.setLineWrap(true);
		JScrollPane prefLabelScrollPane = new JScrollPane(prefLabels);
		JScrollPane altLabelScrollPane = new JScrollPane(altLabels);
		JScrollPane fragURIScrollPane = new JScrollPane(fragURI);
		prefLabelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		altLabelScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		fragURIScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		
		setLayout(new GridLayout(3,1));
		JPanel fragPanel = new JPanel(new BorderLayout());
		fragPanel.add(new JLabel("URI fragment:"), BorderLayout.NORTH); //$NON-NLS-1$
		fragPanel.add(fragURI, BorderLayout.CENTER);
		JPanel prefPanel = new JPanel(new BorderLayout());
		prefPanel.add(new JLabel("Libellés préférentiels:"), BorderLayout.NORTH); //$NON-NLS-1$
		prefPanel.add(prefLabels, BorderLayout.CENTER);
		JPanel altPanel = new JPanel(new BorderLayout());
		altPanel.add(new JLabel("Synomymes:"), BorderLayout.NORTH); //$NON-NLS-1$
		altPanel.add(altLabels, BorderLayout.CENTER);
		
		add(prefPanel);
		add(altPanel);
		add(fragPanel);
		
		setBorder(new TitledBorder(Messages.getString("LexicalisationPanel.LexiconPanelMainTitle"))); //$NON-NLS-1$
	}
	
	/**
	 * @param fragURI the fragURI to set
	 */
	void setFragURI(String fragURI) {
		if(fragURI == null) this.fragURI.setText(EMPTY_LABEL);
		else this.fragURI.setText(fragURI);
	}

	private void setLabelsToPanel(JTextArea labelPan, Set<String> labels) {
		if(labels == null || labels.isEmpty()) labelPan.setText(EMPTY_LABEL);
{'fraction_non_alphanumeric': 0.11635278761887004, 'fraction_numerical': 0.011187768040275966, 'mean_word_length': 5.948186528497409, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7054403', 'n_tokens_mistral': 1951, 'n_tokens_neox': 1808, 'n_words': 333}