Index: gui/Makefile.am
===================================================================
--- gui/Makefile.am	(revision 1605)
+++ gui/Makefile.am	(revision 1606)
@@ -26,5 +26,6 @@
 	broken_edge.h \
 	new_map_win.cc \
-	new_map_win.h
+	new_map_win.h \
+	xymap.h
 
 gd_CXXFLAGS = $(GTK_CFLAGS)
Index: gui/broken_edge.cc
===================================================================
--- gui/broken_edge.cc	(revision 1602)
+++ gui/broken_edge.cc	(revision 1606)
@@ -1,3 +1,3 @@
-#include <broken_edge.h>
+#include "broken_edge.h"
 #include <math.h>
 
Index: gui/broken_edge.h
===================================================================
--- gui/broken_edge.h	(revision 1524)
+++ gui/broken_edge.h	(revision 1606)
@@ -6,8 +6,8 @@
 class BrokenEdge;
 
-#include <all_include.h>
+#include "all_include.h"
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
-#include <graph_displayer_canvas.h>
+#include "graph_displayer_canvas.h"
 #include <lemon/xy.h>
 
Index: gui/graph-displayer.cc
===================================================================
--- gui/graph-displayer.cc	(revision 1512)
+++ gui/graph-displayer.cc	(revision 1606)
@@ -1,5 +1,5 @@
-#include <all_include.h>
-#include <mapstorage.h>
-#include <main_win.h>
+#include "all_include.h"
+#include "mapstorage.h"
+#include "main_win.h"
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -38,48 +38,4 @@
   node_property_defaults[N_TEXT]=0;
 
-  if(argc<2)
-  {
-      std::cerr << "USAGE: gd <input filename.lgf>" << std::endl;
-      return 0;
-  }
-
-  Coordinates coosvector;
-
-  Graph g;
-
-  CoordinatesMap cm(g);
-  Graph::EdgeMap<double> cap(g), map1(g), map2(g), map3(g), map4(g);
-  Graph::NodeMap<double> nodedata (g);
-
-  //we create one object to read x coordinates
-  //and one to read y coordinate of nodes and write them to cm NodeMap.
-  XMap <CoordinatesMap> xreader (cm);
-  YMap <CoordinatesMap> yreader (cm);
-
-  //reading in graph and its maps
-
-  std::ifstream is(argv[1]);
-
-  GraphReader<Graph> reader(is, g);
-  reader.readNodeMap("coordinates_x", xreader);
-  reader.readNodeMap("coordinates_y", yreader);
-  reader.readNodeMap("data", nodedata);
-  reader.readEdgeMap("cap", cap);
-  reader.readEdgeMap("map1", map1);
-  reader.readEdgeMap("map2", map2);
-  reader.readEdgeMap("map3", map3);
-  reader.readEdgeMap("map4", map4);
-  reader.run();
-
-  //initializing MapStorage with the read data
-
-  MapStorage ms(g);
-  ms.addNodeMap("data",&nodedata);
-  ms.addEdgeMap("cap",&cap);
-  ms.addEdgeMap("map1",&map1);
-  ms.addEdgeMap("map2",&map2);
-  ms.addEdgeMap("map3",&map3);
-  ms.addEdgeMap("map4",&map4);
-
   //initializing GUI
 
@@ -87,5 +43,5 @@
   Gtk::Main app(argc, argv);
 
-  MainWin mainwin("Displayed Graph", g, cm, ms);
+  MainWin mainwin("Displayed Graph");
   app.run(mainwin);
 
Index: gui/graph_displayer_canvas-edge.cc
===================================================================
--- gui/graph_displayer_canvas-edge.cc	(revision 1599)
+++ gui/graph_displayer_canvas-edge.cc	(revision 1606)
@@ -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>
 
@@ -13,5 +13,5 @@
       min=edge_property_defaults[E_WIDTH];
       max=edge_property_defaults[E_WIDTH];
-      actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_WIDTH]);
+      actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_WIDTH]);
     }
   else
