C++ main module for gpm Package  1.0
GPMG_ShowGraphWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_ShowGraphWindow_H
2 #define GPMG_ShowGraphWindow_H
3 
4 #include "GUI2D_Window.h"
5 #include "GUI_ChildWindow.h"
7 
8 #include "GPMG_ShowGraphPanel.h"
9 #include "GUI2D_MenuPanel.h"
10 
17 class GPMG_ShowGraphWindow : public GUI_ChildWindow,public GUI2D_Window, public GPMG_GraphWindowInterface { // class
18 
19  SP_OBJECT(GPMG_ShowGraphWindow);
20  // ATTRIBUTES
21 
22 private:
23 
24 
25 
26  // ASSOCIATIONS
27 
28 
29  // METHODS
30 
31 
32 protected:
33  // CONSTRUCTORS
34 
38 
39 
40 
41 
42  // DESTRUCTORS
46  virtual ~GPMG_ShowGraphWindow(void);
47 
48 
49 
50 public:
51  // NEW
54  static inline SP::GPMG_ShowGraphWindow New() {
55  SP::GPMG_ShowGraphWindow win(new GPMG_ShowGraphWindow(),
57  win->setThis(win);
58  return win;
59  };
60 
61  virtual void toDoAfterThisSetting() {
62  GUI_ChildWindow::toDoAfterThisSetting();
63  initComponents();
64  }
65 
66  // SET
67 
70  virtual void setIsMovingEnabled(const tBoolean& v) {
71  GUI2D_MenuPanel *menuPanel=dynamic_cast<GUI2D_MenuPanel*>(getMenuPanel());
72  if (menuPanel!=null) {
73  if (v) menuPanel->enableMoveInButton();
74  else menuPanel->disableMoveInButton();
75  }
76  }
77 
78 
81  inline void showGraph(GPM_ModelGraph& graph,const tBoolean& isForce) {
82  GPMG_ShowGraphPanel *panel=dynamic_cast<GPMG_ShowGraphPanel*>(getRootPanel());
83  panel->showGraph(graph,isForce);
84  }
87  inline void setSelectedVertex(SP::GPM_Vertex obj) {
88  GPMG_GraphPanel *panel=dynamic_cast<GPMG_GraphPanel*>(getRootPanel());
89  panel->setSelectedVertex(obj);
90  }
93  inline void resetSelectedVertex() {
94  GPMG_GraphPanel *panel=dynamic_cast<GPMG_GraphPanel*>(getRootPanel());
95  panel->resetSelectedVertex();
96  }
99  inline void setSelectedEdge(SP::GPM_Edge obj) {
100  GPMG_GraphPanel *panel=dynamic_cast<GPMG_GraphPanel*>(getRootPanel());
101  panel->setSelectedEdge(obj);
102  }
105  inline void resetSelectedEdge() {
106  GPMG_GraphPanel *panel=dynamic_cast<GPMG_GraphPanel*>(getRootPanel());
107  panel->resetSelectedEdge();
108  }
109 
112  virtual void resetSelectedObjects() {
115  }
118  inline void updateEnvironments(const GPMG_Project* project) {
119  GPMG_GraphPanel *panel=dynamic_cast<GPMG_GraphPanel*>(getRootPanel());
120  panel->updateEnvironments(project);
121  }
122 
123  // GET
124 
125  virtual const GUI2D_DrawPanel* getDrawPanel() const;
126  virtual GUI2D_DrawPanel* getDrawPanel();
127 
128 
129  // OTHERS
130 
131 
134  virtual void loadFromUIClass(const UI_Class& mclass);
137  virtual void saveToUIClass(UI_Class& mclass) const;
138 
139 
142  //void loadComponents();
147  virtual void modalWindowClosed(const tFlag& id,
148  const CORE_Object* value);
149 
150 private:
153  void initComponents();
156  //void saveComponents();
157 
158 
159 };
160 #endif
void updateEnvironments(const GPMG_Project *project)
void update the environments
Definition: GPMG_ShowGraphWindow.h:118
void showGraph(GPM_ModelGraph &graph, const tBoolean &isForce)
show the rule
Definition: GPMG_ShowGraphPanel.cpp:22
void resetSelectedEdge()
reset the selected edge
Definition: GPMG_ShowGraphWindow.h:105
virtual void resetSelectedObjects()
reset the selected objects
Definition: GPMG_ShowGraphWindow.h:112
virtual void setIsMovingEnabled(const tBoolean &v)
set if the moving drawing area is enabled
Definition: GPMG_ShowGraphWindow.h:70
virtual void toDoAfterThisSetting()
method called after setThis() method this method can oly be called once.
Definition: GPMG_ShowGraphWindow.h:61
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_ShowGraphWindow.cpp:74
This class describes a model graph.
Definition: GPM_ModelGraph.h:21
void setSelectedVertex(SP::GPM_Vertex obj)
set the selected vertex
Definition: GPMG_ShowGraphWindow.h:87
static SP::GPMG_ShowGraphWindow New()
create a visualization window
Definition: GPMG_ShowGraphWindow.h:54
#define tBoolean
Definition: types.h:35
#define null
Definition: types.h:13
this class describes a interface for graph windows
Definition: GPMG_GraphWindowInterface.h:12
this class describes the root panel of the graph window
Definition: GPMG_GraphPanel.h:17
this class describes a window to show graph
Definition: GPMG_ShowGraphWindow.h:17
void showGraph(GPM_ModelGraph &graph, const tBoolean &isForce)
show the graph
Definition: GPMG_ShowGraphWindow.h:81
void resetSelectedVertex()
reset the selected vertex
Definition: GPMG_ShowGraphWindow.h:93
this class describes the root panel of the rule graph window
Definition: GPMG_ShowGraphPanel.h:15
void setSelectedEdge(SP::GPM_Edge obj)
set the selected edge
Definition: GPMG_GraphPanel.h:89
virtual const GUI2D_DrawPanel * getDrawPanel() const
Definition: GPMG_ShowGraphWindow.cpp:51
void setSelectedVertex(SP::GPM_Vertex obj)
set the selected vertex
Definition: GPMG_GraphPanel.h:79
This class describes a project.
Definition: GPMG_Project.h:22
void resetSelectedEdge()
reset the selected edge
Definition: GPMG_GraphPanel.h:94
abstract base class for most classes.
Definition: CORE_Object.h:30
void setSelectedEdge(SP::GPM_Edge obj)
set the selected edge
Definition: GPMG_ShowGraphWindow.h:99
DEFINE_SPTR(GPMG_ShowGraphWindow)
virtual void modalWindowClosed(const tFlag &id, const CORE_Object *value)
load the components of the windows from saving file
Definition: GPMG_ShowGraphWindow.cpp:79
void resetSelectedVertex()
reset the selected vertex
Definition: GPMG_GraphPanel.h:84
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_ShowGraphWindow.cpp:70
virtual ~GPMG_ShowGraphWindow(void)
destroy a GPMG_ShowGraphWindow
Definition: GPMG_ShowGraphWindow.cpp:19
GPMG_ShowGraphWindow()
build a GPMG_ShowGraphWindow
Definition: GPMG_ShowGraphWindow.cpp:14
void updateEnvironments(const GPMG_Project *project)
update the environments from a graph
Definition: GPMG_GraphPanel.cpp:136
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14