Index: graph_displayer_canvas-event.cc
===================================================================
--- graph_displayer_canvas-event.cc	(revision 48)
+++ graph_displayer_canvas-event.cc	(revision 53)
@@ -1,4 +1,4 @@
-#include <graph_displayer_canvas.h>
-#include <broken_edge.h>
+#include "graph_displayer_canvas.h"
+#include "broken_edge.h"
 #include <math.h>
 
@@ -100,5 +100,5 @@
       active_item=(get_item_at(clicked_x, clicked_y));
       active_node=INVALID;
-      for (NodeIt i(g); i!=INVALID; ++i)
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  if(nodesmap[i]==active_item)
@@ -126,4 +126,6 @@
       if(active_node!=INVALID)
       {
+        mapstorage.modified = true;
+        mapstorage.coords.set(active_node, xy<double>(clicked_x, clicked_y));
 	//new coordinates will be the old values,
 	//because the item will be moved to the
@@ -148,15 +150,15 @@
         EdgeIt ei;
 
-        g.firstOut(ei,active_node);
-
-        for(;ei!=INVALID;g.nextOut(ei))
+        mapstorage.graph.firstOut(ei,active_node);
+
+        for(;ei!=INVALID;mapstorage.graph.nextOut(ei))
         {
             Gnome::Canvas::Points coos;
             double x1, x2, y1, y2;
 
-            nodesmap[g.source(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[mapstorage.graph.source(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            nodesmap[g.target(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[mapstorage.graph.target(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
@@ -177,14 +179,14 @@
         }
 
-        g.firstIn(ei,active_node);
-        for(;ei!=INVALID;g.nextIn(ei))
+        mapstorage.graph.firstIn(ei,active_node);
+        for(;ei!=INVALID;mapstorage.graph.nextIn(ei))
         {
             Gnome::Canvas::Points coos;
             double x1, x2, y1, y2;
 
-            nodesmap[g.source(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[mapstorage.graph.source(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
-            nodesmap[g.target(ei)]->get_bounds(x1, y1, x2, y2);
+            nodesmap[mapstorage.graph.target(ei)]->get_bounds(x1, y1, x2, y2);
             coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
 
@@ -220,7 +222,9 @@
       break;
     case GDK_BUTTON_PRESS:
+      mapstorage.modified = true;
+
       isbutton=1;
 
-      active_node=NodeIt(g,g.addNode());
+      active_node=NodeIt(mapstorage.graph,mapstorage.graph.addNode());
 
       //initiating values corresponding to new node in maps
@@ -228,5 +232,10 @@
       window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
 
-      nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph, clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
+      mapstorage.coords.set(active_node, xy<double>(clicked_x, clicked_y));
+      (*mapstorage.nodemap_storage["id"])[active_node] =
+        mapstorage.graph.id(active_node);
+
+      nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
+        clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
       active_item=(Gnome::Canvas::Item *)(nodesmap[active_node]);
       *(nodesmap[active_node]) << Gnome::Canvas::Properties::fill_color("red");
@@ -234,8 +243,10 @@
       (nodesmap[active_node])->show();
 
-      nodetextmap[active_node]=new Gnome::Canvas::Text(displayed_graph, clicked_x+node_property_defaults[N_RADIUS]+5, clicked_y+node_property_defaults[N_RADIUS]+5, "");
+      nodetextmap[active_node]=new Gnome::Canvas::Text(displayed_graph,
+        clicked_x+node_property_defaults[N_RADIUS]+5,
+        clicked_y+node_property_defaults[N_RADIUS]+5, "");
       nodetextmap[active_node]->property_fill_color().set_value("darkblue");
 
-      mapwin->updateNode(active_node);
+      mapwin.updateNode(active_node);
 
       break;
@@ -301,5 +312,5 @@
 	      active_item=(get_item_at(clicked_x, clicked_y));
 	      active_node=INVALID;
-	      for (NodeIt i(g); i!=INVALID; ++i)
+	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 		{
 		  if(nodesmap[i]==active_item)
@@ -330,5 +341,5 @@
 	      target_item=(get_item_at(clicked_x, clicked_y));
 	      Graph::NodeIt target_node=INVALID;
-	      for (NodeIt i(g); i!=INVALID; ++i)
+	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 		{
 		  if(nodesmap[i]==target_item)
@@ -342,11 +353,14 @@
 		  if(target_node!=active_node)		
 		    {
+          mapstorage.modified = true;
+
 		      *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red");
 
 		      //creating new edge
-		      active_edge=EdgeIt(g,g.addEdge(active_node, target_node));
+		      active_edge=EdgeIt(mapstorage.graph,mapstorage.graph.addEdge(active_node, target_node));
 
 		      //initiating values corresponding to new edge in maps
 		      mapstorage.initMapsForEdge(active_edge);
+                      (*mapstorage.edgemap_storage["id"])[active_edge] = mapstorage.graph.id(active_edge);
 	  
 		      //calculating coordinates of new edge
@@ -377,5 +391,5 @@
 
 		      //updating its properties
-		      mapwin->updateEdge(active_edge);
+		      mapwin.updateEdge(active_edge);
 		    }
 		  else
@@ -430,7 +444,6 @@
       active_node=INVALID;
       active_edge=INVALID;
-
       //was it a node?
-      for (NodeIt i(g); i!=INVALID; ++i)
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  if(nodesmap[i]==active_item)
@@ -442,5 +455,5 @@
       if(active_node==INVALID)
 	{
-	  for (EdgeIt i(g); i!=INVALID; ++i)
+	  for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	    {
 	      if(edgesmap[i]==active_item)
@@ -468,4 +481,5 @@
 	      if(active_node!=INVALID)
 		{
+                  mapstorage.modified = true;
 
 		  //collecting edges to delete
@@ -473,12 +487,12 @@
 		  std::set<Graph::Edge> edges_to_delete;
 
-		  g.firstOut(e,active_node);
-		  for(;e!=INVALID;g.nextOut(e))
+		  mapstorage.graph.firstOut(e,active_node);
+		  for(;e!=INVALID;mapstorage.graph.nextOut(e))
 		    {
 		      edges_to_delete.insert(e);
 		    }
 
-		  g.firstIn(e,active_node);
-		  for(;e!=INVALID;g.nextIn(e))
+		  mapstorage.graph.firstIn(e,active_node);
+		  for(;e!=INVALID;mapstorage.graph.nextIn(e))
 		    {
 		      edges_to_delete.insert(e);
@@ -546,5 +560,5 @@
 	    //find the activated item between texts
 	    active_item=(get_item_at(e->button.x, e->button.y));
-	    for (EdgeIt i(g); i!=INVALID; ++i)
+	    for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	      {
 		if(edgetextmap[i]==active_item)
@@ -560,5 +574,5 @@
 		active_item=(get_item_at(clicked_x, clicked_y));
 
-		for (EdgeIt i(g); i!=INVALID; ++i)
+		for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 		  {
 		    //at the same time only one can be active
@@ -664,5 +678,5 @@
 	    //find the activated item between texts
 	    active_item=(get_item_at(e->button.x, e->button.y));
-	    for (NodeIt i(g); i!=INVALID; ++i)
+	    for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 	      {
 		//at the same time only one can be active
@@ -679,5 +693,5 @@
 		active_item=(get_item_at(clicked_x, clicked_y));
 
-		for (NodeIt i(g); i!=INVALID; ++i)
+		for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 		  {
 		    //at the same time only one can be active
@@ -804,10 +818,10 @@
 			edgetextmap[active_edge]->property_text().set_value(ostr.str());
 			(*(mapstorage.edgemap_storage)[edgemap_to_edit])[active_edge]=mapvalue_d;
-			mapwin->updateEdge(active_edge);
+			mapwin.updateEdge(active_edge);
 			break;
 		      case NODE_MAP_EDIT:
 			nodetextmap[active_node]->property_text().set_value(ostr.str());
 			(*(mapstorage.nodemap_storage)[nodemap_to_edit])[active_node]=mapvalue_d;
-			mapwin->updateNode(active_node);
+			mapwin.updateNode(active_node);
 			break;
 		      default:
@@ -836,5 +850,5 @@
   delete(nodetextmap[node_to_delete]);
   delete(nodesmap[node_to_delete]);
-  g.erase(node_to_delete);
+  mapstorage.graph.erase(node_to_delete);
 }
 
@@ -843,5 +857,5 @@
   delete(edgetextmap[edge_to_delete]);
   delete(edgesmap[edge_to_delete]);
-  g.erase(edge_to_delete);
+  mapstorage.graph.erase(edge_to_delete);
 }
 
@@ -850,5 +864,5 @@
   delete(edgetextmap[edge_to_delete]);
   delete(edgesmap[edge_to_delete]);
-  g.erase(edge_to_delete);
+  mapstorage.graph.erase(edge_to_delete);
 }
 
@@ -870,5 +884,5 @@
       else
 	{
-	  for (EdgeIt i(g); i!=INVALID; ++i)
+	  for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	    {
 	      if(edgesmap[i]==active_bre)
@@ -896,5 +910,5 @@
 {
   //create the new map
-  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (g,default_value);
+  Graph::EdgeMap<double> * emptr=new Graph::EdgeMap<double> (mapstorage.graph, default_value);
 
   //if addition was not successful addEdgeMap returns one.
@@ -907,5 +921,5 @@
 
   //add it to the list of the displayable maps
-  mapwin->registerNewEdgeMap(mapname);
+  mapwin.registerNewEdgeMap(mapname);
 
   //display it
@@ -918,5 +932,5 @@
 {
   //create the new map
-  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (g,default_value);
+  Graph::NodeMap<double> * emptr=new Graph::NodeMap<double> (mapstorage.graph,default_value);
 
   //if addition was not successful addNodeMap returns one.
@@ -928,5 +942,5 @@
 
   //add it to the list of the displayable maps
-  mapwin->registerNewNodeMap(mapname);
+  mapwin.registerNewNodeMap(mapname);
 
   //display it
