graph_displayer_canvas-event.cc
branchgui
changeset 134 82e19031c319
parent 129 2f1a7365839c
child 147 10ef59f6633c
equal deleted inserted replaced
36:bca737593e31 37:a2d27b983062
   329           (*(it->second))[active_node] =
   329           (*(it->second))[active_node] =
   330             (mytab.mapstorage).nodemap_default[it->first];
   330             (mytab.mapstorage).nodemap_default[it->first];
   331         }
   331         }
   332       }
   332       }
   333       // increment the id map's default value
   333       // increment the id map's default value
   334       (mytab.mapstorage).nodemap_default["id"] += 1.0;
   334       (mytab.mapstorage).nodemap_default["label"] += 1.0;
   335 
   335 
   336       nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
   336       nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
   337           clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
   337           clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
   338       active_item=(Gnome::Canvas::Item *)(nodesmap[active_node]);
   338       active_item=(Gnome::Canvas::Item *)(nodesmap[active_node]);
   339       *(nodesmap[active_node]) <<
   339       *(nodesmap[active_node]) <<
   439               {
   439               {
   440                 (*(it->second))[active_edge] =
   440                 (*(it->second))[active_edge] =
   441                   (mytab.mapstorage).edgemap_default[it->first];
   441                   (mytab.mapstorage).edgemap_default[it->first];
   442               }
   442               }
   443               // increment the id map's default value
   443               // increment the id map's default value
   444               (mytab.mapstorage).edgemap_default["id"] += 1.0;
   444               (mytab.mapstorage).edgemap_default["label"] += 1.0;
   445 
   445 
   446               //calculating coordinates of new edge
   446               //calculating coordinates of new edge
   447               Gnome::Canvas::Points coos;
   447               Gnome::Canvas::Points coos;
   448               double x1, x2, y1, y2;
   448               double x1, x2, y1, y2;
   449 
   449 
   671  
   671  
   672           //if it was really an edge...
   672           //if it was really an edge...
   673           if(clicked_edge!=INVALID)
   673           if(clicked_edge!=INVALID)
   674           {
   674           {
   675             // the id map is not editable
   675             // the id map is not editable
   676             if (edgemap_to_edit == "id") return 0;
   676             if (edgemap_to_edit == "label") return 0;
   677 
   677 
   678             //and there is activated map
   678             //and there is activated map
   679             if(edgetextmap[clicked_edge]->property_text().get_value()!="")
   679             if(edgetextmap[clicked_edge]->property_text().get_value()!="")
   680             {
   680             {
   681               //activate the general variable for it
   681               //activate the general variable for it
   759 
   759 
   760           //if it was really a node...
   760           //if it was really a node...
   761           if(clicked_node!=INVALID)
   761           if(clicked_node!=INVALID)
   762           {
   762           {
   763             // the id map is not editable
   763             // the id map is not editable
   764             if (nodemap_to_edit == "id") return 0;
   764             if (nodemap_to_edit == "label") return 0;
   765 
   765 
   766             //and there is activated map
   766             //and there is activated map
   767             if(nodetextmap[clicked_node]->property_text().get_value()!="")
   767             if(nodetextmap[clicked_node]->property_text().get_value()!="")
   768             {
   768             {
   769               //activate the general variable for it
   769               //activate the general variable for it