C++ main module for gpm Package  1.0
GPMG_GraphStateWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_GraphStateWindow_H
2 #define GPMG_GraphStateWindow_H
3 
4 
5 #include "GUI_ChildWindow.h"
6 
7 #include "GPMG_Project.h"
9 
16 
17 class GPMG_GraphStateWindow : public GUI_ChildWindow { // class
18  SP_OBJECT(GPMG_GraphStateWindow);
19 
20  // ATTRIBUTES
21 
22 private:
23 
24  map<tString,SP::GPM_Variable> mEnvironments[3];
25 
26  static const tFlag ENV;
27  static const tFlag VALIDATE;
28  static const tFlag OK;
29  static const tFlag CANCEL;
30 
31 private:
32 
33  tString mLabels[3];
34  tString mVariablesLabels[3];
35 
36  // ASSOCIATIONS
37 
38 
39  SP::GPMG_Project mProject;
40  SP::GPMG_EnvironmentPanel mEnvironmentPanel;
41 
42  // METHODS
43 
44 
45 protected:
46  // CONSTRUCTORS
47 
51 
52 
53 
54 
55  // DESTRUCTORS
59  virtual ~GPMG_GraphStateWindow(void);
60 
61 
62 
63 public:
64  // NEW
67  static inline SP::GPMG_GraphStateWindow New() {
68  SP::GPMG_GraphStateWindow win(new GPMG_GraphStateWindow(),
69  GPMG_GraphStateWindow::Delete());
70  win->setThis(win);
71  return win;
72  };
73 
76  virtual void toDoAfterThisSetting() {
77  GUI_ChildWindow::toDoAfterThisSetting();
78  createComponents();
79  };
80  // SET
81 
84  inline void setProject(SP::GPMG_Project project) {
85  mProject=project;
86  setEnvironment(GPMG_Project::NODE_ENVIRONMENT,mProject->getEnvironment(GPMG_Project::NODE_ENVIRONMENT));
87  setEnvironment(GPMG_Project::PORT_ENVIRONMENT,mProject->getEnvironment(GPMG_Project::PORT_ENVIRONMENT));
88  setEnvironment(GPMG_Project::EDGE_ENVIRONMENT,mProject->getEnvironment(GPMG_Project::EDGE_ENVIRONMENT));
89  selectEnvironment(GPMG_Project::NODE_ENVIRONMENT);
90  }
91 
92 private:
95  void setEnvironment(const tFlag& index,const map<tString,SP::GPM_Variable>& env);
96 
99  void selectEnvironment(const tFlag& index);
100 
101 
102 
103  // GET
104 public:
105  // SAVER & LOADER
108  virtual void loadFromUIClass(const UI_Class& mclass);
111  virtual void saveToUIClass(UI_Class& mclass) const;
112 
113  // OTHERS
114 
117  virtual void componentClicked(GUI_ActionComponent& compo);
118 
119 
120 
121 private:
122 
125  void createComponents();
126 
129  void validate();
130 
131 };
132 #endif
static const tFlag EDGE_ENVIRONMENT
Definition: GPMG_Project.h:28
DEFINE_SPTR(GPMG_GraphStateWindow)
this class describes a window to display environment
Definition: GPMG_GraphStateWindow.h:17
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_GraphStateWindow.cpp:153
void setProject(SP::GPMG_Project project)
set the graph
Definition: GPMG_GraphStateWindow.h:84
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_GraphStateWindow.cpp:117
static const tFlag PORT_ENVIRONMENT
Definition: GPMG_Project.h:29
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_GraphStateWindow.cpp:112
GPMG_GraphStateWindow()
build a GPMG_GraphStateWindow
Definition: GPMG_GraphStateWindow.cpp:30
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPMG_GraphStateWindow.h:76
static const tFlag NODE_ENVIRONMENT
Definition: GPMG_Project.h:27
#define tString
Definition: types.h:36
static SP::GPMG_GraphStateWindow New()
create a visualization window
Definition: GPMG_GraphStateWindow.h:67
virtual ~GPMG_GraphStateWindow(void)
destroy a GPMG_GraphStateWindow
Definition: GPMG_GraphStateWindow.cpp:40
#define tFlag
Definition: types.h:14