cpee 2.1.56 → 2.1.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/cockpit/css/resources-label.css +33 -32
  3. data/cockpit/css/resources-svg.css +2 -2
  4. data/cockpit/css/ui.css +2 -42
  5. data/cockpit/css/wfadaptor.css +9 -0
  6. data/cockpit/edit.html +15 -2
  7. data/cockpit/graph.html +12 -1
  8. data/cockpit/index.html +14 -1
  9. data/cockpit/js/details.js +1 -0
  10. data/cockpit/js/instance.js +29 -13
  11. data/cockpit/js/resources.js +59 -11
  12. data/cockpit/js/wfadaptor.js +10 -6
  13. data/cockpit/model.html +3 -2
  14. data/cockpit/themes/base.js +1506 -0
  15. data/cockpit/themes/compact/rngs/start.rng +10 -0
  16. data/cockpit/themes/compact/symbols/start_event.svg +1 -1
  17. data/cockpit/themes/compact/theme.js +8 -1487
  18. data/cockpit/themes/control/rngs/start.rng +10 -0
  19. data/cockpit/themes/control/symbols/start_event.svg +1 -1
  20. data/cockpit/themes/control/theme.js +277 -1334
  21. data/cockpit/themes/dataflow/rngs/start.rng +10 -0
  22. data/cockpit/themes/dataflow/symbols/start_event.svg +1 -1
  23. data/cockpit/themes/dataflow/theme.js +144 -1563
  24. data/cockpit/themes/default/rngs/start.rng +10 -0
  25. data/cockpit/themes/default/symbols/start_event.svg +1 -1
  26. data/cockpit/themes/default/theme.js +1 -1493
  27. data/cockpit/themes/extended/rngs/start.rng +10 -0
  28. data/cockpit/themes/extended/symbols/start_event.svg +1 -1
  29. data/cockpit/themes/extended/theme.js +81 -1529
  30. data/cockpit/themes/felix/symbols/start_event.svg +1 -1
  31. data/cockpit/themes/felix/theme.js +68 -1528
  32. data/cockpit/themes/model/symbols/start_event.svg +1 -1
  33. data/cockpit/themes/model/theme.js +735 -1383
  34. data/cockpit/themes/packed/rngs/start.rng +10 -0
  35. data/cockpit/themes/packed/symbols/start_event.svg +1 -1
  36. data/cockpit/themes/packed/theme.js +9 -1487
  37. data/cockpit/themes/preset/rngs/start.rng +10 -0
  38. data/cockpit/themes/preset/symbols/start_event.svg +1 -1
  39. data/cockpit/themes/preset/theme.js +1 -1493
  40. data/cockpit/track.html +11 -0
  41. data/cpee.gemspec +1 -1
  42. data/lib/properties/executionhandler.rng +1 -1
  43. data/lib/properties.xml +1 -1
  44. data/server/executionhandlers/ruby/connection.rb +8 -11
  45. data/server/executionhandlers/rust/backend/README.md +17 -0
  46. data/server/executionhandlers/rust/backend/compile.sh +5 -0
  47. data/server/executionhandlers/rust/backend/opts.yaml +6 -0
  48. data/server/executionhandlers/rust/execution.rb +84 -0
  49. data/server/routing/end.pid +1 -1
  50. data/server/routing/forward-events-00.pid +1 -1
  51. data/server/routing/forward-votes.pid +1 -1
  52. data/server/routing/persist.pid +1 -1
  53. metadata +8 -3
