Index: graph_displayer_canvas-edge.cc
===================================================================
--- graph_displayer_canvas-edge.cc	(revision 201)
+++ graph_displayer_canvas-edge.cc	(revision 204)
@@ -17,7 +17,5 @@
  */
 
-#include <graph_displayer_canvas.h>
-#include <mapstorage.h>
-#include <nbtab.h>
+#include "graph_displayer_canvas.h"
 #include <cmath>
 
@@ -26,41 +24,40 @@
 int GraphDisplayerCanvas::resetEdgeWidth (Edge edge)
 {
-  MapStorage& ms = *mytab.mapstorage;
   double min, max;
 
   min=edge_property_defaults[E_WIDTH];
   max=edge_property_defaults[E_WIDTH];
-  Graph::EdgeMap<double> actual_map(ms.graph,edge_property_defaults[E_WIDTH]);
-
-  if(edge==INVALID)
-  {
-    for (EdgeIt i(ms.graph); i!=INVALID; ++i)
-    {
-      double v=fabs(actual_map[i]);
-      int w;
-      if(min==max)
-      {
-        w=(int)(edge_property_defaults[E_WIDTH]);
-      }
-      else
-      {
-        w=(int)(MIN_EDGE_WIDTH+(v-min)/(max-min)*(MAX_EDGE_WIDTH-MIN_EDGE_WIDTH));
-      }
-      if(zoomtrack)
-      {
-        double actual_ppu=get_pixels_per_unit();
-        w=(int)(w/actual_ppu*fixed_zoom_factor);
-      }
-      edgesmap[i]->setLineWidth(w);
-    }
-  }
-  else
-  {
-    int w=(int)actual_map[edge];
-    if(w>=0)
-    {
-      edgesmap[edge]->setLineWidth(w);
-    }
-  }
+  Graph::EdgeMap<double> actual_map((mytab.mapstorage).graph,edge_property_defaults[E_WIDTH]);
+  
+  if(edge==INVALID)
+    {
+      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
+	{
+	  double v=fabs(actual_map[i]);
+	  int w;
+	  if(min==max)
+	    {
+	      w=(int)(edge_property_defaults[E_WIDTH]);
+	    }
+	  else
+	    {
+	      w=(int)(MIN_EDGE_WIDTH+(v-min)/(max-min)*(MAX_EDGE_WIDTH-MIN_EDGE_WIDTH));
+	    }
+	  if(zoomtrack)
+	    {
+	      double actual_ppu=get_pixels_per_unit();
+	      w=(int)(w/actual_ppu*fixed_zoom_factor);
+	    }
+	  edgesmap[i]->setLineWidth(w);
+	}
+    }
+  else
+    {
+      int w=(int)actual_map[edge];
+      if(w>=0)
+	{
+	  edgesmap[edge]->setLineWidth(w);
+	}
+    }
   return 0;
 }
