Index: gui/mapstorage.h
===================================================================
--- gui/mapstorage.h	(revision 1881)
+++ gui/mapstorage.h	(revision 1888)
@@ -9,4 +9,6 @@
 #include "xymap.h"
 #include <libgnomecanvasmm.h>
+
+///class MapStorage handles NodeMaps and EdgeMaps.
 
 ///Class MapStorage is responsible for storing
@@ -23,4 +25,5 @@
 public:
 
+  ///The graph for which the datas are stored.
   Graph graph;
   /// the coordinates of the nodes
@@ -29,5 +32,8 @@
   XYMap<Graph::EdgeMap<double> > arrow_pos;
 
+  ///The content of the object has changed, update is needed.
   bool modified;
+
+  ///Name of file loaded in object.
   std::string file_name;
 
@@ -38,20 +44,20 @@
   std::map< std::string,Graph::EdgeMap<double> * > edgemap_storage;
 
-  //Stores the default values for the different visualization node attributes
+  ///Stores the default values for the different visualization node attributes
   std::vector<Graph::NodeMap<double> > default_nodemaps;
 
-  //Stores the default values for the different visualization edge attributes
+  ///Stores the default values for the different visualization edge attributes
   std::vector<Graph::EdgeMap<double> > default_edgemaps;
 
-  //Stores the active maps for the different visualization node attributes
+  ///Stores the active maps for the different visualization node attributes
   std::vector< std::string > active_nodemaps;
 
-  //Stores the active maps for the different visualization edge attributes
+  /// Stores the active maps for the different visualization edge attributes
   std::vector< std::string > active_edgemaps;
 
-  // Default values for the maps
+  /// Default values for the maps
   std::map< std::string, double > nodemap_default;
 
-  // Default values for the maps
+  /// Default values for the maps
   std::map< std::string, double > edgemap_default;
 
@@ -59,44 +65,96 @@
 
 protected:
+  /// type of the signal emitted if the visualization of the maps might have to be updated.
+
+  /// bool shows us whether the changed map is edge or nodemap.
+  /// int tells us the refreshed property
   typedef sigc::signal<void, bool, int> Signal_Prop;
+
+  /// Signal emitted on any change made on map values
   Signal_Prop signal_prop;
+
+  /// Signal emitted in the case of nodemap addition
+
+  /// std::string is the
+  ///name of the new map
   sigc::signal<void, std::string> signal_node_map;
+
+  /// Signal emitted in the case of edgemap addition
+
+  /// std::string is the
+  ///name of the new map
   sigc::signal<void, std::string> signal_edge_map;
 
 public:
-  ///Constructor of MapStorage. Expects the Graph of
-  ///which maps will be stored in it.
+  ///Constructor of MapStorage.
+
   ///Its all activity is initializing default values
-  ///for different visualization attributes
-  ///
-  ///\param graph is the graph for which the maps are stored in this object.
+  ///for different visualization attributes.
   MapStorage();
 
+  ///Destructor of MapStorage
+
+  ///Maps stored here are created with new. Destructor
+  ///deletes them to free up the reserved memory.
   ~MapStorage();
 
-  void changeActiveMap(bool, int, std::string);
-
-  std::string getActiveEdgeMap(int);
-  std::string getActiveNodeMap(int);
-
+  /// Registrates if the shown map by any attribute has changed to another.
+
+  ///It handles the \ref active_edgemaps and
+  ///\ref active_nodemaps vectors. It also emits \ref signal_prop signal to let
+  ///know the interested objects that the visible map of a certain
+  ///attribute has changed.
+  ///\param itisedge edgemap or nodemap has changed
+  ///\param prop the property of which the map is changed
+  ///\param mapname the visible map
+  void changeActiveMap(bool itisedge , int prop , std::string mapname);
+
+  /// Returns the active edgemap shown by a visualization property.
+
+  /// \param prop is the property
+  ///that shows the requested map.
+  std::string getActiveEdgeMap(int prop);
+
+  /// Returns the active nodemap shown by a visualization property.
+
+  /// \param prop is the property
+  ///that shows the requested map.
+  std::string getActiveNodeMap(int prop);
+
+  /// Returns the names of the edgemaps stored here.
   std::vector<std::string> getEdgeMapList();
+
+  /// Returns the names of the nodemaps stored here.
   std::vector<std::string> getNodeMapList();
 
+  ///returns \ref signal_prop to be able to connect functions to it
   Signal_Prop signal_prop_ch();
 
+  ///returns \ref signal_node_map to be able to connect functions to it
   sigc::signal<void, std::string> signal_node_map_ch(){return signal_node_map;};
+
+  ///returns \ref signal_edge_map to be able to connect functions to it
   sigc::signal<void, std::string> signal_edge_map_ch(){return signal_edge_map;};
 
+  ///Adds given map to storage.
+
+  ///A name and the map itself has to be provided.
+  ///\param mapname is the name of map
+  ///\param nodemap is the pointer of the given nodemap
+  ///\param def the default value of the map. If not given, it will be 0.
+  ///If new edge is added to graph the value of it in the map will be this.
+  ///\todo map should be given by reference!
+  ///\todo why is default value stored?
+  int addNodeMap(const std::string & mapname,Graph::NodeMap<double> * nodemap, double def=0.0);
+
   ///Adds given map to storage. A name and the map itself has to be provided.