@@ -24,5 +24,5 @@
   if(edge==INVALID)
     {
-      for (EdgeIt i(g); i!=INVALID; ++i)
+      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  double v=abs((*actual_map)[i]);
@@ -59,5 +59,5 @@
   if(mapname=="Default")
     {
-      actual_map=new Graph::EdgeMap<double>(g,edge_property_defaults[E_COLOR]);
+      actual_map=new Graph::EdgeMap<double>(mapstorage.graph,edge_property_defaults[E_COLOR]);
     }
   else
@@ -81,5 +81,5 @@
   if(edge==INVALID)
     {
-      for (EdgeIt i(g); i!=INVALID; ++i)
+      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  double w=(*actual_map)[i];
@@ -126,5 +126,5 @@
   if(edge==INVALID)
     {
-      for (EdgeIt i(g); i!=INVALID; ++i)
+      for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  if(mapname!="Default")
Index: gui/graph_displayer_canvas-event.cc
===================================================================
--- gui/graph_displayer_canvas-event.cc	(revision 1599)
+++ gui/graph_displayer_canvas-event.cc	(revision 1606)
@@ -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
Index: gui/graph_displayer_canvas-node.cc
===================================================================
--- gui/graph_displayer_canvas-node.cc	(revision 1599)
+++ gui/graph_displayer_canvas-node.cc	(revision 1606)
@@ -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>
 
@@ -12,5 +12,5 @@
       min=node_property_defaults[N_RADIUS];
       max=node_property_defaults[N_RADIUS];
-      actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_RADIUS]);
+      actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_RADIUS]);
     }
   else
@@ -23,5 +23,5 @@
   if(node==INVALID)
     {
-      for (NodeIt i(g); i!=INVALID; ++i)
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  double v=abs((*actual_map)[i]);
@@ -80,5 +80,5 @@
   if(mapname=="Default")
     {
-      actual_map=new Graph::NodeMap<double>(g,node_property_defaults[N_COLOR]);
+      actual_map=new Graph::NodeMap<double>(mapstorage.graph,node_property_defaults[N_COLOR]);
     }
   else
@@ -104,5 +104,5 @@
     {
 
-      for (NodeIt i(g); i!=INVALID; ++i)
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  Gdk::Color color;
@@ -158,5 +158,5 @@
   if(node==INVALID)
     {
-      for (NodeIt i(g); i!=INVALID; ++i)
+      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
 	{
 	  if(mapname!="Default")
Index: gui/graph_displayer_canvas-zoom.cc
===================================================================
--- gui/graph_displayer_canvas-zoom.cc	(revision 1510)
+++ gui/graph_displayer_canvas-zoom.cc	(revision 1606)
@@ -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>
 
Index: gui/graph_displayer_canvas.cc
===================================================================
--- gui/graph_displayer_canvas.cc	(revision 1599)
+++ gui/graph_displayer_canvas.cc	(revision 1606)
@@ -1,33 +1,60 @@
-#include <graph_displayer_canvas.h>
-#include <broken_edge.h>
+#include "graph_displayer_canvas.h"
+#include "broken_edge.h"
 #include <math.h>
 
-GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms, MapWin * mw):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),nodetextmap(g),displayed_graph(*(root()), 0, 0),canvasentrywidget(NULL),mapstorage(ms),isbutton(0),active_item(NULL),target_item(NULL),nodemap_to_edit(""),edgemap_to_edit(""),mapwin(mw)
+GraphDisplayerCanvas::GraphDisplayerCanvas(MapStorage & ms, MapWin & mw) :
+  nodesmap(ms.graph), edgesmap(ms.graph), edgetextmap(ms.graph),
+  nodetextmap(ms.graph), displayed_graph(*(root()), 0, 0),
+  canvasentrywidget(NULL), mapstorage(ms), isbutton(0), active_item(NULL),
+  target_item(NULL), nodemap_to_edit(""), edgemap_to_edit(""), mapwin(mw)
 {
-  
-  //Initializing values.
-  active_node=INVALID;
-  active_edge=INVALID;
-  forming_edge=INVALID;
+  //base event handler is move tool
+  actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
+  actual_tool=MOVE;
 
   //setting event handler for the editor widget
   entrywidget.signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::entryWidgetChangeHandler), false);
 
-  //base event handler is move tool
-  actual_handler=signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::moveEventHandler), false);
-  actual_tool=MOVE;
+  active_node=INVALID;
+  active_edge=INVALID;
+  forming_edge=INVALID;
+}
 
