C++ main module for gpm Package  1.0
GPMG_GraphPanel.h
Go to the documentation of this file.
1 #ifndef GPMG_GraphPanel_H
2 #define GPMG_GraphPanel_H
3 
4 #include "GUI_RootPanel.h"
5 
6 #include "GPMG_Project.h"
7 
8 #include "GPMG_DrawPanel.h"
9 
10 
17 class GPMG_GraphPanel : public GUI_RootPanel { // class
18  SP_OBJECT(GPMG_GraphPanel);
19 
20  // ATTRIBUTES
21 
22 private:
23  static const tFlag NODE_STATES_LIST;
24  static const tFlag PORT_STATES_LIST;
25  static const tFlag EDGE_STATES_LIST;
26  static const tFlag SHOW_NODES;
27  static const tFlag SHOW_PORTS;
28  static const tFlag SHOW_EDGES;
29  static const tFlag IS_READ_ONLY;
30  static const tFlag VERTEX_SIZE;
31  static const tFlag EDGE_SIZE;
32 
33  // ASSOCIATIONS
34 
35  SP::GPMG_DrawPanel mGraphDrawPanel;
36 
37  // METHODS
38 
39 
40 protected:
41  // CONSTRUCTORS
44  GPMG_GraphPanel();
45 
46 
47 
48 
49  // DESTRUCTORS
53  virtual ~GPMG_GraphPanel(void);
54 
55 
56 
57 public:
58  // NEW
59 
60  virtual void toDoAfterThisSetting() {
61  GUI_RootPanel::toDoAfterThisSetting();
62  };
63 
66  virtual SP::GPMG_DrawPanel NewGraphDrawPanel() const=0;
67  // SET
68 
69 
70 
71 public:
72 
75  void setIsReadOnly(const tBoolean& isReadOnly);
76 
79  inline void setSelectedVertex(SP::GPM_Vertex obj) {
80  mGraphDrawPanel->setSelectedVertex(obj);
81  }
84  inline void resetSelectedVertex() {
85  mGraphDrawPanel->resetSelectedVertex();
86  }
89  inline void setSelectedEdge(SP::GPM_Edge obj) {
90  mGraphDrawPanel->setSelectedEdge(obj);
91  }
94  inline void resetSelectedEdge() {
95  mGraphDrawPanel->resetSelectedEdge();
96  }
97  // GET
100  tBoolean isReadOnly() const;
101 
104  const GPMG_DrawPanel* getDrawPanel() const {
105  return mGraphDrawPanel.get();
106  };
110  return mGraphDrawPanel.get();
111  };
112 
113 
114 
115  // OTHERS
118  void updateEnvironments(const GPMG_Project* project);
119 public:
122  void updateEnvironments(const map<tString,SP::GPM_Variable>& nodeEnv,
123  const map<tString,SP::GPM_Variable>& portEnv,
124  const map<tString,SP::GPM_Variable>& edgeEnv);
125 
126  // SPECIALIZED Methods
127 public:
130  virtual void updateValues();
131 
134  virtual void componentClicked(GUI_ActionComponent& compo);
135 
136 
139  virtual void loadFromUIClass(const UI_Class& mclass);
142  virtual void saveToUIClass(UI_Class& mclass) const;
143 
144 
145 protected:
148  virtual void initComponents(const tBoolean& isReadOnlyShown,
149  const tBoolean& isGraphElementShownEnabled);
150 
151 
152 };
153 #endif
tBoolean isReadOnly() const
get if the graph is read only
Definition: GPMG_GraphPanel.cpp:250
DEFINE_SPTR(GPMG_GraphPanel)
this class describes a Graph Draw Panel.
Definition: GPMG_DrawPanel.h:15
#define tBoolean
Definition: types.h:35
void setIsReadOnly(const tBoolean &isReadOnly)
set true if the graph is read only
Definition: GPMG_GraphPanel.cpp:240
const GPMG_DrawPanel * getDrawPanel() const
Definition: GPMG_GraphPanel.h:104
virtual SP::GPMG_DrawPanel NewGraphDrawPanel() const =0
create the draw panel
virtual ~GPMG_GraphPanel(void)
destroy a GPMG_GraphPanel
Definition: GPMG_GraphPanel.cpp:40
GPMG_GraphPanel()
build a GPMG_GraphPanel
Definition: GPMG_GraphPanel.cpp:36
virtual void initComponents(const tBoolean &isReadOnlyShown, const tBoolean &isGraphElementShownEnabled)
init the components
Definition: GPMG_GraphPanel.cpp:44
this class describes the root panel of the graph window
Definition: GPMG_GraphPanel.h:17
virtual void toDoAfterThisSetting()
Definition: GPMG_GraphPanel.h:60
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: GPMG_GraphPanel.cpp:317
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: GPMG_GraphPanel.cpp:257
void setSelectedEdge(SP::GPM_Edge obj)
set the selected edge
Definition: GPMG_GraphPanel.h:89
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
GPMG_DrawPanel * getDrawPanel()
Definition: GPMG_GraphPanel.h:109
virtual void componentClicked(GUI_ActionComponent &compo)
method called when a panel's component is clicked on
Definition: GPMG_GraphPanel.cpp:201
void resetSelectedVertex()
reset the selected vertex
Definition: GPMG_GraphPanel.h:84
virtual void updateValues()
method called for updating values of the panel
Definition: GPMG_GraphPanel.cpp:129
void updateEnvironments(const GPMG_Project *project)
update the environments from a graph
Definition: GPMG_GraphPanel.cpp:136
#define tFlag
Definition: types.h:14