From f8a8d5192b1e5013d9e2f699be54b072ef39d5f0 Mon Sep 17 00:00:00 2001 From: talasila Date: Wed, 8 Feb 2017 10:13:29 -0500 Subject: Initial OpenECOMP UI/DMaapBC commit Change-Id: Ia492e1b88311b9bed4c31f593b28deaaad73b7e4 Signed-off-by: talasila --- .../app/fusion/ase/scripts/arrayManipulation.js | 356 +++++++++++++++++++++ 1 file changed, 356 insertions(+) create mode 100644 dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js (limited to 'dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js') diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js new file mode 100644 index 0000000..2f041f3 --- /dev/null +++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/arrayManipulation.js @@ -0,0 +1,356 @@ + +//Contains functions to update, create and retrieve arrays. Also uses arrays to determine properties (lNode, rNode) of arrows + +var missingStarts = []; +var missingEnds = []; + +//Stores module's properties in its array +function storeXY (arrayType,id) { + 'use strict'; + var index; + for ( i = 0; i' + + '
'+ text +'
'+ + '
'+ + ''; + dropOffLocation = document.getElementById("nodeChildrenDroppedOffHere"); + dropOffLocation.innerHTML += tag; + var index = nodeArr.push([document.getElementById(id),id,text,parseInt(lX),parseInt(lY),wide,parseInt(lX)+parseInt(wide),parseInt(lY)]); + if (tosca_ID !==null){ + document.getElementById(id).setAttribute('taska_id',tosca_ID); + } + if ( text !== null ){ + document.getElementById(id).setAttribute('sname',text); + } + // When Role is added uncomment. + console.log(role); + if ( role !== null ){ + document.getElementById(id).setAttribute('role_id',role); + } + + if (isOverlapped(id) === true){ + shiftRight(document.getElementById(id),160); + } + if (isOverlapped(id) === false){ + for (i=0;i'+ + '
'+text+'
'+ + '
'+ + ''; + } + if (direction === "left"){ + tag = '
'+ + '
'+ + '
' + text + '
'+ + '
'; + } + if (direction === "self"){ + tag = '
'+ + '
'+ + '
' + text + '
'+ + '
'; + } + + + dropOffLocation = document.getElementById("arrowChildrenDroppedOffHere"); + dropOffLocation.innerHTML += tag; + arrowArr.push([document.getElementById(id),id,text,parseInt(lX),lY,parseInt(wide),parseInt(lX)+parseInt(wide),parseInt(lY),"","",arrowDescription]); + + determineLRNode(id,"arrow"); + } + if (arrayType == "noteArr"){ + tag = '
' + + text + + '
'; + dropOffLocation = document.getElementById("noteChildrenDroppedOffHere"); + dropOffLocation.innerHTML += tag; + noteArr.push([document.getElementById(id),id,text,parseInt(lX),parseInt(lY),wide,parseInt(lX)+parseInt(wide),parseInt(lY)+parseInt(height)]); + + } + +} + +var layers = {}; +var nodesInLayer = []; +function determineLayers () { + var doAgain = true; + layers.length = 0; + var layerNumber = -1; + while (doAgain === true){ + layerNumber++; + nodesInLayer.length = 0; + var classToAssign = 'layer'+layerNumber; + for (var i=0; i