diagram.lib.diagram.min_backup.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-base Show documentation
Show all versions of common-base Show documentation
DSL based modeling framework - facilities common base
var graph;function queryParameter(t){let e=window.location.search.substring(1).split("&");for(let n=0;n0&&t==e[n].substring(0,s))return e[n].substring(s+1).replace(/%22/g,"")}}function collectBases(t,e,n){let s=t.extends;if(void 0!==s)for(let t of e)if(t.name===s)return n.push(t),void collectBases(t,e,n)}function draw(t,e,n){let s,o,l={},a={},r=createDiagramData().content;for(let t of r)a[t.name]=t;let i=queryParameter("focused");if(void 0!==i)for(let t of r)t.name==i&&(s=t,(o=[]).push(t),collectBases(s,r,o));else o=r;let E=[];for(let n of o){void 0===l[n.name]&&drawObject(t,e,n,a,l,"object","title",E,void 0!==s,!1),n.extends}if(void 0!==s){n.execute(e);for(let n of E){t.insertEdge(e,null,"",n.from,n.to,n.style).edge=mxEdgeStyle.OrthConnector}new mxParallelEdgeLayout(t).execute(e)}else n.execute(e)}function drawObject(t,e,n,s,o,l,a,r,i,E){let S=void 0!==s[n.name];E&&(l="otherObject",a="otherTitle"),S||(l="exObject",a="exTitle");let T=80,C=[];if(void 0!==n.fields)for(let t of n.fields){let e={};void 0!==t.cardinality?"*"===t.cardinality?e.namePart=t.name+"*":e.namePart=t.name+"["+t.cardinality+"]":e.namePart=t.name,void 0!==t.type?e.typePart=t.type:void 0!==t.composition?(e.typePart=t.composition,e.association=!0):void 0!==t.aggregation&&(e.typePart=t.aggregation,e.association=!0,e.reference=!0),(i||!0!==e.association)&&(e.namePart=e.namePart+":"),e.nameWidth=mxUtils.getSizeForString(e.namePart).width,e.typeWidth=mxUtils.getSizeForString(e.typePart).width;let n=80;i||!0!==e.association?n=e.nameWidth+e.typeWidth+17:(e.nameWidth=e.nameWidth+5,n=e.nameWidth+e.typeWidth+37),C.push(e),T