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 / mxSysML.js
mxSysML.js 98.3K
1/**2 * Copyright (c) 2006-2014, JGraph Holdings Ltd3 */45//**********************************************************************************************************************************************************6//Composite7//**********************************************************************************************************************************************************8function mxShapeSysMLComposite()9{10 mxCylinder.call(this);11};12 13mxUtils.extend(mxShapeSysMLComposite, mxShape);1415mxShapeSysMLComposite.prototype.isHtmlAllowed = function()16{17 return false;18};1920mxShapeSysMLComposite.prototype.paintForeground = function(c, x, y, w, h)21{22 if (this.style != null)23 {24 var shape = mxCellRenderer.defaultShapes[this.style['symbol0']];2526 c.save();27 28 var tmp = new shape();29 tmp.style = this.style;30 shape.prototype.paintVertexShape.call(tmp, c, x, y, w, h);31 c.restore();3233 c.setDashed(false);34 35 // Draws the symbols defined in the style. The symbols are36 // numbered from 1...n. Possible postfixes are align,37 // verticalAlign, spacing, arcSpacing, width, height38 var counter = 1;39 40 do41 {42 shape = mxCellRenderer.defaultShapes[this.style['symbol' + counter]];43 44 if (shape != null)45 {46 var align = this.style['symbol' + counter + 'Align'];47 var valign = this.style['symbol' + counter + 'VerticalAlign'];48 var width = this.style['symbol' + counter + 'Width'];49 var height = this.style['symbol' + counter + 'Height'];50 var spacing = this.style['symbol' + counter + 'Spacing'] || 0;51 var vspacing = this.style['symbol' + counter + 'VSpacing'] || 0;52 var arcspacing = this.style['symbol' + counter + 'ArcSpacing'];53 var direction = this.style['symbol' + counter + 'Direction'];54 55 if (arcspacing != null)56 {57 spacing += this.getArcSize(w + this.strokewidth, h + this.strokewidth) * arcspacing;58 vspacing += this.getArcSize(w + this.strokewidth, h + this.strokewidth) * arcspacing;59 }60 61 var x2 = x;62 var y2 = y;63 64 if (align == mxConstants.ALIGN_CENTER)65 {66 x2 += (w - width) / 2;67 }68 else if (align == mxConstants.ALIGN_RIGHT)69 {70 x2 += w - width - spacing;71 }72 else73 {74 x2 += spacing;75 }76 77 if (valign == mxConstants.ALIGN_MIDDLE)78 {79 y2 += (h - height) / 2;80 }81 else if (valign == mxConstants.ALIGN_BOTTOM)82 {83 y2 += h - height - vspacing;84 }85 else86 {87 y2 += vspacing;88 }89 90 c.save();91 92 var tmp = new shape();9394 tmp.style = mxUtils.clone(this.style);95 tmp.direction = direction;96 tmp.updateTransform(c, x2, y2, width, height);97 shape.prototype.paintVertexShape.call(tmp, c, x2, y2, width, height);98 c.restore();99 }100 101 counter++;102 }103 while (shape != null);104 }105};106107mxCellRenderer.registerShape('mxgraph.sysml.composite', mxShapeSysMLComposite);108109//**********************************************************************************************************************************************************110//Package111//**********************************************************************************************************************************************************112/**113* Extends mxShape.114*/115function mxShapeSysMLPackage(bounds, fill, stroke, strokewidth)116{117 mxShape.call(this);118 this.bounds = bounds;119 this.fill = fill;120 this.stroke = stroke;121 this.strokewidth = (strokewidth != null) ? strokewidth : 1;122};123124/**125* Extends mxShape.126*/127mxUtils.extend(mxShapeSysMLPackage, mxShape);128129mxShapeSysMLPackage.prototype.cst = {130 PACKAGE : 'mxgraph.sysml.package',131 LABEL_X : 'labelX'132};133134mxShapeSysMLPackage.prototype.customProperties = [135 {name: 'labelX', dispName: 'Header Width', type: 'float', min:0, defVal:90} 136];137138mxShapeSysMLPackage.prototype.getConstraints = function(style, w, h)139{140 var constr = [];141142 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));143 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));144 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));145 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));146 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));147 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));148 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));149 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));150 constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));151 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));152 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));153 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));154 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));155 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));156 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));157 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));158159 return (constr);160};161162/**163* Function: paintVertexShape164* 165* Paints the vertex shape.166*/167mxShapeSysMLPackage.prototype.paintVertexShape = function(c, x, y, w, h)168{169 c.translate(x, y);170 this.background(c, x, y, w, h);171 c.setShadow(false);172 this.foreground(c, x, y, w, h);173};174175mxShapeSysMLPackage.prototype.background = function(c, x, y, w, h)176{177 c.rect(0, 0, w, h);178 c.fillAndStroke();179};180181mxShapeSysMLPackage.prototype.foreground = function(c, x, y, w, h)182{183 var xSize = parseInt(mxUtils.getValue(this.style, mxShapeSysMLPackage.prototype.cst.LABEL_X, '90'));184 var ySize = 20;185 186 xSize = Math.min(xSize, w);187 188 if (xSize > ySize)189 {190 c.begin();191 c.moveTo(0, ySize);192 c.lineTo(xSize - ySize * 0.5, ySize);193 c.lineTo(xSize, ySize * 0.5);194 c.lineTo(xSize, 0);195 c.stroke();196 }197};198199mxCellRenderer.registerShape(mxShapeSysMLPackage.prototype.cst.PACKAGE, mxShapeSysMLPackage);200201Graph.handleFactory[mxShapeSysMLPackage.prototype.cst.PACKAGE] = function(state)202{203 var handles = [Graph.createHandle(state, ['labelX'], function(bounds)204 {205 var labelX = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'labelX', 90))));206207 return new mxPoint(bounds.x + labelX, bounds.y + 10);208 }, function(bounds, pt)209 {210 this.state.style['labelX'] = Math.round(100 * Math.max(0, Math.min(bounds.width, pt.x - bounds.x))) / 100;211 })];212 213 return handles;214215}216217//**********************************************************************************************************************************************************218//Package2219//**********************************************************************************************************************************************************220/**221* Extends mxShape.222*/223function mxShapeSysMLPackage2(bounds, fill, stroke, strokewidth)224{225 mxShape.call(this);226 this.bounds = bounds;227 this.fill = fill;228 this.stroke = stroke;229 this.strokewidth = (strokewidth != null) ? strokewidth : 1;230};231232/**233* Extends mxShape.234*/235mxUtils.extend(mxShapeSysMLPackage2, mxShape);236237mxShapeSysMLPackage2.prototype.cst = {238 PACKAGE2 : 'mxgraph.sysml.package2',239 LABEL_X : 'labelX'240};241242mxShapeSysMLPackage2.prototype.customProperties = [243 {name: 'labelX', dispName: 'Header Width', type: 'float', min:0, defVal:90} 244];245246/**247* Function: paintVertexShape248* 249* Paints the vertex shape.250*/251mxShapeSysMLPackage2.prototype.paintVertexShape = function(c, x, y, w, h)252{253 c.translate(x, y);254 this.background(c, x, y, w, h);255 c.setShadow(false);256 this.foreground(c, x, y, w, h);257};258259mxShapeSysMLPackage2.prototype.background = function(c, x, y, w, h)260{261 c.rect(0, 0, w, h);262 c.stroke();263};264265mxShapeSysMLPackage2.prototype.foreground = function(c, x, y, w, h)266{267 var xSize = parseInt(mxUtils.getValue(this.style, mxShapeSysMLPackage2.prototype.cst.LABEL_X, '90'));268 var ySize = 20;269 270 xSize = Math.min(xSize, w);271 272 if (xSize > ySize)273 {274 c.begin();275 c.moveTo(0, ySize);276 c.lineTo(xSize - ySize * 0.5, ySize);277 c.lineTo(xSize, ySize * 0.5);278 c.lineTo(xSize, 0);279 c.lineTo(0, 0);280 c.close();281 c.fillAndStroke();282 }283};284285mxCellRenderer.registerShape(mxShapeSysMLPackage2.prototype.cst.PACKAGE2, mxShapeSysMLPackage2);286287Graph.handleFactory[mxShapeSysMLPackage2.prototype.cst.PACKAGE2] = function(state)288{289 var handles = [Graph.createHandle(state, ['labelX'], function(bounds)290 {291 var labelX = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'labelX', 90))));292293 return new mxPoint(bounds.x + labelX, bounds.y + 10);294 }, function(bounds, pt)295 {296 this.state.style['labelX'] = Math.round(100 * Math.max(0, Math.min(bounds.width, pt.x - bounds.x))) / 100;297 })];298 299 return handles;300301}302303//**********************************************************************************************************************************************************304//None305//**********************************************************************************************************************************************************306/**307* Extends mxShape.308*/309function mxShapeSysMLNone(bounds, fill, stroke, strokewidth)310{311 mxShape.call(this);312 this.bounds = bounds;313 this.fill = fill;314 this.stroke = stroke;315 this.strokewidth = (strokewidth != null) ? strokewidth : 1;316};317318/**319* Extends mxShape.320*/321mxUtils.extend(mxShapeSysMLNone, mxShape);322323mxShapeSysMLNone.prototype.cst = {324 NONE : 'mxgraph.sysml.none'325};326327/**328* Function: paintVertexShape329* 330* Paints the vertex shape.331*/332mxShapeSysMLNone.prototype.paintVertexShape = function(c, x, y, w, h)333{334};335336mxCellRenderer.registerShape(mxShapeSysMLNone.prototype.cst.NONE, mxShapeSysMLNone);337338//**********************************************************************************************************************************************************339//Rectangle340//**********************************************************************************************************************************************************341/**342* Extends mxShape.343*/344function mxShapeSysMLRect(bounds, fill, stroke, strokewidth)345{346 mxShape.call(this);347 this.bounds = bounds;348 this.fill = fill;349 this.stroke = stroke;350 this.strokewidth = (strokewidth != null) ? strokewidth : 1;351};352353/**354* Extends mxShape.355*/356mxUtils.extend(mxShapeSysMLRect, mxShape);357358mxShapeSysMLRect.prototype.cst = {359 RECT : 'mxgraph.sysml.rect'360};361362/**363* Function: paintVertexShape364* 365* Paints the vertex shape.366*/367mxShapeSysMLRect.prototype.paintVertexShape = function(c, x, y, w, h)368{369 c.rect(x, y, w, h);370 c.fillAndStroke();371};372373mxCellRenderer.registerShape(mxShapeSysMLRect.prototype.cst.RECT, mxShapeSysMLRect);374375//**********************************************************************************************************************************************************376//Port377//**********************************************************************************************************************************************************378/**379* Extends mxShape.380*/381function mxShapeSysMLPortOne(bounds, fill, stroke, strokewidth)382{383 mxShape.call(this);384 this.bounds = bounds;385 this.fill = fill;386 this.stroke = stroke;387 this.strokewidth = (strokewidth != null) ? strokewidth : 1;388};389390/**391* Extends mxShape.392*/393mxUtils.extend(mxShapeSysMLPortOne, mxShape);394395mxShapeSysMLPortOne.prototype.cst = {396 PORT1 : 'mxgraph.sysml.port1'397};398399/**400* Function: paintVertexShape401* 402* Paints the vertex shape.403*/404mxShapeSysMLPortOne.prototype.paintVertexShape = function(c, x, y, w, h)405{406 c.rect(x + w * 0.05, y, w - w * 0.1, h);407 c.fillAndStroke();408};409410mxCellRenderer.registerShape(mxShapeSysMLPortOne.prototype.cst.PORT1, mxShapeSysMLPortOne);411412mxShapeSysMLPortOne.prototype.getConstraints = function(style, w, h)413{414 var constr = [];415416 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 0), false));417 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));418 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));419 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));420 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 0), false));421 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 0.25), false));422 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 0.75), false));423 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 1), false));424 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));425 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));426 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));427 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 1), false));428 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 0.75), false));429 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 0.25), false));430431 return (constr);432};433434//**********************************************************************************************************************************************************435//Port2436//**********************************************************************************************************************************************************437/**438* Extends mxShape.439*/440function mxShapeSysMLPortTwo(bounds, fill, stroke, strokewidth)441{442 mxShape.call(this);443 this.bounds = bounds;444 this.fill = fill;445 this.stroke = stroke;446 this.strokewidth = (strokewidth != null) ? strokewidth : 1;447};448449/**450* Extends mxShape.451*/452mxUtils.extend(mxShapeSysMLPortTwo, mxShape);453454mxShapeSysMLPortTwo.prototype.cst = {455 PORT2 : 'mxgraph.sysml.port2'456};457458/**459* Function: paintVertexShape460* 461* Paints the vertex shape.462*/463mxShapeSysMLPortTwo.prototype.paintVertexShape = function(c, x, y, w, h)464{465 c.rect(x + w * 0.05, y, w * 0.8, h);466 c.fillAndStroke();467};468469mxCellRenderer.registerShape(mxShapeSysMLPortTwo.prototype.cst.PORT2, mxShapeSysMLPortTwo);470471mxShapeSysMLPortTwo.prototype.getConstraints = function(style, w, h)472{473 var constr = [];474475 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 0), false));476 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));477 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));478 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));479 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 0), false));480 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 0.25), false));481 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 0.75), false));482 constr.push(new mxConnectionConstraint(new mxPoint(0.95, 1), false));483 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));484 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));485 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));486 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 1), false));487 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 0.75), false));488 constr.push(new mxConnectionConstraint(new mxPoint(0.05, 0.25), false));489490 return (constr);491};492493//**********************************************************************************************************************************************************494//Port3495//**********************************************************************************************************************************************************496/**497* Extends mxShape.498*/499function mxShapeSysMLPortThree(bounds, fill, stroke, strokewidth)500{501 mxShape.call(this);502 this.bounds = bounds;503 this.fill = fill;504 this.stroke = stroke;505 this.strokewidth = (strokewidth != null) ? strokewidth : 1;506};507508/**509* Extends mxShape.510*/511mxUtils.extend(mxShapeSysMLPortThree, mxShape);512513mxShapeSysMLPortThree.prototype.cst = {514 PORT3 : 'mxgraph.sysml.port3'515};516517/**518* Function: paintVertexShape519* 520* Paints the vertex shape.521*/522mxShapeSysMLPortThree.prototype.paintVertexShape = function(c, x, y, w, h)523{524 c.rect(x + w * 0.07, y, w * 0.86, h);525 c.fillAndStroke();526 c.rect(x, y + h * 0.125, w * 0.14, h * 0.25);527 c.fillAndStroke();528 c.rect(x, y + h * 0.625, w * 0.14, h * 0.25);529 c.fillAndStroke();530 c.rect(x + w * 0.86, y + h * 0.375, w * 0.14, h * 0.25);531 c.fillAndStroke();532 this.drawIn(c, x + w * 0.01, y + h * 0.2, w * 0.11, h * 0.10);533 this.drawOut(c, x + w * 0.02, y + h * 0.7, w * 0.11, h * 0.10);534 this.drawInOut(c, x + w * 0.88, y + h * 0.45, w * 0.1, h * 0.10);535};536537mxShapeSysMLPortThree.prototype.drawIn = function(c, x, y, w, h)538{539 c.begin();540 c.moveTo(x, y + h * 0.5);541 c.lineTo(x + w, y + h * 0.5);542 c.moveTo(x + w * 0.75, y);543 c.lineTo(x + w, y + h * 0.5);544 c.lineTo(x + w * 0.75, y + h);545 c.stroke();546}547548mxShapeSysMLPortThree.prototype.drawOut = function(c, x, y, w, h)549{550 c.begin();551 c.moveTo(x, y + h * 0.5);552 c.lineTo(x + w, y + h * 0.5);553 c.moveTo(x + w * 0.25, y);554 c.lineTo(x, y + h * 0.5);555 c.lineTo(x + w * 0.25, y + h);556 c.stroke();557}558559mxShapeSysMLPortThree.prototype.drawInOut = function(c, x, y, w, h)560{561 c.begin();562 c.moveTo(x + w * 0.75, y);563 c.lineTo(x + w, y + h * 0.5);564 c.lineTo(x + w * 0.75, y + h);565 c.moveTo(x + w * 0.25, y);566 c.lineTo(x, y + h * 0.5);567 c.lineTo(x + w * 0.25, y + h);568 c.stroke();569}570571mxCellRenderer.registerShape(mxShapeSysMLPortThree.prototype.cst.PORT3, mxShapeSysMLPortThree);572573//**********************************************************************************************************************************************************574//Port575//**********************************************************************************************************************************************************576/**577* Extends mxShape.578*/579function mxShapeSysMLPortFour(bounds, fill, stroke, strokewidth)580{581 mxShape.call(this);582 this.bounds = bounds;583 this.fill = fill;584 this.stroke = stroke;585 this.strokewidth = (strokewidth != null) ? strokewidth : 1;586};587588/**589* Extends mxShape.590*/591mxUtils.extend(mxShapeSysMLPortFour, mxShape);592593mxShapeSysMLPortFour.prototype.cst = {594 PORT4 : 'mxgraph.sysml.port4'595};596597/**598* Function: paintVertexShape599* 600* Paints the vertex shape.601*/602mxShapeSysMLPortFour.prototype.paintVertexShape = function(c, x, y, w, h)603{604 c.rect(x + w * 0.05, y, w - w * 0.05, h);605 c.fillAndStroke();606};607608mxCellRenderer.registerShape(mxShapeSysMLPortFour.prototype.cst.PORT4, mxShapeSysMLPortFour);609610mxShapeSysMLPortFour.prototype.constraints = [611 new mxConnectionConstraint(new mxPoint(0.5, 0), true),612 new mxConnectionConstraint(new mxPoint(0, 0.5), true),613 new mxConnectionConstraint(new mxPoint(0.5, 1), true),614 new mxConnectionConstraint(new mxPoint(1, 0.5), true)615 ];616617//**********************************************************************************************************************************************************618//Item Flow619//**********************************************************************************************************************************************************620/**621* Extends mxShape.622*/623function mxShapeSysMLItemFlow(bounds, fill, stroke, strokewidth)624{625 mxShape.call(this);626 this.bounds = bounds;627 this.fill = fill;628 this.stroke = stroke;629 this.strokewidth = (strokewidth != null) ? strokewidth : 1;630};631632/**633* Extends mxShape.634*/635mxUtils.extend(mxShapeSysMLItemFlow, mxShape);636637mxShapeSysMLItemFlow.prototype.cst = {638 ITEM_FLOW : 'mxgraph.sysml.itemFlow',639 FLOW_DIR : 'flowDir',640 FLOW_TYPE : 'flowType'641};642643mxShapeSysMLItemFlow.prototype.customProperties = [644 {name: 'flowDir', dispName: 'Flow Direction', type: 'enum',645 enumList:[646 {val:'n', dispName:'North'},647 {val:'s', dispName:'South'},648 {val:'e', dispName:'East'},649 {val:'w', dispName:'West'}650 ]},651 {name: 'flowType', dispName: 'Flow Type', type: 'enum',652 enumList:[653 {val:'in', dispName:'In'},654 {val:'out', dispName:'Out'}655]}];656657/**658* Function: paintVertexShape659* 660* Paints the vertex shape.661*/662mxShapeSysMLItemFlow.prototype.paintVertexShape = function(c, x, y, w, h)663{664 var flowDir = mxUtils.getValue(this.style, mxShapeSysMLItemFlow.prototype.cst.FLOW_DIR, 'none').toLowerCase();665 var flowType = mxUtils.getValue(this.style, mxShapeSysMLItemFlow.prototype.cst.FLOW_TYPE, 'none');666 667 if (flowDir === 'n')668 {669 c.rect(x, y + 10, w, h - 10);670 c.fillAndStroke();671672 c.setShadow(false);673 674 c.rect(x + w * 0.5 - 10, y, 20, 20);675 c.fillAndStroke();676 677 if (flowType === 'in')678 {679 this.drawDown(c, x + w * 0.5 - 5, y + 2, 10, 16);680 }681 else if (flowType === 'out')682 {683 this.drawUp(c, x + w * 0.5 - 5, y + 2, 10, 16);684 }685 }686 else if (flowDir === 's')687 {688 c.rect(x, y, w, h - 10);689 c.fillAndStroke();690691 c.setShadow(false);692 693 c.rect(x + w * 0.5 - 10, y + h - 20, 20, 20);694 c.fillAndStroke();695696 if (flowType === 'in')697 {698 this.drawUp(c, x + w * 0.5 - 5, y + h - 18, 10, 16);699 }700 else if (flowType === 'out')701 {702 this.drawDown(c, x + w * 0.5 - 5, y + h - 18, 10, 16);703 }704 }705 else if (flowDir === 'w')706 {707 c.rect(x + 10, y, w - 10, h);708 c.fillAndStroke();709710 c.setShadow(false);711 712 c.rect(x, y + h * 0.5 - 10, 20, 20);713 c.fillAndStroke();714 715 if (flowType === 'in')716 {717 this.drawRight(c, x + 2, y + h * 0.5 - 5, 16, 10);718 }719 else if (flowType === 'out')720 {721 this.drawLeft(c, x + 2, y + h * 0.5 - 5, 16, 10);722 }723 }724 else if (flowDir === 'e')725 {726 c.rect(x, y, w - 10, h);727 c.fillAndStroke();728729 c.setShadow(false);730 731 c.rect(x + w - 20, y + h * 0.5 - 10, 20, 20);732 c.fillAndStroke();733 734 if (flowType === 'in')735 {736 this.drawLeft(c, x + w - 18, y + h * 0.5 - 5, 16, 10);737 }738 else if (flowType === 'out')739 {740 this.drawRight(c, x + w - 18, y + h * 0.5 - 5, 16, 10);741 }742 }743};744745mxShapeSysMLItemFlow.prototype.drawRight = function(c, x, y, w, h)746{747 c.begin();748 c.moveTo(x, y + h * 0.5);749 c.lineTo(x + w, y + h * 0.5);750 c.moveTo(x + w * 0.75, y);751 c.lineTo(x + w, y + h * 0.5);752 c.lineTo(x + w * 0.75, y + h);753 c.stroke();754}755756mxShapeSysMLItemFlow.prototype.drawDown = function(c, x, y, w, h)757{758 c.begin();759 c.moveTo(x + w * 0.5, y);760 c.lineTo(x + w * 0.5, y + h);761 c.moveTo(x, y + h * 0.75);762 c.lineTo(x + w * 0.5, y + h);763 c.lineTo(x + w, y + h * 0.75);764 c.stroke();765}766767mxShapeSysMLItemFlow.prototype.drawLeft = function(c, x, y, w, h)768{769 c.begin();770 c.moveTo(x, y + h * 0.5);771 c.lineTo(x + w, y + h * 0.5);772 c.moveTo(x + w * 0.25, y);773 c.lineTo(x, y + h * 0.5);774 c.lineTo(x + w * 0.25, y + h);775 c.stroke();776}777778mxShapeSysMLItemFlow.prototype.drawUp = function(c, x, y, w, h)779{780 c.begin();781 c.moveTo(x + w * 0.5, y + h);782 c.lineTo(x + w * 0.5, y);783 c.moveTo(x, y + h * 0.25);784 c.lineTo(x + w * 0.5, y);785 c.lineTo(x + w, y + h * 0.25);786 c.stroke();787}788789mxCellRenderer.registerShape(mxShapeSysMLItemFlow.prototype.cst.ITEM_FLOW, mxShapeSysMLItemFlow);790791mxShapeSysMLItemFlow.prototype.constraints = [792 new mxConnectionConstraint(new mxPoint(0.5, 0), true),793 new mxConnectionConstraint(new mxPoint(1, 0.5), true),794 new mxConnectionConstraint(new mxPoint(0.5, 1), true),795 new mxConnectionConstraint(new mxPoint(0, 0.5), true)796 ];797798//**********************************************************************************************************************************************************799//Item Flow Left800//**********************************************************************************************************************************************************801/**802* Extends mxShape.803*/804function mxShapeSysMLItemFlowLeft(bounds, fill, stroke, strokewidth)805{806 mxShape.call(this);807 this.bounds = bounds;808 this.fill = fill;809 this.stroke = stroke;810 this.strokewidth = (strokewidth != null) ? strokewidth : 1;811};812813/**814* Extends mxShape.815*/816mxUtils.extend(mxShapeSysMLItemFlowLeft, mxShape);817818mxShapeSysMLItemFlowLeft.prototype.cst = {819 ITEM_FLOW_LEFT : 'mxgraph.sysml.itemFlowLeft'820};821822/**823* Function: paintVertexShape824* 825* Paints the vertex shape.826*/827mxShapeSysMLItemFlowLeft.prototype.paintVertexShape = function(c, x, y, w, h)828{829 c.rect(x + 10, y, w - 10, h);830 c.fillAndStroke();831 c.rect(x, y + h * 0.25 - 10, 20, 20);832 c.fillAndStroke();833 c.rect(x, y + h * 0.5 - 10, 20, 20);834 c.fillAndStroke();835 c.rect(x, y + h * 0.75 - 10, 20, 20);836 c.fillAndStroke();837};838839mxCellRenderer.registerShape(mxShapeSysMLItemFlowLeft.prototype.cst.ITEM_FLOW_LEFT, mxShapeSysMLItemFlowLeft);840841mxShapeSysMLItemFlowLeft.prototype.constraints = [842 new mxConnectionConstraint(new mxPoint(0.5, 0), true),843 new mxConnectionConstraint(new mxPoint(1, 0.5), true),844 new mxConnectionConstraint(new mxPoint(0.5, 1), true),845 new mxConnectionConstraint(new mxPoint(0, 0.25), true),846 new mxConnectionConstraint(new mxPoint(0, 0.5), true),847 new mxConnectionConstraint(new mxPoint(0, 0.75), true)848 ];849850//**********************************************************************************************************************************************************851//Item Flow Right852//**********************************************************************************************************************************************************853/**854* Extends mxShape.855*/856function mxShapeSysMLItemFlowRight(bounds, fill, stroke, strokewidth)857{858 mxShape.call(this);859 this.bounds = bounds;860 this.fill = fill;861 this.stroke = stroke;862 this.strokewidth = (strokewidth != null) ? strokewidth : 1;863};864865/**866* Extends mxShape.867*/868mxUtils.extend(mxShapeSysMLItemFlowRight, mxShape);869870mxShapeSysMLItemFlowRight.prototype.cst = {871 ITEM_FLOW_RIGHT : 'mxgraph.sysml.itemFlowRight'872};873874/**875* Function: paintVertexShape876* 877* Paints the vertex shape.878*/879mxShapeSysMLItemFlowRight.prototype.paintVertexShape = function(c, x, y, w, h)880{881 c.rect(x, y, w - 10, h);882 c.fillAndStroke();883 c.rect(x + w - 20, y + h * 0.25 - 10, 20, 20);884 c.fillAndStroke();885 c.rect(x + w - 20, y + h * 0.5 - 10, 20, 20);886 c.fillAndStroke();887 c.rect(x + w - 20, y + h * 0.75 - 10, 20, 20);888 c.fillAndStroke();889};890891mxCellRenderer.registerShape(mxShapeSysMLItemFlowRight.prototype.cst.ITEM_FLOW_RIGHT, mxShapeSysMLItemFlowRight);892893mxShapeSysMLItemFlowRight.prototype.constraints = [894 new mxConnectionConstraint(new mxPoint(0.5, 0), true),895 new mxConnectionConstraint(new mxPoint(0, 0.5), true),896 new mxConnectionConstraint(new mxPoint(0.5, 1), true),897 new mxConnectionConstraint(new mxPoint(1, 0.25), true),898 new mxConnectionConstraint(new mxPoint(1, 0.5), true),899 new mxConnectionConstraint(new mxPoint(1, 0.75), true)900 ];901902//**********************************************************************************************************************************************************903//Nested Port904//**********************************************************************************************************************************************************905/**906* Extends mxShape.907*/908function mxShapeSysMLNestedPort(bounds, fill, stroke, strokewidth)909{910 mxShape.call(this);911 this.bounds = bounds;912 this.fill = fill;913 this.stroke = stroke;914 this.strokewidth = (strokewidth != null) ? strokewidth : 1;915};916917/**918* Extends mxShape.919*/920mxUtils.extend(mxShapeSysMLNestedPort, mxShape);921922mxShapeSysMLNestedPort.prototype.cst = {923 NESTED_PORT : 'mxgraph.sysml.nestedPort'924};925926/**927* Function: paintVertexShape928* 929* Paints the vertex shape.930*/931mxShapeSysMLNestedPort.prototype.paintVertexShape = function(c, x, y, w, h)932{933 c.rect(x + w * 0.08, y, w * 0.92, h);934 c.fillAndStroke();935 c.rect(x + w * 0.03, y + h * 0.1, w * 0.1, h * 0.8);936 c.fillAndStroke();937 c.rect(x, y + h * 0.15, w * 0.06, h * 0.16);938 c.fillAndStroke();939 c.rect(x, y + h * 0.42, w * 0.06, h * 0.16);940 c.fillAndStroke();941 c.rect(x, y + h * 0.69, w * 0.06, h * 0.16);942 c.fillAndStroke();943};944945mxCellRenderer.registerShape(mxShapeSysMLNestedPort.prototype.cst.NESTED_PORT, mxShapeSysMLNestedPort);946947//**********************************************************************************************************************************************************948//Package Containment949//**********************************************************************************************************************************************************950mxMarker.addMarker('sysMLPackCont', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)951{952 var nx = unitX * (size + sw + 1);953 var ny = unitY * (size + sw + 1);954 var a = size / 2;955956 return function()957 {958 c.begin();959 c.moveTo(pe.x - nx / 2 - ny / 2, pe.y - ny / 2 + nx / 2);960 c.lineTo(pe.x - nx / 2 + ny / 2, pe.y - ny / 2 - nx / 2);961 c.stroke();962 c.ellipse(pe.x - 0.5 * nx - a, pe.y - 0.5 * ny - a, 2 * a, 2 * a);963 c.stroke();964 };965});966967//**********************************************************************************************************************************************************968//Required Interface969//**********************************************************************************************************************************************************970mxMarker.addMarker('sysMLReqInt', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)971{972 var nx = unitX * (size + sw + 1);973 var ny = unitY * (size + sw + 1);974 var a = size / 2;975 976 return function()977 {978 var fillColor = mxUtils.getValue(shape.style, mxConstants.STYLE_FILLCOLOR, 'none');979 c.setFillColor(fillColor);980 c.ellipse(pe.x - 0.5 * nx - a, pe.y - 0.5 * ny - a, 2 * a, 2 * a);981 c.fillAndStroke();982 };983});984985//**********************************************************************************************************************************************************986//Provided Interface987//**********************************************************************************************************************************************************988mxMarker.addMarker('sysMLProvInt', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)989{990 var nx = unitX * (size + sw + 1);991 var ny = unitY * (size + sw + 1);992 var a = size / 2;993 994 return function()995 {996 var fillColor = mxUtils.getValue(shape.style, mxConstants.STYLE_FILLCOLOR, 'none');997 c.setFillColor(fillColor);998 c.begin();999 c.moveTo(pe.x - ny / 2, pe.y + nx / 2);1000 c.arcTo(a, a, 0, 0, 1, pe.x + ny / 2, pe.y - nx / 2);1001 c.fillAndStroke();1002 };1003});10041005//**********************************************************************************************************************************************************1006//Parametric Diagram1007//**********************************************************************************************************************************************************1008/**1009* Extends mxShape.1010*/1011function mxShapeSysMLParametricDiagram(bounds, fill, stroke, strokewidth)1012{1013 mxShape.call(this);1014 this.bounds = bounds;1015 this.fill = fill;1016 this.stroke = stroke;1017 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1018};10191020/**1021* Extends mxShape.1022*/1023mxUtils.extend(mxShapeSysMLParametricDiagram, mxShape);10241025mxShapeSysMLParametricDiagram.prototype.cst = {1026 PARAM_DGM : 'mxgraph.sysml.paramDgm'1027};10281029/**1030* Function: paintVertexShape1031* 1032* Paints the vertex shape.1033*/1034mxShapeSysMLParametricDiagram.prototype.paintVertexShape = function(c, x, y, w, h)1035{1036 c.roundrect(x, y, w, h, 10, 10);1037 c.fillAndStroke();1038 1039 c.setShadow(false);1040 1041 if (h > 60)1042 {1043 c.rect(x, y + h * 0.25 - 10, 20, 20);1044 c.stroke();1045 c.rect(x, y + h * 0.75 - 10, 20, 20);1046 c.stroke();1047 }1048};10491050mxCellRenderer.registerShape(mxShapeSysMLParametricDiagram.prototype.cst.PARAM_DGM, mxShapeSysMLParametricDiagram);10511052//**********************************************************************************************************************************************************1053//Constraint Property1054//**********************************************************************************************************************************************************1055/**1056* Extends mxShape.1057*/1058function mxShapeSysMLConstraintProperty(bounds, fill, stroke, strokewidth)1059{1060 mxShape.call(this);1061 this.bounds = bounds;1062 this.fill = fill;1063 this.stroke = stroke;1064 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1065};10661067/**1068* Extends mxShape.1069*/1070mxUtils.extend(mxShapeSysMLConstraintProperty, mxShape);10711072mxShapeSysMLConstraintProperty.prototype.cst = {1073 CONS_PROP : 'mxgraph.sysml.consProp'1074};10751076/**1077* Function: paintVertexShape1078* 1079* Paints the vertex shape.1080*/1081mxShapeSysMLConstraintProperty.prototype.paintVertexShape = function(c, x, y, w, h)1082{1083 c.rect(x, y, w, h);1084 c.fillAndStroke();1085 1086 c.setShadow(false);1087 1088 if (h > 60)1089 {1090 c.rect(x, y + 50, 20, 20);1091 c.stroke();1092 c.rect(x, y + 80, 20, 20);1093 c.stroke();1094 }1095};10961097mxCellRenderer.registerShape(mxShapeSysMLConstraintProperty.prototype.cst.CONS_PROP, mxShapeSysMLConstraintProperty);10981099//**********************************************************************************************************************************************************1100//Call Behavior Action1101//**********************************************************************************************************************************************************1102/**1103* Extends mxShape.1104*/1105function mxShapeSysMLCallBehaviorAction(bounds, fill, stroke, strokewidth)1106{1107 mxShape.call(this);1108 this.bounds = bounds;1109 this.fill = fill;1110 this.stroke = stroke;1111 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1112};11131114/**1115* Extends mxShape.1116*/1117mxUtils.extend(mxShapeSysMLCallBehaviorAction, mxShape);11181119mxShapeSysMLCallBehaviorAction.prototype.cst = {1120 CALL_BEH_ACT : 'mxgraph.sysml.callBehAct'1121};11221123/**1124* Function: paintVertexShape1125* 1126* Paints the vertex shape.1127*/1128mxShapeSysMLCallBehaviorAction.prototype.paintVertexShape = function(c, x, y, w, h)1129{1130 c.roundrect(x, y, w, h, 10, 10);1131 c.fillAndStroke();1132 1133 if ((h > 30) && (w > 40))1134 {1135 c.setShadow(false);1136 1137 this.drawSymb(c, x + w - 30, y + h - 30, 20, 20);1138 }1139};11401141mxShapeSysMLCallBehaviorAction.prototype.drawSymb = function(c, x, y, w, h)1142{1143 c.begin();1144 c.moveTo(x + w * 0.5, y);1145 c.lineTo(x + w * 0.5, y + h);1146 c.moveTo(x, y + h);1147 c.lineTo(x, y + h * 0.5);1148 c.lineTo(x + w, y + h * 0.5);1149 c.lineTo(x + w, y + h);1150 c.stroke();1151};11521153mxCellRenderer.registerShape(mxShapeSysMLCallBehaviorAction.prototype.cst.CALL_BEH_ACT, mxShapeSysMLCallBehaviorAction);11541155mxShapeSysMLCallBehaviorAction.prototype.getConstraints = function(style, w, h)1156{1157 var constr = [];11581159 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 2.9));1160 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));1161 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1162 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));1163 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -2.9, 2.9));1164 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));1165 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1166 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));1167 constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -2.9, -2.9));1168 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));1169 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1170 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));1171 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));1172 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, 2.9, -2.9));1173 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));1174 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1175 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));11761177 return (constr);1178};11791180//**********************************************************************************************************************************************************1181//Accept Event Action1182//**********************************************************************************************************************************************************1183/**1184* Extends mxShape.1185*/1186function mxShapeSysMLAcceptEventAction(bounds, fill, stroke, strokewidth)1187{1188 mxShape.call(this);1189 this.bounds = bounds;1190 this.fill = fill;1191 this.stroke = stroke;1192 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1193};11941195/**1196* Extends mxShape.1197*/1198mxUtils.extend(mxShapeSysMLAcceptEventAction, mxShape);11991200mxShapeSysMLAcceptEventAction.prototype.cst = {1201 ACC_EVENT : 'mxgraph.sysml.accEvent'1202};12031204/**1205* Function: paintVertexShape1206* 1207* Paints the vertex shape.1208*/1209mxShapeSysMLAcceptEventAction.prototype.paintVertexShape = function(c, x, y, w, h)1210{1211 c.begin();1212 c.moveTo(x, y);1213 c.lineTo(x + w, y);1214 c.lineTo(x + w, y + h);1215 c.lineTo(x, y + h);1216 c.lineTo(x + h * 0.3, y + h * 0.5);1217 c.close();1218 c.fillAndStroke();1219};12201221mxCellRenderer.registerShape(mxShapeSysMLAcceptEventAction.prototype.cst.ACC_EVENT, mxShapeSysMLAcceptEventAction);12221223mxShapeSysMLAcceptEventAction.prototype.getConstraints = function(style, w, h)1224{1225 var constr = [];12261227 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));1228 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));1229 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1230 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));1231 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));1232 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));1233 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1234 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));1235 constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));1236 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));1237 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1238 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));1239 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));1240 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, h * 0.3, 0));12411242 return (constr);1243};12441245//**********************************************************************************************************************************************************1246//Time Event1247//**********************************************************************************************************************************************************1248/**1249* Extends mxShape.1250*/1251function mxShapeSysMLTimeEvent(bounds, fill, stroke, strokewidth)1252{1253 mxShape.call(this);1254 this.bounds = bounds;1255 this.fill = fill;1256 this.stroke = stroke;1257 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1258};12591260/**1261* Extends mxShape.1262*/1263mxUtils.extend(mxShapeSysMLTimeEvent, mxShape);12641265mxShapeSysMLTimeEvent.prototype.cst = {1266 TIME_EVENT : 'mxgraph.sysml.timeEvent'1267};12681269/**1270* Function: paintVertexShape1271* 1272* Paints the vertex shape.1273*/1274mxShapeSysMLTimeEvent.prototype.paintVertexShape = function(c, x, y, w, h)1275{1276 c.begin();1277 c.moveTo(x, y);1278 c.lineTo(x + w, y);1279 c.lineTo(x, y + h);1280 c.lineTo(x + w, y + h);1281 c.close();1282 c.fillAndStroke();1283};12841285mxCellRenderer.registerShape(mxShapeSysMLTimeEvent.prototype.cst.TIME_EVENT, mxShapeSysMLTimeEvent);12861287mxShapeSysMLTimeEvent.prototype.getConstraints = function(style, w, h)1288{1289 var constr = [];12901291 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));1292 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1293 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));1294 constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));1295 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1296 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));1297 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.5), false));12981299 return (constr);1300};13011302//**********************************************************************************************************************************************************1303//Send Signal Action1304//**********************************************************************************************************************************************************1305/**1306* Extends mxShape.1307*/1308function mxShapeSysMLSendSignalAction(bounds, fill, stroke, strokewidth)1309{1310 mxShape.call(this);1311 this.bounds = bounds;1312 this.fill = fill;1313 this.stroke = stroke;1314 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1315};13161317/**1318* Extends mxShape.1319*/1320mxUtils.extend(mxShapeSysMLSendSignalAction, mxShape);13211322mxShapeSysMLSendSignalAction.prototype.cst = {1323 SEND_SIG_ACT : 'mxgraph.sysml.sendSigAct'1324};13251326/**1327* Function: paintVertexShape1328* 1329* Paints the vertex shape.1330*/1331mxShapeSysMLSendSignalAction.prototype.paintVertexShape = function(c, x, y, w, h)1332{1333 c.begin();1334 c.moveTo(x, y);1335 c.lineTo(x + w - h * 0.3, y);1336 c.lineTo(x + w, y + h * 0.5);1337 c.lineTo(x + w - h * 0.3, y + h);1338 c.lineTo(x, y + h);1339 c.close();1340 c.fillAndStroke();1341};13421343mxCellRenderer.registerShape(mxShapeSysMLSendSignalAction.prototype.cst.SEND_SIG_ACT, mxShapeSysMLSendSignalAction);13441345mxShapeSysMLSendSignalAction.prototype.getConstraints = function(style, w, h)1346{1347 var constr = [];13481349 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));1350 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));1351 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1352 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));1353 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -h * 0.3, 0));1354 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1355 constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -h * 0.3, 0));1356 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));1357 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1358 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));1359 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));1360 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));1361 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1362 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));13631364 return (constr);1365};13661367//**********************************************************************************************************************************************************1368//Activity Final1369//**********************************************************************************************************************************************************1370/**1371* Extends mxShape.1372*/1373function mxShapeSysMLActivityFinal(bounds, fill, stroke, strokewidth)1374{1375 mxShape.call(this);1376 this.bounds = bounds;1377 this.fill = fill;1378 this.stroke = stroke;1379 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1380};13811382/**1383* Extends mxShape.1384*/1385mxUtils.extend(mxShapeSysMLActivityFinal, mxShape);13861387mxShapeSysMLActivityFinal.prototype.cst = {1388 ACT_FINAL : 'mxgraph.sysml.actFinal'1389};13901391/**1392* Function: paintVertexShape1393* 1394* Paints the vertex shape.1395*/1396mxShapeSysMLActivityFinal.prototype.paintVertexShape = function(c, x, y, w, h)1397{1398 c.ellipse(x, y, w, h);1399 c.fillAndStroke();1400 1401 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1402 c.setFillColor(strokeColor);1403 1404 c.ellipse(x + 5, y + 5, w - 10, h - 10);1405 c.fillAndStroke();1406};14071408mxCellRenderer.registerShape(mxShapeSysMLActivityFinal.prototype.cst.ACT_FINAL, mxShapeSysMLActivityFinal);14091410mxShapeSysMLActivityFinal.prototype.getConstraints = function(style, w, h)1411{1412 var constr = [];14131414 constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.145), false));1415 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1416 constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.145), false));1417 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1418 constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.855), false));1419 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1420 constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.855), false));1421 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));14221423 return (constr);1424};14251426//**********************************************************************************************************************************************************1427//Activity Parameter Node1428//**********************************************************************************************************************************************************1429/**1430* Extends mxShape.1431*/1432function mxShapeSysMLActivityParameterNode(bounds, fill, stroke, strokewidth)1433{1434 mxShape.call(this);1435 this.bounds = bounds;1436 this.fill = fill;1437 this.stroke = stroke;1438 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1439};14401441/**1442* Extends mxShape.1443*/1444mxUtils.extend(mxShapeSysMLActivityParameterNode, mxShape);14451446mxShapeSysMLActivityParameterNode.prototype.cst = {1447 ACT_PARAM_NODE : 'mxgraph.sysml.actParamNode'1448};14491450/**1451* Function: paintVertexShape1452* 1453* Paints the vertex shape.1454*/1455mxShapeSysMLActivityParameterNode.prototype.paintVertexShape = function(c, x, y, w, h)1456{1457 c.translate(x, y);14581459 c.begin();1460 var minX = Math.max(w * 0.35, 70);1461 var maxX = Math.min(w * 0.65, w - 10);1462 c.begin();1463 c.moveTo(minX, h);1464 c.lineTo(10, h);1465 c.lineTo(10, 0);1466 c.lineTo(minX, 0);1467 c.moveTo(maxX, h);1468 c.lineTo(w - 10, h);1469 c.lineTo(w - 10, 0);1470 c.lineTo(maxX, 0);1471 c.stroke();14721473 var xSize = 50;1474 var ySize = 20;1475 1476 xSize = Math.min(xSize, w);1477 1478 if (xSize > ySize)1479 {1480 c.begin();1481 c.moveTo(10, ySize);1482 c.lineTo(xSize - ySize * 0.5, ySize);1483 c.lineTo(xSize, ySize * 0.5);1484 c.lineTo(xSize, 0);1485 c.lineTo(10, 0);1486 c.close();1487 c.fillAndStroke();1488 }1489 1490 c.rect(0, h * 0.35 - 10, 20, 20);1491 c.fillAndStroke();1492 c.rect(0, h * 0.65 - 10, 20, 20);1493 c.fillAndStroke();1494 c.rect(w - 20, h * 0.5 - 10, 20, 20);1495 c.fillAndStroke();1496};14971498mxCellRenderer.registerShape(mxShapeSysMLActivityParameterNode.prototype.cst.ACT_PARAM_NODE, mxShapeSysMLActivityParameterNode);14991500mxShapeSysMLActivityParameterNode.prototype.getConstraints = function(style, w, h)1501{1502 var constr = [];15031504 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.35), false));1505 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.65), false));1506 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));15071508 return (constr);1509};15101511//**********************************************************************************************************************************************************1512//Control Operator1513//**********************************************************************************************************************************************************1514/**1515* Extends mxShape.1516*/1517function mxShapeSysMLControlOperator(bounds, fill, stroke, strokewidth)1518{1519 mxShape.call(this);1520 this.bounds = bounds;1521 this.fill = fill;1522 this.stroke = stroke;1523 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1524};15251526/**1527* Extends mxShape.1528*/1529mxUtils.extend(mxShapeSysMLControlOperator, mxShape);15301531mxShapeSysMLControlOperator.prototype.cst = {1532 CONT_OPER : 'mxgraph.sysml.contOper'1533};15341535/**1536* Function: paintVertexShape1537* 1538* Paints the vertex shape.1539*/1540mxShapeSysMLControlOperator.prototype.paintVertexShape = function(c, x, y, w, h)1541{1542 c.translate(x, y);1543 this.background(c, x, y, w, h);1544 c.setShadow(false);1545 this.foreground(c, x, y, w, h);1546};15471548mxShapeSysMLControlOperator.prototype.background = function(c, x, y, w, h)1549{1550 c.rect(0, 0, w, h);1551 c.fillAndStroke();1552};15531554mxShapeSysMLControlOperator.prototype.foreground = function(c, x, y, w, h)1555{1556 var xSize = 130;1557 var ySize = 20;1558 1559 xSize = Math.min(xSize, w);1560 1561 if (xSize > ySize)1562 {1563 c.begin();1564 c.moveTo(0, ySize);1565 c.lineTo(xSize - ySize * 0.5, ySize);1566 c.lineTo(xSize, ySize * 0.5);1567 c.lineTo(xSize, 0);1568 c.stroke();1569 }1570};15711572mxCellRenderer.registerShape(mxShapeSysMLControlOperator.prototype.cst.CONT_OPER, mxShapeSysMLControlOperator);15731574//**********************************************************************************************************************************************************1575//Flow Final1576//**********************************************************************************************************************************************************1577/**1578* Extends mxShape.1579*/1580function mxShapeSysMLFlowFinal(bounds, fill, stroke, strokewidth)1581{1582 mxShape.call(this);1583 this.bounds = bounds;1584 this.fill = fill;1585 this.stroke = stroke;1586 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1587};15881589/**1590* Extends mxShape.1591*/1592mxUtils.extend(mxShapeSysMLFlowFinal, mxShape);15931594mxShapeSysMLFlowFinal.prototype.cst = {1595 FLOW_FINAL : 'mxgraph.sysml.flowFinal'1596};15971598/**1599* Function: paintVertexShape1600* 1601* Paints the vertex shape.1602*/1603mxShapeSysMLFlowFinal.prototype.paintVertexShape = function(c, x, y, w, h)1604{1605 c.translate(x, y);1606 1607 c.ellipse(0, 0, w, h);1608 c.fillAndStroke();16091610 c.setShadow(false);1611 1612 c.begin();1613 c.moveTo(w * 0.145, h * 0.145);1614 c.lineTo(w * 0.855, h * 0.855);1615 c.moveTo(w * 0.855, h * 0.145);1616 c.lineTo(w * 0.145, h * 0.855);1617 c.stroke();1618};16191620mxCellRenderer.registerShape(mxShapeSysMLFlowFinal.prototype.cst.FLOW_FINAL, mxShapeSysMLFlowFinal);16211622mxShapeSysMLFlowFinal.prototype.getConstraints = function(style, w, h)1623{1624 var constr = [];16251626 constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.145), false));1627 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1628 constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.145), false));1629 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1630 constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.855), false));1631 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1632 constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.855), false));1633 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));16341635 return (constr);1636};16371638//**********************************************************************************************************************************************************1639//Is Control1640//**********************************************************************************************************************************************************1641/**1642* Extends mxShape.1643*/1644function mxShapeSysMLIsControl(bounds, fill, stroke, strokewidth)1645{1646 mxShape.call(this);1647 this.bounds = bounds;1648 this.fill = fill;1649 this.stroke = stroke;1650 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1651};16521653/**1654* Extends mxShape.1655*/1656mxUtils.extend(mxShapeSysMLIsControl, mxShape);16571658mxShapeSysMLIsControl.prototype.cst = {1659 IS_CONTROL : 'mxgraph.sysml.isControl'1660};16611662/**1663* Function: paintVertexShape1664* 1665* Paints the vertex shape.1666*/1667mxShapeSysMLIsControl.prototype.paintVertexShape = function(c, x, y, w, h)1668{1669 c.translate(x, y);16701671 c.rect(0, h * 0.5 - 10, 10, 20);1672 c.fillAndStroke();1673 c.roundrect(10, 0, w - 20, h, 10, 10);1674 c.fillAndStroke();1675 c.rect(w - 10, h * 0.5 - 10, 10, 20);1676 c.fillAndStroke();1677};16781679mxCellRenderer.registerShape(mxShapeSysMLIsControl.prototype.cst.IS_CONTROL, mxShapeSysMLIsControl);16801681mxShapeSysMLIsControl.prototype.getConstraints = function(style, w, h)1682{1683 var constr = [];16841685 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1686 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));16871688 return (constr);1689};16901691//**********************************************************************************************************************************************************1692//Is Stream1693//**********************************************************************************************************************************************************1694/**1695* Extends mxShape.1696*/1697function mxShapeSysMLIsStream(bounds, fill, stroke, strokewidth)1698{1699 mxShape.call(this);1700 this.bounds = bounds;1701 this.fill = fill;1702 this.stroke = stroke;1703 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1704};17051706/**1707* Extends mxShape.1708*/1709mxUtils.extend(mxShapeSysMLIsStream, mxShape);17101711mxShapeSysMLIsStream.prototype.cst = {1712 IS_STREAM : 'mxgraph.sysml.isStream'1713};17141715/**1716* Function: paintVertexShape1717* 1718* Paints the vertex shape.1719*/1720mxShapeSysMLIsStream.prototype.paintVertexShape = function(c, x, y, w, h)1721{1722 c.translate(x, y);17231724 var strokeColor = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');1725 var fillColor = mxUtils.getValue(this.style, mxConstants.STYLE_FILLCOLOR, '#ffffff');17261727 c.setFillColor(strokeColor);1728 c.rect(0, h * 0.5 - 10, 10, 20);1729 c.fillAndStroke();1730 1731 c.setFillColor(fillColor);1732 c.roundrect(10, 0, w - 20, h, 10, 10);1733 c.fillAndStroke();17341735 c.setFillColor(strokeColor);1736 c.rect(w - 10, h * 0.5 - 10, 10, 20);1737 c.fillAndStroke();1738};17391740mxCellRenderer.registerShape(mxShapeSysMLIsStream.prototype.cst.IS_STREAM, mxShapeSysMLIsStream);17411742mxShapeSysMLIsStream.prototype.getConstraints = function(style, w, h)1743{1744 var constr = [];17451746 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1747 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));17481749 return (constr);1750};17511752//**********************************************************************************************************************************************************1753//Is Activity Stream1754//**********************************************************************************************************************************************************1755/**1756* Extends mxShape.1757*/1758function mxShapeSysMLIsActStream(bounds, fill, stroke, strokewidth)1759{1760 mxShape.call(this);1761 this.bounds = bounds;1762 this.fill = fill;1763 this.stroke = stroke;1764 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1765};17661767/**1768* Extends mxShape.1769*/1770mxUtils.extend(mxShapeSysMLIsActStream, mxShape);17711772mxShapeSysMLIsActStream.prototype.cst = {1773 IS_ACT_STREAM : 'mxgraph.sysml.isActStream'1774};17751776/**1777* Function: paintVertexShape1778* 1779* Paints the vertex shape.1780*/1781mxShapeSysMLIsActStream.prototype.paintVertexShape = function(c, x, y, w, h)1782{1783 c.translate(x, y);17841785 c.begin();1786 c.rect(0, 0, w - 10, h);1787 c.fillAndStroke();17881789 var xSize = 40;1790 var ySize = 20;1791 1792 xSize = Math.min(xSize, w);1793 1794 if (xSize > ySize)1795 {1796 c.begin();1797 c.moveTo(0, ySize);1798 c.lineTo(xSize - ySize * 0.5, ySize);1799 c.lineTo(xSize, ySize * 0.5);1800 c.lineTo(xSize, 0);1801 c.lineTo(0, 0);1802 c.close();1803 c.fillAndStroke();1804 }1805 1806 c.rect(w - 20, h * 0.5 - 10, 20, 20);1807 c.fillAndStroke();1808};18091810mxCellRenderer.registerShape(mxShapeSysMLIsActStream.prototype.cst.IS_ACT_STREAM, mxShapeSysMLIsActStream);18111812mxShapeSysMLIsActStream.prototype.getConstraints = function(style, w, h)1813{1814 var constr = [];18151816 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1817 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1818 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1819 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));18201821 return (constr);1822};18231824//**********************************************************************************************************************************************************1825//Parameter Set1826//**********************************************************************************************************************************************************1827/**1828* Extends mxShape.1829*/1830function mxShapeSysMLParameterSet(bounds, fill, stroke, strokewidth)1831{1832 mxShape.call(this);1833 this.bounds = bounds;1834 this.fill = fill;1835 this.stroke = stroke;1836 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1837};18381839/**1840* Extends mxShape.1841*/1842mxUtils.extend(mxShapeSysMLParameterSet, mxShape);18431844mxShapeSysMLParameterSet.prototype.cst = {1845 PARAM_SET : 'mxgraph.sysml.paramSet'1846};18471848/**1849* Function: paintVertexShape1850* 1851* Paints the vertex shape.1852*/1853mxShapeSysMLParameterSet.prototype.paintVertexShape = function(c, x, y, w, h)1854{1855 c.translate(x, y);18561857 c.rect(0, h * 0.5 - 28, 10, 56);1858 c.fillAndStroke();1859 c.roundrect(10, 0, w - 20, h, 10, 10);1860 c.fillAndStroke();1861 c.rect(w - 10, h * 0.5 - 28, 10, 56);1862 c.fillAndStroke();18631864 c.setShadow(false);18651866 c.rect(4, h * 0.5 - 24, 6, 20);1867 c.fillAndStroke();1868 c.rect(4, h * 0.5 + 4, 6, 20);1869 c.fillAndStroke();1870 c.rect(w - 10, h * 0.5 - 24, 6, 20);1871 c.fillAndStroke();1872 c.rect(w - 10, h * 0.5 + 4, 6, 20);1873 c.fillAndStroke();1874};18751876mxCellRenderer.registerShape(mxShapeSysMLParameterSet.prototype.cst.PARAM_SET, mxShapeSysMLParameterSet);18771878mxShapeSysMLParameterSet.prototype.getConstraints = function(style, w, h)1879{1880 var constr = [];18811882 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 0, -14));1883 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1884 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 0, 14));1885 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, 0, -14));1886 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1887 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, 0, 14));1888 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));1889 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1890 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));1891 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));1892 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1893 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));18941895 return (constr);1896};18971898//**********************************************************************************************************************************************************1899//Is Parameter Activity Set1900//**********************************************************************************************************************************************************1901/**1902* Extends mxShape.1903*/1904function mxShapeSysMLParameterActivitySet(bounds, fill, stroke, strokewidth)1905{1906 mxShape.call(this);1907 this.bounds = bounds;1908 this.fill = fill;1909 this.stroke = stroke;1910 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1911};19121913/**1914* Extends mxShape.1915*/1916mxUtils.extend(mxShapeSysMLParameterActivitySet, mxShape);19171918mxShapeSysMLParameterActivitySet.prototype.cst = {1919 PARAM_ACT_SET : 'mxgraph.sysml.paramActSet'1920};19211922/**1923* Function: paintVertexShape1924* 1925* Paints the vertex shape.1926*/1927mxShapeSysMLParameterActivitySet.prototype.paintVertexShape = function(c, x, y, w, h)1928{1929 c.translate(x, y);19301931 c.begin();1932 c.rect(10, 0, w - 20, h);1933 c.fillAndStroke();19341935 var xSize = 50;1936 var ySize = 20;1937 1938 xSize = Math.min(xSize, w);1939 1940 if (xSize > ySize)1941 {1942 c.begin();1943 c.moveTo(10, ySize);1944 c.lineTo(xSize - ySize * 0.5, ySize);1945 c.lineTo(xSize, ySize * 0.5);1946 c.lineTo(xSize, 0);1947 c.lineTo(10, 0);1948 c.close();1949 c.fillAndStroke();1950 }1951 1952 c.setShadow(false);1953 1954 if (h > 70)1955 {1956 c.rect(0, h * 0.5 - 28, 15, 56);1957 c.fillAndStroke();1958 c.rect(4, h * 0.5 - 24, 15, 20);1959 c.fillAndStroke();1960 c.rect(4, h * 0.5 + 4, 15, 20);1961 c.fillAndStroke();1962 1963 c.rect(w - 15, h * 0.5 - 28, 15, 56);1964 c.fillAndStroke();1965 c.rect(w - 19, h * 0.5 - 24, 15, 20);1966 c.fillAndStroke();1967 c.rect(w - 19, h * 0.5 + 4, 15, 20);1968 c.fillAndStroke();1969 }1970};19711972mxCellRenderer.registerShape(mxShapeSysMLParameterActivitySet.prototype.cst.PARAM_ACT_SET, mxShapeSysMLParameterActivitySet);19731974mxShapeSysMLParameterActivitySet.prototype.getConstraints = function(style, w, h)1975{1976 var constr = [];19771978 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 0, -14));1979 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1980 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 0, 14));1981 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, 0, -14));1982 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1983 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, 0, 14));1984 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));1985 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1986 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));1987 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));1988 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1989 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));19901991 return (constr);1992};19931994//**********************************************************************************************************************************************************1995//Probability1996//**********************************************************************************************************************************************************1997/**1998* Extends mxShape.1999*/2000function mxShapeSysMLProbability(bounds, fill, stroke, strokewidth)2001{2002 mxShape.call(this);2003 this.bounds = bounds;2004 this.fill = fill;2005 this.stroke = stroke;2006 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2007};20082009/**2010* Extends mxShape.2011*/2012mxUtils.extend(mxShapeSysMLProbability, mxShape);20132014mxShapeSysMLProbability.prototype.cst = {2015 PROBABILITY : 'mxgraph.sysml.probability'2016};20172018/**2019* Function: paintVertexShape2020* 2021* Paints the vertex shape.2022*/2023mxShapeSysMLProbability.prototype.paintVertexShape = function(c, x, y, w, h)2024{2025 c.translate(x, y);20262027 c.roundrect(0, 0, w - 10, h, 10, 10);2028 c.fillAndStroke();2029 c.rect(w - 10, h * 0.25 - 28, 10, 56);2030 c.fillAndStroke();2031 c.rect(w - 10, h * 0.75 - 28, 10, 56);2032 c.fillAndStroke();20332034 c.setShadow(false);20352036 c.rect(w - 10, h * 0.25 - 24, 6, 20);2037 c.fillAndStroke();2038 c.rect(w - 10, h * 0.25 + 4, 6, 20);2039 c.fillAndStroke();2040 c.rect(w - 10, h * 0.75 - 24, 6, 20);2041 c.fillAndStroke();2042 c.rect(w - 10, h * 0.75 + 4, 6, 20);2043 c.fillAndStroke();2044};20452046mxCellRenderer.registerShape(mxShapeSysMLProbability.prototype.cst.PROBABILITY, mxShapeSysMLProbability);20472048mxShapeSysMLProbability.prototype.getConstraints = function(style, w, h)2049{2050 var constr = [];20512052 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));2053 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2054 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));2055 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false, null, 0, -14));2056 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false, null, 0, 14));2057 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));2058 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false, null, 0, -14));2059 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));2060 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false, null, 0, 14));2061 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false, null, -5, 0));2062 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, -5, 0));2063 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false, null, -5, 0));2064 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false, null, -5, 0));2065 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false, null, -5, 0));2066 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false, null, -5, 0));20672068 return (constr);2069};20702071//**********************************************************************************************************************************************************2072//Is Activity Stream2073//**********************************************************************************************************************************************************2074/**2075* Extends mxShape.2076*/2077function mxShapeSysMLActivityProbability(bounds, fill, stroke, strokewidth)2078{2079 mxShape.call(this);2080 this.bounds = bounds;2081 this.fill = fill;2082 this.stroke = stroke;2083 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2084};20852086/**2087* Extends mxShape.2088*/2089mxUtils.extend(mxShapeSysMLActivityProbability, mxShape);20902091mxShapeSysMLActivityProbability.prototype.cst = {2092 ACT_PROB : 'mxgraph.sysml.actProb'2093};20942095/**2096* Function: paintVertexShape2097* 2098* Paints the vertex shape.2099*/2100mxShapeSysMLActivityProbability.prototype.paintVertexShape = function(c, x, y, w, h)2101{2102 c.translate(x, y);21032104 c.begin();2105 c.rect(0, 0, w - 10, h);2106 c.fillAndStroke();21072108 var xSize = 40;2109 var ySize = 20;2110 2111 xSize = Math.min(xSize, w);2112 2113 if (xSize > ySize)2114 {2115 c.begin();2116 c.moveTo(0, ySize);2117 c.lineTo(xSize - ySize * 0.5, ySize);2118 c.lineTo(xSize, ySize * 0.5);2119 c.lineTo(xSize, 0);2120 c.lineTo(0, 0);2121 c.close();2122 c.fillAndStroke();2123 }2124 2125 c.setShadow(false);2126 2127 if (h > 70)2128 {2129 c.rect(w - 15, h * 0.25 - 28, 15, 56);2130 c.fillAndStroke();2131 c.rect(w - 19, h * 0.25 - 24, 15, 20);2132 c.fillAndStroke();2133 c.rect(w - 19, h * 0.25 + 4, 15, 20);2134 c.fillAndStroke();21352136 c.rect(w - 15, h * 0.75 - 28, 15, 56);2137 c.fillAndStroke();2138 c.rect(w - 19, h * 0.75 - 24, 15, 20);2139 c.fillAndStroke();2140 c.rect(w - 19, h * 0.75 + 4, 15, 20);2141 c.fillAndStroke();2142 }2143};21442145mxCellRenderer.registerShape(mxShapeSysMLActivityProbability.prototype.cst.ACT_PROB, mxShapeSysMLActivityProbability);21462147mxShapeSysMLActivityProbability.prototype.getConstraints = function(style, w, h)2148{2149 var constr = [];21502151 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));2152 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2153 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));2154 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false, null, 0, -14));2155 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false, null, 0, 14));2156 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));2157 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false, null, 0, -14));2158 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));2159 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false, null, 0, 14));2160 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false, null, -5, 0));2161 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, -5, 0));2162 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false, null, -5, 0));2163 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false, null, -5, 0));2164 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false, null, -5, 0));2165 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false, null, -5, 0));21662167 return (constr);2168};21692170//**********************************************************************************************************************************************************2171//Object Flow Right2172//**********************************************************************************************************************************************************2173/**2174* Extends mxShape.2175*/2176function mxShapeSysMLObjectFlowRight(bounds, fill, stroke, strokewidth)2177{2178 mxShape.call(this);2179 this.bounds = bounds;2180 this.fill = fill;2181 this.stroke = stroke;2182 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2183};21842185/**2186* Extends mxShape.2187*/2188mxUtils.extend(mxShapeSysMLObjectFlowRight, mxShape);21892190mxShapeSysMLObjectFlowRight.prototype.cst = {2191 OBJ_FLOW_R : 'mxgraph.sysml.objFlowR'2192};21932194/**2195* Function: paintVertexShape2196* 2197* Paints the vertex shape.2198*/2199mxShapeSysMLObjectFlowRight.prototype.paintVertexShape = function(c, x, y, w, h)2200{2201 c.translate(x, y);22022203 c.roundrect(0, 0, w - 10, h, 10, 10);2204 c.fillAndStroke();2205 c.rect(w - 10, h * 0.5 - 10, 10, 20);2206 c.fillAndStroke();2207};22082209mxCellRenderer.registerShape(mxShapeSysMLObjectFlowRight.prototype.cst.OBJ_FLOW_R, mxShapeSysMLObjectFlowRight);22102211mxShapeSysMLObjectFlowRight.prototype.getConstraints = function(style, w, h)2212{2213 var constr = [];22142215 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2216 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2217 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, -5, 0));2218 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false, null, -5, 0));22192220 return (constr);2221};22222223//**********************************************************************************************************************************************************2224//Object Flow Left2225//**********************************************************************************************************************************************************2226/**2227* Extends mxShape.2228*/2229function mxShapeSysMLObjectFlowLeft(bounds, fill, stroke, strokewidth)2230{2231 mxShape.call(this);2232 this.bounds = bounds;2233 this.fill = fill;2234 this.stroke = stroke;2235 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2236};22372238/**2239* Extends mxShape.2240*/2241mxUtils.extend(mxShapeSysMLObjectFlowLeft, mxShape);22422243mxShapeSysMLObjectFlowLeft.prototype.cst = {2244 OBJ_FLOW_L : 'mxgraph.sysml.objFlowL'2245};22462247/**2248* Function: paintVertexShape2249* 2250* Paints the vertex shape.2251*/2252mxShapeSysMLObjectFlowLeft.prototype.paintVertexShape = function(c, x, y, w, h)2253{2254 c.translate(x, y);22552256 c.rect(0, h * 0.5 - 10, 10, 20);2257 c.fillAndStroke();2258 c.roundrect(10, 0, w - 10, h, 10, 10);2259 c.fillAndStroke();2260};22612262mxCellRenderer.registerShape(mxShapeSysMLObjectFlowLeft.prototype.cst.OBJ_FLOW_L, mxShapeSysMLObjectFlowLeft);22632264mxShapeSysMLObjectFlowLeft.prototype.getConstraints = function(style, w, h)2265{2266 var constr = [];22672268 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2269 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2270 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, 5, 0));2271 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false, null, 5, 0));22722273 return (constr);2274};22752276//**********************************************************************************************************************************************************2277//Activity Partition2278//**********************************************************************************************************************************************************2279/**2280* Extends mxShape.2281*/2282function mxShapeSysMLActivityPartition(bounds, fill, stroke, strokewidth)2283{2284 mxShape.call(this);2285 this.bounds = bounds;2286 this.fill = fill;2287 this.stroke = stroke;2288 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2289};22902291/**2292* Extends mxShape.2293*/2294mxUtils.extend(mxShapeSysMLActivityPartition, mxShape);22952296mxShapeSysMLActivityPartition.prototype.cst = {2297 ACT_PART : 'mxgraph.sysml.actPart'2298};22992300/**2301* Function: paintVertexShape2302* 2303* Paints the vertex shape.2304*/2305mxShapeSysMLActivityPartition.prototype.paintVertexShape = function(c, x, y, w, h)2306{2307 c.translate(x, y);23082309 c.begin();2310 c.moveTo(0, 0);2311 c.lineTo(0, h);2312 c.moveTo(w, 0);2313 c.lineTo(w, h);2314 c.stroke();2315 2316};23172318mxCellRenderer.registerShape(mxShapeSysMLActivityPartition.prototype.cst.ACT_PART, mxShapeSysMLActivityPartition);23192320//**********************************************************************************************************************************************************2321//Continuation2322//**********************************************************************************************************************************************************2323/**2324* Extends mxShape.2325*/2326function mxShapeSysMLContinuation(bounds, fill, stroke, strokewidth)2327{2328 mxShape.call(this);2329 this.bounds = bounds;2330 this.fill = fill;2331 this.stroke = stroke;2332 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2333};23342335/**2336* Extends mxShape.2337*/2338mxUtils.extend(mxShapeSysMLContinuation, mxShape);23392340mxShapeSysMLContinuation.prototype.cst = {2341 CONT : 'mxgraph.sysml.cont'2342};23432344/**2345* Function: paintVertexShape2346* 2347* Paints the vertex shape.2348*/2349mxShapeSysMLContinuation.prototype.paintVertexShape = function(c, x, y, w, h)2350{2351 c.translate(x, y);23522353 if (w > h)2354 {2355 var r = h * 0.5;2356 2357 c.begin();2358 c.moveTo(w - r, 0);2359 c.arcTo(r, r, 0, 0, 1, w - r, h);2360 c.lineTo(r, h);2361 c.arcTo(r, r, 0, 0, 1, r, 0);2362 c.close();2363 c.fillAndStroke();2364 }2365 else2366 {2367 var r = w * 0.5;2368 2369 c.begin();2370 c.moveTo(0, h - r);2371 c.arcTo(r, r, 0, 0, 0, w, h - r);2372 c.lineTo(w, r);2373 c.arcTo(r, r, 0, 0, 0, 0, r);2374 c.close();2375 c.fillAndStroke();2376 }2377};23782379mxCellRenderer.registerShape(mxShapeSysMLContinuation.prototype.cst.CONT, mxShapeSysMLContinuation);23802381mxShapeSysMLContinuation.prototype.getConstraints = function(style, w, h)2382{2383 var constr = [];23842385 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2386 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2387 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));2388 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));2389 2390 if (w > h)2391 {2392 var r = h * 0.5;23932394 if (w > 2 * h)2395 {2396 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));2397 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));2398 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));2399 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));2400 }2401 }2402 else2403 {2404 var r = w * 0.5;2405 2406 if (h > 2 * w)2407 {2408 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));2409 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));2410 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));2411 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));2412 }2413 }24142415 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, r * 0.29, r * 0.29));2416 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - r * 0.29, r * 0.29));2417 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, r * 0.29, h - r * 0.29));2418 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - r * 0.29, h - r * 0.29));24192420 return (constr);2421};24222423//**********************************************************************************************************************************************************2424//Coregion2425//**********************************************************************************************************************************************************2426/**2427* Extends mxShape.2428*/2429function mxShapeSysMLCoregion(bounds, fill, stroke, strokewidth)2430{2431 mxShape.call(this);2432 this.bounds = bounds;2433 this.fill = fill;2434 this.stroke = stroke;2435 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2436};24372438/**2439* Extends mxShape.2440*/2441mxUtils.extend(mxShapeSysMLCoregion, mxShape);24422443mxShapeSysMLCoregion.prototype.cst = {2444 COREGION : 'mxgraph.sysml.coregion'2445};24462447/**2448* Function: paintVertexShape2449* 2450* Paints the vertex shape.2451*/2452mxShapeSysMLCoregion.prototype.paintVertexShape = function(c, x, y, w, h)2453{2454 c.translate(x, y);24552456 var brack = 10;2457 2458 brack = Math.min(brack, h);2459 2460 c.begin();2461 c.moveTo(0, brack);2462 c.lineTo(0, 0);2463 c.lineTo(w, 0);2464 c.lineTo(w, brack);2465 c.moveTo(0, h - brack);2466 c.lineTo(0, h);2467 c.lineTo(w, h);2468 c.lineTo(w, h - brack);2469 c.stroke();2470};24712472mxCellRenderer.registerShape(mxShapeSysMLCoregion.prototype.cst.COREGION, mxShapeSysMLCoregion);24732474//**********************************************************************************************************************************************************2475//X marker2476//**********************************************************************************************************************************************************2477mxMarker.addMarker('sysMLx', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)2478{2479 var nx = unitX * (size + sw + 1);2480 var ny = unitY * (size + sw + 1);24812482 return function()2483 {2484 c.begin();2485 c.moveTo(pe.x - nx / 2 - ny / 2, pe.y - ny / 2 + nx / 2);2486 c.lineTo(pe.x + nx / 2 + ny / 2, pe.y + ny / 2 - nx / 2);24872488 c.moveTo(pe.x + nx / 2 - ny / 2, pe.y + ny / 2 + nx / 2);2489 c.lineTo(pe.x - nx / 2 + ny / 2, pe.y - ny / 2 - nx / 2);2490 c.stroke();2491 };2492});24932494//**********************************************************************************************************************************************************2495//Dimension2496//**********************************************************************************************************************************************************2497/**2498* Extends mxShape.2499*/2500function mxShapeSysMLDimension(bounds, fill, stroke, strokewidth)2501{2502 mxShape.call(this);2503 this.bounds = bounds;2504 this.fill = fill;2505 this.stroke = stroke;2506 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2507};25082509/**2510* Extends mxShape.2511*/2512mxUtils.extend(mxShapeSysMLDimension, mxShape);25132514mxShapeSysMLDimension.prototype.cst = {2515 DIMENSION : 'mxgraph.sysml.dimension'2516};25172518/**2519* Function: paintVertexShape2520* 2521* Paints the vertex shape.2522*/2523mxShapeSysMLDimension.prototype.paintVertexShape = function(c, x, y, w, h)2524{2525 c.translate(x, y);2526 this.background(c, x, y, w, h);2527};25282529mxShapeSysMLDimension.prototype.background = function(c, x, y, w, h)2530{2531 c.begin();2532 c.moveTo(0, 20);2533 c.lineTo(w, 20);2534 c.moveTo(10, 15);2535 c.lineTo(0, 20);2536 c.lineTo(10, 25);2537 c.moveTo(w - 10, 15);2538 c.lineTo(w, 20);2539 c.lineTo(w - 10, 25);2540 c.moveTo(0, 15);2541 c.lineTo(0, h);2542 c.moveTo(w, 15);2543 c.lineTo(w, h);2544 c.stroke();2545};25462547mxCellRenderer.registerShape(mxShapeSysMLDimension.prototype.cst.DIMENSION, mxShapeSysMLDimension);25482549//**********************************************************************************************************************************************************2550//Lost marker2551//**********************************************************************************************************************************************************2552mxMarker.addMarker('sysMLLost', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)2553{2554 var nx = unitX * (size + sw + 1);2555 var ny = unitY * (size + sw + 1);2556 var a = size / 2;25572558 return function()2559 {2560 c.begin();2561 c.moveTo(pe.x - 1.5 * nx - ny / 2, pe.y - 1.5 * ny + nx / 2);2562 c.lineTo(pe.x - nx / 2, pe.y - ny / 2);2563 c.lineTo(pe.x - 1.5 * nx + ny / 2, pe.y - 1.5 * ny - nx / 2);2564 c.stroke();25652566 c.ellipse(pe.x - 0.5 * nx - a, pe.y - 0.5 * ny - a, 2 * a, 2 * a);25672568 var strokeColor = mxUtils.getValue(shape.style, mxConstants.STYLE_STROKECOLOR, '#000000');2569 c.setFillColor(strokeColor);2570 c.fillAndStroke();2571 };2572});25732574//**********************************************************************************************************************************************************2575//Found marker2576//**********************************************************************************************************************************************************2577mxMarker.addMarker('sysMLFound', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)2578{2579 var nx = unitX * (size + sw + 1);2580 var ny = unitY * (size + sw + 1);2581 var a = size / 2;25822583 return function()2584 {2585 c.ellipse(pe.x - 0.5 * nx - a, pe.y - 0.5 * ny - a, 2 * a, 2 * a);25862587 var strokeColor = mxUtils.getValue(shape.style, mxConstants.STYLE_STROKECOLOR, '#000000');2588 c.setFillColor(strokeColor);2589 c.fillAndStroke();2590 };2591});25922593//**********************************************************************************************************************************************************2594//Composite State2595//**********************************************************************************************************************************************************2596/**2597* Extends mxShape.2598*/2599function mxShapeSysMLCompositeState(bounds, fill, stroke, strokewidth)2600{2601 mxShape.call(this);2602 this.bounds = bounds;2603 this.fill = fill;2604 this.stroke = stroke;2605 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2606};26072608/**2609* Extends mxShape.2610*/2611mxUtils.extend(mxShapeSysMLCompositeState, mxShape);26122613mxShapeSysMLCompositeState.prototype.cst = {2614 COMP_STATE : 'mxgraph.sysml.compState'2615};26162617/**2618* Function: paintVertexShape2619* 2620* Paints the vertex shape.2621*/2622mxShapeSysMLCompositeState.prototype.paintVertexShape = function(c, x, y, w, h)2623{2624 c.translate(x, y);2625 this.background(c, x, y, w, h);2626};26272628mxShapeSysMLCompositeState.prototype.background = function(c, x, y, w, h)2629{2630 var tabH = 20;2631 var tabW = 110;2632 c.roundrect(0, tabH, w, h - tabH, 10, 10);2633 c.fillAndStroke();2634 c.rect(15, 0, tabW, tabH);2635 c.fillAndStroke();2636};26372638mxCellRenderer.registerShape(mxShapeSysMLCompositeState.prototype.cst.COMP_STATE, mxShapeSysMLCompositeState);26392640mxShapeSysMLCompositeState.prototype.getConstraints = function(style, w, h)2641{2642 var constr = [];26432644 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 22.9));2645 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 2.9, 22.9));2646 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, h - 2.9));2647 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 2.9, h - 2.9));2648 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - 20) * 0.25 + 20));2649 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - 20) * 0.5 + 20));2650 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - 20) * 0.75 + 20));2651 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, 0, (h - 20) * 0.25 + 20));2652 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, 0, (h - 20) * 0.5 + 20));2653 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, 0, (h - 20) * 0.75 + 20));2654 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));2655 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));2656 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));2657 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 15, 0));2658 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 70, 0));2659 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 125, 0));26602661 if (w * 0.75 > 125)2662 {2663 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false, null, 0, 20));2664 2665 if (w * 0.5 > 125)2666 {2667 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, 0, 20));26682669 if (w * 0.25 > 125)2670 {2671 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false, null, 0, 20));2672 }2673 }2674 }2675 2676 return (constr);2677};26782679//**********************************************************************************************************************************************************2680//Region2681//**********************************************************************************************************************************************************2682/**2683* Extends mxShape.2684*/2685function mxShapeSysMLRegion(bounds, fill, stroke, strokewidth)2686{2687 mxShape.call(this);2688 this.bounds = bounds;2689 this.fill = fill;2690 this.stroke = stroke;2691 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2692};26932694/**2695* Extends mxShape.2696*/2697mxUtils.extend(mxShapeSysMLRegion, mxShape);26982699mxShapeSysMLRegion.prototype.cst = {2700 REGION : 'mxgraph.sysml.region'2701};27022703/**2704* Function: paintVertexShape2705* 2706* Paints the vertex shape.2707*/2708mxShapeSysMLRegion.prototype.paintVertexShape = function(c, x, y, w, h)2709{2710 var tabH = 20;2711 var tabW = 50;27122713 c.translate(x, y);2714 this.background(c, x, y, w, h, tabH, tabW);2715 c.setShadow(false);2716 this.foreground(c, x, y, w, h, tabH, tabW);2717};27182719mxShapeSysMLRegion.prototype.background = function(c, x, y, w, h, tabH, tabW)2720{2721 var strokeW = parseInt(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '1'));2722 c.roundrect(0, tabH, w, h - tabH, 10, 10);2723 c.fillAndStroke();2724 2725 c.setStrokeWidth(strokeW * 2);2726 c.rect(15, 0, tabW, tabH);2727 c.fillAndStroke();2728 c.setStrokeWidth(strokeW);2729};27302731mxShapeSysMLRegion.prototype.foreground = function(c, x, y, w, h, tabH, tabW)2732{2733 c.setDashed(true);2734 c.begin();2735 c.moveTo(w * 0.5, tabH);2736 c.lineTo(w * 0.5, h);2737 c.stroke();2738};27392740mxCellRenderer.registerShape(mxShapeSysMLRegion.prototype.cst.REGION, mxShapeSysMLRegion);27412742mxShapeSysMLRegion.prototype.getConstraints = function(style, w, h)2743{2744 var constr = [];27452746 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 22.9));2747 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 2.9, 22.9));2748 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, h - 2.9));2749 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 2.9, h - 2.9));2750 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - 20) * 0.25 + 20));2751 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - 20) * 0.5 + 20));2752 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - 20) * 0.75 + 20));2753 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, 0, (h - 20) * 0.25 + 20));2754 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, 0, (h - 20) * 0.5 + 20));2755 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, 0, (h - 20) * 0.75 + 20));2756 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));2757 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));2758 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));2759 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 15, 0));2760 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 40, 0));2761 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 65, 0));27622763 if (w * 0.75 > 65)2764 {2765 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false, null, 0, 20));2766 2767 if (w * 0.5 > 65)2768 {2769 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, 0, 20));27702771 if (w * 0.25 > 65)2772 {2773 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false, null, 0, 20));2774 }2775 }2776 }2777 2778 return (constr);2779};27802781//**********************************************************************************************************************************************************2782//Simple State2783//**********************************************************************************************************************************************************2784/**2785* Extends mxShape.2786*/2787function mxShapeSysMLSimpleState(bounds, fill, stroke, strokewidth)2788{2789 mxShape.call(this);2790 this.bounds = bounds;2791 this.fill = fill;2792 this.stroke = stroke;2793 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2794};27952796/**2797* Extends mxShape.2798*/2799mxUtils.extend(mxShapeSysMLSimpleState, mxShape);28002801mxShapeSysMLSimpleState.prototype.cst = {2802 SIMPLE_STATE : 'mxgraph.sysml.simpleState'2803};28042805/**2806* Function: paintVertexShape2807* 2808* Paints the vertex shape.2809*/2810mxShapeSysMLSimpleState.prototype.paintVertexShape = function(c, x, y, w, h)2811{2812 c.translate(x, y);2813 this.background(c, x, y, w, h);2814 c.setShadow(false);2815// this.foreground(c, x, y, w, h);2816};28172818mxShapeSysMLSimpleState.prototype.background = function(c, x, y, w, h)2819{2820 var strokeW = parseInt(mxUtils.getValue(this.style, mxConstants.STYLE_STROKEWIDTH, '1'));2821 c.roundrect(0, 0, w, h, 10, 10);2822 c.fillAndStroke();2823};28242825mxShapeSysMLSimpleState.prototype.foreground = function(c, x, y, w, h)2826{2827 c.begin();2828 c.moveTo(0, 20);2829 c.lineTo(w, 20);2830 c.stroke();2831};28322833mxCellRenderer.registerShape(mxShapeSysMLSimpleState.prototype.cst.SIMPLE_STATE, mxShapeSysMLSimpleState);28342835mxShapeSysMLSimpleState.prototype.getConstraints = function(style, w, h)2836{2837 var constr = [];28382839 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 2.9));2840 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 2.9, 2.9));2841 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, h - 2.9));2842 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 2.9, h - 2.9));2843 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));2844 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));2845 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));2846 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));2847 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));2848 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));2849 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false));2850 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2851 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false));2852 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));2853 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2854 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));2855 2856 return (constr);2857};28582859//**********************************************************************************************************************************************************2860//State Machine2861//**********************************************************************************************************************************************************2862/**2863* Extends mxShape.2864*/2865function mxShapeSysMLStateMachine(bounds, fill, stroke, strokewidth)2866{2867 mxShape.call(this);2868 this.bounds = bounds;2869 this.fill = fill;2870 this.stroke = stroke;2871 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2872};28732874/**2875* Extends mxShape.2876*/2877mxUtils.extend(mxShapeSysMLStateMachine, mxShape);28782879mxShapeSysMLStateMachine.prototype.cst = {2880 STATE_MACHINE : 'mxgraph.sysml.stateMachine'2881};28822883/**2884* Function: paintVertexShape2885* 2886* Paints the vertex shape.2887*/2888mxShapeSysMLStateMachine.prototype.paintVertexShape = function(c, x, y, w, h)2889{2890 c.translate(x, y);2891 this.background(c, x, y, w, h);2892 c.setShadow(false);2893 this.foreground(c, x, y, w, h);2894};28952896mxShapeSysMLStateMachine.prototype.background = function(c, x, y, w, h)2897{2898 c.roundrect(0, 0, w - 10, h, 10, 10);2899 c.fillAndStroke();2900};29012902mxShapeSysMLStateMachine.prototype.foreground = function(c, x, y, w, h)2903{2904 var strokeC = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');2905 c.setFillColor(strokeC);29062907 c.ellipse(w - 20, h * 0.5 - 10, 20, 20);2908 c.stroke();2909 2910 c.ellipse(w - 17, h * 0.5 - 7, 14, 14);2911 c.fillAndStroke();2912};29132914mxCellRenderer.registerShape(mxShapeSysMLStateMachine.prototype.cst.STATE_MACHINE, mxShapeSysMLStateMachine);29152916mxShapeSysMLStateMachine.prototype.getConstraints = function(style, w, h)2917{2918 var constr = [];29192920 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 2.9));2921 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 12.9, 2.9));2922 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, h - 2.9));2923 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 12.9, h - 2.9));2924 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));2925 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));2926 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));2927 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));2928 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));2929 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));2930 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false, null, -10, 0));2931 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2932 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false, null, -10, 0));2933 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));2934 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));2935 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));2936 2937 return (constr);2938};29392940//**********************************************************************************************************************************************************2941// X2942//**********************************************************************************************************************************************************2943/**2944* Extends mxShape.2945*/2946function mxShapeSysMLX(bounds, fill, stroke, strokewidth)2947{2948 mxShape.call(this);2949 this.bounds = bounds;2950 this.fill = fill;2951 this.stroke = stroke;2952 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2953};29542955/**2956* Extends mxShape.2957*/2958mxUtils.extend(mxShapeSysMLX, mxShape);29592960mxShapeSysMLX.prototype.cst = {2961 X : 'mxgraph.sysml.x'2962};29632964/**2965* Function: paintVertexShape2966* 2967* Paints the vertex shape.2968*/2969mxShapeSysMLX.prototype.paintVertexShape = function(c, x, y, w, h)2970{2971 c.translate(x, y);29722973 c.begin();2974 c.moveTo(0, 0);2975 c.lineTo(w, h);2976 c.moveTo(0, h);2977 c.lineTo(w, 0);2978 c.fillAndStroke();2979};29802981mxCellRenderer.registerShape(mxShapeSysMLX.prototype.cst.X, mxShapeSysMLX);29822983mxShapeSysMLX.prototype.getConstraints = function(style, w, h)2984{2985 var constr = [];29862987 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));2988 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));2989 constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false));2990 constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false));2991 2992 return (constr);2993};29942995//**********************************************************************************************************************************************************2996//Submachine State2997//**********************************************************************************************************************************************************2998/**2999* Extends mxShape.3000*/3001function mxShapeSysMLSubmachineState(bounds, fill, stroke, strokewidth)3002{3003 mxShape.call(this);3004 this.bounds = bounds;3005 this.fill = fill;3006 this.stroke = stroke;3007 this.strokewidth = (strokewidth != null) ? strokewidth : 1;3008};30093010/**3011* Extends mxShape.3012*/3013mxUtils.extend(mxShapeSysMLSubmachineState, mxShape);30143015mxShapeSysMLSubmachineState.prototype.cst = {3016 SUBMACHINE_STATE : 'mxgraph.sysml.submState'3017};30183019/**3020* Function: paintVertexShape3021* 3022* Paints the vertex shape.3023*/3024mxShapeSysMLSubmachineState.prototype.paintVertexShape = function(c, x, y, w, h)3025{3026 c.translate(x, y);3027 this.background(c, x, y, w, h);3028 c.setShadow(false);3029 this.foreground(c, x, y, w, h);3030};30313032mxShapeSysMLSubmachineState.prototype.background = function(c, x, y, w, h)3033{3034 c.roundrect(0, 0, w - 10, h, 10, 10);3035 c.fillAndStroke();3036};30373038mxShapeSysMLSubmachineState.prototype.foreground = function(c, x, y, w, h)3039{3040 var strokeC = mxUtils.getValue(this.style, mxConstants.STYLE_STROKECOLOR, '#000000');3041 c.setFillColor(strokeC);30423043 c.ellipse(w - 20, h * 0.5 - 10, 20, 20);3044 c.stroke();3045 3046 c.ellipse(w - 17, h * 0.5 - 7, 14, 14);3047 c.fillAndStroke();3048};30493050mxCellRenderer.registerShape(mxShapeSysMLSubmachineState.prototype.cst.SUBMACHINE_STATE, mxShapeSysMLSubmachineState);30513052mxShapeSysMLSubmachineState.prototype.getConstraints = function(style, w, h)3053{3054 var constr = [];30553056 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, 2.9));3057 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 12.9, 2.9));3058 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2.9, h - 2.9));3059 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - 12.9, h - 2.9));3060 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 1), false));3061 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));3062 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 1), false));3063 constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false));3064 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));3065 constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false));3066 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.25), false, null, -10, 0));3067 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));3068 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.75), false, null, -10, 0));3069 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.25), false));3070 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));3071 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.75), false));3072 3073 return (constr);3074};30753076//**********************************************************************************************************************************************************3077//Use Case with Extension Points3078//**********************************************************************************************************************************************************3079/**3080* Extends mxShape.3081*/3082function mxShapeSysMLUseCaseExtensionPoints(bounds, fill, stroke, strokewidth)3083{3084 mxShape.call(this);3085 this.bounds = bounds;3086 this.fill = fill;3087 this.stroke = stroke;3088 this.strokewidth = (strokewidth != null) ? strokewidth : 1;3089};30903091/**3092* Extends mxShape.3093*/3094mxUtils.extend(mxShapeSysMLUseCaseExtensionPoints, mxShape);30953096mxShapeSysMLUseCaseExtensionPoints.prototype.cst = {3097 USE_CASE_EXT_PT : 'mxgraph.sysml.useCaseExtPt'3098};30993100/**3101* Function: paintVertexShape3102* 3103* Paints the vertex shape.3104*/3105mxShapeSysMLUseCaseExtensionPoints.prototype.paintVertexShape = function(c, x, y, w, h)3106{3107 c.translate(x, y);3108 this.background(c, x, y, w, h);3109 c.setShadow(false);3110 this.foreground(c, x, y, w, h);3111};31123113mxShapeSysMLUseCaseExtensionPoints.prototype.background = function(c, x, y, w, h)3114{3115 c.ellipse(0, 0, w, h);3116 c.fillAndStroke();3117};31183119mxShapeSysMLUseCaseExtensionPoints.prototype.foreground = function(c, x, y, w, h)3120{3121 c.begin();3122 c.moveTo(w * 0.02, h * 0.35);3123 c.lineTo(w * 0.98, h * 0.35);3124 c.stroke();3125};31263127mxCellRenderer.registerShape(mxShapeSysMLUseCaseExtensionPoints.prototype.cst.USE_CASE_EXT_PT, mxShapeSysMLUseCaseExtensionPoints);31283129mxShapeSysMLUseCaseExtensionPoints.prototype.getConstraints = function(style, w, h)3130{3131 var constr = [];31323133 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));3134 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));3135 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));3136 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));3137 constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.145), false));3138 constr.push(new mxConnectionConstraint(new mxPoint(0.145, 0.855), false));3139 constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.855), false));3140 constr.push(new mxConnectionConstraint(new mxPoint(0.855, 0.145), false));3141 3142 return (constr);3143};31443145//**********************************************************************************************************************************************************3146//Port3147//**********************************************************************************************************************************************************3148/**3149* Extends mxShape.3150*/3151function mxShapeSysMLPort(bounds, fill, stroke, strokewidth)3152{3153 mxShape.call(this);3154 this.bounds = bounds;3155 this.fill = fill;3156 this.stroke = stroke;3157 this.strokewidth = (strokewidth != null) ? strokewidth : 1;3158};31593160/**3161* Extends mxShape.3162*/3163mxUtils.extend(mxShapeSysMLPort, mxShape);31643165mxShapeSysMLPort.prototype.cst = {3166 PORT : 'mxgraph.sysml.port'3167};31683169mxShapeSysMLPort.prototype.customProperties = [3170 {name: 'sysMLPortType', dispName: 'Port Type', type: 'enum',3171 enumList:[3172 {val:'empty', dispName:'Empty'},3173 {val:'flowN', dispName:'Flow Up'},3174 {val:'flowE', dispName:'Flow Right'},3175 {val:'flowS', dispName:'Flow Down'},3176 {val:'flowW', dispName:'Flow Left'},3177 {val:'doubleH', dispName:'Double Horizontal'},3178 {val:'doubleV', dispName:'Double Vertical'}3179 ]}3180];31813182/**3183* Function: paintVertexShape3184* 3185* Paints the vertex shape.3186*/3187mxShapeSysMLPort.prototype.paintVertexShape = function(c, x, y, w, h)3188{3189 c.translate(x, y);3190 c.rect(0, 0, w, h);3191 c.fillAndStroke();3192 var portType = mxUtils.getValue(this.style, 'sysMLPortType', 'empty');3193 3194 switch (portType)3195 {3196 case 'flowN' :3197 c.begin();3198 c.moveTo(0.25 * w, 0.5 * h);3199 c.lineTo(0.5 * w, 0.25 * h);3200 c.lineTo(0.75 * w, 0.5 * h);3201 c.moveTo(0.5 * w, 0.25 * h);3202 c.lineTo(0.5 * w, 0.75 * h);3203 c.stroke();3204 break;3205 case 'flowE' :3206 c.begin();3207 c.moveTo(0.5 * w, 0.25 * h);3208 c.lineTo(0.75 * w, 0.5 * h);3209 c.lineTo(0.5 * w, 0.75 * h);3210 c.moveTo(0.75 * w, 0.5 * h);3211 c.lineTo(0.25 * w, 0.5 * h);3212 c.stroke();3213 break;3214 case 'flowS' :3215 c.begin();3216 c.moveTo(0.25 * w, 0.5 * h);3217 c.lineTo(0.5 * w, 0.75 * h);3218 c.lineTo(0.75 * w, 0.5 * h);3219 c.moveTo(0.5 * w, 0.75 * h);3220 c.lineTo(0.5 * w, 0.25 * h);3221 c.stroke();3222 break;3223 case 'flowW' :3224 c.begin();3225 c.moveTo(0.5 * w, 0.25 * h);3226 c.lineTo(0.25 * w, 0.5 * h);3227 c.lineTo(0.5 * w, 0.75 * h);3228 c.moveTo(0.25 * w, 0.5 * h);3229 c.lineTo(0.75 * w, 0.5 * h);3230 c.stroke();3231 break;3232 case 'doubleH' :3233 c.begin();3234 c.moveTo(0.6 * w, 0.25 * h);3235 c.lineTo(0.85 * w, 0.5 * h);3236 c.lineTo(0.6 * w, 0.75 * h);3237 c.moveTo(0.4 * w, 0.25 * h);3238 c.lineTo(0.15 * w, 0.5 * h);3239 c.lineTo(0.4 * w, 0.75 * h);3240 c.stroke();3241 break;3242 case 'doubleV' :3243 c.begin();3244 c.moveTo(0.25 * w, 0.6 * h);3245 c.lineTo(0.5 * w, 0.85 * h);3246 c.lineTo(0.75 * w, 0.6 * h);3247 c.moveTo(0.25 * w, 0.4 * h);3248 c.lineTo(0.5 * w, 0.15 * h);3249 c.lineTo(0.75 * w, 0.4 * h);3250 c.stroke();3251 break;3252 }3253};32543255mxCellRenderer.registerShape(mxShapeSysMLPort.prototype.cst.PORT, mxShapeSysMLPort);32563257mxShapeSysMLPort.prototype.getConstraints = function(style, w, h)3258{3259 var constr = [];32603261 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));3262 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));3263 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));3264 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));32653266 return (constr);3267};3268