-  //set_center_scroll_region(true);
+GraphDisplayerCanvas::~GraphDisplayerCanvas()
+{
+  for (NodeIt n(mapstorage.graph); n != INVALID; ++n)
+  {
+    delete nodesmap[n];
+    delete nodetextmap[n];
+  }
 
+  for (EdgeIt e(mapstorage.graph); e != INVALID; ++e)
+  {
+    delete edgesmap[e];
+    delete edgetextmap[e];
+  }
+
+  if(canvasentrywidget)
+  {
+    delete(canvasentrywidget);
+  }
+}
+
+void GraphDisplayerCanvas::drawGraph()
+{
   //first edges are drawn, to hide joining with nodes later
 
-  for (EdgeIt i(g); i!=INVALID; ++i)
+  for (EdgeIt i(mapstorage.graph); i!=INVALID; ++i)
   {
 
-    //drawing green lines, coordinates are from cm
+    //drawing green lines, coordinates are from mapstorage.coords
 
     Gnome::Canvas::Points coos;
-    coos.push_back(Gnome::Art::Point(cm[g.source(i)].x,cm[g.source(i)].y));
-    coos.push_back(Gnome::Art::Point(cm[g.target(i)].x,cm[g.target(i)].y));
+    coos.push_back(Gnome::Art::Point(
+          mapstorage.coords[mapstorage.graph.source(i)].x,
+          mapstorage.coords[mapstorage.graph.source(i)].y));
+    coos.push_back(Gnome::Art::Point(
+          mapstorage.coords[mapstorage.graph.target(i)].x,
+          mapstorage.coords[mapstorage.graph.target(i)].y));
     
     edgesmap[i]=new BrokenEdge(displayed_graph, coos, *this);
@@ -47,19 +74,14 @@
   //afterwards nodes come to be drawn
 
-  NodeIt i(g);
-  int maxx=0, maxy=0, minx=(int)cm[i].x, miny=(int)cm[i].y;
-
-  for (; i!=INVALID; ++i)
+  for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
   {
-    //minimum and maximum is gathered to be able to zoom to the graph correctly (whole figure should be seen)
-
-    if(cm[i].x>maxx)maxx=(int)cm[i].x;
-    if(cm[i].y>maxy)maxy=(int)cm[i].y;
-    if(cm[i].x<minx)minx=(int)cm[i].x;
-    if(cm[i].y<miny)miny=(int)cm[i].y;
-
     //drawing bule nodes, with black line around them
 
-    nodesmap[i]=new Gnome::Canvas::Ellipse(displayed_graph, cm[i].x-20, cm[i].y-20, cm[i].x+20, cm[i].y+20);
+    nodesmap[i]=new Gnome::Canvas::Ellipse(
+        displayed_graph,
+        mapstorage.coords[i].x-20,
+        mapstorage.coords[i].y-20,
+        mapstorage.coords[i].x+20,
+        mapstorage.coords[i].y+20);
     *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue");
     *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black");
@@ -67,7 +89,10 @@
     //initializing edge-text as well, to empty string
 
-    xy<double> text_pos((cm[i].x+node_property_defaults[N_RADIUS]+5),(cm[i].y+node_property_defaults[N_RADIUS]+5));
+    xy<double> text_pos(
+        (mapstorage.coords[i].x+node_property_defaults[N_RADIUS]+5),
+        (mapstorage.coords[i].y+node_property_defaults[N_RADIUS]+5));
 
-    nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
+    nodetextmap[i]=new Gnome::Canvas::Text(displayed_graph,
+        text_pos.x, text_pos.y, "");
     nodetextmap[i]->property_fill_color().set_value("darkblue");
     nodetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::nodeMapEditEventHandler), false);
@@ -77,35 +102,20 @@
 }
 
-GraphDisplayerCanvas::~GraphDisplayerCanvas()
+void GraphDisplayerCanvas::clear()
 {
-  if(canvasentrywidget)
-    {
-      delete(canvasentrywidget);
-    }
+  active_node=INVALID;
+  active_edge=INVALID;
+  forming_edge=INVALID;
 
-  //writing out the end state of the graph
-  //\todo all the maps has to be write out!
-
-  Graph::NodeMap <int> id(g);
-  Graph::NodeMap <double> xc(g);
-  Graph::NodeMap <double> yc(g);
-  
-  int j=1;
-  
-  for (NodeIt i(g); i!=INVALID; ++i)
+  for (NodeIt n(mapstorage.graph); n != INVALID; ++n)
   {
-    double x1,y1,x2,y2;
-    nodesmap[i]->get_bounds(x1, y1, x2, y2);
-    
-    id[i]=j++;
-    xc[i]=(x1+x2)/2;
-    yc[i]=(y1+y2)/2;
+    delete nodesmap[n];
+    delete nodetextmap[n];
   }
 
-  GraphWriter<Graph> writer(std::cout,g);
-  
-  writer.writeNodeMap("id", id);
-  writer.writeNodeMap("coordinates_x", xc);
-  writer.writeNodeMap("coordinates_y", yc);
-  writer.run();
+  for (EdgeIt e(mapstorage.graph); e != INVALID; ++e)
+  {
+    delete edgesmap[e];
+    delete edgetextmap[e];
+  }
 }
