Index: gui/broken_edge.cc
===================================================================
--- gui/broken_edge.cc	(revision 1632)
+++ gui/broken_edge.cc	(revision 1645)
@@ -9,4 +9,5 @@
   *arrow << Gnome::Canvas::Properties::fill_color("red");
   arrow->signal_event().connect(sigc::mem_fun(*this, &BrokenEdge::edgeFormerEventHandler));
+  arrow->lower_to_bottom();
   setPoints(p);
 }
Index: gui/graph_displayer_canvas-edge.cc
===================================================================
--- gui/graph_displayer_canvas-edge.cc	(revision 1643)
+++ gui/graph_displayer_canvas-edge.cc	(revision 1645)
@@ -123,5 +123,5 @@
   //in that case empty string will be written, because
   //that is the deleter map
-
+  
   if(edge==INVALID)
     {
Index: gui/graph_displayer_canvas-event.cc
===================================================================
--- gui/graph_displayer_canvas-event.cc	(revision 1643)
+++ gui/graph_displayer_canvas-event.cc	(revision 1645)
@@ -215,11 +215,17 @@
 {
   switch(e->type)
-    {
-
-      //draw the new node in red at the clicked place
-    case GDK_2BUTTON_PRESS:
-      //std::cout << "double click" << std::endl;
-      break;
-    case GDK_BUTTON_PRESS:
+  {
+    //move the new node
+    case GDK_MOTION_NOTIFY:
+      {
+        GdkEvent * generated=new GdkEvent();
+        generated->motion.x=e->motion.x;
+        generated->motion.y=e->motion.y;
+        generated->type=GDK_MOTION_NOTIFY;
+        moveEventHandler(generated);      
+        break;
+      }
+
+    case GDK_BUTTON_RELEASE:
       mapstorage.modified = true;
 
@@ -232,64 +238,53 @@
       window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
 
+      // update coordinates
       mapstorage.coords.set(active_node, xy<double>(clicked_x, clicked_y));
+
+      // update id map
       (*mapstorage.nodemap_storage["id"])[active_node] =
         mapstorage.graph.id(active_node);
 
+      // update all other maps
+      for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
+          mapstorage.nodemap_storage.begin(); it !=
+          mapstorage.nodemap_storage.end(); ++it)
+      {
+        if ((it->first != "id") &&
+            (it->first != "coordinates_x") &&
+            (it->first != "coordiantes_y"))
+        {
+          (*(it->second))[active_node] =
+            mapstorage.nodemap_default[it->first];
+        }
+      }
+
       nodesmap[active_node]=new Gnome::Canvas::Ellipse(displayed_graph,
-        clicked_x-20, clicked_y-20, clicked_x+20, clicked_y+20);
+          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");
-      *(nodesmap[active_node]) << Gnome::Canvas::Properties::outline_color("black");
+      *(nodesmap[active_node]) <<
+        Gnome::Canvas::Properties::fill_color("blue");
+      *(nodesmap[active_node]) <<
+        Gnome::Canvas::Properties::outline_color("black");
+      active_item->raise_to_top();
+
       (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, "");
+          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");
+      nodetextmap[active_node]->raise_to_top();
 
       mapwin.updateNode(active_node);
 
-      break;
-
-      //move the new node
-    case GDK_MOTION_NOTIFY:
-      {
-	GdkEvent * generated=new GdkEvent();
-	generated->motion.x=e->motion.x;
-	generated->motion.y=e->motion.y;
-	generated->type=GDK_MOTION_NOTIFY;
-	moveEventHandler(generated);      
-	break;
-      }
-
-      //finalize the new node
-    case GDK_BUTTON_RELEASE:
-      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
-
-      active_item->lower_to_bottom();
-
-      target_item=NULL;
-      target_item=get_item_at(clicked_x, clicked_y);
-
-      active_item->raise_to_top();
-
       isbutton=0;
-      if(target_item==active_item)
-	{
-	  //Its appropriate color is given by update.
-	  *active_item << Gnome::Canvas::Properties::fill_color("blue");
-	}
-      else
-	{
-	  //In this case the given color has to be overwritten, because the noe covers an other item.
-	  *active_item << Gnome::Canvas::Properties::fill_color("lightblue");
-	}
       target_item=NULL;
       active_item=NULL;
       active_node=INVALID;
+
       break;
     default:
       break;
-    }
+  }
   return false;
 }
