| [1442] | 1 | // -*- C++ -*- // | 
|---|
 | 2 |  | 
|---|
 | 3 | #ifndef MAP_WIN_H | 
|---|
 | 4 | #define MAP_WIN_H | 
|---|
 | 5 |  | 
|---|
| [1512] | 6 | class MapWin; | 
|---|
 | 7 |  | 
|---|
| [1837] | 8 | #include <all_include.h> | 
|---|
| [1849] | 9 | #include <nbtab.h> | 
|---|
| [1882] | 10 | #include <mapselector.h> | 
|---|
| [1442] | 11 | #include <libgnomecanvasmm.h> | 
|---|
 | 12 | #include <libgnomecanvasmm/polygon.h> | 
|---|
 | 13 |  | 
|---|
| [1893] | 14 | ///Graph visualization setup window. | 
|---|
 | 15 |  | 
|---|
| [1442] | 16 | ///This class is responsible for creating a window, | 
|---|
 | 17 | ///on which the visualization attributes can be | 
|---|
 | 18 | ///assigned to maps. | 
|---|
 | 19 | class MapWin : public Gtk::Window | 
|---|
 | 20 | { | 
|---|
 | 21 | protected: | 
|---|
| [1893] | 22 |   ///\ref NoteBookTab to that the \ref MapWin belongs to. | 
|---|
| [1849] | 23 |   NoteBookTab & mytab; | 
|---|
| [1442] | 24 |  | 
|---|
| [1893] | 25 |   ///Designing element | 
|---|
| [1512] | 26 |   Gtk::Table * table; | 
|---|
| [1442] | 27 |    | 
|---|
| [1893] | 28 |   ///\ref MapSelectors for each property | 
|---|
| [1442] | 29 |  | 
|---|
| [1893] | 30 |   ///Each property has an own \ref MapSelector through which | 
|---|
 | 31 |   ///the map to visualize by the property van be set. | 
|---|
 | 32 |   MapSelector ** e_combo_array; | 
|---|
 | 33 |  | 
|---|
 | 34 |   ///\ref MapSelectors for each property | 
|---|
 | 35 |  | 
|---|
 | 36 |   ///Each property has an own \ref MapSelector through which | 
|---|
 | 37 |   ///the map to visualize by the property van be set. | 
|---|
 | 38 |   MapSelector ** n_combo_array; | 
|---|
 | 39 |  | 
|---|
 | 40 |   ///Information holder | 
|---|
| [1446] | 41 |   Gtk::Label * label; | 
|---|
| [1442] | 42 |  | 
|---|
| [1893] | 43 |   ///Container in which elements are organized. | 
|---|
| [1512] | 44 |   Gtk::VBox vbox; | 
|---|
 | 45 |  | 
|---|
| [1442] | 46 | public: | 
|---|
| [1893] | 47 |   ///Constructor | 
|---|
| [1442] | 48 |  | 
|---|
| [1893] | 49 |   ///It creates the widgets shown in \ref MapWin and | 
|---|
 | 50 |   ///binds the needed signal to the correct place. | 
|---|
 | 51 |   ///\param title title of window | 
|---|
 | 52 |   ///\param eml edgemap list | 
|---|
 | 53 |   ///\param nml nodemap list | 
|---|
 | 54 |   ///\param mw the owner \ref NoteBookTab (\ref mytab) | 
|---|
 | 55 |   MapWin(const std::string& title, std::vector<std::string> eml, std::vector<std::string> nml, NoteBookTab & mw); | 
|---|
| [1838] | 56 |  | 
|---|
| [1893] | 57 |   ///Deregistrates \ref MapWin in its \ref NoteBookTab (\ref mytab) | 
|---|
| [1838] | 58 |   virtual bool on_delete_event(GdkEventAny *); | 
|---|
 | 59 |  | 
|---|
| [1893] | 60 |   ///Handles changement in nodemap selection | 
|---|
| [1512] | 61 |  | 
|---|
| [1893] | 62 |   ///If \ref MapSelector emits a signal that indicates | 
|---|
 | 63 |   ///changement in nodemap selection this function will | 
|---|
 | 64 |   ///be called. It calls the appropriate handler function, | 
|---|
 | 65 |   ///\ref NoteBookTab::propertyChange with parameters describing the changement. | 
|---|
 | 66 |   ///\param mapname the recently selected map | 
|---|
 | 67 |   ///\param prop the changed property | 
|---|
 | 68 |   void nodeMapChanged(std::string mapname, int prop); | 
|---|
| [1837] | 69 |  | 
|---|
| [1893] | 70 |   ///Handles changement in edgemap selection | 
|---|
| [1512] | 71 |  | 
|---|
| [1893] | 72 |   ///If \ref MapSelector emits a signal that indicates | 
|---|
 | 73 |   ///changement in edgemap selection this function will | 
|---|
 | 74 |   ///be called. It calls the appropriate handler function, | 
|---|
 | 75 |   ///\ref NoteBookTab::propertyChange with parameters describing the changement. | 
|---|
 | 76 |   ///\param mapname the recently selected map | 
|---|
 | 77 |   ///\param prop the changed property | 
|---|
 | 78 |   void edgeMapChanged(std::string mapname, int prop); | 
|---|
| [1586] | 79 |  | 
|---|
| [1893] | 80 |   ///Indicates to the owner \ref NoteBookTab that a \ref NewMapWin should be opened. | 
|---|
| [1586] | 81 |  | 
|---|
| [1893] | 82 |   ///This function is bound to the | 
|---|
 | 83 |   ///signal emitted by the \ref MapSelector in case of | 
|---|
 | 84 |   ///the user wants to create a new map. It only pass the | 
|---|
 | 85 |   ///information further to the tab owning this \ref MapWin that is needed to open the | 
|---|
 | 86 |   ///\ref NewMapWin. (\ref NoteBookTab::popupNewMapWin) | 
|---|
 | 87 |   ///\param itisedge should the new map will be an edgemap? (or nodemap) | 
|---|
 | 88 |   void newMapWinNeeded(bool itisedge); | 
|---|
 | 89 |  | 
|---|
 | 90 |   ///This function inserts name of the new edgemap in the name list in \ref MapSelector s | 
|---|
 | 91 |  | 
|---|
 | 92 |   ///\param new_name | 
|---|
 | 93 |   ///name of new map | 
|---|
 | 94 |   void registerNewEdgeMap(std::string new_name); | 
|---|
 | 95 |  | 
|---|
 | 96 |   ///This function inserts name of the new nodemap in the name list in \ref MapSelector s | 
|---|
 | 97 |  | 
|---|
 | 98 |   ///\param new_name | 
|---|
 | 99 |   ///name of new map | 
|---|
 | 100 |   void registerNewNodeMap(std::string new_name); | 
|---|
 | 101 |  | 
|---|
 | 102 |   ///Close window if Esc key pressed. | 
|---|
| [1524] | 103 |   virtual bool closeIfEscapeIsPressed(GdkEventKey*); | 
|---|
| [1586] | 104 |  | 
|---|
| [1893] | 105 |   ///Updates list of maps in all \ref MapSelector | 
|---|
 | 106 |  | 
|---|
 | 107 |   ///This function is called by \ref NoteBookTab, when the file | 
|---|
 | 108 |   ///showed in it has changed, therefore the contained maps | 
|---|
 | 109 |   ///have changed as well. \ref NoteBookTab knows, whether it | 
|---|
 | 110 |   ///has to call this function or not from the \ref NoteBookTab::mapwinexists | 
|---|
 | 111 |   ///variable. | 
|---|
 | 112 |   ///\param eml edge map list | 
|---|
 | 113 |   ///\param nml node map list | 
|---|
 | 114 |   void update(std::vector<std::string> eml, std::vector<std::string> nml); | 
|---|
| [1442] | 115 | }; | 
|---|
 | 116 |  | 
|---|
 | 117 | #endif //MAP_WIN_H | 
|---|