@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 2.74 kB
JavaScript
function mxShapeCiscoSafeCompositeIcon(e,l,t,i){mxShape.call(this),this.bounds=e,this.fill=l,this.stroke=t,this.strokewidth=null!=i?i:1}mxUtils.extend(mxShapeCiscoSafeCompositeIcon,mxShape),mxShapeCiscoSafeCompositeIcon.prototype.cst={SHAPE_COMPOSITE_ICON:"mxgraph.cisco_safe.compositeIcon"},mxShapeCiscoSafeCompositeIcon.prototype.paintVertexShape=function(e,l,t,i,s){var a=mxUtils.getValue(this.state.style,"strokeColor","none"),o=mxUtils.getValue(this.state.style,"bgColor","#C2E0AE"),p=mxUtils.getValue(this.state.style,"fillColor","none"),r=mxUtils.getValue(this.state.style,"shadow",!1),c=parseFloat(mxUtils.getValue(this.state.style,"opacity",!1));e.translate(l,t);var h=mxUtils.getValue(this.state.style,"bgIcon",""),n=mxUtils.getValue(this.state.style,"resIcon","");if(null!=(f=mxStencilRegistry.getStencil(n))&&"mxgraph.cisco_safe.architecture.generic_appliance"!=h&&f.drawShape(e,this,0,0,i,s),e.setFillColor(a),e.setStrokeColor("none"),e.setShadow(!1),"ellipse"==h)e.begin(),i<100?e.ellipse(.01*i,.01*s,.98*i,.98*s):e.ellipse(1,1,i-2,s-2),e.fill();else if("threat1"==h)e.begin(),e.ellipse(.18*i,.16*s,.66*i,.65*s),e.fill();else if("threat2"==h)e.begin(),e.ellipse(.01*i,.01*s,.98*i,.6*s),e.fill();else if("threat3"==h)e.begin(),e.ellipse(.18*i,.2*s,.64*i,.79*s),e.fill();else if("threat4"==h)e.begin(),e.ellipse(.09*i,.03*s,.82*i,.77*s),e.fill();else if("threat5"==h)e.begin(),e.ellipse(.16*i,.01*s,.67*i,.72*s),e.fill();else if("mxgraph.cisco_safe.architecture.generic_appliance"==h)e.setShadow(r),e.setFillColor(o),e.begin(),e.moveTo(0,.3*s),e.arcTo(.3*i,.3*s,0,0,1,.3*i,0),e.lineTo(.7*i,0),e.arcTo(.3*i,.3*s,0,0,1,i,.3*s),e.lineTo(i,.7*s),e.arcTo(.3*i,.3*s,0,0,1,.7*i,s),e.lineTo(.3*i,s),e.arcTo(.3*i,.3*s,0,0,1,0,.7*s),e.close(),e.fill(),e.setShadow(!1),e.setFillColor(a),null!=(f=mxStencilRegistry.getStencil(h))&&f.drawShape(e,this,.26*i,.26*s,.48*i,.48*s),e.setAlpha(.5),e.setFillColor("#ffffff"),e.ellipse(.105*i,.48*s,.04*i,.04*s),e.fill(),e.ellipse(.855*i,.48*s,.04*i,.04*s),e.fill(),e.ellipse(.48*i,.105*s,.04*i,.04*s),e.fill(),e.ellipse(.48*i,.855*s,.04*i,.04*s),e.fill(),e.ellipse(.17*i,.17*s,.04*i,.04*s),e.fill(),e.ellipse(.79*i,.17*s,.04*i,.04*s),e.fill(),e.ellipse(.79*i,.79*s,.04*i,.04*s),e.fill(),e.ellipse(.17*i,.79*s,.04*i,.04*s),e.fill(),e.setAlpha(c/100);else{var f;null!=(f=mxStencilRegistry.getStencil(h))&&(i<100?f.drawShape(e,this,.01*i,.01*s,.98*i,.98*s):f.drawShape(e,this,1,1,i-2,s-2))}null!=(f=mxStencilRegistry.getStencil(n))&&(e.setFillColor(p),"mxgraph.cisco_safe.architecture.generic_appliance"==h?f.drawShape(e,this,.25*i,.25*s,.5*i,.5*s):f.drawShape(e,this,0,0,i,s))},mxCellRenderer.registerShape(mxShapeCiscoSafeCompositeIcon.prototype.cst.SHAPE_COMPOSITE_ICON,mxShapeCiscoSafeCompositeIcon);