1/**2 * Copyright (c) 2006-2016, JGraph Holdings Ltd3 */45//**********************************************************************************************************************************************************6//Arrow7//**********************************************************************************************************************************************************8/**9* Extends mxShape.10*/11function mxShapeArrows2Arrow(bounds, fill, stroke, strokewidth)12{13 mxShape.call(this);14 this.bounds = bounds;15 this.fill = fill;16 this.stroke = stroke;17 this.strokewidth = (strokewidth != null) ? strokewidth : 1;18 this.dy = 0.5;19 this.dx = 0.5;20 this.notch = 0;21};2223/**24* Extends mxShape.25*/26mxUtils.extend(mxShapeArrows2Arrow, mxActor);2728mxShapeArrows2Arrow.prototype.customProperties = [29 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 40},30 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal: 0.6},31 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal: 0},32 {name: 'headCrossline', dispName: 'Head Crossline', type: 'bool', defVal: false},33 {name: 'tailCrossline', dispName: 'Tail Crossline', type: 'bool', defVal: false}34];3536mxShapeArrows2Arrow.prototype.cst = {37 ARROW : 'mxgraph.arrows2.arrow'38};3940/**41* Function: paintVertexShape42* 43* Paints the vertex shape.44*/45mxShapeArrows2Arrow.prototype.paintVertexShape = function(c, x, y, w, h)46{47 c.translate(x, y);4849 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));50 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));51 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));52 var headCrossline = mxUtils.getValue(this.style, 'headCrossline', false);53 var tailCrossline = mxUtils.getValue(this.style, 'tailCrossline', false);5455 c.begin();56 c.moveTo(0, dy);57 c.lineTo(w - dx, dy);58 c.lineTo(w - dx, 0);59 c.lineTo(w, h * 0.5);60 c.lineTo(w - dx, h);61 c.lineTo(w - dx, h - dy);62 c.lineTo(0, h - dy);63 c.lineTo(notch, h * 0.5);64 c.close();65 c.fillAndStroke();66 67 c.setShadow(false);68 69 if (headCrossline)70 {71 c.begin();72 c.moveTo(w - dx, dy);73 c.lineTo(w - dx, h - dy);74 c.stroke();75 }76 77 if (tailCrossline)78 {79 c.begin();80 c.moveTo(notch, dy);81 c.lineTo(notch, h - dy);82 c.stroke();83 }84};8586mxShapeArrows2Arrow.prototype.getLabelBounds = function(rect)87{88 if (mxUtils.getValue(this.style, 'boundedLbl', false))89 {90 var w = rect.width;91 var h = rect.height;92 93 var dy, dx;94 var direction = this.direction || mxConstants.DIRECTION_EAST;95 96 if (mxUtils.getValue(this.style, 'flipH', false))97 {98 if (direction == mxConstants.DIRECTION_WEST)99 direction = mxConstants.DIRECTION_EAST;100 else if (direction == mxConstants.DIRECTION_EAST)101 direction = mxConstants.DIRECTION_WEST;102 }103 104 if (mxUtils.getValue(this.style, 'flipV', false))105 {106 if (direction == mxConstants.DIRECTION_NORTH)107 direction = mxConstants.DIRECTION_SOUTH;108 else if (direction == mxConstants.DIRECTION_SOUTH)109 direction = mxConstants.DIRECTION_NORTH;110 }111 112 if (direction == mxConstants.DIRECTION_NORTH113 || direction == mxConstants.DIRECTION_SOUTH)114 {115 dy = w * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));116 dx = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));117 }118 else119 {120 dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));121 dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));122 }123 124 if (direction == mxConstants.DIRECTION_EAST)125 {126 return new mxRectangle(rect.x, rect.y + dy, w - dx, h - 2 * dy);127 }128 else if (direction == mxConstants.DIRECTION_WEST)129 {130 return new mxRectangle(rect.x + dx, rect.y + dy, w - dx, h - 2 * dy);131 }132 else if (direction == mxConstants.DIRECTION_NORTH)133 {134 return new mxRectangle(rect.x + dy, rect.y + dx, w - 2 * dy, h - dx);135 }136 else137 {138 return new mxRectangle(rect.x + dy, rect.y, w - 2 * dy, h - dx);139 }140 }141 142 return rect;143};144145mxCellRenderer.registerShape(mxShapeArrows2Arrow.prototype.cst.ARROW, mxShapeArrows2Arrow);146147Graph.handleFactory[mxShapeArrows2Arrow.prototype.cst.ARROW] = function(state)148{149 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)150 {151 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));152 var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));153154 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2);155 }, function(bounds, pt)156 {157 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;158 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;159 })];160 161 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)162 {163 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));164165 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);166 }, function(bounds, pt)167 {168 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.x - bounds.x))) / 100;169 });170 171 handles.push(handle2);172 173 return handles;174175}176177mxShapeArrows2Arrow.prototype.getConstraints = function(style, w, h)178{179 var constr = [];180 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));181 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));182 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));183184 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));185 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0));186 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy));187 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - dy));188 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, dy));189 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0));190 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h - dy));191 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h));192 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, dy));193 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, h - dy));194195 return (constr);196};197198//**********************************************************************************************************************************************************199//Two Way Arrow200//**********************************************************************************************************************************************************201/**202* Extends mxShape.203*/204function mxShapeArrows2TwoWayArrow(bounds, fill, stroke, strokewidth)205{206 mxShape.call(this);207 this.bounds = bounds;208 this.fill = fill;209 this.stroke = stroke;210 this.strokewidth = (strokewidth != null) ? strokewidth : 1;211 this.dy = 0.5;212 this.dx = 0.5;213};214215/**216* Extends mxShape.217*/218mxUtils.extend(mxShapeArrows2TwoWayArrow, mxActor);219220mxShapeArrows2TwoWayArrow.prototype.cst = {221 TWO_WAY_ARROW : 'mxgraph.arrows2.twoWayArrow'222};223224mxShapeArrows2TwoWayArrow.prototype.customProperties = [225 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal: 35},226 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal: 0.6}227];228229/**230* Function: paintVertexShape231* 232* Paints the vertex shape.233*/234mxShapeArrows2TwoWayArrow.prototype.paintVertexShape = function(c, x, y, w, h)235{236 c.translate(x, y);237238 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));239 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));240241 c.begin();242 c.moveTo(dx, dy);243 c.lineTo(w - dx, dy);244 c.lineTo(w - dx, 0);245 c.lineTo(w, h * 0.5);246 c.lineTo(w - dx, h);247 c.lineTo(w - dx, h - dy);248 c.lineTo(dx, h - dy);249 c.lineTo(dx, h);250 c.lineTo(0, h * 0.5);251 c.lineTo(dx, 0);252 c.close();253 c.fillAndStroke();254};255256mxShapeArrows2TwoWayArrow.prototype.getLabelBounds = function(rect)257{258 if (mxUtils.getValue(this.style, 'boundedLbl', false))259 {260 var w = rect.width;261 var h = rect.height;262 var vertical = this.direction == mxConstants.DIRECTION_NORTH263 || this.direction == mxConstants.DIRECTION_SOUTH;264265 var dy, dx;266 267 if (vertical)268 {269 dy = w * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));270 dx = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));271 }272 else273 {274 dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));275 dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));276 }277 278 if (vertical)279 {280 return new mxRectangle(rect.x + dy, rect.y + dx, w - 2 * dy, h - 2 * dx);281 }282 else283 {284 return new mxRectangle(rect.x + dx, rect.y + dy, w - 2 * dx, h - 2 * dy);285 }286 }287 288 return rect;289};290291mxCellRenderer.registerShape(mxShapeArrows2TwoWayArrow.prototype.cst.TWO_WAY_ARROW, mxShapeArrows2TwoWayArrow);292293mxShapeArrows2TwoWayArrow.prototype.constraints = null;294295Graph.handleFactory[mxShapeArrows2TwoWayArrow.prototype.cst.TWO_WAY_ARROW] = function(state)296{297 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)298 {299 var dx = Math.max(0, Math.min(bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));300 var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));301302 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2);303 }, function(bounds, pt)304 {305 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width / 2, bounds.x + bounds.width - pt.x))) / 100;306 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;307 })];308 309 return handles;310311}312313mxShapeArrows2TwoWayArrow.prototype.getConstraints = function(style, w, h)314{315 var constr = [];316 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));317 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));318319 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));320 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, 0));321 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, dy));322 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h));323 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h - dy));324 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));325 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0));326 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, dy));327 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h));328 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h - dy));329 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, 0, dy));330 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, 0, h - dy));331332 return (constr);333};334335//**********************************************************************************************************************************************************336//Stylised Arrow337//**********************************************************************************************************************************************************338/**339* Extends mxShape.340*/341function mxShapeArrows2StylisedArrow(bounds, fill, stroke, strokewidth)342{343 mxShape.call(this);344 this.bounds = bounds;345 this.fill = fill;346 this.stroke = stroke;347 this.strokewidth = (strokewidth != null) ? strokewidth : 1;348 this.dy = 0.5;349 this.dx = 0.5;350 this.notch = 0;351 this.feather = 0.5;352};353354/**355* Extends mxShape.356*/357mxUtils.extend(mxShapeArrows2StylisedArrow, mxActor);358359mxShapeArrows2StylisedArrow.prototype.customProperties = [360 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:40},361 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal:0.6},362 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:0},363 {name: 'feather', dispName: 'Feather', type: 'float', min:0, max:1, defVal:0.4},364];365366mxShapeArrows2StylisedArrow.prototype.cst = {367 STYLISED_ARROW : 'mxgraph.arrows2.stylisedArrow'368};369370/**371* Function: paintVertexShape372* 373* Paints the vertex shape.374*/375mxShapeArrows2StylisedArrow.prototype.paintVertexShape = function(c, x, y, w, h)376{377 c.translate(x, y);378379 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));380 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));381 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));382 var feather = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'feather', this.feather))));383384 c.begin();385 c.moveTo(0, feather);386 c.lineTo(w - dx, dy);387 c.lineTo(w - dx - 10, 0);388 c.lineTo(w, h * 0.5);389 c.lineTo(w - dx - 10, h);390 c.lineTo(w - dx, h - dy);391 c.lineTo(0, h - feather);392 c.lineTo(notch, h * 0.5);393 c.close();394 c.fillAndStroke();395};396397mxCellRenderer.registerShape(mxShapeArrows2StylisedArrow.prototype.cst.STYLISED_ARROW, mxShapeArrows2StylisedArrow);398399mxShapeArrows2StylisedArrow.prototype.constraints = null;400401Graph.handleFactory[mxShapeArrows2StylisedArrow.prototype.cst.STYLISED_ARROW] = function(state)402{403 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)404 {405 var dx = Math.max(0, Math.min(bounds.width - 10, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));406 var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));407408 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2);409 }, function(bounds, pt)410 {411 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width - 10, bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;412 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;413 })];414 415 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)416 {417 var notch = Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));418419 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);420 }, function(bounds, pt)421 {422 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.x - bounds.x))) / 100;423 });424 425 handles.push(handle2);426 427 var handle3 = Graph.createHandle(state, ['feather'], function(bounds)428 {429 var feather = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'feather', this.dy))));430431 return new mxPoint(bounds.x, bounds.y + feather * bounds.height / 2);432 }, function(bounds, pt)433 {434 this.state.style['feather'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;435 });436 437 handles.push(handle3);438 439 return handles;440441}442443mxShapeArrows2StylisedArrow.prototype.getConstraints = function(style, w, h)444{445 var constr = [];446 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));447 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));448 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));449 var feather = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'feather', this.feather))));450451 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));452 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0));453 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, feather));454 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - feather));455 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, dy));456 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx - 10, 0));457 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h - dy));458 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx - 10, h));459 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, (dy + feather) * 0.5));460 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, h - (dy + feather) * 0.5));461462 return (constr);463};464465//**********************************************************************************************************************************************************466//Sharp Arrow467//**********************************************************************************************************************************************************468/**469* Extends mxShape.470*/471function mxShapeArrows2SharpArrow(bounds, fill, stroke, strokewidth)472{473 mxShape.call(this);474 this.bounds = bounds;475 this.fill = fill;476 this.stroke = stroke;477 this.strokewidth = (strokewidth != null) ? strokewidth : 1;478 this.dy1 = 0.5;479 this.dx1 = 0.5;480 this.dx2 = 0.5;481 this.notch = 0;482};483484/**485* Extends mxShape.486*/487mxUtils.extend(mxShapeArrows2SharpArrow, mxActor);488489mxShapeArrows2SharpArrow.prototype.cst = {490 SHARP_ARROW : 'mxgraph.arrows2.sharpArrow'491};492493mxShapeArrows2SharpArrow.prototype.customProperties = [494 {name: 'dx1', dispName: 'Arrowhead Arrow Width', type: 'float', min:0, defVal:18},495 {name: 'dy1', dispName: 'Arrow Arrow Width', type: 'float', min:0, max:1, defVal:0.67},496 {name: 'dx2', dispName: 'Arrowhead Angle', type: 'float', min:0, defVal:18},497 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:0}498];499500/**501* Function: paintVertexShape502* 503* Paints the vertex shape.504*/505mxShapeArrows2SharpArrow.prototype.paintVertexShape = function(c, x, y, w, h)506{507 c.translate(x, y);508509 var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));510 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));511 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));512 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));513 var dx1a = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));514 var dy1a = h * 0.5 * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));515 var x2 = 0;516 517 if (h != 0)518 {519 x2 = dx1a + dx2 * dy1a * 2 / h;520 }521 522 c.begin();523 c.moveTo(0, dy1);524 c.lineTo(w - dx1, dy1);525 c.lineTo(w - x2, 0);526 c.lineTo(w - dx2, 0);527 c.lineTo(w, h * 0.5);528 c.lineTo(w - dx2, h);529 c.lineTo(w - x2, h);530 c.lineTo(w - dx1, h - dy1);531 c.lineTo(0, h - dy1);532 c.lineTo(notch, h * 0.5);533 c.close();534 c.fillAndStroke();535};536537mxCellRenderer.registerShape(mxShapeArrows2SharpArrow.prototype.cst.SHARP_ARROW, mxShapeArrows2SharpArrow);538539mxShapeArrows2SharpArrow.prototype.constraints = null;540541Graph.handleFactory[mxShapeArrows2SharpArrow.prototype.cst.SHARP_ARROW] = function(state)542{543 var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds)544 {545 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));546 var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));547548 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + dy1 * bounds.height / 2);549 }, function(bounds, pt)550 {551 this.state.style['dx1'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;552 this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;553 })];554 555 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)556 {557 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));558559 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);560 }, function(bounds, pt)561 {562 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), pt.x - bounds.x))) / 100;563 });564 565 handles.push(handle2);566 567 var handle3 = Graph.createHandle(state, ['dx2'], function(bounds)568 {569 var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2))));570571 return new mxPoint(bounds.x + bounds.width - dx2, bounds.y);572 }, function(bounds, pt)573 {574 this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;575 });576 577 handles.push(handle3);578 579 return handles;580};581582mxShapeArrows2SharpArrow.prototype.getConstraints = function(style, w, h)583{584 var constr = [];585 var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));586 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));587 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));588 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));589 var dx1a = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));590 var dy1a = h * 0.5 * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));591 var x2 = 0;592 593 if (h != 0)594 {595 x2 = dx1a + dx2 * dy1a * 2 / h;596 }597 598 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));599 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0));600 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy1));601 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, dy1));602 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - x2, 0));603 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx2, 0));604 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - dy1));605 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h - dy1));606 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - x2, h));607 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx2, h));608 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1) * 0.5, dy1));609 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1) * 0.5, h - dy1));610611 return (constr);612};613614//**********************************************************************************************************************************************************615//Sharp Arrow2616//**********************************************************************************************************************************************************617/**618* Extends mxShape.619*/620function mxShapeArrows2SharpArrow2(bounds, fill, stroke, strokewidth)621{622 mxShape.call(this);623 this.bounds = bounds;624 this.fill = fill;625 this.stroke = stroke;626 this.strokewidth = (strokewidth != null) ? strokewidth : 1;627 this.dy1 = 0.5;628 this.dx1 = 0.5;629 this.dx2 = 0.5;630 this.dy3 = 0.5;631 this.dx3 = 0.5;632633 this.notch = 0;634};635636/**637* Extends mxShape.638*/639mxUtils.extend(mxShapeArrows2SharpArrow2, mxActor);640641mxShapeArrows2SharpArrow2.prototype.customProperties = [642 {name: 'dx1', dispName: 'Arrowhead Arrow Width', type: 'float', min:0, defVal:18},643 {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal:0.67},644 {name: 'dx2', dispName: 'Arrowhead Angle', type: 'float', min:0, defVal:18},645 {name: 'dx3', dispName: 'Arrowhead Edge X', type: 'float', min:0, defVal:27},646 {name: 'dy3', dispName: 'Arrowhead Edge Y', type: 'float', min:0, max:1, defVal:0.15},647 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:0}648];649650mxShapeArrows2SharpArrow2.prototype.cst = {651 SHARP_ARROW2 : 'mxgraph.arrows2.sharpArrow2'652};653654/**655* Function: paintVertexShape656* 657* Paints the vertex shape.658*/659mxShapeArrows2SharpArrow2.prototype.paintVertexShape = function(c, x, y, w, h)660{661 c.translate(x, y);662663 var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));664 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));665 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));666 var dy3 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy3', this.dy3))));667 var dx3 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx3', this.dx3))));668 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));669 var dx1a = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));670 var dy1a = h * 0.5 * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));671672 c.begin();673 c.moveTo(0, dy1);674 c.lineTo(w - dx1, dy1);675 c.lineTo(w - dx3, dy3);676 c.lineTo(w - dx2, 0);677 c.lineTo(w, h * 0.5);678 c.lineTo(w - dx2, h);679 c.lineTo(w - dx3, h - dy3);680 c.lineTo(w - dx1, h - dy1);681 c.lineTo(0, h - dy1);682 c.lineTo(notch, h * 0.5);683 c.close();684 c.fillAndStroke();685};686687mxCellRenderer.registerShape(mxShapeArrows2SharpArrow2.prototype.cst.SHARP_ARROW2, mxShapeArrows2SharpArrow2);688689mxShapeArrows2SharpArrow2.prototype.constraints = null;690691Graph.handleFactory[mxShapeArrows2SharpArrow2.prototype.cst.SHARP_ARROW2] = function(state)692{693 var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds)694 {695 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));696 var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));697698 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + dy1 * bounds.height / 2);699 }, function(bounds, pt)700 {701 this.state.style['dx1'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;702 this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;703 })];704 705 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)706 {707 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));708709 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);710 }, function(bounds, pt)711 {712 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), pt.x - bounds.x))) / 100;713 });714 715 handles.push(handle2);716 717 var handle3 = Graph.createHandle(state, ['dx2'], function(bounds)718 {719 var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2))));720721 return new mxPoint(bounds.x + bounds.width - dx2, bounds.y);722 }, function(bounds, pt)723 {724 this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;725 });726 727 handles.push(handle3);728729 var handle4 = Graph.createHandle(state, ['dx3', 'dy3'], function(bounds)730 {731 var dx3 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx3', this.dx3))));732 var dy3 = Math.max(0, Math.min(1 - parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy3', this.dy3))));733734 return new mxPoint(bounds.x + bounds.width - dx3, bounds.y + dy3 * bounds.height / 2);735 }, function(bounds, pt)736 {737 this.state.style['dx3'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)), Math.min(bounds.width, bounds.x + bounds.width - pt.x))) / 100;738 this.state.style['dy3'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;739 });740741 handles.push(handle4);742743 return handles;744};745746mxShapeArrows2SharpArrow2.prototype.getConstraints = function(style, w, h)747{748 var constr = [];749 var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));750 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));751 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));752 var dy3 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy3', this.dy3))));753 var dx3 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx3', this.dx3))));754 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));755 var dx1a = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));756 var dy1a = h * 0.5 * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));757758 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));759 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0));760 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy1));761 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, dy1));762 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx3, dy3));763 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx2, 0));764 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - dy1));765 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h - dy1));766 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx3, h - dy3));767 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx2, h));768 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1) * 0.5, dy1));769 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1) * 0.5, h - dy1));770771 return (constr);772};773774//**********************************************************************************************************************************************************775//Callout Arrow776//**********************************************************************************************************************************************************777/**778* Extends mxShape.779*/780function mxShapeArrows2CalloutArrow(bounds, fill, stroke, strokewidth)781{782 mxShape.call(this);783 this.bounds = bounds;784 this.fill = fill;785 this.stroke = stroke;786 this.strokewidth = (strokewidth != null) ? strokewidth : 1;787 this.dy = 0.5;788 this.dx = 0.5;789 this.notch = 0;790 this.arrowHead = 0;791};792793/**794* Extends mxShape.795*/796mxUtils.extend(mxShapeArrows2CalloutArrow, mxActor);797798mxShapeArrows2CalloutArrow.prototype.customProperties = [799 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20},800 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10},801 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10},802 {name: 'notch', dispName: 'Rectangle Width', type: 'float', min:0, defVal:60}803];804805mxShapeArrows2CalloutArrow.prototype.cst = {806 CALLOUT_ARROW : 'mxgraph.arrows2.calloutArrow'807};808809/**810* Function: paintVertexShape811* 812* Paints the vertex shape.813*/814mxShapeArrows2CalloutArrow.prototype.paintVertexShape = function(c, x, y, w, h)815{816 c.translate(x, y);817818 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));819 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));820 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));821 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));822823 c.begin();824 c.moveTo(0, 0);825 c.lineTo(notch, 0);826 c.lineTo(notch, h * 0.5 - dy);827 c.lineTo(w - dx, h * 0.5 - dy);828 c.lineTo(w - dx, h * 0.5 - dy - arrowHead);829 c.lineTo(w, h * 0.5);830 c.lineTo(w - dx, h * 0.5 + dy + arrowHead);831 c.lineTo(w - dx, h * 0.5 + dy);832 c.lineTo(notch, h * 0.5 + dy);833 c.lineTo(notch, h);834 c.lineTo(0, h);835 c.close();836 c.fillAndStroke();837};838839mxCellRenderer.registerShape(mxShapeArrows2CalloutArrow.prototype.cst.CALLOUT_ARROW, mxShapeArrows2CalloutArrow);840841mxShapeArrows2CalloutArrow.prototype.constraints = null;842843Graph.handleFactory[mxShapeArrows2CalloutArrow.prototype.cst.CALLOUT_ARROW] = function(state)844{845 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)846 {847 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));848 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));849 var dy = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));850851 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy);852 }, function(bounds, pt)853 {854 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;855 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.y + bounds.height / 2 - pt.y))) / 100;856 857 })];858 859 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)860 {861 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));862863 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);864 }, function(bounds, pt)865 {866 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.x - bounds.x))) / 100;867 });868869 handles.push(handle2);870 871 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)872 {873 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));874 var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));875 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));876877 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead);878 }, function(bounds, pt)879 {880 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), bounds.y + bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)) - pt.y))) / 100;881 });882883 handles.push(handle3);884 885 return handles;886};887888mxShapeArrows2CalloutArrow.prototype.getConstraints = function(style, w, h)889{890 var constr = [];891 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));892 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));893 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));894 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));895896 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));897 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, 0));898 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null,notch, h * 0.5 - dy));899 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy));900 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy - arrowHead));901 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, h * 0.5));902 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 + dy + arrowHead));903 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 + dy));904 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, h * 0.5 + dy));905 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, h));906 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h));907 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch * 0.5 , 0));908 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch * 0.5 , h));909 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, (notch + w - dx) * 0.5, -dy));910 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, (notch + w - dx) * 0.5, dy));911912 return (constr);913};914915//**********************************************************************************************************************************************************916//Bend Arrow917//**********************************************************************************************************************************************************918/**919* Extends mxShape.920*/921function mxShapeArrows2BendArrow(bounds, fill, stroke, strokewidth)922{923 mxShape.call(this);924 this.bounds = bounds;925 this.fill = fill;926 this.stroke = stroke;927 this.strokewidth = (strokewidth != null) ? strokewidth : 1;928 this.dy = 0.5;929 this.dx = 0.5;930 this.notch = 0;931 this.arrowHead = 40;932};933934/**935* Extends mxShape.936*/937mxUtils.extend(mxShapeArrows2BendArrow, mxActor);938939mxShapeArrows2BendArrow.prototype.customProperties = [940 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal: 38},941 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal: 15},942 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal: 0},943 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:55},944 {name: 'rounded', dispName: 'Rounded', type: 'boolean', defVal: false}945];946947mxShapeArrows2BendArrow.prototype.cst = {948 BEND_ARROW : 'mxgraph.arrows2.bendArrow'949};950951/**952* Function: paintVertexShape953* 954* Paints the vertex shape.955*/956mxShapeArrows2BendArrow.prototype.paintVertexShape = function(c, x, y, w, h)957{958 c.translate(x, y);959960 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));961 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));962 var notch = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));963 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));964 var rounded = mxUtils.getValue(this.style, 'rounded', '0');965966 c.begin();967 c.moveTo(w - dx, 0);968 c.lineTo(w, arrowHead * 0.5);969 c.lineTo(w - dx, arrowHead);970 c.lineTo(w - dx, arrowHead / 2 + dy);971 972 if (rounded == '1')973 {974 c.lineTo(dy * 2.2, arrowHead / 2 + dy);975 c.arcTo(dy * 0.2, dy * 0.2, 0, 0, 0, dy * 2, arrowHead / 2 + dy * 1.2);976 }977 else978 {979 c.lineTo(dy * 2, arrowHead / 2 + dy);980 }981 982 c.lineTo(dy * 2, h);983 c.lineTo(dy, h - notch);984 c.lineTo(0, h);985 986 if (rounded == '1')987 {988 c.lineTo(0, arrowHead / 2 + dy);989 c.arcTo(dy * 2, dy * 2, 0, 0, 1, dy * 2, arrowHead / 2 - dy);990 }991 else992 {993 c.lineTo(0, arrowHead / 2 - dy);994 }995996 c.lineTo(w - dx, arrowHead / 2 - dy);997 c.close();998 c.fillAndStroke();999};10001001mxCellRenderer.registerShape(mxShapeArrows2BendArrow.prototype.cst.BEND_ARROW, mxShapeArrows2BendArrow);10021003mxShapeArrows2BendArrow.prototype.constraints = null;10041005Graph.handleFactory[mxShapeArrows2BendArrow.prototype.cst.BEND_ARROW] = function(state)1006{1007 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)1008 {1009 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1010 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1011 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1012 1013 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy);1014 }, function(bounds, pt)1015 {1016 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)) * 2.2, bounds.x + bounds.width - pt.x))) / 100;1017 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2 - pt.y))) / 100;1018 1019 })];1020 1021 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)1022 {1023 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1024 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1025 1026 var notch = Math.max(0, Math.min(bounds.height - arrowHead / 2 - dy, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));10271028 return new mxPoint(bounds.x + dy, bounds.y + bounds.height - notch);1029 }, function(bounds, pt)1030 {1031 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.height - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), bounds.y + bounds.height - pt.y))) / 100;1032 });1033 1034 handles.push(handle2);10351036 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)1037 {1038 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1039 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));10401041 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead);1042 }, function(bounds, pt)1043 {1044 this.state.style['arrowHead'] = Math.round(100 * Math.max(2 * parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(bounds.height, pt.y - bounds.y))) / 100;1045 });1046 1047 handles.push(handle3);10481049 return handles;1050};10511052mxShapeArrows2BendArrow.prototype.getConstraints = function(style, w, h)1053{1054 var constr = [];1055 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1056 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1057 var notch = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));1058 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));1059 var rounded = mxUtils.getValue(this.style, 'rounded', '0');10601061 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx + dy * 2) * 0.5, arrowHead / 2 - dy));1062 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead / 2 - dy));1063 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0));1064 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, arrowHead * 0.5));1065 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead));1066 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead / 2 + dy));1067 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx + dy * 2) * 0.5, arrowHead / 2 + dy));1068 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy * 2, (h - arrowHead / 2 - dy) * 0.5 + arrowHead / 2 + dy));1069 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy * 2, h));1070 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy, h - notch));1071 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h));1072 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - arrowHead / 2 - dy) * 0.5 + arrowHead / 2 + dy));10731074 if (rounded == '1')1075 {1076 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy * 0.586, arrowHead / 2 - dy * 0.414));1077 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2 * dy + dy * 0.0586, arrowHead / 2 + dy + dy * 0.0586));1078 }1079 else1080 {1081 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, arrowHead / 2 - dy));1082 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy * 2, arrowHead / 2 + dy));1083 }1084 1085 return (constr);1086};10871088//**********************************************************************************************************************************************************1089//Bend Double Arrow1090//**********************************************************************************************************************************************************1091/**1092* Extends mxShape.1093*/1094function mxShapeArrows2BendDoubleArrow(bounds, fill, stroke, strokewidth)1095{1096 mxShape.call(this);1097 this.bounds = bounds;1098 this.fill = fill;1099 this.stroke = stroke;1100 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1101 this.dy = 0.5;1102 this.dx = 0.5;1103 this.notch = 0;1104 this.arrowHead = 40;1105};11061107/**1108* Extends mxShape.1109*/1110mxUtils.extend(mxShapeArrows2BendDoubleArrow, mxActor);11111112mxShapeArrows2BendDoubleArrow.prototype.customProperties = [1113 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:38},1114 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:15},1115 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:55},1116 {name: 'rounded', dispName: 'Rounded', type: 'boolean', defVal:false}1117];11181119mxShapeArrows2BendDoubleArrow.prototype.cst = {1120 BEND_DOUBLE_ARROW : 'mxgraph.arrows2.bendDoubleArrow'1121};11221123/**1124* Function: paintVertexShape1125* 1126* Paints the vertex shape.1127*/1128mxShapeArrows2BendDoubleArrow.prototype.paintVertexShape = function(c, x, y, w, h)1129{1130 c.translate(x, y);11311132 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1133 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1134 var arrowHead = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));1135 var rounded = mxUtils.getValue(this.style, 'rounded', '0');11361137 c.begin();1138 c.moveTo(w - dx, 0);1139 c.lineTo(w, arrowHead * 0.5);1140 c.lineTo(w - dx, arrowHead);1141 c.lineTo(w - dx, arrowHead / 2 + dy);11421143 if (rounded == '1')1144 {1145 c.lineTo(arrowHead / 2 + dy * 1.2, arrowHead / 2 + dy);1146 c.arcTo(dy * 0.2, dy * 0.2, 0, 0, 0, arrowHead /2 + dy, arrowHead / 2 + dy * 1.2);1147 }1148 else1149 {1150 c.lineTo(arrowHead / 2 + dy, arrowHead / 2 + dy);1151 }1152 1153 c.lineTo(arrowHead / 2 + dy, h - dx);1154 c.lineTo(arrowHead, h - dx);1155 c.lineTo(arrowHead / 2, h);1156 c.lineTo(0, h - dx);1157 c.lineTo(arrowHead / 2 - dy, h - dx);1158 1159 if (rounded == '1')1160 {1161 c.lineTo(arrowHead / 2 - dy, arrowHead / 2 + dy);1162 c.arcTo(dy * 2, dy * 2, 0, 0, 1, arrowHead / 2 + dy, arrowHead / 2 - dy);1163 }1164 else1165 {1166 c.lineTo(arrowHead / 2 - dy, arrowHead / 2 - dy);1167 }11681169 c.lineTo(w - dx, arrowHead / 2 - dy);1170 c.close();1171 c.fillAndStroke();1172};11731174mxCellRenderer.registerShape(mxShapeArrows2BendDoubleArrow.prototype.cst.BEND_DOUBLE_ARROW, mxShapeArrows2BendDoubleArrow);11751176mxShapeArrows2BendDoubleArrow.prototype.constraints = null;11771178Graph.handleFactory[mxShapeArrows2BendDoubleArrow.prototype.cst.BEND_DOUBLE_ARROW] = function(state)1179{1180 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)1181 {1182 var arrowHead = Math.max(0, Math.min(Math.min(bounds.height, bounds.width) - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1183 var dx = Math.max(0, Math.min(Math.min(bounds.width, bounds.height) - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1184 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1185 1186 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy);1187 }, function(bounds, pt)1188 {1189 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(Math.min(bounds.width, bounds.height) - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.x + bounds.width - pt.x))) / 100;1190 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2 - pt.y))) / 100;1191 1192 })];1193 1194 var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds)1195 {1196 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1197 var arrowHead = Math.max(0, Math.min(Math.min(bounds.height, bounds.width) - dx, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));11981199 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead);1200 }, function(bounds, pt)1201 {1202 this.state.style['arrowHead'] = Math.round(100 * Math.max(2 * parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(Math.min(bounds.height, bounds.width) - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.y - bounds.y))) / 100;1203 });1204 1205 handles.push(handle2);12061207 return handles;1208};12091210mxShapeArrows2BendDoubleArrow.prototype.getConstraints = function(style, w, h)1211{1212 var constr = [];1213 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1214 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1215 var arrowHead = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));1216 var rounded = mxUtils.getValue(this.style, 'rounded', '0');12171218 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx , 0));1219 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, arrowHead * 0.5));1220 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead));1221 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead / 2 + dy));1222 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (arrowHead / 2 + dy + w - dx) * 0.5, arrowHead / 2 + dy));1223 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (arrowHead / 2 + dy + w - dx) * 0.5, arrowHead / 2 - dy));1224 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 + dy, (arrowHead / 2 + dy + h - dx) * 0.5));1225 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy, (arrowHead / 2 + dy + h - dx) * 0.5));1226 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 + dy, h - dx));1227 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead, h - dx));1228 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2, h));1229 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - dx));1230 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy, h - dx));12311232 if (rounded == '1')1233 {1234 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy * 0.414, arrowHead / 2 - dy * 0.414));1235 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 + dy + dy * 0.0586, arrowHead / 2 + dy + dy * 0.0586));1236 }1237 else1238 {1239 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy, arrowHead / 2 - dy));1240 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 + dy, arrowHead / 2 + dy));1241 }1242 1243 return (constr);1244};12451246//**********************************************************************************************************************************************************1247//Callout Double Arrow1248//**********************************************************************************************************************************************************1249/**1250* Extends mxShape.1251*/1252function mxShapeArrows2CalloutDoubleArrow(bounds, fill, stroke, strokewidth)1253{1254 mxShape.call(this);1255 this.bounds = bounds;1256 this.fill = fill;1257 this.stroke = stroke;1258 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1259 this.dy = 0.5;1260 this.dx = 0.5;1261 this.notch = 0;1262 this.arrowHead = 0;1263};12641265/**1266* Extends mxShape.1267*/1268mxUtils.extend(mxShapeArrows2CalloutDoubleArrow, mxActor);12691270mxShapeArrows2CalloutDoubleArrow.prototype.customProperties = [1271 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20},1272 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10},1273 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10},1274 {name: 'notch', dispName: 'Rect Size', type: 'float', min:0, defVal:24}1275];12761277mxShapeArrows2CalloutDoubleArrow.prototype.cst = {1278 CALLOUT_DOUBLE_ARROW : 'mxgraph.arrows2.calloutDoubleArrow'1279};12801281/**1282* Function: paintVertexShape1283* 1284* Paints the vertex shape.1285*/1286mxShapeArrows2CalloutDoubleArrow.prototype.paintVertexShape = function(c, x, y, w, h)1287{1288 c.translate(x, y);12891290 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1291 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1292 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));1293 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));12941295 c.begin();1296 c.moveTo(w / 2 - notch, 0);1297 c.lineTo(w / 2 + notch, 0);1298 c.lineTo(w / 2 + notch, h * 0.5 - dy);1299 c.lineTo(w - dx, h * 0.5 - dy);1300 c.lineTo(w - dx, h * 0.5 - dy - arrowHead);1301 c.lineTo(w, h * 0.5);1302 c.lineTo(w - dx, h * 0.5 + dy + arrowHead);1303 c.lineTo(w - dx, h * 0.5 + dy);1304 c.lineTo(w / 2 + notch, h * 0.5 + dy);1305 c.lineTo(w / 2 + notch, h);1306 c.lineTo(w / 2 - notch, h);1307 c.lineTo(w / 2 - notch, h * 0.5 + dy);1308 c.lineTo(dx, h * 0.5 + dy);1309 c.lineTo(dx, h * 0.5 + dy + arrowHead);1310 c.lineTo(0, h * 0.5);1311 c.lineTo(dx, h * 0.5 - dy - arrowHead);1312 c.lineTo(dx, h * 0.5 - dy);1313 c.lineTo(w / 2 - notch, h * 0.5 - dy);1314 c.close();1315 c.fillAndStroke();1316};13171318mxCellRenderer.registerShape(mxShapeArrows2CalloutDoubleArrow.prototype.cst.CALLOUT_DOUBLE_ARROW, mxShapeArrows2CalloutDoubleArrow);13191320mxShapeArrows2CalloutDoubleArrow.prototype.constraints = null;13211322Graph.handleFactory[mxShapeArrows2CalloutDoubleArrow.prototype.cst.CALLOUT_DOUBLE_ARROW] = function(state)1323{1324 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)1325 {1326 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1327 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1328 var dy = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));13291330 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy);1331 }, function(bounds, pt)1332 {1333 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width / 2 - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;1334 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.y + bounds.height / 2 - pt.y))) / 100;1335 1336 })];1337 1338 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)1339 {1340 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));13411342 return new mxPoint(bounds.x + bounds.width / 2 + notch, bounds.y + bounds.height / 2);1343 }, function(bounds, pt)1344 {1345 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.x - bounds.x - bounds.width / 2))) / 100;1346 });13471348 handles.push(handle2);1349 1350 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)1351 {1352 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1353 var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1354 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));13551356 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead);1357 }, function(bounds, pt)1358 {1359 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), bounds.y + bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)) - pt.y))) / 100;1360 });13611362 handles.push(handle3);1363 1364 return handles;1365};13661367mxShapeArrows2CalloutDoubleArrow.prototype.getConstraints = function(style, w, h)1368{1369 var constr = [];1370 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1371 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1372 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));1373 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));13741375 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1376 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1377 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1378 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1379 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w / 2 - notch, 0));1380 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w / 2 + notch, 0));1381 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, w / 2 - notch, 0));1382 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, w / 2 + notch, 0));1383 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy - arrowHead));1384 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 + dy + arrowHead));1385 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h * 0.5 - dy - arrowHead));1386 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h * 0.5 + dy + arrowHead));1387 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 1.5 - dx + notch) * 0.5, h * 0.5 - dy));1388 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 1.5 - dx + notch) * 0.5, h * 0.5 + dy));1389 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - notch) * 0.5, h * 0.5 - dy));1390 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - notch) * 0.5, h * 0.5 + dy));1391 1392 return (constr);1393};13941395//**********************************************************************************************************************************************************1396//Callout Quad Arrow1397//**********************************************************************************************************************************************************1398/**1399* Extends mxShape.1400*/1401function mxShapeArrows2CalloutQuadArrow(bounds, fill, stroke, strokewidth)1402{1403 mxShape.call(this);1404 this.bounds = bounds;1405 this.fill = fill;1406 this.stroke = stroke;1407 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1408 this.dy = 0.5;1409 this.dx = 0.5;1410 this.notch = 0;1411 this.arrowHead = 0;1412};14131414/**1415* Extends mxShape.1416*/1417mxUtils.extend(mxShapeArrows2CalloutQuadArrow, mxActor);14181419mxShapeArrows2CalloutQuadArrow.prototype.customProperties = [1420 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20},1421 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal: 10},1422 {name: 'notch', dispName: 'Rect Size', type: 'float', min:0, defVal:24},1423 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10}1424];14251426mxShapeArrows2CalloutQuadArrow.prototype.cst = {1427 CALLOUT_QUAD_ARROW : 'mxgraph.arrows2.calloutQuadArrow'1428};14291430/**1431* Function: paintVertexShape1432* 1433* Paints the vertex shape.1434*/1435mxShapeArrows2CalloutQuadArrow.prototype.paintVertexShape = function(c, x, y, w, h)1436{1437 c.translate(x, y);14381439 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1440 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1441 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));1442 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));14431444 c.begin();1445 c.moveTo(w * 0.5 + dy, h * 0.5 - notch);1446 c.lineTo(w * 0.5 + notch, h * 0.5 - notch);1447 c.lineTo(w * 0.5 + notch, h * 0.5 - dy);1448 c.lineTo(w - dx, h * 0.5 - dy);1449 c.lineTo(w - dx, h * 0.5 - dy - arrowHead);1450 c.lineTo(w, h * 0.5);1451 c.lineTo(w - dx, h * 0.5 + dy + arrowHead);1452 c.lineTo(w - dx, h * 0.5 + dy);1453 c.lineTo(w * 0.5 + notch, h * 0.5 + dy);1454 c.lineTo(w * 0.5 + notch, h * 0.5 + notch);1455 c.lineTo(w * 0.5 + dy, h * 0.5 + notch);1456 c.lineTo(w * 0.5 + dy, h - dx);1457 c.lineTo(w * 0.5 + dy + arrowHead, h - dx);1458 c.lineTo(w * 0.5, h);1459 c.lineTo(w * 0.5 - dy - arrowHead, h - dx);1460 c.lineTo(w * 0.5 - dy, h - dx);1461 c.lineTo(w * 0.5 - dy, h * 0.5 + notch);1462 c.lineTo(w * 0.5 - notch, h * 0.5 + notch);1463 c.lineTo(w * 0.5 - notch, h * 0.5 + dy);1464 c.lineTo(dx, h * 0.5 + dy);1465 c.lineTo(dx, h * 0.5 + dy + arrowHead);1466 c.lineTo(0, h * 0.5);1467 c.lineTo(dx, h * 0.5 - dy - arrowHead);1468 c.lineTo(dx, h * 0.5 - dy);1469 c.lineTo(w * 0.5 - notch, h * 0.5 - dy);1470 c.lineTo(w * 0.5 - notch, h * 0.5 - notch);1471 c.lineTo(w * 0.5 - dy, h * 0.5 - notch);1472 c.lineTo(w * 0.5 - dy, dx);1473 c.lineTo(w * 0.5 - dy - arrowHead, dx);1474 c.lineTo(w * 0.5, 0);1475 c.lineTo(w * 0.5 + dy + arrowHead, dx);1476 c.lineTo(w * 0.5 + dy, dx);1477 c.close();1478 c.fillAndStroke();1479};14801481mxCellRenderer.registerShape(mxShapeArrows2CalloutQuadArrow.prototype.cst.CALLOUT_QUAD_ARROW, mxShapeArrows2CalloutQuadArrow);14821483mxShapeArrows2CalloutQuadArrow.prototype.constraints = null;14841485Graph.handleFactory[mxShapeArrows2CalloutQuadArrow.prototype.cst.CALLOUT_QUAD_ARROW] = function(state)1486{1487 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)1488 {1489 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1490 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1491 var dy = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));14921493 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy);1494 }, function(bounds, pt)1495 {1496 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(Math.min(bounds.width, bounds.height) / 2 - Math.max(parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))), bounds.x + bounds.width - pt.x))) / 100;1497 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.y + bounds.height / 2 - pt.y))) / 100;1498 1499 })];1500 1501 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)1502 {1503 var notch = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(Math.min(bounds.width, bounds.height), parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));15041505 return new mxPoint(bounds.x + bounds.width / 2 + notch, bounds.y + bounds.height / 2);1506 }, function(bounds, pt)1507 {1508 this.state.style['notch'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(Math.min(bounds.width, bounds.height) / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.x - bounds.x - bounds.width / 2))) / 100;1509 });15101511 handles.push(handle2);1512 1513 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)1514 {1515 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1516 var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1517 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));15181519 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead);1520 }, function(bounds, pt)1521 {1522 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), bounds.y + bounds.height / 2 - pt.y))) / 100;1523 });15241525 handles.push(handle3);1526 1527 return handles;1528};15291530mxShapeArrows2CalloutQuadArrow.prototype.getConstraints = function(style, w, h)1531{1532 var constr = [];1533 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1534 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1535 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));1536 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));15371538 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1539 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1540 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1541 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1542 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, h * 0.5 - notch));1543 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + notch, h * 0.5 - notch));1544 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + notch, h * 0.5 - dy));1545 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, h * 0.5 + notch));1546 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + notch, h * 0.5 + notch));1547 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + notch, h * 0.5 + dy));1548 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, h * 0.5 + notch));1549 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - notch, h * 0.5 + notch));1550 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - notch, h * 0.5 + dy));1551 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, h * 0.5 - notch));1552 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - notch, h * 0.5 - notch));1553 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - notch, h * 0.5 - dy));1554 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy - arrowHead));1555 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 + dy + arrowHead));1556 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy - arrowHead, h - dx));1557 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy + arrowHead, h - dx));1558 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h * 0.5 - dy - arrowHead));1559 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h * 0.5 + dy + arrowHead));1560 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy - arrowHead, dx));1561 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy + arrowHead, dx));1562 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.75 + (notch - dx) * 0.5, h * 0.5 - dy));1563 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.75 + (notch - dx) * 0.5, h * 0.5 + dy));1564 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, h * 0.75 + (notch - dx) * 0.5));1565 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, h * 0.75 + (notch - dx) * 0.5));1566 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.25 - (notch - dx) * 0.5, h * 0.5 - dy));1567 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.25 - (notch - dx) * 0.5, h * 0.5 + dy));1568 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, h * 0.25 - (notch - dx) * 0.5));1569 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, h * 0.25 - (notch - dx) * 0.5));1570 1571 return (constr);1572};15731574//**********************************************************************************************************************************************************1575//Callout Double 90 Arrow1576//**********************************************************************************************************************************************************1577/**1578* Extends mxShape.1579*/1580function mxShapeArrows2CalloutDouble90Arrow(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 this.dy1 = 0.5;1588 this.dx1 = 0.5;1589 this.dx2 = 0;1590 this.dy2 = 0;1591 this.arrowHead = 0;1592};15931594/**1595* Extends mxShape.1596*/1597mxUtils.extend(mxShapeArrows2CalloutDouble90Arrow, mxActor);15981599mxShapeArrows2CalloutDouble90Arrow.prototype.customProperties = [1600 {name: 'dx1', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20},1601 {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, defVal: 10},1602 {name: 'dx2', dispName: 'Callout Width', type: 'float', min:0, defVal:70},1603 {name: 'dy2', dispName: 'Callout Height', type: 'float', min:0, defVal:70},1604 {name: 'arrowHead', dispName: 'ArrowHead Width', type: 'float', min:0, defVal:10}1605];16061607mxShapeArrows2CalloutDouble90Arrow.prototype.cst = {1608 CALLOUT_DOUBLE_90_ARROW : 'mxgraph.arrows2.calloutDouble90Arrow'1609};16101611/**1612* Function: paintVertexShape1613* 1614* Paints the vertex shape.1615*/1616mxShapeArrows2CalloutDouble90Arrow.prototype.paintVertexShape = function(c, x, y, w, h)1617{1618 c.translate(x, y);16191620 var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));1621 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));1622 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));1623 var dy2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2))));1624 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));16251626 c.begin();1627 c.moveTo(0, 0);1628 c.lineTo(dx2, 0);1629 c.lineTo(dx2, dy2 * 0.5 - dy1);1630 c.lineTo(w - dx1, dy2 * 0.5 - dy1);1631 c.lineTo(w - dx1, dy2 * 0.5 - dy1 - arrowHead);1632 c.lineTo(w, dy2 * 0.5);1633 c.lineTo(w - dx1, dy2 * 0.5 + dy1 + arrowHead);1634 c.lineTo(w - dx1, dy2 * 0.5 + dy1);1635 c.lineTo(dx2, dy2 * 0.5 + dy1);1636 c.lineTo(dx2, dy2);1637 c.lineTo(dx2 / 2 + dy1, dy2);1638 c.lineTo(dx2 / 2 + dy1, h - dx1);1639 c.lineTo(dx2 / 2 + dy1 + arrowHead, h - dx1);1640 c.lineTo(dx2 / 2, h);1641 c.lineTo(dx2 / 2 - dy1 - arrowHead, h - dx1);1642 c.lineTo(dx2 / 2 - dy1, h - dx1);1643 c.lineTo(dx2 / 2 - dy1, dy2);1644 c.lineTo(0, dy2);1645 c.close();1646 c.fillAndStroke();1647};16481649mxCellRenderer.registerShape(mxShapeArrows2CalloutDouble90Arrow.prototype.cst.CALLOUT_DOUBLE_90_ARROW, mxShapeArrows2CalloutDouble90Arrow);16501651mxShapeArrows2CalloutDouble90Arrow.prototype.constraints = null;16521653Graph.handleFactory[mxShapeArrows2CalloutDouble90Arrow.prototype.cst.CALLOUT_DOUBLE_90_ARROW] = function(state)1654{1655 var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds)1656 {1657 var arrowHead = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1658 var dx1 = Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)), parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));1659 var dy1 = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));16601661 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - dy1);1662 }, function(bounds, pt)1663 {1664 this.state.style['dx1'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)), bounds.height - parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)), bounds.x + bounds.width - pt.x))) / 100;1665 this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - pt.y))) / 100;1666 1667 })];1668 1669 var handle2 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds)1670 {1671 var dx2 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2))));1672 var dy2 = Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), Math.min(bounds.height - parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2))));16731674 return new mxPoint(bounds.x + dx2, bounds.y + dy2);1675 }, function(bounds, pt)1676 {1677 this.state.style['dx2'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), pt.x - bounds.x))) / 100;1678 this.state.style['dy2'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), Math.min(bounds.height - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), pt.y - bounds.y))) / 100;1679 });16801681 handles.push(handle2);1682 1683 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)1684 {1685 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));1686 var dy1 = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));1687 var arrowHead = Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));16881689 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - dy1 - arrowHead);1690 }, function(bounds, pt)1691 {1692 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) - pt.y))) / 100;1693 });16941695 handles.push(handle3);1696 1697 return handles;1698};16991700mxShapeArrows2CalloutDouble90Arrow.prototype.getConstraints = function(style, w, h)1701{1702 var constr = [];1703 var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));1704 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));1705 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));1706 var dy2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2))));1707 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));17081709 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false));1710 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 * 0.5, 0));1711 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2, 0));1712 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + dx2) * 0.5, dy2 * 0.5 - dy1));1713 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, dy2 * 0.5 - dy1 - arrowHead));1714 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, dy2 * 0.5));1715 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, dy2 * 0.5 + dy1 + arrowHead));1716 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + dx2) * 0.5, dy2 * 0.5 + dy1));1717 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2, dy2));1718 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 * 0.5 + dy1, (h - dx1 + dy2) * 0.5));1719 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 * 0.5 - dy1, (h - dx1 + dy2) * 0.5));1720 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 / 2 + dy1 + arrowHead, h - dx1));1721 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 / 2, h));1722 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 / 2 - dy1 - arrowHead, h - dx1));1723 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy2));1724 1725 return (constr);1726};17271728//**********************************************************************************************************************************************************1729//Quad Arrow1730//**********************************************************************************************************************************************************1731/**1732* Extends mxShape.1733*/1734function mxShapeArrows2QuadArrow(bounds, fill, stroke, strokewidth)1735{1736 mxShape.call(this);1737 this.bounds = bounds;1738 this.fill = fill;1739 this.stroke = stroke;1740 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1741 this.dy = 0.5;1742 this.dx = 0.5;1743 this.notch = 0;1744 this.arrowHead = 0;1745};17461747/**1748* Extends mxShape.1749*/1750mxUtils.extend(mxShapeArrows2QuadArrow, mxActor);17511752mxShapeArrows2QuadArrow.prototype.customProperties = [1753 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20},1754 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10},1755 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10}1756];17571758mxShapeArrows2QuadArrow.prototype.cst = {1759 QUAD_ARROW : 'mxgraph.arrows2.quadArrow'1760};17611762/**1763* Function: paintVertexShape1764* 1765* Paints the vertex shape.1766*/1767mxShapeArrows2QuadArrow.prototype.paintVertexShape = function(c, x, y, w, h)1768{1769 c.translate(x, y);17701771 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1772 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1773 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));17741775 c.begin();1776 c.moveTo(w * 0.5 + dy, h * 0.5 - dy);1777 c.lineTo(w - dx, h * 0.5 - dy);1778 c.lineTo(w - dx, h * 0.5 - dy - arrowHead);1779 c.lineTo(w, h * 0.5);1780 c.lineTo(w - dx, h * 0.5 + dy + arrowHead);1781 c.lineTo(w - dx, h * 0.5 + dy);1782 c.lineTo(w * 0.5 + dy, h * 0.5 + dy);1783 c.lineTo(w * 0.5 + dy, h - dx);1784 c.lineTo(w * 0.5 + dy + arrowHead, h - dx);1785 c.lineTo(w * 0.5, h);1786 c.lineTo(w * 0.5 - dy - arrowHead, h - dx);1787 c.lineTo(w * 0.5 - dy, h - dx);1788 c.lineTo(w * 0.5 - dy, h * 0.5 + dy);1789 c.lineTo(dx, h * 0.5 + dy);1790 c.lineTo(dx, h * 0.5 + dy + arrowHead);1791 c.lineTo(0, h * 0.5);1792 c.lineTo(dx, h * 0.5 - dy - arrowHead);1793 c.lineTo(dx, h * 0.5 - dy);1794 c.lineTo(w * 0.5 - dy, h * 0.5 - dy);1795 c.lineTo(w * 0.5 - dy, dx);1796 c.lineTo(w * 0.5 - dy - arrowHead, dx);1797 c.lineTo(w * 0.5, 0);1798 c.lineTo(w * 0.5 + dy + arrowHead, dx);1799 c.lineTo(w * 0.5 + dy, dx);1800 c.close();1801 c.fillAndStroke();1802};18031804mxCellRenderer.registerShape(mxShapeArrows2QuadArrow.prototype.cst.QUAD_ARROW, mxShapeArrows2QuadArrow);18051806mxShapeArrows2QuadArrow.prototype.constraints = null;18071808Graph.handleFactory[mxShapeArrows2QuadArrow.prototype.cst.QUAD_ARROW] = function(state)1809{1810 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)1811 {1812 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1813 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1814 var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));18151816 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy);1817 }, function(bounds, pt)1818 {1819 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(Math.min(bounds.width, bounds.height) / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)) - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.x + bounds.width - pt.x))) / 100;1820 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.y + bounds.height / 2 - pt.y))) / 100;1821 1822 })];1823 1824 var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds)1825 {1826 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1827 var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1828 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));18291830 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead);1831 }, function(bounds, pt)1832 {1833 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), bounds.y + bounds.height / 2 - pt.y))) / 100;1834 });18351836 handles.push(handle2);1837 1838 return handles;1839};18401841mxShapeArrows2QuadArrow.prototype.getConstraints = function(style, w, h)1842{1843 var constr = [];1844 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1845 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1846 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));18471848 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1849 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false));1850 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false));1851 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));1852 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy - arrowHead));1853 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 + dy + arrowHead));1854 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h * 0.5 - dy - arrowHead));1855 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h * 0.5 + dy + arrowHead));1856 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy - arrowHead, dx));1857 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy + arrowHead, dx));1858 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy - arrowHead, h - dx));1859 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy + arrowHead, h - dx));1860 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, (dx - dy) * 0.5 + h * 0.25));1861 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, (dx - dy) * 0.5 + h * 0.25));1862 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, (dy - dx) * 0.5 + h * 0.75));1863 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, (dy - dx) * 0.5 + h * 0.75));1864 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dx - dy) * 0.5 + w * 0.25, h * 0.5 - dy));1865 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dx - dy) * 0.5 + w * 0.25, h * 0.5 + dy));1866 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dy - dx) * 0.5 + w * 0.75, h * 0.5 - dy));1867 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dy - dx) * 0.5 + w * 0.75, h * 0.5 + dy));1868 1869 return (constr);1870};18711872//**********************************************************************************************************************************************************1873//Triad Arrow1874//**********************************************************************************************************************************************************1875/**1876* Extends mxShape.1877*/1878function mxShapeArrows2TriadArrow(bounds, fill, stroke, strokewidth)1879{1880 mxShape.call(this);1881 this.bounds = bounds;1882 this.fill = fill;1883 this.stroke = stroke;1884 this.strokewidth = (strokewidth != null) ? strokewidth : 1;1885 this.dy = 0.5;1886 this.dx = 0.5;1887 this.arrowHead = 0;1888};18891890/**1891* Extends mxShape.1892*/1893mxUtils.extend(mxShapeArrows2TriadArrow, mxActor);18941895mxShapeArrows2TriadArrow.prototype.customProperties = [1896 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20},1897 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10},1898 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:40}1899];19001901mxShapeArrows2TriadArrow.prototype.cst = {1902 TRIAD_ARROW : 'mxgraph.arrows2.triadArrow'1903};19041905/**1906* Function: paintVertexShape1907* 1908* Paints the vertex shape.1909*/1910mxShapeArrows2TriadArrow.prototype.paintVertexShape = function(c, x, y, w, h)1911{1912 c.translate(x, y);19131914 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1915 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1916 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));19171918 c.begin();1919 c.moveTo(w * 0.5 + arrowHead * 0.5 - dy, h - arrowHead + dy);1920 c.lineTo(w - dx, h - arrowHead + dy);1921 c.lineTo(w - dx, h - arrowHead);1922 c.lineTo(w, h - arrowHead * 0.5);1923 c.lineTo(w - dx, h);1924 c.lineTo(w - dx, h - dy);1925 c.lineTo(dx, h - dy);1926 c.lineTo(dx, h);1927 c.lineTo(0, h - arrowHead * 0.5);1928 c.lineTo(dx, h - arrowHead);1929 c.lineTo(dx, h - arrowHead + dy);1930 c.lineTo(w * 0.5 - arrowHead * 0.5 + dy, h - arrowHead + dy);1931 c.lineTo(w * 0.5 - arrowHead * 0.5 + dy, dx);1932 c.lineTo(w * 0.5 - arrowHead * 0.5, dx);1933 c.lineTo(w * 0.5, 0);1934 c.lineTo(w * 0.5 + arrowHead * 0.5, dx);1935 c.lineTo(w * 0.5 + arrowHead * 0.5 - dy, dx);1936 c.close();1937 c.fillAndStroke();1938};19391940mxCellRenderer.registerShape(mxShapeArrows2TriadArrow.prototype.cst.TRIAD_ARROW, mxShapeArrows2TriadArrow);19411942mxShapeArrows2TriadArrow.prototype.constraints = null;19431944Graph.handleFactory[mxShapeArrows2TriadArrow.prototype.cst.TRIAD_ARROW] = function(state)1945{1946 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)1947 {1948 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));1949 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1950 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));19511952 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - dy);1953 }, function(bounds, pt)1954 {1955 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(Math.min(bounds.height - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), bounds.width / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2), bounds.x + bounds.width - pt.x))) / 100;1956 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2, bounds.y + bounds.height - pt.y))) / 100;1957 1958 })];1959 1960 var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds)1961 {1962 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));1963 var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));1964 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));19651966 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - arrowHead);1967 }, function(bounds, pt)1968 {1969 this.state.style['arrowHead'] = Math.round(100 * Math.max(2 * parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(bounds.height - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)) * 2, bounds.y + bounds.height - pt.y))) / 100;1970 });19711972 handles.push(handle2);1973 1974 return handles;1975};19761977mxShapeArrows2TriadArrow.prototype.getConstraints = function(style, w, h)1978{1979 var constr = [];1980 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));1981 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));1982 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));19831984 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, - arrowHead * 0.5, dx));1985 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false));1986 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5, h - dy));1987 constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, arrowHead * 0.5, dx));1988 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h - arrowHead));1989 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, h - arrowHead * 0.5));1990 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h));1991 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h - arrowHead));1992 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - arrowHead * 0.5));1993 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h));1994 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 1.5 - dx + arrowHead * 0.5 - dy) * 0.5, h - arrowHead + dy));1995 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 1.5 - dx + arrowHead * 0.5 - dy) * 0.5, h - dy));1996 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - arrowHead * 0.5 + dy) * 0.5, h - arrowHead + dy));1997 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - arrowHead * 0.5 + dy) * 0.5, h - dy));1998 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - arrowHead * 0.5 + dy, (dx + h - arrowHead + dy) * 0.5));1999 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + arrowHead * 0.5 - dy, (dx + h - arrowHead + dy) * 0.5));2000 2001 return (constr);2002};20032004//**********************************************************************************************************************************************************2005//Tailed Arrow2006//**********************************************************************************************************************************************************2007/**2008* Extends mxShape.2009*/2010function mxShapeArrows2TailedArrow(bounds, fill, stroke, strokewidth)2011{2012 mxShape.call(this);2013 this.bounds = bounds;2014 this.fill = fill;2015 this.stroke = stroke;2016 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2017 this.dy = 0.5;2018 this.dx = 0.5;2019 this.notch = 0;2020 this.arrowHead = 0;2021};20222023/**2024* Extends mxShape.2025*/2026mxUtils.extend(mxShapeArrows2TailedArrow, mxActor);20272028mxShapeArrows2TailedArrow.prototype.customProperties = [2029 {name: 'dx1', dispName: 'Arrowhead Length', type: 'float', min:0, defVal: 20},2030 {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, defVal: 10},2031 {name: 'dx2', dispName: 'Tail Length', type: 'float', min:0, defVal: 25},2032 {name: 'dy2', dispName: 'Tail Width', type: 'float', min:0, defVal:30},2033 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal: 0},2034 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:20}2035];20362037mxShapeArrows2TailedArrow.prototype.cst = {2038 TAILED_ARROW : 'mxgraph.arrows2.tailedArrow'2039};20402041/**2042* Function: paintVertexShape2043* 2044* Paints the vertex shape.2045*/2046mxShapeArrows2TailedArrow.prototype.paintVertexShape = function(c, x, y, w, h)2047{2048 c.translate(x, y);20492050 var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));2051 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));2052 var dy2 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2))));2053 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));2054 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));2055 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));2056 var x2 = 0;2057 2058 if (dy2 != 0)2059 {2060 x2 = dx2 + dy2 * (dy2 - dy1) / dy2;2061 }20622063 c.begin();2064 c.moveTo(0, h * 0.5 - dy2);2065 c.lineTo(dx2, h * 0.5 - dy2);2066 c.lineTo(x2, h * 0.5 - dy1);2067 c.lineTo(w - dx1, h * 0.5 - dy1);2068 c.lineTo(w - dx1, h * 0.5 - dy1 - arrowHead);2069 c.lineTo(w, h * 0.5);2070 c.lineTo(w - dx1, h * 0.5 + dy1 + arrowHead);2071 c.lineTo(w - dx1, h * 0.5 + dy1);2072 c.lineTo(x2, h * 0.5 + dy1);2073 c.lineTo(dx2, h * 0.5 + dy2);2074 c.lineTo(0, h * 0.5 + dy2);2075 c.lineTo(notch, h * 0.5);2076 c.close();2077 c.fillAndStroke();2078};20792080mxCellRenderer.registerShape(mxShapeArrows2TailedArrow.prototype.cst.TAILED_ARROW, mxShapeArrows2TailedArrow);20812082mxShapeArrows2TailedArrow.prototype.constraints = null;20832084Graph.handleFactory[mxShapeArrows2TailedArrow.prototype.cst.TAILED_ARROW] = function(state)2085{2086 var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds)2087 {2088 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2089 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));2090 var dy1 = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));20912092 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1);2093 }, function(bounds, pt)2094 {2095 this.state.style['dx1'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)), bounds.x + bounds.width - pt.x))) / 100;2096 this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)), bounds.y + bounds.height / 2 - pt.y))) / 100;2097 2098 })];2099 2100 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)2101 {2102 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));21032104 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);2105 }, function(bounds, pt)2106 {2107 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)), pt.x - bounds.x))) / 100;2108 });21092110 handles.push(handle2);2111 2112 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)2113 {2114 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));2115 var dy1 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));2116 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));21172118 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1 - arrowHead);2119 }, function(bounds, pt)2120 {2121 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), bounds.y + bounds.height / 2 - pt.y))) / 100;2122 });21232124 handles.push(handle3);2125 2126 var handle4 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds)2127 {2128 var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2))));2129 var dy2 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2))));21302131 return new mxPoint(bounds.x + dx2, bounds.y + bounds.height / 2 - dy2);2132 }, function(bounds, pt)2133 {2134 this.state.style['dx2'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)) - parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) + parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)) - 1, pt.x - bounds.x))) / 100;2135 this.state.style['dy2'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), Math.min(bounds.height / 2, bounds.y + bounds.height / 2 - pt.y))) / 100;2136 2137 });21382139 handles.push(handle4);21402141 return handles;2142};21432144mxShapeArrows2TailedArrow.prototype.getConstraints = function(style, w, h)2145{2146 var constr = [];2147 var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));2148 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));2149 var dy2 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2))));2150 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));2151 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));2152 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));2153 var x2 = 0;2154 2155 if (dy2 != 0)2156 {2157 x2 = dx2 + dy2 * (dy2 - dy1) / dy2;2158 }21592160 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0));2161 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h * 0.5 - dy2));2162 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2, h * 0.5 - dy2));2163 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + x2) * 0.5, h * 0.5 - dy1));2164 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h * 0.5 - dy1 - arrowHead));2165 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h * 0.5 + dy2));2166 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2, h * 0.5 + dy2));2167 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + x2) * 0.5, h * 0.5 + dy1));2168 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h * 0.5 + dy1 + arrowHead));2169 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2170 2171 return (constr);2172};21732174//**********************************************************************************************************************************************************2175//Tailed Arrow with Notch2176//**********************************************************************************************************************************************************2177/**2178* Extends mxShape.2179*/2180function mxShapeArrows2TailedNotchedArrow(bounds, fill, stroke, strokewidth)2181{2182 mxShape.call(this);2183 this.bounds = bounds;2184 this.fill = fill;2185 this.stroke = stroke;2186 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2187 this.dy = 0.5;2188 this.dx = 0.5;2189 this.notch = 0;2190 this.arrowHead = 0;2191};21922193/**2194* Extends mxShape.2195*/2196mxUtils.extend(mxShapeArrows2TailedNotchedArrow, mxActor);21972198mxShapeArrows2TailedNotchedArrow.prototype.customProperties = [2199 {name: 'dx1', dispName: 'Arrowhead Length', type: 'float', mix:0, defVal:20},2200 {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, defVal:10},2201 {name: 'dx2', dispName: 'Tail Length', type: 'float', min:0, defVal:25},2202 {name: 'dy2', dispName: 'Tail Width', type: 'float', min:0, defVal:30},2203 {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:20},2204 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:20}2205];22062207mxShapeArrows2TailedNotchedArrow.prototype.cst = {2208 TAILED_NOTCHED_ARROW : 'mxgraph.arrows2.tailedNotchedArrow'2209};22102211/**2212* Function: paintVertexShape2213* 2214* Paints the vertex shape.2215*/2216mxShapeArrows2TailedNotchedArrow.prototype.paintVertexShape = function(c, x, y, w, h)2217{2218 c.translate(x, y);22192220 var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));2221 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));2222 var dy2 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2))));2223 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));2224 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));2225 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));2226 var x2 = 0;2227 2228 if (dy2 != 0)2229 {2230 x2 = dx2 + notch * (dy2 - dy1) / dy2;2231 }22322233 c.begin();2234 c.moveTo(0, h * 0.5 - dy2);2235 c.lineTo(dx2, h * 0.5 - dy2);2236 c.lineTo(x2, h * 0.5 - dy1);2237 c.lineTo(w - dx1, h * 0.5 - dy1);2238 c.lineTo(w - dx1, h * 0.5 - dy1 - arrowHead);2239 c.lineTo(w, h * 0.5);2240 c.lineTo(w - dx1, h * 0.5 + dy1 + arrowHead);2241 c.lineTo(w - dx1, h * 0.5 + dy1);2242 c.lineTo(x2, h * 0.5 + dy1);2243 c.lineTo(dx2, h * 0.5 + dy2);2244 c.lineTo(0, h * 0.5 + dy2);2245 c.lineTo(notch, h * 0.5);2246 c.close();2247 c.fillAndStroke();2248};22492250mxCellRenderer.registerShape(mxShapeArrows2TailedNotchedArrow.prototype.cst.TAILED_NOTCHED_ARROW, mxShapeArrows2TailedNotchedArrow);22512252mxShapeArrows2TailedNotchedArrow.prototype.constraints = null;22532254Graph.handleFactory[mxShapeArrows2TailedNotchedArrow.prototype.cst.TAILED_NOTCHED_ARROW] = function(state)2255{2256 var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds)2257 {2258 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2259 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));2260 var dy1 = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));22612262 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1);2263 }, function(bounds, pt)2264 {2265 this.state.style['dx1'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))- parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)), bounds.x + bounds.width - pt.x))) / 100;2266 this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)), parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)), bounds.y + bounds.height / 2 - pt.y))) / 100;2267 2268 })];2269 2270 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)2271 {2272 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));22732274 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);2275 }, function(bounds, pt)2276 {2277 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), pt.x - bounds.x))) / 100;2278 });22792280 handles.push(handle2);2281 2282 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)2283 {2284 var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1))));2285 var dy1 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1))));2286 var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));22872288 return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1 - arrowHead);2289 }, function(bounds, pt)2290 {2291 this.state.style['arrowHead'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2 - parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), bounds.y + bounds.height / 2 - pt.y))) / 100;2292 });22932294 handles.push(handle3);2295 2296 var handle4 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds)2297 {2298 var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2))));2299 var dy2 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2))));23002301 return new mxPoint(bounds.x + dx2, bounds.y + bounds.height / 2 - dy2);2302 }, function(bounds, pt)2303 {2304 this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)) - parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)), pt.x - bounds.x))) / 100;2305 this.state.style['dy2'] = Math.round(100 * Math.max(parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)), Math.min(bounds.height / 2, bounds.y + bounds.height / 2 - pt.y))) / 100;2306 2307 });23082309 handles.push(handle4);23102311 return handles;2312};23132314mxShapeArrows2TailedNotchedArrow.prototype.getConstraints = function(style, w, h)2315{2316 var constr = [];2317 var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1))));2318 var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1))));2319 var dy2 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2))));2320 var dx2 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))));2321 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));2322 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));2323 var x2 = 0;2324 2325 if (dy2 != 0)2326 {2327 x2 = dx2 + notch * (dy2 - dy1) / dy2;2328 }23292330 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0));2331 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h * 0.5 - dy2));2332 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2, h * 0.5 - dy2));2333 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + x2) * 0.5, h * 0.5 - dy1));2334 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h * 0.5 - dy1 - arrowHead));2335 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h * 0.5 + dy2));2336 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2, h * 0.5 + dy2));2337 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + x2) * 0.5, h * 0.5 + dy1));2338 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h * 0.5 + dy1 + arrowHead));2339 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2340 2341 return (constr);2342};23432344//**********************************************************************************************************************************************************2345//Striped Arrow2346//**********************************************************************************************************************************************************2347/**2348* Extends mxShape.2349*/2350function mxShapeArrows2StripedArrow(bounds, fill, stroke, strokewidth)2351{2352 mxShape.call(this);2353 this.bounds = bounds;2354 this.fill = fill;2355 this.stroke = stroke;2356 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2357 this.dy = 0.5;2358 this.dx = 0.5;2359 this.notch = 0;2360};23612362/**2363* Extends mxShape.2364*/2365mxUtils.extend(mxShapeArrows2StripedArrow, mxActor);23662367mxShapeArrows2StripedArrow.prototype.customProperties = [2368 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:40},2369 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal:0.6},2370 {name: 'notch', dispName: 'Stripes Length', type: 'float', min:0, defVal:25}2371];23722373mxShapeArrows2StripedArrow.prototype.cst = {2374 STRIPED_ARROW : 'mxgraph.arrows2.stripedArrow'2375};23762377/**2378* Function: paintVertexShape2379* 2380* Paints the vertex shape.2381*/2382mxShapeArrows2StripedArrow.prototype.paintVertexShape = function(c, x, y, w, h)2383{2384 c.translate(x, y);23852386 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));2387 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));2388 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));23892390 c.begin();2391 c.moveTo(notch, dy);2392 c.lineTo(w - dx, dy);2393 c.lineTo(w - dx, 0);2394 c.lineTo(w, h * 0.5);2395 c.lineTo(w - dx, h);2396 c.lineTo(w - dx, h - dy);2397 c.lineTo(notch, h - dy);2398 c.close();2399 c.moveTo(0, h - dy);2400 c.lineTo(notch * 0.16, h - dy);2401 c.lineTo(notch * 0.16, dy);2402 c.lineTo(0, dy);2403 c.close();2404 c.moveTo(notch * 0.32, h - dy);2405 c.lineTo(notch * 0.8, h - dy);2406 c.lineTo(notch * 0.8, dy);2407 c.lineTo(notch * 0.32, dy);2408 c.close();2409 c.fillAndStroke();2410};24112412mxCellRenderer.registerShape(mxShapeArrows2StripedArrow.prototype.cst.STRIPED_ARROW, mxShapeArrows2StripedArrow);24132414mxShapeArrows2StripedArrow.prototype.constraints = null;24152416Graph.handleFactory[mxShapeArrows2StripedArrow.prototype.cst.STRIPED_ARROW] = function(state)2417{2418 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)2419 {2420 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));2421 var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));24222423 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2);2424 }, function(bounds, pt)2425 {2426 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)), bounds.x + bounds.width - pt.x))) / 100;2427 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100;2428 })];2429 2430 var handle2 = Graph.createHandle(state, ['notch'], function(bounds)2431 {2432 var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch))));24332434 return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2);2435 }, function(bounds, pt)2436 {2437 this.state.style['notch'] = Math.round(100 * Math.max(0, Math.min(bounds.width - parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)), pt.x - bounds.x))) / 100;2438 });2439 2440 handles.push(handle2);2441 2442 return handles;2443};24442445mxShapeArrows2StripedArrow.prototype.getConstraints = function(style, w, h)2446{2447 var constr = [];2448 var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));2449 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));2450 var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch))));24512452 constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false));2453 constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, 0, 0));2454 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy));2455 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - dy));2456 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, dy));2457 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0));2458 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h - dy));2459 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h));2460 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, dy));2461 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, h - dy));2462 2463 return (constr);2464};24652466//**********************************************************************************************************************************************************2467//Jump-In Arrow2468//**********************************************************************************************************************************************************2469/**2470* Extends mxShape.2471*/2472function mxShapeArrows2JumpInArrow(bounds, fill, stroke, strokewidth)2473{2474 mxShape.call(this);2475 this.bounds = bounds;2476 this.fill = fill;2477 this.stroke = stroke;2478 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2479 this.dy = 0.5;2480 this.dx = 0.5;2481 this.arrowHead = 40;2482};24832484/**2485* Extends mxShape.2486*/2487mxUtils.extend(mxShapeArrows2JumpInArrow, mxActor);24882489mxShapeArrows2JumpInArrow.prototype.customProperties = [2490 {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:38},2491 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:15},2492 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:55}2493];24942495mxShapeArrows2JumpInArrow.prototype.cst = {2496 JUMP_IN_ARROW : 'mxgraph.arrows2.jumpInArrow'2497};24982499/**2500* Function: paintVertexShape2501* 2502* Paints the vertex shape.2503*/2504mxShapeArrows2JumpInArrow.prototype.paintVertexShape = function(c, x, y, w, h)2505{2506 c.translate(x, y);25072508 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));2509 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));2510 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));25112512 c.begin();2513 c.moveTo(w - dx, 0);2514 c.lineTo(w, arrowHead * 0.5);2515 c.lineTo(w - dx, arrowHead);2516 c.lineTo(w - dx, arrowHead / 2 + dy);2517 c.arcTo(w - dx, h - arrowHead / 2 - dy, 0, 0, 0, 0, h);2518 c.arcTo(w - dx, h - arrowHead / 2 + dy, 0, 0, 1, w - dx, arrowHead / 2 - dy);2519 c.close();2520 c.fillAndStroke();2521};25222523mxCellRenderer.registerShape(mxShapeArrows2JumpInArrow.prototype.cst.JUMP_IN_ARROW, mxShapeArrows2JumpInArrow);25242525mxShapeArrows2JumpInArrow.prototype.constraints = null;25262527Graph.handleFactory[mxShapeArrows2JumpInArrow.prototype.cst.JUMP_IN_ARROW] = function(state)2528{2529 var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds)2530 {2531 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2532 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));2533 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));2534 2535 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy);2536 }, function(bounds, pt)2537 {2538 this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width, bounds.x + bounds.width - pt.x))) / 100;2539 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2 - pt.y))) / 100;2540 2541 })];2542 2543 var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds)2544 {2545 var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx))));2546 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));25472548 return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead);2549 }, function(bounds, pt)2550 {2551 this.state.style['arrowHead'] = Math.round(100 * Math.max(2 * parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(bounds.height, pt.y - bounds.y))) / 100;2552 });2553 2554 handles.push(handle2);25552556 return handles;2557};25582559mxShapeArrows2JumpInArrow.prototype.getConstraints = function(style, w, h)2560{2561 var constr = [];2562 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));2563 var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx))));2564 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));25652566 constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false));2567 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0));2568 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, arrowHead * 0.5));2569 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead));2570 2571 return (constr);2572};25732574//**********************************************************************************************************************************************************2575//U Turn Arrow2576//**********************************************************************************************************************************************************2577/**2578* Extends mxShape.2579*/2580function mxShapeArrows2UTurnArrow(bounds, fill, stroke, strokewidth)2581{2582 mxShape.call(this);2583 this.bounds = bounds;2584 this.fill = fill;2585 this.stroke = stroke;2586 this.strokewidth = (strokewidth != null) ? strokewidth : 1;2587 this.dy = 0.5;2588 this.dx = 0.5;2589 this.arrowHead = 40;2590};25912592/**2593* Extends mxShape.2594*/2595mxUtils.extend(mxShapeArrows2UTurnArrow, mxActor);25962597mxShapeArrows2UTurnArrow.prototype.customProperties = [2598 {name: 'dx2', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:25},2599 {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:11},2600 {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:43}2601];26022603mxShapeArrows2UTurnArrow.prototype.cst = {2604 U_TURN_ARROW : 'mxgraph.arrows2.uTurnArrow'2605};26062607/**2608* Function: paintVertexShape2609* 2610* Paints the vertex shape.2611*/2612mxShapeArrows2UTurnArrow.prototype.paintVertexShape = function(c, x, y, w, h)2613{2614 c.translate(x, y);26152616 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));2617 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));2618 var dx = (h - arrowHead / 2 + dy) / 2;2619 var dx2 = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2)));2620 2621 c.begin();2622 c.moveTo(dx, 0);2623 c.lineTo(dx + dx2, arrowHead * 0.5);2624 c.lineTo(dx, arrowHead);2625 c.lineTo(dx, arrowHead / 2 + dy);2626 c.arcTo(dx - 2 * dy, dx - 2 * dy, 0, 0, 0, dx, h - 2 * dy);2627 c.lineTo(Math.max(w, dx), h - 2 * dy);2628 c.lineTo(Math.max(w, dx), h);2629 c.lineTo(dx, h);2630 c.arcTo(dx, dx, 0, 0, 1, dx, arrowHead / 2 - dy);2631 c.close();2632 c.fillAndStroke();2633};26342635mxCellRenderer.registerShape(mxShapeArrows2UTurnArrow.prototype.cst.U_TURN_ARROW, mxShapeArrows2UTurnArrow);26362637mxShapeArrows2UTurnArrow.prototype.constraints = null;26382639Graph.handleFactory[mxShapeArrows2UTurnArrow.prototype.cst.U_TURN_ARROW] = function(state)2640{2641 var handles = [Graph.createHandle(state, ['dy'], function(bounds)2642 {2643 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2644 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));2645 var dx = (bounds.height - arrowHead / 2 + dy) / 2;26462647 return new mxPoint(bounds.x + dx, bounds.y + arrowHead / 2 - dy);2648 }, function(bounds, pt)2649 {2650 this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)) / 2 - pt.y))) / 100;2651 2652 })];26532654 var handle2 = Graph.createHandle(state, ['dx2'], function(bounds)2655 {2656 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2657 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));2658 var dx = (bounds.height - arrowHead / 2 + dy) / 2;2659 2660 var dx2 = Math.max(0, Math.min(bounds.width - dx, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2))));26612662 return new mxPoint(bounds.x + dx + dx2, bounds.y + arrowHead / 2);2663 }, function(bounds, pt)2664 {2665 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2666 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));2667 var dx = (bounds.height - arrowHead / 2 + dy) / 2;2668 this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(Math.max(bounds.width, dx), pt.x - bounds.x - dx))) / 100;2669 });2670 2671 handles.push(handle2);26722673 var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds)2674 {2675 var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead))));2676 var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy))));2677 var dx = (bounds.height - arrowHead / 2 + dy) / 2;26782679 return new mxPoint(bounds.x + dx, bounds.y + arrowHead);2680 }, function(bounds, pt)2681 {2682 this.state.style['arrowHead'] = Math.round(100 * Math.max(2 * parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)), Math.min(bounds.height / 2, pt.y - bounds.y))) / 100;2683 });2684 2685 handles.push(handle3);26862687 return handles;2688};26892690mxShapeArrows2UTurnArrow.prototype.getConstraints = function(style, w, h)2691{2692 var constr = [];2693 var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy))));2694 var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead))));2695 var dx = (h - arrowHead / 2 + dy) / 2;2696 var dx2 = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2)));2697 2698 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, 0));2699 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx + dx2, arrowHead * 0.5));2700 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, arrowHead));2701 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dx + w) * 0.5, h - 2 * dy));2702 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, Math.max(w, dx), h - 2 * dy));2703 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, Math.max(w, dx), h - dy));2704 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, Math.max(w, dx), h));2705 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dx + w) * 0.5, h));2706 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h));2707 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h + arrowHead * 0.5 - dy) * 0.5));2708 constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead - 2 * dy, (h + arrowHead * 0.5 - dy) * 0.5));2709 2710 return (constr);2711};27122713//**********************************************************************************************************************************************************2714//Wedge Arrow2715//**********************************************************************************************************************************************************2716function mxShapeArrowsWedgeArrow()2717{2718 mxArrow.call(this);2719};27202721mxUtils.extend(mxShapeArrowsWedgeArrow, mxArrow);27222723mxShapeArrowsWedgeArrow.prototype.useSvgBoundingBox = true;27242725mxShapeArrowsWedgeArrow.prototype.customProperties = [2726 {name: 'startWidth', dispName: 'Wedge Width', type: 'float', min:0, defVal:25}2727];27282729mxShapeArrowsWedgeArrow.prototype.paintEdgeShape = function(c, pts)2730{2731 var sw = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'startWidth', 20)));27322733 // Base vector (between end points)2734 var p0 = pts[0];2735 var pe = pts[pts.length - 1];27362737 var dx = pe.x - p0.x;2738 var dy = pe.y - p0.y;2739 var dist = Math.sqrt(dx * dx + dy * dy); 2740 var nx = dx * sw / dist;2741 var ny = dy * sw / dist;27422743 c.begin();2744 c.moveTo(p0.x + ny, p0.y - nx);2745 c.lineTo(p0.x - ny, p0.y + nx);2746 c.lineTo(pe.x, pe.y);2747 c.close();2748 c.fillAndStroke();2749};27502751mxCellRenderer.registerShape('mxgraph.arrows2.wedgeArrow', mxShapeArrowsWedgeArrow);27522753//**********************************************************************************************************************************************************2754//Wedge Arrow Dashed2755//**********************************************************************************************************************************************************2756function mxShapeArrowsWedgeArrowDashed()2757{2758 mxArrowConnector.call(this);2759};27602761mxUtils.extend(mxShapeArrowsWedgeArrowDashed, mxArrow);27622763mxShapeArrowsWedgeArrowDashed.prototype.useSvgBoundingBox = true;27642765mxShapeArrowsWedgeArrowDashed.prototype.customProperties = [2766 {name: 'startWidth', dispName: 'Wedge Width', type: 'float', min:0, defVal:25}2767];27682769mxShapeArrowsWedgeArrowDashed.prototype.paintEdgeShape = function(c, pts)2770{2771 var startWidth = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'startWidth', 20)));2772 var steps = 8;2773 // Base vector (between end points)2774 var p0 = pts[0];2775 var pe = pts[pts.length - 1];27762777 var dx = pe.x - p0.x;2778 var dy = pe.y - p0.y;2779 var dist = Math.sqrt(dx * dx + dy * dy); 2780 var nx = dx * startWidth / dist;2781 var ny = dy * startWidth / dist;2782 var cnx = nx; // current nx2783 var cny = ny; // current ny2784 var pcx = p0.x; // current x on edge2785 var pcy = p0.y; // current y on edge27862787 c.begin();2788 2789 for (var i = 0; i <= steps; i++)2790 {2791 cnx = nx * (steps - i) / steps;2792 cny = ny * (steps - i) / steps;27932794 if (i == steps)2795 {2796 cnx = nx * (steps - i * 0.98) / steps;2797 cny = ny * (steps - i * 0.98) / steps;2798 }2799 2800 var px1 = pcx + cny;2801 var py1 = pcy - cnx;2802 var px2 = pcx - cny;2803 var py2 = pcy + cnx;2804 2805 c.moveTo(px1, py1);2806 c.lineTo(px2, py2);2807 2808 pcx = pcx + dx / steps;2809 pcy = pcy + dy / steps;2810 } 2811 2812 c.stroke();2813};28142815mxCellRenderer.registerShape('mxgraph.arrows2.wedgeArrowDashed', mxShapeArrowsWedgeArrowDashed);28162817//**********************************************************************************************************************************************************2818//Wedge Arrow Dashed v22819//**********************************************************************************************************************************************************2820function mxShapeArrowsWedgeArrowDashed2()2821{2822 mxArrowConnector.call(this);2823};28242825mxUtils.extend(mxShapeArrowsWedgeArrowDashed2, mxArrow);28262827mxShapeArrowsWedgeArrowDashed2.prototype.useSvgBoundingBox = true;28282829mxShapeArrowsWedgeArrowDashed2.prototype.customProperties = [2830 {name: 'startWidth', dispName: 'Wedge Width', type: 'float', min:0, defVal:25},2831 {name: 'stepSize', dispName: 'Step Size', type: 'float', min:0, defVal:25}2832];28332834mxShapeArrowsWedgeArrowDashed2.prototype.paintEdgeShape = function(c, pts)2835{2836 var startWidth = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'startWidth', 20)));2837 var stepSize = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'stepSize', 10)));28382839 // Base vector (between end points)2840 var p0 = pts[0];2841 var pe = pts[pts.length - 1];28422843 var dx = pe.x - p0.x;2844 var dy = pe.y - p0.y;2845 var dist = Math.sqrt(dx * dx + dy * dy); 2846 var nx = dx * startWidth / dist;2847 var ny = dy * startWidth / dist;2848 var cnx = nx; // current nx2849 var cny = ny; // current ny2850 var pcx = p0.x; // current x on edge2851 var pcy = p0.y; // current y on edge2852 var steps = Math.floor(dist / stepSize);28532854 c.begin();2855 2856 for (var i = 0; i <= steps; i++)2857 {2858 cnx = nx * (steps - i) / steps;2859 cny = ny * (steps - i) / steps;28602861 if (i == steps)2862 {2863 cnx = nx * (steps - i * 0.98) / steps;2864 cny = ny * (steps - i * 0.98) / steps;2865 }2866 2867 var px1 = pcx + cny;2868 var py1 = pcy - cnx;2869 var px2 = pcx - cny;2870 var py2 = pcy + cnx;2871 2872 c.moveTo(px1, py1);2873 c.lineTo(px2, py2);2874 2875 pcx = pcx + dx / steps;2876 pcy = pcy + dy / steps;2877 } 2878 2879 c.stroke();2880};28812882mxCellRenderer.registerShape('mxgraph.arrows2.wedgeArrowDashed2', mxShapeArrowsWedgeArrowDashed2);