<commit_before>package view.mvp;

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

/**
 * This passive view just reflects some changes in the model (but those changes are 
 * triggered by its Presenter). It does not respond to user
 * events (so it does not implement ActionListener).
 * @author rbejar
 *
 */
public class StyledTextPassiveView extends JPanel {	
	private JEditorPane editorPane;
	private StyledTextPresenter presenter; 
	

	public StyledTextPassiveView() {
		presenter = new StyledTextPresenter(this);

		setLayout(new BorderLayout());

		editorPane = new JEditorPane();
		editorPane.setEditable(false);
		editorPane.setContentType("text/html");        
		editorPane.setText("None updated");

		JScrollPane editorScrollPane = new JScrollPane(editorPane);
		
		editorScrollPane.setBorder(
				BorderFactory.createCompoundBorder(
						BorderFactory.createTitledBorder("Latest Change"),
						BorderFactory.createEmptyBorder(3,3,3,3)));

		this.add(editorScrollPane, BorderLayout.CENTER);
	}
	
	public StyledTextPresenter getPresenter() { 
		return presenter;
	}
	
	public void setData(String countryName, int countryPopulation) {
		editorPane.setText("<h2><strong>"+countryName+", "+
				countryPopulation+"</strong></h2>");			
	}
}<commit_msg>Some comments added to explain whi StyledTextPassiveView depends on its Presenter<commit_after>package view.mvp;

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

/**
 * This passive view just reflects some changes in the model (but those changes are 
 * triggered by its Presenter). It does not respond to user
 * events (so it does not implement ActionListener).
 * @author rbejar
 * This class depends on StyledTextPresenter, but that is not really necessary.
 * The other passive view (OrderedByPopulationPassiveView) depends on its presenter
 * because it relays it some user action events, and I have chosen to keep the
 * design of both views as similar as possible.
 */
public class StyledTextPassiveView extends JPanel {	
	private JEditorPane editorPane;
	private StyledTextPresenter presenter; 
	

	public StyledTextPassiveView() {
		presenter = new StyledTextPresenter(this);

		setLayout(new BorderLayout());

		editorPane = new JEditorPane();
		editorPane.setEditable(false);
		editorPane.setContentType("text/html");        
		editorPane.setText("None updated");

		JScrollPane editorScrollPane = new JScrollPane(editorPane);
		
		editorScrollPane.setBorder(
				BorderFactory.createCompoundBorder(
						BorderFactory.createTitledBorder("Latest Change"),
						BorderFactory.createEmptyBorder(3,3,3,3)));

		this.add(editorScrollPane, BorderLayout.CENTER);
	}
	

	public StyledTextPresenter getPresenter() {
		return presenter;
	}
	
	public void setData(String countryName, int countryPopulation) {
		editorPane.setText("<h2><strong>"+countryName+", "+
				countryPopulation+"</strong></h2>");			
	}
}
{'fraction_non_alphanumeric': 0.09396671289875173, 'fraction_numerical': 0.004160887656033287, 'mean_word_length': 4.8638211382113825, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '523330', 'n_tokens_mistral': 918, 'n_tokens_neox': 806, 'n_words': 229}