public ClassroomPanel(DataStore ds) {

		super();
		this.cp = this;
		this.dataStore = ds;
		this.classrooms = dataStore.getClassrooms();
		this.treenodes = new HashMap<ClassType, DefaultMutableTreeNode>();
		
		this.addComponentListener(new ComponentAdapter() {
			
			public void componentShown(ComponentEvent e) {
				initializeTree();
			}
			
			public void componentHidden(ComponentEvent e)	{
				dataStore.setClassrooms(classrooms);
			}
		});
		
		this.setLayout(new GridLayout(0, 1, 0, 0));
		
		this.splitPane = new JSplitPane();
		add(splitPane);
		
		this.tree = new JTree();
		this.scrollPane = new JScrollPane(tree);
		splitPane.setLeftComponent(this.scrollPane);
		
		this.panel = new JPanel();
		panel.setBorder(new EmptyBorder(23, 23, 23, 23));
		splitPane.setRightComponent(panel);
		
		panel.setLayout(new GridLayout(7, 2, 46, 16));
		
		JLabel label_1 = new JLabel("");
		panel.add(label_1);
		
		JLabel label = new JLabel("");
		panel.add(label);
		
		JLabel lblNom = new JLabel("Nom");
		lblNom.setHorizontalAlignment(SwingConstants.RIGHT);
		panel.add(lblNom);
		
		this.tfName = new JTextField();
		tfName.setHorizontalAlignment(SwingConstants.LEFT);
		tfName.addInputMethodListener(new InputMethodListener() {
			
			@Override
			public void inputMethodTextChanged(InputMethodEvent event) {
				checkEnableBtn();
			}

			@Override
			public void caretPositionChanged(InputMethodEvent event) {}
		});
		panel.add(tfName);
		tfName.setColumns(10);
		
		JLabel lblType = new JLabel("Type");
		lblType.setHorizontalAlignment(SwingConstants.RIGHT);
		panel.add(lblType);
		
		this.cbType = new JComboBox();
		panel.add(cbType);
		
		JLabel lblEffectif = new JLabel("Effectif");
		lblEffectif.setHorizontalAlignment(SwingConstants.RIGHT);
		panel.add(lblEffectif);
		
		spEff = new JSpinner();
		spEff.setModel(new SpinnerNumberModel(new Integer(0), new Integer(0), null, new Integer(1)));
		spEff.addChangeListener(new ChangeListener() {
			
			@Override
			public void stateChanged(ChangeEvent e) {
				checkEnableBtn();
			}
		});
		panel.add(spEff);
		
		this.btnPosition = new JButton("Position");
		btnPosition.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				try	{
					new PositionFrame(ImageIO.read(new File("img/Plan Campus.jpg")), cp);
				} catch(Exception e){
					e.printStackTrace();
				}
				checkEnableBtn();
			}
		});
		panel.add(btnPosition);
		
		this.btnAjouter = new JButton("Ajouter");
		btnAjouter.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				String name = tfName.getText();
				ClassType type = (ClassType)cbType.getSelectedItem();
				int eff = (Integer)spEff.getValue();
				//System.out.println("ClassroomPanel.btnAjouter() : " + name + " " + type + " " + eff + " " + position);
				Classroom cr = new Classroom(type, name, eff, position);
				classrooms.add(cr);
				
				DefaultMutableTreeNode root = (DefaultMutableTreeNode) tree.getModel().getRoot();
				root = (DefaultMutableTreeNode) root.getChildAt(root.getIndex(treenodes.get(type)));
				
				DefaultMutableTreeNode node = new DefaultMutableTreeNode(cr.getName());
				root.insert(node, root.getChildCount());
				
				tree = new JTree((DefaultMutableTreeNode)tree.getModel().getRoot());
				tree.setRootVisible(false);
				tree.makeVisible(new TreePath(node.getPath()));
				
				scrollPane = new JScrollPane(tree);
				splitPane.setLeftComponent(scrollPane);
				splitPane.setDividerLocation(0.25);
				//On redimensione la fenêtre, ça permet (va savoir pourquoi) d'actualiser 
				//l'affichage du JTree et de faire apparraître le nouveau node.
//				setSize(getSize().width + 1, getSize().height);
//				setSize(getSize().width - 1, getSize().height);
				
				position = null;
				tfName.setText("");
				cbType.setSelectedIndex(-1);
				spEff.setValue(0);
				checkEnableBtn();
			}
		});
		
		
		
		panel.add(btnAjouter);
		
		btnPreview = new JButton("Preview");
		btnPreview.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JFrame fr = new JFrame();
				fr.add(new MapPanel(classrooms));
				fr.pack();
				fr.setVisible(true);
				checkEnableBtn();
			}
		});
		panel.add(btnPreview);
		this.initializeTree();
		this.checkEnableBtn();
	}