@@ -298,115 +293,131 @@
 {
   switch(e->type)
-    {
+  {
     case GDK_BUTTON_PRESS:
       //in edge creation right button has special meaning
       if(e->button.button!=3)
-	{
-	  //there is not yet selected node
-	  if(active_node==INVALID)
-	    {
-	      //we mark the location of the event to be able to calculate parameters of dragging
-
-	      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
-
-	      active_item=(get_item_at(clicked_x, clicked_y));
-	      active_node=INVALID;
-	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
-		{
-		  if(nodesmap[i]==active_item)
-		    {
-		      active_node=i;
-		    }
-		}
-	      //the clicked item is really a node
-	      if(active_node!=INVALID)
-		{
-		  *(nodesmap[active_node]) << Gnome::Canvas::Properties::fill_color("red");
-		  isbutton=1;
-		}
-	      //clicked item was not a node. It could be e.g. edge.
-	      else
-		{
-		  active_item=NULL;
-		}
-	    }
-	  //we only have to do sg. if the mouse button
-	  // is pressed already once AND the click was
-	  // on a node that was found in the set of 
-	  //nodes, and now we only search for the second 
-	  //node
-	  else
-	    {
-	      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
-	      target_item=(get_item_at(clicked_x, clicked_y));
-	      Node target_node=INVALID;
-	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
-		{
-		  if(nodesmap[i]==target_item)
-		    {
-		      target_node=i;
-		    }
-		}
-	      //the clicked item is a node, the edge can be drawn
-	      if(target_node!=INVALID)
-		{
-		  if(target_node!=active_node)		
-		    {
-          mapstorage.modified = true;
-
-		      *(nodesmap[target_node]) <<
-			Gnome::Canvas::Properties::fill_color("red");
-
-		      //creating new edge
-		      active_edge=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
-		      Gnome::Canvas::Points coos;
-		      double x1, x2, y1, y2;
-	  
-		      active_item->get_bounds(x1, y1, x2, y2);
-		      coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
-
-		      target_item->get_bounds(x1, y1, x2, y2);
-		      coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
-
-		      //drawing new edge
-		      edgesmap[active_edge]=new BrokenEdge(displayed_graph, coos, *this);
-		      *(edgesmap[active_edge]) << Gnome::Canvas::Properties::fill_color("green");
-		      edgesmap[active_edge]->property_width_pixels().set_value(10);
-
-		      //redraw nodes to blank terminations of the new edge
-		      target_item->raise_to_top();
-		      active_item->raise_to_top();
-
-		      //initializing edge-text as well, to empty string
-		      xy<double> text_pos=edgesmap[active_edge]->getArrowPos();
-		      text_pos+=(xy<double>(10,10));
-
-		      edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph, text_pos.x, text_pos.y, "");
-		      edgetextmap[active_edge]->property_fill_color().set_value("darkgreen");
-
-		      //updating its properties
-		      mapwin.updateEdge(active_edge);
-		    }
-		  else
-		    {
-		      target_node=INVALID;
-		      std::cerr << "Loop edge is not yet implemented!" << std::endl;
-		    }
-		}
-	      //clicked item was not a node. it could be an e.g. edge. we do not deal with it furthermore.
-	      else
-		{
-		  target_item=NULL;
-		}
-	    }
-	}
+      {
+        //there is not yet selected node
+        if(active_node==INVALID)
+        {
+          //we mark the location of the event to be able to calculate parameters of dragging
+
+          window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
+
+          active_item=(get_item_at(clicked_x, clicked_y));
+          active_node=INVALID;
+          for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
+          {
+            if(nodesmap[i]==active_item)
+            {
+              active_node=i;
+            }
+          }
+          //the clicked item is really a node
+          if(active_node!=INVALID)
+          {
+            *(nodesmap[active_node]) << Gnome::Canvas::Properties::fill_color("red");
+            isbutton=1;
+          }
+          //clicked item was not a node. It could be e.g. edge.
+          else
+          {
+            active_item=NULL;
+          }
+        }
+        //we only have to do sg. if the mouse button
+        // is pressed already once AND the click was
+        // on a node that was found in the set of 
+        //nodes, and now we only search for the second 
+        //node
+        else
+        {
+          window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
+          target_item=(get_item_at(clicked_x, clicked_y));
+          Node target_node=INVALID;
+          for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
+          {
+            if(nodesmap[i]==target_item)
+            {
+              target_node=i;
+            }
+          }
+          //the clicked item is a node, the edge can be drawn
+          if(target_node!=INVALID)
+          {
+            if(target_node!=active_node)		
+            {
+              mapstorage.modified = true;
+
+              *(nodesmap[target_node]) <<
+                Gnome::Canvas::Properties::fill_color("red");
+
+              //creating new edge
+              active_edge=mapstorage.graph.addEdge(active_node,
+                  target_node);
+
+              // update id map
+              (*mapstorage.edgemap_storage["id"])[active_edge] = 
+                mapstorage.graph.id(active_edge);
+ 
+              // update all other maps
+              for (std::map<std::string,
+                  Graph::EdgeMap<double>*>::const_iterator it =
+                  mapstorage.edgemap_storage.begin(); it !=
+                  mapstorage.edgemap_storage.end(); ++it)
+              {
+                if (it->first != "id")
+                {
+                  (*(it->second))[active_edge] =
+                    mapstorage.edgemap_default[it->first];
+                }
+              }
+
+              //calculating coordinates of new edge
+              Gnome::Canvas::Points coos;
+              double x1, x2, y1, y2;
+
+              active_item->get_bounds(x1, y1, x2, y2);
+              coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+              target_item->get_bounds(x1, y1, x2, y2);
+              coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+              //drawing new edge
+              edgesmap[active_edge]=new BrokenEdge(displayed_graph, coos,
+                  *this);
+              *(edgesmap[active_edge]) <<
+                Gnome::Canvas::Properties::fill_color("green");
+              edgesmap[active_edge]->property_width_pixels().set_value(10);
+
+              edgesmap[active_edge]->lower_to_bottom();
+
+              //initializing edge-text as well, to empty string
+              xy<double> text_pos=edgesmap[active_edge]->getArrowPos();
+              text_pos+=(xy<double>(10,10));
+
+              edgetextmap[active_edge]=new Gnome::Canvas::Text(displayed_graph,
+                  text_pos.x, text_pos.y, "");
+              edgetextmap[active_edge]->property_fill_color().set_value(
+                  "darkgreen");
+              edgetextmap[active_edge]->raise_to_top();
+
+              //updating its properties
+              mapwin.updateEdge(active_edge);
+            }
+            else
+            {
+              target_node=INVALID;
+              std::cerr << "Loop edge is not yet implemented!" << std::endl;
+            }
+          }
+          //clicked item was not a node. it could be an e.g. edge. we do not
+          //deal with it furthermore.
+          else
+          {
+            target_item=NULL;
+          }
+        }
+      }
       break;
     case GDK_BUTTON_RELEASE:
@@ -416,22 +427,22 @@
       //2: the edge creation is cancelled with right button
       if((target_item)||(e->button.button==3))
-	{
-	  if(active_item)
-	    {
-	      *active_item << Gnome::Canvas::Properties::fill_color("blue");
-	      active_item=NULL;
-	    }
-	  if(target_item)
-	    {
-	      *target_item << Gnome::Canvas::Properties::fill_color("blue");
-	      target_item=NULL;
-	    }
-	  active_node=INVALID;
-	  active_edge=INVALID;
-	}
+      {
+        if(active_item)
+        {
+          *active_item << Gnome::Canvas::Properties::fill_color("blue");
+          active_item=NULL;
+        }
+        if(target_item)
+        {
+          *target_item << Gnome::Canvas::Properties::fill_color("blue");
+          target_item=NULL;
+        }
+        active_node=INVALID;
+        active_edge=INVALID;
+      }
       break;
     default:
       break;
-    }
+  }
   return false;
 }