@@ -1,1419 +1,771 @@
1
- function WFAdaptorManifestation(adaptor) {
2
- var self = this;
1
+ WFAdaptorManifestation = class extends WFAdaptorManifestationBase {
2
+ constructor(adaptor) {
3
+ super(adaptor);
4
+ var self = this;
3
5
 
4
- this.adaptor = adaptor;
5
- this.resources = {};
6
- this.elements = {};
7
- this.events = {};
8
- this.compact = false;
9
- this.striped = false;
10
- this.endpoints = {};
11
- this.presstimer;
12
-
13
- //{{{ transform the details data to description parts based on rng
14
- this.source = function(base,opts) {
15
- if (base[0].namespaceURI == "http://relaxng.org/ns/structure/1.0") {
16
- $('#relaxngworker').empty();
17
- var rngw = new RelaxNGui(base,$('#relaxngworker'),self.adaptor.description.context_eval);
18
- var nnew = $(rngw.save().documentElement);
19
- return(nnew);
20
- } else {
21
- if (opts && opts == 'clone') {
22
- base = base.clone();
23
- if (base.attr('id')) {
24
- base.attr('id',self.adaptor.description.get_free_id());
25
- }
26
- base.find('*[id]').each(function(k,v){
27
- $(v).attr('id',self.adaptor.description.get_free_id(base));
28
- });
29
- }
30
- return base;
31
- }
32
- }; //}}}
33
- //{{{ Return the svgid for the selected task
34
- this.selected = function(){
35
- var svgid = 'unknown';
36
- _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
37
- if ($(value).hasClass('selected')) {
38
- svgid = $(value).attr('element-id');
39
- }
40
- });
41
- return svgid;
42
- }; //}}}
43
- //{{{ Return the svgids for all marked tasks
44
- this.marked = function(){
45
- var svgid = [];
46
- _.each(self.adaptor.illustrator.get_elements(),function(value,key) {
47
- if ($(value).hasClass('marked')) {
48
- svgid.push($(value).attr('element-id'));
49
- }
50
- });
51
- return svgid;
52
- }; //}}}
53
- //{{{ Return the json for all marked tasks
54
- this.marked_text = function(){
55
- var nodes = [];
56
- var markymark = _.uniq(self.marked());
57
- $(markymark).each(function(key,svgid){
58
- var node = self.adaptor.description.get_node_by_svg_id(svgid);
59
- nodes.push($(node).serializePrettyXML());
60
- });
61
- return JSON.stringify(nodes);
62
- }; //}}}
63
- //{{{ Render the details from rng (right hand side of graph tab)
64
- this.update_details = function(svgid){
65
- var tab = $('#dat_details');
66
- var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
67
- if (self.adaptor.description.elements[$(node).attr('svg-subtype')]) {
68
- save['details_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
69
- var rng = self.adaptor.description.elements[$(node).attr('svg-subtype')].clone();
70
- if (save['endpoints_cache'][$(node).attr('endpoint')] && save['endpoints_cache'][$(node).attr('endpoint')].schema) {
71
- var schema = save['endpoints_cache'][$(node).attr('endpoint')].schema.documentElement;
72
- $(rng).find(' > element[name="parameters"] > element[name="arguments"]').replaceWith($(schema).clone());
73
- }
74
- if (save['endpoints_list'][$(node).attr('endpoint')] && (!save['endpoints_list'][$(node).attr('endpoint')].startsWith('http') || save['endpoints_list'][$(node).attr('endpoint')].match(/^https?-/))) {
75
- $(rng).find(' > element[name="parameters"] > element[name="method"]').remove();
76
- }
77
- var nn = $X($(node).serializeXML());
78
- nn.removeAttr('svg-id');
79
- nn.removeAttr('svg-type');
80
- nn.removeAttr('svg-subtype');
81
- nn.removeAttr('svg-label');
82
-
83
- tab.empty();
84
- save['details'] = new RelaxNGui(rng,tab,self.adaptor.description.context_eval,true);
85
- save['details'].content(nn);
86
-
87
- format_visual_forms();
88
- }
89
- }; //}}}
90
-
91
- function copyOrMove(menu,group,xml_node,mode) { //{{{
92
- var nodes = localStorage.getItem('marked');
93
-
94
- if (typeof(nodes) != "string") { return; }
95
-
96
- nodes = JSON.parse(nodes);
97
- $(nodes).each(function(key,str) {
98
- nodes[key] = $X(str);
99
- });
6
+ var contextMenuHandling = function(svgid,e,child,sibling) { //{{{
7
+ if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
100
8
 
101
- var check1 = [];
102
- var check2 = [];
103
- $(nodes).each(function(key,node){
104
- check1.push($(node).attr('svg-type'));
105
- });
106
- $(group).each(function(key,value){
107
- check2.push(value.type);
108
- });
9
+ var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
10
+ var group = null;
11
+ var menu = {};
109
12
 
110
- if (nodes.length > 0 && _.uniq(check1).length == _.intersection(check1,check2).length) {
111
- if (myid == localStorage.getItem('marked_from')) {
112
- $(nodes).each(function(key,node){
113
- nodes[key] = self.adaptor.description.get_node_by_svg_id($(node).attr('svg-id'));
114
- });
115
- }
116
- nodes.reverse();
117
- var iconm = self.resources['arrow'].clone();
118
- var iconc = self.resources['arrow'].clone();
119
- iconm.children('.rfill').addClass('menu');
120
- if (myid == localStorage.getItem('marked_from')) {
121
- menu.push(
122
- {
123
- 'label': '<em>Move Marked Elements</em>',
124
- 'function_call': mode,
125
- 'menu_icon': iconm,
126
- 'type': undefined,
127
- 'params': [nodes, xml_node]
13
+ if (child) {
14
+ group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
15
+ if(group.length > 0) {
16
+ menu['Insert into'] = group;
17
+ copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
18
+ }
19
+ if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
20
+ group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
21
+ if(group.length > 0) {
22
+ menu['Insert into (Experts Only!)'] = group;
23
+ copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
128
24
  }
129
- );
130
- }
131
- menu.push(
132
- {
133
- 'label': '<em>Copy Marked Elements</em>',
134
- 'function_call': mode,
135
- 'menu_icon': iconc,
136
- 'type': undefined,
137
- 'params': [nodes, xml_node, 'clone']
138
25
  }
139
- );
140
- }
141
- } //}}}
142
-
143
- function contextMenuHandling(svgid,e,child,sibling) { //{{{
144
- if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
145
-
146
- var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
147
- var group = null;
148
- var menu = {};
149
-
150
- if (child) {
151
- group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
152
- if(group.length > 0) {
153
- menu['Insert into'] = group;
154
- copyOrMove(menu['Insert into'],group,xml_node,self.adaptor.description.insert_first_into);
155
26
  }
156
- if (self.elements[xml_node.get(0).tagName].permissible_children_expert) {
157
- group = self.elements[xml_node.get(0).tagName].permissible_children_expert(xml_node,'into');
27
+ if (sibling) {
28
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
158
29
  if(group.length > 0) {
159
- menu['Insert into (Experts Only!)'] = group;
160
- copyOrMove(menu['Insert into (Experts Only!)'],group,xml_node,self.adaptor.description.insert_first_into);
30
+ menu['Insert after'] = group;
31
+ copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
161
32
  }
162
- }
163
- }
164
- if (sibling) {
165
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
166
- if(group.length > 0) {
167
- menu['Insert after'] = group;
168
- copyOrMove(menu['Insert after'],group,xml_node,self.adaptor.description.insert_after);
169
- }
170
- if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
171
- group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
172
- if(group.length > 0) {
173
- menu['Insert after (Experts Only!)'] = group;
174
- copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
33
+ if (self.elements[xml_node.parent().get(0).tagName].permissible_children_expert) {
34
+ group = self.elements[xml_node.parent().get(0).tagName].permissible_children_expert(xml_node,'after');
35
+ if(group.length > 0) {
36
+ menu['Insert after (Experts Only!)'] = group;
37
+ copyOrMove(menu['Insert after (Experts Only!)'],group,xml_node,self.adaptor.description.insert_after);
38
+ }
175
39
  }
176
40
  }
177
- }
178
41
 
179
- if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
180
- var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
181
- icon.find('.rfill').addClass('menu');
182
- icon.find('.hfill').addClass('menu');
183
- menu['Delete'] = [{
184
- 'label': 'Remove Element',
185
- 'function_call': function(selector,target,selected){
186
- del_ui_pos(target)
187
- self.adaptor.description.remove(selector,target);
188
- localStorage.removeItem('marked');
189
- localStorage.removeItem('marked_from');
190
- },
191
- 'menu_icon': icon,
192
- 'type': undefined,
193
- 'params': [null, xml_node, self.selected()]
194
- }];
195
- var nodes = localStorage.getItem('marked');
196
- nodes = JSON.parse(nodes);
197
- if (nodes && nodes.length > 0) {
198
- var icond = self.resources['delete'].clone();
199
- icond.children('.standfat').addClass('menu');
200
- menu['Delete'].push({
201
- 'label': 'Remove Marked Elements',
202
- 'function_call': function(){
203
- $(nodes).each(function(key,str) {
204
- nodes[key] = $X(str);
205
- });
206
- let svgids = [];
207
- $(nodes).each(function(key,node){
208
- svgids.push($(node).attr('svg-id'));
209
- });
210
- svgids.sort((a,b) => {
211
- if (a > b) { return -1; }
212
- else if (a < b) { return 1; }
213
- else { return 0; }
214
- });
215
- svgids.forEach(svgid => {
216
- var target = self.adaptor.description.get_node_by_svg_id(svgid);
217
- del_ui_pos(target)
218
- self.adaptor.description.remove(null,target);
219
- localStorage.removeItem('marked');
220
- localStorage.removeItem('marked_from');
221
- });
42
+ if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
43
+ var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
44
+ icon.find('.rfill').addClass('menu');
45
+ icon.find('.hfill').addClass('menu');
46
+ menu['Delete'] = [{
47
+ 'label': 'Remove Element',
48
+ 'function_call': function(selector,target,selected){
49
+ del_ui_pos(target)
50
+ self.adaptor.description.remove(selector,target);
51
+ localStorage.removeItem('marked');
52
+ localStorage.removeItem('marked_from');
222
53
  },
223
- 'menu_icon': icond,
54
+ 'menu_icon': icon,
224
55
  'type': undefined,
225
- 'params': []
226
- })
227
- }
228
- }
229
- if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
230
- var icon = self.elements.callmanipulate.illustrator.svg.clone();
231
- icon.children('.rfill:last').addClass('menu');
232
- menu['Delete'].push({
233
- 'label': 'Remove Output Transformation',
234
- 'function_call': self.adaptor.description.remove,
235
- 'menu_icon': icon,
236
- 'type': undefined,
237
- 'params': ['> code', xml_node]
238
- });
239
- }
240
- new CustomMenu(e).contextmenu(menu);
241
- } //}}}
242
-
243
- function positionHandling(svgid) {
244
- var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
245
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
246
- if (vtarget.length > 0) {
247
- if (vtarget.parents('g.activities.passive, g.activities.active').length > 0) {
248
- del_ui_pos(xml_node);
249
- } else {
250
- add_ui_pos(xml_node);
251
- }
252
- }
253
- }
254
-
255
- // Events
256
- this.events.touchend = function(svgid, e) { // {{{
257
- clearTimeout(self.presstimer);
258
- } // }}}
259
- this.events.touchstart = function(svgid, e, child, sibling) { // {{{
260
- self.presstimer = window.setTimeout(function() { contextMenuHandling(svgid,e,child,sibling); },1000);
261
- return false;
262
- } // }}}
263
- this.events.mousedown = function(svgid, e, child, sibling) { // {{{
264
- if(e.button == 0) { // left-click
265
- } else if(e.button == 1) { // middle-click
266
- positionHandling(svgid);
267
- } else if(e.button == 2) { // right-click
268
- contextMenuHandling(svgid,e,child,sibling);
269
- }
270
- return false;
271
- } // }}}
272
- this.events.suppress = function(svgid, e, child, sibling) { // {{{
273
- return false;
274
- } // }}}
275
- this.events.click = function(svgid, e) { // {{{
276
- if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
277
- return;
278
- }
279
-
280
- self.adaptor.illustrator.get_elements().removeClass('selected');
281
- self.adaptor.illustrator.get_labels().removeClass('selected');
282
-
283
- if (e && (e.ctrlKey || e.metaKey)) {
284
- if (save['state'] != "ready" && save['state'] != "stopped") { return false; }
285
- var tab = $('#dat_details');
286
- tab.empty();
287
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
288
- if (vtarget.length > 0) {
289
- var vt = vtarget.parents('g.element[element-id]');
290
- vt.toggleClass('marked');
291
- if (vt.hasClass('marked')) {
292
- localStorage.setItem('marked',self.marked_text());
293
- localStorage.setItem('marked_from',myid);
294
- } else {
295
- localStorage.removeItem('marked');
296
- localStorage.removeItem('marked_from');
56
+ 'params': [null, xml_node, self.selected()]
57
+ }];
58
+ var nodes = localStorage.getItem('marked');
59
+ nodes = JSON.parse(nodes);
60
+ if (nodes && nodes.length > 0) {
61
+ var icond = self.resources['delete'].clone();
62
+ icond.children('.standfat').addClass('menu');
63
+ menu['Delete'].push({
64
+ 'label': 'Remove Marked Elements',
65
+ 'function_call': function(){
66
+ $(nodes).each(function(key,str) {
67
+ nodes[key] = $X(str);
68
+ });
69
+ let svgids = [];
70
+ $(nodes).each(function(key,node){
71
+ svgids.push($(node).attr('svg-id'));
72
+ });
73
+ svgids.sort((a,b) => {
74
+ if (a > b) { return -1; }
75
+ else if (a < b) { return 1; }
76
+ else { return 0; }
77
+ });
78
+ svgids.forEach(svgid => {
79
+ var target = self.adaptor.description.get_node_by_svg_id(svgid);
80
+ del_ui_pos(target)
81
+ self.adaptor.description.remove(null,target);
82
+ localStorage.removeItem('marked');
83
+ localStorage.removeItem('marked_from');
84
+ });
85
+ },
86
+ 'menu_icon': icond,
87
+ 'type': undefined,
88
+ 'params': []
89
+ })
297
90
  }
298
91
  }
299
- } else if (e && (e.shiftKey)) {
300
- positionHandling(svgid);
301
- } else {
302
- self.adaptor.illustrator.get_elements().removeClass('marked');
303
- localStorage.removeItem('marked');
304
- localStorage.removeItem('marked_from');
305
-
306
- var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
307
- if (vtarget.length > 0) {
308
- vtarget.parents('g.element[element-id]').addClass('selected');
92
+ if($('> code', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
93
+ var icon = self.elements.callmanipulate.illustrator.svg.clone();
94
+ icon.children('.rfill:last').addClass('menu');
95
+ menu['Delete'].push({
96
+ 'label': 'Remove Output Transformation',
97
+ 'function_call': self.adaptor.description.remove,
98
+ 'menu_icon': icon,
99
+ 'type': undefined,
100
+ 'params': ['> code', xml_node]
101
+ });
309
102
  }
310
- self.adaptor.illustrator.get_label_by_svg_id(svgid).addClass('selected');
103
+ new CustomMenu(e).contextmenu(menu);
104
+ } //}}}
311
105
 
312
- self.update_details(svgid);
313
- }
314
- } // }}}
315
- this.events.dblclick = function(svgid, e) { // {{{
316
- } // }}}
317
- this.events.mouseover = function(svgid, e) { // {{{
318
- self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','block');
319
- self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').addClass('hover');
320
- self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').addClass('hover');
321
- return false;
322
- } // }}}
323
- this.events.mouseout = function(svgid, e) { // {{{
324
- self.adaptor.illustrator.svg.container.find('.tile[element-id = "' + svgid + '"]').css('display','none');
325
- self.adaptor.illustrator.svg.container.find('[element-id = "' + svgid + '"]').removeClass('hover');
326
- self.adaptor.illustrator.svg.label_container.find('[element-id = "' + svgid + '"]').removeClass('hover');
327
- return false;
328
- } // }}}
329
- this.events.dragstart = function (svgid, e) { //{{{
330
- } //}}}
331
-
332
- // other resources
333
- this.resources.arrow = self.adaptor.theme_dir + 'symbols/arrow.svg';
334
- this.resources.delete = self.adaptor.theme_dir + 'symbols/delete.svg';
335
-
336
- // Primitive Elements
337
- this.elements.call = { /*{{{*/
338
- 'type': 'primitive',
339
- 'illustrator': {//{{{
340
- 'endnodes': 'this',
341
- 'label': function(node){
342
- var ret;
343
- if ($('> url',$(node).children('parameters').children('arguments')).length > 0) {
344
- ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') + ' <a target="_blank" href="' + $('> url',$(node).children('parameters').children('arguments')).text() + '/open"></a>' } ];
345
- } else {
346
- ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') } ];
106
+ this.elements.call = { /*{{{*/
107
+ 'type': 'primitive',
108
+ 'illustrator': {//{{{
109
+ 'endnodes': 'this',
110
+ 'label': function(node){
111
+ var ret;
112
+ if ($('> url',$(node).children('parameters').children('arguments')).length > 0) {
113
+ ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') + ' <a target="_blank" href="' + $('> url',$(node).children('parameters').children('arguments')).text() + '/open"></a>' } ];
114
+ } else {
115
+ ret = [ { column: 'Label', value: $('> label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'') } ];
116
+ }
117
+ return ret;
118
+ },
119
+ 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
120
+ 'resolve_symbol': function(node) {
121
+ if($('> code', node).length > 0) {
122
+ return 'callmanipulate';
123
+ } else {
124
+ return 'call';
125
+ }
126
+ },
127
+ 'svg': self.adaptor.theme_dir + 'symbols/call.svg'
128
+ },//}}}
129
+ 'description': self.adaptor.theme_dir + 'rngs/call.rng',
130
+ 'permissible_children': function(node,mode) { //{{{
131
+ if(node.children('code').length < 1)
132
+ return [
133
+ {'label': 'Output Transformation',
134
+ 'function_call': self.adaptor.description.insert_last_into,
135
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
136
+ 'type': undefined,
137
+ 'params': [self.adaptor.description.elements.scripts, node]}
138
+ ];
139
+ return [];
140
+ }, //}}}
141
+ 'adaptor': {//{{{
142
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
143
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
144
+ 'touchend': self.events.touchend,
145
+ 'click': self.events.click,
146
+ 'dragstart': self.events.dragstart,
147
+ 'mouseover': self.events.mouseover,
148
+ 'mouseout': self.events.mouseout
149
+ }//}}}
150
+ }; /*}}}*/
151
+ this.elements.otherwise = { /*{{{*/
152
+ 'type': 'complex',
153
+ 'illustrator': {//{{{
154
+ 'endnodes': 'passthrough',
155
+ 'closeblock': false,
156
+ 'noarrow': true,
157
+ 'expansion': function(node) {
158
+ return 'vertical';
159
+ },
160
+ 'col_shift': function(node) {
161
+ return false;
162
+ },
163
+ 'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
164
+ },//}}}
165
+ 'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
166
+ 'neverdelete': true,
167
+ 'permissible_children': function(node,mode) { //{{{
168
+ var func = null;
169
+ var childs = null;
170
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
171
+ else { func = self.adaptor.description.insert_after }
172
+ var childs = [
173
+ {'label': 'Task with Output Transformation',
174
+ 'function_call': func,
175
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
176
+ 'type': 'callmanipulate',
177
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
178
+ {'label': 'Task',
179
+ 'function_call': func,
180
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
181
+ 'type': 'call',
182
+ 'params': [self.adaptor.description.elements.call, node]},
183
+ {'label': 'Script',
184
+ 'function_call': func,
185
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
186
+ 'type': 'manipulate',
187
+ 'params': [self.adaptor.description.elements.manipulate, node]},
188
+ {'label': 'Parallel',
189
+ 'function_call': func,
190
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
191
+ 'type': 'parallel',
192
+ 'params': [self.adaptor.description.elements.parallel, node]},
193
+ {'label': 'Decision',
194
+ 'function_call': func,
195
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
196
+ 'type': 'choose',
197
+ 'params': [self.adaptor.description.elements.choose, node]},
198
+ {'label': 'Loop',
199
+ 'function_call': func,
200
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
201
+ 'type': 'loop',
202
+ 'params': [self.adaptor.description.elements.loop, node]},
203
+ {'label': 'Terminate',
204
+ 'function_call': func,
205
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
206
+ 'type': 'terminate',
207
+ 'params': [self.adaptor.description.elements.terminate, node]},
208
+ {'label': 'Stop',
209
+ 'function_call': func,
210
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
211
+ 'type': 'stop',
212
+ 'params': [self.adaptor.description.elements.stop, node]}
213
+ ];
214
+ if(node.parent('parallel_branch').length > 0) {
215
+ childs.push({
216
+ 'label': 'Critical',
217
+ 'function_call': func,
218
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
219
+ 'type': 'critical',
220
+ 'params': [self.adaptor.description.elements.critical, node]
221
+ });
347
222
  }
348
- return ret;
349
- },
350
- 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
351
- 'resolve_symbol': function(node) {
352
- if($('> code', node).length > 0) {
353
- return 'callmanipulate';
354
- } else {
355
- return 'call';
223
+ return childs;
224
+ }, //}}}
225
+ 'adaptor': {//{{{
226
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
227
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
228
+ 'touchend': self.events.touchend,
229
+ 'click': self.events.click,
230
+ 'dblclick': self.events.dblclick,
231
+ 'mouseover': self.events.mouseover,
232
+ 'mouseout': self.events.mouseout,
233
+ }//}}}
234
+ }; /*}}}*/
235
+ this.elements.alternative = { /*{{{*/
236
+ 'type': 'complex',
237
+ 'illustrator': {//{{{
238
+ 'label': function(node){
239
+ var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
240
+ return ret;
241
+ },
242
+ 'endnodes': 'passthrough',
243
+ 'noarrow': true,
244
+ 'closeblock':false,
245
+ 'expansion': function(node) {
246
+ return 'vertical';
247
+ },
248
+ 'col_shift': function(node) {
249
+ return false;
250
+ },
251
+ 'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
252
+ },//}}}
253
+ 'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
254
+ 'permissible_children': function(node,mode) { //{{{
255
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
256
+ else { func = self.adaptor.description.insert_after }
257
+ if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
258
+ return [{'label': 'Parallel Branch',
259
+ 'function_call': func,
260
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
261
+ 'type': 'parallel_branch',
262
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}];
356
263
  }
357
- },
358
- 'svg': self.adaptor.theme_dir + 'symbols/call.svg'
359
- },//}}}
360
- 'description': self.adaptor.theme_dir + 'rngs/call.rng',
361
- 'permissible_children': function(node,mode) { //{{{
362
- if(node.children('code').length < 1)
363
- return [
364
- {'label': 'Output Transformation',
365
- 'function_call': self.adaptor.description.insert_last_into,
366
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
367
- 'type': undefined,
368
- 'params': [self.adaptor.description.elements.scripts, node]}
264
+ var childs = [
265
+ {'label': 'Task with Output Transformation',
266
+ 'function_call': func,
267
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
268
+ 'type': 'callmanipulate',
269
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
270
+ {'label': 'Task',
271
+ 'function_call': func,
272
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
273
+ 'type': 'call',
274
+ 'params': [self.adaptor.description.elements.call, node]},
275
+ {'label': 'Script',
276
+ 'function_call': func,
277
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
278
+ 'type': 'manipulate',
279
+ 'params': [self.adaptor.description.elements.manipulate, node]},
280
+ {'label': 'Parallel',
281
+ 'function_call': func,
282
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
283
+ 'type': 'parallel',
284
+ 'params': [self.adaptor.description.elements.parallel, node]},
285
+ {'label': 'Decision',
286
+ 'function_call': func,
287
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
288
+ 'type': 'choose',
289
+ 'params': [self.adaptor.description.elements.choose, node]},
290
+ {'label': 'Loop',
291
+ 'function_call': func,
292
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
293
+ 'type': 'loop',
294
+ 'params': [self.adaptor.description.elements.loop, node]},
295
+ {'label': 'Terminate',
296
+ 'function_call': func,
297
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
298
+ 'type': 'terminate',
299
+ 'params': [self.adaptor.description.elements.terminate, node]},
300
+ {'label': 'Stop',
301
+ 'function_call': func,
302
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
303
+ 'type': 'stop',
304
+ 'params': [self.adaptor.description.elements.stop, node]}
369
305
  ];
370
- return [];
371
- }, //}}}
372
- 'adaptor': {//{{{
373
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
374
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
375
- 'touchend': self.events.touchend,
376
- 'click': self.events.click,
377
- 'dragstart': self.events.dragstart,
378
- 'mouseover': self.events.mouseover,
379
- 'mouseout': self.events.mouseout
380
- }//}}}
381
- }; /*}}}*/
382
- this.elements.manipulate = { /*{{{*/
383
- 'type': 'primitive',
384
- 'illustrator': {//{{{
385
- 'endnodes': 'this',
386
- 'label': function(node){
387
- var lab = $(node).attr('label');
388
- if (lab) {
389
- return [ { column: 'Label', value: lab.replace(/^['"]/,'').replace(/['"]$/,'') } ];
390
- } else {
391
- return [];
392
- }
393
- },
394
- 'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
395
- },//}}}
396
- 'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
397
- 'permissible_children': function(node,mode) { //{{{
398
- return [];
399
- }, //}}}
400
- 'adaptor': {//{{{
401
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
402
- 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
403
- 'touchend': self.events.touchend,
404
- 'click': self.events.click,
405
- 'mouseover': self.events.mouseover,
406
- 'mouseout': self.events.mouseout
407
- }//}}}
408
- }; /*}}}*/
409
- this.elements.escape = { /*{{{*/
410
- 'type': 'primitive',
411
- 'illustrator': {//{{{
412
- 'endnodes': 'this',
413
- 'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
414
- },//}}}
415
- 'description': self.adaptor.theme_dir + 'rngs/escape.rng',
416
- 'permissible_children': function(node,mode) { //{{{
417
- return [];
418
- }, //}}}
419
- 'adaptor': {//{{{
420
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
421
- 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
422
- 'touchend': self.events.touchend,
423
- 'click': self.events.click,
424
- 'mouseover': self.events.mouseover,
425
- 'mouseout': self.events.mouseout
426
- }//}}}
427
- }; /*}}}*/
428
- this.elements.stop = { /*{{{*/
429
- 'type': 'primitive',
430
- 'illustrator': {//{{{
431
- 'endnodes': 'this',
432
- 'svg': self.adaptor.theme_dir + 'symbols/stop.svg'
433
- },//}}}
434
- 'description': self.adaptor.theme_dir + 'rngs/stop.rng',
435
- 'permissible_children': function(node,mode) { //{{{
436
- return [];
437
- }, //}}}
438
- 'adaptor': {//{{{
439
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
440
- 'touchstart': function (node,e) { self.events.touchstart(node,e,false,true); },
441
- 'touchend': self.events.touchend,
442
- 'click': self.events.click,
443
- 'mouseover': self.events.mouseover,
444
- 'mouseout': self.events.mouseout
445
- }//}}}
446
- }; /*}}}*/
447
- this.elements.terminate = { /*{{{*/
448
- 'type': 'primitive',
449
- 'illustrator': {//{{{
450
- 'endnodes': 'this',
451
- 'final': true,
452
- 'svg': self.adaptor.theme_dir + 'symbols/terminate.svg'
453
- },//}}}
454
- 'description': self.adaptor.theme_dir + 'rngs/terminate.rng',
455
- 'permissible_children': function(node,mode) { //{{{
456
- return [];
457
- }, //}}}
458
- 'adaptor': {//{{{
459
- 'mousedown': function (node,e) { self.events.mousedown(node,e,false,false); },
460
- 'touchstart': function (node,e) { self.events.touchstart(node,e,false,false); },
461
- 'touchend': self.events.touchend,
462
- 'mouseover': self.events.mouseover,
463
- 'mouseout': self.events.mouseout
464
- }//}}}
465
- }; /*}}}*/
466
- this.elements.end = { /*{{{*/
467
- 'type': 'primitive',
468
- 'illustrator': {//{{{
469
- 'endnodes': 'this',
470
- 'svg': self.adaptor.theme_dir + 'symbols/end.svg'
471
- }, //}}}
472
- 'adaptor': {//{{{
473
- 'mousedown': function (node,e) { self.events.suppress(); }
474
- }//}}}
475
- }; /*}}}*/
476
- this.elements.event_end = { /*{{{*/
477
- 'type': 'primitive',
478
- 'illustrator': {//{{{
479
- 'endnodes': 'this',
480
- 'svg': self.adaptor.theme_dir + 'symbols/event_end.svg'
481
- }, //}}}
482
- 'adaptor': {//{{{
483
- 'mousedown': function (node,e) { self.events.suppress(); },
484
- 'click': self.events.click,
485
- 'dblclick': self.events.dblclick,
486
- 'mouseover': self.events.mouseover,
487
- 'mouseout': self.events.mouseout
488
- }//}}}
489
- }; /*}}}*/
490
- this.elements.choose_finish = { /*{{{*/
491
- 'type': 'primitive',
492
- 'illustrator': {//{{{
493
- 'endnodes': 'this',
494
- 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg',
495
- 'resolve_symbol': function(node) {
496
- if($(node).attr('mode') == 'exclusive') {
497
- return 'choose_exclusive_finish';
498
- } else {
499
- return 'choose_inclusive_finish';
306
+ if(node.parent('parallel_branch').length > 0) {
307
+ childs.push({
308
+ 'label': 'Critical',
309
+ 'function_call': func,
310
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
311
+ 'type': 'critical',
312
+ 'params': [self.adaptor.description.elements.critical, node]
313
+ });
500
314
  }
501
- },
502
- }, //}}}
503
- 'adaptor': {//{{{
504
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
505
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
506
- 'touchend': self.events.touchend,
507
- 'click': self.events.click,
508
- 'dblclick': self.events.dblclick,
509
- 'mouseover': self.events.mouseover,
510
- 'mouseout': self.events.mouseout
511
- }//}}}
512
- }; /*}}}*/
513
- this.elements.loop_finish = { /*{{{*/
514
- 'type': 'primitive',
515
- 'illustrator': {//{{{
516
- 'endnodes': 'this',
517
- 'closeblock': true,
518
- 'label': function(node){
519
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
520
- return ret;
521
- },
522
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg',
523
- }, //}}}
524
- 'adaptor': {//{{{
525
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
526
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
527
- 'touchend': self.events.touchend,
528
- 'click': self.events.click,
529
- 'dblclick': self.events.dblclick,
530
- 'mouseover': self.events.mouseover,
531
- 'mouseout': self.events.mouseout
532
- }//}}}
533
- }; /*}}}*/
534
- this.elements.parallel_finish = { /*{{{*/
535
- 'type': 'primitive',
536
- 'illustrator': {//{{{
537
- 'endnodes': 'this',
538
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
539
- 'resolve_symbol': function(node) {
540
- if($(node).children(':not(parallel_branch)').length > 0) {
541
- return 'parallel_complex';
542
- } else if($(node).attr('cancel') == 'last' && $(node).attr('wait') == '-1') {
543
- return 'parallel_simple';
544
- } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == '-1') {
545
- return 'parallel_event_all';
546
- } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == '1') {
547
- return 'parallel_event_one';
548
- } else {
549
- return 'parallel_complex';
315
+ return childs;
316
+ }, //}}}
317
+ 'adaptor': {//{{{
318
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
319
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
320
+ 'touchend': self.events.touchend,
321
+ 'click': self.events.click,
322
+ 'dblclick': self.events.dblclick,
323
+ 'mouseover': self.events.mouseover,
324
+ 'mouseout': self.events.mouseout,
325
+ }//}}}
326
+ }; /*}}}*/
327
+ this.elements.loop = { /*{{{*/
328
+ 'type': 'complex',
329
+ 'illustrator': {//{{{
330
+ 'resolve_symbol': function(node) {
331
+ if($(node).attr('mode') == 'pre_test') {
332
+ return 'loop_head';
333
+ } else {
334
+ return 'loop_tail';
335
+ }
336
+ },
337
+ 'expansion': function(node) {
338
+ return 'vertical';
339
+ },
340
+ 'col_shift': function(node) {
341
+ return true;
342
+ },
343
+ 'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
344
+ },// }}}
345
+ 'description': self.adaptor.theme_dir + 'rngs/loop.rng',
346
+ 'permissible_children': function(node,mode) { //{{{
347
+ var func = null;
348
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
349
+ else { func = self.adaptor.description.insert_after }
350
+ var childs = [
351
+ {'label': 'Task with Output Transformation',
352
+ 'function_call': func,
353
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
354
+ 'type': 'callmanipulate',
355
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
356
+ {'label': 'Task',
357
+ 'function_call': func,
358
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
359
+ 'type': 'call',
360
+ 'params': [self.adaptor.description.elements.call, node]},
361
+ {'label': 'Script',
362
+ 'function_call': func,
363
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
364
+ 'type': 'manipulate',
365
+ 'params': [self.adaptor.description.elements.manipulate, node]},
366
+ {'label': 'Decision',
367
+ 'function_call': func,
368
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
369
+ 'type': 'choose',
370
+ 'params': [self.adaptor.description.elements.choose, node]},
371
+ {'label': 'Loop',
372
+ 'function_call': func,
373
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
374
+ 'type': 'loop',
375
+ 'params': [self.adaptor.description.elements.loop, node]},
376
+ {'label': 'Terminate',
377
+ 'function_call': func,
378
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
379
+ 'type': 'terminate',
380
+ 'params': [self.adaptor.description.elements.terminate, node]},
381
+ {'label': 'Stop',
382
+ 'function_call': func,
383
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
384
+ 'type': 'stop',
385
+ 'params': [self.adaptor.description.elements.stop, node]}
386
+ ];
387
+ if(node.parent('parallel_branch').length > 0) {
388
+ childs.push({
389
+ 'label': 'Critical',
390
+ 'function_call': func,
391
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
392
+ 'type': 'critical',
393
+ 'params': [self.adaptor.description.elements.critical, node]
394
+ });
550
395
  }
551
- },
552
- }, //}}}
553
- 'adaptor': {//{{{
554
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
555
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
556
- 'touchend': self.events.touchend,
557
- 'click': self.events.click,
558
- 'dblclick': self.events.dblclick,
559
- 'mouseover': self.events.mouseover,
560
- 'mouseout': self.events.mouseout
561
- }//}}}
562
- }; /*}}}*/
563
-
564
- // Complex Elements
565
- this.elements.choose = { /*{{{*/
566
- 'type': 'complex',
567
- 'illustrator': {//{{{
568
- 'label': function(node){ return [ { column: 'Label', value: $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' } ]; },
569
- 'endnodes': 'aggregate',
570
- 'closeblock': false,
571
- 'closing_symbol': 'choose_finish',
572
- 'expansion': function(node) {
573
- return 'horizontal';
574
- },
575
- 'resolve_symbol': function(node) {
576
- if($(node).attr('mode') == 'exclusive') {
577
- return 'choose_exclusive';
396
+ if(node.parent('parallel').length > node.parent('parallel_branch').length) {
397
+ childs.push({'label': 'Parallel Branch',
398
+ 'function_call': func,
399
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
400
+ 'type': 'parallel_branch',
401
+ 'params': [self.adaptor.description.elements.parallel_branch, node]}
402
+ );
578
403
  } else {
579
- return 'choose_inclusive';
404
+ childs.push({'label': 'Parallel',
405
+ 'function_call': func,
406
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
407
+ 'type': 'parallel',
408
+ 'params': [self.adaptor.description.elements.parallel, node]}
409
+ );
580
410
  }
581
- },
582
- 'col_shift': function(node) {
583
- return false;
584
- },
585
- 'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
586
- },//}}}
587
- 'description': self.adaptor.theme_dir + 'rngs/choose.rng',
588
- 'permissible_children': function(node,mode) { //{{{
589
- var func = null;
590
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
591
- else { func = self.adaptor.description.insert_after }
592
- if(node.children('parallel_branch').length > 0) {
593
- return [{'label': 'Parallel Branch',
594
- 'function_call': func,
595
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
596
- 'type': 'parallel_branch',
597
- 'params': [self.adaptor.description.elements.parallel_branch, node]}];
598
- }
599
- var childs = [{'label': 'Alternative',
600
- 'function_call': func,
601
- 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
602
- 'type': 'alternative',
603
- 'params': [self.adaptor.description.elements.alternative, node]}];
604
- if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length && node.parent('choose').length == 0)
605
- childs.push({'label': 'Otherwise',
606
- 'function_call': self.adaptor.description.insert_last_into,
607
- 'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
608
- 'type': 'otherwise',
609
- 'params': [self.adaptor.description.elements.otherwise, node]});
610
- if(node.parents('parallel').length > node.parents('parallel_branch').length)
611
- childs.push({'label': 'Parallel Branch',
612
- 'function_call': func,
613
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
614
- 'type': 'parallel_branch',
615
- 'params': [self.adaptor.description.elements.parallel_branch, node]});
616
- return childs;
617
- }, //}}}
618
- 'adaptor': {//{{{
619
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
620
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
621
- 'touchend': self.events.touchend,
622
- 'click': self.events.click,
623
- 'dblclick': self.events.dblclick,
624
- 'mouseover': self.events.mouseover,
625
- 'mouseout': self.events.mouseout
626
- }//}}}
627
- }; /*}}}*/
628
- this.elements.otherwise = { /*{{{*/
629
- 'type': 'complex',
630
- 'illustrator': {//{{{
631
- 'endnodes': 'passthrough',
632
- 'closeblock': false,
633
- 'noarrow': true,
634
- 'expansion': function(node) {
635
- return 'vertical';
636
- },
637
- 'col_shift': function(node) {
638
- return false;
639
- },
640
- 'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
641
- },//}}}
642
- 'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
643
- 'neverdelete': true,
644
- 'permissible_children': function(node,mode) { //{{{
645
- var func = null;
646
- var childs = null;
647
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
648
- else { func = self.adaptor.description.insert_after }
649
- var childs = [
650
- {'label': 'Task with Output Transformation',
651
- 'function_call': func,
652
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
653
- 'type': 'callmanipulate',
654
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
655
- {'label': 'Task',
656
- 'function_call': func,
657
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
658
- 'type': 'call',
659
- 'params': [self.adaptor.description.elements.call, node]},
660
- {'label': 'Script',
661
- 'function_call': func,
662
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
663
- 'type': 'manipulate',
664
- 'params': [self.adaptor.description.elements.manipulate, node]},
665
- {'label': 'Parallel',
666
- 'function_call': func,
667
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
668
- 'type': 'parallel',
669
- 'params': [self.adaptor.description.elements.parallel, node]},
670
- {'label': 'Decision',
671
- 'function_call': func,
672
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
673
- 'type': 'choose',
674
- 'params': [self.adaptor.description.elements.choose, node]},
675
- {'label': 'Loop',
676
- 'function_call': func,
677
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
678
- 'type': 'loop',
679
- 'params': [self.adaptor.description.elements.loop, node]},
680
- {'label': 'Terminate',
681
- 'function_call': func,
682
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
683
- 'type': 'terminate',
684
- 'params': [self.adaptor.description.elements.terminate, node]},
685
- {'label': 'Stop',
686
- 'function_call': func,
687
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
688
- 'type': 'stop',
689
- 'params': [self.adaptor.description.elements.stop, node]}
690
- ];
691
- if(node.parent('parallel_branch').length > 0) {
692
- childs.push({
693
- 'label': 'Critical',
411
+ return childs;
412
+ }, //}}}
413
+ 'adaptor': {//{{{
414
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
415
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
416
+ 'touchend': self.events.touchend,
417
+ 'click': self.events.click,
418
+ 'dblclick': self.events.dblclick,
419
+ 'mouseover': self.events.mouseover,
420
+ 'mouseout': self.events.mouseout,
421
+ }//}}}
422
+ }; /*}}}*/
423
+ this.elements.parallel = { /*{{{*/
424
+ 'type': 'complex',
425
+ 'illustrator': {//{{{
426
+ 'endnodes': 'aggregate',
427
+ 'closeblock': false,
428
+ 'closing_symbol': 'parallel_finish',
429
+ 'expansion': function(node) {
430
+ // check if any sibling other than 'parallel_branch' is present
431
+ if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
432
+ return 'horizontal';
433
+ },
434
+ 'col_shift': function(node) {
435
+ return true;
436
+ },
437
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
438
+ 'resolve_symbol': function(node) {
439
+ if($(node).attr('cancel') == 'last') {
440
+ return 'parallel_start';
441
+ } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == 1) {
442
+ return 'parallel_eventbased_exclusive';
443
+ } else {
444
+ return 'parallel_eventbased_parallel';
445
+ }
446
+ },
447
+ },//}}}
448
+ 'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
449
+ 'permissible_children': function(node,mode) { //{{{
450
+ var func = null;
451
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
452
+ else { func = self.adaptor.description.insert_after }
453
+ var childs = [
454
+ {'label': 'Parallel Branch',
694
455
  'function_call': func,
695
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
696
- 'type': 'critical',
697
- 'params': [self.adaptor.description.elements.critical, node]
698
- });
699
- }
700
- return childs;
701
- }, //}}}
702
- 'adaptor': {//{{{
703
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
704
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
705
- 'touchend': self.events.touchend,
706
- 'click': self.events.click,
707
- 'dblclick': self.events.dblclick,
708
- 'mouseover': self.events.mouseover,
709
- 'mouseout': self.events.mouseout,
710
- }//}}}
711
- }; /*}}}*/
712
- this.elements.alternative = { /*{{{*/
713
- 'type': 'complex',
714
- 'illustrator': {//{{{
715
- 'label': function(node){
716
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
717
- return ret;
718
- },
719
- 'endnodes': 'passthrough',
720
- 'noarrow': true,
721
- 'closeblock':false,
722
- 'expansion': function(node) {
723
- return 'vertical';
724
- },
725
- 'col_shift': function(node) {
726
- return false;
727
- },
728
- 'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
729
- },//}}}
730
- 'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
731
- 'permissible_children': function(node,mode) { //{{{
732
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
733
- else { func = self.adaptor.description.insert_after }
734
- if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
735
- return [{'label': 'Parallel Branch',
736
- 'function_call': func,
737
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
738
- 'type': 'parallel_branch',
739
- 'params': [self.adaptor.description.elements.parallel_branch, node]}];
740
- }
741
- var childs = [
742
- {'label': 'Task with Output Transformation',
743
- 'function_call': func,
744
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
745
- 'type': 'callmanipulate',
746
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
747
- {'label': 'Task',
748
- 'function_call': func,
749
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
750
- 'type': 'call',
751
- 'params': [self.adaptor.description.elements.call, node]},
752
- {'label': 'Script',
753
- 'function_call': func,
754
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
755
- 'type': 'manipulate',
756
- 'params': [self.adaptor.description.elements.manipulate, node]},
757
- {'label': 'Parallel',
758
- 'function_call': func,
759
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
760
- 'type': 'parallel',
761
- 'params': [self.adaptor.description.elements.parallel, node]},
762
- {'label': 'Decision',
763
- 'function_call': func,
764
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
765
- 'type': 'choose',
766
- 'params': [self.adaptor.description.elements.choose, node]},
767
- {'label': 'Loop',
768
- 'function_call': func,
769
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
770
- 'type': 'loop',
771
- 'params': [self.adaptor.description.elements.loop, node]},
772
- {'label': 'Terminate',
773
- 'function_call': func,
774
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
775
- 'type': 'terminate',
776
- 'params': [self.adaptor.description.elements.terminate, node]},
777
- {'label': 'Stop',
778
- 'function_call': func,
779
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
780
- 'type': 'stop',
781
- 'params': [self.adaptor.description.elements.stop, node]}
782
- ];
783
- if(node.parent('parallel_branch').length > 0) {
784
- childs.push({
785
- 'label': 'Critical',
456
+ 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
457
+ 'type': 'parallel_branch',
458
+ 'params': [self.adaptor.description.elements.parallel_branch, node]},
459
+ ];
460
+ return childs;
461
+ }, //}}}
462
+ 'permissible_children_expert': function(node,mode) { //{{{
463
+ var func = null;
464
+ if (mode.match(/into/)) { func = self.adaptor.description.insert_first_into }
465
+ else { func = self.adaptor.description.insert_after }
466
+ var childs = [
467
+ {'label': 'Task with Output Transformation',
786
468
  'function_call': func,
787
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
788
- 'type': 'critical',
789
- 'params': [self.adaptor.description.elements.critical, node]
790
- });
791
- }
792
- return childs;
793
- }, //}}}
794
- 'adaptor': {//{{{
795
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
796
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
797
- 'touchend': self.events.touchend,
798
- 'click': self.events.click,
799
- 'dblclick': self.events.dblclick,
800
- 'mouseover': self.events.mouseover,
801
- 'mouseout': self.events.mouseout,
802
- }//}}}
803
- }; /*}}}*/
804
- this.elements.loop = { /*{{{*/
805
- 'type': 'complex',
806
- 'illustrator': {//{{{
807
- 'resolve_symbol': function(node) {
808
- if($(node).attr('mode') == 'pre_test') {
809
- return 'loop_head';
810
- } else {
811
- return 'loop_tail';
812
- }
813
- },
814
- 'expansion': function(node) {
815
- return 'vertical';
816
- },
817
- 'col_shift': function(node) {
818
- return true;
819
- },
820
- 'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
821
- },// }}}
822
- 'description': self.adaptor.theme_dir + 'rngs/loop.rng',
823
- 'permissible_children': function(node,mode) { //{{{
824
- var func = null;
825
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
826
- else { func = self.adaptor.description.insert_after }
827
- var childs = [
828
- {'label': 'Task with Output Transformation',
829
- 'function_call': func,
830
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
831
- 'type': 'callmanipulate',
832
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
833
- {'label': 'Task',
834
- 'function_call': func,
835
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
836
- 'type': 'call',
837
- 'params': [self.adaptor.description.elements.call, node]},
838
- {'label': 'Script',
839
- 'function_call': func,
840
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
841
- 'type': 'manipulate',
842
- 'params': [self.adaptor.description.elements.manipulate, node]},
843
- {'label': 'Decision',
844
- 'function_call': func,
845
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
846
- 'type': 'choose',
847
- 'params': [self.adaptor.description.elements.choose, node]},
848
- {'label': 'Loop',
849
- 'function_call': func,
850
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
851
- 'type': 'loop',
852
- 'params': [self.adaptor.description.elements.loop, node]},
853
- {'label': 'Terminate',
854
- 'function_call': func,
855
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
856
- 'type': 'terminate',
857
- 'params': [self.adaptor.description.elements.terminate, node]},
858
- {'label': 'Stop',
859
- 'function_call': func,
860
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
861
- 'type': 'stop',
862
- 'params': [self.adaptor.description.elements.stop, node]}
863
- ];
864
- if(node.parent('parallel_branch').length > 0) {
865
- childs.push({
866
- 'label': 'Critical',
469
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
470
+ 'type': 'callmanipulate',
471
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
472
+ {'label': 'Task',
473
+ 'function_call': func,
474
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
475
+ 'type': 'call',
476
+ 'params': [self.adaptor.description.elements.call, node]},
477
+ {'label': 'Script',
478
+ 'function_call': func,
479
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
480
+ 'type': 'manipulate',
481
+ 'params': [self.adaptor.description.elements.manipulate, node]},
482
+ {'label': 'Decision',
483
+ 'function_call': func,
484
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
485
+ 'type': 'choose',
486
+ 'params': [self.adaptor.description.elements.choose, node]},
487
+ {'label': 'Loop',
488
+ 'function_call': func,
489
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
490
+ 'type': 'loop',
491
+ 'params': [self.adaptor.description.elements.loop, node]},
492
+ {'label': 'Stop',
493
+ 'function_call': func,
494
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
495
+ 'type': 'stop',
496
+ 'params': [self.adaptor.description.elements.stop, node]}
497
+ ];
498
+ if(node.get(0).tagName != 'parallel')
499
+ childs.push({'label': 'Parallel',
500
+ 'function_call': self.adaptor.description.insert_last_into,
501
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
502
+ 'type': 'parallel',
503
+ 'params': [self.adaptor.description.elements.parallel, node]});
504
+ return childs;
505
+ }, //}}}
506
+ 'adaptor': {//{{{
507
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
508
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
509
+ 'touchend': self.events.touchend,
510
+ 'click': self.events.click,
511
+ 'dblclick': self.events.dblclick,
512
+ 'mouseover': self.events.mouseover,
513
+ 'mouseout': self.events.mouseout,
514
+ }//}}}
515
+ }; /*}}}*/
516
+ this.elements.parallel_branch = { /*{{{*/
517
+ 'type': 'complex',
518
+ 'illustrator': {//{{{
519
+ 'endnodes': 'passthrough',
520
+ 'closeblock': false,
521
+ 'noarrow': true,
522
+ 'expansion': function(node) {
523
+ return 'vertical';
524
+ },
525
+ 'resolve_symbol': function(node,shift) {
526
+ if(shift == true) {
527
+ return 'parallel_branch_event';
528
+ } else {
529
+ return 'parallel_branch_normal';
530
+ }
531
+ },
532
+ 'col_shift': function(node) {
533
+ if(node.parentNode.tagName == 'choose') return false;
534
+ if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
535
+ return false;
536
+ },
537
+ 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
538
+ },//}}}
539
+ 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
540
+ 'permissible_children': function(node,mode) { //{{{
541
+ var func = null;
542
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
543
+ else { func = self.adaptor.description.insert_after }
544
+ var childs = [
545
+ {'label': 'Task with Output Transformation',
546
+ 'function_call': func,
547
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
548
+ 'type': 'callmanipulate',
549
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
550
+ {'label': 'Task',
551
+ 'function_call': func,
552
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
553
+ 'type': 'call',
554
+ 'params': [self.adaptor.description.elements.call, node]},
555
+ {'label': 'Script',
556
+ 'function_call': func,
557
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
558
+ 'type': 'manipulate',
559
+ 'params': [self.adaptor.description.elements.manipulate, node]},
560
+ {'label': 'Parallel',
561
+ 'function_call': func,
562
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
563
+ 'type': 'parallel',
564
+ 'params': [self.adaptor.description.elements.parallel, node]},
565
+ {'label': 'Decision',
566
+ 'function_call': func,
567
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
568
+ 'type': 'choose',
569
+ 'params': [self.adaptor.description.elements.choose, node]},
570
+ {'label': 'Loop',
571
+ 'function_call': func,
572
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
573
+ 'type': 'loop',
574
+ 'params': [self.adaptor.description.elements.loop, node]},
575
+ {'label': 'Terminate',
576
+ 'function_call': func,
577
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
578
+ 'type': 'terminate',
579
+ 'params': [self.adaptor.description.elements.terminate, node]},
580
+ {'label': 'Stop',
581
+ 'function_call': func,
582
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
583
+ 'type': 'stop',
584
+ 'params': [self.adaptor.description.elements.stop, node]},
585
+ {'label': 'Critical',
867
586
  'function_call': func,
868
587
  'menu_icon': self.elements.critical.illustrator.svg.clone(),
869
588
  'type': 'critical',
870
- 'params': [self.adaptor.description.elements.critical, node]
871
- });
872
- }
873
- if(node.parent('parallel').length > node.parent('parallel_branch').length) {
874
- childs.push({'label': 'Parallel Branch',
875
- 'function_call': func,
876
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
877
- 'type': 'parallel_branch',
878
- 'params': [self.adaptor.description.elements.parallel_branch, node]}
879
- );
880
- } else {
881
- childs.push({'label': 'Parallel',
882
- 'function_call': func,
883
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
884
- 'type': 'parallel',
885
- 'params': [self.adaptor.description.elements.parallel, node]}
886
- );
887
- }
888
- return childs;
889
- }, //}}}
890
- 'adaptor': {//{{{
891
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
892
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
893
- 'touchend': self.events.touchend,
894
- 'click': self.events.click,
895
- 'dblclick': self.events.dblclick,
896
- 'mouseover': self.events.mouseover,
897
- 'mouseout': self.events.mouseout,
898
- }//}}}
899
- }; /*}}}*/
900
- this.elements.parallel = { /*{{{*/
901
- 'type': 'complex',
902
- 'illustrator': {//{{{
903
- 'endnodes': 'aggregate',
904
- 'closeblock': false,
905
- 'closing_symbol': 'parallel_finish',
906
- 'expansion': function(node) {
907
- // check if any sibling other than 'parallel_branch' is present
908
- if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
909
- return 'horizontal';
910
- },
911
- 'col_shift': function(node) {
912
- return true;
913
- },
914
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg',
915
- 'resolve_symbol': function(node) {
916
- if($(node).attr('cancel') == 'last') {
917
- return 'parallel_start';
918
- } else if($(node).attr('cancel') == 'first' && $(node).attr('wait') == 1) {
919
- return 'parallel_eventbased_exclusive';
920
- } else {
921
- return 'parallel_eventbased_parallel';
589
+ 'params': [self.adaptor.description.elements.critical, node]}
590
+ ];
591
+ if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
592
+ return [{'label': 'Alternative',
593
+ 'function_call': func,
594
+ 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
595
+ 'type': 'alternative',
596
+ 'params': [self.adaptor.description.elements.alternative, node]}];
922
597
  }
923
- },
924
- },//}}}
925
- 'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
926
- 'permissible_children': function(node,mode) { //{{{
927
- var func = null;
928
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
929
- else { func = self.adaptor.description.insert_after }
930
- var childs = [
931
- {'label': 'Parallel Branch',
932
- 'function_call': func,
933
- 'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
934
- 'type': 'parallel_branch',
935
- 'params': [self.adaptor.description.elements.parallel_branch, node]},
936
- ];
937
- return childs;
938
- }, //}}}
939
- 'permissible_children_expert': function(node,mode) { //{{{
940
- var func = null;
941
- if (mode.match(/into/)) { func = self.adaptor.description.insert_first_into }
942
- else { func = self.adaptor.description.insert_after }
943
- var childs = [
944
- {'label': 'Task with Output Transformation',
945
- 'function_call': func,
946
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
947
- 'type': 'callmanipulate',
948
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
949
- {'label': 'Task',
950
- 'function_call': func,
951
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
952
- 'type': 'call',
953
- 'params': [self.adaptor.description.elements.call, node]},
954
- {'label': 'Script',
955
- 'function_call': func,
956
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
957
- 'type': 'manipulate',
958
- 'params': [self.adaptor.description.elements.manipulate, node]},
959
- {'label': 'Decision',
960
- 'function_call': func,
961
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
962
- 'type': 'choose',
963
- 'params': [self.adaptor.description.elements.choose, node]},
964
- {'label': 'Loop',
965
- 'function_call': func,
966
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
967
- 'type': 'loop',
968
- 'params': [self.adaptor.description.elements.loop, node]},
969
- {'label': 'Stop',
970
- 'function_call': func,
971
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
972
- 'type': 'stop',
973
- 'params': [self.adaptor.description.elements.stop, node]}
974
- ];
975
- if(node.get(0).tagName != 'parallel')
976
- childs.push({'label': 'Parallel',
977
- 'function_call': self.adaptor.description.insert_last_into,
598
+ return childs;
599
+ }, //}}}
600
+ 'adaptor': {//{{{
601
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
602
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
603
+ 'touchend': self.events.touchend,
604
+ 'click': self.events.click,
605
+ 'dblclick': self.events.dblclick,
606
+ 'mouseover': self.events.mouseover,
607
+ 'mouseout': self.events.mouseout,
608
+ }//}}}
609
+ }; /*}}}*/
610
+ this.elements.critical = { /*{{{*/
611
+ 'type': 'complex',
612
+ 'illustrator': {//{{{
613
+ 'endnodes': 'aggregate',
614
+ 'closeblock': false,
615
+ 'border': true,
616
+ 'expansion': function(node) {
617
+ return 'vertical';
618
+ },
619
+ 'col_shift': function(node) {
620
+ return true;
621
+ },
622
+ 'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
623
+ },//}}}
624
+ 'description': self.adaptor.theme_dir + 'rngs/critical.rng',
625
+ 'permissible_children': function(node,mode) { //{{{
626
+ var func = null;
627
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
628
+ else { func = self.adaptor.description.insert_after }
629
+ var childs = [
630
+ {'label': 'Task with Output Transformation',
631
+ 'function_call': func,
632
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
633
+ 'type': 'callmanipulate',
634
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
635
+ {'label': 'Task',
636
+ 'function_call': func,
637
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
638
+ 'type': 'call',
639
+ 'params': [self.adaptor.description.elements.call, node]},
640
+ {'label': 'Script',
641
+ 'function_call': func,
642
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
643
+ 'type': 'manipulate',
644
+ 'params': [self.adaptor.description.elements.manipulate, node]},
645
+ {'label': 'Parallel',
646
+ 'function_call': func,
978
647
  'menu_icon': self.elements.parallel.illustrator.svg.clone(),
979
648
  'type': 'parallel',
980
- 'params': [self.adaptor.description.elements.parallel, node]});
981
- return childs;
982
- }, //}}}
983
- 'adaptor': {//{{{
984
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
985
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
986
- 'touchend': self.events.touchend,
987
- 'click': self.events.click,
988
- 'dblclick': self.events.dblclick,
989
- 'mouseover': self.events.mouseover,
990
- 'mouseout': self.events.mouseout,
991
- }//}}}
992
- }; /*}}}*/
993
- this.elements.parallel_branch = { /*{{{*/
994
- 'type': 'complex',
995
- 'illustrator': {//{{{
996
- 'endnodes': 'passthrough',
997
- 'closeblock': false,
998
- 'noarrow': true,
999
- 'expansion': function(node) {
1000
- return 'vertical';
1001
- },
1002
- 'resolve_symbol': function(node,shift) {
1003
- if(shift == true) {
1004
- return 'parallel_branch_event';
1005
- } else {
1006
- return 'parallel_branch_normal';
649
+ 'params': [self.adaptor.description.elements.parallel, node]},
650
+ {'label': 'Decision',
651
+ 'function_call': func,
652
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
653
+ 'type': 'choose',
654
+ 'params': [self.adaptor.description.elements.choose, node]},
655
+ {'label': 'Loop',
656
+ 'function_call': func,
657
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
658
+ 'type': 'loop',
659
+ 'params': [self.adaptor.description.elements.loop, node]},
660
+ {'label': 'Terminate',
661
+ 'function_call': func,
662
+ 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
663
+ 'type': 'terminate',
664
+ 'params': [self.adaptor.description.elements.terminate, node]},
665
+ {'label': 'Stop',
666
+ 'function_call': func,
667
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
668
+ 'type': 'stop',
669
+ 'params': [self.adaptor.description.elements.stop, node]}
670
+ ];
671
+ if(node.parent('parallel_branch').length > 0) {
672
+ childs.push({
673
+ 'label': 'Critical',
674
+ 'function_call': func,
675
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
676
+ 'type': 'critical',
677
+ 'params': [self.adaptor.description.elements.critical, node]
678
+ });
1007
679
  }
1008
- },
1009
- 'col_shift': function(node) {
1010
- if(node.parentNode.tagName == 'choose') return false;
1011
- if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
1012
- return false;
1013
- },
1014
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
1015
- },//}}}
1016
- 'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
1017
- 'permissible_children': function(node,mode) { //{{{
1018
- var func = null;
1019
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1020
- else { func = self.adaptor.description.insert_after }
1021
- var childs = [
1022
- {'label': 'Task with Output Transformation',
1023
- 'function_call': func,
1024
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1025
- 'type': 'callmanipulate',
1026
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
1027
- {'label': 'Task',
1028
- 'function_call': func,
1029
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
1030
- 'type': 'call',
1031
- 'params': [self.adaptor.description.elements.call, node]},
1032
- {'label': 'Script',
1033
- 'function_call': func,
1034
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1035
- 'type': 'manipulate',
1036
- 'params': [self.adaptor.description.elements.manipulate, node]},
1037
- {'label': 'Parallel',
1038
- 'function_call': func,
1039
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1040
- 'type': 'parallel',
1041
- 'params': [self.adaptor.description.elements.parallel, node]},
1042
- {'label': 'Decision',
1043
- 'function_call': func,
1044
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1045
- 'type': 'choose',
1046
- 'params': [self.adaptor.description.elements.choose, node]},
1047
- {'label': 'Loop',
1048
- 'function_call': func,
1049
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1050
- 'type': 'loop',
1051
- 'params': [self.adaptor.description.elements.loop, node]},
1052
- {'label': 'Terminate',
1053
- 'function_call': func,
1054
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1055
- 'type': 'terminate',
1056
- 'params': [self.adaptor.description.elements.terminate, node]},
1057
- {'label': 'Stop',
1058
- 'function_call': func,
1059
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1060
- 'type': 'stop',
1061
- 'params': [self.adaptor.description.elements.stop, node]},
1062
- {'label': 'Critical',
1063
- 'function_call': func,
1064
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1065
- 'type': 'critical',
1066
- 'params': [self.adaptor.description.elements.critical, node]}
1067
- ];
1068
- if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
1069
- return [{'label': 'Alternative',
1070
- 'function_call': func,
1071
- 'menu_icon': self.elements.alternative.illustrator.svg.clone(),
1072
- 'type': 'alternative',
1073
- 'params': [self.adaptor.description.elements.alternative, node]}];
1074
- }
1075
- return childs;
1076
- }, //}}}
1077
- 'adaptor': {//{{{
1078
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1079
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1080
- 'touchend': self.events.touchend,
1081
- 'click': self.events.click,
1082
- 'dblclick': self.events.dblclick,
1083
- 'mouseover': self.events.mouseover,
1084
- 'mouseout': self.events.mouseout,
1085
- }//}}}
1086
- }; /*}}}*/
1087
- this.elements.critical = { /*{{{*/
1088
- 'type': 'complex',
1089
- 'illustrator': {//{{{
1090
- 'endnodes': 'aggregate',
1091
- 'closeblock': false,
1092
- 'border': true,
1093
- 'expansion': function(node) {
1094
- return 'vertical';
1095
- },
1096
- 'col_shift': function(node) {
1097
- return true;
1098
- },
1099
- 'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
1100
- },//}}}
1101
- 'description': self.adaptor.theme_dir + 'rngs/critical.rng',
1102
- 'permissible_children': function(node,mode) { //{{{
1103
- var func = null;
1104
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1105
- else { func = self.adaptor.description.insert_after }
1106
- var childs = [
1107
- {'label': 'Task with Output Transformation',
1108
- 'function_call': func,
1109
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1110
- 'type': 'callmanipulate',
1111
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
1112
- {'label': 'Task',
1113
- 'function_call': func,
1114
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
1115
- 'type': 'call',
1116
- 'params': [self.adaptor.description.elements.call, node]},
1117
- {'label': 'Script',
1118
- 'function_call': func,
1119
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1120
- 'type': 'manipulate',
1121
- 'params': [self.adaptor.description.elements.manipulate, node]},
1122
- {'label': 'Parallel',
1123
- 'function_call': func,
1124
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1125
- 'type': 'parallel',
1126
- 'params': [self.adaptor.description.elements.parallel, node]},
1127
- {'label': 'Decision',
1128
- 'function_call': func,
1129
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1130
- 'type': 'choose',
1131
- 'params': [self.adaptor.description.elements.choose, node]},
1132
- {'label': 'Loop',
1133
- 'function_call': func,
1134
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1135
- 'type': 'loop',
1136
- 'params': [self.adaptor.description.elements.loop, node]},
1137
- {'label': 'Terminate',
1138
- 'function_call': func,
1139
- 'menu_icon': self.elements.terminate.illustrator.svg.clone(),
1140
- 'type': 'terminate',
1141
- 'params': [self.adaptor.description.elements.terminate, node]},
1142
- {'label': 'Stop',
1143
- 'function_call': func,
1144
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1145
- 'type': 'stop',
1146
- 'params': [self.adaptor.description.elements.stop, node]}
1147
- ];
1148
- if(node.parent('parallel_branch').length > 0) {
1149
- childs.push({
1150
- 'label': 'Critical',
680
+ return childs;
681
+ }, //}}}
682
+ 'adaptor': {//{{{
683
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
684
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
685
+ 'touchend': self.events.touchend,
686
+ 'click': self.events.click,
687
+ 'dblclick': self.events.dblclick,
688
+ 'mouseover': self.events.mouseover,
689
+ 'mouseout': self.events.mouseout,
690
+ }//}}}
691
+ }; /*}}}*/
692
+ this.elements.start = this.elements.description = { /*{{{*/
693
+ 'type': 'description',
694
+ 'illustrator': {//{{{
695
+ 'endnodes': 'passthrough',
696
+ 'closeblock': false,
697
+ 'balance': true,
698
+ 'expansion': function(node) {
699
+ return 'vertical';
700
+ },
701
+ 'closing_symbol': 'end',
702
+ 'col_shift': function(node) {
703
+ return true;
704
+ },
705
+ 'svg': self.adaptor.theme_dir + 'symbols/start.svg'
706
+ },//}}}
707
+ 'description': null,
708
+ 'permissible_children': function(node,mode) { //{{{
709
+ var func = null;
710
+ if (mode == 'into') { func = self.adaptor.description.insert_first_into }
711
+ else { func = self.adaptor.description.insert_after }
712
+ var childs = [
713
+ {'label': 'Task with Output Transformation',
1151
714
  'function_call': func,
1152
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1153
- 'type': 'critical',
1154
- 'params': [self.adaptor.description.elements.critical, node]
1155
- });
1156
- }
1157
- return childs;
1158
- }, //}}}
1159
- 'adaptor': {//{{{
1160
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1161
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1162
- 'touchend': self.events.touchend,
1163
- 'click': self.events.click,
1164
- 'dblclick': self.events.dblclick,
1165
- 'mouseover': self.events.mouseover,
1166
- 'mouseout': self.events.mouseout,
1167
- }//}}}
1168
- }; /*}}}*/
1169
- this.elements.group = { /*{{{*/
1170
- 'type': 'complex',
1171
- 'illustrator': {//{{{
1172
- 'endnodes': 'aggregate',
1173
- 'closeblock': false,
1174
- 'border': 'injectiongroup', // other value than true,false inidcates the used class for the svg-object
1175
- 'expansion': function(node) {
1176
- return 'vertical';
1177
- },
1178
- 'col_shift': function(node) {
1179
- return true;
1180
- },
1181
- 'svg': null
1182
- },//}}}
1183
- 'description': self.adaptor.theme_dir + 'rngs/group.rng',
1184
- 'permissible_children': function(node,mode) { //{{{
1185
- var func = null;
1186
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1187
- else { func = self.adaptor.description.insert_after }
1188
- return [
1189
- ];
1190
- }, //}}}
1191
- 'adaptor': {//{{{
1192
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
1193
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,true); },
1194
- 'touchend': self.events.touchend,
1195
- 'click': self.events.click,
1196
- 'dblclick': self.events.dblclick,
1197
- 'mouseover': self.events.mouseover,
1198
- 'mouseout': self.events.mouseout,
1199
- }//}}}
1200
- }; /*}}}*/
1201
- this.elements.start = this.elements.description = { /*{{{*/
1202
- 'type': 'description',
1203
- 'illustrator': {//{{{
1204
- 'endnodes': 'passthrough',
1205
- 'closeblock': false,
1206
- 'balance': true,
1207
- 'expansion': function(node) {
1208
- return 'vertical';
1209
- },
1210
- 'closing_symbol': 'end',
1211
- 'col_shift': function(node) {
1212
- return true;
1213
- },
1214
- 'svg': self.adaptor.theme_dir + 'symbols/start.svg'
1215
- },//}}}
1216
- 'description': null,
1217
- 'permissible_children': function(node,mode) { //{{{
1218
- var func = null;
1219
- if (mode == 'into') { func = self.adaptor.description.insert_first_into }
1220
- else { func = self.adaptor.description.insert_after }
1221
- var childs = [
1222
- {'label': 'Task with Output Transformation',
1223
- 'function_call': func,
1224
- 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
1225
- 'type': 'callmanipulate',
1226
- 'params': [self.adaptor.description.elements.callmanipulate, node]},
1227
- {'label': 'Task',
1228
- 'function_call': func,
1229
- 'menu_icon': self.elements.call.illustrator.svg.clone(),
1230
- 'type': 'call',
1231
- 'params': [self.adaptor.description.elements.call, node]},
1232
- {'label': 'Script',
1233
- 'function_call': func,
1234
- 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
1235
- 'type': 'manipulate',
1236
- 'params': [self.adaptor.description.elements.manipulate, node]},
1237
- {'label': 'Parallel',
1238
- 'function_call': func,
1239
- 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
1240
- 'type': 'parallel',
1241
- 'params': [self.adaptor.description.elements.parallel, node]},
1242
- {'label': 'Decision',
1243
- 'function_call': func,
1244
- 'menu_icon': self.elements.choose.illustrator.svg.clone(),
1245
- 'type': 'choose',
1246
- 'params': [self.adaptor.description.elements.choose, node]},
1247
- {'label': 'Loop',
1248
- 'function_call': func,
1249
- 'menu_icon': self.elements.loop.illustrator.svg.clone(),
1250
- 'type': 'loop',
1251
- 'params': [self.adaptor.description.elements.loop, node]},
1252
- {'label': 'Stop',
1253
- 'function_call': func,
1254
- 'menu_icon': self.elements.stop.illustrator.svg.clone(),
1255
- 'type': 'stop',
1256
- 'params': [self.adaptor.description.elements.stop, node]}
1257
- ];
1258
- if(node.parent('parallel_branch').length > 0) {
1259
- childs.push({
1260
- 'label': 'Critical',
715
+ 'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
716
+ 'type': 'callmanipulate',
717
+ 'params': [self.adaptor.description.elements.callmanipulate, node]},
718
+ {'label': 'Task',
1261
719
  'function_call': func,
1262
- 'menu_icon': self.elements.critical.illustrator.svg.clone(),
1263
- 'type': 'critical',
1264
- 'params': [self.adaptor.description.elements.critical, node]
1265
- });
1266
- }
1267
- return childs;
1268
- }, //}}}
1269
- 'adaptor': {//{{{
1270
- 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
1271
- 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
1272
- 'touchend': self.events.touchend,
1273
- 'click': self.events.click,
1274
- 'dblclick': self.events.dblclick,
1275
- 'mouseover': self.events.mouseover,
1276
- 'mouseout': self.events.mouseout,
1277
- }//}}}
1278
- }; /*}}}*/
1279
-
1280
- // Abstract Elements
1281
- // * they may only have an illustrator (or other parts)
1282
- // * they HAVE TO have a parent
1283
- this.elements.callmanipulate = { /*{{{*/
1284
- 'parent': 'call',
1285
- 'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
1286
- 'illustrator': {//{{{
1287
- 'info': function(node){ return { 'element-endpoint': $(node).attr('endpoint') }; },
1288
- 'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
1289
- },//}}}
1290
- }; /*}}}*/
1291
- this.elements.loop_head = { /*{{{*/
1292
- 'parent': 'loop',
1293
- 'illustrator': {//{{{
1294
- 'endnodes': 'this',
1295
- 'closeblock': true,
1296
- 'label': function(node){
1297
- var ret = [ { column: 'Label', value: $(node).attr('condition') } ];
1298
- return ret;
1299
- },
1300
- }//}}}
1301
- }; /*}}}*/
1302
- this.elements.loop_tail = { /*{{{*/
1303
- 'parent': 'loop',
1304
- 'illustrator': {//{{{
1305
- 'endnodes': 'aggregate',
1306
- 'closeblock': false,
1307
- 'closing_symbol': 'loop_finish'
1308
- },//}}}
1309
- }; /*}}}*/
1310
- this.elements.choose_inclusive = { /*{{{*/
1311
- 'parent': 'choose',
1312
- 'illustrator': {//{{{
1313
- 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1314
- }//}}}
1315
- }; /*}}}*/
1316
- this.elements.choose_exclusive = { /*{{{*/
1317
- 'parent': 'choose',
1318
- 'illustrator': {//{{{
1319
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1320
- },//}}}
1321
- }; /*}}}*/
1322
- this.elements.choose_inclusive_finish = { /*{{{*/
1323
- 'parent': 'choose_finish',
1324
- 'illustrator': {//{{{
1325
- 'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
1326
- }//}}}
1327
- }; /*}}}*/
1328
- this.elements.choose_exclusive_finish = { /*{{{*/
1329
- 'parent': 'choose_finish',
1330
- 'illustrator': {//{{{
1331
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1332
- },//}}}
1333
- }; /*}}}*/
1334
- this.elements.loop_head_finish = { /*{{{*/
1335
- 'parent': 'loop_finish',
1336
- 'illustrator': {//{{{
1337
- 'endnodes': 'this',
1338
- 'closeblock': true,
1339
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1340
- }//}}}
1341
- }; /*}}}*/
1342
- this.elements.loop_tail_finish = { /*{{{*/
1343
- 'parent': 'loop_finish',
1344
- 'illustrator': {//{{{
1345
- 'endnodes': 'this',
1346
- 'closeblock': false,
1347
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1348
- },//}}}
1349
- }; /*}}}*/
1350
- this.elements.parallel_start = { /*{{{*/
1351
- 'parent': 'parallel',
1352
- 'illustrator': {//{{{
1353
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1354
- }//}}}
1355
- }; /*}}}*/
1356
- this.elements.parallel_eventbased_exclusive = { /*{{{*/
1357
- 'parent': 'parallel',
1358
- 'illustrator': {//{{{
1359
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_eventbased_exclusive.svg'
1360
- }//}}}
1361
- }; /*}}}*/
1362
- this.elements.parallel_eventbased_parallel = { /*{{{*/
1363
- 'parent': 'parallel',
1364
- 'illustrator': {//{{{
1365
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_eventbased_parallel.svg'
1366
- }//}}}
1367
- }; /*}}}*/
1368
- this.elements.parallel_simple = { /*{{{*/
1369
- 'parent': 'parallel_finish',
1370
- 'illustrator': {//{{{
1371
- 'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
1372
- }//}}}
1373
- }; /*}}}*/
1374
- this.elements.parallel_complex = { /*{{{*/
1375
- 'parent': 'parallel_finish',
1376
- 'illustrator': {//{{{
1377
- 'svg': self.adaptor.theme_dir + 'symbols/complex.svg'
1378
- },//}}}
1379
- }; /*}}}*/
1380
- this.elements.parallel_event_all = { /*{{{*/
1381
- 'parent': 'parallel_finish',
1382
- 'illustrator': {//{{{
1383
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_eventbased_parallel.svg'
1384
- }//}}}
1385
- }; /*}}}*/
1386
- this.elements.parallel_event_one = { /*{{{*/
1387
- 'parent': 'parallel_finish',
1388
- 'illustrator': {//{{{
1389
- 'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
1390
- }//}}}
1391
- }; /*}}}*/
1392
- this.elements.parallel_branch_normal = { /*{{{*/
1393
- 'parent': 'parallel_branch',
1394
- 'illustrator': {//{{{
1395
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_normal.svg'
1396
- }//}}}
1397
- }; /*}}}*/
1398
- this.elements.parallel_branch_event = { /*{{{*/
1399
- 'parent': 'parallel_branch',
1400
- 'illustrator': {//{{{
1401
- 'endnodes': 'this',
1402
- 'noarrow': false,
1403
- 'border': true,
1404
- 'wide': true,
1405
- 'closing_symbol': 'event_end',
1406
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_event.svg'
1407
- }//}}}
1408
- }; /*}}}*/
1409
- this.elements.parallel_branch_compact = { /*{{{*/
1410
- 'parent': 'parallel_branch',
1411
- 'illustrator': {//{{{
1412
- 'endnodes': 'this',
1413
- 'svg': self.adaptor.theme_dir + 'symbols/parallel_branch_compact.svg'
1414
- }//}}}
1415
- }; /*}}}*/
1416
- this.elements.scripts = { /*{{{*/
1417
- 'description': [self.adaptor.theme_dir + 'rngs/scripts.rng']
1418
- }; /*}}}*/
720
+ 'menu_icon': self.elements.call.illustrator.svg.clone(),
721
+ 'type': 'call',
722
+ 'params': [self.adaptor.description.elements.call, node]},
723
+ {'label': 'Script',
724
+ 'function_call': func,
725
+ 'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
726
+ 'type': 'manipulate',
727
+ 'params': [self.adaptor.description.elements.manipulate, node]},
728
+ {'label': 'Parallel',
729
+ 'function_call': func,
730
+ 'menu_icon': self.elements.parallel.illustrator.svg.clone(),
731
+ 'type': 'parallel',
732
+ 'params': [self.adaptor.description.elements.parallel, node]},
733
+ {'label': 'Decision',
734
+ 'function_call': func,
735
+ 'menu_icon': self.elements.choose.illustrator.svg.clone(),
736
+ 'type': 'choose',
737
+ 'params': [self.adaptor.description.elements.choose, node]},
738
+ {'label': 'Loop',
739
+ 'function_call': func,
740
+ 'menu_icon': self.elements.loop.illustrator.svg.clone(),
741
+ 'type': 'loop',
742
+ 'params': [self.adaptor.description.elements.loop, node]},
743
+ {'label': 'Stop',
744
+ 'function_call': func,
745
+ 'menu_icon': self.elements.stop.illustrator.svg.clone(),
746
+ 'type': 'stop',
747
+ 'params': [self.adaptor.description.elements.stop, node]}
748
+ ];
749
+ if(node.parent('parallel_branch').length > 0) {
750
+ childs.push({
751
+ 'label': 'Critical',
752
+ 'function_call': func,
753
+ 'menu_icon': self.elements.critical.illustrator.svg.clone(),
754
+ 'type': 'critical',
755
+ 'params': [self.adaptor.description.elements.critical, node]
756
+ });
757
+ }
758
+ return childs;
759
+ }, //}}}
760
+ 'adaptor': {//{{{
761
+ 'mousedown': function (node,e) { self.events.mousedown(node,e,true,false); },
762
+ 'touchstart': function (node,e) { self.events.touchstart(node,e,true,false); },
763
+ 'touchend': self.events.touchend,
764
+ 'click': self.events.click,
765
+ 'dblclick': self.events.dblclick,
766
+ 'mouseover': self.events.mouseover,
767
+ 'mouseout': self.events.mouseout,
768
+ }//}}}
769
+ }; /*}}}*/
770
+ }
1419
771
  }