C++ main module for gpm Package  1.0
GPMG_RuleGraphWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_RuleGraphWindow_H
2 #define GPMG_RuleGraphWindow_H
3 
4 #include "GUI2D_Window.h"
5 #include "GUI_ChildWindow.h"
7 
8 #include "GPMG_RuleGraphPanel.h"
9 #include "GUI2D_MenuPanel.h"
10 
11 #include "GPM_ModelFunction.h"
12 
19 class GPMG_RuleGraphWindow : public GUI_ChildWindow,public GUI2D_Window, public GPMG_GraphWindowInterface { // class
20 
21  SP_OBJECT(GPMG_RuleGraphWindow);
22  // ATTRIBUTES
23 
24 private:
25 
26 
27 
28  // ASSOCIATIONS
29 
30 
31  // METHODS
32 
33 
34 protected:
35  // CONSTRUCTORS
36 
40 
41 
42 
43 
44  // DESTRUCTORS
48  virtual ~GPMG_RuleGraphWindow(void);
49 
50 
51 
52 public:
53  // NEW
56  static inline SP::GPMG_RuleGraphWindow New() {
57  SP::GPMG_RuleGraphWindow win(new GPMG_RuleGraphWindow(),
59  win->setThis(win);
60  return win;
61  };
62 
63  virtual void toDoAfterThisSetting() {
64  GUI_ChildWindow::toDoAfterThisSetting();
65  initComponents();
66  }
67 
68  // SET
69 
72  inline void setTitle(const tString& name) {
73  getDrawPanel()->setTitle(name);
74  }
77  virtual void setIsMovingEnabled(const tBoolean& v) {
78  GUI2D_MenuPanel *menuPanel=dynamic_cast<GUI2D_MenuPanel*>(getMenuPanel());
79  if (menuPanel!=null) {
80  if (v) menuPanel->enableMoveInButton();
81  else menuPanel->disableMoveInButton();
82  }
83  }
84 
85 
88  inline void showRule(GPM_ModelFunction& rule) {
89  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
90  panel->showRule(rule);
91  }
92 
95  inline void clearGraphs() {
96  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
97  panel->clearGraphs();
98  }
101  inline void setSelectedVertex(SP::GPM_Vertex obj) {
102  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
103  panel->setSelectedVertex(obj);
104  }
107  inline void resetSelectedVertex() {
108  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
109  panel->resetSelectedVertex();
110  }
113  inline void setSelectedEdge(SP::GPM_Edge obj) {
114  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
115  panel->setSelectedEdge(obj);
116  }
119  inline void resetSelectedEdge() {
120  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
121  panel->resetSelectedEdge();
122  }
123 
126  virtual void resetSelectedObjects() {
129  updateValues();
130  }
133  inline void updateEnvironments(const GPMG_Project* project) {
134  GPMG_RuleGraphPanel *panel=dynamic_cast<GPMG_RuleGraphPanel*>(getRootPanel());
135  panel->updateEnvironments(project);
136  }
137 
138  // GET
139 
140  virtual const GUI2D_DrawPanel* getDrawPanel() const;
141  virtual GUI2D_DrawPanel* getDrawPanel();
142 
143 
144  // OTHERS
145 
146 
149  virtual void loadFromUIClass(const UI_Class& mclass);
152  virtual void saveToUIClass(UI_Class& mclass) const;
153 
154 
157  //void loadComponents();
162  virtual void modalWindowClosed(const tFlag& id,
163  const CORE_Object* value);
164 
165 private:
168  void initComponents();
171  //void saveComponents();
172 
173 
174 };
175 #endif
virtual void toDoAfterThisSetting()
method called after setThis() method this method can oly be called once.
Definition: GPMG_RuleGraphWindow.h:63
virtual void modalWindowClosed(const tFlag &id, const CORE_Object *value)
load the components of the windows from saving file
Definition: GPMG_RuleGraphWindow.cpp:79
virtual void resetSelectedObjects()
reset the selected objects
Definition: GPMG_RuleGraphWindow.h:126
this class describes the root panel of the rule graph window
Definition: GPMG_RuleGraphPanel.h:15
#define tBoolean
Definition: types.h:35
#define null
Definition: types.h:13
void updateEnvironments(const GPMG_Project *project)
void update the environments
Definition: GPMG_RuleGraphWindow.h:133
void setTitle(const tString &name)
set the title
Definition: GPMG_RuleGraphWindow.h:72
this class describes a interface for graph windows
Definition: GPMG_GraphWindowInterface.h:12
void resetSelectedVertex()
reset the selected vertex
Definition: GPMG_RuleGraphWindow.h:107
virtual void setIsMovingEnabled(const tBoolean &v)
set if the moving drawing area is enabled
Definition: GPMG_RuleGraphWindow.h:77
void clearGraphs()
clearthe graphs of the rules
Definition: GPMG_RuleGraphWindow.h:95
void setSelectedEdge(SP::GPM_Edge obj)
set the selected edge
Definition: GPMG_RuleGraphWindow.h:113
virtual const GUI2D_DrawPanel * getDrawPanel() const
Definition: GPMG_RuleGraphWindow.cpp:51
void showRule(GPM_ModelFunction &rule)
show the rule
Definition: GPMG_RuleGraphWindow.h:88
void clearGraphs()
clear the graphs of the rules
Definition: GPMG_RuleGraphPanel.cpp:32
void setSelectedEdge(SP::GPM_Edge obj)
set the selected edge
Definition: GPMG_GraphPanel.h:89
static SP::GPMG_RuleGraphWindow New()
create a visualization window
Definition: GPMG_RuleGraphWindow.h:56
void showRule(GPM_ModelFunction &rule)
show the rule
Definition: GPMG_RuleGraphPanel.cpp:25
void setSelectedVertex(SP::GPM_Vertex obj)
set the selected vertex
Definition: GPMG_GraphPanel.h:79
DEFINE_SPTR(GPMG_RuleGraphWindow)
This class describes a project.
Definition: GPMG_Project.h:22
void resetSelectedEdge()
reset the selected edge
Definition: GPMG_GraphPanel.h:94
GPMG_RuleGraphWindow()
build a GPMG_RuleGraphWindow
Definition: GPMG_RuleGraphWindow.cpp:14
abstract base class for most classes.
Definition: CORE_Object.h:30
virtual ~GPMG_RuleGraphWindow(void)
destroy a GPMG_RuleGraphWindow
Definition: GPMG_RuleGraphWindow.cpp:19
#define tString
Definition: types.h:36
void setSelectedVertex(SP::GPM_Vertex obj)
set the selected vertex
Definition: GPMG_RuleGraphWindow.h:101
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_RuleGraphWindow.cpp:74
void resetSelectedVertex()
reset the selected vertex
Definition: GPMG_GraphPanel.h:84
This class describes a pattern function.
Definition: GPM_ModelFunction.h:23
this class describes a window to show graph
Definition: GPMG_RuleGraphWindow.h:19
void updateEnvironments(const GPMG_Project *project)
update the environments from a graph
Definition: GPMG_GraphPanel.cpp:136
void resetSelectedEdge()
reset the selected edge
Definition: GPMG_RuleGraphWindow.h:119
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_RuleGraphWindow.cpp:70
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14