00001
00002
00003 #ifndef GUINODE_H
00004 #define GUINODE_H
00005
00006 #include "UINode.h"
00007 #include <gnome.h>
00008 #include <string>
00009 #include <vector>
00010 #include <string>
00011
00012 #include <fstream>
00013 #include <iostream>
00014 #include <list>
00015 #include "UINetTerminal.h"
00016 #include "UITerminal.h"
00017
00018 namespace FD {
00019
00020 class GUINode : public UINode {
00021
00022 protected:
00023
00024 GnomeCanvasGroup *group;
00025
00026 GtkWidget *popupMenu;
00027
00028 bool grab;
00029
00030 bool dragging;
00031
00032 GnomeCanvasItem *nodeRect;
00033 GnomeCanvasItem *nodeText;
00034
00035 void initialize_widgets();
00036
00037 public:
00038
00039
00040 GUINode(UINetwork* _net, std::string _name, std::string _type, double x, double y);
00041
00042 GUINode(UINetwork* _net, xmlNodePtr def);
00043
00044 ~GUINode();
00045
00046 GnomeCanvasGroup * getGroup() {return group;}
00047
00048 void createPopup();
00049
00050 virtual void rename(const std::string &newName);
00051
00052 gint event(GdkEvent *event);
00053
00054 void doGrab();
00055
00056 void move (double dx,double dy);
00057
00058 void selectedMove(double dx,double dy);
00059
00060 void select();
00061
00062 void unselect();
00063
00064 void getBounds(double &x1, double &y1, double &x2, double &y2);
00065
00066 void propertiesShow();
00067
00068 void help();
00069
00070
00071 virtual void addTerminal(const std::string &_name, UINetTerminal::NetTermType _type,
00072 const std::string &_objType="any", const std::string &_description="No description available");
00073
00074
00075 virtual UINodeParameters *newNodeParameters (UINode *_node, std::string type);
00076
00077 virtual UILink *newLink (UITerminal *_from, UITerminal *_to);
00078
00079 virtual UINetTerminal *newNetTerminal (UITerminal *_terminal, UINetTerminal::NetTermType _type, const std::string &_name,
00080 const std::string &_objType="any", const std::string &_description="No description available");
00081
00082 virtual void notifyError(const std::string &message);
00083
00084 virtual void redraw();
00085
00086 friend class GUINetwork;
00087
00088 };
00089
00090 }
00091
00092 #endif