graph_displayer_canvas.h
changeset 149 930e838ad5b6
parent 148 5adf29662354
child 150 86273bfe0e4d
equal deleted inserted replaced
35:7020412dbd16 36:d26b30b8fbb4
    41       EdgeBase(Gnome::Canvas::Group&, Edge, GraphDisplayerCanvas&);
    41       EdgeBase(Gnome::Canvas::Group&, Edge, GraphDisplayerCanvas&);
    42       virtual ~EdgeBase();
    42       virtual ~EdgeBase();
    43       virtual void draw() = 0;
    43       virtual void draw() = 0;
    44       virtual void setLineWidth(int) = 0;
    44       virtual void setLineWidth(int) = 0;
    45       virtual void setFillColor(Gdk::Color) = 0;
    45       virtual void setFillColor(Gdk::Color) = 0;
       
    46       virtual Gnome::Canvas::Item * getLine() = 0;
    46   };
    47   };
    47 
    48 
    48   ///Edge displayer class
    49   ///Edge displayer class
    49 
    50 
    50   ///This class is responsible for displaying edges in graph.
    51   ///This class is responsible for displaying edges in graph.
    95       ///The function that draws the edge based on collected data
    96       ///The function that draws the edge based on collected data
    96       void draw();
    97       void draw();
    97 
    98 
    98       void setLineWidth(int);
    99       void setLineWidth(int);
    99       void setFillColor(Gdk::Color);
   100       void setFillColor(Gdk::Color);
       
   101 
       
   102       Gnome::Canvas::Item * getLine() { return (Gnome::Canvas::Item *)(&line); };
   100   };
   103   };
   101 
   104 
   102   class LoopEdge : public EdgeBase
   105   class LoopEdge : public EdgeBase
   103   {
   106   {
   104     private:
   107     private:
   107       LoopEdge(Gnome::Canvas::Group&, Edge, GraphDisplayerCanvas&);
   110       LoopEdge(Gnome::Canvas::Group&, Edge, GraphDisplayerCanvas&);
   108       ~LoopEdge();
   111       ~LoopEdge();
   109       void draw();
   112       void draw();
   110       void setLineWidth(int);
   113       void setLineWidth(int);
   111       void setFillColor(Gdk::Color);
   114       void setFillColor(Gdk::Color);
       
   115       Gnome::Canvas::Item * getLine() { return (Gnome::Canvas::Item *)(&line); };
   112   };
   116   };
   113 
   117 
   114   ///Type of canvas, on which the graph is drawn
   118   ///Type of canvas, on which the graph is drawn
   115   typedef Gnome::Canvas::CanvasAA Parent;
   119   typedef Gnome::Canvas::CanvasAA Parent;
   116 
   120 
   257   bool createNodeEventHandler(GdkEvent*);
   261   bool createNodeEventHandler(GdkEvent*);
   258   ///event handler for the case when create_edge-tool is active
   262   ///event handler for the case when create_edge-tool is active
   259   bool createEdgeEventHandler(GdkEvent*);
   263   bool createEdgeEventHandler(GdkEvent*);
   260   ///event handler for the case when eraser-tool is active
   264   ///event handler for the case when eraser-tool is active
   261   bool eraserEventHandler(GdkEvent*);
   265   bool eraserEventHandler(GdkEvent*);
   262   ///event handler for the case when edge map editor tool is active
   266   ///event handler for the case when map editor tool is active
   263   bool edgeMapEditEventHandler(GdkEvent*);
   267   bool mapEditEventHandler(GdkEvent*);
   264   ///event handler for the case when node map editor tool is active
       
   265   bool nodeMapEditEventHandler(GdkEvent*);
       
   266 
   268 
   267 public:
   269 public:
   268   ///Moves the text to new place
   270   ///Moves the text to new place
   269   void textReposition(xy<double>);
   271   void textReposition(xy<double>);
   270 
   272