clone

a browser-first diagram editor with live svg previews, local drafts and encrypted, accountless sharing

main
diagramzip / renderers / browser-run / frames / diagramsnet / vendor / assets / shapes / mxKubernetes.js
mxKubernetes.js 17.0K
1/**2 * Copyright (c) 2006-2020, JGraph Holdings Ltd3 */4//**********************************************************************************************************************************************************5// Kubernetes icon6//**********************************************************************************************************************************************************7/**8* Extends mxShape.9*/10function mxShapeKubernetesIcon(bounds, fill, stroke, strokewidth)11{12 mxShape.call(this);13 this.bounds = bounds;14 this.fill = fill;15 this.stroke = stroke;16 this.strokewidth = (strokewidth != null) ? strokewidth : 1;17};1819/**20* Extends mxShape.21*/22mxUtils.extend(mxShapeKubernetesIcon, mxShape);2324mxShapeKubernetesIcon.prototype.cst = {25 ICON : 'mxgraph.kubernetes.icon'26};2728mxShapeKubernetesIcon.prototype.customProperties = [29 {name: 'prIcon', dispName: 'Type', defVal: 'api', type: 'enum', 30 enumList: [{val: 'c_c_m', dispName: 'C-C-M'},31 {val: 'c_m', dispName: 'C-M'},32 {val: 'c_role', dispName: 'C-Role'},33 {val: 'cm', dispName: 'CM'},34 {val: 'crb', dispName: 'CRB'},35 {val: 'crd', dispName: 'CRD'},36 {val: 'cronjob', dispName: 'Cronjob'},37 {val: 'deploy', dispName: 'Deploy'},38 {val: 'ds', dispName: 'DS'},39 {val: 'ep', dispName: 'EP'},40 {val: 'etcd', dispName: 'ETCD'},41 {val: 'group', dispName: 'Group'},42 {val: 'hpa', dispName: 'HPA'},43 {val: 'ing', dispName: 'ING'},44 {val: 'job', dispName: 'Job'},45 {val: 'k_proxy', dispName: 'K-Proxy'},46 {val: 'kubelet', dispName: 'Kubelet'},47 {val: 'limits', dispName: 'Limits'},48 {val: 'master', dispName: 'Master'},49 {val: 'netpol', dispName: 'Netpol'},50 {val: 'node', dispName: 'Node'},51 {val: 'ns', dispName: 'NS'},52 {val: 'pod', dispName: 'Pod'},53 {val: 'psp', dispName: 'PSP'},54 {val: 'pv', dispName: 'PV'},55 {val: 'pvc', dispName: 'PVC'},56 {val: 'quota', dispName: 'Quota'},57 {val: 'rb', dispName: 'RB'},58 {val: 'role', dispName: 'Role'},59 {val: 'rs', dispName: 'RS'},60 {val: 'sa', dispName: 'SA'},61 {val: 'sc', dispName: 'SC'},62 {val: 'sched', dispName: 'Sched'},63 {val: 'secret', dispName: 'Secret'},64 {val: 'sts', dispName: 'STS'},65 {val: 'svc', dispName: 'SVC'},66 {val: 'user', dispName: 'User'},67 {val: 'vol', dispName: 'Vol'}]}68];697071/**72* Function: paintVertexShape73* 74* Paints the vertex shape.75*/76mxShapeKubernetesIcon.prototype.paintVertexShape = function(c, x, y, w, h)77{78 var prIcon = mxUtils.getValue(this.state.style, 'prIcon', '');79 80 var fillColor = mxUtils.getValue(this.state.style, 'fillColor', '#ffffff');81 var strokeColor = mxUtils.getValue(this.state.style, 'strokeColor', '#ffffff');8283 c.translate(x, y);84 85 var frame = mxStencilRegistry.getStencil('mxgraph.kubernetes.frame');86 87 c.setFillColor(strokeColor);88 frame.drawShape(c, this, 0, 0, w, h);8990 c.setFillColor(fillColor);91 frame.drawShape(c, this, w * 0.03, h * 0.03, w * 0.94, h * 0.94);92 93 var prStencil = mxStencilRegistry.getStencil('mxgraph.kubernetes.' + prIcon);94 95 if (prStencil != null)96 {97 c.setFillColor(strokeColor);98 prStencil.drawShape(c, this, w * 0.2, h * 0.2, w * 0.6, h * 0.6);99 }100};101102mxCellRenderer.registerShape(mxShapeKubernetesIcon.prototype.cst.ICON, mxShapeKubernetesIcon);103104mxShapeKubernetesIcon.prototype.getConstraints = function(style, w, h)105{106 var constr = [];107 var r = Math.min(h * 0.5, w * 0.5);108 109 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));110111 return (constr);112}113114/**115 * Copyright (c) 2006-2020, JGraph Holdings Ltd116 */117//**********************************************************************************************************************************************************118// Kubernetes icon 2119//**********************************************************************************************************************************************************120/**121* Extends mxShape.122*/123function mxShapeKubernetesIcon2(bounds, fill, stroke, strokewidth)124{125 mxShape.call(this);126 this.bounds = bounds;127 this.fill = fill;128 this.stroke = stroke;129 this.strokewidth = (strokewidth != null) ? strokewidth : 1;130};131132/**133* Extends mxShape.134*/135mxUtils.extend(mxShapeKubernetesIcon2, mxShape);136137mxShapeKubernetesIcon2.prototype.cst = {138 ICON2 : 'mxgraph.kubernetes.icon2'139};140141mxShapeKubernetesIcon2.prototype.customProperties = [142 {name: 'kubernetesLabel', dispName: 'Label', type: 'boolean', defVal:0},143 {name: 'prIcon', dispName: 'Type', defVal: 'api', type: 'enum', 144 enumList: [{val: 'api', dispName: 'API'},145 {val: 'c_c_m', dispName: 'C-C-M'},146 {val: 'cm', dispName: 'CM'},147 {val: 'c_m', dispName: 'C-M'},148 {val: 'c_role', dispName: 'C-Role'},149 {val: 'control_plane', dispName: 'Control Plane'},150 {val: 'crb', dispName: 'CRB'},151 {val: 'crd', dispName: 'CRD'},152 {val: 'cronjob', dispName: 'Cronjob'},153 {val: 'deploy', dispName: 'Deploy'},154 {val: 'ds', dispName: 'DS'},155 {val: 'ep', dispName: 'EP'},156 {val: 'etcd', dispName: 'ETCD'},157 {val: 'group', dispName: 'Group'},158 {val: 'hpa', dispName: 'HPA'},159 {val: 'ing', dispName: 'ING'},160 {val: 'job', dispName: 'Job'},161 {val: 'k_proxy', dispName: 'K-Proxy'},162 {val: 'kubelet', dispName: 'Kubelet'},163 {val: 'limits', dispName: 'Limits'},164 {val: 'netpol', dispName: 'Netpol'},165 {val: 'node', dispName: 'Node'},166 {val: 'ns', dispName: 'NS'},167 {val: 'pod', dispName: 'Pod'},168 {val: 'psp', dispName: 'PSP'},169 {val: 'pv', dispName: 'PV'},170 {val: 'pvc', dispName: 'PVC'},171 {val: 'quota', dispName: 'Quota'},172 {val: 'rb', dispName: 'RB'},173 {val: 'role', dispName: 'Role'},174 ]}175];176177178/**179* Function: paintVertexShape180* 181* Paints the vertex shape.182*/183mxShapeKubernetesIcon2.prototype.paintVertexShape = function(c, x, y, w, h)184{185 var prIcon = mxUtils.getValue(this.state.style, 'prIcon', '');186 187 var fillColor = mxUtils.getValue(this.state.style, 'fillColor', '#ffffff');188 var strokeColor = mxUtils.getValue(this.state.style, 'strokeColor', '#ffffff');189 var hasLabel = mxUtils.getValue(this.state.style, 'kubernetesLabel', 0);190191 c.translate(x, y);192 193 var frame = mxStencilRegistry.getStencil('mxgraph.kubernetes.frame');194 195 c.setFillColor(strokeColor);196 frame.drawShape(c, this, 0, 0, w, h);197198 c.setFillColor(fillColor);199 frame.drawShape(c, this, w * 0.03, h * 0.03, w * 0.94, h * 0.94);200 201 var prStencil = mxStencilRegistry.getStencil('mxgraph.kubernetes2.' + prIcon);202 c.setFillColor(strokeColor);203 c.setFontColor(strokeColor);204 c.setFontSize(Math.min(w, h) * 0.2);205 206 var w2 = Math.min(h, w);207 var h2 = w2;208 209 if (hasLabel == 1)210 {211 w2 = w2 * 0.8;212 h2 = w2 * 0.9;213 }214 215 if (prIcon == 'api')216 {217 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);218219 if (hasLabel == 1)220 {221 c.text(w * 0.5, h * 0.75, 0, 0, 'api', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);222 }223 }224 else if (prIcon == 'c_c_m')225 {226 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);227228 if (hasLabel == 1)229 {230 c.text(w * 0.5, h * 0.75, 0, 0, 'c-c-m', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);231 }232 }233 else if (prIcon == 'cm')234 {235 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.25, w2 * 0.6, h2 * 0.5);236237 if (hasLabel == 1)238 {239 c.text(w * 0.5, h * 0.75, 0, 0, 'cm', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);240 }241 }242 else if (prIcon == 'c_m')243 {244 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);245246 if (hasLabel == 1)247 {248 c.text(w * 0.5, h * 0.75, 0, 0, 'c-m', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);249 }250 }251 else if (prIcon == 'c_role')252 {253 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.25, h * 0.2, w2 * 0.5, h2 * 0.6);254255 if (hasLabel == 1)256 {257 c.text(w * 0.5, h * 0.75, 0, 0, 'c-role', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);258 }259 }260 else if (prIcon == 'control_plane')261 {262 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);263264 if (hasLabel == 1)265 {266 c.setFontSize(Math.min(w, h) * 0.12);267 c.text(w * 0.5, h * 0.78, 0, 0, 'control\nplane', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);268 }269 }270 else if (prIcon == 'crb')271 {272 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.25, h * 0.3, w2 * 0.5, h2 * 0.3);273274 if (hasLabel == 1)275 {276 c.text(w * 0.5, h * 0.75, 0, 0, 'crb', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);277 }278 }279 else if (prIcon == 'crd')280 {281 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.25, h * 0.2, w2 * 0.6, h2 * 0.6);282283 if (hasLabel == 1)284 {285 c.text(w * 0.5, h * 0.75, 0, 0, 'crd', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);286 }287 }288 else if (prIcon == 'cronjob')289 {290 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);291292 if (hasLabel == 1)293 {294 c.text(w * 0.5, h * 0.75, 0, 0, 'cronjob', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);295 }296 }297 else if (prIcon == 'deploy')298 {299 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.27, h * 0.25, w2 * 0.6, h2 * 0.55);300301 if (hasLabel == 1)302 {303 c.text(w * 0.5, h * 0.75, 0, 0, 'deploy', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);304 }305 }306 else if (prIcon == 'ds')307 {308 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);309310 if (hasLabel == 1)311 {312 c.text(w * 0.5, h * 0.75, 0, 0, 'ds', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);313 }314 }315 else if (prIcon == 'ep')316 {317 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);318319 if (hasLabel == 1)320 {321 c.text(w * 0.5, h * 0.75, 0, 0, 'ep', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);322 }323 }324 else if (prIcon == 'etcd')325 {326 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);327328 if (hasLabel == 1)329 {330 c.text(w * 0.5, h * 0.75, 0, 0, 'etcd', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);331 }332 }333 else if (prIcon == 'group')334 {335 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);336337 if (hasLabel == 1)338 {339 c.text(w * 0.5, h * 0.75, 0, 0, 'group', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);340 }341 }342 else if (prIcon == 'hpa')343 {344 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.4, h * 0.1, w2 * 0.8, h2 * 0.8);345346 if (hasLabel == 1)347 {348 c.text(w * 0.5, h * 0.75, 0, 0, 'hpa', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);349 }350 }351 else if (prIcon == 'ing')352 {353 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);354355 if (hasLabel == 1)356 {357 c.text(w * 0.5, h * 0.75, 0, 0, 'ing', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);358 }359 }360 else if (prIcon == 'job')361 {362 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);363364 if (hasLabel == 1)365 {366 c.text(w * 0.5, h * 0.75, 0, 0, 'job', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);367 }368 }369 else if (prIcon == 'k_proxy')370 {371 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);372373 if (hasLabel == 1)374 {375 c.text(w * 0.5, h * 0.75, 0, 0, 'k-proxy', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);376 }377 }378 else if (prIcon == 'kubelet')379 {380 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);381382 if (hasLabel == 1)383 {384 c.text(w * 0.5, h * 0.75, 0, 0, 'kubelet', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);385 }386 }387 else if (prIcon == 'limits')388 {389 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);390391 if (hasLabel == 1)392 {393 c.text(w * 0.5, h * 0.75, 0, 0, 'limits', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);394 }395 }396 else if (prIcon == 'netpol')397 {398 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);399400 if (hasLabel == 1)401 {402 c.text(w * 0.5, h * 0.75, 0, 0, 'netpol', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);403 }404 }405 else if (prIcon == 'node')406 {407 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);408409 if (hasLabel == 1)410 {411 c.text(w * 0.5, h * 0.75, 0, 0, 'node', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);412 }413 }414 else if (prIcon == 'ns')415 {416 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);417418 if (hasLabel == 1)419 {420 c.text(w * 0.5, h * 0.75, 0, 0, 'ns', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);421 }422 }423 else if (prIcon == 'pod')424 {425 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);426427 if (hasLabel == 1)428 {429 c.text(w * 0.5, h * 0.75, 0, 0, 'pod', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);430 }431 }432 else if (prIcon == 'psp')433 {434 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);435436 if (hasLabel == 1)437 {438 c.text(w * 0.5, h * 0.75, 0, 0, 'psp', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);439 }440 }441 else if (prIcon == 'pv')442 {443 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);444445 if (hasLabel == 1)446 {447 c.text(w * 0.5, h * 0.75, 0, 0, 'pv', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);448 }449 }450 else if (prIcon == 'pvc')451 {452 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);453454 if (hasLabel == 1)455 {456 c.text(w * 0.5, h * 0.75, 0, 0, 'pvc', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);457 }458 }459 else if (prIcon == 'quota')460 {461 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);462463 if (hasLabel == 1)464 {465 c.text(w * 0.5, h * 0.75, 0, 0, 'quota', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);466 }467 }468 else if (prIcon == 'rb')469 {470 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);471472 if (hasLabel == 1)473 {474 c.text(w * 0.5, h * 0.75, 0, 0, 'rb', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);475 }476 }477 else if (prIcon == 'role')478 {479 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);480481 if (hasLabel == 1)482 {483 c.text(w * 0.5, h * 0.75, 0, 0, 'role', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);484 }485 }486 else if (prIcon == 'rs')487 {488 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);489490 if (hasLabel == 1)491 {492 c.text(w * 0.5, h * 0.75, 0, 0, 'rs', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);493 }494 }495 else if (prIcon == 'sa')496 {497 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);498499 if (hasLabel == 1)500 {501 c.text(w * 0.5, h * 0.75, 0, 0, 'sa', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);502 }503 }504 else if (prIcon == 'sc')505 {506 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);507508 if (hasLabel == 1)509 {510 c.text(w * 0.5, h * 0.75, 0, 0, 'sc', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);511 }512 }513 else if (prIcon == 'sched')514 {515 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);516517 if (hasLabel == 1)518 {519 c.text(w * 0.5, h * 0.75, 0, 0, 'sched', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);520 }521 }522 else if (prIcon == 'secret')523 {524 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);525526 if (hasLabel == 1)527 {528 c.text(w * 0.5, h * 0.75, 0, 0, 'secret', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);529 }530 }531 else if (prIcon == 'sts')532 {533 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);534535 if (hasLabel == 1)536 {537 c.text(w * 0.5, h * 0.75, 0, 0, 'sts', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);538 }539 }540 else if (prIcon == 'svc')541 {542 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);543544 if (hasLabel == 1)545 {546 c.text(w * 0.5, h * 0.75, 0, 0, 'svc', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);547 }548 }549 else if (prIcon == 'user')550 {551 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);552553 if (hasLabel == 1)554 {555 c.text(w * 0.5, h * 0.75, 0, 0, 'user', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);556 }557 }558 else if (prIcon == 'vol')559 {560 prStencil.drawShape(c, this, w * 0.5 - w2 * 0.3, h * 0.2, w2 * 0.6, h2 * 0.6);561562 if (hasLabel == 1)563 {564 c.text(w * 0.5, h * 0.75, 0, 0, 'vol', mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, 0, null, 0, 0, 0);565 }566 }567 else if (prStencil != null)568 {569 prStencil.drawShape(c, this, w * 0.2, h * 0.2, w * 0.6, h * 0.6);570 }571};572573mxCellRenderer.registerShape(mxShapeKubernetesIcon2.prototype.cst.ICON2, mxShapeKubernetesIcon2);574575mxShapeKubernetesIcon2.prototype.getConstraints = function(style, w, h)576{577 var constr = [];578 var r = Math.min(h * 0.5, w * 0.5);579 580 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));581582 return (constr);583}584