<commit_before>package Vue;

import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import Modles.Panneau;

/**
 * Estimate maker java application with GUI. 
 * This class read the .xml file for create the materials tabs
 * Info: JDOM (Java Document Object Model)
 *
 * @author <NAME>, <NAME>
 * @version 1.0
 */
public class JDOM {
	
	int j = 0;
	
	/**
	 * Default Constructor of the class JDOM
	 * Read the xml file and send the information to the class Panneau
	 * To create the materials radio buttons
	 **/
	public JDOM() {
		
		//Etape 1 : rcupration d'une instance de la classe "DocumentBuilderFactory" 
		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

		try {
			//Etape 2 : cration d'un parseur 
			final DocumentBuilder builder = factory.newDocumentBuilder();
			//Etape 3 : cration d'un Document
			final Document document = builder.parse(new File("fichiers/panneau.xml"));

			/* Affiche du prologue
			System.out.println("*************PROLOGUE************");
			System.out.println("version : " + document.getXmlVersion());
			System.out.println("encodage : " + document.getXmlEncoding());*/

			
			 //Etape 4 : rcupration de l'Element racine
			final Element racine = document.getDocumentElement();

			/* Affichage de l'lment racine : panneau
			System.out.println("\n*************RACINE************");
			System.out.println(racine.getNodeName());*/

			//Etape 5 : rcupration des panneaus comportant les diffrents boutons radio
			final NodeList racineNoeuds = racine.getChildNodes();
			final int nbRacineNoeuds = racineNoeuds.getLength();

			for (int i = 0; i < nbRacineNoeuds; i++) 
			{
				if (racineNoeuds.item(i).getNodeType() == Node.ELEMENT_NODE) 
				{
					final Element panneau = (Element) racineNoeuds.item(i);

					/* Affichage d'un onglet
					System.out.println("\n*************ONGLET************");
					System.out.println("onglet : "+ panneau.getAttribute("type"));
					System.out.println("mat : "+
					panneau.getAttribute("bouton"));*/
					Panneau p = new Panneau(panneau.getAttribute("type"));
					Materiaux.AddOnglet(panneau.getAttribute("type"), p);
					
					//Etape 6 : rcupration des boutons radio
					final NodeList bouton = panneau.getElementsByTagName("bouton");
					final int nbBoutonsElements = bouton.getLength();

					for (int j = 0; j < nbBoutonsElements; j++, this.j++) 
					{

						NodeList nodeListMat = document.getElementsByTagName("matiere");
						Node nodeMatiere = nodeListMat.item(this.j);
						//System.out.println("matiere"+ nodeMatiere.getFirstChild().getNodeValue());

						NodeList nodeListIcon = document.getElementsByTagName("imgChemin");
						Node nodeIcon = nodeListIcon.item(this.j);
						//System.out.println("icon"+ nodeIcon.getFirstChild().getNodeValue());

						NodeList nodeListImg = document.getElementsByTagName("img");
						Node nodeImg = nodeListImg.item(this.j);
						//System.out.println("image"+ nodeImg.getFirstChild().getNodeValue());
						
						NodeList nodeListPrix = document.getElementsByTagName("prix");
						Node nodePrix = nodeListPrix.item(this.j);
						//System.out.println("prix"+ Integer.parseInt(nodeImg.getFirstChild().getNodeValue()));
						
						NodeList nodeListColor = document.getElementsByTagName("color");
						Node nodeColor = nodeListColor.item(this.j);
						//System.out.println("color"+ nodeColor.getFirstChild().getNodeValue());

						// System.out.println(matiere.getTextContent());
						p.AddBoutonPanneau(nodeMatiere.getFirstChild()
								.getNodeValue(), nodeIcon.getFirstChild()
								.getNodeValue(), nodeImg.getFirstChild()
								.getNodeValue(), nbBoutonsElements,Integer.parseInt(nodePrix.getFirstChild()
								.getNodeValue()), nodeColor.getFirstChild().getNodeValue());
					}
				}
			}
		} catch (final ParserConfigurationException e) {
			e.printStackTrace();
		} catch (final SAXException e) {
			e.printStackTrace();<commit_msg>JDOM commente<commit_after>package Vue;

import java.io.File;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import Modles.Panneau;

/**
 * Estimate maker java application with GUI. 
 * This class read the .xml file for create the materials tabs
 * Info: JDOM (Java Document Object Model)
 *
 * @author <NAME>, <NAME>
 * @version 1.0
 */
public class JDOM {
	
	int j = 0;
	
	/**
	 * Default Constructor of the class JDOM
	 * Read the xml file and send the information to the class Panneau
	 * To create the materials radio buttons
	 **/
	public JDOM() {
		
		//rcupration d'une instance de la classe "DocumentBuilderFactory" 
		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

		try {
			//cration d'un parseur 
			final DocumentBuilder builder = factory.newDocumentBuilder();
			//cration d'un Document
			final Document document = builder.parse(new File("fichiers/panneau.xml"));

			//rcupration de l'Element racine
			final Element racine = document.getDocumentElement();


			//rcupration des panneaus comportant les diffrents boutons radio
			final NodeList racineNoeuds = racine.getChildNodes();
			final int nbRacineNoeuds = racineNoeuds.getLength();

			for (int i = 0; i < nbRacineNoeuds; i++) 
			{
				if (racineNoeuds.item(i).getNodeType() == Node.ELEMENT_NODE) 
				{
					final Element panneau = (Element) racineNoeuds.item(i);

					Panneau p = new Panneau(panneau.getAttribute("type"));
					Materiaux.AddOnglet(panneau.getAttribute("type"), p);
					
					//rcupration des boutons radio
					final NodeList bouton = panneau.getElementsByTagName("bouton");
					final int nbBoutonsElements = bouton.getLength();

					for (int j = 0; j < nbBoutonsElements; j++, this.j++) 
					{
						NodeList nodeListMat = document.getElementsByTagName("matiere");
						Node nodeMatiere = nodeListMat.item(this.j);

						NodeList nodeListIcon = document.getElementsByTagName("imgChemin");
						Node nodeIcon = nodeListIcon.item(this.j);

						NodeList nodeListImg = document.getElementsByTagName("img");
						Node nodeImg = nodeListImg.item(this.j);
						
						NodeList nodeListPrix = document.getElementsByTagName("prix");
						Node nodePrix = nodeListPrix.item(this.j);
						
						NodeList nodeListColor = document.getElementsByTagName("color");
						Node nodeColor = nodeListColor.item(this.j);

						p.AddBoutonPanneau(nodeMatiere.getFirstChild()
								.getNodeValue(), nodeIcon.getFirstChild()
								.getNodeValue(), nodeImg.getFirstChild()
								.getNodeValue(), nbBoutonsElements,Integer.parseInt(nodePrix.getFirstChild()
								.getNodeValue()), nodeColor.getFirstChild().getNodeValue());
					}
				}
			}
		} catch (final ParserConfigurationException e) {
			e.printStackTrace();
		} catch (final SAXException e) {
			e.printStackTrace();
{'fraction_non_alphanumeric': 0.12972378727497594, 'fraction_numerical': 0.003298062388346846, 'mean_word_length': 3.829462508294625, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '719842', 'n_tokens_mistral': 2750, 'n_tokens_neox': 2273, 'n_words': 496}