-  ///\param name is the name of map
-  ///\nodemap is the pointer of the given nodemap
+
+  ///A name and the map itself has to be provided.
+  ///\param mapname is the name of map
+  ///\param edgemap is the pointer of the given edgemap
+  ///\param def the default value of the map. If not given, it will be 0.
+  ///If new edge is added to graph the value of it in the map will be this.
   ///\todo map should be given by reference!
-  int addNodeMap(const std::string &,Graph::NodeMap<double> *, double);
-
-  ///Adds given map to storage. A name and the map itself has to be provided.
-  ///\param name is the name of map
-  ///\edgemap is the pointer of the given edgemap
-  ///\todo map should be given by reference!
-  int addEdgeMap(const std::string &,Graph::EdgeMap<double> *, double);
+  int addEdgeMap(const std::string & mapname,Graph::EdgeMap<double> * edgemap, double def=0.0);
 
   ///Returns how much nodemaps is stored in \ref MapStorage
@@ -106,37 +164,72 @@
   int numOfEdgeMaps() {return edgemap_storage.size();};
 
-  ///Returns the maximum value of the given NodeMap. NodeMap has to be given by its name.
-  ///\param name is the name of map of which maximum is searched
-  double maxOfNodeMap(const std::string &);
-
-  ///Returns the maximum value of the given EdgeMap. EdgeMap has to be given by its name.
-  ///\param name is the name of map of which maximum is searched
-  double maxOfEdgeMap(const std::string &);
-
-  ///Returns the minimum value of the given NodeMap. NodeMap has to be given by its name.
-  ///\param name is the name of map of which minimum is searched
-  double minOfNodeMap(const std::string &);
-
-  ///Returns the minimum value of the given EdgeMap. EdgeMap has to be given by its name.
-  ///\param name is the name of map of which minimum is searched
-  double minOfEdgeMap(const std::string &);
-
-  ///To be able to iterate through each maps this function returns an iterator pointing to the first nodemap in the storage.
+  ///Returns the maximum value of the given NodeMap.
+
+  ///NodeMap has to be given by its name.
+  ///\param name the name of map of which maximum is searched
+  double maxOfNodeMap(const std::string & name);
+
+  ///Returns the maximum value of the given EdgeMap.
+
+  ///EdgeMap has to be given by its name.
+  ///\param name the name of map of which maximum is searched
+  double maxOfEdgeMap(const std::string & name);
+
+  ///Returns the minimum value of the given NodeMap.
+
+  ///NodeMap has to be given by its name.
+  ///\param name the name of map of which minimum is searched
+  double minOfNodeMap(const std::string & name);
+
+  ///Returns the minimum value of the given EdgeMap.
+
+  ///EdgeMap has to be given by its name.
+  ///\param name the name of map of which minimum is searched
+  double minOfEdgeMap(const std::string & name);
+
+  ///Returns iterator pointing to the first NodeMap in storage.
+
+  ///To be able to iterate through each maps this function
+  ///returns an iterator pointing to the first nodemap in
+  ///the storage.
   std::map< std::string,Graph::NodeMap<double> * >::iterator beginOfNodeMaps(){return nodemap_storage.begin();};
 
-  ///To be able to iterate through each maps this function returns an iterator pointing to the first edgemap in the storage.
+  ///Returns iterator pointing to the first EdgeMap in storage.
+
+  ///To be able to iterate through each maps this function
+  ///returns an iterator pointing to the first edgemap in
+  ///the storage.
   std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();};
 
-  ///To be able to iterate through each maps this function returns an iterator pointing to the last nodemap in the storage.
+  ///Returns iterator pointing after the last NodeMap in storage.
+
+  ///To be able to iterate through each maps this function
+  ///returns an iterator pointing to the last nodemap in the storage.
   std::map< std::string,Graph::NodeMap<double> * >::iterator endOfNodeMaps(){return nodemap_storage.end();};
 
-  ///To be able to iterate through each maps this function returns an iterator pointing to the last edgemap in the storage.
+  ///Returns iterator pointing after the last EdgeMap in storage.
+
+  ///To be able to iterate through each maps this function
+  ///returns an iterator pointing to the last edgemap in the storage.
   std::map< std::string,Graph::EdgeMap<double> * >::iterator endOfEdgeMaps(){return edgemap_storage.end();};
 
-  void mapChanged(bool, std::string);
-
+  ///Emits \ref signal_prop if mapvalues have changed, and MapStorage gets to know it.
+
+  ///If values in a map have changed, this function checks, whether it is displayed.
+  ///This check means searching the given mapname between active maps
+  ///(\ref active_nodemaps, \ref active_edgemaps). If it is there at a certain property,
+  ///it emits a signal with the property, where the gotten mapname was found. One signal
+  ///is emitted for each property displaying the given map.
+  ///\param itisedge whether the map an edgemap or nodemap
+  ///\param mapname name of map to visualize
+  void mapChanged(bool itisedge, std::string mapname);
+
+  ///Read datas from the given filename.
   int readFromFile(const std::string &);
+
+  ///Save datas to the given filename.
   void writeToFile(const std::string &);
 
+  ///Deletes all datastructures stored here.
   void clear();
 
