cpee 1.3.223 → 1.3.224
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cockpit/css/ui.css +14 -14
- data/cockpit/css/wfadaptor.css +50 -0
- data/cockpit/graph.html +116 -0
- data/cockpit/index.html +41 -41
- data/cockpit/js/instance.js +15 -5
- data/cockpit/js/ui.js +5 -11
- data/cockpit/js/wfadaptor.js +20 -7
- data/cockpit/themes/{labels → compact}/theme.js +199 -48
- data/cockpit/themes/default/rngs/call.rng +26 -0
- data/cockpit/themes/default/rngs/callmanipulate.rng +29 -0
- data/cockpit/themes/default/rngs/manipulate.rng +3 -0
- data/cockpit/themes/default/symbols/alternative.svg +1 -1
- data/cockpit/themes/default/symbols/arrow.svg +3 -0
- data/cockpit/themes/default/symbols/call.svg +1 -1
- data/cockpit/themes/default/symbols/callcorrelationreceive.svg +1 -1
- data/cockpit/themes/default/symbols/callcorrelationsend.svg +2 -2
- data/cockpit/themes/default/symbols/callinstantiation.svg +1 -1
- data/cockpit/themes/default/symbols/callmanipulate.svg +1 -1
- data/cockpit/themes/default/symbols/callmanipulateworklist.svg +2 -2
- data/cockpit/themes/default/symbols/callworklist.svg +1 -1
- data/cockpit/themes/default/symbols/choose.svg +1 -1
- data/cockpit/themes/default/symbols/choose_exclusive.svg +1 -1
- data/cockpit/themes/default/symbols/choose_inclusive.svg +1 -1
- data/cockpit/themes/default/symbols/critical.svg +2 -2
- data/cockpit/themes/default/symbols/escape.svg +1 -1
- data/cockpit/themes/default/symbols/loop.svg +1 -1
- data/cockpit/themes/default/symbols/manipulate.svg +1 -1
- data/cockpit/themes/default/symbols/otherwise.svg +1 -1
- data/cockpit/themes/default/symbols/parallel.svg +1 -1
- data/cockpit/themes/default/symbols/parallel_branch.svg +1 -1
- data/cockpit/themes/default/symbols/scripts.svg +1 -1
- data/cockpit/themes/default/theme.js +198 -57
- data/cockpit/themes/lego/theme.js +459 -400
- data/cockpit/themes/promise/theme.js +459 -400
- data/cpee.gemspec +1 -1
- data/server/resources/transformation_dslx.xsl +98 -0
- metadata +5 -67
- data/cockpit/themes/adventure/rngs/alternative.rng +0 -5
- data/cockpit/themes/adventure/rngs/call.rng +0 -29
- data/cockpit/themes/adventure/rngs/callmanipulate.rng +0 -41
- data/cockpit/themes/adventure/rngs/choose.rng +0 -8
- data/cockpit/themes/adventure/rngs/critical.rng +0 -5
- data/cockpit/themes/adventure/rngs/escape.rng +0 -1
- data/cockpit/themes/adventure/rngs/finalize.rng +0 -6
- data/cockpit/themes/adventure/rngs/group.rng +0 -3
- data/cockpit/themes/adventure/rngs/loop.rng +0 -11
- data/cockpit/themes/adventure/rngs/manipulate.rng +0 -6
- data/cockpit/themes/adventure/rngs/otherwise.rng +0 -1
- data/cockpit/themes/adventure/rngs/parallel.rng +0 -5
- data/cockpit/themes/adventure/rngs/parallel_branch.rng +0 -8
- data/cockpit/themes/adventure/rngs/update.rng +0 -6
- data/cockpit/themes/adventure/symbols/alternative.svg +0 -4
- data/cockpit/themes/adventure/symbols/call.svg +0 -4
- data/cockpit/themes/adventure/symbols/callmanipulate.svg +0 -6
- data/cockpit/themes/adventure/symbols/choose.svg +0 -5
- data/cockpit/themes/adventure/symbols/choose_exclusive.svg +0 -5
- data/cockpit/themes/adventure/symbols/choose_inclusive.svg +0 -4
- data/cockpit/themes/adventure/symbols/critical.svg +0 -4
- data/cockpit/themes/adventure/symbols/escape.svg +0 -5
- data/cockpit/themes/adventure/symbols/loop.svg +0 -5
- data/cockpit/themes/adventure/symbols/manipulate.svg +0 -4
- data/cockpit/themes/adventure/symbols/otherwise.svg +0 -4
- data/cockpit/themes/adventure/symbols/parallel.svg +0 -5
- data/cockpit/themes/adventure/symbols/parallel_branch.svg +0 -4
- data/cockpit/themes/adventure/symbols/scripts.svg +0 -4
- data/cockpit/themes/adventure/symbols/start.svg +0 -3
- data/cockpit/themes/adventure/theme.js +0 -739
- data/cockpit/themes/labels/rngs/alternative.rng +0 -5
- data/cockpit/themes/labels/rngs/call.rng +0 -32
- data/cockpit/themes/labels/rngs/callmanipulate.rng +0 -47
- data/cockpit/themes/labels/rngs/choose.rng +0 -8
- data/cockpit/themes/labels/rngs/critical.rng +0 -5
- data/cockpit/themes/labels/rngs/escape.rng +0 -1
- data/cockpit/themes/labels/rngs/finalize.rng +0 -6
- data/cockpit/themes/labels/rngs/group.rng +0 -3
- data/cockpit/themes/labels/rngs/loop.rng +0 -11
- data/cockpit/themes/labels/rngs/manipulate.rng +0 -6
- data/cockpit/themes/labels/rngs/otherwise.rng +0 -1
- data/cockpit/themes/labels/rngs/parallel.rng +0 -5
- data/cockpit/themes/labels/rngs/parallel_branch.rng +0 -8
- data/cockpit/themes/labels/rngs/update.rng +0 -6
- data/cockpit/themes/labels/symbols/alternative.svg +0 -4
- data/cockpit/themes/labels/symbols/call.svg +0 -4
- data/cockpit/themes/labels/symbols/callcorrelationreceive.svg +0 -6
- data/cockpit/themes/labels/symbols/callcorrelationsend.svg +0 -6
- data/cockpit/themes/labels/symbols/callinstantiation.svg +0 -3
- data/cockpit/themes/labels/symbols/callmanipulate.svg +0 -6
- data/cockpit/themes/labels/symbols/callmanipulateworklist.svg +0 -6
- data/cockpit/themes/labels/symbols/callworklist.svg +0 -4
- data/cockpit/themes/labels/symbols/choose.svg +0 -5
- data/cockpit/themes/labels/symbols/choose_exclusive.svg +0 -5
- data/cockpit/themes/labels/symbols/choose_inclusive.svg +0 -4
- data/cockpit/themes/labels/symbols/critical.svg +0 -4
- data/cockpit/themes/labels/symbols/escape.svg +0 -5
- data/cockpit/themes/labels/symbols/loop.svg +0 -5
- data/cockpit/themes/labels/symbols/manipulate.svg +0 -4
- data/cockpit/themes/labels/symbols/otherwise.svg +0 -4
- data/cockpit/themes/labels/symbols/parallel.svg +0 -5
- data/cockpit/themes/labels/symbols/parallel_branch.svg +0 -4
- data/cockpit/themes/labels/symbols/scripts.svg +0 -4
- data/cockpit/themes/labels/symbols/start.svg +0 -3
@@ -1,84 +1,106 @@
|
|
1
1
|
function WFAdaptorManifestation(adaptor) {
|
2
|
+
var self = this;
|
3
|
+
|
2
4
|
this.adaptor = adaptor;
|
3
|
-
this.elements =
|
4
|
-
this.events =
|
5
|
+
this.elements = {};
|
6
|
+
this.events = {};
|
7
|
+
this.compact = false;
|
5
8
|
|
6
|
-
this.noarrow =
|
7
|
-
this.
|
8
|
-
|
9
|
-
|
9
|
+
this.noarrow = ['alternative', 'otherwise'];
|
10
|
+
this.source = function(rng) {
|
11
|
+
$('#relaxngworker').empty();
|
12
|
+
var rngw = new RelaxNGui(rng,$('#relaxngworker'),self.adaptor.description.context_eval);
|
13
|
+
var nnew = $(rngw.save().documentElement);
|
14
|
+
nnew.attr('trans-xmlns','http://cpee.org/ns/description/1.0');
|
15
|
+
var ntxt = nnew.serializeXML();
|
16
|
+
ntxt = ntxt.replace(/trans-xmlns/,'xmlns');
|
17
|
+
|
18
|
+
return($X(ntxt));
|
19
|
+
};
|
20
|
+
this.clicked = function(){
|
21
|
+
var svgid = 'unknown';
|
22
|
+
_.each(self.adaptor.illustrator.get_elements(),function(value,key) {
|
23
|
+
if ($(value).hasClass('clicked')) {
|
24
|
+
svgid = $(value).attr('element-id');
|
25
|
+
}
|
26
|
+
});
|
27
|
+
return svgid;
|
28
|
+
};
|
10
29
|
|
11
30
|
// Events
|
12
31
|
this.events.mousedown = function(svgid, e, child, sibling) { // {{{
|
13
32
|
if(e.button == 0) { // left-click
|
14
33
|
} else if(e.button == 1) { // middle-click
|
15
34
|
} else if(e.button == 2) { // right-click
|
16
|
-
var xml_node = adaptor.description.get_node_by_svg_id(svgid);
|
35
|
+
var xml_node = self.adaptor.description.get_node_by_svg_id(svgid);
|
17
36
|
var group = null;
|
18
37
|
var menu = {};
|
19
38
|
|
20
|
-
if(child) {
|
21
|
-
group = elements[xml_node.get(0).tagName].permissible_children(xml_node);
|
39
|
+
if (child) {
|
40
|
+
group = self.elements[xml_node.get(0).tagName].permissible_children(xml_node,'into');
|
22
41
|
if(group.length > 0) menu['Insert into'] = group;
|
23
42
|
}
|
24
|
-
if(sibling) {
|
25
|
-
group = elements[xml_node.parent().get(0).tagName].permissible_children(xml_node);
|
43
|
+
if (sibling) {
|
44
|
+
group = self.elements[xml_node.parent().get(0).tagName].permissible_children(xml_node,'after');
|
26
45
|
if(group.length > 0) menu['Insert after'] = group;
|
27
46
|
}
|
28
47
|
|
29
|
-
if(xml_node.get(0).tagName != 'description' && !elements[xml_node.get(0).tagName].neverdelete)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
48
|
+
if(xml_node.get(0).tagName != 'description' && !self.elements[xml_node.get(0).tagName].neverdelete) {
|
49
|
+
var icon = self.elements[xml_node.get(0).tagName].illustrator.svg.clone();
|
50
|
+
icon.children('.rfill').css({'fill':'#ff7f7f','fill-opacity':'1'});
|
51
|
+
menu['Delete'] = [{
|
52
|
+
'label': 'Remove Element',
|
53
|
+
'function_call': self.adaptor.description.remove,
|
54
|
+
'menu_icon': icon,
|
55
|
+
'params': [null, xml_node]
|
56
|
+
}];
|
57
|
+
}
|
58
|
+
if($('> finalize, > update', xml_node).length > 0 && xml_node.get(0).tagName == 'call') {
|
59
|
+
var icon = self.elements.callmanipulate.illustrator.svg.clone();
|
60
|
+
icon.children('.rfill:last').css({'fill':'#ff7f7f','fill-opacity':'1'});
|
61
|
+
menu['Delete'].push({
|
62
|
+
'label': 'Remove Scripts',
|
63
|
+
'function_call': self.adaptor.description.remove,
|
64
|
+
'menu_icon': icon,
|
65
|
+
'params': ['> finalize, > update', xml_node]
|
66
|
+
});
|
47
67
|
}
|
48
68
|
new CustomMenu(e).contextmenu(menu);
|
49
69
|
}
|
50
70
|
return false;
|
51
71
|
} // }}}
|
52
72
|
this.events.click = function(svgid, e) { // {{{
|
53
|
-
if (adaptor.description.get_node_by_svg_id(svgid).length == 0) {
|
73
|
+
if (self.adaptor.description.get_node_by_svg_id(svgid).length == 0) {
|
54
74
|
return;
|
55
75
|
}
|
56
76
|
|
57
|
-
if ($('#state').text() != 'finished')
|
58
|
-
$('#main ui-behind button').show();
|
59
|
-
if ($('#main ui-behind button').hasClass('highlight')) {
|
60
|
-
var check = confirm("Discard changes?");
|
61
|
-
if (check)
|
62
|
-
$('#main ui-behind button').removeClass('highlight');
|
63
|
-
else
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
|
67
77
|
var visid = 'details';
|
68
78
|
var tab = $('#dat_' + visid);
|
69
|
-
|
79
|
+
tab.empty();
|
70
80
|
|
71
|
-
|
81
|
+
self.adaptor.illustrator.get_elements().removeClass('clicked');
|
72
82
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
success: function(rng){
|
78
|
-
save[visid] = new RelaxNGui(rng,tab);
|
79
|
-
save[visid].content(node,adaptor.description.context_eval);
|
83
|
+
if (e && e.ctrlKey) {
|
84
|
+
var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
|
85
|
+
if (vtarget.length > 0) {
|
86
|
+
vtarget.parents('g.element[element-id]').toggleClass('marked');
|
80
87
|
}
|
81
|
-
}
|
88
|
+
} else {
|
89
|
+
self.adaptor.illustrator.get_elements().removeClass('marked');
|
90
|
+
|
91
|
+
var vtarget = self.adaptor.illustrator.get_node_by_svg_id(svgid);
|
92
|
+
if (vtarget.length > 0) {
|
93
|
+
vtarget.parents('g.element[element-id]').addClass('clicked');
|
94
|
+
}
|
95
|
+
|
96
|
+
var node = self.adaptor.description.get_node_by_svg_id(svgid).get(0);
|
97
|
+
|
98
|
+
if (self.adaptor.description.elements[$(node).attr('svg-type')]) {
|
99
|
+
save[visid + '_target'] = { 'svgid': svgid, 'model': self.adaptor.description };
|
100
|
+
save[visid] = new RelaxNGui(self.adaptor.description.elements[$(node).attr('svg-type')],tab,self.adaptor.description.context_eval);
|
101
|
+
save[visid].content(node);
|
102
|
+
}
|
103
|
+
}
|
82
104
|
} // }}}
|
83
105
|
this.events.dblclick = function(svgid, e) { // {{{
|
84
106
|
} // }}}
|
@@ -93,42 +115,23 @@ function WFAdaptorManifestation(adaptor) {
|
|
93
115
|
this.events.dragstart = function (svgid, e) { //{{{
|
94
116
|
} //}}}
|
95
117
|
|
96
|
-
// Abstract Elements (they only have an illustrator)
|
97
|
-
this.elements.callmanipulate = { /*{{{*/
|
98
|
-
'illustrator': {//{{{
|
99
|
-
'type' : 'abstract',
|
100
|
-
'svg': adaptor.theme_dir + 'symbols/callmanipulate.svg'
|
101
|
-
},//}}}
|
102
|
-
}; /*}}}*/
|
103
|
-
this.elements.choose_inclusive = { /*{{{*/
|
104
|
-
'illustrator': {//{{{
|
105
|
-
'type' : 'abstract',
|
106
|
-
'svg': adaptor.theme_dir + 'symbols/choose_inclusive.svg'
|
107
|
-
},//}}}
|
108
|
-
}; /*}}}*/
|
109
|
-
this.elements.choose_exclusive = { /*{{{*/
|
110
|
-
'illustrator': {//{{{
|
111
|
-
'type' : 'abstract',
|
112
|
-
'svg': adaptor.theme_dir + 'symbols/choose_exclusive.svg'
|
113
|
-
},//}}}
|
114
|
-
}; /*}}}*/
|
115
|
-
this.elements.callassline = { /*{{{*/
|
116
|
-
'illustrator': {//{{{
|
117
|
-
'type' : 'abstract',
|
118
|
-
'svg': adaptor.theme_dir + 'symbols/lego.svg'
|
119
|
-
},//}}}
|
120
|
-
}; /*}}}*/
|
121
|
-
|
122
118
|
// Primitive Elements
|
123
119
|
this.elements.call = { /*{{{*/
|
120
|
+
'type': 'primitive',
|
124
121
|
'illustrator': {//{{{
|
125
|
-
'
|
126
|
-
'
|
127
|
-
'resolve_symbol'
|
128
|
-
if($(node).attr('endpoint')
|
122
|
+
'endnodes': 'this',
|
123
|
+
'label': function(node){return $('label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'')},
|
124
|
+
'resolve_symbol': function(node) {
|
125
|
+
if($(node).attr('endpoint').match(/^instantiation/)) {
|
129
126
|
return 'callinstantiation';
|
130
|
-
} else if($(node).attr('endpoint')
|
131
|
-
return '
|
127
|
+
} else if($(node).attr('endpoint').match(/^correlation_send/)) {
|
128
|
+
return 'callcorrelationsend';
|
129
|
+
} else if($(node).attr('endpoint').match(/^correlation_receive/)) {
|
130
|
+
return 'callcorrelationreceive';
|
131
|
+
} else if($(node).attr('endpoint').match(/^worklist/) && $('finalize,update', node).length > 0) {
|
132
|
+
return 'callmanipulateworklist';
|
133
|
+
} else if($(node).attr('endpoint').match(/^worklist/)) {
|
134
|
+
return 'callworklist';
|
132
135
|
} else if($('parameters > service', node).length > 0) {
|
133
136
|
return 'callinjection';
|
134
137
|
} else if($('finalize,update', node).length > 0) {
|
@@ -137,606 +140,662 @@ function WFAdaptorManifestation(adaptor) {
|
|
137
140
|
return'call';
|
138
141
|
}
|
139
142
|
},
|
140
|
-
'svg': adaptor.theme_dir + 'symbols/call.svg'
|
143
|
+
'svg': self.adaptor.theme_dir + 'symbols/call.svg'
|
141
144
|
},//}}}
|
142
|
-
'description':
|
143
|
-
'permissible_children': function(node) { //{{{
|
145
|
+
'description': self.adaptor.theme_dir + 'rngs/call.rng',
|
146
|
+
'permissible_children': function(node,mode) { //{{{
|
144
147
|
if(node.children('finalize,update').length < 1)
|
145
148
|
return [
|
146
149
|
{'label': 'Scripts',
|
147
|
-
'function_call': adaptor.description.insert_last_into,
|
148
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
149
|
-
'params': [adaptor.description.elements.scripts, node]}
|
150
|
+
'function_call': self.adaptor.description.insert_last_into,
|
151
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
152
|
+
'params': [self.adaptor.description.elements.scripts, node]}
|
150
153
|
];
|
151
154
|
return [];
|
152
155
|
}, //}}}
|
153
|
-
'adaptor'
|
154
|
-
'mousedown': function (node,
|
155
|
-
'click': events.click,
|
156
|
-
'dragstart': events.dragstart,
|
156
|
+
'adaptor': {//{{{
|
157
|
+
'mousedown': function (node,e) { self.events.mousedown(node,e,true,true); },
|
158
|
+
'click': self.events.click,
|
159
|
+
'dragstart': self.events.dragstart,
|
157
160
|
}//}}}
|
158
161
|
}; /*}}}*/
|
159
|
-
this.elements.scripts = { /*{{{*/
|
160
|
-
'illustrator': {//{{{
|
161
|
-
'type' : 'primitive',
|
162
|
-
'endnodes' : 'this',
|
163
|
-
'svg': adaptor.theme_dir + 'symbols/scripts.svg'
|
164
|
-
},//}}}
|
165
|
-
'description': ['<finalize xmlns="http://cpee.org/ns/description/1.0"/>','<update xmlns="http://cpee.org/ns/description/1.0"/>'],
|
166
|
-
'permissible_children': function(node) { //{{{
|
167
|
-
return [];
|
168
|
-
}, //}}}
|
169
|
-
'adaptor': { //{{{
|
170
|
-
'mousedown': function (node, e) { events.mousedown(node,e,false, true); },
|
171
|
-
'click': events.click,
|
172
|
-
} //}}}
|
173
|
-
}; /*}}}*/
|
174
162
|
this.elements.manipulate = { /*{{{*/
|
163
|
+
'type': 'primitive',
|
175
164
|
'illustrator': {//{{{
|
176
|
-
'
|
177
|
-
'
|
178
|
-
'svg': adaptor.theme_dir + 'symbols/manipulate.svg'
|
165
|
+
'endnodes': 'this',
|
166
|
+
'label': function(node){return $(node).attr('label').replace(/^['"]/,'').replace(/['"]$/,'')},
|
167
|
+
'svg': self.adaptor.theme_dir + 'symbols/manipulate.svg'
|
179
168
|
},//}}}
|
180
|
-
'description':
|
181
|
-
'permissible_children': function(node) { //{{{
|
169
|
+
'description': self.adaptor.theme_dir + 'rngs/manipulate.rng',
|
170
|
+
'permissible_children': function(node,mode) { //{{{
|
182
171
|
return [];
|
183
172
|
}, //}}}
|
184
|
-
'adaptor'
|
185
|
-
'mousedown': function (node,
|
186
|
-
'click': events.click,
|
173
|
+
'adaptor': {//{{{
|
174
|
+
'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
|
175
|
+
'click': self.events.click,
|
187
176
|
}//}}}
|
188
177
|
}; /*}}}*/
|
189
178
|
this.elements.escape = { /*{{{*/
|
179
|
+
'type': 'primitive',
|
190
180
|
'illustrator': {//{{{
|
191
|
-
'
|
192
|
-
'
|
193
|
-
'svg': adaptor.theme_dir + 'symbols/escape.svg'
|
181
|
+
'endnodes': 'this',
|
182
|
+
'svg': self.adaptor.theme_dir + 'symbols/escape.svg'
|
194
183
|
},//}}}
|
195
|
-
'description': '
|
196
|
-
'permissible_children': function(node) { //{{{
|
184
|
+
'description': self.adaptor.theme_dir + 'rngs/escape.rng',
|
185
|
+
'permissible_children': function(node,mode) { //{{{
|
197
186
|
return [];
|
198
187
|
}, //}}}
|
199
|
-
'adaptor'
|
200
|
-
'mousedown': function (node,
|
201
|
-
'click': events.click,
|
188
|
+
'adaptor': {//{{{
|
189
|
+
'mousedown': function (node,e) { self.events.mousedown(node,e,false,true); },
|
190
|
+
'click': self.events.click,
|
202
191
|
}//}}}
|
203
192
|
}; /*}}}*/
|
204
193
|
|
205
194
|
// Complex Elements
|
206
195
|
this.elements.choose = { /*{{{*/
|
196
|
+
'type': 'complex',
|
207
197
|
'illustrator': {//{{{
|
208
|
-
'
|
209
|
-
'endnodes'
|
198
|
+
'label': function(node){return $(node).attr('mode') == 'exclusive' ? 'exclusive' : 'inclusive' },
|
199
|
+
'endnodes': 'aggregate',
|
210
200
|
'closeblock': false,
|
211
|
-
'expansion'
|
201
|
+
'expansion': function(node) {
|
212
202
|
return 'horizontal';
|
213
203
|
},
|
214
|
-
'resolve_symbol'
|
204
|
+
'resolve_symbol': function(node) {
|
215
205
|
if($(node).attr('mode') == 'exclusive') {
|
216
206
|
return 'choose_exclusive';
|
217
207
|
} else {
|
218
208
|
return 'choose_inclusive';
|
219
209
|
}
|
220
210
|
},
|
221
|
-
'col_shift'
|
211
|
+
'col_shift': function(node) {
|
222
212
|
return false;
|
223
213
|
},
|
224
|
-
'svg': adaptor.theme_dir + 'symbols/choose.svg'
|
214
|
+
'svg': self.adaptor.theme_dir + 'symbols/choose.svg'
|
225
215
|
},//}}}
|
226
|
-
'description':
|
227
|
-
'permissible_children': function(node) { //{{{
|
216
|
+
'description': self.adaptor.theme_dir + 'rngs/choose.rng',
|
217
|
+
'permissible_children': function(node,mode) { //{{{
|
228
218
|
var func = null;
|
229
|
-
if(
|
230
|
-
else { func = adaptor.description.insert_after }
|
219
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
220
|
+
else { func = self.adaptor.description.insert_after }
|
231
221
|
if(node.children('parallel_branch').length > 0) {
|
232
222
|
return [{'label': 'Parallel Branch',
|
233
223
|
'function_call': func,
|
234
|
-
'menu_icon': elements.parallel_branch.illustrator.svg,
|
235
|
-
'params': [adaptor.description.elements.parallel_branch, node]}];
|
224
|
+
'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
|
225
|
+
'params': [self.adaptor.description.elements.parallel_branch, node]}];
|
236
226
|
}
|
237
227
|
var childs = [{'label': 'Alternative',
|
238
228
|
'function_call': func,
|
239
|
-
'menu_icon': elements.alternative.illustrator.svg,
|
240
|
-
'params': [adaptor.description.elements.alternative, node]}];
|
229
|
+
'menu_icon': self.elements.alternative.illustrator.svg.clone(),
|
230
|
+
'params': [self.adaptor.description.elements.alternative, node]}];
|
241
231
|
if((node.children('otherwise').length == 0) && node.parents('parallel').length == node.parents('parallel_branch').length)
|
242
232
|
childs.push({'label': 'Otherwise',
|
243
|
-
'function_call':
|
244
|
-
'menu_icon': elements.otherwise.illustrator.svg,
|
245
|
-
'params': [adaptor.description.elements.otherwise, node]});
|
233
|
+
'function_call': self.adaptor.description.insert_last_into,
|
234
|
+
'menu_icon': self.elements.otherwise.illustrator.svg.clone(),
|
235
|
+
'params': [self.adaptor.description.elements.otherwise, node]});
|
246
236
|
if(node.parents('parallel').length > node.parents('parallel_branch').length)
|
247
237
|
childs.push({'label': 'Parallel Branch',
|
248
238
|
'function_call': func,
|
249
|
-
'menu_icon': elements.parallel_branch.illustrator.svg,
|
250
|
-
'params': [adaptor.description.elements.parallel_branch, node]});
|
239
|
+
'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
|
240
|
+
'params': [self.adaptor.description.elements.parallel_branch, node]});
|
251
241
|
return childs;
|
252
242
|
}, //}}}
|
253
|
-
'adaptor'
|
254
|
-
'mousedown': function (node,
|
255
|
-
events.mousedown(node,e,true,
|
243
|
+
'adaptor': {//{{{
|
244
|
+
'mousedown': function (node,e) {
|
245
|
+
self.events.mousedown(node,e,true,true);
|
256
246
|
},
|
257
|
-
'click': events.click,
|
258
|
-
'dblclick': events.dblclick,
|
259
|
-
'mouseover': events.mouseover,
|
260
|
-
'mouseout': events.mouseout,
|
247
|
+
'click': self.events.click,
|
248
|
+
'dblclick': self.events.dblclick,
|
249
|
+
'mouseover': self.events.mouseover,
|
250
|
+
'mouseout': self.events.mouseout,
|
261
251
|
}//}}}
|
262
252
|
}; /*}}}*/
|
263
253
|
this.elements.otherwise = { /*{{{*/
|
254
|
+
'type': 'complex',
|
264
255
|
'illustrator': {//{{{
|
265
|
-
'
|
266
|
-
'endnodes' : 'passthrough',
|
256
|
+
'endnodes': 'passthrough',
|
267
257
|
'closeblock': false,
|
268
|
-
'expansion'
|
258
|
+
'expansion': function(node) {
|
269
259
|
return 'vertical';
|
270
260
|
},
|
271
|
-
'col_shift'
|
261
|
+
'col_shift': function(node) {
|
272
262
|
return false;
|
273
263
|
},
|
274
|
-
'svg': adaptor.theme_dir + 'symbols/otherwise.svg'
|
264
|
+
'svg': self.adaptor.theme_dir + 'symbols/otherwise.svg'
|
275
265
|
},//}}}
|
276
|
-
'description': '
|
266
|
+
'description': self.adaptor.theme_dir + 'rngs/otherwise.rng',
|
277
267
|
'neverdelete': true,
|
278
|
-
'permissible_children': function(node) { //{{{
|
268
|
+
'permissible_children': function(node,mode) { //{{{
|
279
269
|
var func = null;
|
280
270
|
var childs = null;
|
281
|
-
if(
|
282
|
-
else { func = adaptor.description.insert_after }
|
271
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
272
|
+
else { func = self.adaptor.description.insert_after }
|
283
273
|
return [
|
284
274
|
{'label': 'Service Call with Scripts',
|
285
275
|
'function_call': func,
|
286
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
287
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
276
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
277
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
288
278
|
{'label': 'Service Call',
|
289
279
|
'function_call': func,
|
290
|
-
'menu_icon': elements.call.illustrator.svg,
|
291
|
-
'params': [adaptor.description.elements.call, node]},
|
280
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
281
|
+
'params': [self.adaptor.description.elements.call, node]},
|
292
282
|
{'label': 'Script',
|
293
283
|
'function_call': func,
|
294
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
295
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
284
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
285
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
296
286
|
{'label': 'Parallel',
|
297
287
|
'function_call': func,
|
298
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
299
|
-
'params': [adaptor.description.elements.parallel, node]},
|
300
|
-
{'label': '
|
288
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
289
|
+
'params': [self.adaptor.description.elements.parallel, node]},
|
290
|
+
{'label': 'Decision',
|
301
291
|
'function_call': func,
|
302
|
-
'menu_icon': elements.choose.illustrator.svg,
|
303
|
-
'params': [adaptor.description.elements.choose, node]},
|
292
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
293
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
304
294
|
{'label': 'Loop',
|
305
295
|
'function_call': func,
|
306
|
-
'menu_icon': elements.loop.illustrator.svg,
|
307
|
-
'params': [adaptor.description.elements.loop, node]},
|
296
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
297
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
308
298
|
{'label': 'Critical',
|
309
299
|
'function_call': func,
|
310
|
-
'menu_icon': elements.critical.illustrator.svg,
|
311
|
-
'params': [adaptor.description.elements.critical, node]}
|
300
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
301
|
+
'params': [self.adaptor.description.elements.critical, node]}
|
312
302
|
];
|
313
303
|
}, //}}}
|
314
|
-
'adaptor'
|
315
|
-
'mousedown': function (node,
|
316
|
-
events.mousedown(node,e,true,
|
304
|
+
'adaptor': {//{{{
|
305
|
+
'mousedown': function (node,e) {
|
306
|
+
self.events.mousedown(node,e,true,false);
|
317
307
|
},
|
318
|
-
'click': events.click,
|
319
|
-
'dblclick': events.dblclick,
|
320
|
-
'mouseover': events.mouseover,
|
321
|
-
'mouseout': events.mouseout,
|
308
|
+
'click': self.events.click,
|
309
|
+
'dblclick': self.events.dblclick,
|
310
|
+
'mouseover': self.events.mouseover,
|
311
|
+
'mouseout': self.events.mouseout,
|
322
312
|
}//}}}
|
323
313
|
}; /*}}}*/
|
324
314
|
this.elements.alternative = { /*{{{*/
|
315
|
+
'type': 'complex',
|
325
316
|
'illustrator': {//{{{
|
326
|
-
'
|
327
|
-
'endnodes'
|
317
|
+
'label': function(node){return $(node).attr('condition')},
|
318
|
+
'endnodes': 'passthrough',
|
328
319
|
'closeblock':false,
|
329
|
-
'expansion'
|
320
|
+
'expansion': function(node) {
|
330
321
|
return 'vertical';
|
331
322
|
},
|
332
|
-
'col_shift'
|
323
|
+
'col_shift': function(node) {
|
333
324
|
return false;
|
334
325
|
},
|
335
|
-
'svg': adaptor.theme_dir + 'symbols/alternative.svg'
|
326
|
+
'svg': self.adaptor.theme_dir + 'symbols/alternative.svg'
|
336
327
|
},//}}}
|
337
|
-
'description':
|
338
|
-
'permissible_children': function(node) { //{{{
|
339
|
-
if(
|
340
|
-
else { func = adaptor.description.insert_after }
|
328
|
+
'description': self.adaptor.theme_dir + 'rngs/alternative.rng',
|
329
|
+
'permissible_children': function(node,mode) { //{{{
|
330
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
331
|
+
else { func = self.adaptor.description.insert_after }
|
341
332
|
if(node.parents('parallel').length > node.parents('parallel_branch').length && node.get(0).tagName == 'alternative') {
|
342
333
|
return [{'label': 'Parallel Branch',
|
343
334
|
'function_call': func,
|
344
|
-
'menu_icon': elements.parallel_branch.illustrator.svg,
|
345
|
-
'params': [adaptor.description.elements.parallel_branch, node]}];
|
335
|
+
'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
|
336
|
+
'params': [self.adaptor.description.elements.parallel_branch, node]}];
|
346
337
|
}
|
347
338
|
return [
|
348
339
|
{'label': 'Service Call with Scripts',
|
349
340
|
'function_call': func,
|
350
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
351
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
341
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
342
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
352
343
|
{'label': 'Service Call',
|
353
344
|
'function_call': func,
|
354
|
-
'menu_icon': elements.call.illustrator.svg,
|
355
|
-
'params': [adaptor.description.elements.call, node]},
|
345
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
346
|
+
'params': [self.adaptor.description.elements.call, node]},
|
356
347
|
{'label': 'Script',
|
357
348
|
'function_call': func,
|
358
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
359
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
349
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
350
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
360
351
|
{'label': 'Parallel',
|
361
352
|
'function_call': func,
|
362
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
363
|
-
'params': [adaptor.description.elements.parallel, node]},
|
364
|
-
{'label': '
|
353
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
354
|
+
'params': [self.adaptor.description.elements.parallel, node]},
|
355
|
+
{'label': 'Decision',
|
365
356
|
'function_call': func,
|
366
|
-
'menu_icon': elements.choose.illustrator.svg,
|
367
|
-
'params': [adaptor.description.elements.choose, node]},
|
357
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
358
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
368
359
|
{'label': 'Loop',
|
369
360
|
'function_call': func,
|
370
|
-
'menu_icon': elements.loop.illustrator.svg,
|
371
|
-
'params': [adaptor.description.elements.loop, node]},
|
361
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
362
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
372
363
|
{'label': 'Critical',
|
373
364
|
'function_call': func,
|
374
|
-
'menu_icon': elements.critical.illustrator.svg,
|
375
|
-
'params': [adaptor.description.elements.critical, node]}
|
365
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
366
|
+
'params': [self.adaptor.description.elements.critical, node]}
|
376
367
|
];
|
377
368
|
}, //}}}
|
378
|
-
'adaptor'
|
379
|
-
'mousedown': function (node,
|
380
|
-
events.mousedown(node,e,true,
|
369
|
+
'adaptor': {//{{{
|
370
|
+
'mousedown': function (node,e) {
|
371
|
+
self.events.mousedown(node,e,true,false);
|
381
372
|
},
|
382
|
-
'click': events.click,
|
383
|
-
'dblclick': events.dblclick,
|
384
|
-
'mouseover': events.mouseover,
|
385
|
-
'mouseout': events.mouseout,
|
373
|
+
'click': self.events.click,
|
374
|
+
'dblclick': self.events.dblclick,
|
375
|
+
'mouseover': self.events.mouseover,
|
376
|
+
'mouseout': self.events.mouseout,
|
386
377
|
}//}}}
|
387
378
|
}; /*}}}*/
|
388
379
|
this.elements.loop = { /*{{{*/
|
380
|
+
'type': 'complex',
|
389
381
|
'illustrator': {//{{{
|
390
|
-
'
|
391
|
-
'endnodes'
|
392
|
-
'closeblock'
|
393
|
-
'expansion'
|
382
|
+
'label': function(node){return $(node).attr('condition') + ($(node).attr('mode') == 'pre_test' ? ' (⭱)' : ' (⭳)') },
|
383
|
+
'endnodes': 'this',
|
384
|
+
'closeblock': true,
|
385
|
+
'expansion': function(node) {
|
394
386
|
return 'vertical';
|
395
387
|
},
|
396
|
-
'col_shift'
|
388
|
+
'col_shift': function(node) {
|
397
389
|
return true;
|
398
390
|
},
|
399
|
-
'svg': adaptor.theme_dir + 'symbols/loop.svg'
|
391
|
+
'svg': self.adaptor.theme_dir + 'symbols/loop.svg'
|
400
392
|
},// }}}
|
401
|
-
'description':
|
402
|
-
'permissible_children': function(node) { //{{{
|
393
|
+
'description': self.adaptor.theme_dir + 'rngs/loop.rng',
|
394
|
+
'permissible_children': function(node,mode) { //{{{
|
403
395
|
var func = null;
|
404
|
-
if(
|
405
|
-
else { func = adaptor.description.insert_after }
|
396
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
397
|
+
else { func = self.adaptor.description.insert_after }
|
406
398
|
var childs = [
|
407
399
|
{'label': 'Service Call with Scripts',
|
408
400
|
'function_call': func,
|
409
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
410
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
401
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
402
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
411
403
|
{'label': 'Service Call',
|
412
404
|
'function_call': func,
|
413
|
-
'menu_icon': elements.call.illustrator.svg,
|
414
|
-
'params': [adaptor.description.elements.call, node]},
|
405
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
406
|
+
'params': [self.adaptor.description.elements.call, node]},
|
415
407
|
{'label': 'Manipulate',
|
416
408
|
'function_call': func,
|
417
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
418
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
419
|
-
{'label': '
|
409
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
410
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
411
|
+
{'label': 'Decision',
|
420
412
|
'function_call': func,
|
421
|
-
'menu_icon': elements.choose.illustrator.svg,
|
422
|
-
'params': [adaptor.description.elements.choose, node]},
|
413
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
414
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
423
415
|
{'label': 'Loop',
|
424
416
|
'function_call': func,
|
425
|
-
'menu_icon': elements.loop.illustrator.svg,
|
426
|
-
'params': [adaptor.description.elements.loop, node]},
|
417
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
418
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
427
419
|
{'label': 'Critical',
|
428
420
|
'function_call': func,
|
429
|
-
'menu_icon': elements.critical.illustrator.svg,
|
430
|
-
'params': [adaptor.description.elements.critical, node]}
|
421
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
422
|
+
'params': [self.adaptor.description.elements.critical, node]}
|
431
423
|
];
|
432
424
|
if(node.parent('parallel').length > node.parent('parallel_branch').length) {
|
433
425
|
childs.push({'label': 'Parallel Branch',
|
434
426
|
'function_call': func,
|
435
|
-
'menu_icon': elements.parallel_branch.illustrator.svg,
|
436
|
-
'params': [adaptor.description.elements.parallel_branch, node]}
|
427
|
+
'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
|
428
|
+
'params': [self.adaptor.description.elements.parallel_branch, node]}
|
437
429
|
);
|
438
430
|
} else {
|
439
431
|
childs.push({'label': 'Parallel',
|
440
432
|
'function_call': func,
|
441
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
442
|
-
'params': [adaptor.description.elements.parallel, node]}
|
433
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
434
|
+
'params': [self.adaptor.description.elements.parallel, node]}
|
443
435
|
);
|
444
436
|
}
|
445
437
|
return childs;
|
446
438
|
}, //}}}
|
447
|
-
'adaptor'
|
448
|
-
'mousedown': function (node,
|
449
|
-
events.mousedown(node,e,true,
|
439
|
+
'adaptor': {//{{{
|
440
|
+
'mousedown': function (node,e) {
|
441
|
+
self.events.mousedown(node,e,true,true);
|
450
442
|
},
|
451
|
-
'click': events.click,
|
452
|
-
'dblclick': events.dblclick,
|
453
|
-
'mouseover': events.mouseover,
|
454
|
-
'mouseout': events.mouseout,
|
443
|
+
'click': self.events.click,
|
444
|
+
'dblclick': self.events.dblclick,
|
445
|
+
'mouseover': self.events.mouseover,
|
446
|
+
'mouseout': self.events.mouseout,
|
455
447
|
}//}}}
|
456
448
|
}; /*}}}*/
|
457
449
|
this.elements.parallel = { /*{{{*/
|
450
|
+
'type': 'complex',
|
458
451
|
'illustrator': {//{{{
|
459
|
-
'
|
460
|
-
'
|
461
|
-
'closeblock' : false,
|
452
|
+
'endnodes': 'this',
|
453
|
+
'closeblock': false,
|
462
454
|
'border': true,
|
463
|
-
'expansion'
|
455
|
+
'expansion': function(node) {
|
464
456
|
// check if any sibling other than 'parallel_branch' is present
|
465
457
|
if($(node).children(':not(parallel_branch)').length > 0) return 'vertical';
|
466
458
|
return 'horizontal';
|
467
459
|
},
|
468
|
-
'col_shift'
|
460
|
+
'col_shift': function(node) {
|
469
461
|
return true;
|
470
462
|
},
|
471
|
-
'svg': adaptor.theme_dir + 'symbols/parallel.svg'
|
463
|
+
'svg': self.adaptor.theme_dir + 'symbols/parallel.svg'
|
472
464
|
},//}}}
|
473
|
-
'description': '
|
474
|
-
'permissible_children': function(node) { //{{{
|
465
|
+
'description': self.adaptor.theme_dir + 'rngs/parallel.rng',
|
466
|
+
'permissible_children': function(node,mode) { //{{{
|
475
467
|
var childs = [
|
476
468
|
{'label': 'Service Call with Scripts',
|
477
|
-
'function_call': adaptor.description.insert_last_into,
|
478
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
479
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
469
|
+
'function_call': self.adaptor.description.insert_last_into,
|
470
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
471
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
480
472
|
{'label': 'Service Call',
|
481
|
-
'function_call': adaptor.description.insert_last_into,
|
482
|
-
'menu_icon': elements.call.illustrator.svg,
|
483
|
-
'params': [adaptor.description.elements.call, node]},
|
473
|
+
'function_call': self.adaptor.description.insert_last_into,
|
474
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
475
|
+
'params': [self.adaptor.description.elements.call, node]},
|
484
476
|
{'label': 'Manipulate',
|
485
|
-
'function_call': adaptor.description.insert_last_into,
|
486
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
487
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
488
|
-
{'label': '
|
489
|
-
'function_call': adaptor.description.insert_last_into,
|
490
|
-
'menu_icon': elements.choose.illustrator.svg,
|
491
|
-
'params': [adaptor.description.elements.choose, node]},
|
477
|
+
'function_call': self.adaptor.description.insert_last_into,
|
478
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
479
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
480
|
+
{'label': 'Decision',
|
481
|
+
'function_call': self.adaptor.description.insert_last_into,
|
482
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
483
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
492
484
|
{'label': 'Loop',
|
493
|
-
'function_call': adaptor.description.insert_last_into,
|
494
|
-
'menu_icon': elements.loop.illustrator.svg,
|
495
|
-
'params': [adaptor.description.elements.loop, node]},
|
485
|
+
'function_call': self.adaptor.description.insert_last_into,
|
486
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
487
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
496
488
|
{'label': 'Critical',
|
497
|
-
'function_call': adaptor.description.insert_last_into,
|
498
|
-
'menu_icon': elements.critical.illustrator.svg,
|
499
|
-
'params': [adaptor.description.elements.critical, node]},
|
489
|
+
'function_call': self.adaptor.description.insert_last_into,
|
490
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
491
|
+
'params': [self.adaptor.description.elements.critical, node]},
|
500
492
|
{'label': 'Parallel Branch',
|
501
|
-
'function_call': adaptor.description.insert_last_into,
|
502
|
-
'menu_icon': elements.parallel_branch.illustrator.svg,
|
503
|
-
'params': [adaptor.description.elements.parallel_branch, node]}
|
493
|
+
'function_call': self.adaptor.description.insert_last_into,
|
494
|
+
'menu_icon': self.elements.parallel_branch.illustrator.svg.clone(),
|
495
|
+
'params': [self.adaptor.description.elements.parallel_branch, node]}
|
504
496
|
];
|
505
497
|
if(node.get(0).tagName != 'parallel')
|
506
498
|
childs.push({'label': 'Parallel',
|
507
|
-
'function_call': adaptor.description.insert_last_into,
|
508
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
509
|
-
'params': [adaptor.description.elements.parallel, node]});
|
499
|
+
'function_call': self.adaptor.description.insert_last_into,
|
500
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
501
|
+
'params': [self.adaptor.description.elements.parallel, node]});
|
510
502
|
return childs;
|
511
503
|
}, //}}}
|
512
|
-
'adaptor'
|
513
|
-
'mousedown': function (node,
|
514
|
-
events.mousedown(node,e,true,
|
504
|
+
'adaptor': {//{{{
|
505
|
+
'mousedown': function (node,e) {
|
506
|
+
self.events.mousedown(node,e,true,true);
|
515
507
|
},
|
516
|
-
'click': events.click,
|
517
|
-
'dblclick': events.dblclick,
|
518
|
-
'mouseover': events.mouseover,
|
519
|
-
'mouseout': events.mouseout,
|
508
|
+
'click': self.events.click,
|
509
|
+
'dblclick': self.events.dblclick,
|
510
|
+
'mouseover': self.events.mouseover,
|
511
|
+
'mouseout': self.events.mouseout,
|
520
512
|
}//}}}
|
521
513
|
}; /*}}}*/
|
522
514
|
this.elements.parallel_branch = { /*{{{*/
|
515
|
+
'type': 'complex',
|
523
516
|
'illustrator': {//{{{
|
524
|
-
'
|
525
|
-
'
|
526
|
-
'
|
527
|
-
'expansion' : function(node) {
|
517
|
+
'endnodes': 'this',
|
518
|
+
'closeblock': false,
|
519
|
+
'expansion': function(node) {
|
528
520
|
return 'vertical';
|
529
521
|
},
|
530
|
-
'col_shift'
|
522
|
+
'col_shift': function(node) {
|
531
523
|
if(node.parentNode.tagName == 'choose') return false;
|
532
524
|
if($(node).parents('parallel').first().children(':not(parallel_branch)').length > 0) return true;
|
533
525
|
return false;
|
534
526
|
},
|
535
|
-
'svg': adaptor.theme_dir + 'symbols/parallel_branch.svg'
|
527
|
+
'svg': self.adaptor.theme_dir + 'symbols/parallel_branch.svg'
|
536
528
|
},//}}}
|
537
|
-
'description': '
|
538
|
-
'permissible_children': function(node) { //{{{
|
529
|
+
'description': self.adaptor.theme_dir + 'rngs/parallel_branch.rng',
|
530
|
+
'permissible_children': function(node,mode) { //{{{
|
539
531
|
var func = null;
|
540
532
|
var childs = null;
|
541
|
-
if(
|
542
|
-
else { func = adaptor.description.insert_after }
|
533
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
534
|
+
else { func = self.adaptor.description.insert_after }
|
543
535
|
childs = [
|
544
536
|
{'label': 'Service Call with Scripts',
|
545
537
|
'function_call': func,
|
546
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
547
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
538
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
539
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
548
540
|
{'label': 'Service Call',
|
549
541
|
'function_call': func,
|
550
|
-
'menu_icon': elements.call.illustrator.svg,
|
551
|
-
'params': [adaptor.description.elements.call, node]},
|
542
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
543
|
+
'params': [self.adaptor.description.elements.call, node]},
|
552
544
|
{'label': 'Script',
|
553
545
|
'function_call': func,
|
554
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
555
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
546
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
547
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
556
548
|
{'label': 'Parallel',
|
557
549
|
'function_call': func,
|
558
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
559
|
-
'params': [adaptor.description.elements.parallel, node]},
|
560
|
-
{'label': '
|
550
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
551
|
+
'params': [self.adaptor.description.elements.parallel, node]},
|
552
|
+
{'label': 'Decision',
|
561
553
|
'function_call': func,
|
562
|
-
'menu_icon': elements.choose.illustrator.svg,
|
563
|
-
'params': [adaptor.description.elements.choose, node]},
|
554
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
555
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
564
556
|
{'label': 'Loop',
|
565
557
|
'function_call': func,
|
566
|
-
'menu_icon': elements.loop.illustrator.svg,
|
567
|
-
'params': [adaptor.description.elements.loop, node]},
|
558
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
559
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
568
560
|
{'label': 'Critical',
|
569
561
|
'function_call': func,
|
570
|
-
'menu_icon': elements.critical.illustrator.svg,
|
571
|
-
'params': [adaptor.description.elements.critical, node]},
|
562
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
563
|
+
'params': [self.adaptor.description.elements.critical, node]},
|
572
564
|
];
|
573
565
|
if(node.parents('choose').length > node.parents('alternative, otherwise').length && node.get(0).tagName == 'parallel_branch') {
|
574
566
|
return [{'label': 'Alternative',
|
575
567
|
'function_call': func,
|
576
|
-
'menu_icon': elements.alternative.illustrator.svg,
|
577
|
-
'params': [adaptor.description.elements.alternative, node]}];
|
568
|
+
'menu_icon': self.elements.alternative.illustrator.svg.clone(),
|
569
|
+
'params': [self.adaptor.description.elements.alternative, node]}];
|
578
570
|
}
|
579
571
|
return childs;
|
580
572
|
}, //}}}
|
581
|
-
'adaptor'
|
582
|
-
'mousedown': function (node,
|
583
|
-
events.mousedown(node,e,true,
|
573
|
+
'adaptor': {//{{{
|
574
|
+
'mousedown': function (node,e) {
|
575
|
+
self.events.mousedown(node,e,true,false);
|
584
576
|
},
|
585
|
-
'click': events.click,
|
586
|
-
'dblclick': events.dblclick,
|
587
|
-
'mouseover': events.mouseover,
|
588
|
-
'mouseout': events.mouseout,
|
577
|
+
'click': self.events.click,
|
578
|
+
'dblclick': self.events.dblclick,
|
579
|
+
'mouseover': self.events.mouseover,
|
580
|
+
'mouseout': self.events.mouseout,
|
589
581
|
}//}}}
|
590
582
|
}; /*}}}*/
|
591
583
|
this.elements.critical = { /*{{{*/
|
584
|
+
'type': 'complex',
|
592
585
|
'illustrator': {//{{{
|
593
|
-
'
|
594
|
-
'
|
595
|
-
'closeblock' : false,
|
586
|
+
'endnodes': 'aggregate',
|
587
|
+
'closeblock': false,
|
596
588
|
'border': true,
|
597
|
-
'expansion'
|
589
|
+
'expansion': function(node) {
|
598
590
|
return 'vertical';
|
599
591
|
},
|
600
|
-
'col_shift'
|
592
|
+
'col_shift': function(node) {
|
601
593
|
return true;
|
602
594
|
},
|
603
|
-
'svg': adaptor.theme_dir + 'symbols/critical.svg'
|
595
|
+
'svg': self.adaptor.theme_dir + 'symbols/critical.svg'
|
604
596
|
},//}}}
|
605
|
-
'description':
|
606
|
-
'permissible_children': function(node) { //{{{
|
597
|
+
'description': self.adaptor.theme_dir + 'rngs/critical.rng',
|
598
|
+
'permissible_children': function(node,mode) { //{{{
|
607
599
|
var func = null;
|
608
|
-
if(
|
609
|
-
else { func = adaptor.description.insert_after }
|
600
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
601
|
+
else { func = self.adaptor.description.insert_after }
|
610
602
|
return [
|
611
603
|
{'label': 'Service Call with Scripts',
|
612
604
|
'function_call': func,
|
613
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
614
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
605
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
606
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
615
607
|
{'label': 'Service Call',
|
616
608
|
'function_call': func,
|
617
|
-
'menu_icon': elements.call.illustrator.svg,
|
618
|
-
'params': [adaptor.description.elements.call, node]},
|
609
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
610
|
+
'params': [self.adaptor.description.elements.call, node]},
|
619
611
|
{'label': 'Script',
|
620
612
|
'function_call': func,
|
621
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
622
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
613
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
614
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
623
615
|
{'label': 'Parallel',
|
624
616
|
'function_call': func,
|
625
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
626
|
-
'params': [adaptor.description.elements.parallel, node]},
|
627
|
-
{'label': '
|
617
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
618
|
+
'params': [self.adaptor.description.elements.parallel, node]},
|
619
|
+
{'label': 'Decision',
|
628
620
|
'function_call': func,
|
629
|
-
'menu_icon': elements.choose.illustrator.svg,
|
630
|
-
'params': [adaptor.description.elements.choose, node]},
|
621
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
622
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
631
623
|
{'label': 'Loop',
|
632
624
|
'function_call': func,
|
633
|
-
'menu_icon': elements.loop.illustrator.svg,
|
634
|
-
'params': [adaptor.description.elements.loop, node]},
|
625
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
626
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
635
627
|
{'label': 'Critical',
|
636
628
|
'function_call': func,
|
637
|
-
'menu_icon': elements.critical.illustrator.svg,
|
638
|
-
'params': [adaptor.description.elements.critical, node]},
|
629
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
630
|
+
'params': [self.adaptor.description.elements.critical, node]},
|
639
631
|
];
|
640
632
|
}, //}}}
|
641
|
-
'adaptor'
|
642
|
-
'mousedown': function (node,
|
643
|
-
events.mousedown(node,e,true,
|
633
|
+
'adaptor': {//{{{
|
634
|
+
'mousedown': function (node,e) {
|
635
|
+
self.events.mousedown(node,e,true,true);
|
644
636
|
},
|
645
|
-
'click': events.click,
|
646
|
-
'dblclick': events.dblclick,
|
647
|
-
'mouseover': events.mouseover,
|
648
|
-
'mouseout': events.mouseout,
|
637
|
+
'click': self.events.click,
|
638
|
+
'dblclick': self.events.dblclick,
|
639
|
+
'mouseover': self.events.mouseover,
|
640
|
+
'mouseout': self.events.mouseout,
|
649
641
|
}//}}}
|
650
642
|
}; /*}}}*/
|
651
643
|
this.elements.group = { /*{{{*/
|
644
|
+
'type': 'complex',
|
652
645
|
'illustrator': {//{{{
|
653
|
-
'
|
654
|
-
'
|
655
|
-
'closeblock' : false,
|
646
|
+
'endnodes': 'aggregate',
|
647
|
+
'closeblock': false,
|
656
648
|
'border': 'injectiongroup', // other value than true,false inidcates the used class for the svg-object
|
657
|
-
'expansion'
|
649
|
+
'expansion': function(node) {
|
658
650
|
return 'vertical';
|
659
651
|
},
|
660
|
-
'col_shift'
|
652
|
+
'col_shift': function(node) {
|
661
653
|
return true;
|
662
654
|
},
|
663
655
|
'svg': null
|
664
656
|
},//}}}
|
665
|
-
'description': '
|
666
|
-
'permissible_children': function(node) { //{{{
|
657
|
+
'description': self.adaptor.theme_dir + 'rngs/group.rng',
|
658
|
+
'permissible_children': function(node,mode) { //{{{
|
667
659
|
var func = null;
|
668
|
-
if(
|
669
|
-
else { func = adaptor.description.insert_after }
|
660
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
661
|
+
else { func = self.adaptor.description.insert_after }
|
670
662
|
return [
|
671
663
|
];
|
672
664
|
}, //}}}
|
673
|
-
'adaptor'
|
674
|
-
'mousedown': function (node,
|
675
|
-
events.mousedown(node,e,true,
|
665
|
+
'adaptor': {//{{{
|
666
|
+
'mousedown': function (node,e) {
|
667
|
+
self.events.mousedown(node,e,true,true);
|
676
668
|
},
|
677
|
-
'click': events.click,
|
678
|
-
'dblclick': events.dblclick,
|
679
|
-
'mouseover': events.mouseover,
|
680
|
-
'mouseout': events.mouseout,
|
669
|
+
'click': self.events.click,
|
670
|
+
'dblclick': self.events.dblclick,
|
671
|
+
'mouseover': self.events.mouseover,
|
672
|
+
'mouseout': self.events.mouseout,
|
681
673
|
}//}}}
|
682
674
|
}; /*}}}*/
|
683
675
|
this.elements.start = this.elements.description = { /*{{{*/
|
676
|
+
'type': 'description',
|
684
677
|
'illustrator': {//{{{
|
685
|
-
'
|
686
|
-
'
|
687
|
-
'
|
688
|
-
'expansion' : function(node) {
|
678
|
+
'endnodes': 'passthrough',
|
679
|
+
'closeblock': false,
|
680
|
+
'expansion': function(node) {
|
689
681
|
return 'vertical';
|
690
682
|
},
|
691
|
-
'col_shift'
|
683
|
+
'col_shift': function(node) {
|
692
684
|
return true;
|
693
685
|
},
|
694
|
-
'svg': adaptor.theme_dir + 'symbols/start.svg'
|
686
|
+
'svg': self.adaptor.theme_dir + 'symbols/start.svg'
|
695
687
|
},//}}}
|
696
688
|
'description': null,
|
697
|
-
'permissible_children': function(node) { //{{{
|
689
|
+
'permissible_children': function(node,mode) { //{{{
|
698
690
|
var func = null;
|
699
|
-
if(
|
700
|
-
else { func = adaptor.description.insert_after }
|
691
|
+
if (mode == 'into') { func = self.adaptor.description.insert_first_into }
|
692
|
+
else { func = self.adaptor.description.insert_after }
|
701
693
|
return [
|
702
694
|
{'label': 'Service Call with Scripts',
|
703
695
|
'function_call': func,
|
704
|
-
'menu_icon': elements.callmanipulate.illustrator.svg,
|
705
|
-
'params': [adaptor.description.elements.callmanipulate, node]},
|
696
|
+
'menu_icon': self.elements.callmanipulate.illustrator.svg.clone(),
|
697
|
+
'params': [self.adaptor.description.elements.callmanipulate, node]},
|
706
698
|
{'label': 'Service Call',
|
707
699
|
'function_call': func,
|
708
|
-
'menu_icon': elements.call.illustrator.svg,
|
709
|
-
'params': [adaptor.description.elements.call, node]},
|
700
|
+
'menu_icon': self.elements.call.illustrator.svg.clone(),
|
701
|
+
'params': [self.adaptor.description.elements.call, node]},
|
710
702
|
{'label': 'Script Task',
|
711
703
|
'function_call': func,
|
712
|
-
'menu_icon': elements.manipulate.illustrator.svg,
|
713
|
-
'params': [adaptor.description.elements.manipulate, node]},
|
704
|
+
'menu_icon': self.elements.manipulate.illustrator.svg.clone(),
|
705
|
+
'params': [self.adaptor.description.elements.manipulate, node]},
|
714
706
|
{'label': 'Parallel',
|
715
707
|
'function_call': func,
|
716
|
-
'menu_icon': elements.parallel.illustrator.svg,
|
717
|
-
'params': [adaptor.description.elements.parallel, node]},
|
718
|
-
{'label': '
|
708
|
+
'menu_icon': self.elements.parallel.illustrator.svg.clone(),
|
709
|
+
'params': [self.adaptor.description.elements.parallel, node]},
|
710
|
+
{'label': 'Decision',
|
719
711
|
'function_call': func,
|
720
|
-
'menu_icon': elements.choose.illustrator.svg,
|
721
|
-
'params': [adaptor.description.elements.choose, node]},
|
712
|
+
'menu_icon': self.elements.choose.illustrator.svg.clone(),
|
713
|
+
'params': [self.adaptor.description.elements.choose, node]},
|
722
714
|
{'label': 'Loop',
|
723
715
|
'function_call': func,
|
724
|
-
'menu_icon': elements.loop.illustrator.svg,
|
725
|
-
'params': [adaptor.description.elements.loop, node]},
|
716
|
+
'menu_icon': self.elements.loop.illustrator.svg.clone(),
|
717
|
+
'params': [self.adaptor.description.elements.loop, node]},
|
726
718
|
{'label': 'Critical',
|
727
719
|
'function_call': func,
|
728
|
-
'menu_icon': elements.critical.illustrator.svg,
|
729
|
-
'params': [adaptor.description.elements.critical, node]}
|
720
|
+
'menu_icon': self.elements.critical.illustrator.svg.clone(),
|
721
|
+
'params': [self.adaptor.description.elements.critical, node]}
|
730
722
|
];
|
731
723
|
}, //}}}
|
732
|
-
'adaptor'
|
733
|
-
'mousedown': function (node,
|
734
|
-
events.mousedown(node,e,true,
|
724
|
+
'adaptor': {//{{{
|
725
|
+
'mousedown': function (node,e) {
|
726
|
+
self.events.mousedown(node,e,true,false);
|
735
727
|
},
|
736
|
-
'click': events.click,
|
737
|
-
'dblclick': events.dblclick,
|
738
|
-
'mouseover': events.mouseover,
|
739
|
-
'mouseout': events.mouseout,
|
728
|
+
'click': self.events.click,
|
729
|
+
'dblclick': self.events.dblclick,
|
730
|
+
'mouseover': self.events.mouseover,
|
731
|
+
'mouseout': self.events.mouseout,
|
740
732
|
}//}}}
|
741
733
|
}; /*}}}*/
|
734
|
+
|
735
|
+
// Abstract Elements
|
736
|
+
// * they may only have an illustrator (or other parts)
|
737
|
+
// * they HAVE TO have a parent
|
738
|
+
this.elements.callmanipulate = { /*{{{*/
|
739
|
+
'type': 'abstract',
|
740
|
+
'parent': 'call',
|
741
|
+
'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
|
742
|
+
'illustrator': {//{{{
|
743
|
+
'label': function(node){return $('label',$(node).children('parameters')).text().replace(/^['"]/,'').replace(/['"]$/,'')},
|
744
|
+
'svg': self.adaptor.theme_dir + 'symbols/callmanipulate.svg'
|
745
|
+
},//}}}
|
746
|
+
}; /*}}}*/
|
747
|
+
this.elements.choose_inclusive = { /*{{{*/
|
748
|
+
'type': 'abstract',
|
749
|
+
'parent': 'choose',
|
750
|
+
'illustrator': {//{{{
|
751
|
+
'svg': self.adaptor.theme_dir + 'symbols/choose_inclusive.svg'
|
752
|
+
},//}}}
|
753
|
+
}; /*}}}*/
|
754
|
+
this.elements.choose_exclusive = { /*{{{*/
|
755
|
+
'type': 'abstract',
|
756
|
+
'parent': 'choose',
|
757
|
+
'illustrator': {//{{{
|
758
|
+
'svg': self.adaptor.theme_dir + 'symbols/choose_exclusive.svg'
|
759
|
+
},//}}}
|
760
|
+
}; /*}}}*/
|
761
|
+
this.elements.scripts = { /*{{{*/
|
762
|
+
'type': 'abstract',
|
763
|
+
'description': [self.adaptor.theme_dir + 'rngs/update.rng',self.adaptor.theme_dir + 'rngs/finalize.rng']
|
764
|
+
}; /*}}}*/
|
765
|
+
this.elements.callinstantiation = { /*{{{*/
|
766
|
+
'type': 'abstract',
|
767
|
+
'parent': 'call',
|
768
|
+
'illustrator': {//{{{
|
769
|
+
'svg': self.adaptor.theme_dir + 'symbols/callinstantiation.svg'
|
770
|
+
},//}}}
|
771
|
+
}; /*}}}*/
|
772
|
+
this.elements.callcorrelationsend = { /*{{{*/
|
773
|
+
'type': 'abstract',
|
774
|
+
'parent': 'call',
|
775
|
+
'illustrator': {//{{{
|
776
|
+
'svg': self.adaptor.theme_dir + 'symbols/callcorrelationsend.svg'
|
777
|
+
},//}}}
|
778
|
+
}; /*}}}*/
|
779
|
+
this.elements.callcorrelationreceive = { /*{{{*/
|
780
|
+
'type': 'abstract',
|
781
|
+
'parent': 'call',
|
782
|
+
'illustrator': {//{{{
|
783
|
+
'svg': self.adaptor.theme_dir + 'symbols/callcorrelationreceive.svg'
|
784
|
+
},//}}}
|
785
|
+
}; /*}}}*/
|
786
|
+
this.elements.callworklist = { /*{{{*/
|
787
|
+
'type': 'abstract',
|
788
|
+
'parent': 'call',
|
789
|
+
'illustrator': {//{{{
|
790
|
+
'svg': self.adaptor.theme_dir + 'symbols/callworklist.svg'
|
791
|
+
},//}}}
|
792
|
+
}; /*}}}*/
|
793
|
+
this.elements.callmanipulateworklist = { /*{{{*/
|
794
|
+
'type': 'abstract',
|
795
|
+
'parent': 'call',
|
796
|
+
'description': self.adaptor.theme_dir + 'rngs/callmanipulate.rng',
|
797
|
+
'illustrator': {//{{{
|
798
|
+
'svg': self.adaptor.theme_dir + 'symbols/callmanipulateworklist.svg'
|
799
|
+
},//}}}
|
800
|
+
}; /*}}}*/
|
742
801
|
}
|