Index: gui/graph_displayer_canvas.h
===================================================================
--- gui/graph_displayer_canvas.h	(revision 1860)
+++ gui/graph_displayer_canvas.h	(revision 1888)
@@ -17,65 +17,178 @@
   friend class BrokenEdge;
 
+  ///Edge displayer class
+
+  ///This class is responsible for displaying edges in graph.
+  ///The displayed edge is broken in the middle. The
+  ///aim of this is to be able to indicate direction of edges
+  ///and to be able to display more then one edges between the
+  ///same source and target
   class BrokenEdge : public Gnome::Canvas::Line
   {
+    ///The edge that the class displays.
+
+    ///It is needed, because some datas needed from
+    ///graph can be accessed by this or should be sent
+    ///as parameter, but it would be complicated
     Edge edge;
+
+    ///Reference to the canvas, on which the graph is drawn.
+
+    ///It is needed, because some datas needed from
+    ///graph can be accessed by this or should be sent
+    ///as parameter, but it would be complicated
     GraphDisplayerCanvas & gdc;
+
+    ///An arrow that indicates the direction of the edges
+
+    ///in case of directional graph direction can be indicated
+    ///by this polygon. The polygon formulates a red arrow.
     Gnome::Canvas::Polygon * arrow;
 
-    ///Indicates whether the button of mouse is pressed or not
+    ///Indicates whether the button of mouse is pressed or not at the moment.
     bool isbutton;
 
-    ///At this location was the mousebutton pressed.
-    ///It helps to calculate the distance of dragging.
-    double clicked_x, clicked_y;
-
-    ///event handler for forming edges
-    bool edgeFormerEventHandler(GdkEvent*);
+    ///At this location was the mousebutton pressed. Horizontal component.
+
+    ///It helps to calculate the
+    ///distance of dragging.
+    double clicked_x;
+
+    ///At this location was the mousebutton pressed. Vertical component.
+
+    ///It helps to calculate the
+    ///distance of dragging.
+    double clicked_y;
+
+    ///event handler for forming broken edges
+
+    ///\param event the
+    ///event to handle
+    bool edgeFormerEventHandler(GdkEvent* event);
   public:
-    BrokenEdge(Gnome::Canvas::Group &, Edge, GraphDisplayerCanvas &);
+
+    ///Constructor of broken edge class.
+
+    ///\param g the group to which the edge belongs
+    ///\param _edge the represented edge
+    ///\param gc the canvas
+    BrokenEdge(Gnome::Canvas::Group & g, Edge _edge, GraphDisplayerCanvas & gc);
+
+    ///Destructor of broken edge class
+
+    ///Frees up
+    ///reserved memory
     ~BrokenEdge();
+
+    ///The function that draws the edge based on collected data
     void draw();
   };
+
+  ///Type of canvas, on which the graph is drawn
   typedef Gnome::Canvas::CanvasAA Parent;
 
 public:
-  GraphDisplayerCanvas(NoteBookTab &);
+  ///Constructor
+
+  ///\param nbt the tab of the window, in which the graph is displayed
+  GraphDisplayerCanvas(NoteBookTab & nbt);
+
+  ///destructor of the class
   virtual ~GraphDisplayerCanvas();
 