@@ -589,4 +600,6 @@
 	    if(clicked_edge!=INVALID)
 	      {
+                // the id map is not editable
+                if (nodemap_to_edit == "id") return 0;
 		//If there is already edited edge, it has to be saved first
 		if(entrywidget.is_visible())
@@ -712,4 +725,6 @@
 	    if(clicked_node!=INVALID)
 	      {
+                // the id map is not editable
+                if (nodemap_to_edit == "id") return 0;
 		//If there is already edited edge, it has to be saved first
 		if(entrywidget.is_visible())
@@ -914,5 +929,5 @@
   //if addition was not successful addEdgeMap returns one.
   //cause can be that there is already a map named like the new one
-  if(mapstorage.addEdgeMap(mapname,emptr))
+  if(mapstorage.addEdgeMap(mapname,emptr, default_value))
     {
       return 1;
@@ -936,5 +951,5 @@
   //if addition was not successful addNodeMap returns one.
   //cause can be that there is already a map named like the new one
-  if(mapstorage.addNodeMap(mapname,emptr))
+  if(mapstorage.addNodeMap(mapname,emptr, default_value))
     {
       return 1;
Index: gui/graph_displayer_canvas.cc
===================================================================
--- gui/graph_displayer_canvas.cc	(revision 1632)
+++ gui/graph_displayer_canvas.cc	(revision 1645)
@@ -63,4 +63,5 @@
     *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
     edgesmap[i]->property_width_units().set_value(10);    
+    edgesmap[i]->lower_to_bottom();
     
     //initializing edge-text as well, to empty string
@@ -72,4 +73,5 @@
     edgetextmap[i]->property_fill_color().set_value("darkgreen");
     edgetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::edgeMapEditEventHandler), false);
+    edgetextmap[i]->raise_to_top();
   }
 
@@ -88,4 +90,5 @@
     *(nodesmap[i]) << Gnome::Canvas::Properties::fill_color("blue");
     *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black");
+    nodesmap[i]->raise_to_top();
 
     //initializing edge-text as well, to empty string
@@ -99,4 +102,5 @@
     nodetextmap[i]->property_fill_color().set_value("darkblue");
     nodetextmap[i]->signal_event().connect(sigc::mem_fun(*this, &GraphDisplayerCanvas::nodeMapEditEventHandler), false);
+    nodetextmap[i]->raise_to_top();
   }
 