Index: gui/graph_displayer_canvas.h
===================================================================
--- gui/graph_displayer_canvas.h	(revision 1597)
+++ gui/graph_displayer_canvas.h	(revision 1606)
@@ -6,8 +6,8 @@
 class GraphDisplayerCanvas;
 
-#include <all_include.h>
-#include <map_win.h>
-#include <mapstorage.h>
-#include <broken_edge.h>
+#include "all_include.h"
+#include "mapstorage.h"
+#include "broken_edge.h"
+#include "map_win.h"
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -19,5 +19,5 @@
 
 public:
-  GraphDisplayerCanvas(Graph &, CoordinatesMap &, MapStorage &, MapWin *);
+  GraphDisplayerCanvas(MapStorage &, MapWin &);
   virtual ~GraphDisplayerCanvas();
 
@@ -110,4 +110,7 @@
   int getActualTool();
 
+  void drawGraph();
+  void clear();
+
   ///creates a new Nodemap
   int addNewNodeMap(double,std::string);
@@ -124,7 +127,4 @@
 
 private:
-
-  ///The graph, on which we work
-  Graph & g;
 
   ///Map of nodes of graph
@@ -176,5 +176,5 @@
 
   ///We need to store mapwin, to be able to ask the appropriate values for properties of new items.
-  MapWin * mapwin;
+  MapWin & mapwin;
 
 };
Index: gui/main_win.cc
===================================================================
--- gui/main_win.cc	(revision 1601)
+++ gui/main_win.cc	(revision 1606)
@@ -1,6 +1,7 @@
-#include <main_win.h>
-
-MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm,
-    MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),newmapwin("Creating new map",gd_canvas),gd_canvas(graph, cm, ms, &mapwin)
+#include "main_win.h"
+
+MainWin::MainWin(const std::string& title) :
+  mapwin("Map Setup", mapstorage, gd_canvas),
+  newmapwin("Creating new map", gd_canvas), gd_canvas(mapstorage, mapwin)
 {
 
@@ -20,5 +21,7 @@
   ag->add( Gtk::Action::create("FileSaveAs", Gtk::Stock::SAVE_AS),
       sigc::mem_fun(*this, &MainWin::saveFileAs));
-  ag->add( Gtk::Action::create("FileQuit", Gtk::Stock::QUIT),
+  ag->add( Gtk::Action::create("Close", Gtk::Stock::CLOSE),
+      sigc::mem_fun(*this, &MainWin::close));
+  ag->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT),
       sigc::mem_fun(*this, &MainWin::hide));
 
@@ -37,12 +40,13 @@
       sigc::mem_fun(this->mapwin, &MapWin::show));
 
-  ag->add( Gtk::Action::create("CreateNode", Gtk::Stock::NO),
+  Gtk::RadioAction::Group tool_group;
+  ag->add( Gtk::RadioAction::create(tool_group, "MoveItem", Gtk::Stock::CONVERT, "Move"),
+      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 0) );
+  ag->add( Gtk::RadioAction::create(tool_group, "CreateNode", Gtk::Stock::NO, "Create node"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 1) );
-  ag->add( Gtk::Action::create("CreateEdge", Gtk::Stock::REMOVE),
+  ag->add( Gtk::RadioAction::create(tool_group, "CreateEdge", Gtk::Stock::REMOVE, "Create edge"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 2) );
-  ag->add( Gtk::Action::create("EraseItem", Gtk::Stock::DELETE),
+  ag->add( Gtk::RadioAction::create(tool_group, "EraseItem", Gtk::Stock::DELETE, "Delete"),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 3) );
-  ag->add( Gtk::Action::create("MoveItem", Gtk::Stock::CONVERT),
-      sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 0) );
   ag->add( Gtk::Action::create("EditEdgeMap", Gtk::Stock::PROPERTIES),
       sigc::bind( sigc::mem_fun ( this->gd_canvas, &GraphDisplayerCanvas::changeEditorialTool ), 4) );
