-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdataobjects.h
265 lines (206 loc) · 4.23 KB
/
dataobjects.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#ifndef DATAOBJECTS_H
#define DATAOBJECTS_H
#include <QObject>
#include <QPoint>
class ClassObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(float centrality READ centrality WRITE setCentrality)
Q_PROPERTY(float positionX READ positionX WRITE setPositionX)
Q_PROPERTY(float positionY READ positionY WRITE setPositionY)
QString m_name;
float m_centrality;
float m_positionX;
float m_positionY;
public:
QString name() const { return m_name; }
void setName(const QString &name) {
m_name = name;
}
float centrality() const
{
return m_centrality;
}
void setCentrality(float centrality)
{
m_centrality = centrality;
}
float positionX() const
{
return m_positionX;
}
void setPositionX(float arg)
{
m_positionX = arg;
}
float positionY() const
{
return m_positionY;
}
void setPositionY(float arg)
{
m_positionY = arg;
}
};
class MethodObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString visibility READ visibility WRITE setVisibility)
QString m_name;
QString m_visibility;
public:
QString name() const
{
return m_name;
}
QString visibility() const
{
return m_visibility;
}
public slots:
void setName(QString name)
{
m_name = name;
}
void setVisibility(QString visibility)
{
m_visibility = visibility;
}
};
class AttributeObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString type READ type WRITE setType)
QString m_name;
QString m_type;
public:
QString name() const
{
return m_name;
}
QString type() const
{
return m_type;
}
public slots:
void setName(QString name)
{
m_name = name;
}
void setType(QString type)
{
m_type = type;
}
};
class LinkObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString type READ type WRITE setType NOTIFY typeChanged)
// For links of type "calls"
Q_PROPERTY(QString classFrom READ classFrom WRITE setClassFrom)
Q_PROPERTY(QString methodFrom READ methodFrom WRITE setMethodFrom)
Q_PROPERTY(QString classTo READ classTo WRITE setClassTo)
Q_PROPERTY(QString methodTo READ methodTo WRITE setMethodTo)
// For links of type "references"
Q_PROPERTY(QString className READ className WRITE setClassName)
Q_PROPERTY(QString method READ method WRITE setMethod)
Q_PROPERTY(QString attribute READ attribute WRITE setAttribute)
// For "inherits", properties classFrom and classTo are already defined
QString m_classFrom;
QString m_methodFrom;
QString m_classTo;
QString m_methodTo;
QString m_className;
QString m_method;
QString m_attribute;
QString m_type;
public:
QString classFrom() const
{
return m_classFrom;
}
QString methodFrom() const
{
return m_methodFrom;
}
QString classTo() const
{
return m_classTo;
}
QString methodTo() const
{
return m_methodTo;
}
QString className() const
{
return m_className;
}
QString method() const
{
return m_method;
}
QString attribute() const
{
return m_attribute;
}
QString type() const
{
return m_type;
}
public slots:
void setClassFrom(QString classFrom)
{
if (m_classFrom == classFrom)
return;
m_classFrom = classFrom;
}
void setMethodFrom(QString methodFrom)
{
if (m_methodFrom == methodFrom)
return;
m_methodFrom = methodFrom;
}
void setClassTo(QString classTo)
{
if (m_classTo == classTo)
return;
m_classTo = classTo;
}
void setMethodTo(QString methodTo)
{
if (m_methodTo == methodTo)
return;
m_methodTo = methodTo;
}
void setClassName(QString className)
{
if (m_className == className)
return;
m_className = className;
}
void setMethod(QString method)
{
if (m_method == method)
return;
m_method = method;
}
void setAttribute(QString attribute)
{
if (m_attribute == attribute)
return;
m_attribute = attribute;
}
void setType(QString type)
{
if (m_type == type)
return;
m_type = type;
emit typeChanged(type);
}
signals:
void typeChanged(QString type);
};
#endif // DATAOBJECTS_H