camunda-bpmn-js 4.0.0-0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/diagram-js.css +7 -19
- package/dist/assets/properties-panel.css +57 -23
- package/dist/base-modeler.development.js +44323 -41580
- package/dist/base-modeler.production.min.js +52 -53
- package/dist/base-navigated-viewer.development.js +1695 -1148
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +1694 -1151
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +53952 -41021
- package/dist/camunda-cloud-modeler.production.min.js +61 -61
- package/dist/camunda-cloud-navigated-viewer.development.js +1695 -1148
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +1694 -1151
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +45914 -43112
- package/dist/camunda-platform-modeler.production.min.js +52 -53
- package/dist/camunda-platform-navigated-viewer.development.js +1695 -1148
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +1694 -1151
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/lib/camunda-cloud/Modeler.js +0 -3
- package/package.json +33 -33
- package/lib/camunda-cloud/features/rules/BpmnRules.d.ts +0 -32
- package/lib/camunda-cloud/features/rules/BpmnRules.js +0 -161
- package/lib/camunda-cloud/features/rules/index.d.ts +0 -6
- package/lib/camunda-cloud/features/rules/index.js +0 -6
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @template T
|
|
13
13
|
*
|
|
14
|
-
* @param {T[][]} arr
|
|
14
|
+
* @param {T[][] | T[] | null} [arr]
|
|
15
15
|
*
|
|
16
16
|
* @return {T[]}
|
|
17
17
|
*/
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
return obj !== undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function isNil(obj) {
|
|
31
|
+
return obj == null;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
function isArray$2(obj) {
|
|
31
35
|
return nativeToString$1.call(obj) === '[object Array]';
|
|
32
36
|
}
|
|
@@ -475,6 +479,58 @@
|
|
|
475
479
|
return Object.assign(target, ...others);
|
|
476
480
|
}
|
|
477
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Sets a nested property of a given object to the specified value.
|
|
484
|
+
*
|
|
485
|
+
* This mutates the object and returns it.
|
|
486
|
+
*
|
|
487
|
+
* @template T
|
|
488
|
+
*
|
|
489
|
+
* @param {T} target The target of the set operation.
|
|
490
|
+
* @param {(string|number)[]} path The path to the nested value.
|
|
491
|
+
* @param {any} value The value to set.
|
|
492
|
+
*
|
|
493
|
+
* @return {T}
|
|
494
|
+
*/
|
|
495
|
+
function set$2(target, path, value) {
|
|
496
|
+
|
|
497
|
+
let currentTarget = target;
|
|
498
|
+
|
|
499
|
+
forEach$1(path, function(key, idx) {
|
|
500
|
+
|
|
501
|
+
if (typeof key !== 'number' && typeof key !== 'string') {
|
|
502
|
+
throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (key === 'constructor') {
|
|
506
|
+
throw new Error('illegal key: constructor');
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (key === '__proto__') {
|
|
510
|
+
throw new Error('illegal key: __proto__');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
let nextKey = path[idx + 1];
|
|
514
|
+
let nextTarget = currentTarget[key];
|
|
515
|
+
|
|
516
|
+
if (isDefined(nextKey) && isNil(nextTarget)) {
|
|
517
|
+
nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
if (isUndefined$2(nextKey)) {
|
|
521
|
+
if (isUndefined$2(value)) {
|
|
522
|
+
delete currentTarget[key];
|
|
523
|
+
} else {
|
|
524
|
+
currentTarget[key] = value;
|
|
525
|
+
}
|
|
526
|
+
} else {
|
|
527
|
+
currentTarget = nextTarget;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
return target;
|
|
532
|
+
}
|
|
533
|
+
|
|
478
534
|
/**
|
|
479
535
|
* Pick properties from the given target.
|
|
480
536
|
*
|
|
@@ -713,6 +769,26 @@
|
|
|
713
769
|
return true;
|
|
714
770
|
}
|
|
715
771
|
|
|
772
|
+
/**
|
|
773
|
+
* @param {Element} element
|
|
774
|
+
*
|
|
775
|
+
* @return {boolean}
|
|
776
|
+
*/
|
|
777
|
+
function isHorizontal(element) {
|
|
778
|
+
|
|
779
|
+
if (!is$1(element, 'bpmn:Participant') && !is$1(element, 'bpmn:Lane')) {
|
|
780
|
+
return undefined;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
var isHorizontal = getDi(element).isHorizontal;
|
|
784
|
+
|
|
785
|
+
if (isHorizontal === undefined) {
|
|
786
|
+
return true;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return isHorizontal;
|
|
790
|
+
}
|
|
791
|
+
|
|
716
792
|
/**
|
|
717
793
|
* @param {Element} element
|
|
718
794
|
*
|
|
@@ -1784,6 +1860,7 @@
|
|
|
1784
1860
|
}
|
|
1785
1861
|
|
|
1786
1862
|
var black = 'hsl(225, 10%, 15%)';
|
|
1863
|
+
var white = 'white';
|
|
1787
1864
|
|
|
1788
1865
|
// element utils //////////////////////
|
|
1789
1866
|
|
|
@@ -1831,39 +1908,42 @@
|
|
|
1831
1908
|
/**
|
|
1832
1909
|
* @param {Element} element
|
|
1833
1910
|
* @param {string} [defaultColor]
|
|
1911
|
+
* @param {string} [overrideColor]
|
|
1834
1912
|
*
|
|
1835
1913
|
* @return {string}
|
|
1836
1914
|
*/
|
|
1837
|
-
function getFillColor(element, defaultColor) {
|
|
1915
|
+
function getFillColor(element, defaultColor, overrideColor) {
|
|
1838
1916
|
var di = getDi(element);
|
|
1839
1917
|
|
|
1840
|
-
return di.get('color:background-color') || di.get('bioc:fill') || defaultColor ||
|
|
1918
|
+
return overrideColor || di.get('color:background-color') || di.get('bioc:fill') || defaultColor || white;
|
|
1841
1919
|
}
|
|
1842
1920
|
|
|
1843
1921
|
/**
|
|
1844
1922
|
* @param {Element} element
|
|
1845
1923
|
* @param {string} [defaultColor]
|
|
1924
|
+
* @param {string} [overrideColor]
|
|
1846
1925
|
*
|
|
1847
1926
|
* @return {string}
|
|
1848
1927
|
*/
|
|
1849
|
-
function getStrokeColor(element, defaultColor) {
|
|
1928
|
+
function getStrokeColor(element, defaultColor, overrideColor) {
|
|
1850
1929
|
var di = getDi(element);
|
|
1851
1930
|
|
|
1852
|
-
return di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
1931
|
+
return overrideColor || di.get('color:border-color') || di.get('bioc:stroke') || defaultColor || black;
|
|
1853
1932
|
}
|
|
1854
1933
|
|
|
1855
1934
|
/**
|
|
1856
1935
|
* @param {Element} element
|
|
1857
1936
|
* @param {string} [defaultColor]
|
|
1858
1937
|
* @param {string} [defaultStrokeColor]
|
|
1938
|
+
* @param {string} [overrideColor]
|
|
1859
1939
|
*
|
|
1860
1940
|
* @return {string}
|
|
1861
1941
|
*/
|
|
1862
|
-
function getLabelColor(element, defaultColor, defaultStrokeColor) {
|
|
1942
|
+
function getLabelColor(element, defaultColor, defaultStrokeColor, overrideColor) {
|
|
1863
1943
|
var di = getDi(element),
|
|
1864
1944
|
label = di.get('label');
|
|
1865
1945
|
|
|
1866
|
-
return label && label.get('color:color') || defaultColor ||
|
|
1946
|
+
return overrideColor || (label && label.get('color:color')) || defaultColor ||
|
|
1867
1947
|
getStrokeColor(element, defaultStrokeColor);
|
|
1868
1948
|
}
|
|
1869
1949
|
|
|
@@ -1967,6 +2047,45 @@
|
|
|
1967
2047
|
return componentsToPath(rectPath);
|
|
1968
2048
|
}
|
|
1969
2049
|
|
|
2050
|
+
/**
|
|
2051
|
+
* Get width and height from element or overrides.
|
|
2052
|
+
*
|
|
2053
|
+
* @param {Dimensions|Rect|ShapeLike} bounds
|
|
2054
|
+
* @param {Object} overrides
|
|
2055
|
+
*
|
|
2056
|
+
* @returns {Dimensions}
|
|
2057
|
+
*/
|
|
2058
|
+
function getBounds(bounds, overrides = {}) {
|
|
2059
|
+
return {
|
|
2060
|
+
width: getWidth(bounds, overrides),
|
|
2061
|
+
height: getHeight(bounds, overrides)
|
|
2062
|
+
};
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
* Get width from element or overrides.
|
|
2067
|
+
*
|
|
2068
|
+
* @param {Dimensions|Rect|ShapeLike} bounds
|
|
2069
|
+
* @param {Object} overrides
|
|
2070
|
+
*
|
|
2071
|
+
* @returns {number}
|
|
2072
|
+
*/
|
|
2073
|
+
function getWidth(bounds, overrides = {}) {
|
|
2074
|
+
return has$1(overrides, 'width') ? overrides.width : bounds.width;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* Get height from element or overrides.
|
|
2079
|
+
*
|
|
2080
|
+
* @param {Dimensions|Rect|ShapeLike} bounds
|
|
2081
|
+
* @param {Object} overrides
|
|
2082
|
+
*
|
|
2083
|
+
* @returns {number}
|
|
2084
|
+
*/
|
|
2085
|
+
function getHeight(bounds, overrides = {}) {
|
|
2086
|
+
return has$1(overrides, 'height') ? overrides.height : bounds.height;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
1970
2089
|
function _mergeNamespaces$1(n, m) {
|
|
1971
2090
|
m.forEach(function (e) {
|
|
1972
2091
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -2730,15 +2849,16 @@
|
|
|
2730
2849
|
}
|
|
2731
2850
|
};
|
|
2732
2851
|
|
|
2733
|
-
var
|
|
2734
|
-
|
|
2735
|
-
var TASK_BORDER_RADIUS = 10;
|
|
2736
|
-
var INNER_OUTER_DIST = 3;
|
|
2852
|
+
var rendererIds = new Ids();
|
|
2737
2853
|
|
|
2738
|
-
var
|
|
2739
|
-
|
|
2854
|
+
var ELEMENT_LABEL_DISTANCE = 10,
|
|
2855
|
+
INNER_OUTER_DIST = 3,
|
|
2856
|
+
PARTICIPANT_STROKE_WIDTH = 1.5,
|
|
2857
|
+
TASK_BORDER_RADIUS = 10;
|
|
2740
2858
|
|
|
2741
|
-
var
|
|
2859
|
+
var DEFAULT_OPACITY = 0.95,
|
|
2860
|
+
FULL_OPACITY = 1,
|
|
2861
|
+
LOW_OPACITY = 0.25;
|
|
2742
2862
|
|
|
2743
2863
|
/**
|
|
2744
2864
|
* @typedef { Partial<{
|
|
@@ -2746,6 +2866,13 @@
|
|
|
2746
2866
|
* defaultStrokeColor: string,
|
|
2747
2867
|
* defaultLabelColor: string
|
|
2748
2868
|
* }> } BpmnRendererConfig
|
|
2869
|
+
*
|
|
2870
|
+
* @typedef { Partial<{
|
|
2871
|
+
* fill: string,
|
|
2872
|
+
* stroke: string,
|
|
2873
|
+
* width: string,
|
|
2874
|
+
* height: string
|
|
2875
|
+
* }> } Attrs
|
|
2749
2876
|
*/
|
|
2750
2877
|
|
|
2751
2878
|
/**
|
|
@@ -2773,7 +2900,7 @@
|
|
|
2773
2900
|
defaultStrokeColor = config && config.defaultStrokeColor,
|
|
2774
2901
|
defaultLabelColor = config && config.defaultLabelColor;
|
|
2775
2902
|
|
|
2776
|
-
var rendererId =
|
|
2903
|
+
var rendererId = rendererIds.next();
|
|
2777
2904
|
|
|
2778
2905
|
var markers = {};
|
|
2779
2906
|
|
|
@@ -2869,7 +2996,7 @@
|
|
|
2869
2996
|
cy: 6,
|
|
2870
2997
|
r: 3.5,
|
|
2871
2998
|
...shapeStyle({
|
|
2872
|
-
fill
|
|
2999
|
+
fill,
|
|
2873
3000
|
stroke: stroke,
|
|
2874
3001
|
strokeWidth: 1,
|
|
2875
3002
|
|
|
@@ -2889,7 +3016,7 @@
|
|
|
2889
3016
|
var messageflowEnd = create$1('path', {
|
|
2890
3017
|
d: 'm 1 5 l 0 -3 l 7 3 l -7 3 z',
|
|
2891
3018
|
...shapeStyle({
|
|
2892
|
-
fill
|
|
3019
|
+
fill,
|
|
2893
3020
|
stroke: stroke,
|
|
2894
3021
|
strokeWidth: 1,
|
|
2895
3022
|
|
|
@@ -2910,7 +3037,7 @@
|
|
|
2910
3037
|
d: 'M 11 5 L 1 10 L 11 15',
|
|
2911
3038
|
...lineStyle({
|
|
2912
3039
|
fill: 'none',
|
|
2913
|
-
stroke
|
|
3040
|
+
stroke,
|
|
2914
3041
|
strokeWidth: 1.5,
|
|
2915
3042
|
|
|
2916
3043
|
// fix for safari / chrome / firefox bug not correctly
|
|
@@ -2931,7 +3058,7 @@
|
|
|
2931
3058
|
d: 'M 1 5 L 11 10 L 1 15',
|
|
2932
3059
|
...lineStyle({
|
|
2933
3060
|
fill: 'none',
|
|
2934
|
-
stroke
|
|
3061
|
+
stroke,
|
|
2935
3062
|
strokeWidth: 1.5,
|
|
2936
3063
|
|
|
2937
3064
|
// fix for safari / chrome / firefox bug not correctly
|
|
@@ -2951,7 +3078,7 @@
|
|
|
2951
3078
|
var conditionalFlowMarker = create$1('path', {
|
|
2952
3079
|
d: 'M 0 10 L 8 6 L 16 10 L 8 14 Z',
|
|
2953
3080
|
...shapeStyle({
|
|
2954
|
-
fill
|
|
3081
|
+
fill,
|
|
2955
3082
|
stroke: stroke
|
|
2956
3083
|
})
|
|
2957
3084
|
});
|
|
@@ -2979,7 +3106,7 @@
|
|
|
2979
3106
|
}
|
|
2980
3107
|
}
|
|
2981
3108
|
|
|
2982
|
-
function drawCircle(parentGfx, width, height, offset, attrs) {
|
|
3109
|
+
function drawCircle(parentGfx, width, height, offset, attrs = {}) {
|
|
2983
3110
|
|
|
2984
3111
|
if (isObject(offset)) {
|
|
2985
3112
|
attrs = offset;
|
|
@@ -2990,10 +3117,6 @@
|
|
|
2990
3117
|
|
|
2991
3118
|
attrs = shapeStyle(attrs);
|
|
2992
3119
|
|
|
2993
|
-
if (attrs.fill === 'none') {
|
|
2994
|
-
delete attrs.fillOpacity;
|
|
2995
|
-
}
|
|
2996
|
-
|
|
2997
3120
|
var cx = width / 2,
|
|
2998
3121
|
cy = height / 2;
|
|
2999
3122
|
|
|
@@ -3093,7 +3216,6 @@
|
|
|
3093
3216
|
}
|
|
3094
3217
|
|
|
3095
3218
|
function drawPath(parentGfx, d, attrs) {
|
|
3096
|
-
|
|
3097
3219
|
attrs = lineStyle(attrs);
|
|
3098
3220
|
|
|
3099
3221
|
var path = create$1('path', {
|
|
@@ -3115,171 +3237,13 @@
|
|
|
3115
3237
|
}
|
|
3116
3238
|
|
|
3117
3239
|
function as(type) {
|
|
3118
|
-
return function(parentGfx, element,
|
|
3119
|
-
return renderer(type)(parentGfx, element,
|
|
3120
|
-
};
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
function renderEventContent(element, parentGfx) {
|
|
3124
|
-
|
|
3125
|
-
var event = getBusinessObject(element);
|
|
3126
|
-
var isThrowing = isThrowEvent(event);
|
|
3127
|
-
|
|
3128
|
-
if (event.eventDefinitions && event.eventDefinitions.length > 1) {
|
|
3129
|
-
if (event.parallelMultiple) {
|
|
3130
|
-
return renderer('bpmn:ParallelMultipleEventDefinition')(parentGfx, element, isThrowing);
|
|
3131
|
-
}
|
|
3132
|
-
else {
|
|
3133
|
-
return renderer('bpmn:MultipleEventDefinition')(parentGfx, element, isThrowing);
|
|
3134
|
-
}
|
|
3135
|
-
}
|
|
3136
|
-
|
|
3137
|
-
if (isTypedEvent(event, 'bpmn:MessageEventDefinition')) {
|
|
3138
|
-
return renderer('bpmn:MessageEventDefinition')(parentGfx, element, isThrowing);
|
|
3139
|
-
}
|
|
3140
|
-
|
|
3141
|
-
if (isTypedEvent(event, 'bpmn:TimerEventDefinition')) {
|
|
3142
|
-
return renderer('bpmn:TimerEventDefinition')(parentGfx, element, isThrowing);
|
|
3143
|
-
}
|
|
3144
|
-
|
|
3145
|
-
if (isTypedEvent(event, 'bpmn:ConditionalEventDefinition')) {
|
|
3146
|
-
return renderer('bpmn:ConditionalEventDefinition')(parentGfx, element);
|
|
3147
|
-
}
|
|
3148
|
-
|
|
3149
|
-
if (isTypedEvent(event, 'bpmn:SignalEventDefinition')) {
|
|
3150
|
-
return renderer('bpmn:SignalEventDefinition')(parentGfx, element, isThrowing);
|
|
3151
|
-
}
|
|
3152
|
-
|
|
3153
|
-
if (isTypedEvent(event, 'bpmn:EscalationEventDefinition')) {
|
|
3154
|
-
return renderer('bpmn:EscalationEventDefinition')(parentGfx, element, isThrowing);
|
|
3155
|
-
}
|
|
3156
|
-
|
|
3157
|
-
if (isTypedEvent(event, 'bpmn:LinkEventDefinition')) {
|
|
3158
|
-
return renderer('bpmn:LinkEventDefinition')(parentGfx, element, isThrowing);
|
|
3159
|
-
}
|
|
3160
|
-
|
|
3161
|
-
if (isTypedEvent(event, 'bpmn:ErrorEventDefinition')) {
|
|
3162
|
-
return renderer('bpmn:ErrorEventDefinition')(parentGfx, element, isThrowing);
|
|
3163
|
-
}
|
|
3164
|
-
|
|
3165
|
-
if (isTypedEvent(event, 'bpmn:CancelEventDefinition')) {
|
|
3166
|
-
return renderer('bpmn:CancelEventDefinition')(parentGfx, element, isThrowing);
|
|
3167
|
-
}
|
|
3168
|
-
|
|
3169
|
-
if (isTypedEvent(event, 'bpmn:CompensateEventDefinition')) {
|
|
3170
|
-
return renderer('bpmn:CompensateEventDefinition')(parentGfx, element, isThrowing);
|
|
3171
|
-
}
|
|
3172
|
-
|
|
3173
|
-
if (isTypedEvent(event, 'bpmn:TerminateEventDefinition')) {
|
|
3174
|
-
return renderer('bpmn:TerminateEventDefinition')(parentGfx, element, isThrowing);
|
|
3175
|
-
}
|
|
3176
|
-
|
|
3177
|
-
return null;
|
|
3178
|
-
}
|
|
3179
|
-
|
|
3180
|
-
function renderLabel(parentGfx, label, options) {
|
|
3181
|
-
|
|
3182
|
-
options = assign$1({
|
|
3183
|
-
size: {
|
|
3184
|
-
width: 100
|
|
3185
|
-
}
|
|
3186
|
-
}, options);
|
|
3187
|
-
|
|
3188
|
-
var text = textRenderer.createText(label || '', options);
|
|
3189
|
-
|
|
3190
|
-
classes$1(text).add('djs-label');
|
|
3191
|
-
|
|
3192
|
-
append(parentGfx, text);
|
|
3193
|
-
|
|
3194
|
-
return text;
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
function renderEmbeddedLabel(parentGfx, element, align) {
|
|
3198
|
-
var semantic = getBusinessObject(element);
|
|
3199
|
-
|
|
3200
|
-
return renderLabel(parentGfx, semantic.name, {
|
|
3201
|
-
box: element,
|
|
3202
|
-
align: align,
|
|
3203
|
-
padding: 7,
|
|
3204
|
-
style: {
|
|
3205
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3206
|
-
}
|
|
3207
|
-
});
|
|
3208
|
-
}
|
|
3209
|
-
|
|
3210
|
-
function renderExternalLabel(parentGfx, element) {
|
|
3211
|
-
|
|
3212
|
-
var box = {
|
|
3213
|
-
width: 90,
|
|
3214
|
-
height: 30,
|
|
3215
|
-
x: element.width / 2 + element.x,
|
|
3216
|
-
y: element.height / 2 + element.y
|
|
3240
|
+
return function(parentGfx, element, attrs) {
|
|
3241
|
+
return renderer(type)(parentGfx, element, attrs);
|
|
3217
3242
|
};
|
|
3218
|
-
|
|
3219
|
-
return renderLabel(parentGfx, getLabel(element), {
|
|
3220
|
-
box: box,
|
|
3221
|
-
fitBox: true,
|
|
3222
|
-
style: assign$1(
|
|
3223
|
-
{},
|
|
3224
|
-
textRenderer.getExternalStyle(),
|
|
3225
|
-
{
|
|
3226
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3227
|
-
}
|
|
3228
|
-
)
|
|
3229
|
-
});
|
|
3230
|
-
}
|
|
3231
|
-
|
|
3232
|
-
function renderLaneLabel(parentGfx, text, element) {
|
|
3233
|
-
var textBox = renderLabel(parentGfx, text, {
|
|
3234
|
-
box: {
|
|
3235
|
-
height: 30,
|
|
3236
|
-
width: element.height
|
|
3237
|
-
},
|
|
3238
|
-
align: 'center-middle',
|
|
3239
|
-
style: {
|
|
3240
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3241
|
-
}
|
|
3242
|
-
});
|
|
3243
|
-
|
|
3244
|
-
var top = -1 * element.height;
|
|
3245
|
-
|
|
3246
|
-
transform(textBox, 0, -top, 270);
|
|
3247
3243
|
}
|
|
3248
3244
|
|
|
3249
|
-
var
|
|
3250
|
-
'bpmn:
|
|
3251
|
-
|
|
3252
|
-
if (!('fillOpacity' in attrs)) {
|
|
3253
|
-
attrs.fillOpacity = DEFAULT_FILL_OPACITY;
|
|
3254
|
-
}
|
|
3255
|
-
|
|
3256
|
-
return drawCircle(parentGfx, element.width, element.height, attrs);
|
|
3257
|
-
},
|
|
3258
|
-
'bpmn:StartEvent': function(parentGfx, element, options) {
|
|
3259
|
-
var attrs = {
|
|
3260
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3261
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3262
|
-
};
|
|
3263
|
-
|
|
3264
|
-
var semantic = getBusinessObject(element);
|
|
3265
|
-
|
|
3266
|
-
if (!semantic.isInterrupting) {
|
|
3267
|
-
attrs = {
|
|
3268
|
-
strokeDasharray: '6',
|
|
3269
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3270
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3271
|
-
};
|
|
3272
|
-
}
|
|
3273
|
-
|
|
3274
|
-
var circle = renderer('bpmn:Event')(parentGfx, element, attrs);
|
|
3275
|
-
|
|
3276
|
-
if (!options || options.renderIcon !== false) {
|
|
3277
|
-
renderEventContent(element, parentGfx);
|
|
3278
|
-
}
|
|
3279
|
-
|
|
3280
|
-
return circle;
|
|
3281
|
-
},
|
|
3282
|
-
'bpmn:MessageEventDefinition': function(parentGfx, element, isThrowing) {
|
|
3245
|
+
var eventIconRenderers = {
|
|
3246
|
+
'bpmn:MessageEventDefinition': function(parentGfx, element, attrs = {}, isThrowing) {
|
|
3283
3247
|
var pathData = pathMap.getScaledPath('EVENT_MESSAGE', {
|
|
3284
3248
|
xScaleFactor: 0.9,
|
|
3285
3249
|
yScaleFactor: 0.9,
|
|
@@ -3291,22 +3255,27 @@
|
|
|
3291
3255
|
}
|
|
3292
3256
|
});
|
|
3293
3257
|
|
|
3294
|
-
var fill = isThrowing
|
|
3295
|
-
|
|
3258
|
+
var fill = isThrowing
|
|
3259
|
+
? getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3260
|
+
: getFillColor(element, defaultFillColor, attrs.fill);
|
|
3261
|
+
|
|
3262
|
+
var stroke = isThrowing
|
|
3263
|
+
? getFillColor(element, defaultFillColor, attrs.fill)
|
|
3264
|
+
: getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3296
3265
|
|
|
3297
3266
|
var messagePath = drawPath(parentGfx, pathData, {
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3267
|
+
fill,
|
|
3268
|
+
stroke,
|
|
3269
|
+
strokeWidth: 1
|
|
3301
3270
|
});
|
|
3302
3271
|
|
|
3303
3272
|
return messagePath;
|
|
3304
3273
|
},
|
|
3305
|
-
'bpmn:TimerEventDefinition': function(parentGfx, element) {
|
|
3274
|
+
'bpmn:TimerEventDefinition': function(parentGfx, element, attrs = {}) {
|
|
3306
3275
|
var circle = drawCircle(parentGfx, element.width, element.height, 0.2 * element.height, {
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3276
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3277
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3278
|
+
strokeWidth: 2
|
|
3310
3279
|
});
|
|
3311
3280
|
|
|
3312
3281
|
var pathData = pathMap.getScaledPath('EVENT_TIMER_WH', {
|
|
@@ -3321,12 +3290,11 @@
|
|
|
3321
3290
|
});
|
|
3322
3291
|
|
|
3323
3292
|
drawPath(parentGfx, pathData, {
|
|
3324
|
-
|
|
3325
|
-
|
|
3293
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3294
|
+
strokeWidth: 2
|
|
3326
3295
|
});
|
|
3327
3296
|
|
|
3328
|
-
for (var i = 0;i < 12; i++) {
|
|
3329
|
-
|
|
3297
|
+
for (var i = 0; i < 12; i++) {
|
|
3330
3298
|
var linePathData = pathMap.getScaledPath('EVENT_TIMER_LINE', {
|
|
3331
3299
|
xScaleFactor: 0.75,
|
|
3332
3300
|
yScaleFactor: 0.75,
|
|
@@ -3338,19 +3306,19 @@
|
|
|
3338
3306
|
}
|
|
3339
3307
|
});
|
|
3340
3308
|
|
|
3341
|
-
var width = element.width / 2
|
|
3342
|
-
|
|
3309
|
+
var width = element.width / 2,
|
|
3310
|
+
height = element.height / 2;
|
|
3343
3311
|
|
|
3344
3312
|
drawPath(parentGfx, linePathData, {
|
|
3345
3313
|
strokeWidth: 1,
|
|
3346
|
-
|
|
3347
|
-
|
|
3314
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3315
|
+
transform: 'rotate(' + (i * 30) + ',' + height + ',' + width + ')'
|
|
3348
3316
|
});
|
|
3349
3317
|
}
|
|
3350
3318
|
|
|
3351
3319
|
return circle;
|
|
3352
3320
|
},
|
|
3353
|
-
'bpmn:EscalationEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3321
|
+
'bpmn:EscalationEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3354
3322
|
var pathData = pathMap.getScaledPath('EVENT_ESCALATION', {
|
|
3355
3323
|
xScaleFactor: 1,
|
|
3356
3324
|
yScaleFactor: 1,
|
|
@@ -3362,15 +3330,17 @@
|
|
|
3362
3330
|
}
|
|
3363
3331
|
});
|
|
3364
3332
|
|
|
3365
|
-
var fill = isThrowing
|
|
3333
|
+
var fill = isThrowing
|
|
3334
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3335
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3366
3336
|
|
|
3367
3337
|
return drawPath(parentGfx, pathData, {
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3338
|
+
fill,
|
|
3339
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3340
|
+
strokeWidth: 1
|
|
3371
3341
|
});
|
|
3372
3342
|
},
|
|
3373
|
-
'bpmn:ConditionalEventDefinition': function(parentGfx, event) {
|
|
3343
|
+
'bpmn:ConditionalEventDefinition': function(parentGfx, event, attrs = {}) {
|
|
3374
3344
|
var pathData = pathMap.getScaledPath('EVENT_CONDITIONAL', {
|
|
3375
3345
|
xScaleFactor: 1,
|
|
3376
3346
|
yScaleFactor: 1,
|
|
@@ -3383,11 +3353,12 @@
|
|
|
3383
3353
|
});
|
|
3384
3354
|
|
|
3385
3355
|
return drawPath(parentGfx, pathData, {
|
|
3386
|
-
|
|
3387
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3356
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
3357
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3358
|
+
strokeWidth: 1
|
|
3388
3359
|
});
|
|
3389
3360
|
},
|
|
3390
|
-
'bpmn:LinkEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3361
|
+
'bpmn:LinkEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3391
3362
|
var pathData = pathMap.getScaledPath('EVENT_LINK', {
|
|
3392
3363
|
xScaleFactor: 1,
|
|
3393
3364
|
yScaleFactor: 1,
|
|
@@ -3399,15 +3370,17 @@
|
|
|
3399
3370
|
}
|
|
3400
3371
|
});
|
|
3401
3372
|
|
|
3402
|
-
var fill = isThrowing
|
|
3373
|
+
var fill = isThrowing
|
|
3374
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3375
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3403
3376
|
|
|
3404
3377
|
return drawPath(parentGfx, pathData, {
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3378
|
+
fill,
|
|
3379
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3380
|
+
strokeWidth: 1
|
|
3408
3381
|
});
|
|
3409
3382
|
},
|
|
3410
|
-
'bpmn:ErrorEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3383
|
+
'bpmn:ErrorEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3411
3384
|
var pathData = pathMap.getScaledPath('EVENT_ERROR', {
|
|
3412
3385
|
xScaleFactor: 1.1,
|
|
3413
3386
|
yScaleFactor: 1.1,
|
|
@@ -3419,15 +3392,17 @@
|
|
|
3419
3392
|
}
|
|
3420
3393
|
});
|
|
3421
3394
|
|
|
3422
|
-
var fill = isThrowing
|
|
3395
|
+
var fill = isThrowing
|
|
3396
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3397
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3423
3398
|
|
|
3424
3399
|
return drawPath(parentGfx, pathData, {
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3400
|
+
fill,
|
|
3401
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3402
|
+
strokeWidth: 1
|
|
3428
3403
|
});
|
|
3429
3404
|
},
|
|
3430
|
-
'bpmn:CancelEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3405
|
+
'bpmn:CancelEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3431
3406
|
var pathData = pathMap.getScaledPath('EVENT_CANCEL_45', {
|
|
3432
3407
|
xScaleFactor: 1.0,
|
|
3433
3408
|
yScaleFactor: 1.0,
|
|
@@ -3439,19 +3414,19 @@
|
|
|
3439
3414
|
}
|
|
3440
3415
|
});
|
|
3441
3416
|
|
|
3442
|
-
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor) : 'none';
|
|
3417
|
+
var fill = isThrowing ? getStrokeColor(event, defaultStrokeColor, attrs.stroke) : 'none';
|
|
3443
3418
|
|
|
3444
3419
|
var path = drawPath(parentGfx, pathData, {
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3420
|
+
fill,
|
|
3421
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3422
|
+
strokeWidth: 1
|
|
3448
3423
|
});
|
|
3449
3424
|
|
|
3450
3425
|
rotate(path, 45);
|
|
3451
3426
|
|
|
3452
3427
|
return path;
|
|
3453
3428
|
},
|
|
3454
|
-
'bpmn:CompensateEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3429
|
+
'bpmn:CompensateEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3455
3430
|
var pathData = pathMap.getScaledPath('EVENT_COMPENSATION', {
|
|
3456
3431
|
xScaleFactor: 1,
|
|
3457
3432
|
yScaleFactor: 1,
|
|
@@ -3463,15 +3438,17 @@
|
|
|
3463
3438
|
}
|
|
3464
3439
|
});
|
|
3465
3440
|
|
|
3466
|
-
var fill = isThrowing
|
|
3441
|
+
var fill = isThrowing
|
|
3442
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3443
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3467
3444
|
|
|
3468
3445
|
return drawPath(parentGfx, pathData, {
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3446
|
+
fill,
|
|
3447
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3448
|
+
strokeWidth: 1
|
|
3472
3449
|
});
|
|
3473
3450
|
},
|
|
3474
|
-
'bpmn:SignalEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3451
|
+
'bpmn:SignalEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3475
3452
|
var pathData = pathMap.getScaledPath('EVENT_SIGNAL', {
|
|
3476
3453
|
xScaleFactor: 0.9,
|
|
3477
3454
|
yScaleFactor: 0.9,
|
|
@@ -3483,15 +3460,17 @@
|
|
|
3483
3460
|
}
|
|
3484
3461
|
});
|
|
3485
3462
|
|
|
3486
|
-
var fill = isThrowing
|
|
3463
|
+
var fill = isThrowing
|
|
3464
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3465
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3487
3466
|
|
|
3488
3467
|
return drawPath(parentGfx, pathData, {
|
|
3489
3468
|
strokeWidth: 1,
|
|
3490
|
-
fill
|
|
3491
|
-
stroke: getStrokeColor(event, defaultStrokeColor)
|
|
3469
|
+
fill,
|
|
3470
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3492
3471
|
});
|
|
3493
3472
|
},
|
|
3494
|
-
'bpmn:MultipleEventDefinition': function(parentGfx, event, isThrowing) {
|
|
3473
|
+
'bpmn:MultipleEventDefinition': function(parentGfx, event, attrs = {}, isThrowing) {
|
|
3495
3474
|
var pathData = pathMap.getScaledPath('EVENT_MULTIPLE', {
|
|
3496
3475
|
xScaleFactor: 1.1,
|
|
3497
3476
|
yScaleFactor: 1.1,
|
|
@@ -3503,14 +3482,16 @@
|
|
|
3503
3482
|
}
|
|
3504
3483
|
});
|
|
3505
3484
|
|
|
3506
|
-
var fill = isThrowing
|
|
3485
|
+
var fill = isThrowing
|
|
3486
|
+
? getStrokeColor(event, defaultStrokeColor, attrs.stroke)
|
|
3487
|
+
: getFillColor(event, defaultFillColor, attrs.fill);
|
|
3507
3488
|
|
|
3508
3489
|
return drawPath(parentGfx, pathData, {
|
|
3509
|
-
|
|
3510
|
-
|
|
3490
|
+
fill,
|
|
3491
|
+
strokeWidth: 1
|
|
3511
3492
|
});
|
|
3512
3493
|
},
|
|
3513
|
-
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event) {
|
|
3494
|
+
'bpmn:ParallelMultipleEventDefinition': function(parentGfx, event, attrs = {}) {
|
|
3514
3495
|
var pathData = pathMap.getScaledPath('EVENT_PARALLEL_MULTIPLE', {
|
|
3515
3496
|
xScaleFactor: 1.2,
|
|
3516
3497
|
yScaleFactor: 1.2,
|
|
@@ -3523,501 +3504,791 @@
|
|
|
3523
3504
|
});
|
|
3524
3505
|
|
|
3525
3506
|
return drawPath(parentGfx, pathData, {
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3507
|
+
fill: getFillColor(event, defaultFillColor, attrs.fill),
|
|
3508
|
+
stroke: getStrokeColor(event, defaultStrokeColor, attrs.stroke),
|
|
3509
|
+
strokeWidth: 1
|
|
3529
3510
|
});
|
|
3530
3511
|
},
|
|
3531
|
-
'bpmn:
|
|
3532
|
-
var circle = renderer('bpmn:Event')(parentGfx, element, {
|
|
3533
|
-
strokeWidth: 4,
|
|
3534
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3535
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3536
|
-
});
|
|
3537
|
-
|
|
3538
|
-
if (!options || options.renderIcon !== false) {
|
|
3539
|
-
renderEventContent(element, parentGfx);
|
|
3540
|
-
}
|
|
3541
|
-
|
|
3542
|
-
return circle;
|
|
3543
|
-
},
|
|
3544
|
-
'bpmn:TerminateEventDefinition': function(parentGfx, element) {
|
|
3512
|
+
'bpmn:TerminateEventDefinition': function(parentGfx, element, attrs = {}) {
|
|
3545
3513
|
var circle = drawCircle(parentGfx, element.width, element.height, 8, {
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3514
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3515
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3516
|
+
strokeWidth: 4
|
|
3549
3517
|
});
|
|
3550
3518
|
|
|
3551
3519
|
return circle;
|
|
3552
|
-
}
|
|
3553
|
-
|
|
3554
|
-
var outer = renderer('bpmn:Event')(parentGfx, element, {
|
|
3555
|
-
strokeWidth: 1.5,
|
|
3556
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3557
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3558
|
-
});
|
|
3520
|
+
}
|
|
3521
|
+
};
|
|
3559
3522
|
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
fill: getFillColor(element, 'none'),
|
|
3564
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3565
|
-
});
|
|
3523
|
+
function renderEventIcon(element, parentGfx, attrs = {}) {
|
|
3524
|
+
var semantic = getBusinessObject(element),
|
|
3525
|
+
isThrowing = isThrowEvent(semantic);
|
|
3566
3526
|
|
|
3567
|
-
|
|
3568
|
-
|
|
3527
|
+
if (semantic.get('eventDefinitions') && semantic.get('eventDefinitions').length > 1) {
|
|
3528
|
+
if (semantic.get('parallelMultiple')) {
|
|
3529
|
+
return eventIconRenderers[ 'bpmn:ParallelMultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3530
|
+
}
|
|
3531
|
+
else {
|
|
3532
|
+
return eventIconRenderers[ 'bpmn:MultipleEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3569
3533
|
}
|
|
3534
|
+
}
|
|
3570
3535
|
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
|
|
3536
|
+
if (isTypedEvent(semantic, 'bpmn:MessageEventDefinition')) {
|
|
3537
|
+
return eventIconRenderers[ 'bpmn:MessageEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3538
|
+
}
|
|
3575
3539
|
|
|
3576
|
-
'bpmn:
|
|
3540
|
+
if (isTypedEvent(semantic, 'bpmn:TimerEventDefinition')) {
|
|
3541
|
+
return eventIconRenderers[ 'bpmn:TimerEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3542
|
+
}
|
|
3577
3543
|
|
|
3578
|
-
|
|
3544
|
+
if (isTypedEvent(semantic, 'bpmn:ConditionalEventDefinition')) {
|
|
3545
|
+
return eventIconRenderers[ 'bpmn:ConditionalEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3546
|
+
}
|
|
3579
3547
|
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3548
|
+
if (isTypedEvent(semantic, 'bpmn:SignalEventDefinition')) {
|
|
3549
|
+
return eventIconRenderers[ 'bpmn:SignalEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3550
|
+
}
|
|
3583
3551
|
|
|
3584
|
-
|
|
3585
|
-
|
|
3552
|
+
if (isTypedEvent(semantic, 'bpmn:EscalationEventDefinition')) {
|
|
3553
|
+
return eventIconRenderers[ 'bpmn:EscalationEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3554
|
+
}
|
|
3586
3555
|
|
|
3587
|
-
'bpmn:
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3591
|
-
};
|
|
3556
|
+
if (isTypedEvent(semantic, 'bpmn:LinkEventDefinition')) {
|
|
3557
|
+
return eventIconRenderers[ 'bpmn:LinkEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3558
|
+
}
|
|
3592
3559
|
|
|
3593
|
-
|
|
3560
|
+
if (isTypedEvent(semantic, 'bpmn:ErrorEventDefinition')) {
|
|
3561
|
+
return eventIconRenderers[ 'bpmn:ErrorEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3562
|
+
}
|
|
3594
3563
|
|
|
3595
|
-
|
|
3596
|
-
|
|
3564
|
+
if (isTypedEvent(semantic, 'bpmn:CancelEventDefinition')) {
|
|
3565
|
+
return eventIconRenderers[ 'bpmn:CancelEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3566
|
+
}
|
|
3597
3567
|
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
3568
|
+
if (isTypedEvent(semantic, 'bpmn:CompensateEventDefinition')) {
|
|
3569
|
+
return eventIconRenderers[ 'bpmn:CompensateEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3570
|
+
}
|
|
3602
3571
|
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3572
|
+
if (isTypedEvent(semantic, 'bpmn:TerminateEventDefinition')) {
|
|
3573
|
+
return eventIconRenderers[ 'bpmn:TerminateEventDefinition' ](parentGfx, element, attrs, isThrowing);
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
return null;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
var taskMarkerRenderers = {
|
|
3580
|
+
'ParticipantMultiplicityMarker': function(parentGfx, element, attrs = {}) {
|
|
3581
|
+
var width = getWidth(element, attrs),
|
|
3582
|
+
height = getHeight(element, attrs);
|
|
3583
|
+
|
|
3584
|
+
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
3585
|
+
xScaleFactor: 1,
|
|
3586
|
+
yScaleFactor: 1,
|
|
3587
|
+
containerWidth: width,
|
|
3588
|
+
containerHeight: height,
|
|
3589
|
+
position: {
|
|
3590
|
+
mx: ((width / 2 - 6) / width),
|
|
3591
|
+
my: (height - 15) / height
|
|
3607
3592
|
}
|
|
3608
3593
|
});
|
|
3609
3594
|
|
|
3610
|
-
|
|
3595
|
+
drawMarker('participant-multiplicity', parentGfx, markerPath, {
|
|
3596
|
+
strokeWidth: 2,
|
|
3597
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3598
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3599
|
+
});
|
|
3600
|
+
},
|
|
3601
|
+
'SubProcessMarker': function(parentGfx, element, attrs = {}) {
|
|
3602
|
+
var markerRect = drawRect(parentGfx, 14, 14, 0, {
|
|
3611
3603
|
strokeWidth: 1,
|
|
3612
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3613
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3604
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3605
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3614
3606
|
});
|
|
3615
3607
|
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3608
|
+
translate$1(markerRect, element.width / 2 - 7.5, element.height - 20);
|
|
3609
|
+
|
|
3610
|
+
var markerPath = pathMap.getScaledPath('MARKER_SUB_PROCESS', {
|
|
3611
|
+
xScaleFactor: 1.5,
|
|
3612
|
+
yScaleFactor: 1.5,
|
|
3613
|
+
containerWidth: element.width,
|
|
3614
|
+
containerHeight: element.height,
|
|
3615
|
+
position: {
|
|
3616
|
+
mx: (element.width / 2 - 7.5) / element.width,
|
|
3617
|
+
my: (element.height - 20) / element.height
|
|
3620
3618
|
}
|
|
3621
3619
|
});
|
|
3622
3620
|
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3621
|
+
drawMarker('sub-process', parentGfx, markerPath, {
|
|
3622
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3623
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3626
3624
|
});
|
|
3625
|
+
},
|
|
3626
|
+
'ParallelMarker': function(parentGfx, element, attrs) {
|
|
3627
|
+
var width = getWidth(element, attrs),
|
|
3628
|
+
height = getHeight(element, attrs);
|
|
3627
3629
|
|
|
3628
|
-
var
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3630
|
+
var markerPath = pathMap.getScaledPath('MARKER_PARALLEL', {
|
|
3631
|
+
xScaleFactor: 1,
|
|
3632
|
+
yScaleFactor: 1,
|
|
3633
|
+
containerWidth: width,
|
|
3634
|
+
containerHeight: height,
|
|
3635
|
+
position: {
|
|
3636
|
+
mx: ((width / 2 + attrs.parallel) / width),
|
|
3637
|
+
my: (height - 20) / height
|
|
3632
3638
|
}
|
|
3633
3639
|
});
|
|
3634
3640
|
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3641
|
+
drawMarker('parallel', parentGfx, markerPath, {
|
|
3642
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3643
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3639
3644
|
});
|
|
3640
|
-
|
|
3641
|
-
return task;
|
|
3642
3645
|
},
|
|
3643
|
-
'
|
|
3644
|
-
var
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
y: y
|
|
3646
|
+
'SequentialMarker': function(parentGfx, element, attrs) {
|
|
3647
|
+
var markerPath = pathMap.getScaledPath('MARKER_SEQUENTIAL', {
|
|
3648
|
+
xScaleFactor: 1,
|
|
3649
|
+
yScaleFactor: 1,
|
|
3650
|
+
containerWidth: element.width,
|
|
3651
|
+
containerHeight: element.height,
|
|
3652
|
+
position: {
|
|
3653
|
+
mx: ((element.width / 2 + attrs.seq) / element.width),
|
|
3654
|
+
my: (element.height - 19) / element.height
|
|
3653
3655
|
}
|
|
3654
3656
|
});
|
|
3655
3657
|
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3658
|
+
drawMarker('sequential', parentGfx, markerPath, {
|
|
3659
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3660
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3660
3661
|
});
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3662
|
+
},
|
|
3663
|
+
'CompensationMarker': function(parentGfx, element, attrs) {
|
|
3664
|
+
var markerMath = pathMap.getScaledPath('MARKER_COMPENSATION', {
|
|
3665
|
+
xScaleFactor: 1,
|
|
3666
|
+
yScaleFactor: 1,
|
|
3667
|
+
containerWidth: element.width,
|
|
3668
|
+
containerHeight: element.height,
|
|
3669
|
+
position: {
|
|
3670
|
+
mx: ((element.width / 2 + attrs.compensation) / element.width),
|
|
3671
|
+
my: (element.height - 13) / element.height
|
|
3666
3672
|
}
|
|
3667
3673
|
});
|
|
3668
3674
|
|
|
3669
|
-
|
|
3670
|
-
strokeWidth:
|
|
3671
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3672
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3675
|
+
drawMarker('compensation', parentGfx, markerMath, {
|
|
3676
|
+
strokeWidth: 1,
|
|
3677
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3678
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3673
3679
|
});
|
|
3680
|
+
},
|
|
3681
|
+
'LoopMarker': function(parentGfx, element, attrs) {
|
|
3682
|
+
var width = getWidth(element, attrs),
|
|
3683
|
+
height = getHeight(element, attrs);
|
|
3674
3684
|
|
|
3675
|
-
var
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3685
|
+
var markerPath = pathMap.getScaledPath('MARKER_LOOP', {
|
|
3686
|
+
xScaleFactor: 1,
|
|
3687
|
+
yScaleFactor: 1,
|
|
3688
|
+
containerWidth: width,
|
|
3689
|
+
containerHeight: height,
|
|
3690
|
+
position: {
|
|
3691
|
+
mx: ((width / 2 + attrs.loop) / width),
|
|
3692
|
+
my: (height - 7) / height
|
|
3679
3693
|
}
|
|
3680
3694
|
});
|
|
3681
3695
|
|
|
3682
|
-
|
|
3683
|
-
strokeWidth:
|
|
3684
|
-
fill:
|
|
3685
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3696
|
+
drawMarker('loop', parentGfx, markerPath, {
|
|
3697
|
+
strokeWidth: 1.5,
|
|
3698
|
+
fill: 'none',
|
|
3699
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3700
|
+
strokeMiterlimit: 0.5
|
|
3686
3701
|
});
|
|
3687
|
-
|
|
3688
|
-
return task;
|
|
3689
3702
|
},
|
|
3690
|
-
'
|
|
3691
|
-
var
|
|
3703
|
+
'AdhocMarker': function(parentGfx, element, attrs) {
|
|
3704
|
+
var width = getWidth(element, attrs),
|
|
3705
|
+
height = getHeight(element, attrs);
|
|
3692
3706
|
|
|
3693
|
-
var
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3707
|
+
var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {
|
|
3708
|
+
xScaleFactor: 1,
|
|
3709
|
+
yScaleFactor: 1,
|
|
3710
|
+
containerWidth: width,
|
|
3711
|
+
containerHeight: height,
|
|
3712
|
+
position: {
|
|
3713
|
+
mx: ((width / 2 + attrs.adhoc) / width),
|
|
3714
|
+
my: (height - 15) / height
|
|
3697
3715
|
}
|
|
3698
3716
|
});
|
|
3699
3717
|
|
|
3700
|
-
|
|
3701
|
-
strokeWidth:
|
|
3702
|
-
fill:
|
|
3703
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3718
|
+
drawMarker('adhoc', parentGfx, markerPath, {
|
|
3719
|
+
strokeWidth: 1,
|
|
3720
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3721
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3704
3722
|
});
|
|
3723
|
+
}
|
|
3724
|
+
};
|
|
3705
3725
|
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
var task = renderer('bpmn:Task')(parentGfx, element);
|
|
3726
|
+
function renderTaskMarker(type, parentGfx, element, attrs) {
|
|
3727
|
+
taskMarkerRenderers[ type ](parentGfx, element, attrs);
|
|
3728
|
+
}
|
|
3710
3729
|
|
|
3711
|
-
|
|
3730
|
+
function renderTaskMarkers(parentGfx, element, taskMarkers, attrs = {}) {
|
|
3731
|
+
attrs = {
|
|
3732
|
+
fill: attrs.fill,
|
|
3733
|
+
stroke: attrs.stroke,
|
|
3734
|
+
width: getWidth(element, attrs),
|
|
3735
|
+
height: getHeight(element, attrs)
|
|
3736
|
+
};
|
|
3737
|
+
|
|
3738
|
+
var semantic = getBusinessObject(element);
|
|
3739
|
+
|
|
3740
|
+
var subprocess = taskMarkers && taskMarkers.includes('SubProcessMarker');
|
|
3741
|
+
|
|
3742
|
+
if (subprocess) {
|
|
3743
|
+
attrs = {
|
|
3744
|
+
...attrs,
|
|
3745
|
+
seq: -21,
|
|
3746
|
+
parallel: -22,
|
|
3747
|
+
compensation: -42,
|
|
3748
|
+
loop: -18,
|
|
3749
|
+
adhoc: 10
|
|
3750
|
+
};
|
|
3751
|
+
} else {
|
|
3752
|
+
attrs = {
|
|
3753
|
+
...attrs,
|
|
3754
|
+
seq: -5,
|
|
3755
|
+
parallel: -6,
|
|
3756
|
+
compensation: -27,
|
|
3757
|
+
loop: 0,
|
|
3758
|
+
adhoc: 10
|
|
3759
|
+
};
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
forEach$1(taskMarkers, function(marker) {
|
|
3763
|
+
renderTaskMarker(marker, parentGfx, element, attrs);
|
|
3764
|
+
});
|
|
3765
|
+
|
|
3766
|
+
if (semantic.get('isForCompensation')) {
|
|
3767
|
+
renderTaskMarker('CompensationMarker', parentGfx, element, attrs);
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
if (is$1(semantic, 'bpmn:AdHocSubProcess')) {
|
|
3771
|
+
renderTaskMarker('AdhocMarker', parentGfx, element, attrs);
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
var loopCharacteristics = semantic.get('loopCharacteristics'),
|
|
3775
|
+
isSequential = loopCharacteristics && loopCharacteristics.get('isSequential');
|
|
3776
|
+
|
|
3777
|
+
if (loopCharacteristics) {
|
|
3778
|
+
|
|
3779
|
+
if (isSequential === undefined) {
|
|
3780
|
+
renderTaskMarker('LoopMarker', parentGfx, element, attrs);
|
|
3781
|
+
}
|
|
3782
|
+
|
|
3783
|
+
if (isSequential === false) {
|
|
3784
|
+
renderTaskMarker('ParallelMarker', parentGfx, element, attrs);
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
if (isSequential === true) {
|
|
3788
|
+
renderTaskMarker('SequentialMarker', parentGfx, element, attrs);
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
function renderLabel(parentGfx, label, attrs = {}) {
|
|
3794
|
+
attrs = assign$1({
|
|
3795
|
+
size: {
|
|
3796
|
+
width: 100
|
|
3797
|
+
}
|
|
3798
|
+
}, attrs);
|
|
3799
|
+
|
|
3800
|
+
var text = textRenderer.createText(label || '', attrs);
|
|
3801
|
+
|
|
3802
|
+
classes$1(text).add('djs-label');
|
|
3803
|
+
|
|
3804
|
+
append(parentGfx, text);
|
|
3805
|
+
|
|
3806
|
+
return text;
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
function renderEmbeddedLabel(parentGfx, element, align, attrs = {}) {
|
|
3810
|
+
var semantic = getBusinessObject(element);
|
|
3811
|
+
|
|
3812
|
+
var box = getBounds({
|
|
3813
|
+
x: element.x,
|
|
3814
|
+
y: element.y,
|
|
3815
|
+
width: element.width,
|
|
3816
|
+
height: element.height
|
|
3817
|
+
}, attrs);
|
|
3818
|
+
|
|
3819
|
+
return renderLabel(parentGfx, semantic.name, {
|
|
3820
|
+
align,
|
|
3821
|
+
box,
|
|
3822
|
+
padding: 7,
|
|
3823
|
+
style: {
|
|
3824
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3825
|
+
}
|
|
3826
|
+
});
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
function renderExternalLabel(parentGfx, element, attrs = {}) {
|
|
3830
|
+
var box = {
|
|
3831
|
+
width: 90,
|
|
3832
|
+
height: 30,
|
|
3833
|
+
x: element.width / 2 + element.x,
|
|
3834
|
+
y: element.height / 2 + element.y
|
|
3835
|
+
};
|
|
3836
|
+
|
|
3837
|
+
return renderLabel(parentGfx, getLabel(element), {
|
|
3838
|
+
box: box,
|
|
3839
|
+
fitBox: true,
|
|
3840
|
+
style: assign$1(
|
|
3841
|
+
{},
|
|
3842
|
+
textRenderer.getExternalStyle(),
|
|
3843
|
+
{
|
|
3844
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3845
|
+
}
|
|
3846
|
+
)
|
|
3847
|
+
});
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
function renderLaneLabel(parentGfx, text, element, attrs = {}) {
|
|
3851
|
+
var isHorizontalLane = isHorizontal(element);
|
|
3852
|
+
|
|
3853
|
+
var textBox = renderLabel(parentGfx, text, {
|
|
3854
|
+
box: {
|
|
3855
|
+
height: 30,
|
|
3856
|
+
width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
|
|
3857
|
+
},
|
|
3858
|
+
align: 'center-middle',
|
|
3859
|
+
style: {
|
|
3860
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
3861
|
+
}
|
|
3862
|
+
});
|
|
3863
|
+
|
|
3864
|
+
if (isHorizontalLane) {
|
|
3865
|
+
var top = -1 * getHeight(element, attrs);
|
|
3866
|
+
transform(textBox, 0, -top, 270);
|
|
3867
|
+
}
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
function renderActivity(parentGfx, element, attrs = {}) {
|
|
3871
|
+
var {
|
|
3872
|
+
width,
|
|
3873
|
+
height
|
|
3874
|
+
} = getBounds(element, attrs);
|
|
3875
|
+
|
|
3876
|
+
return drawRect(parentGfx, width, height, TASK_BORDER_RADIUS, {
|
|
3877
|
+
...attrs,
|
|
3878
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3879
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3880
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3881
|
+
});
|
|
3882
|
+
}
|
|
3883
|
+
|
|
3884
|
+
function renderAssociation(parentGfx, element, attrs = {}) {
|
|
3885
|
+
var semantic = getBusinessObject(element);
|
|
3886
|
+
|
|
3887
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
3888
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3889
|
+
|
|
3890
|
+
if (semantic.get('associationDirection') === 'One' ||
|
|
3891
|
+
semantic.get('associationDirection') === 'Both') {
|
|
3892
|
+
attrs.markerEnd = marker('association-end', fill, stroke);
|
|
3893
|
+
}
|
|
3894
|
+
|
|
3895
|
+
if (semantic.get('associationDirection') === 'Both') {
|
|
3896
|
+
attrs.markerStart = marker('association-start', fill, stroke);
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
attrs = pickAttrs(attrs, [
|
|
3900
|
+
'markerStart',
|
|
3901
|
+
'markerEnd'
|
|
3902
|
+
]);
|
|
3903
|
+
|
|
3904
|
+
return drawConnectionSegments(parentGfx, element.waypoints, {
|
|
3905
|
+
...attrs,
|
|
3906
|
+
stroke,
|
|
3907
|
+
strokeDasharray: '0, 5'
|
|
3908
|
+
});
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
function renderDataObject(parentGfx, element, attrs = {}) {
|
|
3912
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
3913
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
3914
|
+
|
|
3915
|
+
var pathData = pathMap.getScaledPath('DATA_OBJECT_PATH', {
|
|
3916
|
+
xScaleFactor: 1,
|
|
3917
|
+
yScaleFactor: 1,
|
|
3918
|
+
containerWidth: element.width,
|
|
3919
|
+
containerHeight: element.height,
|
|
3920
|
+
position: {
|
|
3921
|
+
mx: 0.474,
|
|
3922
|
+
my: 0.296
|
|
3923
|
+
}
|
|
3924
|
+
});
|
|
3925
|
+
|
|
3926
|
+
var dataObject = drawPath(parentGfx, pathData, {
|
|
3927
|
+
fill,
|
|
3928
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3929
|
+
stroke
|
|
3930
|
+
});
|
|
3931
|
+
|
|
3932
|
+
var semantic = getBusinessObject(element);
|
|
3933
|
+
|
|
3934
|
+
if (isCollection(semantic)) {
|
|
3935
|
+
var collectionPathData = pathMap.getScaledPath('DATA_OBJECT_COLLECTION_PATH', {
|
|
3712
3936
|
xScaleFactor: 1,
|
|
3713
3937
|
yScaleFactor: 1,
|
|
3714
|
-
containerWidth:
|
|
3715
|
-
containerHeight:
|
|
3938
|
+
containerWidth: element.width,
|
|
3939
|
+
containerHeight: element.height,
|
|
3716
3940
|
position: {
|
|
3717
|
-
mx: 0.
|
|
3718
|
-
my:
|
|
3941
|
+
mx: 0.33,
|
|
3942
|
+
my: (element.height - 18) / element.height
|
|
3719
3943
|
}
|
|
3720
3944
|
});
|
|
3721
3945
|
|
|
3722
|
-
|
|
3723
|
-
strokeWidth:
|
|
3724
|
-
fill
|
|
3725
|
-
stroke
|
|
3946
|
+
drawPath(parentGfx, collectionPathData, {
|
|
3947
|
+
strokeWidth: 2,
|
|
3948
|
+
fill,
|
|
3949
|
+
stroke
|
|
3726
3950
|
});
|
|
3951
|
+
}
|
|
3727
3952
|
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
'bpmn:ReceiveTask' : function(parentGfx, element) {
|
|
3731
|
-
var semantic = getBusinessObject(element);
|
|
3953
|
+
return dataObject;
|
|
3954
|
+
}
|
|
3732
3955
|
|
|
3733
|
-
|
|
3734
|
-
|
|
3956
|
+
function renderEvent(parentGfx, element, attrs = {}) {
|
|
3957
|
+
return drawCircle(parentGfx, element.width, element.height, {
|
|
3958
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3959
|
+
...attrs,
|
|
3960
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3961
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3962
|
+
});
|
|
3963
|
+
}
|
|
3735
3964
|
|
|
3736
|
-
|
|
3737
|
-
|
|
3965
|
+
function renderGateway(parentGfx, element, attrs = {}) {
|
|
3966
|
+
return drawDiamond(parentGfx, element.width, element.height, {
|
|
3967
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3968
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
3969
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3970
|
+
});
|
|
3971
|
+
}
|
|
3738
3972
|
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3973
|
+
function renderLane(parentGfx, element, attrs = {}) {
|
|
3974
|
+
var lane = drawRect(parentGfx, getWidth(element, attrs), getHeight(element, attrs), 0, {
|
|
3975
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
3976
|
+
fillOpacity: attrs.fillOpacity || DEFAULT_OPACITY,
|
|
3977
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
3978
|
+
strokeWidth: 1.5
|
|
3979
|
+
});
|
|
3746
3980
|
|
|
3747
|
-
|
|
3748
|
-
xScaleFactor: 0.9,
|
|
3749
|
-
yScaleFactor: 0.9,
|
|
3750
|
-
containerWidth: 21,
|
|
3751
|
-
containerHeight: 14,
|
|
3752
|
-
position: {
|
|
3753
|
-
mx: 0.3,
|
|
3754
|
-
my: 0.4
|
|
3755
|
-
}
|
|
3756
|
-
});
|
|
3757
|
-
}
|
|
3981
|
+
var semantic = getBusinessObject(element);
|
|
3758
3982
|
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3983
|
+
if (is$1(semantic, 'bpmn:Lane')) {
|
|
3984
|
+
var text = semantic.get('name');
|
|
3985
|
+
|
|
3986
|
+
renderLaneLabel(parentGfx, text, element, attrs);
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
return lane;
|
|
3990
|
+
}
|
|
3991
|
+
|
|
3992
|
+
function renderSubProcess(parentGfx, element, attrs = {}) {
|
|
3993
|
+
var activity = renderActivity(parentGfx, element, attrs);
|
|
3994
|
+
|
|
3995
|
+
if (isEventSubProcess(element)) {
|
|
3996
|
+
attr$1(activity, {
|
|
3997
|
+
strokeDasharray: '0, 5.5',
|
|
3998
|
+
strokeWidth: 2.5
|
|
3763
3999
|
});
|
|
4000
|
+
}
|
|
3764
4001
|
|
|
3765
|
-
|
|
4002
|
+
var expanded = isExpanded(element);
|
|
4003
|
+
|
|
4004
|
+
renderEmbeddedLabel(parentGfx, element, expanded ? 'center-top' : 'center-middle', attrs);
|
|
4005
|
+
|
|
4006
|
+
if (expanded) {
|
|
4007
|
+
renderTaskMarkers(parentGfx, element, undefined, attrs);
|
|
4008
|
+
} else {
|
|
4009
|
+
renderTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ], attrs);
|
|
4010
|
+
}
|
|
4011
|
+
|
|
4012
|
+
return activity;
|
|
4013
|
+
}
|
|
4014
|
+
|
|
4015
|
+
function renderTask(parentGfx, element, attrs = {}) {
|
|
4016
|
+
var activity = renderActivity(parentGfx, element, attrs);
|
|
4017
|
+
|
|
4018
|
+
renderEmbeddedLabel(parentGfx, element, 'center-middle', attrs);
|
|
4019
|
+
|
|
4020
|
+
renderTaskMarkers(parentGfx, element, undefined, attrs);
|
|
4021
|
+
|
|
4022
|
+
return activity;
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
var handlers = this.handlers = {
|
|
4026
|
+
'bpmn:AdHocSubProcess': function(parentGfx, element, attrs = {}) {
|
|
4027
|
+
if (isExpanded(element)) {
|
|
4028
|
+
attrs = pickAttrs(attrs, [
|
|
4029
|
+
'fill',
|
|
4030
|
+
'stroke',
|
|
4031
|
+
'width',
|
|
4032
|
+
'height'
|
|
4033
|
+
]);
|
|
4034
|
+
} else {
|
|
4035
|
+
attrs = pickAttrs(attrs, [
|
|
4036
|
+
'fill',
|
|
4037
|
+
'stroke'
|
|
4038
|
+
]);
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
return renderSubProcess(parentGfx, element, attrs);
|
|
3766
4042
|
},
|
|
3767
|
-
'bpmn:
|
|
3768
|
-
|
|
4043
|
+
'bpmn:Association': function(parentGfx, element, attrs = {}) {
|
|
4044
|
+
attrs = pickAttrs(attrs, [
|
|
4045
|
+
'fill',
|
|
4046
|
+
'stroke'
|
|
4047
|
+
]);
|
|
3769
4048
|
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
}
|
|
3775
|
-
});
|
|
4049
|
+
return renderAssociation(parentGfx, element, attrs);
|
|
4050
|
+
},
|
|
4051
|
+
'bpmn:BoundaryEvent': function(parentGfx, element, attrs = {}) {
|
|
4052
|
+
var { renderIcon = true } = attrs;
|
|
3776
4053
|
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
stroke
|
|
4054
|
+
attrs = pickAttrs(attrs, [
|
|
4055
|
+
'fill',
|
|
4056
|
+
'stroke'
|
|
4057
|
+
]);
|
|
4058
|
+
|
|
4059
|
+
var semantic = getBusinessObject(element),
|
|
4060
|
+
cancelActivity = semantic.get('cancelActivity');
|
|
4061
|
+
|
|
4062
|
+
attrs = {
|
|
4063
|
+
strokeWidth: 1.5,
|
|
4064
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4065
|
+
fillOpacity: FULL_OPACITY,
|
|
4066
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
4067
|
+
};
|
|
4068
|
+
|
|
4069
|
+
if (!cancelActivity) {
|
|
4070
|
+
attrs.strokeDasharray = '6';
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
var event = renderEvent(parentGfx, element, attrs);
|
|
4074
|
+
|
|
4075
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
4076
|
+
...attrs,
|
|
4077
|
+
fill: 'none'
|
|
3780
4078
|
});
|
|
3781
4079
|
|
|
3782
|
-
|
|
4080
|
+
if (renderIcon) {
|
|
4081
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4082
|
+
}
|
|
4083
|
+
|
|
4084
|
+
return event;
|
|
3783
4085
|
},
|
|
3784
|
-
'bpmn:BusinessRuleTask': function(parentGfx, element) {
|
|
3785
|
-
|
|
4086
|
+
'bpmn:BusinessRuleTask': function(parentGfx, element, attrs = {}) {
|
|
4087
|
+
attrs = pickAttrs(attrs, [
|
|
4088
|
+
'fill',
|
|
4089
|
+
'stroke'
|
|
4090
|
+
]);
|
|
3786
4091
|
|
|
3787
|
-
var
|
|
4092
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4093
|
+
|
|
4094
|
+
var headerData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_MAIN', {
|
|
3788
4095
|
abspos: {
|
|
3789
4096
|
x: 8,
|
|
3790
4097
|
y: 8
|
|
3791
4098
|
}
|
|
3792
4099
|
});
|
|
3793
4100
|
|
|
3794
|
-
var
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
fill: getFillColor(element,
|
|
3798
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4101
|
+
var businessPath = drawPath(parentGfx, headerData);
|
|
4102
|
+
|
|
4103
|
+
attr$1(businessPath, {
|
|
4104
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4105
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4106
|
+
strokeWidth: 1
|
|
3799
4107
|
});
|
|
3800
4108
|
|
|
3801
|
-
var
|
|
4109
|
+
var headerPathData = pathMap.getScaledPath('TASK_TYPE_BUSINESS_RULE_HEADER', {
|
|
3802
4110
|
abspos: {
|
|
3803
4111
|
x: 8,
|
|
3804
4112
|
y: 8
|
|
3805
4113
|
}
|
|
3806
4114
|
});
|
|
3807
4115
|
|
|
3808
|
-
var
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
4116
|
+
var businessHeaderPath = drawPath(parentGfx, headerPathData);
|
|
4117
|
+
|
|
4118
|
+
attr$1(businessHeaderPath, {
|
|
4119
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4120
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4121
|
+
strokeWidth: 1
|
|
3812
4122
|
});
|
|
3813
4123
|
|
|
3814
4124
|
return task;
|
|
3815
4125
|
},
|
|
3816
|
-
'bpmn:
|
|
3817
|
-
attrs =
|
|
3818
|
-
fill
|
|
3819
|
-
stroke
|
|
4126
|
+
'bpmn:CallActivity': function(parentGfx, element, attrs = {}) {
|
|
4127
|
+
attrs = pickAttrs(attrs, [
|
|
4128
|
+
'fill',
|
|
4129
|
+
'stroke'
|
|
4130
|
+
]);
|
|
4131
|
+
|
|
4132
|
+
return renderSubProcess(parentGfx, element, {
|
|
4133
|
+
strokeWidth: 5,
|
|
3820
4134
|
...attrs
|
|
3821
|
-
};
|
|
4135
|
+
});
|
|
4136
|
+
},
|
|
4137
|
+
'bpmn:ComplexGateway': function(parentGfx, element, attrs = {}) {
|
|
4138
|
+
attrs = pickAttrs(attrs, [
|
|
4139
|
+
'fill',
|
|
4140
|
+
'stroke'
|
|
4141
|
+
]);
|
|
3822
4142
|
|
|
3823
|
-
var
|
|
4143
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
3824
4144
|
|
|
3825
|
-
var
|
|
4145
|
+
var pathData = pathMap.getScaledPath('GATEWAY_COMPLEX', {
|
|
4146
|
+
xScaleFactor: 0.5,
|
|
4147
|
+
yScaleFactor:0.5,
|
|
4148
|
+
containerWidth: element.width,
|
|
4149
|
+
containerHeight: element.height,
|
|
4150
|
+
position: {
|
|
4151
|
+
mx: 0.46,
|
|
4152
|
+
my: 0.26
|
|
4153
|
+
}
|
|
4154
|
+
});
|
|
3826
4155
|
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
}
|
|
4156
|
+
drawPath(parentGfx, pathData, {
|
|
4157
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4158
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4159
|
+
strokeWidth: 1
|
|
4160
|
+
});
|
|
3833
4161
|
|
|
3834
|
-
|
|
4162
|
+
return gateway;
|
|
4163
|
+
},
|
|
4164
|
+
'bpmn:DataInput': function(parentGfx, element, attrs = {}) {
|
|
4165
|
+
attrs = pickAttrs(attrs, [
|
|
4166
|
+
'fill',
|
|
4167
|
+
'stroke'
|
|
4168
|
+
]);
|
|
3835
4169
|
|
|
3836
|
-
|
|
3837
|
-
attachTaskMarkers(parentGfx, element);
|
|
3838
|
-
} else {
|
|
3839
|
-
attachTaskMarkers(parentGfx, element, [ 'SubProcessMarker' ]);
|
|
3840
|
-
}
|
|
4170
|
+
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
3841
4171
|
|
|
3842
|
-
|
|
3843
|
-
},
|
|
3844
|
-
'bpmn:AdHocSubProcess': function(parentGfx, element) {
|
|
3845
|
-
return renderer('bpmn:SubProcess')(parentGfx, element);
|
|
3846
|
-
},
|
|
3847
|
-
'bpmn:Transaction': function(parentGfx, element) {
|
|
3848
|
-
var outer = renderer('bpmn:SubProcess')(parentGfx, element, { strokeWidth: 1.5 });
|
|
4172
|
+
var dataObject = renderDataObject(parentGfx, element, attrs);
|
|
3849
4173
|
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
4174
|
+
drawPath(parentGfx, arrowPathData, {
|
|
4175
|
+
fill: 'none',
|
|
4176
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4177
|
+
strokeWidth: 1
|
|
3853
4178
|
});
|
|
3854
4179
|
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
return outer;
|
|
4180
|
+
return dataObject;
|
|
3858
4181
|
},
|
|
3859
|
-
'bpmn:
|
|
3860
|
-
|
|
3861
|
-
|
|
4182
|
+
'bpmn:DataInputAssociation': function(parentGfx, element, attrs = {}) {
|
|
4183
|
+
attrs = pickAttrs(attrs, [
|
|
4184
|
+
'fill',
|
|
4185
|
+
'stroke'
|
|
4186
|
+
]);
|
|
4187
|
+
|
|
4188
|
+
return renderAssociation(parentGfx, element, {
|
|
4189
|
+
...attrs,
|
|
4190
|
+
markerEnd: marker('association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))
|
|
3862
4191
|
});
|
|
3863
4192
|
},
|
|
3864
|
-
'bpmn:
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
3870
|
-
fill: getFillColor(element, defaultFillColor),
|
|
3871
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3872
|
-
strokeWidth
|
|
3873
|
-
};
|
|
3874
|
-
|
|
3875
|
-
var lane = renderer('bpmn:Lane')(parentGfx, element, attrs);
|
|
3876
|
-
|
|
3877
|
-
var expandedPool = isExpanded(element);
|
|
3878
|
-
|
|
3879
|
-
if (expandedPool) {
|
|
3880
|
-
drawLine(parentGfx, [
|
|
3881
|
-
{ x: 30, y: 0 },
|
|
3882
|
-
{ x: 30, y: element.height }
|
|
3883
|
-
], {
|
|
3884
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
3885
|
-
strokeWidth
|
|
3886
|
-
});
|
|
3887
|
-
var text = getBusinessObject(element).name;
|
|
3888
|
-
renderLaneLabel(parentGfx, text, element);
|
|
3889
|
-
} else {
|
|
3890
|
-
|
|
3891
|
-
// collapsed pool draw text inline
|
|
3892
|
-
var text2 = getBusinessObject(element).name;
|
|
3893
|
-
renderLabel(parentGfx, text2, {
|
|
3894
|
-
box: element, align: 'center-middle',
|
|
3895
|
-
style: {
|
|
3896
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
3897
|
-
}
|
|
3898
|
-
});
|
|
3899
|
-
}
|
|
3900
|
-
|
|
3901
|
-
var participantMultiplicity = !!(getBusinessObject(element).participantMultiplicity);
|
|
3902
|
-
|
|
3903
|
-
if (participantMultiplicity) {
|
|
3904
|
-
renderer('ParticipantMultiplicityMarker')(parentGfx, element);
|
|
3905
|
-
}
|
|
4193
|
+
'bpmn:DataObject': function(parentGfx, element, attrs = {}) {
|
|
4194
|
+
attrs = pickAttrs(attrs, [
|
|
4195
|
+
'fill',
|
|
4196
|
+
'stroke'
|
|
4197
|
+
]);
|
|
3906
4198
|
|
|
3907
|
-
return
|
|
4199
|
+
return renderDataObject(parentGfx, element, attrs);
|
|
3908
4200
|
},
|
|
3909
|
-
'bpmn:
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
stroke
|
|
3914
|
-
|
|
3915
|
-
...attrs
|
|
3916
|
-
});
|
|
3917
|
-
|
|
3918
|
-
var semantic = getBusinessObject(element);
|
|
4201
|
+
'bpmn:DataObjectReference': as('bpmn:DataObject'),
|
|
4202
|
+
'bpmn:DataOutput': function(parentGfx, element, attrs = {}) {
|
|
4203
|
+
attrs = pickAttrs(attrs, [
|
|
4204
|
+
'fill',
|
|
4205
|
+
'stroke'
|
|
4206
|
+
]);
|
|
3919
4207
|
|
|
3920
|
-
|
|
3921
|
-
var text = semantic.name;
|
|
3922
|
-
renderLaneLabel(parentGfx, text, element);
|
|
3923
|
-
}
|
|
4208
|
+
var arrowPathData = pathMap.getRawPath('DATA_ARROW');
|
|
3924
4209
|
|
|
3925
|
-
|
|
3926
|
-
},
|
|
3927
|
-
'bpmn:InclusiveGateway': function(parentGfx, element) {
|
|
3928
|
-
var diamond = renderer('bpmn:Gateway')(parentGfx, element);
|
|
4210
|
+
var dataObject = renderDataObject(parentGfx, element, attrs);
|
|
3929
4211
|
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4212
|
+
drawPath(parentGfx, arrowPathData, {
|
|
4213
|
+
strokeWidth: 1,
|
|
4214
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4215
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
3935
4216
|
});
|
|
3936
4217
|
|
|
3937
|
-
return
|
|
4218
|
+
return dataObject;
|
|
3938
4219
|
},
|
|
3939
|
-
'bpmn:
|
|
3940
|
-
|
|
4220
|
+
'bpmn:DataOutputAssociation': function(parentGfx, element, attrs = {}) {
|
|
4221
|
+
attrs = pickAttrs(attrs, [
|
|
4222
|
+
'fill',
|
|
4223
|
+
'stroke'
|
|
4224
|
+
]);
|
|
3941
4225
|
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
containerWidth: element.width,
|
|
3946
|
-
containerHeight: element.height,
|
|
3947
|
-
position: {
|
|
3948
|
-
mx: 0.32,
|
|
3949
|
-
my: 0.3
|
|
3950
|
-
}
|
|
4226
|
+
return renderAssociation(parentGfx, element, {
|
|
4227
|
+
...attrs,
|
|
4228
|
+
markerEnd: marker('association-end', getFillColor(element, defaultFillColor, attrs.fill), getStrokeColor(element, defaultStrokeColor, attrs.stroke))
|
|
3951
4229
|
});
|
|
3952
|
-
|
|
3953
|
-
if ((getDi(element).isMarkerVisible)) {
|
|
3954
|
-
drawPath(parentGfx, pathData, {
|
|
3955
|
-
strokeWidth: 1,
|
|
3956
|
-
fill: getStrokeColor(element, defaultStrokeColor),
|
|
3957
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3958
|
-
});
|
|
3959
|
-
}
|
|
3960
|
-
|
|
3961
|
-
return diamond;
|
|
3962
4230
|
},
|
|
3963
|
-
'bpmn:
|
|
3964
|
-
|
|
4231
|
+
'bpmn:DataStoreReference': function(parentGfx, element, attrs = {}) {
|
|
4232
|
+
attrs = pickAttrs(attrs, [
|
|
4233
|
+
'fill',
|
|
4234
|
+
'stroke'
|
|
4235
|
+
]);
|
|
3965
4236
|
|
|
3966
|
-
var
|
|
3967
|
-
xScaleFactor:
|
|
3968
|
-
yScaleFactor:
|
|
4237
|
+
var dataStorePath = pathMap.getScaledPath('DATA_STORE', {
|
|
4238
|
+
xScaleFactor: 1,
|
|
4239
|
+
yScaleFactor: 1,
|
|
3969
4240
|
containerWidth: element.width,
|
|
3970
4241
|
containerHeight: element.height,
|
|
3971
4242
|
position: {
|
|
3972
|
-
mx: 0
|
|
3973
|
-
my: 0.
|
|
4243
|
+
mx: 0,
|
|
4244
|
+
my: 0.133
|
|
3974
4245
|
}
|
|
3975
4246
|
});
|
|
3976
4247
|
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4248
|
+
return drawPath(parentGfx, dataStorePath, {
|
|
4249
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4250
|
+
fillOpacity: DEFAULT_OPACITY,
|
|
4251
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4252
|
+
strokeWidth: 2
|
|
3981
4253
|
});
|
|
3982
|
-
|
|
3983
|
-
return diamond;
|
|
3984
4254
|
},
|
|
3985
|
-
'bpmn:
|
|
3986
|
-
var
|
|
4255
|
+
'bpmn:EndEvent': function(parentGfx, element, attrs = {}) {
|
|
4256
|
+
var { renderIcon = true } = attrs;
|
|
3987
4257
|
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
containerHeight: element.height,
|
|
3993
|
-
position: {
|
|
3994
|
-
mx: 0.46,
|
|
3995
|
-
my: 0.2
|
|
3996
|
-
}
|
|
3997
|
-
});
|
|
4258
|
+
attrs = pickAttrs(attrs, [
|
|
4259
|
+
'fill',
|
|
4260
|
+
'stroke'
|
|
4261
|
+
]);
|
|
3998
4262
|
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4263
|
+
var event = renderEvent(parentGfx, element, {
|
|
4264
|
+
...attrs,
|
|
4265
|
+
strokeWidth: 4
|
|
4003
4266
|
});
|
|
4004
4267
|
|
|
4005
|
-
|
|
4268
|
+
if (renderIcon) {
|
|
4269
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4270
|
+
}
|
|
4271
|
+
|
|
4272
|
+
return event;
|
|
4006
4273
|
},
|
|
4007
|
-
'bpmn:EventBasedGateway': function(parentGfx, element) {
|
|
4274
|
+
'bpmn:EventBasedGateway': function(parentGfx, element, attrs = {}) {
|
|
4275
|
+
attrs = pickAttrs(attrs, [
|
|
4276
|
+
'fill',
|
|
4277
|
+
'stroke'
|
|
4278
|
+
]);
|
|
4008
4279
|
|
|
4009
4280
|
var semantic = getBusinessObject(element);
|
|
4010
4281
|
|
|
4011
|
-
var diamond =
|
|
4282
|
+
var diamond = renderGateway(parentGfx, element, attrs);
|
|
4012
4283
|
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4284
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.20, {
|
|
4285
|
+
fill: getFillColor(element, 'none', attrs.fill),
|
|
4286
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4287
|
+
strokeWidth: 1
|
|
4017
4288
|
});
|
|
4018
4289
|
|
|
4019
|
-
var type = semantic.eventGatewayType
|
|
4020
|
-
|
|
4290
|
+
var type = semantic.get('eventGatewayType'),
|
|
4291
|
+
instantiate = !!semantic.get('instantiate');
|
|
4021
4292
|
|
|
4022
4293
|
function drawEvent() {
|
|
4023
4294
|
|
|
@@ -4032,18 +4303,17 @@
|
|
|
4032
4303
|
}
|
|
4033
4304
|
});
|
|
4034
4305
|
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4306
|
+
drawPath(parentGfx, pathData, {
|
|
4307
|
+
fill: 'none',
|
|
4308
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4309
|
+
strokeWidth: 2
|
|
4039
4310
|
});
|
|
4040
4311
|
}
|
|
4041
4312
|
|
|
4042
4313
|
if (type === 'Parallel') {
|
|
4043
|
-
|
|
4044
4314
|
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
4045
4315
|
xScaleFactor: 0.4,
|
|
4046
|
-
yScaleFactor:0.4,
|
|
4316
|
+
yScaleFactor: 0.4,
|
|
4047
4317
|
containerWidth: element.width,
|
|
4048
4318
|
containerHeight: element.height,
|
|
4049
4319
|
position: {
|
|
@@ -4053,16 +4323,16 @@
|
|
|
4053
4323
|
});
|
|
4054
4324
|
|
|
4055
4325
|
drawPath(parentGfx, pathData, {
|
|
4056
|
-
|
|
4057
|
-
|
|
4326
|
+
fill: 'none',
|
|
4327
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4328
|
+
strokeWidth: 1
|
|
4058
4329
|
});
|
|
4059
4330
|
} else if (type === 'Exclusive') {
|
|
4060
|
-
|
|
4061
4331
|
if (!instantiate) {
|
|
4062
4332
|
drawCircle(parentGfx, element.width, element.height, element.height * 0.26, {
|
|
4063
|
-
strokeWidth: 1,
|
|
4064
4333
|
fill: 'none',
|
|
4065
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4334
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4335
|
+
strokeWidth: 1
|
|
4066
4336
|
});
|
|
4067
4337
|
}
|
|
4068
4338
|
|
|
@@ -4072,104 +4342,163 @@
|
|
|
4072
4342
|
|
|
4073
4343
|
return diamond;
|
|
4074
4344
|
},
|
|
4075
|
-
'bpmn:
|
|
4076
|
-
|
|
4077
|
-
fill
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
});
|
|
4081
|
-
},
|
|
4082
|
-
'bpmn:SequenceFlow': function(parentGfx, element) {
|
|
4083
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
4084
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
4345
|
+
'bpmn:ExclusiveGateway': function(parentGfx, element, attrs = {}) {
|
|
4346
|
+
attrs = pickAttrs(attrs, [
|
|
4347
|
+
'fill',
|
|
4348
|
+
'stroke'
|
|
4349
|
+
]);
|
|
4085
4350
|
|
|
4086
|
-
var
|
|
4087
|
-
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
4088
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4089
|
-
});
|
|
4351
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
4090
4352
|
|
|
4091
|
-
var
|
|
4353
|
+
var pathData = pathMap.getScaledPath('GATEWAY_EXCLUSIVE', {
|
|
4354
|
+
xScaleFactor: 0.4,
|
|
4355
|
+
yScaleFactor: 0.4,
|
|
4356
|
+
containerWidth: element.width,
|
|
4357
|
+
containerHeight: element.height,
|
|
4358
|
+
position: {
|
|
4359
|
+
mx: 0.32,
|
|
4360
|
+
my: 0.3
|
|
4361
|
+
}
|
|
4362
|
+
});
|
|
4092
4363
|
|
|
4093
|
-
var
|
|
4364
|
+
var di = getDi(element);
|
|
4094
4365
|
|
|
4095
|
-
if (
|
|
4096
|
-
|
|
4366
|
+
if (di.get('isMarkerVisible')) {
|
|
4367
|
+
drawPath(parentGfx, pathData, {
|
|
4368
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4369
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4370
|
+
strokeWidth: 1
|
|
4371
|
+
});
|
|
4372
|
+
}
|
|
4097
4373
|
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4374
|
+
return gateway;
|
|
4375
|
+
},
|
|
4376
|
+
'bpmn:Gateway': function(parentGfx, element, attrs = {}) {
|
|
4377
|
+
attrs = pickAttrs(attrs, [
|
|
4378
|
+
'fill',
|
|
4379
|
+
'stroke'
|
|
4380
|
+
]);
|
|
4104
4381
|
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4382
|
+
return renderGateway(parentGfx, element, attrs);
|
|
4383
|
+
},
|
|
4384
|
+
'bpmn:Group': function(parentGfx, element, attrs = {}) {
|
|
4385
|
+
attrs = pickAttrs(attrs, [
|
|
4386
|
+
'fill',
|
|
4387
|
+
'stroke',
|
|
4388
|
+
'width',
|
|
4389
|
+
'height'
|
|
4390
|
+
]);
|
|
4113
4391
|
|
|
4114
|
-
return
|
|
4392
|
+
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
4393
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4394
|
+
strokeWidth: 1.5,
|
|
4395
|
+
strokeDasharray: '10, 6, 0, 6',
|
|
4396
|
+
fill: 'none',
|
|
4397
|
+
pointerEvents: 'none',
|
|
4398
|
+
width: getWidth(element, attrs),
|
|
4399
|
+
height: getHeight(element, attrs)
|
|
4400
|
+
});
|
|
4115
4401
|
},
|
|
4116
|
-
'bpmn:
|
|
4402
|
+
'bpmn:InclusiveGateway': function(parentGfx, element, attrs = {}) {
|
|
4403
|
+
attrs = pickAttrs(attrs, [
|
|
4404
|
+
'fill',
|
|
4405
|
+
'stroke'
|
|
4406
|
+
]);
|
|
4117
4407
|
|
|
4118
|
-
var
|
|
4408
|
+
var gateway = renderGateway(parentGfx, element, attrs);
|
|
4119
4409
|
|
|
4120
|
-
|
|
4121
|
-
|
|
4410
|
+
drawCircle(parentGfx, element.width, element.height, element.height * 0.24, {
|
|
4411
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4412
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4413
|
+
strokeWidth: 2.5
|
|
4414
|
+
});
|
|
4122
4415
|
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
};
|
|
4416
|
+
return gateway;
|
|
4417
|
+
},
|
|
4418
|
+
'bpmn:IntermediateEvent': function(parentGfx, element, attrs = {}) {
|
|
4419
|
+
var { renderIcon = true } = attrs;
|
|
4128
4420
|
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4421
|
+
attrs = pickAttrs(attrs, [
|
|
4422
|
+
'fill',
|
|
4423
|
+
'stroke'
|
|
4424
|
+
]);
|
|
4425
|
+
|
|
4426
|
+
var outer = renderEvent(parentGfx, element, {
|
|
4427
|
+
...attrs,
|
|
4428
|
+
strokeWidth: 1.5
|
|
4429
|
+
});
|
|
4430
|
+
|
|
4431
|
+
drawCircle(parentGfx, element.width, element.height, INNER_OUTER_DIST, {
|
|
4432
|
+
fill: 'none',
|
|
4433
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4434
|
+
strokeWidth: 1.5
|
|
4435
|
+
});
|
|
4133
4436
|
|
|
4134
|
-
if (
|
|
4135
|
-
|
|
4437
|
+
if (renderIcon) {
|
|
4438
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4136
4439
|
}
|
|
4137
4440
|
|
|
4138
|
-
return
|
|
4441
|
+
return outer;
|
|
4139
4442
|
},
|
|
4140
|
-
'bpmn:
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4443
|
+
'bpmn:IntermediateCatchEvent': as('bpmn:IntermediateEvent'),
|
|
4444
|
+
'bpmn:IntermediateThrowEvent': as('bpmn:IntermediateEvent'),
|
|
4445
|
+
'bpmn:Lane': function(parentGfx, element, attrs = {}) {
|
|
4446
|
+
attrs = pickAttrs(attrs, [
|
|
4447
|
+
'fill',
|
|
4448
|
+
'stroke',
|
|
4449
|
+
'width',
|
|
4450
|
+
'height'
|
|
4451
|
+
]);
|
|
4452
|
+
|
|
4453
|
+
return renderLane(parentGfx, element, {
|
|
4454
|
+
...attrs,
|
|
4455
|
+
fillOpacity: LOW_OPACITY
|
|
4146
4456
|
});
|
|
4147
4457
|
},
|
|
4148
|
-
'bpmn:
|
|
4149
|
-
|
|
4150
|
-
|
|
4458
|
+
'bpmn:ManualTask': function(parentGfx, element, attrs = {}) {
|
|
4459
|
+
attrs = pickAttrs(attrs, [
|
|
4460
|
+
'fill',
|
|
4461
|
+
'stroke'
|
|
4462
|
+
]);
|
|
4463
|
+
|
|
4464
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4465
|
+
|
|
4466
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_MANUAL', {
|
|
4467
|
+
abspos: {
|
|
4468
|
+
x: 17,
|
|
4469
|
+
y: 15
|
|
4470
|
+
}
|
|
4471
|
+
});
|
|
4151
4472
|
|
|
4152
|
-
|
|
4153
|
-
|
|
4473
|
+
drawPath(parentGfx, pathData, {
|
|
4474
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4475
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4476
|
+
strokeWidth: 0.5
|
|
4154
4477
|
});
|
|
4478
|
+
|
|
4479
|
+
return task;
|
|
4155
4480
|
},
|
|
4156
|
-
'bpmn:MessageFlow': function(parentGfx, element) {
|
|
4481
|
+
'bpmn:MessageFlow': function(parentGfx, element, attrs = {}) {
|
|
4482
|
+
attrs = pickAttrs(attrs, [
|
|
4483
|
+
'fill',
|
|
4484
|
+
'stroke'
|
|
4485
|
+
]);
|
|
4157
4486
|
|
|
4158
4487
|
var semantic = getBusinessObject(element),
|
|
4159
4488
|
di = getDi(element);
|
|
4160
4489
|
|
|
4161
|
-
var fill = getFillColor(element, defaultFillColor),
|
|
4162
|
-
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
4490
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
4491
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
4163
4492
|
|
|
4164
4493
|
var path = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
4165
4494
|
markerEnd: marker('messageflow-end', fill, stroke),
|
|
4166
4495
|
markerStart: marker('messageflow-start', fill, stroke),
|
|
4496
|
+
stroke,
|
|
4167
4497
|
strokeDasharray: '10, 11',
|
|
4168
|
-
strokeWidth: 1.5
|
|
4169
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4498
|
+
strokeWidth: 1.5
|
|
4170
4499
|
});
|
|
4171
4500
|
|
|
4172
|
-
if (semantic.messageRef) {
|
|
4501
|
+
if (semantic.get('messageRef')) {
|
|
4173
4502
|
var midPoint = path.getPointAtLength(path.getTotalLength() / 2);
|
|
4174
4503
|
|
|
4175
4504
|
var markerPathData = pathMap.getScaledPath('MESSAGE_FLOW_MARKER', {
|
|
@@ -4179,404 +4508,518 @@
|
|
|
4179
4508
|
}
|
|
4180
4509
|
});
|
|
4181
4510
|
|
|
4182
|
-
var messageAttrs = {
|
|
4511
|
+
var messageAttrs = {
|
|
4512
|
+
strokeWidth: 1
|
|
4513
|
+
};
|
|
4514
|
+
|
|
4515
|
+
if (di.get('messageVisibleKind') === 'initiating') {
|
|
4516
|
+
messageAttrs.fill = fill;
|
|
4517
|
+
messageAttrs.stroke = stroke;
|
|
4518
|
+
} else {
|
|
4519
|
+
messageAttrs.fill = stroke;
|
|
4520
|
+
messageAttrs.stroke = fill;
|
|
4521
|
+
}
|
|
4522
|
+
|
|
4523
|
+
var message = drawPath(parentGfx, markerPathData, messageAttrs);
|
|
4524
|
+
|
|
4525
|
+
var messageRef = semantic.get('messageRef'),
|
|
4526
|
+
name = messageRef.get('name');
|
|
4527
|
+
|
|
4528
|
+
var label = renderLabel(parentGfx, name, {
|
|
4529
|
+
align: 'center-top',
|
|
4530
|
+
fitBox: true,
|
|
4531
|
+
style: {
|
|
4532
|
+
fill: stroke
|
|
4533
|
+
}
|
|
4534
|
+
});
|
|
4535
|
+
|
|
4536
|
+
var messageBounds = message.getBBox(),
|
|
4537
|
+
labelBounds = label.getBBox();
|
|
4538
|
+
|
|
4539
|
+
var translateX = midPoint.x - labelBounds.width / 2,
|
|
4540
|
+
translateY = midPoint.y + messageBounds.height / 2 + ELEMENT_LABEL_DISTANCE;
|
|
4541
|
+
|
|
4542
|
+
transform(label, translateX, translateY, 0);
|
|
4543
|
+
}
|
|
4544
|
+
|
|
4545
|
+
return path;
|
|
4546
|
+
},
|
|
4547
|
+
'bpmn:ParallelGateway': function(parentGfx, element, attrs = {}) {
|
|
4548
|
+
attrs = pickAttrs(attrs, [
|
|
4549
|
+
'fill',
|
|
4550
|
+
'stroke'
|
|
4551
|
+
]);
|
|
4552
|
+
|
|
4553
|
+
var diamond = renderGateway(parentGfx, element, attrs);
|
|
4554
|
+
|
|
4555
|
+
var pathData = pathMap.getScaledPath('GATEWAY_PARALLEL', {
|
|
4556
|
+
xScaleFactor: 0.6,
|
|
4557
|
+
yScaleFactor: 0.6,
|
|
4558
|
+
containerWidth: element.width,
|
|
4559
|
+
containerHeight: element.height,
|
|
4560
|
+
position: {
|
|
4561
|
+
mx: 0.46,
|
|
4562
|
+
my: 0.2
|
|
4563
|
+
}
|
|
4564
|
+
});
|
|
4565
|
+
|
|
4566
|
+
drawPath(parentGfx, pathData, {
|
|
4567
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4568
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4569
|
+
strokeWidth: 1
|
|
4570
|
+
});
|
|
4571
|
+
|
|
4572
|
+
return diamond;
|
|
4573
|
+
},
|
|
4574
|
+
'bpmn:Participant': function(parentGfx, element, attrs = {}) {
|
|
4575
|
+
attrs = pickAttrs(attrs, [
|
|
4576
|
+
'fill',
|
|
4577
|
+
'stroke',
|
|
4578
|
+
'width',
|
|
4579
|
+
'height'
|
|
4580
|
+
]);
|
|
4581
|
+
|
|
4582
|
+
var participant = renderLane(parentGfx, element, attrs);
|
|
4583
|
+
|
|
4584
|
+
var expandedParticipant = isExpanded(element);
|
|
4585
|
+
var horizontalParticipant = isHorizontal(element);
|
|
4586
|
+
|
|
4587
|
+
var semantic = getBusinessObject(element),
|
|
4588
|
+
name = semantic.get('name');
|
|
4589
|
+
|
|
4590
|
+
if (expandedParticipant) {
|
|
4591
|
+
var waypoints = horizontalParticipant ? [
|
|
4592
|
+
{
|
|
4593
|
+
x: 30,
|
|
4594
|
+
y: 0
|
|
4595
|
+
},
|
|
4596
|
+
{
|
|
4597
|
+
x: 30,
|
|
4598
|
+
y: getHeight(element, attrs)
|
|
4599
|
+
}
|
|
4600
|
+
] : [
|
|
4601
|
+
{
|
|
4602
|
+
x: 0,
|
|
4603
|
+
y: 30
|
|
4604
|
+
},
|
|
4605
|
+
{
|
|
4606
|
+
x: getWidth(element, attrs),
|
|
4607
|
+
y: 30
|
|
4608
|
+
}
|
|
4609
|
+
];
|
|
4610
|
+
|
|
4611
|
+
drawLine(parentGfx, waypoints, {
|
|
4612
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4613
|
+
strokeWidth: PARTICIPANT_STROKE_WIDTH
|
|
4614
|
+
});
|
|
4615
|
+
|
|
4616
|
+
renderLaneLabel(parentGfx, name, element, attrs);
|
|
4617
|
+
} else {
|
|
4618
|
+
var bounds = getBounds(element, attrs);
|
|
4183
4619
|
|
|
4184
|
-
if (
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
} else {
|
|
4188
|
-
messageAttrs.fill = '#888';
|
|
4189
|
-
messageAttrs.stroke = 'white';
|
|
4620
|
+
if (!horizontalParticipant) {
|
|
4621
|
+
bounds.height = getWidth(element, attrs);
|
|
4622
|
+
bounds.width = getHeight(element, attrs);
|
|
4190
4623
|
}
|
|
4191
4624
|
|
|
4192
|
-
var
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
var label = renderLabel(parentGfx, labelText, {
|
|
4196
|
-
align: 'center-top',
|
|
4197
|
-
fitBox: true,
|
|
4625
|
+
var textBox = renderLabel(parentGfx, name, {
|
|
4626
|
+
box: bounds,
|
|
4627
|
+
align: 'center-middle',
|
|
4198
4628
|
style: {
|
|
4199
|
-
fill:
|
|
4629
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4200
4630
|
}
|
|
4201
4631
|
});
|
|
4202
4632
|
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
transform(label, translateX, translateY, 0);
|
|
4633
|
+
if (!horizontalParticipant) {
|
|
4634
|
+
var top = -1 * getHeight(element, attrs);
|
|
4635
|
+
transform(textBox, 0, -top, 270);
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4210
4638
|
|
|
4639
|
+
if (semantic.get('participantMultiplicity')) {
|
|
4640
|
+
renderTaskMarker('ParticipantMultiplicityMarker', parentGfx, element, attrs);
|
|
4211
4641
|
}
|
|
4212
4642
|
|
|
4213
|
-
return
|
|
4643
|
+
return participant;
|
|
4214
4644
|
},
|
|
4215
|
-
'bpmn:
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
containerHeight: element.height,
|
|
4221
|
-
position: {
|
|
4222
|
-
mx: 0.474,
|
|
4223
|
-
my: 0.296
|
|
4224
|
-
}
|
|
4225
|
-
});
|
|
4226
|
-
|
|
4227
|
-
var elementObject = drawPath(parentGfx, pathData, {
|
|
4228
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4229
|
-
fillOpacity: DEFAULT_FILL_OPACITY,
|
|
4230
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4231
|
-
});
|
|
4645
|
+
'bpmn:ReceiveTask' : function(parentGfx, element, attrs = {}) {
|
|
4646
|
+
attrs = pickAttrs(attrs, [
|
|
4647
|
+
'fill',
|
|
4648
|
+
'stroke'
|
|
4649
|
+
]);
|
|
4232
4650
|
|
|
4233
4651
|
var semantic = getBusinessObject(element);
|
|
4234
4652
|
|
|
4235
|
-
|
|
4236
|
-
renderDataItemCollection(parentGfx, element);
|
|
4237
|
-
}
|
|
4653
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4238
4654
|
|
|
4239
|
-
|
|
4240
|
-
},
|
|
4241
|
-
'bpmn:DataObjectReference': as('bpmn:DataObject'),
|
|
4242
|
-
'bpmn:DataInput': function(parentGfx, element) {
|
|
4655
|
+
var pathData;
|
|
4243
4656
|
|
|
4244
|
-
|
|
4657
|
+
if (semantic.get('instantiate')) {
|
|
4658
|
+
drawCircle(parentGfx, 28, 28, 20 * 0.22, {
|
|
4659
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4660
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4661
|
+
strokeWidth: 1
|
|
4662
|
+
});
|
|
4245
4663
|
|
|
4246
|
-
|
|
4247
|
-
|
|
4664
|
+
pathData = pathMap.getScaledPath('TASK_TYPE_INSTANTIATING_SEND', {
|
|
4665
|
+
abspos: {
|
|
4666
|
+
x: 7.77,
|
|
4667
|
+
y: 9.52
|
|
4668
|
+
}
|
|
4669
|
+
});
|
|
4670
|
+
} else {
|
|
4671
|
+
pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
4672
|
+
xScaleFactor: 0.9,
|
|
4673
|
+
yScaleFactor: 0.9,
|
|
4674
|
+
containerWidth: 21,
|
|
4675
|
+
containerHeight: 14,
|
|
4676
|
+
position: {
|
|
4677
|
+
mx: 0.3,
|
|
4678
|
+
my: 0.4
|
|
4679
|
+
}
|
|
4680
|
+
});
|
|
4681
|
+
}
|
|
4248
4682
|
|
|
4249
|
-
|
|
4683
|
+
drawPath(parentGfx, pathData, {
|
|
4684
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4685
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4686
|
+
strokeWidth: 1
|
|
4687
|
+
});
|
|
4250
4688
|
|
|
4251
|
-
return
|
|
4689
|
+
return task;
|
|
4252
4690
|
},
|
|
4253
|
-
'bpmn:
|
|
4254
|
-
|
|
4691
|
+
'bpmn:ScriptTask': function(parentGfx, element, attrs = {}) {
|
|
4692
|
+
attrs = pickAttrs(attrs, [
|
|
4693
|
+
'fill',
|
|
4694
|
+
'stroke'
|
|
4695
|
+
]);
|
|
4255
4696
|
|
|
4256
|
-
|
|
4257
|
-
var elementObject = renderer('bpmn:DataObject')(parentGfx, element);
|
|
4697
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4258
4698
|
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4699
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_SCRIPT', {
|
|
4700
|
+
abspos: {
|
|
4701
|
+
x: 15,
|
|
4702
|
+
y: 20
|
|
4703
|
+
}
|
|
4262
4704
|
});
|
|
4263
4705
|
|
|
4264
|
-
|
|
4706
|
+
drawPath(parentGfx, pathData, {
|
|
4707
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4708
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4709
|
+
strokeWidth: 1
|
|
4710
|
+
});
|
|
4711
|
+
|
|
4712
|
+
return task;
|
|
4265
4713
|
},
|
|
4266
|
-
'bpmn:
|
|
4267
|
-
|
|
4714
|
+
'bpmn:SendTask': function(parentGfx, element, attrs = {}) {
|
|
4715
|
+
attrs = pickAttrs(attrs, [
|
|
4716
|
+
'fill',
|
|
4717
|
+
'stroke'
|
|
4718
|
+
]);
|
|
4719
|
+
|
|
4720
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4721
|
+
|
|
4722
|
+
var pathData = pathMap.getScaledPath('TASK_TYPE_SEND', {
|
|
4268
4723
|
xScaleFactor: 1,
|
|
4269
4724
|
yScaleFactor: 1,
|
|
4270
|
-
containerWidth:
|
|
4271
|
-
containerHeight:
|
|
4725
|
+
containerWidth: 21,
|
|
4726
|
+
containerHeight: 14,
|
|
4272
4727
|
position: {
|
|
4273
|
-
mx: 0,
|
|
4274
|
-
my: 0.
|
|
4728
|
+
mx: 0.285,
|
|
4729
|
+
my: 0.357
|
|
4275
4730
|
}
|
|
4276
4731
|
});
|
|
4277
4732
|
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4733
|
+
drawPath(parentGfx, pathData, {
|
|
4734
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4735
|
+
stroke: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4736
|
+
strokeWidth: 1
|
|
4283
4737
|
});
|
|
4284
4738
|
|
|
4285
|
-
return
|
|
4739
|
+
return task;
|
|
4286
4740
|
},
|
|
4287
|
-
'bpmn:
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4741
|
+
'bpmn:SequenceFlow': function(parentGfx, element, attrs = {}) {
|
|
4742
|
+
attrs = pickAttrs(attrs, [
|
|
4743
|
+
'fill',
|
|
4744
|
+
'stroke'
|
|
4745
|
+
]);
|
|
4291
4746
|
|
|
4292
|
-
var
|
|
4293
|
-
|
|
4294
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4295
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4296
|
-
};
|
|
4747
|
+
var fill = getFillColor(element, defaultFillColor, attrs.fill),
|
|
4748
|
+
stroke = getStrokeColor(element, defaultStrokeColor, attrs.stroke);
|
|
4297
4749
|
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4750
|
+
var connection = drawConnectionSegments(parentGfx, element.waypoints, {
|
|
4751
|
+
markerEnd: marker('sequenceflow-end', fill, stroke),
|
|
4752
|
+
stroke
|
|
4753
|
+
});
|
|
4301
4754
|
|
|
4302
|
-
|
|
4303
|
-
var outerAttrs = {
|
|
4304
|
-
...attrs,
|
|
4305
|
-
fillOpacity: 1
|
|
4306
|
-
};
|
|
4755
|
+
var semantic = getBusinessObject(element);
|
|
4307
4756
|
|
|
4308
|
-
|
|
4309
|
-
var innerAttrs = {
|
|
4310
|
-
...attrs,
|
|
4311
|
-
fill: 'none'
|
|
4312
|
-
};
|
|
4757
|
+
var { source } = element;
|
|
4313
4758
|
|
|
4314
|
-
|
|
4759
|
+
if (source) {
|
|
4760
|
+
var sourceSemantic = getBusinessObject(source);
|
|
4315
4761
|
|
|
4316
|
-
|
|
4762
|
+
// conditional flow marker
|
|
4763
|
+
if (semantic.get('conditionExpression') && is$1(sourceSemantic, 'bpmn:Activity')) {
|
|
4764
|
+
attr$1(connection, {
|
|
4765
|
+
markerStart: marker('conditional-flow-marker', fill, stroke)
|
|
4766
|
+
});
|
|
4767
|
+
}
|
|
4317
4768
|
|
|
4318
|
-
|
|
4319
|
-
|
|
4769
|
+
// default marker
|
|
4770
|
+
if (sourceSemantic.get('default') && (is$1(sourceSemantic, 'bpmn:Gateway') || is$1(sourceSemantic, 'bpmn:Activity')) &&
|
|
4771
|
+
sourceSemantic.get('default') === semantic) {
|
|
4772
|
+
attr$1(connection, {
|
|
4773
|
+
markerStart: marker('conditional-default-flow-marker', fill, stroke)
|
|
4774
|
+
});
|
|
4775
|
+
}
|
|
4320
4776
|
}
|
|
4321
4777
|
|
|
4322
|
-
return
|
|
4323
|
-
},
|
|
4324
|
-
'bpmn:Group': function(parentGfx, element) {
|
|
4325
|
-
return drawRect(parentGfx, element.width, element.height, TASK_BORDER_RADIUS, {
|
|
4326
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
4327
|
-
strokeWidth: 1.5,
|
|
4328
|
-
strokeDasharray: '10,6,0,6',
|
|
4329
|
-
fill: 'none',
|
|
4330
|
-
pointerEvents: 'none'
|
|
4331
|
-
});
|
|
4778
|
+
return connection;
|
|
4332
4779
|
},
|
|
4333
|
-
'
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4780
|
+
'bpmn:ServiceTask': function(parentGfx, element, attrs = {}) {
|
|
4781
|
+
attrs = pickAttrs(attrs, [
|
|
4782
|
+
'fill',
|
|
4783
|
+
'stroke'
|
|
4784
|
+
]);
|
|
4785
|
+
|
|
4786
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4787
|
+
|
|
4788
|
+
drawCircle(parentGfx, 10, 10, {
|
|
4789
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4790
|
+
stroke: 'none',
|
|
4791
|
+
transform: 'translate(6, 6)'
|
|
4340
4792
|
});
|
|
4341
4793
|
|
|
4342
|
-
var
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
containerHeight: element.height,
|
|
4347
|
-
position: {
|
|
4348
|
-
mx: 0.0,
|
|
4349
|
-
my: 0.0
|
|
4794
|
+
var pathDataService1 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
4795
|
+
abspos: {
|
|
4796
|
+
x: 12,
|
|
4797
|
+
y: 18
|
|
4350
4798
|
}
|
|
4351
4799
|
});
|
|
4352
4800
|
|
|
4353
|
-
drawPath(parentGfx,
|
|
4354
|
-
|
|
4801
|
+
drawPath(parentGfx, pathDataService1, {
|
|
4802
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4803
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4804
|
+
strokeWidth: 1
|
|
4355
4805
|
});
|
|
4356
4806
|
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
padding: 7,
|
|
4362
|
-
style: {
|
|
4363
|
-
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor)
|
|
4364
|
-
}
|
|
4807
|
+
drawCircle(parentGfx, 10, 10, {
|
|
4808
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4809
|
+
stroke: 'none',
|
|
4810
|
+
transform: 'translate(11, 10)'
|
|
4365
4811
|
});
|
|
4366
4812
|
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
xScaleFactor: 1,
|
|
4372
|
-
yScaleFactor: 1,
|
|
4373
|
-
containerWidth: element.width,
|
|
4374
|
-
containerHeight: element.height,
|
|
4375
|
-
position: {
|
|
4376
|
-
mx: ((element.width / 2) / element.width),
|
|
4377
|
-
my: (element.height - 15) / element.height
|
|
4813
|
+
var pathDataService2 = pathMap.getScaledPath('TASK_TYPE_SERVICE', {
|
|
4814
|
+
abspos: {
|
|
4815
|
+
x: 17,
|
|
4816
|
+
y: 22
|
|
4378
4817
|
}
|
|
4379
4818
|
});
|
|
4380
4819
|
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4820
|
+
drawPath(parentGfx, pathDataService2, {
|
|
4821
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4822
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4823
|
+
strokeWidth: 1
|
|
4385
4824
|
});
|
|
4825
|
+
|
|
4826
|
+
return task;
|
|
4386
4827
|
},
|
|
4387
|
-
'
|
|
4388
|
-
var
|
|
4389
|
-
strokeWidth: 1,
|
|
4390
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4391
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4392
|
-
});
|
|
4828
|
+
'bpmn:StartEvent': function(parentGfx, element, attrs = {}) {
|
|
4829
|
+
var { renderIcon = true } = attrs;
|
|
4393
4830
|
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4831
|
+
attrs = pickAttrs(attrs, [
|
|
4832
|
+
'fill',
|
|
4833
|
+
'stroke'
|
|
4834
|
+
]);
|
|
4397
4835
|
|
|
4398
|
-
var
|
|
4399
|
-
xScaleFactor: 1.5,
|
|
4400
|
-
yScaleFactor: 1.5,
|
|
4401
|
-
containerWidth: element.width,
|
|
4402
|
-
containerHeight: element.height,
|
|
4403
|
-
position: {
|
|
4404
|
-
mx: (element.width / 2 - 7.5) / element.width,
|
|
4405
|
-
my: (element.height - 20) / element.height
|
|
4406
|
-
}
|
|
4407
|
-
});
|
|
4836
|
+
var semantic = getBusinessObject(element);
|
|
4408
4837
|
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4838
|
+
if (!semantic.get('isInterrupting')) {
|
|
4839
|
+
attrs = {
|
|
4840
|
+
...attrs,
|
|
4841
|
+
strokeDasharray: '6'
|
|
4842
|
+
};
|
|
4843
|
+
}
|
|
4844
|
+
|
|
4845
|
+
var event = renderEvent(parentGfx, element, attrs);
|
|
4846
|
+
|
|
4847
|
+
if (renderIcon) {
|
|
4848
|
+
renderEventIcon(element, parentGfx, attrs);
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
return event;
|
|
4413
4852
|
},
|
|
4414
|
-
'
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4853
|
+
'bpmn:SubProcess': function(parentGfx, element, attrs = {}) {
|
|
4854
|
+
if (isExpanded(element)) {
|
|
4855
|
+
attrs = pickAttrs(attrs, [
|
|
4856
|
+
'fill',
|
|
4857
|
+
'stroke',
|
|
4858
|
+
'width',
|
|
4859
|
+
'height'
|
|
4860
|
+
]);
|
|
4861
|
+
} else {
|
|
4862
|
+
attrs = pickAttrs(attrs, [
|
|
4863
|
+
'fill',
|
|
4864
|
+
'stroke'
|
|
4865
|
+
]);
|
|
4866
|
+
}
|
|
4425
4867
|
|
|
4426
|
-
|
|
4427
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4428
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4429
|
-
});
|
|
4868
|
+
return renderSubProcess(parentGfx, element, attrs);
|
|
4430
4869
|
},
|
|
4431
|
-
'
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
containerHeight: element.height,
|
|
4437
|
-
position: {
|
|
4438
|
-
mx: ((element.width / 2 + position.seq) / element.width),
|
|
4439
|
-
my: (element.height - 19) / element.height
|
|
4440
|
-
}
|
|
4441
|
-
});
|
|
4870
|
+
'bpmn:Task': function(parentGfx, element, attrs = {}) {
|
|
4871
|
+
attrs = pickAttrs(attrs, [
|
|
4872
|
+
'fill',
|
|
4873
|
+
'stroke'
|
|
4874
|
+
]);
|
|
4442
4875
|
|
|
4443
|
-
|
|
4444
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4445
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4446
|
-
});
|
|
4876
|
+
return renderTask(parentGfx, element, attrs);
|
|
4447
4877
|
},
|
|
4448
|
-
'
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4878
|
+
'bpmn:TextAnnotation': function(parentGfx, element, attrs = {}) {
|
|
4879
|
+
attrs = pickAttrs(attrs, [
|
|
4880
|
+
'fill',
|
|
4881
|
+
'stroke',
|
|
4882
|
+
'width',
|
|
4883
|
+
'height'
|
|
4884
|
+
]);
|
|
4885
|
+
|
|
4886
|
+
var {
|
|
4887
|
+
width,
|
|
4888
|
+
height
|
|
4889
|
+
} = getBounds(element, attrs);
|
|
4890
|
+
|
|
4891
|
+
var textElement = drawRect(parentGfx, width, height, 0, 0, {
|
|
4892
|
+
fill: 'none',
|
|
4893
|
+
stroke: 'none'
|
|
4458
4894
|
});
|
|
4459
4895
|
|
|
4460
|
-
|
|
4461
|
-
strokeWidth: 1,
|
|
4462
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4463
|
-
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
4464
|
-
});
|
|
4465
|
-
},
|
|
4466
|
-
'LoopMarker': function(parentGfx, element, position) {
|
|
4467
|
-
var markerPath = pathMap.getScaledPath('MARKER_LOOP', {
|
|
4896
|
+
var textPathData = pathMap.getScaledPath('TEXT_ANNOTATION', {
|
|
4468
4897
|
xScaleFactor: 1,
|
|
4469
4898
|
yScaleFactor: 1,
|
|
4470
|
-
containerWidth:
|
|
4471
|
-
containerHeight:
|
|
4899
|
+
containerWidth: width,
|
|
4900
|
+
containerHeight: height,
|
|
4472
4901
|
position: {
|
|
4473
|
-
mx:
|
|
4474
|
-
my:
|
|
4902
|
+
mx: 0.0,
|
|
4903
|
+
my: 0.0
|
|
4475
4904
|
}
|
|
4476
4905
|
});
|
|
4477
4906
|
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
fill: getFillColor(element, defaultFillColor),
|
|
4481
|
-
stroke: getStrokeColor(element, defaultStrokeColor),
|
|
4482
|
-
strokeMiterlimit: 0.5
|
|
4483
|
-
});
|
|
4484
|
-
},
|
|
4485
|
-
'AdhocMarker': function(parentGfx, element, position) {
|
|
4486
|
-
var markerPath = pathMap.getScaledPath('MARKER_ADHOC', {
|
|
4487
|
-
xScaleFactor: 1,
|
|
4488
|
-
yScaleFactor: 1,
|
|
4489
|
-
containerWidth: element.width,
|
|
4490
|
-
containerHeight: element.height,
|
|
4491
|
-
position: {
|
|
4492
|
-
mx: ((element.width / 2 + position.adhoc) / element.width),
|
|
4493
|
-
my: (element.height - 15) / element.height
|
|
4494
|
-
}
|
|
4907
|
+
drawPath(parentGfx, textPathData, {
|
|
4908
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke)
|
|
4495
4909
|
});
|
|
4496
4910
|
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4911
|
+
var semantic = getBusinessObject(element),
|
|
4912
|
+
text = semantic.get('text') || '';
|
|
4913
|
+
|
|
4914
|
+
renderLabel(parentGfx, text, {
|
|
4915
|
+
align: 'left-top',
|
|
4916
|
+
box: getBounds(element, attrs),
|
|
4917
|
+
padding: 7,
|
|
4918
|
+
style: {
|
|
4919
|
+
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4920
|
+
}
|
|
4501
4921
|
});
|
|
4502
|
-
}
|
|
4503
|
-
};
|
|
4504
4922
|
|
|
4505
|
-
|
|
4506
|
-
|
|
4923
|
+
return textElement;
|
|
4924
|
+
},
|
|
4925
|
+
'bpmn:Transaction': function(parentGfx, element, attrs = {}) {
|
|
4926
|
+
if (isExpanded(element)) {
|
|
4927
|
+
attrs = pickAttrs(attrs, [
|
|
4928
|
+
'fill',
|
|
4929
|
+
'stroke',
|
|
4930
|
+
'width',
|
|
4931
|
+
'height'
|
|
4932
|
+
]);
|
|
4933
|
+
} else {
|
|
4934
|
+
attrs = pickAttrs(attrs, [
|
|
4935
|
+
'fill',
|
|
4936
|
+
'stroke'
|
|
4937
|
+
]);
|
|
4938
|
+
}
|
|
4507
4939
|
|
|
4508
|
-
|
|
4509
|
-
|
|
4940
|
+
var outer = renderSubProcess(parentGfx, element, {
|
|
4941
|
+
strokeWidth: 1.5,
|
|
4942
|
+
...attrs
|
|
4943
|
+
});
|
|
4510
4944
|
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
compensation: -42,
|
|
4516
|
-
loop: -18,
|
|
4517
|
-
adhoc: 10
|
|
4518
|
-
};
|
|
4519
|
-
} else {
|
|
4520
|
-
position = {
|
|
4521
|
-
seq: -3,
|
|
4522
|
-
parallel: -6,
|
|
4523
|
-
compensation: -27,
|
|
4524
|
-
loop: 0,
|
|
4525
|
-
adhoc: 10
|
|
4526
|
-
};
|
|
4527
|
-
}
|
|
4945
|
+
var innerAttrs = styles.style([ 'no-fill', 'no-events' ], {
|
|
4946
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4947
|
+
strokeWidth: 1.5
|
|
4948
|
+
});
|
|
4528
4949
|
|
|
4529
|
-
|
|
4530
|
-
renderer(marker)(parentGfx, element, position);
|
|
4531
|
-
});
|
|
4950
|
+
var expanded = isExpanded(element);
|
|
4532
4951
|
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4952
|
+
if (!expanded) {
|
|
4953
|
+
attrs = {};
|
|
4954
|
+
}
|
|
4536
4955
|
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4956
|
+
drawRect(
|
|
4957
|
+
parentGfx,
|
|
4958
|
+
getWidth(element, attrs),
|
|
4959
|
+
getHeight(element, attrs),
|
|
4960
|
+
TASK_BORDER_RADIUS - INNER_OUTER_DIST,
|
|
4961
|
+
INNER_OUTER_DIST,
|
|
4962
|
+
innerAttrs
|
|
4963
|
+
);
|
|
4540
4964
|
|
|
4541
|
-
|
|
4542
|
-
|
|
4965
|
+
return outer;
|
|
4966
|
+
},
|
|
4967
|
+
'bpmn:UserTask': function(parentGfx, element, attrs = {}) {
|
|
4968
|
+
attrs = pickAttrs(attrs, [
|
|
4969
|
+
'fill',
|
|
4970
|
+
'stroke'
|
|
4971
|
+
]);
|
|
4543
4972
|
|
|
4544
|
-
|
|
4973
|
+
var task = renderTask(parentGfx, element, attrs);
|
|
4545
4974
|
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
}
|
|
4975
|
+
var x = 15;
|
|
4976
|
+
var y = 12;
|
|
4549
4977
|
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4978
|
+
var pathDataUser1 = pathMap.getScaledPath('TASK_TYPE_USER_1', {
|
|
4979
|
+
abspos: {
|
|
4980
|
+
x: x,
|
|
4981
|
+
y: y
|
|
4982
|
+
}
|
|
4983
|
+
});
|
|
4553
4984
|
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4985
|
+
drawPath(parentGfx, pathDataUser1, {
|
|
4986
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
4987
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4988
|
+
strokeWidth: 0.5
|
|
4989
|
+
});
|
|
4559
4990
|
|
|
4560
|
-
|
|
4991
|
+
var pathDataUser2 = pathMap.getScaledPath('TASK_TYPE_USER_2', {
|
|
4992
|
+
abspos: {
|
|
4993
|
+
x: x,
|
|
4994
|
+
y: y
|
|
4995
|
+
}
|
|
4996
|
+
});
|
|
4561
4997
|
|
|
4562
|
-
|
|
4998
|
+
drawPath(parentGfx, pathDataUser2, {
|
|
4999
|
+
fill: getFillColor(element, defaultFillColor, attrs.fill),
|
|
5000
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
5001
|
+
strokeWidth: 0.5
|
|
5002
|
+
});
|
|
4563
5003
|
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
mx: 0.33,
|
|
4571
|
-
my: yPosition
|
|
4572
|
-
}
|
|
4573
|
-
});
|
|
5004
|
+
var pathDataUser3 = pathMap.getScaledPath('TASK_TYPE_USER_3', {
|
|
5005
|
+
abspos: {
|
|
5006
|
+
x: x,
|
|
5007
|
+
y: y
|
|
5008
|
+
}
|
|
5009
|
+
});
|
|
4574
5010
|
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
5011
|
+
drawPath(parentGfx, pathDataUser3, {
|
|
5012
|
+
fill: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
5013
|
+
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
5014
|
+
strokeWidth: 0.5
|
|
5015
|
+
});
|
|
4579
5016
|
|
|
5017
|
+
return task;
|
|
5018
|
+
},
|
|
5019
|
+
'label': function(parentGfx, element, attrs = {}) {
|
|
5020
|
+
return renderExternalLabel(parentGfx, element, attrs);
|
|
5021
|
+
}
|
|
5022
|
+
};
|
|
4580
5023
|
|
|
4581
5024
|
// extension API, use at your own risk
|
|
4582
5025
|
this._drawPath = drawPath;
|
|
@@ -4611,15 +5054,16 @@
|
|
|
4611
5054
|
*
|
|
4612
5055
|
* @param {SVGElement} parentGfx
|
|
4613
5056
|
* @param {Element} element
|
|
5057
|
+
* @param {Attrs} [attrs]
|
|
4614
5058
|
*
|
|
4615
5059
|
* @return {SVGElement} mainGfx
|
|
4616
5060
|
*/
|
|
4617
|
-
BpmnRenderer.prototype.drawShape = function(parentGfx, element) {
|
|
4618
|
-
var type = element
|
|
4619
|
-
var h = this._renderer(type);
|
|
5061
|
+
BpmnRenderer.prototype.drawShape = function(parentGfx, element, attrs = {}) {
|
|
5062
|
+
var { type } = element;
|
|
4620
5063
|
|
|
4621
|
-
|
|
4622
|
-
|
|
5064
|
+
var handler = this._renderer(type);
|
|
5065
|
+
|
|
5066
|
+
return handler(parentGfx, element, attrs);
|
|
4623
5067
|
};
|
|
4624
5068
|
|
|
4625
5069
|
/**
|
|
@@ -4627,15 +5071,16 @@
|
|
|
4627
5071
|
*
|
|
4628
5072
|
* @param {SVGElement} parentGfx
|
|
4629
5073
|
* @param {Element} element
|
|
5074
|
+
* @param {Attrs} [attrs]
|
|
4630
5075
|
*
|
|
4631
5076
|
* @return {SVGElement} mainGfx
|
|
4632
5077
|
*/
|
|
4633
|
-
BpmnRenderer.prototype.drawConnection = function(parentGfx, element) {
|
|
4634
|
-
var type = element
|
|
4635
|
-
|
|
5078
|
+
BpmnRenderer.prototype.drawConnection = function(parentGfx, element, attrs = {}) {
|
|
5079
|
+
var { type } = element;
|
|
5080
|
+
|
|
5081
|
+
var handler = this._renderer(type);
|
|
4636
5082
|
|
|
4637
|
-
|
|
4638
|
-
return h(parentGfx, element);
|
|
5083
|
+
return handler(parentGfx, element, attrs);
|
|
4639
5084
|
};
|
|
4640
5085
|
|
|
4641
5086
|
/**
|
|
@@ -4646,7 +5091,6 @@
|
|
|
4646
5091
|
* @return {string} path
|
|
4647
5092
|
*/
|
|
4648
5093
|
BpmnRenderer.prototype.getShapePath = function(element) {
|
|
4649
|
-
|
|
4650
5094
|
if (is$1(element, 'bpmn:Event')) {
|
|
4651
5095
|
return getCirclePath(element);
|
|
4652
5096
|
}
|
|
@@ -4662,6 +5106,24 @@
|
|
|
4662
5106
|
return getRectPath(element);
|
|
4663
5107
|
};
|
|
4664
5108
|
|
|
5109
|
+
/**
|
|
5110
|
+
* Pick attributes if they exist.
|
|
5111
|
+
*
|
|
5112
|
+
* @param {Object} attrs
|
|
5113
|
+
* @param {string[]} keys
|
|
5114
|
+
*
|
|
5115
|
+
* @returns {Object}
|
|
5116
|
+
*/
|
|
5117
|
+
function pickAttrs(attrs, keys = []) {
|
|
5118
|
+
return keys.reduce((pickedAttrs, key) => {
|
|
5119
|
+
if (attrs[ key ]) {
|
|
5120
|
+
pickedAttrs[ key ] = attrs[ key ];
|
|
5121
|
+
}
|
|
5122
|
+
|
|
5123
|
+
return pickedAttrs;
|
|
5124
|
+
}, {});
|
|
5125
|
+
}
|
|
5126
|
+
|
|
4665
5127
|
/**
|
|
4666
5128
|
* @typedef {import('../util/Types').Dimensions} Dimensions
|
|
4667
5129
|
*
|
|
@@ -5758,10 +6220,6 @@
|
|
|
5758
6220
|
translate: [ 'value', translate ]
|
|
5759
6221
|
};
|
|
5760
6222
|
|
|
5761
|
-
function getDefaultExportFromCjs (x) {
|
|
5762
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5763
|
-
}
|
|
5764
|
-
|
|
5765
6223
|
/**
|
|
5766
6224
|
* @param {Point} point
|
|
5767
6225
|
*
|
|
@@ -6350,26 +6808,6 @@
|
|
|
6350
6808
|
return isButton(event, 1);
|
|
6351
6809
|
}
|
|
6352
6810
|
|
|
6353
|
-
/**
|
|
6354
|
-
* @param {MouseEvent} event
|
|
6355
|
-
*
|
|
6356
|
-
* @return {boolean}
|
|
6357
|
-
*/
|
|
6358
|
-
function hasPrimaryModifier(event) {
|
|
6359
|
-
var originalEvent = getOriginal(event) || event;
|
|
6360
|
-
|
|
6361
|
-
if (!isPrimaryButton(event)) {
|
|
6362
|
-
return false;
|
|
6363
|
-
}
|
|
6364
|
-
|
|
6365
|
-
// Use cmd as primary modifier key for mac OS
|
|
6366
|
-
if (isMac()) {
|
|
6367
|
-
return originalEvent.metaKey;
|
|
6368
|
-
} else {
|
|
6369
|
-
return originalEvent.ctrlKey;
|
|
6370
|
-
}
|
|
6371
|
-
}
|
|
6372
|
-
|
|
6373
6811
|
/**
|
|
6374
6812
|
* @param {MouseEvent} event
|
|
6375
6813
|
*
|
|
@@ -6970,6 +7408,8 @@
|
|
|
6970
7408
|
|
|
6971
7409
|
var LOW_PRIORITY$3 = 500;
|
|
6972
7410
|
|
|
7411
|
+
var DEFAULT_PRIORITY$3 = 1000;
|
|
7412
|
+
|
|
6973
7413
|
/**
|
|
6974
7414
|
* @typedef {import('../../model/Types').Element} Element
|
|
6975
7415
|
*
|
|
@@ -6988,25 +7428,30 @@
|
|
|
6988
7428
|
*/
|
|
6989
7429
|
function Outline(eventBus, styles) {
|
|
6990
7430
|
|
|
6991
|
-
this.
|
|
7431
|
+
this._eventBus = eventBus;
|
|
7432
|
+
|
|
7433
|
+
this.offset = 5;
|
|
6992
7434
|
|
|
6993
7435
|
var OUTLINE_STYLE = styles.cls('djs-outline', [ 'no-fill' ]);
|
|
6994
7436
|
|
|
6995
7437
|
var self = this;
|
|
6996
7438
|
|
|
6997
|
-
|
|
7439
|
+
/**
|
|
7440
|
+
* @param {SVGElement} gfx
|
|
7441
|
+
*
|
|
7442
|
+
* @return {SVGElement} outline
|
|
7443
|
+
*/
|
|
7444
|
+
function createOutline(gfx) {
|
|
6998
7445
|
var outline = create$1('rect');
|
|
6999
7446
|
|
|
7000
7447
|
attr$1(outline, assign$1({
|
|
7001
|
-
x:
|
|
7002
|
-
y:
|
|
7448
|
+
x: 0,
|
|
7449
|
+
y: 0,
|
|
7003
7450
|
rx: 4,
|
|
7004
7451
|
width: 100,
|
|
7005
7452
|
height: 100
|
|
7006
7453
|
}, OUTLINE_STYLE));
|
|
7007
7454
|
|
|
7008
|
-
append(gfx, outline);
|
|
7009
|
-
|
|
7010
7455
|
return outline;
|
|
7011
7456
|
}
|
|
7012
7457
|
|
|
@@ -7019,7 +7464,8 @@
|
|
|
7019
7464
|
var outline = query('.djs-outline', gfx);
|
|
7020
7465
|
|
|
7021
7466
|
if (!outline) {
|
|
7022
|
-
outline = createOutline(
|
|
7467
|
+
outline = self.getOutline(element) || createOutline();
|
|
7468
|
+
append(gfx, outline);
|
|
7023
7469
|
}
|
|
7024
7470
|
|
|
7025
7471
|
self.updateShapeOutline(outline, element);
|
|
@@ -7032,7 +7478,8 @@
|
|
|
7032
7478
|
var outline = query('.djs-outline', gfx);
|
|
7033
7479
|
|
|
7034
7480
|
if (!outline) {
|
|
7035
|
-
outline = createOutline(
|
|
7481
|
+
outline = createOutline();
|
|
7482
|
+
append(gfx, outline);
|
|
7036
7483
|
}
|
|
7037
7484
|
|
|
7038
7485
|
self.updateConnectionOutline(outline, element);
|
|
@@ -7049,25 +7496,34 @@
|
|
|
7049
7496
|
*/
|
|
7050
7497
|
Outline.prototype.updateShapeOutline = function(outline, element) {
|
|
7051
7498
|
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
y: -this.offset,
|
|
7055
|
-
width: element.width + this.offset * 2,
|
|
7056
|
-
height: element.height + this.offset * 2
|
|
7057
|
-
});
|
|
7499
|
+
var updated = false;
|
|
7500
|
+
var providers = this._getProviders();
|
|
7058
7501
|
|
|
7059
|
-
|
|
7502
|
+
if (providers.length) {
|
|
7503
|
+
forEach$1(providers, function(provider) {
|
|
7504
|
+
updated = updated || provider.updateOutline(element, outline);
|
|
7505
|
+
});
|
|
7506
|
+
}
|
|
7060
7507
|
|
|
7508
|
+
if (!updated) {
|
|
7509
|
+
attr$1(outline, {
|
|
7510
|
+
x: -this.offset,
|
|
7511
|
+
y: -this.offset,
|
|
7512
|
+
width: element.width + this.offset * 2,
|
|
7513
|
+
height: element.height + this.offset * 2
|
|
7514
|
+
});
|
|
7515
|
+
}
|
|
7516
|
+
};
|
|
7061
7517
|
|
|
7062
7518
|
/**
|
|
7063
7519
|
* Updates the outline of a connection respecting the bounding box of
|
|
7064
7520
|
* the connection and an outline offset.
|
|
7521
|
+
* Register an outline provider with the given priority.
|
|
7065
7522
|
*
|
|
7066
7523
|
* @param {SVGElement} outline
|
|
7067
7524
|
* @param {Element} connection
|
|
7068
7525
|
*/
|
|
7069
7526
|
Outline.prototype.updateConnectionOutline = function(outline, connection) {
|
|
7070
|
-
|
|
7071
7527
|
var bbox = getBBox(connection);
|
|
7072
7528
|
|
|
7073
7529
|
attr$1(outline, {
|
|
@@ -7076,9 +7532,61 @@
|
|
|
7076
7532
|
width: bbox.width + this.offset * 2,
|
|
7077
7533
|
height: bbox.height + this.offset * 2
|
|
7078
7534
|
});
|
|
7535
|
+
};
|
|
7536
|
+
|
|
7537
|
+
/**
|
|
7538
|
+
* Register an outline provider with the given priority.
|
|
7539
|
+
*
|
|
7540
|
+
* @param {number} priority
|
|
7541
|
+
* @param {OutlineProvider} provider
|
|
7542
|
+
*/
|
|
7543
|
+
Outline.prototype.registerProvider = function(priority, provider) {
|
|
7544
|
+
if (!provider) {
|
|
7545
|
+
provider = priority;
|
|
7546
|
+
priority = DEFAULT_PRIORITY$3;
|
|
7547
|
+
}
|
|
7548
|
+
|
|
7549
|
+
this._eventBus.on('outline.getProviders', priority, function(event) {
|
|
7550
|
+
event.providers.push(provider);
|
|
7551
|
+
});
|
|
7552
|
+
};
|
|
7553
|
+
|
|
7554
|
+
/**
|
|
7555
|
+
* Returns the registered outline providers.
|
|
7556
|
+
*
|
|
7557
|
+
* @returns {OutlineProvider[]}
|
|
7558
|
+
*/
|
|
7559
|
+
Outline.prototype._getProviders = function() {
|
|
7560
|
+
var event = this._eventBus.createEvent({
|
|
7561
|
+
type: 'outline.getProviders',
|
|
7562
|
+
providers: []
|
|
7563
|
+
});
|
|
7564
|
+
|
|
7565
|
+
this._eventBus.fire(event);
|
|
7079
7566
|
|
|
7567
|
+
return event.providers;
|
|
7080
7568
|
};
|
|
7081
7569
|
|
|
7570
|
+
/**
|
|
7571
|
+
* Returns the outline for an element.
|
|
7572
|
+
*
|
|
7573
|
+
* @param {Element} element
|
|
7574
|
+
**/
|
|
7575
|
+
Outline.prototype.getOutline = function(element) {
|
|
7576
|
+
var outline;
|
|
7577
|
+
var providers = this._getProviders();
|
|
7578
|
+
|
|
7579
|
+
forEach$1(providers, function(provider) {
|
|
7580
|
+
|
|
7581
|
+
if (!isFunction(provider.getOutline)) {
|
|
7582
|
+
return;
|
|
7583
|
+
}
|
|
7584
|
+
|
|
7585
|
+
outline = outline || provider.getOutline(element);
|
|
7586
|
+
});
|
|
7587
|
+
|
|
7588
|
+
return outline;
|
|
7589
|
+
};
|
|
7082
7590
|
|
|
7083
7591
|
Outline.$inject = [ 'eventBus', 'styles', 'elementRegistry' ];
|
|
7084
7592
|
|
|
@@ -7420,8 +7928,8 @@
|
|
|
7420
7928
|
var isSelected = selection.isSelected(element),
|
|
7421
7929
|
isMultiSelect = selection.get().length > 1;
|
|
7422
7930
|
|
|
7423
|
-
// Add to selection if
|
|
7424
|
-
var add =
|
|
7931
|
+
// Add to selection if SHIFT pressed
|
|
7932
|
+
var add = hasSecondaryModifier(event);
|
|
7425
7933
|
|
|
7426
7934
|
if (isSelected && isMultiSelect) {
|
|
7427
7935
|
if (add) {
|
|
@@ -7713,8 +8221,7 @@
|
|
|
7713
8221
|
} else {
|
|
7714
8222
|
return [];
|
|
7715
8223
|
}
|
|
7716
|
-
} else
|
|
7717
|
-
if (search.type) {
|
|
8224
|
+
} else if (search.type) {
|
|
7718
8225
|
return filter(this._overlays, matchPattern({ type: search.type }));
|
|
7719
8226
|
} else {
|
|
7720
8227
|
|
|
@@ -9397,7 +9904,7 @@
|
|
|
9397
9904
|
}
|
|
9398
9905
|
|
|
9399
9906
|
/**
|
|
9400
|
-
* @typedef {import('./index').InjectAnnotated } InjectAnnotated
|
|
9907
|
+
* @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
|
|
9401
9908
|
*/
|
|
9402
9909
|
|
|
9403
9910
|
/**
|
|
@@ -9467,9 +9974,9 @@
|
|
|
9467
9974
|
}
|
|
9468
9975
|
|
|
9469
9976
|
/**
|
|
9470
|
-
* @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
|
|
9471
|
-
* @typedef { import('./index').ModuleDefinition } ModuleDefinition
|
|
9472
|
-
* @typedef { import('./index').InjectorContext } InjectorContext
|
|
9977
|
+
* @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
|
|
9978
|
+
* @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
|
|
9979
|
+
* @typedef { import('./index.js').InjectorContext } InjectorContext
|
|
9473
9980
|
*/
|
|
9474
9981
|
|
|
9475
9982
|
/**
|
|
@@ -9572,11 +10079,20 @@
|
|
|
9572
10079
|
};
|
|
9573
10080
|
}
|
|
9574
10081
|
|
|
9575
|
-
|
|
10082
|
+
/**
|
|
10083
|
+
* Instantiate the given type, injecting dependencies.
|
|
10084
|
+
*
|
|
10085
|
+
* @template T
|
|
10086
|
+
*
|
|
10087
|
+
* @param { Function | [...string[], Function ]} type
|
|
10088
|
+
*
|
|
10089
|
+
* @return T
|
|
10090
|
+
*/
|
|
10091
|
+
function instantiate(type) {
|
|
9576
10092
|
const {
|
|
9577
10093
|
fn,
|
|
9578
10094
|
dependencies
|
|
9579
|
-
} = fnDef(
|
|
10095
|
+
} = fnDef(type);
|
|
9580
10096
|
|
|
9581
10097
|
// instantiate var args constructor
|
|
9582
10098
|
const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
|
|
@@ -9584,6 +10100,17 @@
|
|
|
9584
10100
|
return new Constructor();
|
|
9585
10101
|
}
|
|
9586
10102
|
|
|
10103
|
+
/**
|
|
10104
|
+
* Invoke the given function, injecting dependencies. Return the result.
|
|
10105
|
+
*
|
|
10106
|
+
* @template T
|
|
10107
|
+
*
|
|
10108
|
+
* @param { Function | [...string[], Function ]} func
|
|
10109
|
+
* @param { Object } [context]
|
|
10110
|
+
* @param { Object } [locals]
|
|
10111
|
+
*
|
|
10112
|
+
* @return {T} invocation result
|
|
10113
|
+
*/
|
|
9587
10114
|
function invoke(func, context, locals) {
|
|
9588
10115
|
const {
|
|
9589
10116
|
fn,
|
|
@@ -11852,32 +12379,17 @@
|
|
|
11852
12379
|
}
|
|
11853
12380
|
};
|
|
11854
12381
|
|
|
11855
|
-
var objectRefs = {exports: {}};
|
|
11856
|
-
|
|
11857
|
-
var collection = {};
|
|
11858
|
-
|
|
11859
|
-
/**
|
|
11860
|
-
* An empty collection stub. Use {@link RefsCollection.extend} to extend a
|
|
11861
|
-
* collection with ref semantics.
|
|
11862
|
-
*
|
|
11863
|
-
* @class RefsCollection
|
|
11864
|
-
*/
|
|
11865
|
-
|
|
11866
12382
|
/**
|
|
11867
12383
|
* Extends a collection with {@link Refs} aware methods
|
|
11868
12384
|
*
|
|
11869
|
-
* @
|
|
11870
|
-
* @
|
|
11871
|
-
*
|
|
11872
|
-
* @param
|
|
11873
|
-
* @param {Refs} refs instance
|
|
11874
|
-
* @param {Object} property represented by the collection
|
|
11875
|
-
* @param {Object} target object the collection is attached to
|
|
12385
|
+
* @param {Array<Object>} collection
|
|
12386
|
+
* @param {Refs} refs instance
|
|
12387
|
+
* @param {Object} property represented by the collection
|
|
12388
|
+
* @param {Object} target object the collection is attached to
|
|
11876
12389
|
*
|
|
11877
12390
|
* @return {RefsCollection<Object>} the extended array
|
|
11878
12391
|
*/
|
|
11879
12392
|
function extend(collection, refs, property, target) {
|
|
11880
|
-
|
|
11881
12393
|
var inverseProperty = property.inverse;
|
|
11882
12394
|
|
|
11883
12395
|
/**
|
|
@@ -11888,7 +12400,7 @@
|
|
|
11888
12400
|
* @param {Object} element the element to remove
|
|
11889
12401
|
*/
|
|
11890
12402
|
Object.defineProperty(collection, 'remove', {
|
|
11891
|
-
value: function(element) {
|
|
12403
|
+
value: function (element) {
|
|
11892
12404
|
var idx = this.indexOf(element);
|
|
11893
12405
|
if (idx !== -1) {
|
|
11894
12406
|
this.splice(idx, 1);
|
|
@@ -11896,7 +12408,6 @@
|
|
|
11896
12408
|
// unset inverse
|
|
11897
12409
|
refs.unset(element, inverseProperty, target);
|
|
11898
12410
|
}
|
|
11899
|
-
|
|
11900
12411
|
return element;
|
|
11901
12412
|
}
|
|
11902
12413
|
});
|
|
@@ -11909,7 +12420,7 @@
|
|
|
11909
12420
|
* @param {Object} element the element to check for
|
|
11910
12421
|
*/
|
|
11911
12422
|
Object.defineProperty(collection, 'contains', {
|
|
11912
|
-
value: function(element) {
|
|
12423
|
+
value: function (element) {
|
|
11913
12424
|
return this.indexOf(element) !== -1;
|
|
11914
12425
|
}
|
|
11915
12426
|
});
|
|
@@ -11924,12 +12435,9 @@
|
|
|
11924
12435
|
* (possibly moving other elements around)
|
|
11925
12436
|
*/
|
|
11926
12437
|
Object.defineProperty(collection, 'add', {
|
|
11927
|
-
value: function(element, idx) {
|
|
11928
|
-
|
|
12438
|
+
value: function (element, idx) {
|
|
11929
12439
|
var currentIdx = this.indexOf(element);
|
|
11930
|
-
|
|
11931
12440
|
if (typeof idx === 'undefined') {
|
|
11932
|
-
|
|
11933
12441
|
if (currentIdx !== -1) {
|
|
11934
12442
|
// element already in collection (!)
|
|
11935
12443
|
return;
|
|
@@ -11941,14 +12449,12 @@
|
|
|
11941
12449
|
|
|
11942
12450
|
// handle already in collection
|
|
11943
12451
|
if (currentIdx !== -1) {
|
|
11944
|
-
|
|
11945
12452
|
// remove element from currentIdx
|
|
11946
12453
|
this.splice(currentIdx, 1);
|
|
11947
12454
|
}
|
|
11948
12455
|
|
|
11949
12456
|
// add element at idx
|
|
11950
12457
|
this.splice(idx, 0, element);
|
|
11951
|
-
|
|
11952
12458
|
if (currentIdx === -1) {
|
|
11953
12459
|
// set inverse, unless element was
|
|
11954
12460
|
// in collection already
|
|
@@ -11962,69 +12468,53 @@
|
|
|
11962
12468
|
Object.defineProperty(collection, '__refs_collection', {
|
|
11963
12469
|
value: true
|
|
11964
12470
|
});
|
|
11965
|
-
|
|
11966
12471
|
return collection;
|
|
11967
12472
|
}
|
|
11968
12473
|
|
|
11969
|
-
|
|
12474
|
+
/**
|
|
12475
|
+
* Checks if a given collection is extended
|
|
12476
|
+
*
|
|
12477
|
+
* @param {Array<Object>} collection
|
|
12478
|
+
*
|
|
12479
|
+
* @return {boolean}
|
|
12480
|
+
*/
|
|
11970
12481
|
function isExtended(collection) {
|
|
11971
12482
|
return collection.__refs_collection === true;
|
|
11972
12483
|
}
|
|
11973
12484
|
|
|
11974
|
-
collection.extend = extend;
|
|
11975
|
-
|
|
11976
|
-
collection.isExtended = isExtended;
|
|
11977
|
-
|
|
11978
|
-
var Collection = collection;
|
|
11979
|
-
|
|
11980
12485
|
function hasOwnProperty$1(e, property) {
|
|
11981
12486
|
return Object.prototype.hasOwnProperty.call(e, property.name || property);
|
|
11982
12487
|
}
|
|
11983
|
-
|
|
11984
12488
|
function defineCollectionProperty(ref, property, target) {
|
|
11985
|
-
|
|
11986
|
-
var collection = Collection.extend(target[property.name] || [], ref, property, target);
|
|
11987
|
-
|
|
12489
|
+
var collection = extend(target[property.name] || [], ref, property, target);
|
|
11988
12490
|
Object.defineProperty(target, property.name, {
|
|
11989
12491
|
enumerable: property.enumerable,
|
|
11990
12492
|
value: collection
|
|
11991
12493
|
});
|
|
11992
|
-
|
|
11993
12494
|
if (collection.length) {
|
|
11994
|
-
|
|
11995
|
-
collection.forEach(function(o) {
|
|
12495
|
+
collection.forEach(function (o) {
|
|
11996
12496
|
ref.set(o, property.inverse, target);
|
|
11997
12497
|
});
|
|
11998
12498
|
}
|
|
11999
12499
|
}
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
12500
|
function defineProperty$1(ref, property, target) {
|
|
12003
|
-
|
|
12004
12501
|
var inverseProperty = property.inverse;
|
|
12005
|
-
|
|
12006
12502
|
var _value = target[property.name];
|
|
12007
|
-
|
|
12008
12503
|
Object.defineProperty(target, property.name, {
|
|
12009
12504
|
configurable: property.configurable,
|
|
12010
12505
|
enumerable: property.enumerable,
|
|
12011
|
-
|
|
12012
|
-
get: function() {
|
|
12506
|
+
get: function () {
|
|
12013
12507
|
return _value;
|
|
12014
12508
|
},
|
|
12015
|
-
|
|
12016
|
-
set: function(value) {
|
|
12017
|
-
|
|
12509
|
+
set: function (value) {
|
|
12018
12510
|
// return if we already performed all changes
|
|
12019
12511
|
if (value === _value) {
|
|
12020
12512
|
return;
|
|
12021
12513
|
}
|
|
12022
|
-
|
|
12023
12514
|
var old = _value;
|
|
12024
12515
|
|
|
12025
12516
|
// temporary set null
|
|
12026
12517
|
_value = null;
|
|
12027
|
-
|
|
12028
12518
|
if (old) {
|
|
12029
12519
|
ref.unset(old, inverseProperty, target);
|
|
12030
12520
|
}
|
|
@@ -12036,7 +12526,6 @@
|
|
|
12036
12526
|
ref.set(_value, inverseProperty, target);
|
|
12037
12527
|
}
|
|
12038
12528
|
});
|
|
12039
|
-
|
|
12040
12529
|
}
|
|
12041
12530
|
|
|
12042
12531
|
/**
|
|
@@ -12082,16 +12571,14 @@
|
|
|
12082
12571
|
*
|
|
12083
12572
|
* wheels[0].car // undefined
|
|
12084
12573
|
*/
|
|
12085
|
-
function Refs
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
return new Refs$1(a, b);
|
|
12574
|
+
function Refs(a, b) {
|
|
12575
|
+
if (!(this instanceof Refs)) {
|
|
12576
|
+
return new Refs(a, b);
|
|
12089
12577
|
}
|
|
12090
12578
|
|
|
12091
12579
|
// link
|
|
12092
12580
|
a.inverse = b;
|
|
12093
12581
|
b.inverse = a;
|
|
12094
|
-
|
|
12095
12582
|
this.props = {};
|
|
12096
12583
|
this.props[a.name] = a;
|
|
12097
12584
|
this.props[b.name] = b;
|
|
@@ -12106,43 +12593,34 @@
|
|
|
12106
12593
|
* @param {Object} target
|
|
12107
12594
|
* @param {String} property
|
|
12108
12595
|
*/
|
|
12109
|
-
Refs
|
|
12596
|
+
Refs.prototype.bind = function (target, property) {
|
|
12110
12597
|
if (typeof property === 'string') {
|
|
12111
12598
|
if (!this.props[property]) {
|
|
12112
12599
|
throw new Error('no property <' + property + '> in ref');
|
|
12113
12600
|
}
|
|
12114
12601
|
property = this.props[property];
|
|
12115
12602
|
}
|
|
12116
|
-
|
|
12117
12603
|
if (property.collection) {
|
|
12118
12604
|
defineCollectionProperty(this, property, target);
|
|
12119
12605
|
} else {
|
|
12120
12606
|
defineProperty$1(this, property, target);
|
|
12121
12607
|
}
|
|
12122
12608
|
};
|
|
12123
|
-
|
|
12124
|
-
Refs$1.prototype.ensureRefsCollection = function(target, property) {
|
|
12125
|
-
|
|
12609
|
+
Refs.prototype.ensureRefsCollection = function (target, property) {
|
|
12126
12610
|
var collection = target[property.name];
|
|
12127
|
-
|
|
12128
|
-
if (!Collection.isExtended(collection)) {
|
|
12611
|
+
if (!isExtended(collection)) {
|
|
12129
12612
|
defineCollectionProperty(this, property, target);
|
|
12130
12613
|
}
|
|
12131
|
-
|
|
12132
12614
|
return collection;
|
|
12133
12615
|
};
|
|
12134
|
-
|
|
12135
|
-
Refs$1.prototype.ensureBound = function(target, property) {
|
|
12616
|
+
Refs.prototype.ensureBound = function (target, property) {
|
|
12136
12617
|
if (!hasOwnProperty$1(target, property)) {
|
|
12137
12618
|
this.bind(target, property);
|
|
12138
12619
|
}
|
|
12139
12620
|
};
|
|
12140
|
-
|
|
12141
|
-
Refs$1.prototype.unset = function(target, property, value) {
|
|
12142
|
-
|
|
12621
|
+
Refs.prototype.unset = function (target, property, value) {
|
|
12143
12622
|
if (target) {
|
|
12144
12623
|
this.ensureBound(target, property);
|
|
12145
|
-
|
|
12146
12624
|
if (property.collection) {
|
|
12147
12625
|
this.ensureRefsCollection(target, property).remove(value);
|
|
12148
12626
|
} else {
|
|
@@ -12150,12 +12628,9 @@
|
|
|
12150
12628
|
}
|
|
12151
12629
|
}
|
|
12152
12630
|
};
|
|
12153
|
-
|
|
12154
|
-
Refs$1.prototype.set = function(target, property, value) {
|
|
12155
|
-
|
|
12631
|
+
Refs.prototype.set = function (target, property, value) {
|
|
12156
12632
|
if (target) {
|
|
12157
12633
|
this.ensureBound(target, property);
|
|
12158
|
-
|
|
12159
12634
|
if (property.collection) {
|
|
12160
12635
|
this.ensureRefsCollection(target, property).add(value);
|
|
12161
12636
|
} else {
|
|
@@ -12164,15 +12639,6 @@
|
|
|
12164
12639
|
}
|
|
12165
12640
|
};
|
|
12166
12641
|
|
|
12167
|
-
var refs = Refs$1;
|
|
12168
|
-
|
|
12169
|
-
objectRefs.exports = refs;
|
|
12170
|
-
|
|
12171
|
-
objectRefs.exports.Collection = collection;
|
|
12172
|
-
|
|
12173
|
-
var objectRefsExports = objectRefs.exports;
|
|
12174
|
-
var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
|
|
12175
|
-
|
|
12176
12642
|
var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
|
|
12177
12643
|
labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
|
|
12178
12644
|
attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),
|
|
@@ -13377,13 +13843,14 @@
|
|
|
13377
13843
|
*
|
|
13378
13844
|
* @param {SVGElement} visual The graphical element.
|
|
13379
13845
|
* @param {ShapeLike} element The shape.
|
|
13846
|
+
* @param {Object} attrs Optional attributes.
|
|
13380
13847
|
*
|
|
13381
13848
|
* @return {SVGElement}
|
|
13382
13849
|
*/
|
|
13383
|
-
GraphicsFactory.prototype.drawShape = function(visual, element) {
|
|
13850
|
+
GraphicsFactory.prototype.drawShape = function(visual, element, attrs = {}) {
|
|
13384
13851
|
var eventBus = this._eventBus;
|
|
13385
13852
|
|
|
13386
|
-
return eventBus.fire('render.shape', { gfx: visual, element
|
|
13853
|
+
return eventBus.fire('render.shape', { gfx: visual, element, attrs });
|
|
13387
13854
|
};
|
|
13388
13855
|
|
|
13389
13856
|
/**
|
|
@@ -13404,13 +13871,14 @@
|
|
|
13404
13871
|
*
|
|
13405
13872
|
* @param {SVGElement} visual The graphical element.
|
|
13406
13873
|
* @param {ConnectionLike} element The connection.
|
|
13874
|
+
* @param {Object} attrs Optional attributes.
|
|
13407
13875
|
*
|
|
13408
13876
|
* @return {SVGElement}
|
|
13409
13877
|
*/
|
|
13410
|
-
GraphicsFactory.prototype.drawConnection = function(visual, element) {
|
|
13878
|
+
GraphicsFactory.prototype.drawConnection = function(visual, element, attrs = {}) {
|
|
13411
13879
|
var eventBus = this._eventBus;
|
|
13412
13880
|
|
|
13413
|
-
return eventBus.fire('render.connection', { gfx: visual, element
|
|
13881
|
+
return eventBus.fire('render.connection', { gfx: visual, element, attrs });
|
|
13414
13882
|
};
|
|
13415
13883
|
|
|
13416
13884
|
/**
|
|
@@ -13448,8 +13916,7 @@
|
|
|
13448
13916
|
|
|
13449
13917
|
// update positioning
|
|
13450
13918
|
translate$1(gfx, element.x, element.y);
|
|
13451
|
-
} else
|
|
13452
|
-
if (type === 'connection') {
|
|
13919
|
+
} else if (type === 'connection') {
|
|
13453
13920
|
this.drawConnection(visual, element);
|
|
13454
13921
|
} else {
|
|
13455
13922
|
throw new Error('unknown type: ' + type);
|
|
@@ -13987,6 +14454,17 @@
|
|
|
13987
14454
|
this.idProperty = p;
|
|
13988
14455
|
};
|
|
13989
14456
|
|
|
14457
|
+
DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
|
|
14458
|
+
|
|
14459
|
+
const _extends = typeDescriptor.extends || [];
|
|
14460
|
+
|
|
14461
|
+
if (_extends.length) {
|
|
14462
|
+
throw new Error(
|
|
14463
|
+
`cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
|
|
14464
|
+
);
|
|
14465
|
+
}
|
|
14466
|
+
};
|
|
14467
|
+
|
|
13990
14468
|
DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
|
|
13991
14469
|
var propertyName = p.name,
|
|
13992
14470
|
definedProperty = this.propertiesByName[propertyName];
|
|
@@ -14005,6 +14483,10 @@
|
|
|
14005
14483
|
|
|
14006
14484
|
DescriptorBuilder.prototype.addTrait = function(t, inherited) {
|
|
14007
14485
|
|
|
14486
|
+
if (inherited) {
|
|
14487
|
+
this.assertNotTrait(t);
|
|
14488
|
+
}
|
|
14489
|
+
|
|
14008
14490
|
var typesByName = this.allTypesByName,
|
|
14009
14491
|
types = this.allTypes;
|
|
14010
14492
|
|
|
@@ -14138,7 +14620,9 @@
|
|
|
14138
14620
|
});
|
|
14139
14621
|
|
|
14140
14622
|
forEach$1(type.extends, bind$2(function(extendsName) {
|
|
14141
|
-
var
|
|
14623
|
+
var extendsNameNs = parseName(extendsName, ns.prefix);
|
|
14624
|
+
|
|
14625
|
+
var extended = this.typeMap[extendsNameNs.name];
|
|
14142
14626
|
|
|
14143
14627
|
extended.traits = extended.traits || [];
|
|
14144
14628
|
extended.traits.push(name);
|
|
@@ -14167,24 +14651,33 @@
|
|
|
14167
14651
|
|
|
14168
14652
|
var self = this;
|
|
14169
14653
|
|
|
14654
|
+
/**
|
|
14655
|
+
* Traverse the selected super type or trait
|
|
14656
|
+
*
|
|
14657
|
+
* @param {String} cls
|
|
14658
|
+
* @param {Boolean} [trait=false]
|
|
14659
|
+
*/
|
|
14660
|
+
function traverse(cls, trait) {
|
|
14661
|
+
var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
|
|
14662
|
+
self.mapTypes(parentNs, iterator, trait);
|
|
14663
|
+
}
|
|
14664
|
+
|
|
14170
14665
|
/**
|
|
14171
14666
|
* Traverse the selected trait.
|
|
14172
14667
|
*
|
|
14173
14668
|
* @param {String} cls
|
|
14174
14669
|
*/
|
|
14175
14670
|
function traverseTrait(cls) {
|
|
14176
|
-
return
|
|
14671
|
+
return traverse(cls, true);
|
|
14177
14672
|
}
|
|
14178
14673
|
|
|
14179
14674
|
/**
|
|
14180
|
-
* Traverse the selected super type
|
|
14675
|
+
* Traverse the selected super type
|
|
14181
14676
|
*
|
|
14182
14677
|
* @param {String} cls
|
|
14183
|
-
* @param {Boolean} [trait=false]
|
|
14184
14678
|
*/
|
|
14185
|
-
function traverseSuper(cls
|
|
14186
|
-
|
|
14187
|
-
self.mapTypes(parentNs, iterator, trait);
|
|
14679
|
+
function traverseSuper(cls) {
|
|
14680
|
+
return traverse(cls, false);
|
|
14188
14681
|
}
|
|
14189
14682
|
|
|
14190
14683
|
if (!type) {
|
|
@@ -14267,7 +14760,7 @@
|
|
|
14267
14760
|
throw new TypeError('property name must be a non-empty string');
|
|
14268
14761
|
}
|
|
14269
14762
|
|
|
14270
|
-
var property = this.
|
|
14763
|
+
var property = this.getProperty(target, name);
|
|
14271
14764
|
|
|
14272
14765
|
var propertyName = property && property.name;
|
|
14273
14766
|
|
|
@@ -14278,7 +14771,7 @@
|
|
|
14278
14771
|
if (property) {
|
|
14279
14772
|
delete target[propertyName];
|
|
14280
14773
|
} else {
|
|
14281
|
-
delete target.$attrs[name];
|
|
14774
|
+
delete target.$attrs[stripGlobal(name)];
|
|
14282
14775
|
}
|
|
14283
14776
|
} else {
|
|
14284
14777
|
|
|
@@ -14291,7 +14784,7 @@
|
|
|
14291
14784
|
defineProperty(target, property, value);
|
|
14292
14785
|
}
|
|
14293
14786
|
} else {
|
|
14294
|
-
target.$attrs[name] = value;
|
|
14787
|
+
target.$attrs[stripGlobal(name)] = value;
|
|
14295
14788
|
}
|
|
14296
14789
|
}
|
|
14297
14790
|
};
|
|
@@ -14306,10 +14799,10 @@
|
|
|
14306
14799
|
*/
|
|
14307
14800
|
Properties.prototype.get = function(target, name) {
|
|
14308
14801
|
|
|
14309
|
-
var property = this.
|
|
14802
|
+
var property = this.getProperty(target, name);
|
|
14310
14803
|
|
|
14311
14804
|
if (!property) {
|
|
14312
|
-
return target.$attrs[name];
|
|
14805
|
+
return target.$attrs[stripGlobal(name)];
|
|
14313
14806
|
}
|
|
14314
14807
|
|
|
14315
14808
|
var propertyName = property.name;
|
|
@@ -14363,6 +14856,44 @@
|
|
|
14363
14856
|
this.define(target, '$model', { value: model });
|
|
14364
14857
|
};
|
|
14365
14858
|
|
|
14859
|
+
/**
|
|
14860
|
+
* Return property with the given name on the element.
|
|
14861
|
+
*
|
|
14862
|
+
* @param {any} target
|
|
14863
|
+
* @param {string} name
|
|
14864
|
+
*
|
|
14865
|
+
* @return {object | null} property
|
|
14866
|
+
*/
|
|
14867
|
+
Properties.prototype.getProperty = function(target, name) {
|
|
14868
|
+
|
|
14869
|
+
var model = this.model;
|
|
14870
|
+
|
|
14871
|
+
var property = model.getPropertyDescriptor(target, name);
|
|
14872
|
+
|
|
14873
|
+
if (property) {
|
|
14874
|
+
return property;
|
|
14875
|
+
}
|
|
14876
|
+
|
|
14877
|
+
if (name.includes(':')) {
|
|
14878
|
+
return null;
|
|
14879
|
+
}
|
|
14880
|
+
|
|
14881
|
+
const strict = model.config.strict;
|
|
14882
|
+
|
|
14883
|
+
if (typeof strict !== 'undefined') {
|
|
14884
|
+
const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
|
|
14885
|
+
|
|
14886
|
+
if (strict) {
|
|
14887
|
+
throw error;
|
|
14888
|
+
} else {
|
|
14889
|
+
|
|
14890
|
+
// eslint-disable-next-line no-undef
|
|
14891
|
+
typeof console !== 'undefined' && console.warn(error);
|
|
14892
|
+
}
|
|
14893
|
+
}
|
|
14894
|
+
|
|
14895
|
+
return null;
|
|
14896
|
+
};
|
|
14366
14897
|
|
|
14367
14898
|
function isUndefined(val) {
|
|
14368
14899
|
return typeof val === 'undefined';
|
|
@@ -14377,6 +14908,10 @@
|
|
|
14377
14908
|
});
|
|
14378
14909
|
}
|
|
14379
14910
|
|
|
14911
|
+
function stripGlobal(name) {
|
|
14912
|
+
return name.replace(/^:/, '');
|
|
14913
|
+
}
|
|
14914
|
+
|
|
14380
14915
|
// Moddle implementation /////////////////////////////////////////////////
|
|
14381
14916
|
|
|
14382
14917
|
/**
|
|
@@ -14399,8 +14934,10 @@
|
|
|
14399
14934
|
* var moddle = new Moddle([pkg]);
|
|
14400
14935
|
*
|
|
14401
14936
|
* @param {Array<Package>} packages the packages to contain
|
|
14937
|
+
*
|
|
14938
|
+
* @param { { strict?: boolean } } [config] moddle configuration
|
|
14402
14939
|
*/
|
|
14403
|
-
function Moddle(packages) {
|
|
14940
|
+
function Moddle(packages, config = {}) {
|
|
14404
14941
|
|
|
14405
14942
|
this.properties = new Properties(this);
|
|
14406
14943
|
|
|
@@ -14408,6 +14945,8 @@
|
|
|
14408
14945
|
this.registry = new Registry(packages, this.properties);
|
|
14409
14946
|
|
|
14410
14947
|
this.typeCache = {};
|
|
14948
|
+
|
|
14949
|
+
this.config = config;
|
|
14411
14950
|
}
|
|
14412
14951
|
|
|
14413
14952
|
|
|
@@ -14501,6 +15040,12 @@
|
|
|
14501
15040
|
$type: name,
|
|
14502
15041
|
$instanceOf: function(type) {
|
|
14503
15042
|
return type === this.$type;
|
|
15043
|
+
},
|
|
15044
|
+
get: function(key) {
|
|
15045
|
+
return this[key];
|
|
15046
|
+
},
|
|
15047
|
+
set: function(key, value) {
|
|
15048
|
+
set$2(this, [ key ], value);
|
|
14504
15049
|
}
|
|
14505
15050
|
};
|
|
14506
15051
|
|
|
@@ -14516,6 +15061,8 @@
|
|
|
14516
15061
|
|
|
14517
15062
|
this.properties.defineDescriptor(element, descriptor);
|
|
14518
15063
|
this.properties.defineModel(element, this);
|
|
15064
|
+
this.properties.define(element, 'get', { enumerable: false, writable: true });
|
|
15065
|
+
this.properties.define(element, 'set', { enumerable: false, writable: true });
|
|
14519
15066
|
this.properties.define(element, '$parent', { enumerable: false, writable: true });
|
|
14520
15067
|
this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
|
|
14521
15068
|
|
|
@@ -23759,7 +24306,7 @@
|
|
|
23759
24306
|
// pinch to zoom is mapped to wheel + ctrlKey = true
|
|
23760
24307
|
// in modern browsers (!)
|
|
23761
24308
|
|
|
23762
|
-
var isZoom = event.ctrlKey;
|
|
24309
|
+
var isZoom = event.ctrlKey || (isMac() && event.metaKey);
|
|
23763
24310
|
|
|
23764
24311
|
var isHorizontalScroll = event.shiftKey;
|
|
23765
24312
|
|