C++ main module for gpm Package  1.0
GPMG_GraphElementWindow.h
Go to the documentation of this file.
1 #ifndef GPMG_GraphElementWindow_H
2 #define GPMG_GraphElementWindow_H
3 
4 
5 #include "GUI_ChildWindow.h"
6 #include "GUI_VBoxLayout.h"
7 
8 #include "GPM_GraphElement.h"
9 #include "GUI_ComboBox.h"
10 
12 
13 
20 
21 class GPMG_GraphElementWindow : public GUI_ChildWindow { // class
22  SP_OBJECT(GPMG_GraphElementWindow);
23 
24  // ATTRIBUTES
25 
26 private:
27  static const tFlag ID;
28  static const tFlag SHOW;
29  static const tFlag VAR_NAME,VAR_TYPE,VAR_VALUE;
30  static const tFlag OK,CANCEL,VALIDATE;
31  static const tFlag TRIGGER_VARIABLE,TRIGGER_ACTION,TRIGGER_VALUE,TRIGGER_ANALYSE;
32 
33 private:
34 
35  tFlag mGraphType;
36 
37  // ASSOCIATIONS
38 
39  SP::GPM_GraphElement mGraphElement;
40  SP::GPM_GraphElement mWorkingGraphElement;
41  WP::GPM_Graph mGraph;
42 
43  WP::GPM_Graph mPatternGraph;
44  WP::GPM_Graph mTransformerGraph;
45  // METHODS
46 
47 
48 protected:
49  // CONSTRUCTORS
50 
54 
55 
56 
57 
58  // DESTRUCTORS
62  virtual ~GPMG_GraphElementWindow(void);
63 
64 
65 
66 public:
67  // NEW
68 
69  virtual void toDoAfterThisSetting() {
70  GUI_ChildWindow::toDoAfterThisSetting();
71  createComponents();
72  };
73 
74  // SET
75 
78  void setGraphElement(GPM_Graph *pGraph,GPM_Graph *tGraph,const tFlag& graphType,GPM_Graph* graph,SP::GPM_GraphElement item);
79 
80  // GET
83  inline SP::GPM_GraphElement getWorkingGraphElement() {
84  return mWorkingGraphElement;
85 
86  }
89  inline SPC::GPM_GraphElement getGraphElement() const {
90  return mGraphElement;
91  }
94  inline tFlag getGraphType() const {
95  return mGraphType;
96  }
97 
100  inline GPM_Graph* getGraph() const {
101  return mGraph.lock().get();
102  }
105  inline GPM_Graph* getPatternGraph() const {
106  return mPatternGraph.lock().get();
107  }
110  inline GPM_Graph* getTransformerGraph() const {
111  return mTransformerGraph.lock().get();
112  }
115  tBoolean isReadOnly() const;
116 
119  tBoolean isShown() const;
120 
121  // OTHERS
122 
123 
126  virtual void componentClicked(GUI_ActionComponent& compo);
127 
130  virtual void loadFromUIClass(const UI_Class& mclass);
133  virtual void saveToUIClass(UI_Class& mclass) const;
134 
137  virtual void modalWindowClosed(const tFlag& id,
138  const CORE_Object* value);
141  virtual void enableComponents(const tBoolean& isReadOnly);
142 
143 
144 
149  virtual void updateValues();
150 
151 protected:
154  virtual void createComponentsInLayout(const int& index,GUI_VBoxLayout& hlayout)=0;
157  virtual void resetValues();
158 
161  virtual void updateTriggerVariables(const tString& letter,GUI_ComboBox& cb) {
162  }
163 
164 private:
167  void createComponents();
168 
172  void validate();
173 
177  void checkVariableValue();
178 
181  void setVariableValue(const tString& varName,const int& varType,const tString& value);
184  void updateVariable(const tString& name);
187  void updateTriggerVariable(const tString& name);
188 
194  tBoolean updateId(int& id);
195 
196 
197 
198 };
199 #endif
GPM_Graph * getGraph() const
get the graph
Definition: GPMG_GraphElementWindow.h:100
virtual void modalWindowClosed(const tFlag &id, const CORE_Object *value)
method called when a modal window is closed
Definition: GPMG_GraphElementWindow.cpp:325
GPM_Graph * getTransformerGraph() const
get the graph
Definition: GPMG_GraphElementWindow.h:110
boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS, VertexProperties, EdgeProperties > tGraph
Definition: GPM_Types.h:36
SPC::GPM_GraphElement getGraphElement() const
get the graph element attached to the window
Definition: GPMG_GraphElementWindow.h:89
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_GraphElementWindow.cpp:230
#define tBoolean
Definition: types.h:35
void setGraphElement(GPM_Graph *pGraph, GPM_Graph *tGraph, const tFlag &graphType, GPM_Graph *graph, SP::GPM_GraphElement item)
set the graph element properties
Definition: GPMG_GraphElementWindow.cpp:48
GPM_Graph * getPatternGraph() const
get the pattern graph
Definition: GPMG_GraphElementWindow.h:105
this class describes a window to display graph element properties
Definition: GPMG_GraphElementWindow.h:21
SP::GPM_GraphElement getWorkingGraphElement()
get the working graph element attached to the window
Definition: GPMG_GraphElementWindow.h:83
tBoolean isShown() const
return true if the graph element has to be shown
Definition: GPMG_GraphElementWindow.cpp:830
virtual ~GPMG_GraphElementWindow(void)
destroy a GPMG_GraphElementWindow
Definition: GPMG_GraphElementWindow.cpp:45
virtual void resetValues()
reset values
Definition: GPMG_GraphElementWindow.cpp:332
virtual void updateTriggerVariables(const tString &letter, GUI_ComboBox &cb)
update trigger variables
Definition: GPMG_GraphElementWindow.h:161
virtual void enableComponents(const tBoolean &isReadOnly)
enable the components
Definition: GPMG_GraphElementWindow.cpp:750
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a component are clicked on
Definition: GPMG_GraphElementWindow.cpp:235
tFlag getGraphType() const
get the graph type
Definition: GPMG_GraphElementWindow.h:94
abstract base class for most classes.
Definition: CORE_Object.h:30
#define tString
Definition: types.h:36
virtual void updateValues()
update the components values put the values of model object to gui components re-copy the graph eleme...
Definition: GPMG_GraphElementWindow.cpp:359
GPMG_GraphElementWindow()
build a GPMG_GraphElementWindow
Definition: GPMG_GraphElementWindow.cpp:40
virtual void toDoAfterThisSetting()
Definition: GPMG_GraphElementWindow.h:69
virtual void createComponentsInLayout(const int &index, GUI_VBoxLayout &hlayout)=0
create the components in special rows with id index
DEFINE_SPTR(GPM_Graph)
This class describes a graph which is a list of nodes & ports.
Definition: GPM_Graph.h:19
tBoolean isReadOnly() const
return true if the graph element is read only
Definition: GPMG_GraphElementWindow.cpp:824
#define tFlag
Definition: types.h:14
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_GraphElementWindow.cpp:225