@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		MainView main = MainView.getMain();
		HouseModel m =  main.getMaison();
		MemoryAction hg= new MemoryAction();

		ModificationView.getCaracView();
		musicController = MainView.getMusicController();
		RepresentationView viewRep =(RepresentationView)MainView.getRep();
		RoomModel p = HouseModel.
		getPieceWhereNom(CaracteristicView.nomPiece);

		if (arg0.getActionCommand().equals("Validate")){

			if (p != null) 
			{

				if (!CaracteristicView.nomPiece.equals(CaracteristicView.lblNom.getText()))
				{
					if (HouseModel.getPieceWhereNom(CaracteristicView.lblNom.getText()) == null){
						hg.enregistrerHouse(p,"Name",CaracteristicView.nomPiece ,CaracteristicView.lblNom.getText() );

						p.setNom(CaracteristicView.lblNom.getText() );
						musicController.changeRoomName(CaracteristicView.nomPiece,
								CaracteristicView.lblNom.getText() );
						viewRep.deleteRoom(CaracteristicView.nomPiece);
						viewRep.addRoom(CaracteristicView.lblNom.getText());
						CaracteristicView.lblNom.setText("-"); 
					}
					else JOptionPane.showMessageDialog(null,
					"This name already exists");
				}

				int lastTemp = p.getTemperature();
				p.setTemperature((Integer)CaracteristicView.s.getValue());
				if (lastTemp != (Integer)CaracteristicView.s.getValue())
				{ 
					hg.enregistrerHouse(p,"Temperature", lastTemp,(Integer)CaracteristicView.s.getValue() );
				}
			}
			else 
				JOptionPane.showMessageDialog(null,
				"No rooms selected");


			ModificationView.getRoomView().update();
		}
		else if(arg0.getActionCommand().equals("Previous")){
			hg.mag.getLastAction();
		}
		else if (arg0.getActionCommand().equals("ALL")){
			CaracteristicView.btnValider.setText("Validate all");
			CaracteristicView.lblNom.setText("General");

		}
		else if (arg0.getActionCommand().equals("Validate all")){
			if (HouseModel.pieceList.size() == 0) JOptionPane.showMessageDialog(null,
			"No rooms in the house");
			else m.appliquerPartout();
		}

	}