@@ -69,68 +66,60 @@
 int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge)
 {
-  MapStorage& ms = *mytab.mapstorage;
+  Graph::EdgeMap<double> * actual_map;
   double min, max;
 
-  {
-    EdgeIt e(ms.graph);
-    min = max = ms.get(mapname, e);
-    for (; e != INVALID; ++e)
-    {
-      if (static_cast<double>(ms.get(mapname, e)) > max)
-        max = ms.get(mapname, e);
-      if (static_cast<double>(ms.get(mapname, e)) < min)
-        min = ms.get(mapname, e);
-    }
-  }
-
-  if(edge==INVALID)
-  {
-    for (EdgeIt i(ms.graph); i!=INVALID; ++i)
-    {
-      double v=ms.get(mapname, i);
-      int w;
-      if(autoscale)
-      {
-        if(min==max)
-        {
-          w=(int)(edge_property_defaults[E_WIDTH]);
-        }
-        else
-        {
-          w=(int)(minimum_edge_width+(v-min)/(max-min)*(edge_width-minimum_edge_width));
-        }
-      }
-      else
-      {
-        w=(int)(v*edge_width);
-      }
-      if(w<0)
-      {
-        edgesmap[i]->hide();
-      }
-      else
-      {
-        edgesmap[i]->show();
-        if(w<minimum_edge_width)
-        {
-          w=minimum_edge_width;
-        }
-        if(zoomtrack)
-        {
-          double actual_ppu=get_pixels_per_unit();
-          w=(int)(w/actual_ppu*fixed_zoom_factor);
-        }
-        edgesmap[i]->setLineWidth(w);
-      }
-    }
-  }
-  else
-  {
-    int w=(int)ms.get(mapname, edge);
-    if(w>=0)
-    {
-      edgesmap[edge]->setLineWidth(w);
-    }
-  }
+  min=(mytab.mapstorage).minOfEdgeMap(mapname);
+  max=(mytab.mapstorage).maxOfEdgeMap(mapname);
+  actual_map=((mytab.mapstorage).edgemap_storage)[mapname];
+
+  if(edge==INVALID)
+    {
+      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
+	{
+	  double v=(*actual_map)[i];
+	  int w;
+	  if(autoscale)
+	    {
+	      if(min==max)
+		{
+		  w=(int)(edge_property_defaults[E_WIDTH]);
+		}
+	      else
+		{
+		  w=(int)(minimum_edge_width+(v-min)/(max-min)*(edge_width-minimum_edge_width));
+		}
+	    }
+	  else
+	    {
+	      w=(int)(v*edge_width);
+	    }
+	  if(w<0)
+	    {
+	      edgesmap[i]->hide();
+	    }
+	  else
+	    {
+	      edgesmap[i]->show();
+	      if(w<minimum_edge_width)
+		{
+		  w=minimum_edge_width;
+		}
+	      if(zoomtrack)
+		{
+		  double actual_ppu=get_pixels_per_unit();
+		  w=(int)(w/actual_ppu*fixed_zoom_factor);
+		}
+	      edgesmap[i]->setLineWidth(w);
+	    }
+	}
+    }
+  else
+    {
+      int w=(int)(*actual_map)[edge];
+      if(w>=0)
+	{
+	  edgesmap[edge]->setLineWidth(w);
+	}
+    }
   return 0;
 };