@@ -67,5 +71,6 @@
       "      <menuitem action='FileSave'/>"
       "      <menuitem action='FileSaveAs'/>"
-      "      <menuitem action='FileQuit'/>"
+      "      <menuitem action='Close'/>"
+      "      <menuitem action='Quit'/>"
       "    </menu>"
       "    <menu action='ViewMenu'>"
@@ -83,4 +88,5 @@
       "    <toolitem action='FileOpen' />"
       "    <toolitem action='FileSave' />"
+      "    <toolitem action='Close' />"
       "    <separator />"
       "    <toolitem action='ViewZoomIn' />"
@@ -89,8 +95,8 @@
       "    <toolitem action='ViewZoom100' />"
       "    <separator />"
+      "    <toolitem action='MoveItem' />"
       "    <toolitem action='CreateNode' />"
       "    <toolitem action='CreateEdge' />"
       "    <toolitem action='EraseItem' />"
-      "    <toolitem action='MoveItem' />"
       "    <toolitem action='EditEdgeMap' />"
       "    <toolitem action='EditNodeMap' />"
@@ -131,19 +137,114 @@
 void MainWin::newFile()
 {
-  std::cerr << "MainWin::newFile(): not yet implemented" << std::endl;
+  if (mapstorage.modified)
+  {
+    Gtk::MessageDialog mdialog("", false, Gtk::MESSAGE_WARNING,
+        Gtk::BUTTONS_NONE);
+    mdialog.set_message("<b>Save changes before closing?</b>", true);
+    mdialog.add_button("Close _without Saving", Gtk::RESPONSE_REJECT);
+    mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+    mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
+    switch (mdialog.run())
+    {
+      case Gtk::RESPONSE_CANCEL:
+        return;
+      case Gtk::RESPONSE_REJECT:
+        break;
+      case Gtk::RESPONSE_ACCEPT:
+        saveFile();
+        break;
+    }
+  }
+  gd_canvas.clear();
+  mapstorage.clear();
+  mapwin.update();
 }
 
 void MainWin::openFile()
 {
-  std::cerr << "MainWin::openFile(): not yet implemented" << std::endl;
+  if (mapstorage.modified)
+  {
+    Gtk::MessageDialog mdialog("", false, Gtk::MESSAGE_WARNING,
+        Gtk::BUTTONS_NONE);
+    mdialog.set_message("<b>Save changes before closing?</b>", true);
+    mdialog.add_button("Close _without Saving", Gtk::RESPONSE_REJECT);
+    mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+    mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
+    switch (mdialog.run())
+    {
+      case Gtk::RESPONSE_CANCEL:
+        return;
+      case Gtk::RESPONSE_REJECT:
+        break;
+      case Gtk::RESPONSE_ACCEPT:
+        saveFile();
+        break;
+    }
+  }
+  gd_canvas.clear();
+  mapstorage.clear();
+  Gtk::FileChooserDialog fcdialog("Open File");
+  fcdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+  fcdialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT);
+  if (fcdialog.run() == Gtk::RESPONSE_ACCEPT)
+  {
+    Glib::ustring filename = fcdialog.get_filename();
+    mapstorage.readFromFile(filename);
+    mapstorage.file_name = filename;
+    mapstorage.modified = false;
+    gd_canvas.drawGraph();
+    mapwin.update();
+  }
 }
 
 void MainWin::saveFile()
 {
-  std::cerr << "MainWin::saveFile(): not yet implemented" << std::endl;
+  if (mapstorage.file_name == "") {
+    saveFileAs();
+  }
+  else
+  {
+    mapstorage.writeToFile(mapstorage.file_name);
+    mapstorage.modified = false;
+  }
 }
 
 void MainWin::saveFileAs()
 {
-  std::cerr << "MainWin::saveFileAs(): not yet implemented" << std::endl;
-}
+  Gtk::FileChooserDialog fcdialog("Save File", Gtk::FILE_CHOOSER_ACTION_SAVE);
+  fcdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+  fcdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
+  if (fcdialog.run() == Gtk::RESPONSE_ACCEPT)
+  {
+    Glib::ustring filename = fcdialog.get_filename();
+    mapstorage.file_name = filename;
+    mapstorage.writeToFile(filename);
+    mapstorage.modified = false;
+  }
+}
+
+void MainWin::close()
+{
+  if (mapstorage.modified)
+  {
+    Gtk::MessageDialog mdialog("", false, Gtk::MESSAGE_WARNING,
+        Gtk::BUTTONS_NONE);
+    mdialog.set_message("<b>Save changes before closing?</b>", true);
+    mdialog.add_button("Close _without Saving", Gtk::RESPONSE_REJECT);
+    mdialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+    mdialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
+    switch (mdialog.run())
+    {
+      case Gtk::RESPONSE_CANCEL:
+        return;
+      case Gtk::RESPONSE_REJECT:
+        break;
+      case Gtk::RESPONSE_ACCEPT:
+        saveFile();
+        break;
+    }
+  }
+  gd_canvas.clear();
+  mapstorage.clear();
+  mapwin.update();
+}
Index: gui/main_win.h
===================================================================
--- gui/main_win.h	(revision 1601)
+++ gui/main_win.h	(revision 1606)
@@ -4,8 +4,10 @@
 #define MAIN_WIN_H
 