-  ///Changes the linewidth attribute according to the given map.
-  ///\param mapname is the name of the map which contains the new values
-  int changeEdgeWidth (std::string mapname, Edge new_item=INVALID);
-  int resetEdgeWidth (Edge new_item=INVALID);
-
-  ///Changes the linecolor attribute according to the given map.
-  ///\param mapname is the name of the map which contains the new values
-  int changeEdgeColor (std::string mapname, Edge new_item=INVALID);
-  int resetEdgeColor (Edge new_item=INVALID);
-
-  ///Changes the text of line attribute according to the given map.
-  ///\param mapname is the name of the map which contains the new values
-  int changeEdgeText (std::string mapname, Edge new_item=INVALID);
-  int resetEdgeText (Edge new_item=INVALID);
-
-  ///Changes the linewidth attribute according to the given map.
-  ///\param mapname is the name of the map which contains the new values
-  int changeNodeRadius (std::string mapname, Node new_item=INVALID);
-  int resetNodeRadius (Node new_item=INVALID);
-
-  ///Changes the linecolor attribute according to the given map.
-  ///\param mapname is the name of the map which contains the new values
-  int changeNodeColor (std::string mapname, Node new_item=INVALID);
-  int resetNodeColor (Node new_item=INVALID);
-
-  ///Changes the text of line attribute according to the given map.
-  ///\param mapname is the name of the map which contains the new values
-  int changeNodeText (std::string mapname, Node new_item=INVALID);
-  int resetNodeText (Node new_item=INVALID);
-
-  void propertyChange(bool, int);
-  void propertyUpdate(Edge, int, int dummy=0);
-  void propertyUpdate(Node, int, int dummy=0);
-
+  ///Changes the width of edge(s) according to the given map.
+
+  ///\param mapname is the name of the map which contains the values to be set
+  ///\param edge if it is given, only the width of the given edge will be set, instead of all of them.
+  int changeEdgeWidth (std::string mapname, Edge edge=INVALID);
+
+  ///Resets width of edge(s) to the default value
+
+  ///\param edge if it is given, only the width of the
+  ///given edge will be reset, instead of all of them.
+  int resetEdgeWidth (Edge edge=INVALID);
+
+  ///Changes the color of edge(s) according to the given map.
+
+  ///\param mapname is the name of the map which contains the new values
+  ///\param edge if it is given, only the color of the given edge will be set, instead of all of them.
+  int changeEdgeColor (std::string mapname, Edge edge=INVALID);
+
+  ///Resets color of edge(s) to the default value
+
+  ///\param edge if it is given, only the color of the
+  ///given edge will be reset, instead of all of them.
+  int resetEdgeColor (Edge edge=INVALID);
+
+  ///Changes the label of edge(s) according to the given map.
+
+  ///\param mapname is the name of the map which contains the new values
+  ///\param edge if it is given, only the label of the given edge will be set, instead of all of them.
+  int changeEdgeText (std::string mapname, Edge edge=INVALID);
+
+  ///Resets label of edge(s) to the default value
+
+  ///\param edge if it is given, only the color of the
+  ///given edge will be reset, instead of all of them.
+  int resetEdgeText (Edge edge=INVALID);
+
+  ///Changes the radius of node(s) according to the given map.
+
+  ///\param mapname is the name of the map which contains the new values
+  ///\param node if it is given, only the radius of the given node will be set, instead of all of them.
+  int changeNodeRadius (std::string mapname, Node node=INVALID);
+
+  ///Resets radius of node(s) to the default value
+
+  ///\param node if it is given, only the radius of the
+  ///given node will be reset, instead of all of them.
+  int resetNodeRadius (Node node=INVALID);
+
+  ///Changes the color of node(s) according to the given map.
+
+  ///\param mapname is the name of the map which contains the new values
+  ///\param node if it is given, only the color of the given node will be set, instead of all of them.
+  int changeNodeColor (std::string mapname, Node node=INVALID);
+
+  ///Resets color of node(s) to the default value
+
+  ///\param node if it is given, only the color of the
+  ///given node will be reset, instead of all of them.
+  int resetNodeColor (Node node=INVALID);
+
+  ///Changes the label of node(s) according to the given map.
+
+  ///\param mapname is the name of the map which contains the new values
+  ///\param node if it is given, only the label of the given node will be set, instead of all of them.
+  int changeNodeText (std::string mapname, Node node=INVALID);
+
+  ///Resets label of node(s) to the default value
+
+  ///\param node if it is given, only the label of the
+  ///given node will be reset, instead of all of them.
+  int resetNodeText (Node node=INVALID);
+
+  ///This function is called, when any of the displayed attributes have to be updated, or changed
+
+  ///\param itisedge if true, edge property has to be changed, else node property
+  ///\param prop the id of property that has to changed or updated
+  void propertyChange(bool itisedge, int prop);
+
+  ///updates the given property
+
+  ///\param edge if it is not INVALID, only the property of the given edge will be updated, instead of all of them
+  ///\param prop the property to update
+  void propertyUpdate(Edge edge, int prop);
+
+  ///updates the given property
+
+  ///\param node if it is not INVALID, only the property of the given node will be updated, instead of all of them
+  ///\param prop the property to update
+  void propertyUpdate(Node node, int prop);
+
+  ///updates all the property for the given edge
   void propertyUpdate(Edge);
