C++ main module for gpm Package  1.0
GPMG_Application.h
Go to the documentation of this file.
1 #ifndef GPMG_Application_H
2 #define GPMG_Application_H
3 
4 #include "GPMG_MainWindow.h"
5 #include "GPMG_ClassFactory.h"
6 
7 #include "GUI_Application.h"
8 
9 
10 
17 class GPMG_Application : public GUI_Application { // class
18  SP_OBJECT(GPMG_Application);
19 
20  // ATTRIBUTES
21 
22 private:
23  // colors
24  tString mPatternGraphColor;
25  tString mTransformerGraphColor;
26  tString mDeleteGraphColor;
27  tString mKeepGraphColor;
28  tString mConnectionGraphColor;
29 
30  // ASSOCIATIONS
31 
32 
33  // METHODS
34 
35 
36 protected:
37  // CONSTRUCTORS
40  GPMG_Application(int& argc,char *argv[],SP::GUI_EngineClassFactory cf);
41 
42 
43 
44 
45  // DESTRUCTORS
49  virtual ~GPMG_Application(void);
50 
51 
52 
53 
54 public:
55  // NEW
56  inline static SP::GPMG_Application New(int& argc,char *argv[],SP::GUI_EngineClassFactory cf) {
57  SP::GPMG_Application p(new GPMG_Application(argc,argv,cf),
58  GPMG_Application::Delete());
59  p->setThis(p);
60  return p;
61  };
67  virtual SP::GUI_ClassFactory newClassFactoryInstance() const {
68  return GPMG_ClassFactory::New();
69  };
70 
71 
72  // SET
75  inline void setRuleGraphColors(const tString& patternColor,
76  const tString& transformerColor,
77  const tString& deleteColor,
78  const tString& keepColor,
79  const tString& connectionsColor) {
80  mPatternGraphColor=patternColor;
81  mTransformerGraphColor=transformerColor;
82  mDeleteGraphColor=deleteColor;
83  mKeepGraphColor=keepColor;
84  mConnectionGraphColor=connectionsColor;
85  }
86 
87 
88  // GET
91  inline void getRuleGraphColors(tString& patternColor,
92  tString& transformerColor,
93  tString& deleteColor,
94  tString& keepColor,
95  tString& connectionColor) const {
96  patternColor=mPatternGraphColor;
97  transformerColor=mTransformerGraphColor;
98  deleteColor=mDeleteGraphColor;
99  keepColor=mKeepGraphColor;
100  connectionColor=mConnectionGraphColor;
101  }
102  // OTHERS
103 
104  // SPECIALIZED METHODS
107  virtual void loadFromUIClass(const UI_Class& mclass);
110  virtual void saveToUIClass(UI_Class& mclass) const;
111 
114  virtual void run();
117  virtual SP::GUI_RootWindow NewRootWindowInstance() const{
118  SP::GPMG_MainWindow rootWindow=GPMG_MainWindow::New();
119  return rootWindow;
120  };
121 
124  virtual void loadModelFile(const tString& projectFile);
127  virtual tString saveModelFile(const tString& projectFile);
128 
129 
130 
131 
132 
133 private:
134  tString searchPath(const tString& f) const;
135 
136 
137 
138 };
139 #endif
virtual SP::GUI_RootWindow NewRootWindowInstance() const
create a root window instance
Definition: GPMG_Application.h:117
virtual void loadModelFile(const tString &projectFile)
load the model
Definition: GPMG_Application.cpp:64
virtual tString saveModelFile(const tString &projectFile)
save the model
Definition: GPMG_Application.cpp:85
void getRuleGraphColors(tString &patternColor, tString &transformerColor, tString &deleteColor, tString &keepColor, tString &connectionColor) const
get the colors of rules graph
Definition: GPMG_Application.h:91
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object to a meta model class
Definition: GPMG_Application.cpp:103
static SP::GPMG_Application New(int &argc, char *argv[], SP::GUI_EngineClassFactory cf)
Definition: GPMG_Application.h:56
static SP::GPMG_ClassFactory New()
create a class factory
Definition: GPMG_ClassFactory.h:50
virtual SP::GUI_ClassFactory newClassFactoryInstance() const
return the loading class factory
Definition: GPMG_Application.h:67
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a meta model class
Definition: GPMG_Application.cpp:113
virtual ~GPMG_Application(void)
destroy a GPMG_Application
Definition: GPMG_Application.cpp:42
DEFINE_SPTR(GPMG_Application)
this class is the main class of the Dynsys GUI Interface
Definition: GPMG_Application.h:17
static SP::GPMG_MainWindow New()
Definition: GPMG_MainWindow.h:61
#define tString
Definition: types.h:36
virtual void run()
initialize the application
Definition: GPMG_Application.cpp:97
void setRuleGraphColors(const tString &patternColor, const tString &transformerColor, const tString &deleteColor, const tString &keepColor, const tString &connectionsColor)
set the colors of rules graph
Definition: GPMG_Application.h:75
GPMG_Application(int &argc, char *argv[], SP::GUI_EngineClassFactory cf)
build a GPMG_Application
Definition: GPMG_Application.cpp:9