-#include <all_include.h>
-#include <mapstorage.h>
-#include <map_win.h>
-#include <new_map_win.h>
+#include "all_include.h"
+#include "mapstorage.h"
+#include "map_win.h"
+#include "new_map_win.h"
+#include "edit_win.h"
+#include "graph_displayer_canvas.h"
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -18,8 +20,7 @@
   ///Constructor of the \ref MainWin. It creates the menu and the \ref GraphDisplayerCanvas on which the graph will be drawn.
   ///\param title is the title of the window
-  ///\param graph is the graph that will be drawn here. It will be given further to the \ref GraphDisplayerCanvas
-  ///\param cm stores the coordinates of the nodes of the graph
-  ///\param ms is the \ref MapStorage in which the different visualizable maps are stored
-  MainWin(const std::string& title, Graph &, CoordinatesMap &, MapStorage &);
+  MainWin(const std::string& title);
+
+  MapStorage mapstorage;
 
 protected:
@@ -53,4 +54,6 @@
   ///Callback for 'FileSaveAs' action.
   virtual void saveFileAs();
+  ///Callback for 'Close' action.
+  virtual void close();
 };
 
Index: gui/map_win.cc
===================================================================
--- gui/map_win.cc	(revision 1599)
+++ gui/map_win.cc	(revision 1606)
@@ -1,3 +1,3 @@
-#include <map_win.h>
+#include "map_win.h"
 #include <set>
 
@@ -119,4 +119,39 @@
   show_all_children();
 
+}
+
+void MapWin::update()
+{
+  for(int i=0;i<EDGE_PROPERTY_NUM;i++)
+  {
+    //filling in combo box with choices
+    std::list<Glib::ustring> listStrings;
+
+    listStrings.push_back("Default");
+
+    std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
+    for(;emsi!=ms.endOfEdgeMaps();emsi++)
+    {
+      listStrings.push_back(emsi->first);
+    }
+
+    e_combo_array[i].set_popdown_strings(listStrings);
+  }
+  for(int i=0;i<NODE_PROPERTY_NUM;i++)
+  {
+    //filling in combo box with choices
+    std::list<Glib::ustring> listStrings;
+
+    listStrings.push_back("Default");
+
+    std::map< std::string,Graph::NodeMap<double> * >::iterator emsi=ms.beginOfNodeMaps();
+
+    for(;emsi!=ms.endOfNodeMaps();emsi++)
+    {
+      listStrings.push_back(emsi->first);
+    }
+
+    n_combo_array[i].set_popdown_strings(listStrings);
+  }
 }
 
Index: gui/map_win.h
===================================================================
--- gui/map_win.h	(revision 1586)
+++ gui/map_win.h	(revision 1606)
@@ -6,7 +6,7 @@
 class MapWin;
 
-#include <all_include.h>
-#include <mapstorage.h>
-#include <graph_displayer_canvas.h>
+#include "all_include.h"
+#include "graph_displayer_canvas.h"
+#include "mapstorage.h"
 #include <libgnomecanvasmm.h>
 #include <libgnomecanvasmm/polygon.h>
@@ -64,4 +64,5 @@
   virtual bool closeIfEscapeIsPressed(GdkEventKey*);
 