Index: gui/main_win.cc
===================================================================
--- gui/main_win.cc	(revision 1635)
+++ gui/main_win.cc	(revision 1645)
@@ -265,9 +265,11 @@
   {
     Glib::ustring filename = fcdialog.get_filename();
-    mapstorage.readFromFile(filename);
-    mapstorage.file_name = filename;
-    mapstorage.modified = false;
-    gd_canvas.drawGraph();
-    mapwin.update();
+    if (!mapstorage.readFromFile(filename))
+    {
+      mapstorage.file_name = filename;
+      mapstorage.modified = false;
+      gd_canvas.drawGraph();
+      mapwin.update();
+    }
   }
 }
Index: gui/mapstorage.cc
===================================================================
--- gui/mapstorage.cc	(revision 1643)
+++ gui/mapstorage.cc	(revision 1645)
@@ -1,3 +1,4 @@
 #include "mapstorage.h"
+#include <gtkmm.h>
 #include <cmath>
 
@@ -27,9 +28,11 @@
 }
 
-int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap)
+int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap, double default_value = 0.0)
 {
   if( nodemap_storage.find(name) == nodemap_storage.end() )
     {
       nodemap_storage[name]=nodemap;
+      // set the maps default value
+      nodemap_default[name] = default_value;
       return 0;
     }
@@ -37,9 +40,11 @@
 }
 
