all files / diagram/load-utility/ nodeProperties.js

96.89% Statements 280/289
87.98% Branches 183/208
93.75% Functions 15/16
96.89% Lines 280/289
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566   1307× 1307×   25× 25× 25× 71× 71× 71× 71×     71×       71× 71×     25× 25×   104× 104× 104× 104× 79×   104× 82×   104× 75×   104× 74×   104× 20×   104× 75×   104×   104× 75×   104× 104×   104× 104×   104× 79×   104× 79×   104× 75×   104× 104×   104×   104× 75×   104× 79×   104×   104× 19×   104×   104× 19×   104× 75×   104× 75×   104× 79×   104× 100×   104× 75×       104×         104× 75×                                 75×   73× 10×     104× 75×                                 75× 10×   65×     104× 75×   104× 13×     104× 92× 92× 92× 92×   104× 79×   104×             79×   45× 45×     42×       45×                       10×       10×         12× 12×       79×   10× 10×                               79× 79× 79×   79× 77×   79× 79×   79× 79×   79× 77×   79× 77×   79× 77×   79× 77×   79× 77×   79× 77×   79× 77×   79× 79×   79× 79×   79× 79×   79×     79× 77×   79×     79× 77×   79× 79×   79× 79×   79×                               12×                 10×                                                                                                                       12×                                                                                                
define(["require", "exports", "../enum/enum"], function (require, exports, enum_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var NodeProperties = (function () {
        function NodeProperties(labelProperties, portProperties) {
            this.labelProperties = labelProperties;
            this.portProperties = portProperties;
        }
        NodeProperties.prototype.renderNodesCollection = function (convertedData, data) {
            convertedData.nodes = [];
            var nodes = [];
            for (var i = 0; i < data.nodes.length; i++) {
                var node = data.nodes[parseInt(i.toString(), 10)];
                var processCollection = [];
                var newNode = this.convertToNode(node);
                if (newNode.shape && newNode.shape.activity && newNode.shape.activity.subProcess && newNode.shape.activity.subProcess.processes && newNode.shape.activity.subProcess.processes.length > 0) {
                    var processName = [];
                    for (var k = 0; k < newNode.shape.activity.subProcess.processes.length; k++) {
                        var processes = newNode.shape.activity.subProcess.processes[parseInt(k.toString(), 10)];
                        processes.margin.right = 0;
                        processes.margin.bottom = 0;
                        processes.processId = newNode.id;
                        processName.push(processes.id);
                        processCollection.push(processes);
                    }
                    newNode.shape.activity.subProcess.processes = processName;
                }
                if (node.type === 'group' && !node.isSwimlane) {
                    var childCollection = [];
                    Eif (newNode.children && newNode.children.length > 0) {
                        for (var j = 0; j < newNode.children.length; j++) {
                            var child = newNode.children[parseInt(j.toString(), 10)];
                            nodes.push(child);
                            childCollection.push(child.id);
                        }
                        newNode.children = childCollection;
                    }
                }
                nodes.push(newNode);
                if (processCollection && processCollection.length > 0) {
                    nodes = nodes.concat(processCollection);
                }
            }
            convertedData.nodes = nodes;
            return convertedData.nodes;
        };
        NodeProperties.prototype.convertToNode = function (node) {
            var newNode = {};
            newNode.style = {};
            newNode.margin = {};
            if (node.name) {
                newNode.id = node.name;
            }
            if (node.fillColor) {
                newNode.style.fill = node.fillColor;
            }
            if (node.borderColor) {
                newNode.style.strokeColor = node.borderColor;
            }
            if (node.borderWidth) {
                newNode.style.strokeWidth = node.borderWidth;
            }
            if (node.borderDashArray) {
                newNode.style.strokeDashArray = node.borderDashArray;
            }
            if (node.opacity) {
                newNode.style.opacity = node.opacity;
            }
            if (node.gradient) {
                newNode.style.gradient = this.setGradient(node.gradient);
            }
            if (node.isExpanded) {
                newNode.isExpanded = node.isExpanded;
            }
            Eif (node.width) {
                newNode.width = node.width;
            }
            Eif (node.height) {
                newNode.height = node.height;
            }
            if (node.offsetX) {
                newNode.offsetX = node.offsetX;
            }
            if (node.offsetY) {
                newNode.offsetY = node.offsetY;
            }
            if (node.visible) {
                newNode.visible = node.visible;
            }
            newNode.zIndex = node.zOrder === -1 ? -1 : node.zOrder;
            if (node.excludeFromLayout) {
                newNode.excludeFromLayout = node.excludeFromLayout;
            }
            if (node.rotateAngle) {
                newNode.rotateAngle = node.rotateAngle;
            }
            if (node.pivot) {
                newNode.pivot = node.pivot;
            }
            if (node.addInfo) {
                newNode.addInfo = node.addInfo;
            }
            if (node.marginLeft) {
                newNode.margin.left = node.marginLeft;
            }
            if (node.marginRight) {
                newNode.margin.right = node.marginRight;
            }
            if (node.marginTop) {
                newNode.margin.top = node.marginTop;
            }
            if (node.marginBottom) {
                newNode.margin.bottom = node.marginBottom;
            }
            if (node.horizontalAlign) {
                newNode.horizontalAlignment = node.horizontalAlign;
            }
            if (node.verticalAlign) {
                newNode.verticalAlignment = node.verticalAlign;
            }
            if (node.constraints) {
                newNode.constraints = this.setNodeConstraints(node.constraints);
            }
            if (node.labels) {
                newNode.annotations = this.labelProperties.setLabelProperties(node.labels, undefined);
            }
            if (node.shadow) {
                newNode.shadow = {
                    angle: node.shadow.angle, opacity: node.shadow.opacity, distance: node.shadow.distance
                };
            }
            Iif (node.tooltip) {
                newNode.tooltip = {
                    relativeMode: node.tooltip.relativeMode
                };
            }
            if (node.expandIcon) {
                newNode.expandIcon = {
                    shape: node.expandIcon.shape.charAt(0).toUpperCase() + (node.expandIcon.shape).slice(1),
                    width: node.expandIcon.width, height: node.expandIcon.height,
                    margin: {
                        left: node.expandIcon.margin.left,
                        right: node.expandIcon.margin.right,
                        top: node.expandIcon.margin.top,
                        bottom: node.expandIcon.margin.bottom
                    },
                    offset: {
                        x: node.expandIcon.offset.x,
                        y: node.expandIcon.offset.y
                    },
                    borderColor: node.expandIcon.borderColor, borderWidth: node.expandIcon.borderWidth,
                    cornerRadius: node.expandIcon.cornerRadius,
                    pathData: node.expandIcon.pathData
                };
                if (newNode.expandIcon.shape === 'Arrowup') {
                    newNode.expandIcon.shape = 'ArrowUp';
                }
                else if (newNode.expandIcon.shape === 'Arrowdown') {
                    newNode.expandIcon.shape = 'ArrowDown';
                }
            }
            if (node.collapseIcon) {
                newNode.collapseIcon = {
                    shape: node.collapseIcon.shape.charAt(0).toUpperCase() + (node.collapseIcon.shape).slice(1),
                    width: node.collapseIcon.width, height: node.collapseIcon.height,
                    margin: {
                        left: node.collapseIcon.margin.left,
                        right: node.collapseIcon.margin.right,
                        top: node.collapseIcon.margin.top,
                        bottom: node.collapseIcon.margin.bottom
                    },
                    offset: {
                        x: node.collapseIcon.offset.x,
                        y: node.collapseIcon.offset.y
                    },
                    borderColor: node.collapseIcon.borderColor, borderWidth: node.collapseIcon.borderWidth,
                    cornerRadius: node.collapseIcon.cornerRadius,
                    pathData: node.collapseIcon.pathData
                };
                if (newNode.collapseIcon.shape === 'Arrowup') {
                    newNode.collapseIcon.shape = 'ArrowUp';
                }
                else if (newNode.collapseIcon.shape === 'Arrowdown') {
                    newNode.collapseIcon.shape = 'ArrowDown';
                }
            }
            if (node.ports) {
                newNode.ports = this.portProperties.setPortProperties(node.ports);
            }
            if (node.children) {
                if (node.type !== 'bpmn' && !node.isSwimlane) {
                    newNode.children = this.getChildren(newNode, node);
                }
            }
            if (!(node.children && node.children.length > 0)) {
                newNode.maxWidth = node.maxWidth;
                newNode.maxHeight = node.maxHeight;
                newNode.minWidth = node.minWidth;
                newNode.minHeight = node.minHeight;
            }
            if (node.shape || node.type) {
                newNode = this.setShape(newNode, node);
            }
            return newNode;
        };
        NodeProperties.prototype.getChildren = function (newNode, node) {
            Eif (node.children && node.children.length > 0) {
                var newChild = [];
                for (var i = 0; i < node.children.length; i++) {
                    var child = this.convertToNode(node.children[parseInt(i.toString(), 10)]);
                    Iif (child.children) {
                        this.getChildren(newNode, child);
                    }
                    newChild.push(child);
                }
                newNode.children = newChild;
            }
            return newNode.children;
        };
        NodeProperties.prototype.setShape = function (newNode, node) {
            switch (node.type) {
                case 'basic': {
                    var basicShape = (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1);
                    if (node.shape === 'path') {
                        newNode.shape = { type: 'Path', data: node.pathData };
                    }
                    else {
                        newNode.shape = {
                            type: 'Basic', shape: basicShape, cornerRadius: node.cornerRadius, points: node.points
                        };
                    }
                    break;
                }
                case 'flow': {
                    var flowShape = (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1);
                    newNode.shape = {
                        type: 'Flow', shape: flowShape
                    };
                    break;
                }
                case 'umlactivity':
                    newNode.shape = {
                        type: 'UmlActivity', shape: (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1)
                    };
                    break;
                case 'image':
                    newNode.shape = {
                        type: 'Image', source: node.source, align: this.getImageContentAlignment(node.contentAlignment),
                        scale: (node.scale).charAt(0).toUpperCase() + (node.scale).slice(1)
                    };
                    break;
                case 'html':
                    newNode.shape = { type: 'HTML' };
                    break;
                case 'native':
                    newNode.shape = { type: 'Native' };
                    break;
                case 'text':
                    newNode.shape = { type: 'Text', content: node.textBlock.text };
                    break;
                case 'bpmn':
                    newNode.shape = this.renderBpmnShape(newNode, node);
                    break;
                case 'group':
                    if (node.isSwimlane) {
                        newNode.shape = this.renderSwimlaneShape(newNode, node);
                    }
            }
            return newNode;
        };
        NodeProperties.prototype.getImageContentAlignment = function (option) {
            Eif (option) {
                switch (option) {
                    case 'xminymin':
                        return 'XMinYMin';
                    case 'xminymid':
                        return 'XMinYMid';
                    case 'xminymax':
                        return 'XMinYMax';
                    case 'xmidymin':
                        return 'XMidYMin';
                    case 'xmidymid':
                        return 'XMidYMid';
                    case 'xmidymax':
                        return 'XMidYMax';
                    case 'xmaxymin':
                        return 'XMaxYMin';
                    case 'xmaxymid':
                        return 'XMaxYMid';
                    case 'xmaxymax':
                        return 'XMaxYMax';
                    case 'none':
                        return 'None';
                }
            }
            return 'None';
        };
        NodeProperties.prototype.setNodeConstraints = function (constraints) {
            var nodeConstraints = enum_1.NodeConstraints.None;
            Eif (constraints & enum_1.NodeConstraints.Select) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Select;
            }
            if (constraints & enum_1.NodeConstraints.Delete) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Delete;
            }
            Eif (constraints & enum_1.NodeConstraints.Drag) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Drag;
            }
            Eif (constraints & enum_1.NodeConstraints.Rotate) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Rotate;
            }
            if (constraints & enum_1.NodeConstraints.ResizeNorthEast) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeNorthEast;
            }
            if (constraints & enum_1.NodeConstraints.ResizeEast) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeEast;
            }
            if (constraints & enum_1.NodeConstraints.OutConnect) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeSouthEast;
            }
            if (constraints & enum_1.NodeConstraints.Expandable) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeSouth;
            }
            if (constraints & enum_1.NodeConstraints.AllowDrop) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeSouthWest;
            }
            if (constraints & enum_1.NodeConstraints.ResizeNorthEast) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeWest;
            }
            if (constraints & enum_1.NodeConstraints.ResizeEast) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeNorthWest;
            }
            Eif (constraints & enum_1.NodeConstraints.ResizeNorth) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.ResizeNorth;
            }
            Eif (constraints & enum_1.NodeConstraints.Resize) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Resize;
            }
            Eif (constraints & enum_1.NodeConstraints.Shadow) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Shadow;
            }
            Iif (constraints & enum_1.NodeConstraints.AspectRatio) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.AspectRatio;
            }
            if (constraints & enum_1.NodeConstraints.AllowDrop) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.AllowDrop;
            }
            Iif (constraints & enum_1.NodeConstraints.InheritTooltip) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.InheritTooltip;
            }
            if (constraints & enum_1.NodeConstraints.PointerEvents) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.PointerEvents;
            }
            Eif (constraints & enum_1.NodeConstraints.Inherit) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Inherit;
            }
            Eif (constraints & enum_1.NodeConstraints.Default) {
                nodeConstraints = nodeConstraints | enum_1.NodeConstraints.Default;
            }
            return nodeConstraints;
        };
        NodeProperties.prototype.setGradient = function (gradient) {
            var newGradient = {};
            Eif (gradient) {
                if (gradient.type === 'linear') {
                    newGradient = {
                        type: 'Linear',
                        x1: gradient.x1, x2: gradient.x2, y1: gradient.y1, y2: gradient.y2,
                        stops: this.getGradientStops(gradient.stops)
                    };
                }
                else Eif (gradient.type === 'radial') {
                    newGradient = {
                        type: 'Radial',
                        cx: gradient.cx, cy: gradient.cy, fx: gradient.fx, fy: gradient.fy,
                        stops: this.getGradientStops(gradient.stops)
                    };
                }
            }
            return newGradient;
        };
        NodeProperties.prototype.getGradientStops = function (gradientStops) {
            var stopsCollection = [];
            for (var i = 0; i < gradientStops.length; i++) {
                var newStop = {};
                var stop_1 = gradientStops[parseInt(i.toString(), 10)];
                newStop.color = stop_1.color;
                newStop.offset = stop_1.offset;
                stopsCollection.push(newStop);
            }
            return stopsCollection;
        };
        NodeProperties.prototype.renderBpmnShape = function (newNode, node) {
            if (node.shape === 'event') {
                newNode.shape = {
                    type: 'Bpmn',
                    shape: (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1),
                    event: {
                        event: (node.event).charAt(0).toUpperCase() + (node.event).slice(1),
                        trigger: (node.trigger).charAt(0).toUpperCase() + (node.trigger).slice(1)
                    }
                };
            }
            else if (node.shape === 'gateway') {
                newNode.shape = {
                    type: 'Bpmn',
                    shape: (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1),
                    gateway: {
                        type: (node.gateway).charAt(0).toUpperCase() + (node.gateway).slice(1)
                    }
                };
            }
            else if (node.shape === 'activity') {
                newNode.shape = {
                    type: 'Bpmn',
                    shape: (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1),
                    activity: {
                        activity: (node.activity).charAt(0).toUpperCase() + (node.activity).slice(1)
                    }
                };
                newNode.shape.activity.activity = newNode.shape.activity.activity === 'Subprocess' ? 'SubProcess' : newNode.shape.activity.activity;
                if (node.activity === 'task') {
                    newNode.shape.activity.task = {
                        type: (node.task.type).charAt(0).toUpperCase() + (node.task.type).slice(1),
                        loop: (node.task.loop).charAt(0).toUpperCase() + (node.task.loop).slice(1),
                        compensation: node.task.compensation,
                        call: node.task.call
                    };
                }
                if (node.activity === 'subprocess') {
                    if (node.subProcess.type === 'event') {
                        newNode.shape.activity.subProcess = {
                            collapsed: node.subProcess.collapsed,
                            compensation: node.subProcess.compensation,
                            adhoc: node.subProcess.adhoc,
                            loop: (node.subProcess.loop).charAt(0).toUpperCase() + (node.subProcess.loop).slice(1),
                            boundary: (node.subProcess.boundary).charAt(0).toUpperCase() + (node.subProcess.boundary).slice(1),
                            type: (node.subProcess.type).charAt(0).toUpperCase() + (node.subProcess.type).slice(1),
                            event: {
                                event: (node.subProcess.event).charAt(0).toUpperCase() + (node.subProcess.event).slice(1),
                                trigger: (node.subProcess.trigger).charAt(0).toUpperCase() + (node.subProcess.trigger).slice(1)
                            }
                        };
                    }
                    else Eif (node.subProcess.type === 'transaction') {
                        newNode.shape.activity.subProcess = {
                            collapsed: node.subProcess.collapsed,
                            compensation: node.subProcess.compensation,
                            adhoc: node.subProcess.adhoc,
                            loop: (node.subProcess.loop).charAt(0).toUpperCase() + (node.subProcess.loop).slice(1),
                            boundary: (node.subProcess.boundary).charAt(0).toUpperCase() + (node.subProcess.boundary).slice(1),
                            type: (node.subProcess.type).charAt(0).toUpperCase() + (node.subProcess.type).slice(1),
                            events: this.renderEventsCollection(node.subProcess.events),
                            processes: this.renderProcessesCollection(node)
                        };
                    }
                }
            }
            else if (node.shape === 'dataobject') {
                newNode.shape = {
                    type: 'Bpmn',
                    shape: (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1)
                };
                if (node.annotation) {
                    newNode.shape.annotation = {
                        text: node.annotation.text,
                        angle: node.annotation.angle,
                        width: node.annotation.width,
                        height: node.annotation.height,
                        length: node.annotation.length
                    };
                }
            }
            else {
                newNode.shape = {
                    type: 'Bpmn',
                    shape: (node.shape).charAt(0).toUpperCase() + (node.shape).slice(1)
                };
            }
            return newNode.shape;
        };
        NodeProperties.prototype.renderSwimlaneShape = function (newNode, node) {
            newNode.shape = {
                type: 'SwimLane', orientation: (node.orientation).charAt(0).toUpperCase() + (node.orientation).slice(1),
                header: {
                    annotation: { content: node.header.text },
                    height: 50, style: { fontSize: node.header.fontSize, color: node.header.fontColor, fill: node.header.fillColor }
                }
            };
            var lanes = [];
            var phases = [];
            for (var i = 0; i < node.lanes.length; i++) {
                lanes[parseInt(i.toString(), 10)] = {
                    header: {
                        annotation: {
                            content: node.lanes[parseInt(i.toString(), 10)].header.text,
                            width: node.lanes[parseInt(i.toString(), 10)].header.width,
                            style: {
                                fontSize: node.lanes[parseInt(i.toString(), 10)].header.fontSize,
                                color: node.lanes[parseInt(i.toString(), 10)].header.fontColor
                            }
                        }
                    },
                    style: { fill: node.lanes[parseInt(i.toString(), 10)].fillColor },
                    children: []
                };
                for (var j = 0; j < node.lanes[parseInt(i.toString(), 10)].children.length; j++) {
                    var childNode = this.convertToNode(node.lanes[parseInt(i.toString(), 10)].children[parseInt(j.toString(), 10)]);
                    Eif (childNode.wrapper == null) {
                        childNode.wrapper = {
                            actualSize: { width: childNode.width, height: childNode.height },
                            offsetX: childNode.offsetX, offsetY: childNode.offsetY
                        };
                    }
                    lanes[parseInt(i.toString(), 10)].children.push(childNode);
                }
            }
            for (var i = 0; i < node.phases.length; i++) {
                phases[parseInt(i.toString(), 10)] = {
                    header: {
                        annotation: {
                            content: node.phases[parseInt(i.toString(), 10)].label.text,
                            style: { fill: node.phases[parseInt(i.toString(), 10)].label.fillColor, fontSize: node.phases[parseInt(i.toString(), 10)].label.fontSize, color: node.phases[parseInt(i.toString(), 10)].label.fontColor }
                        }
                    },
                    offset: node.phases[parseInt(i.toString(), 10)].offset,
                    style: { fill: node.phases[parseInt(i.toString(), 10)].fillColor, strokeColor: node.phases[parseInt(i.toString(), 10)].lineColor, strokeDashArray: node.phases[parseInt(i.toString(), 10)].lineDashArray }
                };
            }
            newNode.shape.lanes = lanes;
            newNode.shape.phases = phases;
            return newNode.shape;
        };
        NodeProperties.prototype.renderEventsCollection = function (subProcessEvents) {
            var eventsCollection = [];
            Eif (subProcessEvents.length > 0) {
                for (var i = 0; i < subProcessEvents.length; i++) {
                    var newEvent = {};
                    var eventObject = subProcessEvents[parseInt(i.toString(), 10)];
                    newEvent.event = (eventObject.event).charAt(0).toUpperCase() + (eventObject.event).slice(1);
                    newEvent.trigger = (eventObject.trigger).charAt(0).toUpperCase() + (eventObject.trigger).slice(1);
                    newEvent.offset = { x: eventObject.offset.x, y: eventObject.offset.y };
                    eventsCollection.push(newEvent);
                }
            }
            return eventsCollection;
        };
        NodeProperties.prototype.renderProcessesCollection = function (node) {
            var processesCollection = [];
            Eif (node.subProcess && node.subProcess.processes.length > 0) {
                for (var i = 0; i < node.subProcess.processes.length; i++) {
                    var processObject = node.subProcess.processes[parseInt(i.toString(), 10)];
                    var data = this.convertToNode(processObject);
                    processesCollection.push(data);
                }
            }
            return processesCollection;
        };
        NodeProperties.prototype.getModuleName = function () {
            return 'NodeProperties';
        };
        return NodeProperties;
    }());
    exports.NodeProperties = NodeProperties;
});