]> AND Private Git Repository - blast.git/blobdiff - SourceItem.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
finished conn mode of library
[blast.git] / SourceItem.cpp
index 89413b0de8c01a08cd15c273afd239d4a7d9bba7..0229e7f2d7117972b752f9cd0ba83883c940693e 100644 (file)
@@ -30,7 +30,7 @@ SourceItem::SourceItem(AbstractBlock *_refBlock,
   setZValue(100);
   setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges);
 
   setZValue(100);
   setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemSendsGeometryChanges);
 
-  initInterfaceItems();
+  createInterfaceItems();
   updateGeometry(InterfaceMove);
   resetInterfaceItemsPosition();
   QPointF initPos = QPointF(0.0,0.0) - originPoint;
   updateGeometry(InterfaceMove);
   resetInterfaceItemsPosition();
   QPointF initPos = QPointF(0.0,0.0) - originPoint;
@@ -315,7 +315,7 @@ void SourceItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
 
   int mode = getScene()->getEditionMode();
 
 
   int mode = getScene()->getEditionMode();
 
-  dispatcher->setCurrentGroupWidget(getScene()->getGroupWidget());
+  dispatcher->setCurrentGroupWidget(Dispatcher::Design, getScene()->getGroupWidget());
 
   if ((mode == GroupScene::AddConnection) && (params->cursorState == Parameters::CursorOnInterface)) {
     InterfaceItem *inter = getInterfaceItemFromCursor(x,y);
 
   if ((mode == GroupScene::AddConnection) && (params->cursorState == Parameters::CursorOnInterface)) {
     InterfaceItem *inter = getInterfaceItemFromCursor(x,y);
@@ -389,7 +389,7 @@ void SourceItem::mouseReleaseEvent(QGraphicsSceneMouseEvent  *event) {
     else if (params->editState == Parameters::EditCloseConnection) {
       InterfaceItem* iface1 = getScene()->getSelectedInterface(1);
       InterfaceItem* iface2 = getScene()->getSelectedInterface(2);
     else if (params->editState == Parameters::EditCloseConnection) {
       InterfaceItem* iface1 = getScene()->getSelectedInterface(1);
       InterfaceItem* iface2 = getScene()->getSelectedInterface(2);
-      bool ok = dispatcher->createConnection(iface1,iface2);
+      bool ok = dispatcher->createConnection(Dispatcher::Design, iface1,iface2);
       if (ok) {
         iface1->selected = false;
         update(iface1->boundingRect());
       if (ok) {
         iface1->selected = false;
         update(iface1->boundingRect());
@@ -539,27 +539,27 @@ void SourceItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
   if(selectedAction == NULL) return ;
 
   if (selectedAction == removeAction) {    
   if(selectedAction == NULL) return ;
 
   if (selectedAction == removeAction) {    
-    dispatcher->removeSourceItem(this);    
+    dispatcher->removeSourceItem(Dispatcher::Design, this);
   }
   else if (selectedAction == duplicateAction) {
   }
   else if (selectedAction == duplicateAction) {
-    dispatcher->duplicateSourceItem(this);
+    dispatcher->duplicateSourceItem(Dispatcher::Design, this);
   }
   else if(selectedAction == renameAction){
     if(ifaceItem != NULL) {
   }
   else if(selectedAction == renameAction){
     if(ifaceItem != NULL) {
-      dispatcher->renameInterface(ifaceItem);
+      dispatcher->renameInterface(Dispatcher::Design, ifaceItem);
     }
     else {      
     }
     else {      
-      dispatcher->renameSourceBlock(this);      
+      dispatcher->renameSourceBlock(Dispatcher::Design, this);
     }   
   }
   else if(selectedAction == showProperties){
     }   
   }
   else if(selectedAction == showProperties){
-    dispatcher->showProperties(ifaceItem);
+    dispatcher->showProperties(Dispatcher::Design, ifaceItem);
   }  
   else if(selectedAction == showParameters){
     new ParametersWindow(refBlock, params, NULL);
   }      
   else if(selectedAction == showPatterns) {
   }  
   else if(selectedAction == showParameters){
     new ParametersWindow(refBlock, params, NULL);
   }      
   else if(selectedAction == showPatterns) {
-    dispatcher->showPatterns(ifaceItem);
+    dispatcher->showPatterns(Dispatcher::Design, ifaceItem);
   }
 }
 
   }
 }
 
@@ -679,7 +679,7 @@ void SourceItem::load(QDomElement funcElement) throw(Exception) {
   }
   
   // creating InterfaceItem
   }
   
   // creating InterfaceItem
-  initInterfaceItems();
+  createInterfaceItems();
   // setting them with saved values
   for(int i=0; i<interfaceNodes.length(); i++){
 
   // setting them with saved values
   for(int i=0; i<interfaceNodes.length(); i++){