+
+  ///updates all the property for the given node
   void propertyUpdate(Node);
 
@@ -96,5 +209,5 @@
 protected:
 
-  //maximizing, minimizing, restoring window, etc. 
+  //maximizing, minimizing, restoring window, etc.
   virtual bool on_expose_event(GdkEventExpose *);
 
@@ -128,9 +241,10 @@
   ///Moves the text to new place
   void textReposition(xy<double>);
+
   ///Activates an edge belonging to a BrokenEdge
-  ///
+
   ///After we have activated an edge this way,
   ///the GDC object will know, which edge is under forming
-  ///therefore it can redraw the necessarz elementy on the canvas,
+  ///therefore it can redraw the necessary elements on the canvas,
   ///for example the text belonging to the \ref BrokenEdge can be
   ///redrawn (\ref textReposition).
@@ -138,14 +252,29 @@
 
 public:
-  ///\return the actual tool in hand
+
+  ///Returns the actual tool in hand
   int getActualTool();
 
+  ///draws the graph
+
+  ///Called when opening a file.
   void drawGraph();
+
+  ///Clears the canvas
+
+  ///It achieves this by deleting all data
+  ///structure used to help handle the displayed graph.
   void clear();
 
   ///creates a new Nodemap
-  int addNewNodeMap(double,std::string);
+
+  ///\param init initial value of the map
+  ///\param mapname name of new map
+  int addNewNodeMap(double init,std::string mapname);
   ///creates a new Edgemap
-  int addNewEdgeMap(double,std::string);
+
+  ///\param init initial value of the map
+  ///\param mapname name of new map
+  int addNewEdgeMap(double init,std::string mapname);
 
 private:
@@ -184,13 +313,35 @@
 
   ///Remembers which Gnome::Canvas::Item was pressed.
-  ///this variable is needed, because
-  ///1. we cannot query the item at he cursor as fast as it could not cause a Segmentation Fault
-  ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
-  Gnome::Canvas::Item * active_item, * target_item;
+
+  ///this variable is needed, to work on it after selection
+  Gnome::Canvas::Item * active_item;
+
+  ///Remembers which Gnome::Canvas::Item was pressed.
+
+  ///this variable is used at edge creation, it will
+  ///be the secondly selected node. No local variable
+  ///can be used for this purpose inside the function,
+  ///because the node selected by button press, and
+  ///the edge is created by button release. Both of
+  ///them is different function call.
+  Gnome::Canvas::Item * target_item;
+
+  ///selected node (for any editing)
   Node active_node;
+
+  ///selected edge (for any editing)
   Edge active_edge;
+
+  ///the edge that is selected by clicking on the red arrow in the middle of it
+
+  ///This edge is stored only for the purpose of reshape it.
+  ///That is why it is selected in a different manner.
   Edge forming_edge;
 
-  std::string nodemap_to_edit, edgemap_to_edit;
+  ///Map displayed by label can be edited.
+  std::string nodemap_to_edit;
+
+  ///Map displayed by label can be edited.
+  std::string edgemap_to_edit;
 
   static const int zoom_step = 5;
@@ -198,5 +349,5 @@
 private:
 
-  ///reference to the parent window
+  ///reference to the container, in which the canvas is
   NoteBookTab & mytab;
 
