Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_about_actions.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_about_actions.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_about_actions.cpp	(revision 32)
@@ -6,5 +6,5 @@
 using namespace morpheo::tools::viewer::graphics;
 
-
+/*about window constructor*/
 void Window::_about(){
   QMessageBox *mess = new QMessageBox(this);
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawAll.cpp	(revision 32)
@@ -13,10 +13,21 @@
   QString t;
  
+  
   if(paint){
+    /*draw the main component*/
     painter.begin(this);
     painter.setPen(Qt::blue);
     painter.drawRect(MARGEX,MARGEY,MARGEX+450,MARGEY+450);
+    
+    Entity *e = p.getEntity();
+    string s;
+    s.append(e->getName());
+    s.append(" : ");
+    s.append(e->getType());
+    painter.setPen(Qt::black);
+    painter.drawText(50,10,500,60,Qt::AlignCenter,QString::fromStdString(s));
+    painter.setPen(Qt::blue);
 
-    
+    /*draw the ports of the main component*/
     for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){
       portX = it->get_x();
@@ -43,8 +54,9 @@
       portX = it->get_x() ;
       portY = it->get_y() ;
-      drawPort(portX + MARGEX,portY+MARGEY,SOUTH,it->getDirection());
+      drawPort(portX + MARGEX,portY+ MARGEY + 20 ,SOUTH,it->getDirection());
 
     }
     
+    /*draw the components inside the main component*/
     if(p.getArchitecture()!=NULL){
       compo = p.getComponent();
@@ -61,11 +73,11 @@
 	  schema=tp.getSchema();
 	  switch(schema){
-	  case 0:
+	  case 0://a basic element
 	    painter.drawRect(posX,posY,tailleX,tailleY);
 	    break;
-	  case 1:
+	  case 1://a combinatoire element
 	    painter.drawEllipse(posX,posY,tailleX,tailleY);
 	    break;  
-	  case 2:
+	  case 2://a FIFO
 	    painter.drawRect(posX,posY,tailleX,tailleY);
 	    painter.drawLine(posX+tailleX/4,posY+tailleY,posX+tailleX/4,posY);
@@ -73,5 +85,5 @@
 	    painter.drawLine(posX+3*tailleX/4,posY+tailleY,posX+3*tailleX/4,posY);
 	    break;
-	  case 3:
+	  case 3://a register
 	    painter.drawRect(posX,posY,tailleX,tailleY);
 	    painter.drawLine(posX,posY+tailleY,posX+tailleX/2,posY+tailleY/2);
@@ -83,6 +95,8 @@
 	if (componentName){
 	  QString compo_name = QString::fromStdString(it->getName());
-	  painter.drawText(posX , posY + tailleY/2,compo_name);
+	  painter.drawText(posX - compo_name.size()/2 , posY + tailleY/2,compo_name);
 	}
+
+	/*draw the ports of the inside components*/
 	Coord *co2=new Coord( co->get_hg_x() + tailleX/2, co->get_hg_y() + tailleY/2,tailleX/2,tailleY/2);
 
@@ -124,4 +138,5 @@
         QList<PortMap> *pm=it->getPortMap();
 	
+	/*draw the signals*/
 	for (QList<PortMap>::iterator it3=pm->begin();it3!=pm->end();++it3) 
 	  {
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawPort.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawPort.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_drawPort.cpp	(revision 32)
@@ -5,4 +5,5 @@
 using namespace morpheo::tools::viewer::graphics;
 
+/*draw the port in rectangular form*/
 void Window::drawPort(int x,int y,int pos,string dir){
     if(pos == NORTH){
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_file_actions.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_file_actions.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_file_actions.cpp	(revision 32)
@@ -9,10 +9,12 @@
 /*signals actions implementation*/
 
+/*open function*/
 void Window::_open(){
   QString current2;
   if(!file_open && is_save){//if no file open or if the file opened has been saved -> open other file, else -> ask for saving file
     current2 = QFileDialog::getOpenFileName(this,"", "./data");
+    this->setDisabled(true);
+    /*if a file has been opened*/
     if(current2!=""){
-      this->setDisabled(true);
       current_name = current2;
       if(parse->open_file( current_name.toStdString(),0)==-1)
@@ -54,10 +56,11 @@
 }
 
+/*initialize the database when a file has been opened*/
 void Window::_init_file(){
   is_save = true;
   base = parse->getBaseV();//parse the base and open the file
-  #ifdef DEBUG_ALL
+  //#ifdef DEBUG_ALL
   base->afficheBaseConsole();
-  #endif
+  //#endif
   cpt_level = 0;
   
@@ -75,8 +78,10 @@
   paint = true;
   repaint();
+  display_param();
   this->setDisabled(false);
   setMouseTracking(true);
 }
 
+/*if user entered a wrong file name*/
 void Window::_open_error(){
   QMessageBox *error = new QMessageBox(this);
@@ -84,18 +89,20 @@
   error->addButton("ok",QMessageBox::YesRole);
   error->show();  
+  this->setDisabled(false);
 }  
 
-
+/*save functions*/
 void Window::_save(){
   if(file_open){
     if (wa_open)
       wa->close();
-    if(save_as || first_save || (current_name==NULL)){//if "save as" or if it's the first time the user click on save (new file) -> save as
+    if(save_as){//if "save as" 
       current_name = QFileDialog::getSaveFileName(this,"","./data");
       save_as = false;
-      first_save = false;
+      parse->save_file(current_name.toStdString(),0);
     }
     else {
-      status->showMessage("file " + current_name + " saved",900);
+      parse->save_file(current.toStdString(),0);
+      status->showMessage("file " + current + " saved",900);
       is_save = true;//file saved
     }
@@ -133,18 +140,20 @@
 }
 
+/*close function*/
 void Window::_close(){
   paint = false;
+  repaint();
   parse->closeBaseV();
-  lname->setText("");
-  ln->setText("");
-  lt->setText("");
-  write_name("");
-  write_comment("");
-  comment->hide();
+  erase_line(ln,lname);
+  erase_line(lt,ltype);
+  erase_comment();
   winfo->show();
+  wscroll->hide();
+  scroll_hide = true;
+  wparam->show();
   file_open = false;
-  repaint();
 }
 
+/*quit functions*/
 void Window::_quit(){
   //if the file is not saved -> ask to the user if he wants to save it. If yes -> save, else quit.
@@ -171,5 +180,5 @@
     _quit2();
 }
-  
+/*close all the windows opened*/
 void Window::_quit2(){
   /*test if there are windows (other than the main window) opened*/
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_informations_window.cpp	(revision 32)
@@ -7,4 +7,5 @@
 using namespace morpheo::tools::viewer::graphics;
 
+/*informations window constructor*/
 void Window::winformations()
 {
@@ -12,7 +13,9 @@
   informations = new QBoxLayout(QBoxLayout::TopToBottom,0);
   winfo->setWindowTitle("informations");
-  winfo->setFixedSize(350,292);
+  winfo->setFixedSize(370,180);
   winfo->move(628,50);
+  
 
+  /*name line*/
   QBoxLayout *bname = new QBoxLayout(QBoxLayout::LeftToRight,0);
   ln = new QLabel();
@@ -23,4 +26,5 @@
   bname->addWidget(lname);
 
+  /*type line*/
   QBoxLayout *btype = new QBoxLayout(QBoxLayout::LeftToRight,0);
   lt = new QLabel();
@@ -30,9 +34,11 @@
   btype->addWidget(lt);
   btype->addWidget(ltype);
-
+  
+  /*comment line*/
   comment = new QLineEdit();
   comment->setText("");
   comment->setReadOnly(true);
 
+  /*buttons*/
   QPushButton *noselect = new QPushButton("cancel selection",wparam);
   QPushButton *back = new QPushButton("back",wparam);
@@ -50,15 +56,30 @@
 }
 
+/*write the comment of the componenet selected*/
 void Window::write_comment(string cm){
   QString c = QString::fromStdString(cm);
   comment->setText(c);
+  comment->setCursorPosition(1);
   comment->show();
 }
 
-void Window::write_name(string name){
-  QString n = QString::fromStdString(name);
-  lname->setText(n);
+void Window::erase_comment(){
+  comment->setText("");
+  comment->hide();
+}
+/*write the name of the component selected*/
+void Window::write_name(string type,string name){
+  QString n = QString::fromStdString(type);
+  ln->setText(n);
+  QString n2 = QString::fromStdString(name);
+  lname->setText(n2);
 }
 
+void Window::erase_line(QLabel *l1, QLabel *l2){
+  l1->setText("");
+  l2->setText("");
+}
+
+/*write the type of the component selected*/
 void Window::write_type(string type){
   lt->setText("type");
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main.cpp	(revision 32)
@@ -16,4 +16,5 @@
 int main (int argc, char* argv[])
 {
+  /*if to many arguments*/
   if(argc>2){
     cout << "error : argument must be a file name or nothing" << endl;
@@ -22,10 +23,11 @@
   }
 
+  /*construct the base*/
   Parse *par = new Parse();
   
-  
+  /*create the window application*/
    QApplication *a=new QApplication (argc,argv);  
    
-  if(argc == 2){
+   if(argc == 2){
      if(par->open_file(argv[1],0)==-1){
 	cout << "file doesn't exist or is not a valid format" << endl;  
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_main_window.cpp	(revision 32)
@@ -16,5 +16,8 @@
   component_clicked = false;
   cpt_level=0;
-  
+  apply_display = false; 
+  scroll_hide = false;
+  parameter_modify = false; 
+
   /*menu bar*/
   QMenuBar *menu_bar = new QMenuBar(this);
@@ -122,5 +125,5 @@
 
   /*main window title*/
-  this->setWindowTitle("Viewer");
+  this->setWindowTitle("Morpheo Viewer");
    
   /*parameters window creation*/
@@ -145,5 +148,4 @@
   /*file unsaved at init*/
   save_as = false;
-  first_save = false; //first_save = true for a new file
   
   current_name = name;
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_mouseEvent.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_mouseEvent.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_mouseEvent.cpp	(revision 32)
@@ -6,4 +6,5 @@
 using namespace morpheo::tools::viewer::graphics;
 
+/*mouse press event handler*/
 void Window::mousePressEvent (QMouseEvent *e){
   if(paint && (p.getArchitecture() != NULL)){
@@ -16,9 +17,10 @@
     mouseY = mouseEvent->y();
     
-    bool bc = false;
+    bool bc,b3 = false;
     int cx,cy,tx,ty;
-    string cc,nc,type;
+    string s2,cc,nc,type,comm;
     bool found = false;
 
+    /*search the component under the mouse focus*/
     for(QList<Component>::iterator it=compo->begin();it!=compo->end();++it){
       Coord *co = it->get_Position();
@@ -28,4 +30,5 @@
       int tailley = co->get_size_y();
       QString t=QString::fromStdString(it->getType()).toLower();
+      /*go to the next level if comoponent doubleclicked*/
       if(e->type() == QMouseEvent::MouseButtonDblClick && e->button() == Qt::LeftButton){
 	
@@ -66,15 +69,12 @@
 	paint = true;
 	repaint();
-	write_name("");
-	write_comment("");
-	write_type("");
-	ln->setText("");
-	lt->setText("");
-	comment->hide();
+     	erase_line(lt,ltype);
+	erase_line(ln,lname);
+	erase_comment();
 	found = false;
 	this->setDisabled(false);
 	component_clicked = false;
       }
-      
+      /*search and display the informations of the component clicked*/
       if(e->type() == QMouseEvent::MouseButtonPress && e->button() == Qt::LeftButton){
 	if(mouseX >= px + MARGEX  && mouseY >= py +MARGEY && mouseX <= px+taillex + MARGEX  && mouseY <= py+tailley + MARGEY) {
@@ -88,20 +88,68 @@
 	  BaseP tp = base->get_BasePos(t.toStdString());
 	  if(&tp != NULL)
-		cc=tp.getComment();
+	    cc=tp.getComment();
 	  component_clicked = true;
+	}
+	
+	for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){
+	  portX = it->get_x();
+	  portY = it->get_y();
+	  if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 +MARGEX && mouseY <= portY + 15 + MARGEY){
+	    b3 = true;
+	    s2 = it->getName();
+	    comm = it->getComment();
+	    type = it->getDirection();
+	  }
+	} 
+   
+	for(QList<Port>::iterator it=port_west.begin(); it!=port_west.end(); ++it){
+	  portX = it->get_x() ;
+	  portY = it->get_y() ;
+	  if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 + MARGEX && mouseY <= portY + 15 + MARGEY){
+	    b3 = true;
+	    s2 = it->getName();
+	    comm = it->getComment();
+	    type = it->getDirection();
+	  }
+	}
+   
+	for(QList<Port>::iterator it=port_north.begin(); it!=port_north.end(); ++it){
+	  portX = it->get_x() ;
+	  portY = it->get_y() ;
+	  if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 +MARGEY && mouseX <= portX + 15 + MARGEX && mouseY <= portY + 15 +MARGEY){
+	    b3 = true;
+	    s2 = it->getName();
+	    type = it->getDirection();
+	    comm = it->getComment();
+	  }
+	}
+   
+	for(QList<Port>::iterator it=port_south.begin(); it!=port_south.end(); ++it){
+	  portX = it->get_x() ;
+	  portY = it->get_y() ;
+	  if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 +MARGEX && mouseY <= portY + 15 + MARGEY){
+	    b3 = true;
+	    s2 = it->getName();
+	    comm = it->getComment();
+	    type = it->getDirection();
+	  }
 	}
       }
     }
     if(bc){
-      write_name(nc);
+      write_name("component",nc);
       write_type(type);
-      ln->setText("component");
-      lt->setText("type");
       write_comment(cc);
+    }
+    if(b3){
+      write_name("signal",s2);
+      write_type(type);
+      write_comment(comm);
+      component_clicked = true;
     }
   }
 }
 
-
+/*mouse move event handler*/
 void Window::mouseMoveEvent(QMouseEvent *e){
   bool b  = false;
@@ -110,130 +158,139 @@
   int px,py,taillex,tailley,ppx,ppy;
   string s,s2,c,type;
-
-   if(paint && (p.getArchitecture() != NULL) && !component_clicked){
-
-    compo = p.getComponent();
-    
-    QMouseEvent *mouseEvent = (QMouseEvent *) e;
-
-    mouseX = mouseEvent->x();
-    mouseY = mouseEvent->y();
-    
-    for(QList<Component>::iterator it=compo->begin();it!=compo->end();++it){
-      Coord *co = it->get_Position();
-      px = co->get_hg_x();
-      py = co->get_hg_y();
-      taillex = co->get_size_x();
-      tailley = co->get_size_y();
-      QString t=QString::fromStdString(it->getType()).toLower();
-      QList<PortMap> *pm=it->getPortMap();
-
-      if(e->type() == QMouseEvent::MouseMove){
-	if(mouseX >= px + MARGEX  && mouseY >= py +MARGEY && mouseX <= px+taillex + MARGEX  && mouseY <= py+tailley + MARGEY) {
-	  b = true;
-	  s = it->getName();
-	  type = it->getType();
-	  BaseP tp=base->get_BasePos(t.toStdString());
-	  if(&tp!=NULL)
-	    c=tp.getComment();
-	  ppx = px;
-	  ppy = py;
-	  break;
-	}
-	else{
-	  for (QList<PortMap>::iterator it3=pm->begin();it3!=pm->end();++it3) {
-	  	Signal *sig=base->getSignal(&p,it->getName(),new PortMap(*it3));
-	  	if(mouseX >= sig->get_src_x() - 15  + MARGEX  && mouseY >= sig->get_src_y() - 15 + MARGEY && mouseX <= sig->get_src_x() + 15  + MARGEX  && mouseY <= sig->get_src_y() + 15 +MARGEY){
-		  b2 = true;
-	  	  s = it3->getName();
-		  break;
-	  	}
-	  }
-	}   
-      }
-    }
-    
-    if(b){
-      write_name(s);
-      write_type(type);
-      ln->setText("component");
-      write_comment(c);
-      lt->setText("type");
-      b3 = false;
-      b2 = false;
-    }
-    
-    if(b2){
-      write_name(s);
-      write_type("");
-      lt->setText("");
-      write_comment("");
-      ln->setText("signal");
-      comment->hide();
-      b3 = false;
-      b = false;
-    }
-
-    if(!b && !b2){
-      write_name("");
-      write_type("");
-      ln->setText("");
-      lt->setText("");
-      write_comment("");
-      comment->hide();
-    }
+  string comm;
+
+   if(paint && !component_clicked){
+     if(p.getArchitecture() != NULL){
+
+       compo = p.getComponent();
+       
+       QMouseEvent *mouseEvent = (QMouseEvent *) e;
+       
+       mouseX = mouseEvent->x();
+       mouseY = mouseEvent->y();
+       
+       /*display the component under the mouse focus*/
+       for(QList<Component>::iterator it=compo->begin();it!=compo->end();++it){
+	 Coord *co = it->get_Position();
+	 px = co->get_hg_x();
+	 py = co->get_hg_y();
+	 taillex = co->get_size_x();
+	 tailley = co->get_size_y();
+	 QString t=QString::fromStdString(it->getType()).toLower();
+	 QList<PortMap> *pm=it->getPortMap();
+	 
+	 if(e->type() == QMouseEvent::MouseMove){
+	   if(mouseX >= px + MARGEX  && mouseY >= py +MARGEY && mouseX <= px+taillex + MARGEX  && mouseY <= py+tailley + MARGEY) {
+	     b = true;
+	     s = it->getName();
+	     type = it->getType();
+	     BaseP tp=base->get_BasePos(t.toStdString());
+	     if(&tp!=NULL)
+	       c=tp.getComment();
+	     ppx = px;
+	     ppy = py;
+	     break;
+	   }
+	   else{
+	     for (QList<PortMap>::iterator it3=pm->begin();it3!=pm->end();++it3) {
+	       Signal *sig=base->getSignal(&p,it->getName(),new PortMap(*it3));
+	       if(mouseX >= sig->get_src_x() - 15  + MARGEX  && mouseY >= sig->get_src_y() - 15 + MARGEY && mouseX <= sig->get_src_x() + 15  + MARGEX  && mouseY <= sig->get_src_y() + 15 +MARGEY){
+		 b2 = true;
+		 s = it3->getName();
+		 break;
+	       }
+	     }
+	   }   
+	 }
+       }
+       
+       if(b){
+	 write_name("component",s);
+	 write_type(type);
+	 write_comment(c);
+	 b3 = false;
+	 b2 = false;
+       }
+     
+       if(b2){
+	 write_name("signal",s);
+	 erase_line(lt,ltype);
+	 erase_comment();
+	 b3 = false;
+	 b = false;
+       }
+     
+       if(!b && !b2){
+	 erase_line(lt,ltype);
+	 erase_line(ln,lname);
+	 erase_comment();
+       }
+     }
+   
+     p=base->get_BasePos(current.toStdString());
+     Entity *ent = p.getEntity();
+     Coord *c = new Coord(250,250,250,250);
+     port_east = ent->getPortEast(c);
+     port_west = ent->getPortWest(c);
+     port_north = ent->getPortNorth(c);
+     port_south = ent->getPortSouth(c);
+
+     /*display the signal under the mouse focus*/
+     for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){
+       portX = it->get_x();
+       portY = it->get_y();
+       if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 +MARGEX && mouseY <= portY + 15 + MARGEY){
+	 b3 = true;
+	 s2 = it->getName();
+	 comm = it->getComment();
+	 type = it->getDirection();
+       }
+     } 
+   
+     for(QList<Port>::iterator it=port_west.begin(); it!=port_west.end(); ++it){
+       portX = it->get_x() ;
+       portY = it->get_y() ;
+       if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 + MARGEX && mouseY <= portY + 15 + MARGEY){
+	 b3 = true;
+	 s2 = it->getName();
+	 comm = it->getComment();
+	 type = it->getDirection();
+       }
+     }
+   
+     for(QList<Port>::iterator it=port_north.begin(); it!=port_north.end(); ++it){
+       portX = it->get_x() ;
+       portY = it->get_y() ;
+       if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 +MARGEY && mouseX <= portX + 15 + MARGEX && mouseY <= portY + 15 +MARGEY){
+	 b3 = true;
+	 s2 = it->getName();
+	 comm = it->getComment();
+	 type = it->getDirection();
+       }
+     }
+   
+     for(QList<Port>::iterator it=port_south.begin(); it!=port_south.end(); ++it){
+       portX = it->get_x() ;
+       portY = it->get_y() ;
+       if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 +MARGEX && mouseY <= portY + 15 + MARGEY){
+	 b3 = true;
+	 s2 = it->getName();
+	 comm = it->getComment();
+	 type = it->getDirection();
+       }
+     }
+     if(b3){
+       b = false;
+       erase_line(ln,lname);
+       write_type(type);
+       erase_comment();
+       write_comment(comm);
+       write_name("signal",s2);
+     }
    }
-  
-  
-   for(QList<Port>::iterator it=port_east.begin(); it!=port_east.end(); ++it){
-      portX = it->get_x();
-      portY = it->get_y();
-      if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 +MARGEX && mouseY <= portY + 15 + MARGEY){
-	b3 = true;
-	s2 = it->getName();
-      }
-   } 
-   
-   for(QList<Port>::iterator it=port_west.begin(); it!=port_west.end(); ++it){
-     portX = it->get_x() ;
-     portY = it->get_y() ;
-     if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 + MARGEX && mouseY <= portY + 15 + MARGEY){
-       b3 = true;
-       s2 = it->getName();
-     }
-   }
-   
-   for(QList<Port>::iterator it=port_north.begin(); it!=port_north.end(); ++it){
-     portX = it->get_x() ;
-     portY = it->get_y() ;
-     if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 +MARGEY && mouseX <= portX + 15 + MARGEX && mouseY <= portY + 15 +MARGEY){
-	b3 = true;
-	s2 = it->getName();
-     }
-   }
-   
-    for(QList<Port>::iterator it=port_south.begin(); it!=port_south.end(); ++it){
-      portX = it->get_x() ;
-      portY = it->get_y() ;
-      if(mouseX >= portX - 15 + MARGEX && mouseY >= portY - 15 + MARGEY && mouseX <= portX + 15 +MARGEX && mouseY <= portY + 15 + MARGEY){
-	b3 = true;
-	s2 = it->getName();
-      }
-    }
-    if(b3){
-      b = false;
-      write_name("");
-      write_name(s2);
-      write_type(type);
-      ln->setText("signal");
-      lt->setText("");
-      write_comment("");
-      comment->hide();
-    }
 }
 
 
-   
- 
+/*return to the previous level if back button has been clicked*/
 void Window::_back(){
   if(cpt_level==0){
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_parameters_window.cpp	(revision 32)
@@ -7,24 +7,279 @@
 using namespace morpheo::tools::viewer::graphics;
 
+/*parameters window constructor*/
 void Window::wparameters()
 {
-  wparam = new QWidget();
+  wparam = new QMainWindow();
+  //  wparam = new QWidget();
   parameters = new QBoxLayout(QBoxLayout::TopToBottom,0);
   wparam->setWindowTitle("parameters");
-  wparam->setFixedSize(350,300);
-  wparam->move(628,370);
-
-  
-  QPushButton *apply = new QPushButton("apply",wparam);
-  connect(apply,SIGNAL(clicked()),this,SLOT(_apply()));
-  
-  parameters->addWidget(apply);
-
+  wparam->setFixedSize(370,415);
+  wparam->move(628,255);
   wparam->setLayout(parameters);
+  sc = new QScrollArea(wparam);
+  wscroll = new QWidget();
+  sc->setWidgetResizable(false);
+  sc->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+  sc->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+  sc->setGeometry(2,2,365,410);
   wparam->show();
 }
 
-
+/*display the parameters*/
+void Window::display_param(){
+
+  pbox = new QBoxLayout(QBoxLayout::TopToBottom,0);
+
+  string scpu;
+  string lgroup;
+  string sparam;
+  string ecart;
+  
+  if(!apply_display){
+    QPushButton *apply = new QPushButton("apply",wparam);
+    connect(apply,SIGNAL(clicked()),this,SLOT(_apply()));
+    apply->setFixedSize(310,25); 
+    pbox->addWidget(apply);
+    apply_display = true;
+  }
+  
+  /*top level name display*/
+  QLabel *cpu = new QLabel();
+  scpu.append("CPU : ");
+  scpu.append(parse->getTopLevelName());
+  scpu.append(" \n");
+  cpu ->setText(QString::fromStdString(scpu));
+  cpu->setFixedSize(300,50);
+  pbox->addWidget(cpu);
+  
+   /*architecture in tree view display*/
+   group = base->getGroups();
+   for(QList<Group>::iterator it=group->begin();it!=group->end();++it){
+   QLabel *lg = new QLabel();
+   lgroup = "";
+   lg->setFixedSize(200,30);
+   ecart = "";
+   if(it->getLevel() == 1)
+     ecart.append("     ");
+   if(it->getLevel() == 2)
+     ecart.append("        ");
+   if(it->getLevel() == 3)
+     ecart.append("          ");
+   if(it->getLevel() == 4)
+     ecart.append("            ");
+    if(it->getLevel() == 5)
+      ecart.append("              ");
+    lgroup.append(ecart);
+    lgroup.append("<");
+    lgroup.append(it->getName());
+    lgroup.append(">");
+    lg->setText(QString::fromStdString(lgroup));
+    pbox->addWidget(lg);
+    param = it->getParam();
+    for(QList<Param>::iterator it2=param.begin();it2!=param.end();++it2){
+
+      if(it2->getName() == "id"){
+	QBoxLayout *b = new QBoxLayout(QBoxLayout::LeftToRight,0);
+	QLabel *l = new QLabel();
+	QString st2 = "   ";
+	QString st;
+	st2.append(QString::fromStdString(ecart));
+	st2.append("nb_");
+	st2.append(QString::fromStdString(it->getName()));
+
+	st.append("nb_");
+	st.append(QString::fromStdString(it->getName()));
+	LimitParam lp = base->searchLimitParam(st.toStdString());
+
+	QLabel *lab = new QLabel();
+	QString s = "   ";
+	s.append(QString::fromStdString(ecart));
+	s.append(QString::fromStdString(it2->getName()));
+	s.append(" : ");
+	stringstream out;
+	string str;
+	out << it2->getValue();
+	str = out.str();
+	s.append(QString::fromStdString(str));
+	lab->setText(s);
+	pbox->addWidget(lab);
+	l->setText(st2);
+	QSpinBox *spin = new QSpinBox();
+	int min = lp.getMin();
+	int max = lp.getMax();
+	QString step = QString::fromStdString(lp.getStep());
+	
+	spin->setValue(base->nbGroup(it->getName()));
+	
+	if(step.contains("+")){
+	  step = step.right(step.length()-1);
+	  int pas = step.toInt(0,10);
+	  spin->setMinimum(min);
+	  spin->setMaximum(max);
+	  spin->setSingleStep(pas);
+	}
+      
+	if(step.contains("*")){
+	  step = step.right(step.length()-1);
+	  int pas = step.toInt(0,10);
+	  spin->setMinimum(min);
+	  spin->setMaximum(max);
+	  spin->setSingleStep(pas);
+	}
+	spin->setFixedSize(60,30);
+
+	QString name_obj = (QString::fromStdString(it->getName()));
+	spin->setObjectName(name_obj);
+
+	b->addWidget(l);
+	b->addWidget(spin);
+	pbox->addLayout(b);
+
+	connect(spin,SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int)));
+
+      }
+      else{
+	QBoxLayout *b = new QBoxLayout(QBoxLayout::LeftToRight,0);
+	QLabel *l = new QLabel();
+	sparam ="   ";
+	sparam.append(ecart);
+	sparam.append(it2->getName());
+	sparam.append(" : ");
+	stringstream out;
+	string str;
+	out << it2->getValue();
+	str = out.str();
+	sparam.append(str);
+	l->setText(QString::fromStdString(sparam));
+	l->setFixedSize(200,30);
+	parameters->addWidget(l);
+	QComboBox *cb = new QComboBox();
+	LimitParam lp = base->searchLimitParam(it2->getName());
+	int min = lp.getMin();
+	int max = lp.getMax();
+	QString step = QString::fromStdString(lp.getStep());
+	int value = min;
+	if(step.contains("+")){
+	  step = step.right(step.length()-1);
+	  int pas = step.toInt(0,10);
+	  while(value!=max+pas){
+	    stringstream out2;
+	    string str2;
+	    out2 << value;
+	    str2 = out2.str();
+	    cb->addItem(QString::fromStdString(str2));
+	    value = value+pas;
+	  }
+	}
+	if(step.contains("*")){
+	  step = step.right(step.length()-1);
+	  int pas = step.toInt(0,10);
+	  while(value!=max*pas){
+	    stringstream out2;
+	    string str2;
+	    out2 << value;
+	    str2 = out2.str();
+	    cb->addItem(QString::fromStdString(str2));
+	    value = value*pas;
+	  }
+	}
+	stringstream out3;
+	string str3;
+	out3 << it2->getValue();
+	str3 = out3.str();
+	int index = cb->findText(QString::fromStdString(str3));
+	cb->setCurrentIndex(index);
+	cb->setFixedSize(60,30);
+	//QPushButton *pb = new QPushButton();
+	//pb->setText("change");
+	QString name_obj = (QString::fromStdString(it->getName()));
+	name_obj.append(":");
+	name_obj.append( QString::fromStdString(it2->getName()));
+	name_obj.append(":");
+	name_obj.append(cb->currentText());
+	cb->setObjectName(name_obj);
+	//cb->setFixedSize(60,30);
+	QString new_value = cb->currentText();
+	connect(cb,SIGNAL(currentIndexChanged(QString)),this,SLOT(currentIndexChanged(QString)));
+	//connect(pb,SIGNAL(clicked()),this,SLOT(_change_value()));
+	b->addWidget(l);
+	b->addWidget(cb);
+	//b->addWidget(pb);
+	pbox->addLayout(b);
+      }
+    }
+   }
+  
+  wscroll->setLayout(pbox);
+  parameters->addWidget(wscroll);
+  sc->setWidget(wscroll);
+  if(scroll_hide){
+    scroll_hide = false;
+    wscroll->show();
+  }
+}
+
+void Window::currentIndexChanged(QString value2){
+  //cout << QObject::sender()->objectName().toStdString() << endl;
+  
+  QString obj = QObject::sender()->objectName();
+  
+  int i,j,v;
+  QString param,group,value;
+  i = obj.indexOf(":");
+  group = obj.left(i);
+  //cout << "group : " << group.toStdString() << endl;
+  j = obj.indexOf(":",i+1);
+  value = obj.right(obj.size() - j - 1);
+  v = value2.toInt(0,10);
+  cout << "value : " << v << endl; 
+  param = obj.section(":",1,1);
+  //cout << "param : " << param.toStdString() << endl;
+
+  base->modifyValue(group.toStdString(),param.toStdString(),v);
+  wparam->close();
+  apply_display = false;
+  wparameters();
+  display_param();
+  parameter_modify = true;
+}
+
+
+void Window::valueChanged(int i){
+
+  //cout << QObject::sender()->objectName().toStdString() << endl;
+
+  QString obj = QObject::sender()->objectName();
+  int v,j;
+  //cout << "name : " << obj.toStdString() << endl;
+  v = i;
+  //cout << "value : " << v << endl; 
+  
+  j = base->nbGroup(obj.toStdString());
+  v = v - j;
+  cout << "value : " << v << " " << j<< endl; 
+  if(base->modifyGroup(obj.toStdString(),v)==-1){
+    cout << "error" << endl;
+    exit(1);
+  }
+  wparam->close();
+  apply_display = false;
+  wparameters();
+  parameter_modify = true;
+  display_param();
+  //  base->afficheParamConsole();
+}
+
+/*apply the parameters changes*/
 void Window::_apply(){
-  cout << "apply\n";
-}
+  if(!parameter_modify){
+    QMessageBox *m = new QMessageBox(wparam);
+    m->setText("no parameter changed");
+    m->addButton("ok",QMessageBox::YesRole);
+    m->show();
+  }
+  else{
+    parameter_modify = false;
+    cout << "apply\n";
+  }
+}
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_tools_actions.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_tools_actions.cpp	(revision 30)
+++ trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_tools_actions.cpp	(revision 32)
@@ -6,4 +6,5 @@
 using namespace morpheo::tools::viewer::graphics;
 
+/*zoom functions*/
 void Window::_zoomIn(){
   cout << "zoom in" << endl;
@@ -22,4 +23,5 @@
 }
 
+/*open or close the informations window*/
 void Window::_informations(){
   if(!info_open){//if the informations window is not open, open it,else close it
@@ -33,8 +35,13 @@
 }
 
+/*open or close the parameters window*/
 void Window::_parameters(){//if the parameteres  window is not open, open it,else close it
   if(!param_open){
     this->wparameters();
     param_open = true;
+    if(info_open){
+      apply_display = false;
+      display_param();
+    }
   }
   else{ 
@@ -44,4 +51,5 @@
 }
 
+/*display or hide the components name*/
 void Window::_component_name(){
 
@@ -54,4 +62,5 @@
 }
 
+/*display or hide the signals name*/
 void Window::_signal_name(){
 
Index: trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_window_actions.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Tools/Viewer/Graphics/src/Graphics_window_actions.cpp	(revision 30)
+++ 	(revision )
@@ -1,249 +1,0 @@
-#include "window.h"
-
-using namespace std;
-using namespace morpheo::tools::viewer::parser;
-using namespace morpheo::tools::viewer::bdd;
-using namespace morpheo::tools::viewer::graphics;
-
-
-/*signals actions implementation*/
-
-void Window::_open(){
-  //if no file open or if the file opened has been saved -> open other file, else -> ask for saving file
-  if(!file_open || is_save){
-    wo = new QWidget();
-    wo_open = true; //the "open" window is open
-    if(wa_open)
-      wa->close();
-    QBoxLayout *open_box = new QBoxLayout(QBoxLayout::TopToBottom,0);
-    wo->setWindowTitle("open : file name");
-    wo->setFixedSize(500,500);
-    wo->move(50,100);
-    QDirModel *dir = new QDirModel();
-    QTreeView *tree = new QTreeView(wo);
-    tree->resize(400,400);
-    tree->setModel(dir);
-    tree->setRootIndex(dir->index("./data/"));
-    file_name = new QLineEdit(wo);
-    file_name->setText("data/");
-    QPushButton *ok_open = new QPushButton("ok",wo);
-    connect(ok_open,SIGNAL(clicked()),this,SLOT(_open_end()));
-    open_box->addWidget(tree);
-    open_box->addWidget(file_name);
-    open_box->addWidget(ok_open);
-    wo->setLayout(open_box);
-    wo->show();
-  }
-  else{
-    wa_open = true;
-    file_open = false;
-    wa = new QWidget();
-    QBoxLayout *other_box = new QBoxLayout(QBoxLayout::LeftToRight,0);
-    wa->setFixedSize(500,60);
-    wa->move(50,100);
-    QLabel *label = new QLabel("do you want to save this file?");
-    QPushButton *yes_save = new QPushButton("yes",wa);
-    QPushButton *no_save = new QPushButton("no",wa);
-    if(current_name!=NULL)
-      connect(yes_save,SIGNAL(clicked()),this,SLOT(_save()));
-    else 
-      connect(yes_save,SIGNAL(clicked()),this,SLOT(_saveAs()));
-    connect(no_save,SIGNAL(clicked()),this,SLOT(_open()));
-    other_box->addWidget(label);
-    other_box->addWidget(yes_save);
-    other_box->addWidget(no_save);
-    wa->setLayout(other_box);
-    wa->show();
-  }
-}
-
-
-void Window::_open_end(){
-  current_name=file_name->text();
-  wo->close();
-  wo_open = false;//the "open" window is now closed
-  if(!is_parse){
-    parse = new Parse();
-    is_parse=true;
-  }
-  if(parse->open_file( current_name.toStdString())==-1)
-    _open_error();
-  else{
-  paint = false;
-  repaint();
-  _init_file();
-  }
-}
-
-void Window::_init_file(){
-  is_save = true;
-  base = parse->getBaseV();//parse the base and open the file
-  base->afficheBaseConsole();
-  file_open = true;
-  QList <BaseP> *liste_compo = base->getBaseP();
-  p = liste_compo->at(0);
-  entity = p.getEntity();
-  c = new Coord(250,250,250,250);
-  port_east = entity->getPortEast(c);
-  port_west = entity->getPortWest(c);
-  port_north = entity->getPortNorth(c);
-  port_south = entity->getPortSouth(c);
-  paint = true;
-  repaint();
-}
-
-void Window::_open_error(){
-  QMessageBox *error = new QMessageBox(this);
-  error->setText("error : file doesn't exist or is not a valid format");
-  error->addButton("ok",QMessageBox::YesRole);
-  error->show();  
-}  
-
-
-void Window::_save(){
-  if (wa_open)
-    wa->close();
-  if(save_as || first_save || (current_name==NULL)){//if "save as" or if it's the first time the user click on save (new file) -> save as
-    ws = new QWidget();
-    ws_open = true;//the "save" window is open
-    QBoxLayout *save_box = new QBoxLayout(QBoxLayout::LeftToRight,0);
-    ws->setWindowTitle("save : file name");
-    ws->setFixedSize(300,60);
-    ws->move(50,100);
-    file_name = new QLineEdit(ws);
-    QPushButton *ok_save = new QPushButton("ok",ws);
-    connect(ok_save,SIGNAL(clicked()),this,SLOT(_saveAsOk()));
-    save_box->addWidget(file_name);
-    save_box->addWidget(ok_save);
-    ws->setLayout(save_box);
-    ws->show();
-    save_as = false;
-    first_save = false;
-  }
-  else {
-    status->showMessage("file " + current_name + " saved",900);
-    is_save = true;//file saved
-  }
-  if(wa_open){
-    wa_open = false;
-    _open();
-  }
-}
-
-void Window::_saveAs(){
-  if (wq_open){//if "quit" window is open, close it
-    wq->close();
-    wq_open = false;
-  }
-  save_as = true;
-  _save();
-}
-
-void Window::_saveAsOk(){
-  current_name = file_name->text();
-  ws->close();//close the "save" window
-  ws_open = false;
-  is_save = true;
-  status->showMessage("file " + current_name + " saved",900);
-  if(wa_open){
-    wa_open = false;
-    _open();
-  }
-  if(quit_demand)//if the user clicked on "quit" (but saved the file just before) -> quit the application
-    _quit2();
-}
-
-void Window::_close(){
-  paint = false;
-  repaint();
-}
-
-void Window::_quit(){
-  //if the file is not saved -> ask to the user if he wants to save it. If yes -> save, else quit.
-  if(file_open && !is_save){
-    wq_open = true;
-    quit_demand = true;
-    wq = new QWidget();
-    QBoxLayout *quit_box = new QBoxLayout(QBoxLayout::LeftToRight,0);
-    wq->setWindowTitle("save : file name");
-    wq->setFixedSize(500,60);
-    wq->move(50,100);
-    QLabel *label = new QLabel("do you want to save this file?");
-    QPushButton *yes_save = new QPushButton("yes",wq);
-    QPushButton *no_save = new QPushButton("no",wq);
-    connect(yes_save,SIGNAL(clicked()),this,SLOT(_saveAs()));
-    connect(no_save,SIGNAL(clicked()),this,SLOT(_quit2()));
-    quit_box->addWidget(label);
-    quit_box->addWidget(yes_save);
-    quit_box->addWidget(no_save);
-    wq->setLayout(quit_box);
-    wq->show();
-  }
-  else
-    _quit2();
-}
-  
-void Window::_quit2(){
-  /*test if there are windows (other than the main window) opened*/
-
-  if(wq_open)
-    wq->close();
-  if(wo_open)
-    wo->close();
-  if(ws_open)
-    ws->close();
-  if(wa_open)
-    wa->close();
-  if(param_open)
-    wparam->close();
-  if(info_open)
-    winfo->close();
-  close();
-}
-
-void Window::_zoomIn(){
-  cout << "zoom in" << endl;
-}
-
-void Window::_zoomOut(){
-  cout << "zoom out" << endl;
-}
-
-void Window::_defautZoom(){
-  cout << "defaut zoom" << endl;
-}
-
-void Window::_level(){
-  cout << "level" <<endl;
-}
-
-void Window::_informations(){
-  if(!info_open){//if the informations window is not open, open it,else close it
-    this->winformations();
-    info_open = true;
-  }
-  else{ 
-    winfo->close();
-    info_open = false;
-  }
-}
-
-void Window::_parameters(){//if the parameteres  window is not open, open it,else close it
-  if(!param_open){
-    this->wparameters();
-    param_open = true;
-  }
-  else{ 
-    wparam->close();
-    param_open = false;
-  }
-}
-
-void Window::_about(){
-  QMessageBox *mess = new QMessageBox(this);
-  mess->setText("Viewer beta 1.0\n\nmade by : \nChou Philippe\nLafaye Michaël\nRosière Mathieu\n\nLip6 - 2007");
-  mess->addButton("ok",QMessageBox::YesRole);
-  mess->show();  
-}
-
-