+  void update();
 };
 
Index: gui/mapstorage.cc
===================================================================
--- gui/mapstorage.cc	(revision 1597)
+++ gui/mapstorage.cc	(revision 1606)
@@ -1,7 +1,28 @@
-#include <mapstorage.h>
-
-MapStorage::MapStorage(Graph & graph):g(graph)
-{
-};
+#include "mapstorage.h"
+
+MapStorage::MapStorage() : modified(false), file_name("")
+{
+  nodemap_storage["coordinates_x"] = new Graph::NodeMap<double>(graph);
+  coords.setXMap(*nodemap_storage["coordinates_x"]);
+  nodemap_storage["coordinates_y"] = new Graph::NodeMap<double>(graph);
+  coords.setYMap(*nodemap_storage["coordinates_y"]);
+
+  nodemap_storage["id"] = new Graph::NodeMap<double>(graph);
+  edgemap_storage["id"] = new Graph::EdgeMap<double>(graph);
+}
+
+MapStorage::~MapStorage()
+{
+  for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
+      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
+  {
+    delete it->second;
+  }
+  for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
+      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
+  {
+    delete it->second;
+  }
+}
 
 int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap)
@@ -28,5 +49,5 @@
 {
   double max=0;
-  for (NodeIt j(g); j!=INVALID; ++j)
+  for (NodeIt j(graph); j!=INVALID; ++j)
   {
     if( (*nodemap_storage[name])[j]>max )
@@ -41,5 +62,5 @@
 {
   double max=0;
-  for (EdgeIt j(g); j!=INVALID; ++j)
+  for (EdgeIt j(graph); j!=INVALID; ++j)
   {
     if( (*edgemap_storage[name])[j]>max )
@@ -53,5 +74,5 @@
 double MapStorage::minOfNodeMap(const std::string & name)
 {
-  NodeIt j(g);
+  NodeIt j(graph);
   double min=(*nodemap_storage[name])[j];
   for (; j!=INVALID; ++j)
@@ -67,7 +88,7 @@
 double MapStorage::minOfEdgeMap(const std::string & name)
 {
-  EdgeIt j(g);
+  EdgeIt j(graph);
   double min=(*edgemap_storage[name])[j];
-  for (EdgeIt j(g); j!=INVALID; ++j)
+  for (EdgeIt j(graph); j!=INVALID; ++j)
   {
     if( (*edgemap_storage[name])[j]<min )
@@ -87,2 +108,130 @@
     }
 }
+
+void MapStorage::readFromFile(const std::string &filename)
+{
+  bool read_x = false;
+  bool read_y = false;
+
+  try {
+    LemonReader lreader(filename);
+    ContentReader content(lreader);
+    lreader.run();
+
+    const std::vector<std::string>& nodeMapNames = content.nodeSetMaps(0);
+    const std::vector<std::string>& edgeMapNames = content.edgeSetMaps(0);
+
+    GraphReader<Graph> greader(filename, graph);
+    for (std::vector<std::string>::const_iterator it = nodeMapNames.begin();
+        it != nodeMapNames.end(); ++it)
+    {
+      if (*it == "coordinates_x")
+      {
+        read_x = true;
+        //std::cout << "read X nodemap" << std::endl;
+      }
+      else if (*it == "coordinates_y")
+      {
+        read_y = true;
+        //std::cout << "read Y nodemap" << std::endl;
+      }
+      else if (*it == "id")
+      {
+        //std::cout << "read id nodemap" << std::endl;
+      }
+      else
+      {
+        nodemap_storage[*it] = new Graph::NodeMap<double>(graph);
+        //std::cout << "read " << *it << " nodemap" << std::endl;
+      }
+      greader.readNodeMap(*it, *nodemap_storage[*it]);
+    }
+    for (std::vector<std::string>::const_iterator it = edgeMapNames.begin();
+        it != edgeMapNames.end(); ++it)
+    {
+      if (*it == "id")
+      {
+        //std::cout << "read id edgemap" << std::endl;
+      }
+      else
+      {
+        edgemap_storage[*it] = new Graph::EdgeMap<double>(graph);
+        //std::cout << "read " << *it << " edgemap" << std::endl;
+      }
+      greader.readEdgeMap(*it, *edgemap_storage[*it]);
+    }
+    greader.run();
+  } catch (DataFormatError& error) {
+    /*
+    Gtk::MessageDialog mdialog("Read Error");
+    mdialog.set_message(error.what());
+    mdialog.run();
+    */
+    // reset graph and mapstorage ?
+    return;
+  }
+
+  if (!read_x || !read_y)
+  {
+    int node_num = 0;
+    for (NodeIt n(graph); n != INVALID; ++n)
+    {
+      node_num++;
+    }
+    const double pi = 3.142;
+    double step = 2 * pi / (double) node_num;
+    int i = 0;
+    for (NodeIt n(graph); n != INVALID; ++n)
+    {
+      nodemap_storage["coordinates_x"]->set(n, 250.0 * cos(i * step));
+      nodemap_storage["coordinates_y"]->set(n, 250.0 * sin(i * step));
+      i++;
+    }
+  }
+}
+
+void MapStorage::writeToFile(const std::string &filename)
+{
+  GraphWriter<Graph> gwriter(filename, graph);
+
+  for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
+      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
+  {
+    gwriter.writeNodeMap(it->first, *(it->second));
+    //std::cout << "wrote " << it->first << " nodemap" << std::endl;
+  }
+  for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
+      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
+  {
+    gwriter.writeEdgeMap(it->first, *(it->second));
+    //std::cout << "wrote " << it->first << " edgemap" << std::endl;
+  }
+  gwriter.run();
+}
+
+void MapStorage::clear()
+{
+  for (std::map<std::string, Graph::NodeMap<double>*>::iterator it =
+      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
+  {
+    if ((it->first != "coordinates_x") &&
+        (it->first != "coordinates_y") &&
+        (it->first != "id"))
+    {
+      delete it->second;
+      nodemap_storage.erase(it);
+    }
+  }
+  for (std::map<std::string, Graph::EdgeMap<double>*>::iterator it =
+      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
+  {
+    if (it->first != "id")
+    {
+      delete it->second;
+      edgemap_storage.erase(it);
+    }
+  }
+  graph.clear();
+  file_name = "";
+  modified = false;
+}
Index: gui/mapstorage.h
===================================================================
--- gui/mapstorage.h	(revision 1525)
+++ gui/mapstorage.h	(revision 1606)
@@ -4,5 +4,6 @@
 #define MAPSTORAGE_H
 
-#include <all_include.h>
+#include "all_include.h"
+#include "xymap.h"
 
 ///Class MapStorage is responsible for storing
@@ -19,5 +20,9 @@
 public:
 
-  Graph &g;
+  Graph graph;
+  XYMap<Graph::NodeMap<double> > coords;
+
+  bool modified;
+  std::string file_name;
 
   ///Stores double type NodeMaps
@@ -40,5 +45,7 @@
   ///
   ///\param graph is the graph for which the maps are stored in this object.
-  MapStorage(Graph &);
+  MapStorage();
+
+  ~MapStorage();
 
   ///Adds given map to storage. A name and the map itself has to be provided.
@@ -93,4 +100,9 @@
   ///This function sets a default base value for the newly created node
   void initMapsForEdge(Graph::Edge);
+
+  void readFromFile(const std::string &);
+  void writeToFile(const std::string &);
+
+  void clear();
 };
 
Index: gui/xymap.h
===================================================================
--- gui/xymap.h	(revision 1606)
+++ gui/xymap.h	(revision 1606)
@@ -0,0 +1,35 @@
+#ifndef XYMAP_H
+#define XYMAP_H
+
+#include <lemon/list_graph.h>
+#include <lemon/xy.h>
+
+using lemon::ListGraph;
+using lemon::xy;
+
+template<class M>
+class XYMap
+{
+  private:
+    M *xmap, *ymap;
+
+  public:
+    typedef typename M::Key Key;
+    typedef xy<typename M::Value> Value;
+    XYMap() {}
+    XYMap(M &_xmap, M &_ymap) : xmap(&_xmap), ymap(&_ymap) {}
+    void setXMap(M &_xmap) { xmap = &_xmap; }
+    void setYMap(M &_ymap) { ymap = &_ymap; }
+    Value operator[](Key k) const
+    {
+      Value v(xmap->operator[](k), ymap->operator[](k));
+      return v;
+    }
+    void set(Key k, Value v)
+    {
+      xmap->set(k, v.x);
+      ymap->set(k, v.y);
+    }
+};
+
+#endif