-int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap)
+int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap, double default_value = 0.0)
 {
   if( edgemap_storage.find(name) == edgemap_storage.end() )
     {
       edgemap_storage[name]=edgemap;
+      // set the maps default value
+      edgemap_default[name] = default_value;
       return 0;
     }
@@ -117,14 +122,5 @@
 }
 
-void MapStorage::initMapsForEdge(Edge e)
-{
-  std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it;
-  for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++)
-    {
-      (*((*ems_it).second))[e]=5;
-    }
-}
-
-void MapStorage::readFromFile(const std::string &filename)
+int MapStorage::readFromFile(const std::string &filename)
 {
   bool read_x = false;
@@ -180,11 +176,9 @@
     greader.run();
   } catch (DataFormatError& error) {
-    /*
     Gtk::MessageDialog mdialog("Read Error");
     mdialog.set_message(error.what());
     mdialog.run();
-    */
-    // reset graph and mapstorage ?
-    return;
+    clear();
+    return 1;
   }
 
@@ -206,4 +200,26 @@
     }
   }
+
+  // fill in the default values for the maps
+  for (std::map<std::string, Graph::NodeMap<double>*>::const_iterator it =
+      nodemap_storage.begin(); it != nodemap_storage.end(); ++it)
+  {
+    if ((it->first != "id") &&
+        (it->first != "coordiantes_x") &&
+        (it->first != "coordinates_y"))
+    {
+      nodemap_default[it->first] = 0.0;
+    }
+  }
+  for (std::map<std::string, Graph::EdgeMap<double>*>::const_iterator it =
+      edgemap_storage.begin(); it != edgemap_storage.end(); ++it)
+  {
+    if (it->first != "id")
+    {
+      edgemap_default[it->first] = 0.0;
+    }
+  }
+
+  return 0;
 }
 
@@ -249,4 +265,14 @@
     }
   }
+  for (std::map<std::string, double>::iterator it =
+      nodemap_default.begin(); it != nodemap_default.end(); ++it)
+  {
+    nodemap_default.erase(it);
+  }
+  for (std::map<std::string, double>::iterator it =
+      edgemap_default.begin(); it != edgemap_default.end(); ++it)
+  {
+    edgemap_default.erase(it);
+  }
   graph.clear();
   file_name = "";
Index: gui/mapstorage.h
===================================================================
--- gui/mapstorage.h	(revision 1606)
+++ gui/mapstorage.h	(revision 1645)
@@ -38,4 +38,10 @@
   std::vector<Graph::EdgeMap<double> > default_edgemaps;
 
+  // Default values for the maps
+  std::map< std::string, double > nodemap_default;
+
+  // Default values for the maps
+  std::map< std::string, double > edgemap_default;
+
 public:
   ///Constructor of MapStorage. Expects the Graph of
@@ -53,5 +59,5 @@
   ///\nodemap is the pointer of the given nodemap
   ///\todo map should be given by reference!
-  int addNodeMap(const std::string &,Graph::NodeMap<double> *);
+  int addNodeMap(const std::string &,Graph::NodeMap<double> *, double);
 
   ///Adds given map to storage. A name and the map itself has to be provided.
@@ -59,5 +65,5 @@
   ///\edgemap is the pointer of the given edgemap
   ///\todo map should be given by reference!
-  int addEdgeMap(const std::string &,Graph::EdgeMap<double> *);
+  int addEdgeMap(const std::string &,Graph::EdgeMap<double> *, double);
 
   ///Returns how much nodemaps is stored in \ref MapStorage
@@ -95,11 +101,5 @@
   std::map< std::string,Graph::EdgeMap<double> * >::iterator endOfEdgeMaps(){return edgemap_storage.end();};
 
-  ///This function sets a default base value for the newly created node
-  void initMapsForNode(NodeIt);
-
-  ///This function sets a default base value for the newly created node
-  void initMapsForEdge(Graph::Edge);
-
-  void readFromFile(const std::string &);
+  int readFromFile(const std::string &);
   void writeToFile(const std::string &);
 