@@ -138,29 +127,21 @@
 int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Edge edge)
 {  
-  MapStorage& ms = *mytab.mapstorage;
 
   //function maps the range of the maximum and
   //the minimum of the nodemap to the range of
   //green in RGB
+  Graph::EdgeMap<double> * actual_map;
+  actual_map=((mytab.mapstorage).edgemap_storage)[mapname];
 
   double max, min;
 
-  {
-    EdgeIt e(ms.graph);
-    min = max = ms.get(mapname, e);
-    for (; e != INVALID; ++e)
-    {
-      if (static_cast<double>(ms.get(mapname, e)) > max)
-        max = ms.get(mapname, e);
-      if (static_cast<double>(ms.get(mapname, e)) < min)
-        min = ms.get(mapname, e);
-    }
-  }
-
-  if(edge==INVALID)
-    {
-      for (EdgeIt i(ms.graph); i!=INVALID; ++i)
-	{
-	  double w=ms.get(mapname, i);
+  max=(mytab.mapstorage).maxOfEdgeMap(mapname);
+  min=(mytab.mapstorage).minOfEdgeMap(mapname);
+
+  if(edge==INVALID)
+    {
+      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
+	{
+	  double w=(*actual_map)[i];
 
 	  Gdk::Color color;
@@ -180,5 +161,5 @@
       Gdk::Color color;
 
-      double w=ms.get(mapname, edge);
+      double w=(*actual_map)[edge];
 
       if(max!=min)
@@ -198,10 +179,9 @@
 int GraphDisplayerCanvas::resetEdgeColor (Edge edge)
 {  
-  MapStorage& ms = *mytab.mapstorage;
 
   //function maps the range of the maximum and
   //the minimum of the nodemap to the range of
   //green in RGB
-  Graph::EdgeMap<double> actual_map(ms.graph,edge_property_defaults[E_COLOR]);
+  Graph::EdgeMap<double> actual_map((mytab.mapstorage).graph,edge_property_defaults[E_COLOR]);
 
   double max, min;
@@ -211,38 +191,38 @@
 
   if(edge==INVALID)
-  {
-    for (EdgeIt i(ms.graph); i!=INVALID; ++i)
-    {
-      double w=actual_map[i];
-
+    {
+      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
+	{
+	  double w=actual_map[i];
+
+	  Gdk::Color color;
+	  if(max!=min)
+	    {
+	      color.set_rgb_p (0, 100*(w-min)/(max-min), 0);
+	    }
+	  else
+	    {
+	      color.set_rgb_p (0, 100, 0);
+	    }
+	  edgesmap[i]->setFillColor(color);
+	}
+    }
+  else
+    {
       Gdk::Color color;
+
+      double w=actual_map[edge];
+
       if(max!=min)
-      {
-        color.set_rgb_p (0, 100*(w-min)/(max-min), 0);
-      }
+	{
+	  color.set_rgb_p (0, 100*(w-min)/(max-min), 0);
+	}
       else
-      {
-        color.set_rgb_p (0, 100, 0);
-      }
-      edgesmap[i]->setFillColor(color);
-    }
-  }
-  else
-  {
-    Gdk::Color color;
-
-    double w=actual_map[edge];
-
-    if(max!=min)
-    {
-      color.set_rgb_p (0, 100*(w-min)/(max-min), 0);
-    }
-    else
-    {
-      color.set_rgb_p (0, 100, 0);
-    }
-
-    edgesmap[edge]->setFillColor(color);
-  }
+	{
+	  color.set_rgb_p (0, 100, 0);
+	}
+
+      edgesmap[edge]->setFillColor(color);
+    }
   return 0;
 };
@@ -250,53 +230,59 @@
 int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Edge edge)
 {
-  MapStorage& ms = *mytab.mapstorage;
-
   //the number in the map will be written on the edge
   //EXCEPT when the name of the map is Default, because
   //in that case empty string will be written, because
   //that is the deleter map
-
-  if(edge==INVALID)
-  {
-    for (EdgeIt i(ms.graph); i!=INVALID; ++i)
-    {
-      edgemap_to_edit=mapname;
-
-      edgetextmap[i]->property_text().set_value(
-          static_cast<std::string>(ms.get(mapname, i)));
-    }
-
-  }
-  else
-  {
-    edgetextmap[edge]->property_text().set_value(
-        static_cast<std::string>(ms.get(mapname, edge)));
-  }
-
-  return 0;
+  
+  if(edge==INVALID)
+    {
+      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
+	{
+	  edgemap_to_edit=mapname;
+	  double number=(*((mytab.mapstorage).edgemap_storage)[mapname])[i];
+	  
+	  std::ostringstream ostr;
+	  ostr << number;
+	  
+// 	  edgetextmap[i]->property_text().set_value(ostr.str());
+	}
+
+    }
+  else
+    {
+	  double number=(*((mytab.mapstorage).edgemap_storage)[mapname])[edge];
+
+	  std::ostringstream ostr;
+	  ostr << number;
+	  
+// 	  edgetextmap[edge]->property_text().set_value(ostr.str());
+    }
+
+  return 0;
+
 };
 
 int GraphDisplayerCanvas::resetEdgeText (Edge edge)
 {
-  MapStorage& ms = *mytab.mapstorage;
-
   //the number in the map will be written on the edge
   //EXCEPT when the name of the map is Default, because
   //in that case empty string will be written, because
   //that is the deleter map
-
-  if(edge==INVALID)
-  {
-    for (EdgeIt i(ms.graph); i!=INVALID; ++i)
-    {
-      edgemap_to_edit="";
-      edgetextmap[i]->property_text().set_value("");
-    }
-  }
-  else
-  {
-    edgetextmap[edge]->property_text().set_value("");
-  }
-
-  return 0;
-};
+  
+  if(edge==INVALID)
+    {
+      for (EdgeIt i((mytab.mapstorage).graph); i!=INVALID; ++i)
+	{
+	  edgemap_to_edit="";
+// 	  edgetextmap[i]->property_text().set_value("");
+	}
+
+    }
+  else
+    {
+//       edgetextmap[edge]->property_text().set_value("");
+    }
+
+  return 0;
+
+};
