C++ main module for gpm Package  1.0
GPMG_RulesWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_RulesWindow_H
2 #define GPMG_RulesWindow_H
3 
4 
5 #include "GUI_ChildWindow.h"
6 
7 #include "GPMG_Project.h"
8 #include "GPM_ModelFunction.h"
9 
16 
17 class GPMG_RulesWindow : public GUI_ChildWindow { // class
18  SP_OBJECT(GPMG_RulesWindow);
19 
20  // ATTRIBUTES
21 
22 private:
23 
24  static const tFlag RULES;
25  static const tFlag CLEAR_RULE;
26  static const tFlag ADD_RULE;
27  static const tFlag DUPLICATE_RULE;
28  static const tFlag DEL_RULE;
29  static const tFlag IS_UP_TO_AUTOMORPHISM;
30  static const tFlag SHOW_GRAPH;
31 
32  static const tFlag NODE_MAPPING_VARIABLES;
33  static const tFlag NODE_MAPPING_VARIABLE;
34  static const tFlag ADD_NODE_MAPPING_VARIABLE;
35  static const tFlag DEL_NODE_MAPPING_VARIABLE;
36 
37  static const tFlag PORT_MAPPING_VARIABLES;
38  static const tFlag PORT_MAPPING_VARIABLE;
39  static const tFlag ADD_PORT_MAPPING_VARIABLE;
40  static const tFlag DEL_PORT_MAPPING_VARIABLE;
41 
42  static const tFlag MAPPING_RULES;
43  static const tFlag MAPPING_RULE;
44  static const tFlag MAPPING_ENV;
45  static const tFlag ADD_MAPPING_RULE;
46  static const tFlag DEL_MAPPING_RULE;
47 
48  static const tFlag CLOSE;
49 
50 
51 private:
52 
53 
54  // ASSOCIATIONS
55 
56 
57  SP::GPMG_Project mProject;
58 
59  // METHODS
60 
61 
62 protected:
63  // CONSTRUCTORS
64 
68 
69 
70 
71 
72  // DESTRUCTORS
76  virtual ~GPMG_RulesWindow(void);
77 
78 
79 
80 public:
81  // NEW
84  static inline SP::GPMG_RulesWindow New() {
85  SP::GPMG_RulesWindow win(new GPMG_RulesWindow(),
86  GPMG_RulesWindow::Delete());
87  win->setThis(win);
88  return win;
89  };
90 
93  virtual void toDoAfterThisSetting() {
94  GUI_ChildWindow::toDoAfterThisSetting();
95  createComponents();
96  };
97  // SET
98 
101  inline void setProject(SP::GPMG_Project project) {
102  mProject=project;
103  updateValues();
104  }
105 
106  // GET
107 
108 private:
109 
110 public:
111  // SAVER & LOADER
114  virtual void loadFromUIClass(const UI_Class& mclass);
117  virtual void saveToUIClass(UI_Class& mclass) const;
118 
119  // OTHERS
120 
124  virtual void updateValues();
125 
126 
129  virtual void componentClicked(GUI_ActionComponent& compo);
130 
131 
132 
133 private:
134 
137  void createComponents();
138 
142  void showRule(const tFlag& index);
143 
146  void addRule();
149  void duplicateRule(const int& index);
153  void deleteRule(const int& index);
154 
157  GPM_ModelFunction* getSelectedRule();
158 
159 
162  tBoolean isUpToAutomorphism() const;
165  void setIsUpToAutomorphism(const tBoolean& isUpToAutomorphism);
166 
167 
168 
169 };
170 
171 #endif
static SP::GPMG_RulesWindow New()
create a visualization window
Definition: GPMG_RulesWindow.h:84
DEFINE_SPTR(GPMG_RulesWindow)
#define tBoolean
Definition: types.h:35
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_RulesWindow.cpp:233
GPMG_RulesWindow()
build a GPMG_RulesWindow
Definition: GPMG_RulesWindow.cpp:53
virtual void updateValues()
update the values set the gui components with respect to the project class attributes ...
Definition: GPMG_RulesWindow.cpp:255
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_RulesWindow.cpp:228
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_RulesWindow.cpp:474
virtual void toDoAfterThisSetting()
method called after this setting
Definition: GPMG_RulesWindow.h:93
this class describes a window to display erules
Definition: GPMG_RulesWindow.h:17
virtual ~GPMG_RulesWindow(void)
destroy a GPMG_RulesWindow
Definition: GPMG_RulesWindow.cpp:59
This class describes a pattern function.
Definition: GPM_ModelFunction.h:23
void setProject(SP::GPMG_Project project)
set the graph
Definition: GPMG_RulesWindow.h:101
#define tFlag
Definition: types.h:14