UNPKG

@zklogic/draw.io

Version:

Draw.IO - Graph Editor integration in Angular-cli

1 lines 29.5 kB
function mxShapeEREntity(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeEREntityExt(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERAttribute(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERHas(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERCloud(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERHierarchy(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERNote(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERChen(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERBachman(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERInfEng(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERRRect(n,t,e,o){mxShape.call(this),this.bounds=n,this.fill=t,this.stroke=e,this.strokewidth=null!=o?o:1}function mxShapeERAnchor(n,t,e,o){mxShape.call(this),this.bounds=n}mxUtils.extend(mxShapeEREntity,mxShape),mxShapeEREntity.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","Entity"),a=mxUtils.getValue(this.style,"textColor","#666666"),m=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,20),i=Math.max(i,20),this.background(n,t,e,o,i,10,a),n.setShadow(!1),this.mainText(n,t,e,o,i,s,m,a)},mxShapeEREntity.prototype.background=function(n,t,e,o,i,s,a){var m=mxUtils.getValue(this.style,"buttonStyle","round").toString();if("round"===m)n.begin(),n.moveTo(0,s),n.arcTo(s,s,0,0,1,s,0),n.lineTo(o-s,0),n.arcTo(s,s,0,0,1,o,s),n.lineTo(o,i-s),n.arcTo(s,s,0,0,1,o-s,i),n.lineTo(s,i),n.arcTo(s,s,0,0,1,0,i-s),n.close(),n.fillAndStroke();else if("rect"===m)n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke();else if("dblFrame"===m){var x=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#ffffff");n.setFillColor(x),n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke(),s=Math.min(o,i),n.begin(),n.moveTo(.1*s,.1*s),n.lineTo(o-.1*s,.1*s),n.lineTo(o-.1*s,i-.1*s),n.lineTo(.1*s,i-.1*s),n.close(),n.stroke()}},mxShapeEREntity.prototype.mainText=function(n,t,e,o,i,s,a,m){n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*o,.5*i,0,0,s,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.entity",mxShapeEREntity),mxShapeEREntity.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeEREntityExt,mxShape),mxShapeEREntityExt.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","Entity"),a=mxUtils.getValue(this.style,"subText","+ attribute 1,+ attribute 2,+ attribute 3").toString().split(","),m=mxUtils.getValue(this.style,mxConstants.STYLE_STROKECOLOR,"#666666"),x=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17"),l=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#008cff"),r=mxUtils.getValue(this.style,"fillColor2","#ffffff"),C=0;n.translate(t,e);for(var h=1.25*x,T=0;T<a.length;T++){var c=mxUtils.getSizeForString(a[T],x,mxConstants.DEFAULT_FONTFAMILY).width;c>C&&(C=c)}o=Math.max(o,20,C+10),i=Math.max(i,20,(a.length+1)*h),this.background(n,t,e,o,i,10),n.setShadow(!1),this.shapes(n,t,e,o,i,x,l,r,10,h),this.mainText(n,t,e,o,i,s,x,r),this.attrText(n,t,e,o,i,a,x,m,h,10)},mxShapeEREntityExt.prototype.background=function(n,t,e,o,i,s){var a=mxUtils.getValue(this.style,"buttonStyle","round").toString();n.begin(),"round"===a?(n.moveTo(0,s),n.arcTo(s,s,0,0,1,s,0),n.lineTo(o-s,0),n.arcTo(s,s,0,0,1,o,s),n.lineTo(o,i-s),n.arcTo(s,s,0,0,1,o-s,i),n.lineTo(s,i),n.arcTo(s,s,0,0,1,0,i-s)):"rect"===a&&(n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i)),n.close(),n.fillAndStroke()},mxShapeEREntityExt.prototype.mainText=function(n,t,e,o,i,s,a,m){n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*o,.5*a,0,0,s,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxShapeEREntityExt.prototype.shapes=function(n,t,e,o,i,s,a,m,x,l){var r=mxUtils.getValue(this.style,"buttonStyle","round").toString();"round"===r?(n.begin(),n.moveTo(0,x),n.arcTo(x,x,0,0,1,x,0),n.lineTo(o-x,0),n.arcTo(x,x,0,0,1,o,x),n.lineTo(o,l),n.lineTo(0,l),n.close(),n.fill(),n.setFillColor(m),n.begin(),n.moveTo(o,l),n.lineTo(o,i-x),n.arcTo(x,x,0,0,1,o-x,i),n.lineTo(x,i),n.arcTo(x,x,0,0,1,0,i-x),n.lineTo(0,l),n.close(),n.fill()):"rect"===r&&(n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,l),n.lineTo(0,l),n.close(),n.fill(),n.setFillColor(m),n.begin(),n.moveTo(0,l),n.lineTo(o,l),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fill()),n.begin(),"round"===r?(n.moveTo(0,x),n.arcTo(x,x,0,0,1,x,0),n.lineTo(o-x,0),n.arcTo(x,x,0,0,1,o,x),n.lineTo(o,i-x),n.arcTo(x,x,0,0,1,o-x,i),n.lineTo(x,i),n.arcTo(x,x,0,0,1,0,i-x)):"rect"===r&&(n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i)),n.close(),n.stroke()},mxShapeEREntityExt.prototype.attrText=function(n,t,e,o,i,s,a,m,x,l){for(var r=0;r<s.length;r++)n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*l,(r+1.5)*x,0,0,s[r],mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.entityExt",mxShapeEREntityExt),mxShapeEREntityExt.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeERAttribute,mxShape),mxShapeERAttribute.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","Entity"),a=mxUtils.getValue(this.style,"textColor","#666666"),m=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,20),i=Math.max(i,20),this.background(n,t,e,o,i,10,a),n.setShadow(!1),this.mainText(n,t,e,o,i,s,m,a)},mxShapeERAttribute.prototype.background=function(n,t,e,o,i,s,a){var m=mxUtils.getValue(this.style,"buttonStyle","simple").toString();if("simple"===m)n.begin(),n.ellipse(0,0,o,i),n.fillAndStroke();else if("dblFrame"===m){var x=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#666666");n.setFillColor(x),n.begin(),n.ellipse(0,0,o,i),n.fillAndStroke(),s=Math.min(o,i),n.begin(),n.ellipse(.1*s,.1*s,o-.2*s,i-.2*s),n.stroke()}},mxShapeERAttribute.prototype.mainText=function(n,t,e,o,i,s,a,m){n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*o,.5*i,0,0,s,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.attribute",mxShapeERAttribute),mxShapeERAttribute.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.144,.144),!1),new mxConnectionConstraint(new mxPoint(.856,.144),!1),new mxConnectionConstraint(new mxPoint(.856,.856),!1),new mxConnectionConstraint(new mxPoint(.144,.856),!1),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0)],mxUtils.extend(mxShapeERHas,mxShape),mxShapeERHas.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","Entity"),a=mxUtils.getValue(this.style,"textColor","#666666"),m=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,20),i=Math.max(i,20),this.background(n,t,e,o,i,10,a),n.setShadow(!1),this.mainText(n,t,e,o,i,s,m,a)},mxShapeERHas.prototype.background=function(n,t,e,o,i,s,a){var m=mxUtils.getValue(this.style,"buttonStyle","rhombus").toString();if("rhombus"===m)n.begin(),n.moveTo(0,.5*i),n.lineTo(.5*o,0),n.lineTo(o,.5*i),n.lineTo(.5*o,i),n.close(),n.fillAndStroke();else if("dblFrame"===m){var x=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#666666");n.setFillColor(x),n.begin(),n.moveTo(0,.5*i),n.lineTo(.5*o,0),n.lineTo(o,.5*i),n.lineTo(.5*o,i),n.close(),n.fillAndStroke(),n.begin(),n.moveTo(.1*o,.5*i),n.lineTo(.5*o,.1*i),n.lineTo(.9*o,.5*i),n.lineTo(.5*o,.9*i),n.close(),n.stroke()}},mxShapeERHas.prototype.mainText=function(n,t,e,o,i,s,a,m){n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*o,.5*i,0,0,s,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.has",mxShapeERHas),mxShapeERHas.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.75),!1),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.75,.75),!1)],mxUtils.extend(mxShapeERCloud,mxShape),mxShapeERCloud.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","Entity"),a=mxUtils.getValue(this.style,"textColor","#666666"),m=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,20),i=Math.max(i,20),this.background(n,t,e,o,i,10,a),n.setShadow(!1),this.mainText(n,t,e,o,i,s,m,a)},mxShapeERCloud.prototype.background=function(n,t,e,o,i,s,a){n.begin(),n.moveTo(.25*o,.25*i),n.curveTo(.05*o,.25*i,0,.5*i,.16*o,.55*i),n.curveTo(0,.66*i,.18*o,.9*i,.31*o,.8*i),n.curveTo(.4*o,i,.7*o,i,.8*o,.8*i),n.curveTo(o,.8*i,o,.6*i,.875*o,.5*i),n.curveTo(o,.3*i,.8*o,.1*i,.625*o,.2*i),n.curveTo(.5*o,.05*i,.3*o,.05*i,.25*o,.25*i),n.fillAndStroke()},mxShapeERCloud.prototype.mainText=function(n,t,e,o,i,s,a,m){n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*o,.5*i,0,0,s,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.cloud",mxShapeERCloud),mxShapeERCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.08,.5),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.1),!1),new mxConnectionConstraint(new mxPoint(.5,.92),!1),new mxConnectionConstraint(new mxPoint(.24,.24),!1),new mxConnectionConstraint(new mxPoint(.22,.8),!1),new mxConnectionConstraint(new mxPoint(.81,.2),!1),new mxConnectionConstraint(new mxPoint(.78,.78),!1)],mxUtils.extend(mxShapeERHierarchy,mxShape),mxShapeERHierarchy.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","main").toString().split(","),a=mxUtils.getValue(this.style,"subText","sub").toString().split(","),m=mxUtils.getValue(this.style,"textColor","#666666"),x=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,20),i=Math.max(i,20),this.background(n,t,e,o,i,10,m),n.setShadow(!1),this.shapeText(n,t,e,o,i,s,a,x,m)},mxShapeERHierarchy.prototype.background=function(n,t,e,o,i,s,a){var m=mxUtils.getValue(this.style,"buttonStyle","round").toString();if("round"===m)n.begin(),n.moveTo(0,s),n.arcTo(s,s,0,0,1,s,0),n.lineTo(o-s,0),n.arcTo(s,s,0,0,1,o,s),n.lineTo(o,i-s),n.arcTo(s,s,0,0,1,o-s,i),n.lineTo(s,i),n.arcTo(s,s,0,0,1,0,i-s),n.close(),n.fillAndStroke();else if("rect"===m)n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke();else if("dblFrame"===m){var x=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#666666");n.setFillColor(x),n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke(),s=Math.min(o,i),n.begin(),n.moveTo(.1*s,.1*s),n.lineTo(o-.1*s,.1*s),n.lineTo(o-.1*s,i-.1*s),n.lineTo(.1*s,i-.1*s),n.close(),n.stroke()}var l=0,r=0;"round"===m?(l=.5*o,r=s,n.translate(l,r),o=.5*o-s,i-=2*s,n.begin(),n.moveTo(0,s),n.arcTo(s,s,0,0,1,s,0),n.lineTo(o-s,0),n.arcTo(s,s,0,0,1,o,s),n.lineTo(o,i-s),n.arcTo(s,s,0,0,1,o-s,i),n.lineTo(s,i),n.arcTo(s,s,0,0,1,0,i-s),n.close(),n.fillAndStroke()):"rect"===m?(l=.5*o,r=s,n.translate(l,r),o=.5*o-s,i-=2*s,n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke()):"dblFrame"===m&&(l=.5*o,r=.15*s,n.translate(l,r),o=.5*o-.15*s,i-=.3*s,x=mxUtils.getValue(this.style,mxConstants.STYLE_FILLCOLOR,"#666666"),n.setFillColor(x),n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke(),s=Math.min(o,i),n.begin(),n.moveTo(.1*s,.1*s),n.lineTo(o-.1*s,.1*s),n.lineTo(o-.1*s,i-.1*s),n.lineTo(.1*s,i-.1*s),n.close(),n.stroke()),n.translate(-l,-r)},mxShapeERHierarchy.prototype.shapeText=function(n,t,e,o,i,s,a,m,x,l){n.begin(),n.setFontSize(m),n.setFontColor(x),n.text(.25*o,.5*(i-m),0,0,s[0],mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.25*o,.5*(i+m),0,0,s[1],mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.7*o,.5*(i-m),0,0,a[0],mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.7*o,.5*(i+m),0,0,a[1],mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.hierarchy",mxShapeERHierarchy),mxShapeERHierarchy.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeERNote,mxShape),mxShapeERNote.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"buttonText","Entity"),a=mxUtils.getValue(this.style,"textColor","#666666"),m=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17"),x=mxUtils.getValue(this.style,"fillColor2","#ffffff");n.translate(t,e),o=Math.max(o,40),i=Math.max(i,40),this.background(n,t,e,o,i,20),n.setShadow(!1),this.flipShape(n,t,e,o,i,20,x),this.mainText(n,t,e,o,i,s,m,a)},mxShapeERNote.prototype.background=function(n,t,e,o,i,s){n.begin(),n.moveTo(0,0),n.lineTo(o-s,0),n.lineTo(o,s),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke()},mxShapeERNote.prototype.flipShape=function(n,t,e,o,i,s,a){n.setLineJoin("round"),n.setFillColor(a),n.begin(),n.moveTo(o-s,0),n.lineTo(o,s),n.lineTo(o-s,s),n.close(),n.fillAndStroke()},mxShapeERNote.prototype.mainText=function(n,t,e,o,i,s,a,m){n.begin(),n.setFontSize(a),n.setFontColor(m),n.text(.5*o,.5*i,0,0,s,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.note",mxShapeERNote),mxShapeERNote.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeERChen,mxShape),mxShapeERChen.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"textColor","#666666"),a=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,40),i=Math.max(i,40),this.background(n,t,e,o,i),n.setShadow(!1),this.foreground(n,t,e,o,i,a,s)},mxShapeERChen.prototype.background=function(n,t,e,o,i){n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke()},mxShapeERChen.prototype.foreground=function(n,t,e,o,i,s,a){n.begin(),n.moveTo(0,.25*i),n.lineTo(o,.25*i),n.moveTo(0,.5*i),n.lineTo(o,.5*i),n.moveTo(0,.75*i),n.lineTo(o,.75*i),n.moveTo(.25*o,.5*i),n.lineTo(.25*o,i),n.moveTo(.5*o,.25*i),n.lineTo(.5*o,i),n.moveTo(.75*o,.5*i),n.lineTo(.75*o,i),n.stroke(),n.begin(),n.setFontSize(s),n.setFontColor(a),n.text(.5*o,.125*i,0,0,"ERD Peter Chen's Notation",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.setFontSize(.85*s),n.text(.25*o,.375*i,0,0,"Cardinality",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.75*o,.375*i,0,0,"Optionality",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.setFontSize(.7*s),n.text(.125*o,.625*i,0,0,"1",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.375*o,.625*i,0,0,"One",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.625*o,.625*i,0,0,"0",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.875*o,.625*i,0,0,"Optional",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.125*o,.875*i,0,0,"N",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.375*o,.875*i,0,0,"Many",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.625*o,.875*i,0,0,"1",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.875*o,.875*i,0,0,"Mandatory",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0)},mxCellRenderer.registerShape("mxgraph.er.chens",mxShapeERChen),mxShapeERChen.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeERBachman,mxShape),mxShapeERBachman.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"textColor","#666666"),a=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),this.background(n,t,e,o,i),n.setShadow(!1),this.foreground(n,t,e,o,i,a,s)},mxShapeERBachman.prototype.background=function(n,t,e,o,i){n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke()},mxShapeERBachman.prototype.foreground=function(n,t,e,o,i,s,a){n.begin(),n.moveTo(0,.125*i),n.lineTo(o,.125*i),n.moveTo(0,.25*i),n.lineTo(o,.25*i),n.moveTo(0,.375*i),n.lineTo(o,.375*i),n.moveTo(0,.5*i),n.lineTo(o,.5*i),n.moveTo(0,.625*i),n.lineTo(o,.625*i),n.moveTo(0,.75*i),n.lineTo(o,.75*i),n.moveTo(0,.875*i),n.lineTo(o,.875*i),n.moveTo(.5*o,.125*i),n.lineTo(.5*o,i),n.stroke(),n.begin(),n.setFontSize(s),n.setFontColor(a),n.text(.5*o,.0625*i,0,0,"ERD Bachman's Notation",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.setFontSize(.85*s),n.text(.52*o,.1875*i,0,0,"Relationship",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.3125*i,0,0,"Cardinality (One)",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.4375*i,0,0,"Cardinality (Many)",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.5625*i,0,0,"Mandatory, One",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.6875*i,0,0,"Mandatory, Many",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.8125*i,0,0,"Optional, One",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.9375*i,0,0,"Optional, Many",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);var m=mxUtils.getSizeForString("has/forms",s,mxConstants.DEFAULT_FONTFAMILY).width;n.begin(),n.moveTo(.04*o,.1875*i),n.lineTo(.25*o-.5*m,.1875*i),n.moveTo(.25*o+.5*m,.1875*i),n.lineTo(.46*o,.1875*i),n.text(.25*o,.1875*i,0,0,"has/forms",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,!0,0,0),n.moveTo(.04*o,.3125*i),n.lineTo(.46*o,.3125*i),n.moveTo(.04*o,.4375*i),n.lineTo(.46*o,.4375*i),n.moveTo(.46*o,.405*i),n.lineTo(.4*o,.4375*i),n.lineTo(.46*o,.47*i),n.moveTo(.04*o,.5625*i),n.lineTo(.46*o,.5625*i),n.moveTo(.38*o,.53*i),n.lineTo(.38*o,.595*i),n.moveTo(.04*o,.6875*i),n.lineTo(.46*o,.6875*i),n.moveTo(.46*o,.655*i),n.lineTo(.4*o,.6875*i),n.lineTo(.46*o,.72*i),n.moveTo(.38*o,.655*i),n.lineTo(.38*o,.72*i),n.moveTo(.04*o,.8125*i),n.lineTo(.46*o,.8125*i),n.moveTo(.04*o,.9375*i),n.lineTo(.46*o,.9375*i),n.moveTo(.46*o,.905*i),n.lineTo(.4*o,.9375*i),n.lineTo(.46*o,.97*i),n.stroke();var x=i/15;n.begin(),n.ellipse(.46*o-x,.8125*i-.5*x,x,x),n.fillAndStroke(),n.begin(),n.ellipse(.4*o-x,.9375*i-.5*x,x,x),n.fillAndStroke()},mxCellRenderer.registerShape("mxgraph.er.bachmans",mxShapeERBachman),mxShapeERBachman.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeERInfEng,mxShape),mxShapeERInfEng.prototype.paintVertexShape=function(n,t,e,o,i){var s=mxUtils.getValue(this.style,"textColor","#666666"),a=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,"17");n.translate(t,e),o=Math.max(o,i/1.5),i=Math.max(i,5*a),this.background(n,t,e,o,i),n.setShadow(!1),this.foreground(n,t,e,o,i,a,s)},mxShapeERInfEng.prototype.background=function(n,t,e,o,i){n.begin(),n.moveTo(0,0),n.lineTo(o,0),n.lineTo(o,i),n.lineTo(0,i),n.close(),n.fillAndStroke()},mxShapeERInfEng.prototype.foreground=function(n,t,e,o,i,s,a){n.begin(),n.moveTo(0,.2*i),n.lineTo(o,.2*i),n.moveTo(0,.4*i),n.lineTo(o,.4*i),n.moveTo(0,.6*i),n.lineTo(o,.6*i),n.moveTo(0,.8*i),n.lineTo(o,.8*i),n.moveTo(.5*o,.2*i),n.lineTo(.5*o,i),n.stroke(),n.begin(),n.setFontSize(s),n.setFontColor(a),n.text(.5*o,.1*i,0,0,"ERD Information Engineering Notation",mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.setFontSize(.85*s),n.text(.52*o,.3*i,0,0,"Zero or one",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.5*i,0,0,"One only",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.7*i,0,0,"Zero or more",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0),n.text(.52*o,.9*i,0,0,"One or more",mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,0,null,0,0,0);var m=i/12;n.begin(),n.moveTo(.04*o,.3*i),n.lineTo(.46*o,.3*i),n.moveTo(.46*o-m,.25*i),n.lineTo(.46*o-m,.35*i),n.moveTo(.04*o,.5*i),n.lineTo(.46*o,.5*i),n.moveTo(.46*o-2*m,.45*i),n.lineTo(.46*o-2*m,.55*i),n.moveTo(.46*o-2.5*m,.45*i),n.lineTo(.46*o-2.5*m,.55*i),n.moveTo(.04*o,.7*i),n.lineTo(.46*o,.7*i),n.moveTo(.46*o,.65*i),n.lineTo(.46*o-2*m,.7*i),n.lineTo(.46*o,.75*i),n.stroke(),n.moveTo(.04*o,.9*i),n.lineTo(.46*o,.9*i),n.moveTo(.46*o,.85*i),n.lineTo(.46*o-2*m,.9*i),n.lineTo(.46*o,.95*i),n.moveTo(.46*o-2.5*m,.85*i),n.lineTo(.46*o-2.5*m,.95*i),n.stroke(),n.begin(),n.ellipse(.46*o-3*m,.3*i-.5*m,m,m),n.fillAndStroke(),n.begin(),n.ellipse(.46*o-3*m,.7*i-.5*m,m,m),n.fillAndStroke()},mxCellRenderer.registerShape("mxgraph.er.ie",mxShapeERInfEng),mxShapeERInfEng.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxMarker.addMarker("ERone",(function(n,t,e,o,i,s,a,m,x,l){var r=i*(a+x+1),C=s*(a+x+1);return function(){n.begin(),n.moveTo(o.x-r/2-C/2,o.y-C/2+r/2),n.lineTo(o.x-r/2+C/2,o.y-C/2-r/2),n.stroke()}})),mxMarker.addMarker("ERmandOne",(function(n,t,e,o,i,s,a,m,x,l){var r=i*(a+x+1),C=s*(a+x+1);return function(){n.begin(),n.moveTo(o.x-r/2-C/2,o.y-C/2+r/2),n.lineTo(o.x-r/2+C/2,o.y-C/2-r/2),n.moveTo(o.x-r-C/2,o.y-C+r/2),n.lineTo(o.x-r+C/2,o.y-C-r/2),n.stroke()}})),mxMarker.addMarker("ERmany",(function(n,t,e,o,i,s,a,m,x,l){var r=i*(a+x+1),C=s*(a+x+1);return function(){n.begin(),n.moveTo(o.x+C/2,o.y-r/2),n.lineTo(o.x-r,o.y-C),n.lineTo(o.x-C/2,o.y+r/2),n.stroke()}})),mxMarker.addMarker("ERoneToMany",(function(n,t,e,o,i,s,a,m,x,l){var r=i*(a+x+1),C=s*(a+x+1);return function(){n.begin(),n.moveTo(o.x-r-C/2,o.y-C+r/2),n.lineTo(o.x-r+C/2,o.y-C-r/2),n.moveTo(o.x+C/2,o.y-r/2),n.lineTo(o.x-r,o.y-C),n.lineTo(o.x-C/2,o.y+r/2),n.stroke()}})),mxMarker.addMarker("ERzeroToMany",(function(n,t,e,o,i,s,a,m,x,l){var r=i*(a+x+1),C=s*(a+x+1),h=a/2,T=o.x,c=o.y;return l||(o.x-=2*r-i*x/2,o.y-=2*C-s*x/2),function(){if(n.begin(),n.ellipse(T-1.5*r-h,c-1.5*C-h,2*h,2*h),l){var e=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,"#666666");n.setFillColor("#ffffff"),n.fillAndStroke(),n.setFillColor(e)}else n.stroke();n.begin(),n.moveTo(T+C/2,c-r/2),n.lineTo(T-r,c-C),n.lineTo(T-C/2,c+r/2),l||(n.moveTo(T-r,c-C),n.lineTo(T,c)),n.stroke()}})),mxMarker.addMarker("ERzeroToOne",(function(n,t,e,o,i,s,a,m,x,l){var r=i*(a+x+1),C=s*(a+x+1),h=a/2,T=o.x,c=o.y;return l||(o.x-=2*r-i*x/2,o.y-=2*C-s*x/2),function(){if(n.begin(),n.ellipse(T-1.5*r-h,c-1.5*C-h,2*h,2*h),l){var e=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,"#666666");n.setFillColor("#ffffff"),n.fillAndStroke(),n.setFillColor(e)}else n.stroke();n.begin(),n.moveTo(T-r/2-C/2,c-C/2+r/2),n.lineTo(T-r/2+C/2,c-C/2-r/2),l||(n.moveTo(T-r-i*x/2,c-C-s*x/2),n.lineTo(T,c)),n.stroke()}})),mxUtils.extend(mxShapeERRRect,mxShape),mxShapeERRRect.prototype.cst={RRECT:"mxgraph.er.rrect",R_SIZE:"rSize"},mxShapeERRRect.prototype.customProperties=[{name:"rSize",dispName:"Rounding Size",type:"float"}],mxShapeERRRect.prototype.paintVertexShape=function(n,t,e,o,i){n.translate(t,e);var s=parseInt(mxUtils.getValue(this.style,mxShapeERRRect.prototype.cst.R_SIZE,"10"));n.roundrect(0,0,o,i,s),n.fillAndStroke()},mxCellRenderer.registerShape(mxShapeERRRect.prototype.cst.RRECT,mxShapeERRRect),mxShapeERRRect.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)],mxUtils.extend(mxShapeERAnchor,mxShape),mxShapeERAnchor.prototype.cst={ANCHOR:"mxgraph.er.anchor"},mxShapeERAnchor.prototype.paintVertexShape=function(n,t,e,o,i){},mxCellRenderer.registerShape(mxShapeERAnchor.prototype.cst.ANCHOR,mxShapeERAnchor);