<commit_before>package bridgeconstructor;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 * L'interface Graphique est construite à partir de cette classe
 *
 */
public class GraphicInterface extends JFrame implements ActionListener {

	private static final long serialVersionUID = 1L;
	
	private static String title = "Bridge Constructor";
	
	// Layout
	private GridLayout grid_layout;
	private BoxLayout box_layout;
	// Panel
	private JPanel choose_panel;
	private JPanel down_panel;
	private JPanel main_panel;
	// Traffic Box
	private JCheckBox naval_box;
	private JCheckBox railway_box;
	private JCheckBox pedestrian_box;
	private JCheckBox road_box;
	// Risques Météorologiques Box
	private JCheckBox storm_box;
	private JCheckBox fire_box;
	private JCheckBox flood_box;
	// Bouton
	private JButton button;
	
	public GraphicInterface() {
		super(title);
		buildComposants();
		buildInterface();
		buildEvents();
		
		this.setResizable(true);
		this.setLocationRelativeTo(null);
		this.pack();
		this.setVisible(true);
	}
	
	private void buildComposants() {
		// Layout
		grid_layout = new GridLayout(4, 4);
		box_layout = new BoxLayout(main_panel, BoxLayout.X_AXIS);
		choose_panel = new JPanel();
		down_panel = new JPanel();
		main_panel = new JPanel();
		
			
		// Traffic box
		naval_box = new JCheckBox("Traffic Naval");
		railway_box = new JCheckBox("Traffic Ferroviaire");
		pedestrian_box = new JCheckBox("Traffic Piéton");
		road_box = new JCheckBox("Traffic Routier");
		// Risques Météorologies Box
		storm_box =  new JCheckBox("Tempête");
		fire_box = new JCheckBox("Incendie");
		flood_box = new JCheckBox("Inondation");
		
		// Bouton
		button = new JButton("Tout est fait !");
	}
	
	private void buildInterface() {
		choose_panel.setLayout(grid_layout);
			choose_panel.add(naval_box);
			choose_panel.add(railway_box);
			choose_panel.add(pedestrian_box);
			choose_panel.add(road_box);
			choose_panel.add(storm_box);
			choose_panel.add(fire_box);
			choose_panel.add(flood_box);
			
		down_panel.add(button);
		
		main_panel.add(choose_panel);
		main_panel.add(down_panel);
		
		this.setContentPane(main_panel);
	}
	
	private void buildEvents() {
		this.naval_box.addActionListener(this);<commit_msg>12h06 : Vendredi 16 Octobre<commit_after>package bridgeconstructor;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * L'interface Graphique est construite à partir de cette classe
 *
 */
public class GraphicInterface extends JFrame implements ActionListener {

	private static final long serialVersionUID = 1L;
	
	private static String title = "Bridge Constructor";
	
	// Layout
	private GridLayout grid_layout;
	private BoxLayout box_layout;
	// Panel
	private JPanel up_panel;
	private JPanel center_panel;
	private JPanel down_panel;
	private Container main_panel;
	// Label
	private JLabel order;
	// Traffic Box
	private JCheckBox naval_box;
	private JCheckBox railway_box;
	private JCheckBox pedestrian_box;
	private JCheckBox road_box;
	// Risques Météorologiques Box
	private JCheckBox storm_box;
	private JCheckBox fire_box;
	private JCheckBox flood_box;
	// Bouton
	private JButton button;
	
	public GraphicInterface() {
		super(title);
		buildComposants();
		buildInterface();
		buildEvents();
		
		this.setResizable(true);
		this.setLocationRelativeTo(null);
		this.pack();
		this.setVisible(true);
	}
	
	private void buildComposants() {
		// Layout
		grid_layout = new GridLayout(4, 4);
		box_layout = new BoxLayout(main_panel, BoxLayout.Y_AXIS);
		
		// Panel
		up_panel = new JPanel();
		center_panel = new JPanel();
		down_panel = new JPanel();
		// Label
		order = new JLabel("Veuillez sélectionner les caractéristiques de l'environnement");
		// Traffic box
		naval_box = new JCheckBox("Traffic Naval");
		railway_box = new JCheckBox("Traffic Ferroviaire");
		pedestrian_box = new JCheckBox("Traffic Piéton");
		road_box = new JCheckBox("Traffic Routier");
		// Risques Météorologies Box
		storm_box =  new JCheckBox("Tempête");
		fire_box = new JCheckBox("Incendie");
		flood_box = new JCheckBox("Inondation");
		
		// Bouton
		button = new JButton("Tout est fait !");
	}
	
	private void buildInterface() {
		up_panel.add(order);
		
		center_panel.setLayout(grid_layout);
			center_panel.add(naval_box);
			center_panel.add(railway_box);
			center_panel.add(pedestrian_box);
			center_panel.add(road_box);
			center_panel.add(storm_box);
			center_panel.add(fire_box);
			center_panel.add(flood_box);
			center_panel.add(Box.createRigidArea(new Dimension(0, 5)));
			center_panel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
			
		down_panel.add(button);

		//Put everything together, using the content pane's BorderLayout.
		main_panel = getContentPane();
		main_panel.add(up_panel, BorderLayout.PAGE_START);
		main_panel.add(center_panel, BorderLayout.CENTER);
		main_panel.add(down_panel, BorderLayout.PAGE_END);
		
		this.setContentPane(main_panel);
	}
	
	private void buildEvents() {
		this.naval_box.addActionListener(this);
{'fraction_non_alphanumeric': 0.10173741715923339, 'fraction_numerical': 0.003940533763209744, 'mean_word_length': 4.8045738045738045, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1358924', 'n_tokens_mistral': 2035, 'n_tokens_neox': 1829, 'n_words': 410}