Index: src/gui/Makefile.am
===================================================================
--- src/gui/Makefile.am	(revision 1404)
+++ src/gui/Makefile.am	(revision 1412)
@@ -1,1 +1,19 @@
-SUBDIRS = src
+AM_CPPFLAGS = -I$(top_srcdir)/src
+LDADD = $(top_builddir)/src/lemon/libemon.la
+
+bin_PROGRAMS = gd
+
+gd_SOURCES = \
+	all_include.h \
+	graph_displayer_canvas.cc \
+	graph_displayer_canvas.h \
+	graph-displayer.cc \
+	main_win.cc \
+	main_win.h \
+	mapstorage.cc \
+	mapstorage.h \
+	map_win.cc \
+	map_win.h
+
+gd_CXXFLAGS = $(GTK_CFLAGS)
+gd_LDFLAGS = $(GTK_LIBS)
Index: src/gui/all_include.h
===================================================================
--- src/gui/all_include.h	(revision 1412)
+++ src/gui/all_include.h	(revision 1412)
@@ -0,0 +1,39 @@
+// -*- C++ -*- //
+
+#ifndef ALL_INCLUDE_H
+#define ALL_INCLUDE_H
+
+#include <fstream>
+#include <iostream>
+
+#include <vector>
+
+#include <lemon/list_graph.h>
+#include <lemon/graph_reader.h>
+#include <lemon/graph_writer.h>
+#include <lemon/graph_utils.h>
+#include <lemon/maps.h>
+#include <lemon/error.h>
+#include <lemon/xy.h>
+
+enum {WIDTH, COLOR, TEXT, PROPERTY_NUM};// properties;
+#define RANGE 3
+#define WIN_WIDTH 900
+#define WIN_HEIGHT 600
+
+
+#ifndef MAIN_PART
+extern std::string * property_strings;
+extern double * property_defaults;
+#endif //MAIN_PART
+
+using namespace lemon;
+
+typedef xy<double> Coordinates;
+typedef ListGraph Graph;
+typedef Graph::NodeMap<Coordinates> CoordinatesMap;
+typedef Graph::Node Node;
+typedef Graph::EdgeIt EdgeIt;
+typedef Graph::NodeIt NodeIt;
+
+#endif // ALL_INCLUDE_H
Index: src/gui/graph-displayer.cc
===================================================================
--- src/gui/graph-displayer.cc	(revision 1412)
+++ src/gui/graph-displayer.cc	(revision 1412)
@@ -0,0 +1,73 @@
+#include <all_include.h>
+#include <mapstorage.h>
+#include <main_win.h>
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+#define MAIN_PART
+
+std::string * property_strings;
+double * property_defaults;
+
+
+int main(int argc, char *argv[])
+{
+  property_strings=new std::string[PROPERTY_NUM];
+  property_strings[WIDTH]="Width";
+  property_strings[COLOR]="Color";
+  property_strings[TEXT]="Text";
+
+  property_defaults=new double[PROPERTY_NUM];
+  property_defaults[WIDTH]=10.0;
+  property_defaults[COLOR]=100;
+  property_defaults[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);
+
+  //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);
+  Graph::NodeMap<double> nodedata (g);
+
+  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();
+
+  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);
+
+  Gnome::Canvas::init();
+  Gtk::Main app(argc, argv);
+
+  MainWin mainwin("Displayed Graph", g, cm, ms);
+  app.run(mainwin);
+
+  return 0;
+}
Index: src/gui/graph_displayer_canvas.cc
===================================================================
--- src/gui/graph_displayer_canvas.cc	(revision 1412)
+++ src/gui/graph_displayer_canvas.cc	(revision 1412)
@@ -0,0 +1,259 @@
+#include <graph_displayer_canvas.h>
+
+GraphDisplayerCanvas::GraphDisplayerCanvas(Graph & gr, CoordinatesMap & cm, MapStorage & ms):g(gr),nodesmap(g),edgesmap(g),edgetextmap(g),displayed_graph(*(root()), 0, 0),mapstorage(ms),isbutton(false),active_item(NULL)
+{
+
+  for (EdgeIt i(g); i!=INVALID; ++i)
+  {
+    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));
+    
+    edgesmap[i]=new Gnome::Canvas::Line(displayed_graph, coos);
+    *(edgesmap[i]) << Gnome::Canvas::Properties::fill_color("green");
+    edgesmap[i]->property_width_pixels().set_value(10);
+    
+    
+    double x1, x2, y1, y2;
+    edgesmap[i]->get_bounds(x1, y1, x2, y2);
+    
+    edgetextmap[i]=new Gnome::Canvas::Text(displayed_graph,(x1+x2)/2, (y1+y2)/2, "");
+    edgetextmap[i]->property_fill_color().set_value("black");
+  }
+
+  NodeIt i(g);
+  int maxx=0, maxy=0, minx=(int)cm[i].x, miny=(int)cm[i].y;
+
+  for (; i!=INVALID; ++i)
+  {
+    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;
+
+    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]) << Gnome::Canvas::Properties::fill_color("blue");
+    *(nodesmap[i]) << Gnome::Canvas::Properties::outline_color("black");
+    (nodesmap[i])->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &GraphDisplayerCanvas::event_handler),i));
+  }
+
+  double biggest_x=(abs(maxx)>abs(minx))?(abs(maxx)+80):(abs(minx)+80);
+  double biggest_y=(abs(maxy)>abs(miny))?(abs(maxy)+80):(abs(miny)+80);
+
+  set_pixels_per_unit((biggest_x>biggest_y)?(WIN_WIDTH/biggest_x/2):(WIN_HEIGHT/biggest_y/2));
+  std::cout<<abs(maxx)<<" "<<abs(minx)<<" big x "<<biggest_x<<" "<<abs(maxy)<<" "<<abs(miny)<<" big y "<<biggest_y<<std::endl;
+  std::cout<<maxx<<" "<<minx<<" big x "<<biggest_x<<" "<<maxy<<" "<<miny<<" big y "<<biggest_y<<std::endl;
+  std::cout<<"dx "<<(maxx-minx)<<" dy "<<(maxy-miny)<<" xrate "<<((maxx-minx)/WIN_WIDTH)<<" yrate "<<((maxy-miny)/WIN_HEIGHT)<<std::endl;
+
+}
+
+GraphDisplayerCanvas::~GraphDisplayerCanvas()
+{
+    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)
+    {
+        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;
+    }
+
+    GraphWriter<Graph> writer(std::cout,g);
+
+    writer.writeNodeMap("id", id);
+    writer.writeNodeMap("coordinates_x", xc);
+    writer.writeNodeMap("coordinates_y", yc);
+    writer.run();
+}
+
+int GraphDisplayerCanvas::changeLineWidth (std::string mapname)
+{
+  for (EdgeIt i(g); i!=INVALID; ++i)
+  {
+    int w=(int)(*(mapstorage.edgemap_storage)[mapname])[i];
+    edgesmap[i]->property_width_pixels().set_value(w);
+  }
+  return 0;
+};
+
+int GraphDisplayerCanvas::changeColor (std::string mapname)
+{  
+  for (EdgeIt i(g); i!=INVALID; ++i)
+  {
+    double w=(*(mapstorage.edgemap_storage)[mapname])[i];
+    double max=mapstorage.maxOfEdgeMap(mapname);
+    double min=mapstorage.minOfEdgeMap(mapname);
+      
+    //std::cout<<w<<" "<<max<<" "<<min<<" "<<100*(w-min)/(max-min)<<std::endl;
+    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]->property_fill_color_gdk().set_value(color);
+  }
+  return 0;
+};
+
+int GraphDisplayerCanvas::changeText (std::string mapname)
+{
+  for (EdgeIt i(g); i!=INVALID; ++i)
+  {
+    if(mapname!="Text")
+    {
+      double number=(*(mapstorage.edgemap_storage)[mapname])[i];
+      int length=(int)(floor(log(number)/log(10)))+1;
+      int maxpos=(int)(pow(10,length-1));
+      int strl=length+1+RANGE;
+      char * str=new char[strl];
+      str[length]='.';
+      str[strl]='\0';
+      
+      for(int j=0;j<strl;j++)
+      {
+	if(j!=length)
+        {
+	  int digit=(int)(number/maxpos);
+	  str[j]=(digit+'0');
+	  number-=digit*maxpos;
+	  number*=10;
+        }
+      }
+      
+      edgetextmap[i]->property_text().set_value(str);
+    }
+    else
+    {
+      edgetextmap[i]->property_text().set_value("");
+    }
+  }
+  return 0;
+};
+
+
+int GraphDisplayerCanvas::rezoom ()
+{
+  double x1, x2, y1, y2;
+  int x,y;
+
+  NodeIt i(g);
+  nodesmap[i]->get_bounds(x1, y1, x2, y2);
+
+  x=(int)((x1+x2)/2);
+  y=(int)((y1+y2)/2);
+  
+  int maxx=0, maxy=0, minx=(int)x, miny=(int)y;
+
+  for (; i!=INVALID; ++i)
+  {
+    nodesmap[i]->get_bounds(x1, y1, x2, y2);
+
+    x=(int)((x1+x2)/2);
+    y=(int)((y1+y2)/2);
+
+    if(x>maxx)maxx=x;
+    if(y>maxy)maxy=y;
+    if(x<minx)minx=x;
+    if(y<miny)miny=y;
+  }
+
+  double biggest_x=(abs(maxx)>abs(minx))?(abs(maxx)+80):(abs(minx)+80);
+  double biggest_y=(abs(maxy)>abs(miny))?(abs(maxy)+80):(abs(miny)+80);
+
+  set_pixels_per_unit((biggest_x-WIN_WIDTH>biggest_y-WIN_HEIGHT)?(WIN_WIDTH/biggest_x/2):(WIN_HEIGHT/biggest_y/2));
+  return 0;
+};
+
+
+///This function moves only one node of displayed_graph,
+///but recalculate the location of weight point,
+///and also redraw the sides of the planefigure.
+bool GraphDisplayerCanvas::event_handler(GdkEvent* e, Node n)
+{
+  switch(e->type)
+  {
+    case GDK_BUTTON_PRESS:
+      clicked_x=e->button.x;
+      clicked_y=e->button.y;
+      active_item=(get_item_at(e->button.x, e->button.y));
+      isbutton=true;
+      break;
+    case GDK_BUTTON_RELEASE:
+      isbutton=false;
+      active_item=NULL;
+      break;
+    case GDK_MOTION_NOTIFY:
+      if(isbutton)
+      {
+        double dx=e->motion.x-clicked_x;
+        double dy=e->motion.y-clicked_y;
+        active_item->move(dx, dy);
+        clicked_x=e->motion.x;
+        clicked_y=e->motion.y;
+
+        EdgeIt e;
+
+        g.firstOut(e,n);
+        for(;e!=INVALID;g.nextOut(e))
+        {
+            Gnome::Canvas::Points coos;
+            double x1, x2, y1, y2;
+
+            nodesmap[g.source(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            edgesmap[e]->property_points().set_value(coos);
+
+	    edgesmap[e]->get_bounds(x1, y1, x2, y2);
+
+	    edgetextmap[e]->property_x().set_value((x1+x2)/2);
+	    edgetextmap[e]->property_y().set_value((y1+y2)/2);
+        }
+
+        g.firstIn(e,n);
+        for(;e!=INVALID;g.nextIn(e))
+        {
+            Gnome::Canvas::Points coos;
+            double x1, x2, y1, y2;
+
+            nodesmap[g.source(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            nodesmap[g.target(e)]->get_bounds(x1, y1, x2, y2);
+            coos.push_back(Gnome::Art::Point((x1+x2)/2,(y1+y2)/2));
+
+            edgesmap[e]->property_points().set_value(coos);
+
+	    edgesmap[e]->get_bounds(x1, y1, x2, y2);
+
+	    edgetextmap[e]->property_x().set_value((x1+x2)/2);
+	    edgetextmap[e]->property_y().set_value((y1+y2)/2);
+        }
+      }
+    default: break;
+  }
+  return true;
+}
+
+bool GraphDisplayerCanvas::on_expose_event(GdkEventExpose *event)
+{
+  Gnome::Canvas::CanvasAA::on_expose_event(event);
+  //usleep(10000);
+  //rezoom();
+  return true;
+}
Index: src/gui/graph_displayer_canvas.h
===================================================================
--- src/gui/graph_displayer_canvas.h	(revision 1412)
+++ src/gui/graph_displayer_canvas.h	(revision 1412)
@@ -0,0 +1,65 @@
+// -*- C++ -*- //
+
+#ifndef GRAPH_DISPLAYER_CANVAS_H
+#define GRAPH_DISPLAYER_CANVAS_H
+
+#include <all_include.h>
+#include <mapstorage.h>
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+class GraphDisplayerCanvas : public Gnome::Canvas::CanvasAA
+{
+  typedef Gnome::Canvas::CanvasAA Parent;
+
+public:
+  GraphDisplayerCanvas(Graph &, CoordinatesMap &, MapStorage &);
+  virtual ~GraphDisplayerCanvas();
+
+  int changeLineWidth (std::string mapname);
+  int changeColor (std::string mapname);
+  int changeText (std::string mapname);
+  int rezoom();
+
+protected:
+
+  virtual bool on_expose_event(GdkEventExpose *);
+
+private:
+
+  ///Event handler function that handles dragging nodes of displayed_graph
+  bool event_handler(GdkEvent* e, Node n);
+
+  ///The graph, on which we work
+  Graph g;
+  ///Map of nodes of planefigure
+  Graph::NodeMap<Gnome::Canvas::Ellipse *> nodesmap;
+  ///Map of edges of planefigure
+  Graph::EdgeMap<Gnome::Canvas::Line *> edgesmap;
+
+  ///Map of texts to write on edges
+  Graph::EdgeMap<Gnome::Canvas::Text *> edgetextmap;
+
+  ///Group of graphical elements of displayed_graph
+  Gnome::Canvas::Group displayed_graph;
+
+  ///Here we store the maps that can be displayed through properties.
+  MapStorage mapstorage;
+
+  ///Indicates whether the button of mouse is pressed or not
+  bool isbutton;
+
+  ///At this location was the mousebutton pressed.
+  ///It helps to calculate the distance of dragging.
+  double clicked_x, clicked_y;
+
+  ///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;
+
+
+};
+
+#endif //GRAPH_DISPLAYER_CANVAS_H
Index: src/gui/graphocska.lgf
===================================================================
--- src/gui/graphocska.lgf	(revision 1412)
+++ src/gui/graphocska.lgf	(revision 1412)
@@ -0,0 +1,39 @@
+@nodeset
+id	coordinates_x	coordinates_y data
+1	230	-80	1
+2	230	100	3
+3	120	-80	5
+4	120	100	7
+5	20	100	9
+6	20	-80	11
+7	-40	10	13
+8	-100	100	15
+9	-100	10	17
+10	-100	-80	19
+11	-200	-80	21
+12	-200	10	23
+13	-200	100	25
+14	-300	100	27
+15	-300	-80	29
+
+@edgeset
+	        cap	map1	map2	map3	map4
+15	14	1	21	111	231	3
+14	13	2	22	112	232	6
+13	12	3	23	113	233	9
+13	8	4	24	114	234	12
+12	11	5	25	115	235	15
+12	9	6	26	116	236	18
+11	10	7	27	117	237	21
+10	9	8	28	118	238	24
+10	7	9	29	119	239	27
+9	8	10	30	120	230	30
+7	6	11	31	121	241	33
+6	5	12	32	122	242	36
+6	3	13	33	123	243	39
+5	4	14	34	124	244	42
+4	3	15	35	125	245	45
+3	2	16	36	126	246	48
+2	1	17	37	127	247	51
+
+@end
Index: src/gui/main_win.cc
===================================================================
--- src/gui/main_win.cc	(revision 1412)
+++ src/gui/main_win.cc	(revision 1412)
@@ -0,0 +1,69 @@
+#include <main_win.h>
+
+MainWin::MainWin(const std::string& title, Graph & graph, CoordinatesMap & cm, MapStorage & ms):mapwin("Map Setup", ms, gd_canvas),gd_canvas(graph, cm, ms)
+{
+  set_title (title);
+  set_default_size(WIN_WIDTH,WIN_HEIGHT);
+  add(vbox);
+
+  ag=Gtk::ActionGroup::create();
+  ag->add( Gtk::Action::create("ShowMenu", "_Show") );
+  ag->add( Gtk::Action::create("ShowMaps", "_Maps"), sigc::mem_fun(*this, &MainWin::showMaps));
+  ag->add( Gtk::Action::create("FileMenu", "_File") );
+  ag->add( Gtk::Action::create("FileQuit", "_Quit"), sigc::mem_fun(*this, &MainWin::quit));
+  ag->add( Gtk::Action::create("ZoomMenu", "_Zoom") );
+  ag->add( Gtk::Action::create("ZoomRezoom", "_Rezoom"), sigc::mem_fun(*this, &MainWin::rezoom)); //!!!!!!
+
+  uim=Gtk::UIManager::create();
+  uim->insert_action_group(ag);
+  add_accel_group(uim->get_accel_group());
+
+  try
+  {
+
+    Glib::ustring ui_info =
+      "<ui>"
+      "  <menubar name='MenuBar'>"
+      "    <menu action='FileMenu'>"
+      "      <menuitem action='FileQuit'/>"
+      "    </menu>"
+      "    <menu action='ShowMenu'>"
+      "      <menuitem action='ShowMaps'/>"
+      "    </menu>"
+      "    <menu action='ZoomMenu'>"
+      "      <menuitem action='ZoomRezoom'/>"
+      "    </menu>"
+      "  </menubar>"
+      "</ui>";
+
+    uim->add_ui_from_string(ui_info);
+
+  }
+  catch(const Glib::Error& ex)
+  {
+    std::cerr << "building menus failed: " <<  ex.what();
+  }
+
+  Gtk::Widget* menubar = uim->get_widget("/MenuBar");
+  if(menubar)vbox.pack_start(*menubar, Gtk::PACK_SHRINK);
+
+  vbox.pack_start(gd_canvas);
+
+  show_all_children();
+}
+
+void MainWin::showMaps()
+{
+  mapwin.show();
+}
+
+void MainWin::quit()
+{
+  hide();
+}
+
+void MainWin::rezoom()
+{
+  gd_canvas.rezoom();
+}
+
Index: src/gui/main_win.h
===================================================================
--- src/gui/main_win.h	(revision 1412)
+++ src/gui/main_win.h	(revision 1412)
@@ -0,0 +1,44 @@
+// -*- C++ -*- //
+
+#ifndef MAIN_WIN_H
+#define MAIN_WIN_H
+
+#include <all_include.h>
+#include <mapstorage.h>
+#include <map_win.h>
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+class MainWin : public Gtk::Window
+{
+public:
+  MainWin(const std::string& title, Graph &, CoordinatesMap &, MapStorage &);
+
+protected:
+  //Window of map-showing setup
+  MapWin mapwin;
+
+  //Member widgets:
+  GraphDisplayerCanvas gd_canvas;
+
+  //ActionGroup for menu
+  Glib::RefPtr<Gtk::ActionGroup> ag;
+
+  //UIManager for menu
+  Glib::RefPtr<Gtk::UIManager> uim;
+
+  //Container
+  Gtk::VBox vbox;
+
+  //Pops up map-setup window
+  virtual void showMaps();
+
+  //Exit
+  virtual void quit();
+
+  //Refit screen
+  virtual void rezoom();
+
+};
+
+#endif //MAIN_WIN_H
Index: src/gui/map_win.cc
===================================================================
--- src/gui/map_win.cc	(revision 1412)
+++ src/gui/map_win.cc	(revision 1412)
@@ -0,0 +1,116 @@
+#include <map_win.h>
+#include <set>
+
+MapWin::MapWin(const std::string& title, MapStorage & mapst, GraphDisplayerCanvas & grdispc):gdc(grdispc),ms(mapst)
+{
+  set_title(title);
+  set_default_size(400, 200);
+
+  rb_array=new Gtk::RadioButton * [PROPERTY_NUM];
+  vbox_r1=new Gtk::VBox[PROPERTY_NUM];
+  vbox_r2=new Gtk::VBox[PROPERTY_NUM];
+  radios=new Gtk::HBox[PROPERTY_NUM];
+  for(int i=0;i<PROPERTY_NUM;i++)
+  {
+    rb_array[i]=new Gtk::RadioButton[ms.numOfEdgeMaps()+1];
+
+    Gtk::RadioButton::Group group;
+
+    std::map< std::string,Graph::EdgeMap<double> * >::iterator emsi=ms.beginOfEdgeMaps();
+    std::set<int> props;
+
+    int actprop;
+    for(int j=0;j<ms.numOfEdgeMaps();j++)
+    {
+
+      if(emsi->second==&(ms.default_edgemaps[i]))
+      {
+	actprop=j;
+      }
+      for(int k=0;k<PROPERTY_NUM;k++)
+      {
+	if(emsi->second==&(ms.default_edgemaps[k]))
+	{
+	  props.insert(j);
+	}
+      }
+      emsi++;
+    }
+
+    rb_array[i][0].set_group(group);
+    rb_array[i][0].set_label("Default");
+    rb_array[i][0].signal_clicked().connect( sigc::bind( sigc::bind( sigc::mem_fun(*this, &MapWin::radio_click), 0), i) );
+    vbox_r1[i].pack_start(rb_array[i][0]);
+
+
+    emsi=ms.beginOfEdgeMaps();
+    int actpos=1;
+    for(int j=0;j<ms.numOfEdgeMaps();j++)
+    {
+      if( ( props.find(j) )==( props.end() ) )
+      {
+	rb_array[i][actpos].set_group(group);
+	rb_array[i][actpos].set_label(emsi->first);
+	rb_array[i][actpos].signal_clicked().connect
+	  (
+	   sigc::bind( 
+	    sigc::bind(
+	     sigc::mem_fun(*this, &MapWin::radio_click),
+	     actpos
+	    ),
+	    i
+	   ) 
+	  );
+
+    	if(actpos<(ms.numOfEdgeMaps()-PROPERTY_NUM+1)/2)
+        {
+          vbox_r1[i].pack_start(rb_array[i][actpos]);
+	}
+	else
+        {
+	  vbox_r2[i].pack_start(rb_array[i][actpos]);
+	}
+	actpos++;
+      }
+      emsi++;
+    }
+    radios[i].pack_start(vbox_r1[i]);
+    radios[i].pack_start(vbox_r2[i]);
+    notebook.append_page(radios[i], property_strings[i]);
+  }
+
+  add(vbox_b);
+  vbox_b.pack_start(notebook);
+
+  show_all_children();
+
+}
+
+void MapWin::radio_click(int prop, int actpos)
+{
+  if(rb_array[prop][actpos].get_active())
+  {
+
+    std::string mapname=rb_array[prop][actpos].get_label();
+
+    if(mapname=="Default")
+    {
+      mapname=property_strings[prop];
+    }
+
+    switch(prop)
+    {
+      case WIDTH:
+        gdc.changeLineWidth(mapname);
+        break;
+      case COLOR:
+        gdc.changeColor(mapname);
+        break;
+      case TEXT:
+        gdc.changeText(mapname);
+        break;
+      default:
+        std::cout<<"Error\n";
+    }
+  }
+};
Index: src/gui/map_win.h
===================================================================
--- src/gui/map_win.h	(revision 1412)
+++ src/gui/map_win.h	(revision 1412)
@@ -0,0 +1,30 @@
+// -*- C++ -*- //
+
+#ifndef MAP_WIN_H
+#define MAP_WIN_H
+
+#include <all_include.h>
+#include <mapstorage.h>
+#include <graph_displayer_canvas.h>
+#include <libgnomecanvasmm.h>
+#include <libgnomecanvasmm/polygon.h>
+
+class MapWin : public Gtk::Window
+{
+protected:
+  GraphDisplayerCanvas & gdc;
+  MapStorage & ms;
+
+  Gtk::HBox * radios;
+  Gtk::RadioButton ** rb_array;
+
+  Gtk::VBox vbox_b, * vbox_r1, * vbox_r2;
+  Gtk::Notebook notebook;
+  Gtk::Label * labels;
+
+public:
+  MapWin(const std::string& title, MapStorage &, GraphDisplayerCanvas &);
+  virtual void radio_click(int, int);
+};
+
+#endif //MAP_WIN_H
Index: src/gui/mapstorage.cc
===================================================================
--- src/gui/mapstorage.cc	(revision 1412)
+++ src/gui/mapstorage.cc	(revision 1412)
@@ -0,0 +1,89 @@
+#include <mapstorage.h>
+
+MapStorage::MapStorage(Graph & graph):g(graph)
+{
+  for(int i=0;i<PROPERTY_NUM;i++)
+  {
+    Graph::EdgeMap<double> emd(g);
+    default_edgemaps.push_back(emd);
+    Graph::NodeMap<double> nmd(g);
+    default_nodemaps.push_back(nmd);
+  }
+
+  //std::string defaultstr="Default ";
+  for(int i=0;i<PROPERTY_NUM;i++)
+  {
+      for (EdgeIt j(g); j!=INVALID; ++j)
+      {
+	(default_edgemaps[i])[j]=property_defaults[i];
+      }
+      addEdgeMap(property_strings[i],&(default_edgemaps[i]));
+  }
+
+};
+
+int MapStorage::addNodeMap(const std::string & name, Graph::NodeMap<double> *nodemap)
+{
+  nodemap_storage[name]=nodemap;
+  return 0;
+}
+int MapStorage::addEdgeMap(const std::string & name, Graph::EdgeMap<double> *edgemap)
+{
+  edgemap_storage[name]=edgemap;
+  return 0;
+}
+
+double MapStorage::maxOfNodeMap(const std::string & name)
+{
+  double max=0;
+  for (NodeIt j(g); j!=INVALID; ++j)
+  {
+    if( (*nodemap_storage[name])[j]>max )
+    {
+      max=(*nodemap_storage[name])[j];
+    }
+  }
+  return max;
+}
+
+double MapStorage::maxOfEdgeMap(const std::string & name)
+{
+  double max=0;
+  for (EdgeIt j(g); j!=INVALID; ++j)
+  {
+    if( (*edgemap_storage[name])[j]>max )
+    {
+      max=(*edgemap_storage[name])[j];
+    }
+  }
+  return max;
+}
+
+double MapStorage::minOfNodeMap(const std::string & name)
+{
+  NodeIt j(g);
+  double min=(*nodemap_storage[name])[j];
+  for (; j!=INVALID; ++j)
+  {
+    if( (*nodemap_storage[name])[j]<min )
+    {
+      min=(*nodemap_storage[name])[j];
+    }
+  }
+  return min;
+}
+
+double MapStorage::minOfEdgeMap(const std::string & name)
+{
+  EdgeIt j(g);
+  double min=(*edgemap_storage[name])[j];
+  for (EdgeIt j(g); j!=INVALID; ++j)
+  {
+    if( (*edgemap_storage[name])[j]<min )
+    {
+      min=(*edgemap_storage[name])[j];
+    }
+  }
+  return min;
+}
+
Index: src/gui/mapstorage.h
===================================================================
--- src/gui/mapstorage.h	(revision 1412)
+++ src/gui/mapstorage.h	(revision 1412)
@@ -0,0 +1,37 @@
+// -*- C++ -*- //
+
+#ifndef MAPSTORAGE_H
+#define MAPSTORAGE_H
+
+#include <all_include.h>
+
+class MapStorage
+{
+
+public: ///!!!!!!!!
+  Graph g;
+  std::map< std::string,Graph::NodeMap<double> * > nodemap_storage;
+  std::map< std::string,Graph::EdgeMap<double> * > edgemap_storage;
+
+  std::vector<Graph::NodeMap<double> > default_nodemaps;
+  std::vector<Graph::EdgeMap<double> > default_edgemaps;
+
+public:
+  MapStorage(Graph &);
+  int addNodeMap(const std::string &,Graph::NodeMap<double> *);
+  int addEdgeMap(const std::string &,Graph::EdgeMap<double> *);
+
+  int numOfNodeMaps() {return nodemap_storage.size();};
+  int numOfEdgeMaps() {return edgemap_storage.size();};
+
+  double maxOfNodeMap(const std::string &);
+  double maxOfEdgeMap(const std::string &);
+
+  double minOfNodeMap(const std::string &);
+  double minOfEdgeMap(const std::string &);
+
+  std::map< std::string,Graph::NodeMap<double> * >::iterator beginOfNodeMaps(){return nodemap_storage.begin();};
+  std::map< std::string,Graph::EdgeMap<double> * >::iterator beginOfEdgeMaps(){return edgemap_storage.begin();};
+};
+
+#endif //MAPSTORAGE_H
Index: src/gui/src/Makefile.am
===================================================================
--- src/gui/src/Makefile.am	(revision 1404)
+++ 	(revision )
@@ -1,6 +1,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/src
-LDADD = $(top_builddir)/src/lemon/libemon.la
-
-bin_PROGRAMS = gui
-
-gui_SOURCES = main.cc
Index: src/gui/src/main.cc
===================================================================
--- src/gui/src/main.cc	(revision 1404)
+++ 	(revision )
@@ -1,10 +1,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <iostream>
-
-int main()
-{
-  std::cout << "Hello World!" << std::endl;
-}
