1/**2 * Copyright (c) 2020-2025, JGraph Holdings Ltd3 * Copyright (c) 2020-2025, draw.io AG4 */5//**********************************************************************************************************************************************************6//Input Pin7//**********************************************************************************************************************************************************8function mxShapeUMLInputPin(bounds, fill, stroke, strokewidth)9{10 mxShape.call(this);11 this.bounds = bounds;12 this.fill = fill;13 this.stroke = stroke;14 this.strokewidth = (strokewidth != null) ? strokewidth : 1;15 this.dx = 0.5;16};1718/**19* Extends mxShape.20*/21mxUtils.extend(mxShapeUMLInputPin, mxActor);2223mxShapeUMLInputPin.prototype.cst = {INPUT_PIN : 'mxgraph.uml25.inputPin'};2425mxShapeUMLInputPin.prototype.paintVertexShape = function(c, x, y, w, h)26{27 c.translate(x, y);2829 c.begin();30 c.moveTo(0, 0);31 c.lineTo(w, 0);32 c.lineTo(w, h);33 c.lineTo(0, h);34 c.close();35 c.fillAndStroke();36 37 c.setShadow(false);38 39 c.begin();40 c.moveTo(w * 0.75, h * 0.5);41 c.lineTo(w * 0.25, h * 0.5);42 c.moveTo(w * 0.4, h * 0.4);43 c.lineTo(w * 0.25, h * 0.5);44 c.lineTo(w * 0.4, h * 0.6);45 c.stroke();46};4748mxCellRenderer.registerShape(mxShapeUMLInputPin.prototype.cst.INPUT_PIN, mxShapeUMLInputPin);4950mxShapeUMLInputPin.prototype.constraints = null;5152//**********************************************************************************************************************************************************53//Behavior Action54//**********************************************************************************************************************************************************55function mxShapeUMLBehaviorAction(bounds, fill, stroke, strokewidth)56{57 mxShape.call(this);58 this.bounds = bounds;59 this.fill = fill;60 this.stroke = stroke;61 this.strokewidth = (strokewidth != null) ? strokewidth : 1;62 this.dx = 0.5;63};6465mxUtils.extend(mxShapeUMLBehaviorAction, mxActor);6667mxShapeUMLBehaviorAction.prototype.cst = {BEHAVIOR_ACTION : 'mxgraph.uml25.behaviorAction'};6869/**70* Function: paintVertexShape71* 72* Paints the vertex shape.73*/74mxShapeUMLBehaviorAction.prototype.paintVertexShape = function(c, x, y, w, h)75{76 c.translate(x, y);7778 var rounded = mxUtils.getValue(this.style, 'rounded', false);79 var absArcSize = mxUtils.getValue(this.style, 'absoluteArcSize', false);80 var arcSize = parseFloat(mxUtils.getValue(this.style, 'arcSize', this.arcSize));81 82 if (!absArcSize)83 {84 arcSize = Math.min(w, h) * arcSize;85 }86 87 arcSize = Math.min(arcSize, w * 0.5, h * 0.5);88 89 if (!rounded)90 {91 arcSize = 0;92 }93 94 c.begin();95 96 if (rounded)97 {98 c.moveTo(0, arcSize);99 c.arcTo(arcSize, arcSize, 0, 0, 1, arcSize, 0);100 c.lineTo(w - arcSize, 0);101 c.arcTo(arcSize, arcSize, 0, 0, 1, w, arcSize);102 c.lineTo(w, h - arcSize);103 c.arcTo(arcSize, arcSize, 0, 0, 1, w - arcSize, h);104 c.lineTo(arcSize, h);105 c.arcTo(arcSize, arcSize, 0, 0, 1, 0, h - arcSize);106 }107 else108 {109 c.moveTo(0, 0);110 c.lineTo(w, 0);111 c.lineTo(w, h);112 c.lineTo(0, h);113 }114 115 c.close();116 c.fillAndStroke();117 118 c.setShadow(false);119120 if (w >= 60 && h >= 40)121 {122 c.begin();123 c.moveTo(w - 60, h * 0.5 + 20);124 c.lineTo(w - 60, h * 0.5);125 c.lineTo(w - 20, h * 0.5);126 c.lineTo(w - 20, h * 0.5 + 20);127 c.moveTo(w - 40, h * 0.5 - 20);128 c.lineTo(w - 40, h * 0.5 + 20);129 c.stroke();130 }131};132133mxCellRenderer.registerShape(mxShapeUMLBehaviorAction.prototype.cst.BEHAVIOR_ACTION, mxShapeUMLBehaviorAction);134135mxShapeUMLBehaviorAction.prototype.constraints = null;136137//**********************************************************************************************************************************************************138//Action139//**********************************************************************************************************************************************************140/**141* Extends mxShape.142*/143function mxShapeUMLAction(bounds, fill, stroke, strokewidth)144{145 mxShape.call(this);146 this.bounds = bounds;147 this.fill = fill;148 this.stroke = stroke;149 this.strokewidth = (strokewidth != null) ? strokewidth : 1;150 this.dx = 0.5;151};152153/**154* Extends mxShape.155*/156mxUtils.extend(mxShapeUMLAction, mxActor);157158mxShapeUMLAction.prototype.cst = {ACTION : 'mxgraph.uml25.action'};159160/**161* Function: paintVertexShape162* 163* Paints the vertex shape.164*/165mxShapeUMLAction.prototype.paintVertexShape = function(c, x, y, w, h)166{167 c.translate(x, y);168169 var absArcSize = mxUtils.getValue(this.style, 'absoluteArcSize', false);170 var arcSize = parseFloat(mxUtils.getValue(this.style, 'arcSize', this.arcSize));171 172 if (!absArcSize)173 {174 arcSize = Math.min(w, h) * arcSize;175 }176 177 arcSize = Math.min(arcSize, w * 0.5, h * 0.5);178 179 c.begin();180 c.moveTo(0, arcSize);181 c.arcTo(arcSize, arcSize, 0, 0, 1, arcSize, 0);182 c.lineTo(w - arcSize - 10, 0);183 c.arcTo(arcSize, arcSize, 0, 0, 1, w - 10, arcSize);184 c.lineTo(w - 10, h - arcSize);185 c.arcTo(arcSize, arcSize, 0, 0, 1, w - arcSize - 10, h);186 c.lineTo(arcSize, h);187 c.arcTo(arcSize, arcSize, 0, 0, 1, 0, h - arcSize);188 c.close();189 c.fillAndStroke();190 191 c.rect(w - 10, h * 0.5 - 10, 10, 20);192 c.fillAndStroke();193};194195mxCellRenderer.registerShape(mxShapeUMLAction.prototype.cst.ACTION, mxShapeUMLAction);196197mxShapeUMLAction.prototype.constraints = null;198199//**********************************************************************************************************************************************************200//Action with parameters201//**********************************************************************************************************************************************************202/**203* Extends mxShape.204*/205function mxShapeUMLActionParams(bounds, fill, stroke, strokewidth)206{207 mxShape.call(this);208 this.bounds = bounds;209 this.fill = fill;210 this.stroke = stroke;211 this.strokewidth = (strokewidth != null) ? strokewidth : 1;212 this.dx = 0.5;213};214215/**216* Extends mxShape.217*/218mxUtils.extend(mxShapeUMLActionParams, mxActor);219220mxShapeUMLActionParams.prototype.cst = {ACTION_PARAMS : 'mxgraph.uml25.actionParams'};221222/**223* Function: paintVertexShape224* 225* Paints the vertex shape.226*/227mxShapeUMLActionParams.prototype.paintVertexShape = function(c, x, y, w, h)228{229 c.translate(x, y);230231 var absArcSize = mxUtils.getValue(this.style, 'absoluteArcSize', false);232 var arcSize = parseFloat(mxUtils.getValue(this.style, 'arcSize', this.arcSize));233 234 if (!absArcSize)235 {236 arcSize = Math.min(w, h) * arcSize;237 }238 239 arcSize = Math.min(arcSize, w * 0.5, h * 0.5);240 241 c.begin();242 c.moveTo(20, arcSize);243 c.arcTo(arcSize, arcSize, 0, 0, 1, 20 + arcSize, 0);244 c.lineTo(w - arcSize, 0);245 c.arcTo(arcSize, arcSize, 0, 0, 1, w, arcSize);246 c.lineTo(w, h - arcSize);247 c.arcTo(arcSize, arcSize, 0, 0, 1, w - arcSize, h);248 c.lineTo(20 + arcSize, h);249 c.arcTo(arcSize, arcSize, 0, 0, 1, 20, h - arcSize);250 c.close();251 c.fillAndStroke();252 253 c.rect(5, h * 0.5 - 17, 20, 34);254 c.fillAndStroke();255 256 c.rect(0, h * 0.5 - 13, 10, 10);257 c.fillAndStroke();258 259 c.rect(0, h * 0.5 + 3, 10, 10);260 c.fillAndStroke();261};262263mxCellRenderer.registerShape(mxShapeUMLActionParams.prototype.cst.ACTION_PARAMS, mxShapeUMLActionParams);264265mxShapeUMLActionParams.prototype.constraints = null;