Commit 88b3d77744e83a70698d740ebae2d7fc5f8d421f
Merge branch 'perf/main_dev' into 'main_dev'
Perf/main dev See merge request yunteng/thingskit-scada!160
Showing
46 changed files
with
2273 additions
and
2048 deletions
| ... | ... | @@ -68,9 +68,6 @@ dependencies: |
| 68 | 68 | vue: |
| 69 | 69 | specifier: ^3.3.4 |
| 70 | 70 | version: 3.3.4 |
| 71 | - vue3-seamless-scroll: | |
| 72 | - specifier: ^2.0.1 | |
| 73 | - version: 2.0.1 | |
| 74 | 71 | |
| 75 | 72 | devDependencies: |
| 76 | 73 | '@iconify/vue': |
| ... | ... | @@ -6412,12 +6409,6 @@ packages: |
| 6412 | 6409 | vue: 3.3.4 |
| 6413 | 6410 | dev: false |
| 6414 | 6411 | |
| 6415 | - /vue3-seamless-scroll@2.0.1: | |
| 6416 | - resolution: {integrity: sha512-mI3BaDU3pjcPUhVSw3/xNKdfPBDABTi/OdZaZqKysx4cSdNfGRbVvGNDzzptBbJ5S7imv5T55l6x/SqgnxKreg==} | |
| 6417 | - dependencies: | |
| 6418 | - throttle-debounce: 5.0.0 | |
| 6419 | - dev: false | |
| 6420 | - | |
| 6421 | 6412 | /vue@3.3.4: |
| 6422 | 6413 | resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} |
| 6423 | 6414 | dependencies: | ... | ... |
| 1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1698114729661" class="icon" viewBox="0 0 1262 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18580" xmlns:xlink="http://www.w3.org/1999/xlink" width="39.4375" height="32"><path d="M1144.523821 0.00008H118.407981A118.271982 118.271982 0 0 0 0 118.101062v787.796876A118.271982 118.271982 0 0 0 118.407981 1023.99992h1026.11584a118.305982 118.305982 0 0 0 118.408982-118.101982V118.101062A118.373982 118.373982 0 0 0 1144.523821 0.00008z m19.729997 785.407877L916.546857 455.680009a70.041989 70.041989 0 0 0-64.85299-26.623996 87.619986 87.619986 0 0 0-74.615988 25.599996L560.093912 789.161957a46.659993 46.659993 0 0 1-40.755993 22.186996 55.090991 55.090991 0 0 1-44.781993-22.186996L360.447944 658.772977a99.464984 99.464984 0 0 0-67.24299-38.569994 105.812983 105.812983 0 0 0-69.255989 42.665993L98.713985 818.859952V139.263058a39.252994 39.252994 0 0 1 39.491993-39.252994h986.589846a39.252994 39.252994 0 0 1 39.491994 39.252994v646.143899zM572.141911 354.645025A139.775978 139.775978 0 1 1 432.399932 215.040046a139.570978 139.570978 0 0 1 139.741979 139.604979z" fill="#1296db" p-id="18581"></path></svg> | |
| \ No newline at end of file | ||
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path fill="#8CBCD6" d="M31 41H8c-2.2 0-4-1.8-4-4V11c0-2.2 1.8-4 4-4h32c2.2 0 4 1.8 4 4v17c0 7.2-5.8 13-13 13z"/><circle cx="35" cy="16" r="3" fill="#B3DDF5"/><path fill="#9AC9E3" d="M20 16L9 32h22z"/><path fill="#B3DDF5" d="m31 22l-8 10h16z"/><path fill="#E57373" d="m47.7 29.1l-2.8-2.8c-.4-.4-1.1-.4-1.6 0L42 27.6l4.4 4.4l1.3-1.3c.4-.4.4-1.1 0-1.6z"/><path fill="#FF9800" d="M27.467 42.167L39.77 29.865l4.384 4.384L31.85 46.55z"/><path fill="#B0BEC5" d="m46.4 32.038l-2.192 2.192l-4.383-4.384l2.192-2.191z"/><path fill="#FFC107" d="M27.5 42.2L26 48l5.8-1.5z"/><path fill="#37474F" d="m26.7 45l-.7 3l3-.7z"/></svg> | ... | ... |
| 1 | -<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1698114511177" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6417" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M328.887995 146.401322a109.61707 109.61707 0 1 0 109.61707 109.61707 109.690639 109.690639 0 0 0-109.61707-109.61707zM804.655507 0H219.270925A219.381277 219.381277 0 0 0 0 219.270925v584.869602a227.768087 227.768087 0 0 0 3.678425 37.740643l-3.678425 3.678425a131.76119 131.76119 0 0 0 13.463036 31.560888 219.197356 219.197356 0 0 0 205.99181 146.879517h584.869603a219.785904 219.785904 0 0 0 215.629283-180.463539 120.578777 120.578777 0 0 0 4.119837-30.494145V219.270925A219.381277 219.381277 0 0 0 804.655507 0z m146.364538 557.980315a5266.769164 5266.769164 0 0 0-73.936346-103.437316c-73.568503-99.31748-160.820749-129.811624-249.76507-16.037934l-114.28867 160.820749c-82.727782-82.727782-187.599684-91.519218-274.594439 7.761477l-164.46239 165.529133V219.270925A146.548459 146.548459 0 0 1 220.300884 72.832818h584.869602a146.548459 146.548459 0 0 1 146.364538 146.364538v338.70939z" fill="#0AA8FD" p-id="6418"></path></svg> | |
| \ No newline at end of file | ||
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path fill="#8CBCD6" d="M40 41H8c-2.2 0-4-1.8-4-4V11c0-2.2 1.8-4 4-4h32c2.2 0 4 1.8 4 4v26c0 2.2-1.8 4-4 4z"/><circle cx="35" cy="16" r="3" fill="#B3DDF5"/><path fill="#9AC9E3" d="M20 16L9 32h22z"/><path fill="#B3DDF5" d="m31 22l-8 10h16z"/><circle cx="38" cy="38" r="10" fill="#43A047"/><g fill="#fff"><path d="M36 32h4v12h-4z"/><path d="M32 36h12v4H32z"/></g></svg> | ... | ... |
| ... | ... | @@ -30,9 +30,9 @@ |
| 30 | 30 | // 柱状图 |
| 31 | 31 | this.createVertexTemplateEntry("shape=mxgraph.thingskit/histogramChartComponent;verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;strokeColor=none;fontColor=#000000;align=center;textOpacity=100;fillColor=none;fontSize=16;", 400, 400, createUserObject({ [COMPONENT_KEY]: 'Histogram', [CATEGORY]: 'CHART' }), '柱状图', true, "text textbox textarea label"), |
| 32 | 32 | // 流量计(圆形) |
| 33 | - this.createVertexTemplateEntry("shape=mxgraph.thingskit/circularFlowMeterComponent;verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;strokeColor=none;fontColor=#000000;align=center;textOpacity=100;fillColor=none;fontSize=16;", 150, 200, createUserObject({ [COMPONENT_KEY]: 'CircularFlowMeter', [CATEGORY]: 'CHART' }), '流量计(圆形)', true, "circular flow meter"), | |
| 33 | + this.createVertexTemplateEntry("shape=mxgraph.thingskit/circularFlowMeterComponent;verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;strokeColor=none;fontColor=#000000;align=center;textOpacity=100;fillColor=none;fontSize=16;", 200, 250, createUserObject({ [COMPONENT_KEY]: 'CircularFlowMeter', [CATEGORY]: 'CHART' }), '流量计(圆形)', true, "circular flow meter"), | |
| 34 | 34 | // 流量计(方形) |
| 35 | - this.createVertexTemplateEntry("shape=mxgraph.thingskit/rectFlowMeterComponent;verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;strokeColor=none;fontColor=#000000;align=center;textOpacity=100;fillColor=none;fontSize=16;", 150, 200, createUserObject({ [COMPONENT_KEY]: 'RectFlowMeter', [CATEGORY]: 'CHART' }), '流量计(正方形)', true, "rect flow meter"), | |
| 35 | + this.createVertexTemplateEntry("shape=mxgraph.thingskit/rectFlowMeterComponent;verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;strokeColor=none;fontColor=#000000;align=center;textOpacity=100;fillColor=none;fontSize=16;", 200, 250, createUserObject({ [COMPONENT_KEY]: 'RectFlowMeter', [CATEGORY]: 'CHART' }), '流量计(正方形)', true, "rect flow meter"), | |
| 36 | 36 | // 温度计 |
| 37 | 37 | this.createVertexTemplateEntry("shape=mxgraph.thingskit/thermometerComponent;verticalLabelPosition=bottom;verticalAlign=top;html=1;shadow=0;strokeColor=none;fontColor=#000000;align=center;textOpacity=100;fillColor=none;fontSize=16;", 300, 400, createUserObject({ [COMPONENT_KEY]: 'Thermometer', [CATEGORY]: 'CHART' }), '温度计', true, "thermometer"), |
| 38 | 38 | ] | ... | ... |
| ... | ... | @@ -353,14 +353,14 @@ Format.prototype.immediateRefresh = function () { |
| 353 | 353 | var label2 = label.cloneNode(false); |
| 354 | 354 | var label3 = label2.cloneNode(false); |
| 355 | 355 | var label4 = label3.cloneNode(false); |
| 356 | - | |
| 357 | 356 | |
| 357 | + | |
| 358 | 358 | // Workaround for ignored background in IE |
| 359 | 359 | label2.style.backgroundColor = Format.inactiveTabBackgroundColor; |
| 360 | 360 | label3.style.backgroundColor = Format.inactiveTabBackgroundColor; |
| 361 | 361 | label4.style.backgroundColor = Format.inactiveTabBackgroundColor; |
| 362 | 362 | label4.style.borderStyle = 'none' |
| 363 | - | |
| 363 | + | |
| 364 | 364 | // TODO Thingskit 新增数据绑定面板 Data Source Bind |
| 365 | 365 | if (hasDataSourceBindPanel) { |
| 366 | 366 | mxUtils.write(label4, mxResources.get('dataSourcePanel')) |
| ... | ... | @@ -4259,7 +4259,6 @@ StyleFormatPanel.prototype.addFill = function (container) { |
| 4259 | 4259 | }); |
| 4260 | 4260 | |
| 4261 | 4261 | mxEvent.addListener(fillStyleSelect, 'change', function (evt) { |
| 4262 | - console.log('enter') | |
| 4263 | 4262 | graph.setCellStyles('fillStyle', fillStyleSelect.value, ss.cells); |
| 4264 | 4263 | ui.fireEvent(new mxEventObject('styleChanged', 'keys', ['fillStyle'], |
| 4265 | 4264 | 'values', [fillStyleSelect.value], 'cells', ss.cells)); | ... | ... |
| ... | ... | @@ -9,8 +9,7 @@ |
| 9 | 9 | /** |
| 10 | 10 | * Extends mxShape. |
| 11 | 11 | */ |
| 12 | -function mxShapeArrows2Arrow(bounds, fill, stroke, strokewidth) | |
| 13 | -{ | |
| 12 | +function mxShapeArrows2Arrow(bounds, fill, stroke, strokewidth) { | |
| 14 | 13 | mxShape.call(this); |
| 15 | 14 | this.bounds = bounds; |
| 16 | 15 | this.fill = fill; |
| ... | ... | @@ -27,15 +26,15 @@ function mxShapeArrows2Arrow(bounds, fill, stroke, strokewidth) |
| 27 | 26 | mxUtils.extend(mxShapeArrows2Arrow, mxActor); |
| 28 | 27 | |
| 29 | 28 | mxShapeArrows2Arrow.prototype.customProperties = [ |
| 30 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 40}, | |
| 31 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal: 0.6}, | |
| 32 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal: 0}, | |
| 33 | - {name: 'headCrossline', dispName: 'Head Crossline', type: 'bool', defVal: false}, | |
| 34 | - {name: 'tailCrossline', dispName: 'Tail Crossline', type: 'bool', defVal: false} | |
| 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 } | |
| 35 | 34 | ]; |
| 36 | 35 | |
| 37 | 36 | mxShapeArrows2Arrow.prototype.cst = { |
| 38 | - ARROW : 'mxgraph.arrows2.arrow' | |
| 37 | + ARROW: 'mxgraph.arrows2.arrow' | |
| 39 | 38 | }; |
| 40 | 39 | |
| 41 | 40 | /** |
| ... | ... | @@ -43,8 +42,7 @@ mxShapeArrows2Arrow.prototype.cst = { |
| 43 | 42 | * |
| 44 | 43 | * Paints the vertex shape. |
| 45 | 44 | */ |
| 46 | -mxShapeArrows2Arrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 47 | -{ | |
| 45 | +mxShapeArrows2Arrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 48 | 46 | c.translate(x, y); |
| 49 | 47 | |
| 50 | 48 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -64,19 +62,17 @@ mxShapeArrows2Arrow.prototype.paintVertexShape = function(c, x, y, w, h) |
| 64 | 62 | c.lineTo(notch, h * 0.5); |
| 65 | 63 | c.close(); |
| 66 | 64 | c.fillAndStroke(); |
| 67 | - | |
| 65 | + | |
| 68 | 66 | c.setShadow(false); |
| 69 | - | |
| 70 | - if (headCrossline) | |
| 71 | - { | |
| 67 | + | |
| 68 | + if (headCrossline) { | |
| 72 | 69 | c.begin(); |
| 73 | 70 | c.moveTo(w - dx, dy); |
| 74 | 71 | c.lineTo(w - dx, h - dy); |
| 75 | 72 | c.stroke(); |
| 76 | 73 | } |
| 77 | - | |
| 78 | - if (tailCrossline) | |
| 79 | - { | |
| 74 | + | |
| 75 | + if (tailCrossline) { | |
| 80 | 76 | c.begin(); |
| 81 | 77 | c.moveTo(notch, dy); |
| 82 | 78 | c.lineTo(notch, h - dy); |
| ... | ... | @@ -84,99 +80,83 @@ mxShapeArrows2Arrow.prototype.paintVertexShape = function(c, x, y, w, h) |
| 84 | 80 | } |
| 85 | 81 | }; |
| 86 | 82 | |
| 87 | -mxShapeArrows2Arrow.prototype.getLabelBounds = function(rect) | |
| 88 | -{ | |
| 89 | - if (mxUtils.getValue(this.style, 'boundedLbl', false)) | |
| 90 | - { | |
| 83 | +mxShapeArrows2Arrow.prototype.getLabelBounds = function (rect) { | |
| 84 | + if (mxUtils.getValue(this.style, 'boundedLbl', false)) { | |
| 91 | 85 | var w = rect.width; |
| 92 | 86 | var h = rect.height; |
| 93 | - | |
| 87 | + | |
| 94 | 88 | var dy, dx; |
| 95 | 89 | var direction = this.direction || mxConstants.DIRECTION_EAST; |
| 96 | - | |
| 97 | - if (mxUtils.getValue(this.style, 'flipH', false)) | |
| 98 | - { | |
| 90 | + | |
| 91 | + if (mxUtils.getValue(this.style, 'flipH', false)) { | |
| 99 | 92 | if (direction == mxConstants.DIRECTION_WEST) |
| 100 | 93 | direction = mxConstants.DIRECTION_EAST; |
| 101 | 94 | else if (direction == mxConstants.DIRECTION_EAST) |
| 102 | 95 | direction = mxConstants.DIRECTION_WEST; |
| 103 | 96 | } |
| 104 | - | |
| 105 | - if (mxUtils.getValue(this.style, 'flipV', false)) | |
| 106 | - { | |
| 97 | + | |
| 98 | + if (mxUtils.getValue(this.style, 'flipV', false)) { | |
| 107 | 99 | if (direction == mxConstants.DIRECTION_NORTH) |
| 108 | 100 | direction = mxConstants.DIRECTION_SOUTH; |
| 109 | 101 | else if (direction == mxConstants.DIRECTION_SOUTH) |
| 110 | 102 | direction = mxConstants.DIRECTION_NORTH; |
| 111 | 103 | } |
| 112 | - | |
| 104 | + | |
| 113 | 105 | if (direction == mxConstants.DIRECTION_NORTH |
| 114 | - || direction == mxConstants.DIRECTION_SOUTH) | |
| 115 | - { | |
| 106 | + || direction == mxConstants.DIRECTION_SOUTH) { | |
| 116 | 107 | dy = w * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 117 | 108 | dx = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 118 | 109 | } |
| 119 | - else | |
| 120 | - { | |
| 110 | + else { | |
| 121 | 111 | dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 122 | 112 | dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 123 | 113 | } |
| 124 | - | |
| 125 | - if (direction == mxConstants.DIRECTION_EAST) | |
| 126 | - { | |
| 114 | + | |
| 115 | + if (direction == mxConstants.DIRECTION_EAST) { | |
| 127 | 116 | return new mxRectangle(rect.x, rect.y + dy, w - dx, h - 2 * dy); |
| 128 | 117 | } |
| 129 | - else if (direction == mxConstants.DIRECTION_WEST) | |
| 130 | - { | |
| 118 | + else if (direction == mxConstants.DIRECTION_WEST) { | |
| 131 | 119 | return new mxRectangle(rect.x + dx, rect.y + dy, w - dx, h - 2 * dy); |
| 132 | 120 | } |
| 133 | - else if (direction == mxConstants.DIRECTION_NORTH) | |
| 134 | - { | |
| 121 | + else if (direction == mxConstants.DIRECTION_NORTH) { | |
| 135 | 122 | return new mxRectangle(rect.x + dy, rect.y + dx, w - 2 * dy, h - dx); |
| 136 | 123 | } |
| 137 | - else | |
| 138 | - { | |
| 124 | + else { | |
| 139 | 125 | return new mxRectangle(rect.x + dy, rect.y, w - 2 * dy, h - dx); |
| 140 | 126 | } |
| 141 | 127 | } |
| 142 | - | |
| 128 | + | |
| 143 | 129 | return rect; |
| 144 | 130 | }; |
| 145 | 131 | |
| 146 | 132 | mxCellRenderer.registerShape(mxShapeArrows2Arrow.prototype.cst.ARROW, mxShapeArrows2Arrow); |
| 147 | 133 | |
| 148 | -Graph.handleFactory[mxShapeArrows2Arrow.prototype.cst.ARROW] = function(state) | |
| 149 | -{ | |
| 150 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 151 | - { | |
| 152 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 153 | - var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 154 | - | |
| 155 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 156 | - }, function(bounds, pt) | |
| 157 | - { | |
| 158 | - 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; | |
| 159 | - this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 160 | - })]; | |
| 161 | - | |
| 162 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 163 | - { | |
| 164 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 165 | - | |
| 166 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 167 | - }, function(bounds, pt) | |
| 168 | - { | |
| 169 | - 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; | |
| 170 | - }); | |
| 171 | - | |
| 134 | +Graph.handleFactory[mxShapeArrows2Arrow.prototype.cst.ARROW] = function (state) { | |
| 135 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 136 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 137 | + var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 138 | + | |
| 139 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 140 | + }, function (bounds, pt) { | |
| 141 | + 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; | |
| 142 | + this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 143 | + })]; | |
| 144 | + | |
| 145 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 146 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 147 | + | |
| 148 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 149 | + }, function (bounds, pt) { | |
| 150 | + 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; | |
| 151 | + }); | |
| 152 | + | |
| 172 | 153 | handles.push(handle2); |
| 173 | - | |
| 154 | + | |
| 174 | 155 | return handles; |
| 175 | 156 | |
| 176 | 157 | } |
| 177 | 158 | |
| 178 | -mxShapeArrows2Arrow.prototype.getConstraints = function(style, w, h) | |
| 179 | -{ | |
| 159 | +mxShapeArrows2Arrow.prototype.getConstraints = function (style, w, h) { | |
| 180 | 160 | var constr = []; |
| 181 | 161 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 182 | 162 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -202,8 +182,7 @@ mxShapeArrows2Arrow.prototype.getConstraints = function(style, w, h) |
| 202 | 182 | /** |
| 203 | 183 | * Extends mxShape. |
| 204 | 184 | */ |
| 205 | -function mxShapeArrows2TwoWayArrow(bounds, fill, stroke, strokewidth) | |
| 206 | -{ | |
| 185 | +function mxShapeArrows2TwoWayArrow(bounds, fill, stroke, strokewidth) { | |
| 207 | 186 | mxShape.call(this); |
| 208 | 187 | this.bounds = bounds; |
| 209 | 188 | this.fill = fill; |
| ... | ... | @@ -219,12 +198,12 @@ function mxShapeArrows2TwoWayArrow(bounds, fill, stroke, strokewidth) |
| 219 | 198 | mxUtils.extend(mxShapeArrows2TwoWayArrow, mxActor); |
| 220 | 199 | |
| 221 | 200 | mxShapeArrows2TwoWayArrow.prototype.cst = { |
| 222 | - TWO_WAY_ARROW : 'mxgraph.arrows2.twoWayArrow' | |
| 201 | + TWO_WAY_ARROW: 'mxgraph.arrows2.twoWayArrow' | |
| 223 | 202 | }; |
| 224 | 203 | |
| 225 | 204 | mxShapeArrows2TwoWayArrow.prototype.customProperties = [ |
| 226 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal: 35}, | |
| 227 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal: 0.6} | |
| 205 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 35 }, | |
| 206 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, max: 1, defVal: 0.6 } | |
| 228 | 207 | ]; |
| 229 | 208 | |
| 230 | 209 | /** |
| ... | ... | @@ -232,8 +211,7 @@ mxShapeArrows2TwoWayArrow.prototype.customProperties = [ |
| 232 | 211 | * |
| 233 | 212 | * Paints the vertex shape. |
| 234 | 213 | */ |
| 235 | -mxShapeArrows2TwoWayArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 236 | -{ | |
| 214 | +mxShapeArrows2TwoWayArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 237 | 215 | c.translate(x, y); |
| 238 | 216 | |
| 239 | 217 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -254,38 +232,32 @@ mxShapeArrows2TwoWayArrow.prototype.paintVertexShape = function(c, x, y, w, h) |
| 254 | 232 | c.fillAndStroke(); |
| 255 | 233 | }; |
| 256 | 234 | |
| 257 | -mxShapeArrows2TwoWayArrow.prototype.getLabelBounds = function(rect) | |
| 258 | -{ | |
| 259 | - if (mxUtils.getValue(this.style, 'boundedLbl', false)) | |
| 260 | - { | |
| 235 | +mxShapeArrows2TwoWayArrow.prototype.getLabelBounds = function (rect) { | |
| 236 | + if (mxUtils.getValue(this.style, 'boundedLbl', false)) { | |
| 261 | 237 | var w = rect.width; |
| 262 | 238 | var h = rect.height; |
| 263 | 239 | var vertical = this.direction == mxConstants.DIRECTION_NORTH |
| 264 | - || this.direction == mxConstants.DIRECTION_SOUTH; | |
| 240 | + || this.direction == mxConstants.DIRECTION_SOUTH; | |
| 265 | 241 | |
| 266 | 242 | var dy, dx; |
| 267 | - | |
| 268 | - if (vertical) | |
| 269 | - { | |
| 243 | + | |
| 244 | + if (vertical) { | |
| 270 | 245 | dy = w * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 271 | 246 | dx = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 272 | 247 | } |
| 273 | - else | |
| 274 | - { | |
| 248 | + else { | |
| 275 | 249 | dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 276 | 250 | dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 277 | 251 | } |
| 278 | - | |
| 279 | - if (vertical) | |
| 280 | - { | |
| 252 | + | |
| 253 | + if (vertical) { | |
| 281 | 254 | return new mxRectangle(rect.x + dy, rect.y + dx, w - 2 * dy, h - 2 * dx); |
| 282 | 255 | } |
| 283 | - else | |
| 284 | - { | |
| 256 | + else { | |
| 285 | 257 | return new mxRectangle(rect.x + dx, rect.y + dy, w - 2 * dx, h - 2 * dy); |
| 286 | 258 | } |
| 287 | 259 | } |
| 288 | - | |
| 260 | + | |
| 289 | 261 | return rect; |
| 290 | 262 | }; |
| 291 | 263 | |
| ... | ... | @@ -293,26 +265,22 @@ mxCellRenderer.registerShape(mxShapeArrows2TwoWayArrow.prototype.cst.TWO_WAY_ARR |
| 293 | 265 | |
| 294 | 266 | mxShapeArrows2TwoWayArrow.prototype.constraints = null; |
| 295 | 267 | |
| 296 | -Graph.handleFactory[mxShapeArrows2TwoWayArrow.prototype.cst.TWO_WAY_ARROW] = function(state) | |
| 297 | -{ | |
| 298 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 299 | - { | |
| 300 | - var dx = Math.max(0, Math.min(bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 301 | - var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 302 | - | |
| 303 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 304 | - }, function(bounds, pt) | |
| 305 | - { | |
| 306 | - this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width / 2, bounds.x + bounds.width - pt.x))) / 100; | |
| 307 | - this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 308 | - })]; | |
| 309 | - | |
| 268 | +Graph.handleFactory[mxShapeArrows2TwoWayArrow.prototype.cst.TWO_WAY_ARROW] = function (state) { | |
| 269 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 270 | + var dx = Math.max(0, Math.min(bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 271 | + var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 272 | + | |
| 273 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 274 | + }, function (bounds, pt) { | |
| 275 | + this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width / 2, bounds.x + bounds.width - pt.x))) / 100; | |
| 276 | + this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 277 | + })]; | |
| 278 | + | |
| 310 | 279 | return handles; |
| 311 | 280 | |
| 312 | 281 | } |
| 313 | 282 | |
| 314 | -mxShapeArrows2TwoWayArrow.prototype.getConstraints = function(style, w, h) | |
| 315 | -{ | |
| 283 | +mxShapeArrows2TwoWayArrow.prototype.getConstraints = function (style, w, h) { | |
| 316 | 284 | var constr = []; |
| 317 | 285 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 318 | 286 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -339,8 +307,7 @@ mxShapeArrows2TwoWayArrow.prototype.getConstraints = function(style, w, h) |
| 339 | 307 | /** |
| 340 | 308 | * Extends mxShape. |
| 341 | 309 | */ |
| 342 | -function mxShapeArrows2StylisedArrow(bounds, fill, stroke, strokewidth) | |
| 343 | -{ | |
| 310 | +function mxShapeArrows2StylisedArrow(bounds, fill, stroke, strokewidth) { | |
| 344 | 311 | mxShape.call(this); |
| 345 | 312 | this.bounds = bounds; |
| 346 | 313 | this.fill = fill; |
| ... | ... | @@ -358,14 +325,14 @@ function mxShapeArrows2StylisedArrow(bounds, fill, stroke, strokewidth) |
| 358 | 325 | mxUtils.extend(mxShapeArrows2StylisedArrow, mxActor); |
| 359 | 326 | |
| 360 | 327 | mxShapeArrows2StylisedArrow.prototype.customProperties = [ |
| 361 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:40}, | |
| 362 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal:0.6}, | |
| 363 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:0}, | |
| 364 | - {name: 'feather', dispName: 'Feather', type: 'float', min:0, max:1, defVal:0.4}, | |
| 328 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 40 }, | |
| 329 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, max: 1, defVal: 0.6 }, | |
| 330 | + { name: 'notch', dispName: 'Notch', type: 'float', min: 0, defVal: 0 }, | |
| 331 | + { name: 'feather', dispName: 'Feather', type: 'float', min: 0, max: 1, defVal: 0.4 }, | |
| 365 | 332 | ]; |
| 366 | 333 | |
| 367 | 334 | mxShapeArrows2StylisedArrow.prototype.cst = { |
| 368 | - STYLISED_ARROW : 'mxgraph.arrows2.stylisedArrow' | |
| 335 | + STYLISED_ARROW: 'mxgraph.arrows2.stylisedArrow' | |
| 369 | 336 | }; |
| 370 | 337 | |
| 371 | 338 | /** |
| ... | ... | @@ -373,8 +340,7 @@ mxShapeArrows2StylisedArrow.prototype.cst = { |
| 373 | 340 | * |
| 374 | 341 | * Paints the vertex shape. |
| 375 | 342 | */ |
| 376 | -mxShapeArrows2StylisedArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 377 | -{ | |
| 343 | +mxShapeArrows2StylisedArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 378 | 344 | c.translate(x, y); |
| 379 | 345 | |
| 380 | 346 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -399,50 +365,42 @@ mxCellRenderer.registerShape(mxShapeArrows2StylisedArrow.prototype.cst.STYLISED_ |
| 399 | 365 | |
| 400 | 366 | mxShapeArrows2StylisedArrow.prototype.constraints = null; |
| 401 | 367 | |
| 402 | -Graph.handleFactory[mxShapeArrows2StylisedArrow.prototype.cst.STYLISED_ARROW] = function(state) | |
| 403 | -{ | |
| 404 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 405 | - { | |
| 406 | - var dx = Math.max(0, Math.min(bounds.width - 10, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 407 | - var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 408 | - | |
| 409 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 410 | - }, function(bounds, pt) | |
| 411 | - { | |
| 412 | - 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; | |
| 413 | - this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 414 | - })]; | |
| 415 | - | |
| 416 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 417 | - { | |
| 418 | - 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)))); | |
| 419 | - | |
| 420 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 421 | - }, function(bounds, pt) | |
| 422 | - { | |
| 423 | - 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; | |
| 424 | - }); | |
| 425 | - | |
| 368 | +Graph.handleFactory[mxShapeArrows2StylisedArrow.prototype.cst.STYLISED_ARROW] = function (state) { | |
| 369 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 370 | + var dx = Math.max(0, Math.min(bounds.width - 10, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 371 | + var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 372 | + | |
| 373 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 374 | + }, function (bounds, pt) { | |
| 375 | + 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; | |
| 376 | + this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 377 | + })]; | |
| 378 | + | |
| 379 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 380 | + 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)))); | |
| 381 | + | |
| 382 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 383 | + }, function (bounds, pt) { | |
| 384 | + 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; | |
| 385 | + }); | |
| 386 | + | |
| 426 | 387 | handles.push(handle2); |
| 427 | - | |
| 428 | - var handle3 = Graph.createHandle(state, ['feather'], function(bounds) | |
| 429 | - { | |
| 430 | - var feather = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'feather', this.dy)))); | |
| 431 | - | |
| 432 | - return new mxPoint(bounds.x, bounds.y + feather * bounds.height / 2); | |
| 433 | - }, function(bounds, pt) | |
| 434 | - { | |
| 435 | - this.state.style['feather'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 436 | - }); | |
| 437 | - | |
| 388 | + | |
| 389 | + var handle3 = Graph.createHandle(state, ['feather'], function (bounds) { | |
| 390 | + var feather = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'feather', this.dy)))); | |
| 391 | + | |
| 392 | + return new mxPoint(bounds.x, bounds.y + feather * bounds.height / 2); | |
| 393 | + }, function (bounds, pt) { | |
| 394 | + this.state.style['feather'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 395 | + }); | |
| 396 | + | |
| 438 | 397 | handles.push(handle3); |
| 439 | - | |
| 398 | + | |
| 440 | 399 | return handles; |
| 441 | 400 | |
| 442 | 401 | } |
| 443 | 402 | |
| 444 | -mxShapeArrows2StylisedArrow.prototype.getConstraints = function(style, w, h) | |
| 445 | -{ | |
| 403 | +mxShapeArrows2StylisedArrow.prototype.getConstraints = function (style, w, h) { | |
| 446 | 404 | var constr = []; |
| 447 | 405 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 448 | 406 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -469,8 +427,7 @@ mxShapeArrows2StylisedArrow.prototype.getConstraints = function(style, w, h) |
| 469 | 427 | /** |
| 470 | 428 | * Extends mxShape. |
| 471 | 429 | */ |
| 472 | -function mxShapeArrows2SharpArrow(bounds, fill, stroke, strokewidth) | |
| 473 | -{ | |
| 430 | +function mxShapeArrows2SharpArrow(bounds, fill, stroke, strokewidth) { | |
| 474 | 431 | mxShape.call(this); |
| 475 | 432 | this.bounds = bounds; |
| 476 | 433 | this.fill = fill; |
| ... | ... | @@ -488,14 +445,14 @@ function mxShapeArrows2SharpArrow(bounds, fill, stroke, strokewidth) |
| 488 | 445 | mxUtils.extend(mxShapeArrows2SharpArrow, mxActor); |
| 489 | 446 | |
| 490 | 447 | mxShapeArrows2SharpArrow.prototype.cst = { |
| 491 | - SHARP_ARROW : 'mxgraph.arrows2.sharpArrow' | |
| 448 | + SHARP_ARROW: 'mxgraph.arrows2.sharpArrow' | |
| 492 | 449 | }; |
| 493 | 450 | |
| 494 | 451 | mxShapeArrows2SharpArrow.prototype.customProperties = [ |
| 495 | - {name: 'dx1', dispName: 'Arrowhead Arrow Width', type: 'float', min:0, defVal:18}, | |
| 496 | - {name: 'dy1', dispName: 'Arrow Arrow Width', type: 'float', min:0, max:1, defVal:0.67}, | |
| 497 | - {name: 'dx2', dispName: 'Arrowhead Angle', type: 'float', min:0, defVal:18}, | |
| 498 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:0} | |
| 452 | + { name: 'dx1', dispName: 'Arrowhead Arrow Width', type: 'float', min: 0, defVal: 18 }, | |
| 453 | + { name: 'dy1', dispName: 'Arrow Arrow Width', type: 'float', min: 0, max: 1, defVal: 0.67 }, | |
| 454 | + { name: 'dx2', dispName: 'Arrowhead Angle', type: 'float', min: 0, defVal: 18 }, | |
| 455 | + { name: 'notch', dispName: 'Notch', type: 'float', min: 0, defVal: 0 } | |
| 499 | 456 | ]; |
| 500 | 457 | |
| 501 | 458 | /** |
| ... | ... | @@ -503,8 +460,7 @@ mxShapeArrows2SharpArrow.prototype.customProperties = [ |
| 503 | 460 | * |
| 504 | 461 | * Paints the vertex shape. |
| 505 | 462 | */ |
| 506 | -mxShapeArrows2SharpArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 507 | -{ | |
| 463 | +mxShapeArrows2SharpArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 508 | 464 | c.translate(x, y); |
| 509 | 465 | |
| 510 | 466 | var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| ... | ... | @@ -514,12 +470,11 @@ mxShapeArrows2SharpArrow.prototype.paintVertexShape = function(c, x, y, w, h) |
| 514 | 470 | var dx1a = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| 515 | 471 | var dy1a = h * 0.5 * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 516 | 472 | var x2 = 0; |
| 517 | - | |
| 518 | - if (h != 0) | |
| 519 | - { | |
| 473 | + | |
| 474 | + if (h != 0) { | |
| 520 | 475 | x2 = dx1a + dx2 * dy1a * 2 / h; |
| 521 | 476 | } |
| 522 | - | |
| 477 | + | |
| 523 | 478 | c.begin(); |
| 524 | 479 | c.moveTo(0, dy1); |
| 525 | 480 | c.lineTo(w - dx1, dy1); |
| ... | ... | @@ -539,49 +494,41 @@ mxCellRenderer.registerShape(mxShapeArrows2SharpArrow.prototype.cst.SHARP_ARROW, |
| 539 | 494 | |
| 540 | 495 | mxShapeArrows2SharpArrow.prototype.constraints = null; |
| 541 | 496 | |
| 542 | -Graph.handleFactory[mxShapeArrows2SharpArrow.prototype.cst.SHARP_ARROW] = function(state) | |
| 543 | -{ | |
| 544 | - var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds) | |
| 545 | - { | |
| 546 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 547 | - var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 548 | - | |
| 549 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + dy1 * bounds.height / 2); | |
| 550 | - }, function(bounds, pt) | |
| 551 | - { | |
| 552 | - 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; | |
| 553 | - this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 554 | - })]; | |
| 555 | - | |
| 556 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 557 | - { | |
| 558 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 559 | - | |
| 560 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 561 | - }, function(bounds, pt) | |
| 562 | - { | |
| 563 | - 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; | |
| 564 | - }); | |
| 565 | - | |
| 497 | +Graph.handleFactory[mxShapeArrows2SharpArrow.prototype.cst.SHARP_ARROW] = function (state) { | |
| 498 | + var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function (bounds) { | |
| 499 | + var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 500 | + var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 501 | + | |
| 502 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + dy1 * bounds.height / 2); | |
| 503 | + }, function (bounds, pt) { | |
| 504 | + 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; | |
| 505 | + this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 506 | + })]; | |
| 507 | + | |
| 508 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 509 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 510 | + | |
| 511 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 512 | + }, function (bounds, pt) { | |
| 513 | + 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; | |
| 514 | + }); | |
| 515 | + | |
| 566 | 516 | handles.push(handle2); |
| 567 | - | |
| 568 | - var handle3 = Graph.createHandle(state, ['dx2'], function(bounds) | |
| 569 | - { | |
| 570 | - var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 571 | - | |
| 572 | - return new mxPoint(bounds.x + bounds.width - dx2, bounds.y); | |
| 573 | - }, function(bounds, pt) | |
| 574 | - { | |
| 575 | - 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; | |
| 576 | - }); | |
| 577 | - | |
| 517 | + | |
| 518 | + var handle3 = Graph.createHandle(state, ['dx2'], function (bounds) { | |
| 519 | + var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 520 | + | |
| 521 | + return new mxPoint(bounds.x + bounds.width - dx2, bounds.y); | |
| 522 | + }, function (bounds, pt) { | |
| 523 | + 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; | |
| 524 | + }); | |
| 525 | + | |
| 578 | 526 | handles.push(handle3); |
| 579 | - | |
| 527 | + | |
| 580 | 528 | return handles; |
| 581 | 529 | }; |
| 582 | 530 | |
| 583 | -mxShapeArrows2SharpArrow.prototype.getConstraints = function(style, w, h) | |
| 584 | -{ | |
| 531 | +mxShapeArrows2SharpArrow.prototype.getConstraints = function (style, w, h) { | |
| 585 | 532 | var constr = []; |
| 586 | 533 | var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 587 | 534 | var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| ... | ... | @@ -590,12 +537,11 @@ mxShapeArrows2SharpArrow.prototype.getConstraints = function(style, w, h) |
| 590 | 537 | var dx1a = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| 591 | 538 | var dy1a = h * 0.5 * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 592 | 539 | var x2 = 0; |
| 593 | - | |
| 594 | - if (h != 0) | |
| 595 | - { | |
| 540 | + | |
| 541 | + if (h != 0) { | |
| 596 | 542 | x2 = dx1a + dx2 * dy1a * 2 / h; |
| 597 | 543 | } |
| 598 | - | |
| 544 | + | |
| 599 | 545 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false)); |
| 600 | 546 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, notch, 0)); |
| 601 | 547 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy1)); |
| ... | ... | @@ -618,8 +564,7 @@ mxShapeArrows2SharpArrow.prototype.getConstraints = function(style, w, h) |
| 618 | 564 | /** |
| 619 | 565 | * Extends mxShape. |
| 620 | 566 | */ |
| 621 | -function mxShapeArrows2SharpArrow2(bounds, fill, stroke, strokewidth) | |
| 622 | -{ | |
| 567 | +function mxShapeArrows2SharpArrow2(bounds, fill, stroke, strokewidth) { | |
| 623 | 568 | mxShape.call(this); |
| 624 | 569 | this.bounds = bounds; |
| 625 | 570 | this.fill = fill; |
| ... | ... | @@ -640,16 +585,16 @@ function mxShapeArrows2SharpArrow2(bounds, fill, stroke, strokewidth) |
| 640 | 585 | mxUtils.extend(mxShapeArrows2SharpArrow2, mxActor); |
| 641 | 586 | |
| 642 | 587 | mxShapeArrows2SharpArrow2.prototype.customProperties = [ |
| 643 | - {name: 'dx1', dispName: 'Arrowhead Arrow Width', type: 'float', min:0, defVal:18}, | |
| 644 | - {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal:0.67}, | |
| 645 | - {name: 'dx2', dispName: 'Arrowhead Angle', type: 'float', min:0, defVal:18}, | |
| 646 | - {name: 'dx3', dispName: 'Arrowhead Edge X', type: 'float', min:0, defVal:27}, | |
| 647 | - {name: 'dy3', dispName: 'Arrowhead Edge Y', type: 'float', min:0, max:1, defVal:0.15}, | |
| 648 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:0} | |
| 588 | + { name: 'dx1', dispName: 'Arrowhead Arrow Width', type: 'float', min: 0, defVal: 18 }, | |
| 589 | + { name: 'dy1', dispName: 'Arrow Width', type: 'float', min: 0, max: 1, defVal: 0.67 }, | |
| 590 | + { name: 'dx2', dispName: 'Arrowhead Angle', type: 'float', min: 0, defVal: 18 }, | |
| 591 | + { name: 'dx3', dispName: 'Arrowhead Edge X', type: 'float', min: 0, defVal: 27 }, | |
| 592 | + { name: 'dy3', dispName: 'Arrowhead Edge Y', type: 'float', min: 0, max: 1, defVal: 0.15 }, | |
| 593 | + { name: 'notch', dispName: 'Notch', type: 'float', min: 0, defVal: 0 } | |
| 649 | 594 | ]; |
| 650 | 595 | |
| 651 | 596 | mxShapeArrows2SharpArrow2.prototype.cst = { |
| 652 | - SHARP_ARROW2 : 'mxgraph.arrows2.sharpArrow2' | |
| 597 | + SHARP_ARROW2: 'mxgraph.arrows2.sharpArrow2' | |
| 653 | 598 | }; |
| 654 | 599 | |
| 655 | 600 | /** |
| ... | ... | @@ -657,8 +602,7 @@ mxShapeArrows2SharpArrow2.prototype.cst = { |
| 657 | 602 | * |
| 658 | 603 | * Paints the vertex shape. |
| 659 | 604 | */ |
| 660 | -mxShapeArrows2SharpArrow2.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 661 | -{ | |
| 605 | +mxShapeArrows2SharpArrow2.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 662 | 606 | c.translate(x, y); |
| 663 | 607 | |
| 664 | 608 | var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| ... | ... | @@ -689,63 +633,53 @@ mxCellRenderer.registerShape(mxShapeArrows2SharpArrow2.prototype.cst.SHARP_ARROW |
| 689 | 633 | |
| 690 | 634 | mxShapeArrows2SharpArrow2.prototype.constraints = null; |
| 691 | 635 | |
| 692 | -Graph.handleFactory[mxShapeArrows2SharpArrow2.prototype.cst.SHARP_ARROW2] = function(state) | |
| 693 | -{ | |
| 694 | - var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds) | |
| 695 | - { | |
| 696 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 697 | - var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 698 | - | |
| 699 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + dy1 * bounds.height / 2); | |
| 700 | - }, function(bounds, pt) | |
| 701 | - { | |
| 702 | - 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; | |
| 703 | - this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 704 | - })]; | |
| 705 | - | |
| 706 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 707 | - { | |
| 708 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 709 | - | |
| 710 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 711 | - }, function(bounds, pt) | |
| 712 | - { | |
| 713 | - 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; | |
| 714 | - }); | |
| 715 | - | |
| 636 | +Graph.handleFactory[mxShapeArrows2SharpArrow2.prototype.cst.SHARP_ARROW2] = function (state) { | |
| 637 | + var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function (bounds) { | |
| 638 | + var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 639 | + var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 640 | + | |
| 641 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + dy1 * bounds.height / 2); | |
| 642 | + }, function (bounds, pt) { | |
| 643 | + 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; | |
| 644 | + this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 645 | + })]; | |
| 646 | + | |
| 647 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 648 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 649 | + | |
| 650 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 651 | + }, function (bounds, pt) { | |
| 652 | + 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; | |
| 653 | + }); | |
| 654 | + | |
| 716 | 655 | handles.push(handle2); |
| 717 | - | |
| 718 | - var handle3 = Graph.createHandle(state, ['dx2'], function(bounds) | |
| 719 | - { | |
| 720 | - var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 721 | - | |
| 722 | - return new mxPoint(bounds.x + bounds.width - dx2, bounds.y); | |
| 723 | - }, function(bounds, pt) | |
| 724 | - { | |
| 725 | - 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; | |
| 726 | - }); | |
| 727 | - | |
| 656 | + | |
| 657 | + var handle3 = Graph.createHandle(state, ['dx2'], function (bounds) { | |
| 658 | + var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 659 | + | |
| 660 | + return new mxPoint(bounds.x + bounds.width - dx2, bounds.y); | |
| 661 | + }, function (bounds, pt) { | |
| 662 | + 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; | |
| 663 | + }); | |
| 664 | + | |
| 728 | 665 | handles.push(handle3); |
| 729 | 666 | |
| 730 | - var handle4 = Graph.createHandle(state, ['dx3', 'dy3'], function(bounds) | |
| 731 | - { | |
| 732 | - var dx3 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx3', this.dx3)))); | |
| 733 | - 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)))); | |
| 667 | + var handle4 = Graph.createHandle(state, ['dx3', 'dy3'], function (bounds) { | |
| 668 | + var dx3 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx3', this.dx3)))); | |
| 669 | + 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)))); | |
| 734 | 670 | |
| 735 | - return new mxPoint(bounds.x + bounds.width - dx3, bounds.y + dy3 * bounds.height / 2); | |
| 736 | - }, function(bounds, pt) | |
| 737 | - { | |
| 738 | - 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; | |
| 739 | - 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; | |
| 740 | - }); | |
| 671 | + return new mxPoint(bounds.x + bounds.width - dx3, bounds.y + dy3 * bounds.height / 2); | |
| 672 | + }, function (bounds, pt) { | |
| 673 | + 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; | |
| 674 | + 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; | |
| 675 | + }); | |
| 741 | 676 | |
| 742 | 677 | handles.push(handle4); |
| 743 | 678 | |
| 744 | 679 | return handles; |
| 745 | 680 | }; |
| 746 | 681 | |
| 747 | -mxShapeArrows2SharpArrow2.prototype.getConstraints = function(style, w, h) | |
| 748 | -{ | |
| 682 | +mxShapeArrows2SharpArrow2.prototype.getConstraints = function (style, w, h) { | |
| 749 | 683 | var constr = []; |
| 750 | 684 | var dy1 = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 751 | 685 | var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| ... | ... | @@ -778,8 +712,7 @@ mxShapeArrows2SharpArrow2.prototype.getConstraints = function(style, w, h) |
| 778 | 712 | /** |
| 779 | 713 | * Extends mxShape. |
| 780 | 714 | */ |
| 781 | -function mxShapeArrows2CalloutArrow(bounds, fill, stroke, strokewidth) | |
| 782 | -{ | |
| 715 | +function mxShapeArrows2CalloutArrow(bounds, fill, stroke, strokewidth) { | |
| 783 | 716 | mxShape.call(this); |
| 784 | 717 | this.bounds = bounds; |
| 785 | 718 | this.fill = fill; |
| ... | ... | @@ -797,14 +730,14 @@ function mxShapeArrows2CalloutArrow(bounds, fill, stroke, strokewidth) |
| 797 | 730 | mxUtils.extend(mxShapeArrows2CalloutArrow, mxActor); |
| 798 | 731 | |
| 799 | 732 | mxShapeArrows2CalloutArrow.prototype.customProperties = [ |
| 800 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20}, | |
| 801 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10}, | |
| 802 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10}, | |
| 803 | - {name: 'notch', dispName: 'Rectangle Width', type: 'float', min:0, defVal:60} | |
| 733 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 734 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 10 }, | |
| 735 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 736 | + { name: 'notch', dispName: 'Rectangle Width', type: 'float', min: 0, defVal: 60 } | |
| 804 | 737 | ]; |
| 805 | 738 | |
| 806 | 739 | mxShapeArrows2CalloutArrow.prototype.cst = { |
| 807 | - CALLOUT_ARROW : 'mxgraph.arrows2.calloutArrow' | |
| 740 | + CALLOUT_ARROW: 'mxgraph.arrows2.calloutArrow' | |
| 808 | 741 | }; |
| 809 | 742 | |
| 810 | 743 | /** |
| ... | ... | @@ -812,8 +745,7 @@ mxShapeArrows2CalloutArrow.prototype.cst = { |
| 812 | 745 | * |
| 813 | 746 | * Paints the vertex shape. |
| 814 | 747 | */ |
| 815 | -mxShapeArrows2CalloutArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 816 | -{ | |
| 748 | +mxShapeArrows2CalloutArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 817 | 749 | c.translate(x, y); |
| 818 | 750 | |
| 819 | 751 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -841,53 +773,45 @@ mxCellRenderer.registerShape(mxShapeArrows2CalloutArrow.prototype.cst.CALLOUT_AR |
| 841 | 773 | |
| 842 | 774 | mxShapeArrows2CalloutArrow.prototype.constraints = null; |
| 843 | 775 | |
| 844 | -Graph.handleFactory[mxShapeArrows2CalloutArrow.prototype.cst.CALLOUT_ARROW] = function(state) | |
| 845 | -{ | |
| 846 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 847 | - { | |
| 848 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 849 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 850 | - var dy = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 851 | - | |
| 852 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 853 | - }, function(bounds, pt) | |
| 854 | - { | |
| 855 | - 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; | |
| 856 | - 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; | |
| 857 | - | |
| 858 | - })]; | |
| 859 | - | |
| 860 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 861 | - { | |
| 862 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 863 | - | |
| 864 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 865 | - }, function(bounds, pt) | |
| 866 | - { | |
| 867 | - 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; | |
| 868 | - }); | |
| 776 | +Graph.handleFactory[mxShapeArrows2CalloutArrow.prototype.cst.CALLOUT_ARROW] = function (state) { | |
| 777 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 778 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 779 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 780 | + var dy = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 781 | + | |
| 782 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 783 | + }, function (bounds, pt) { | |
| 784 | + 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; | |
| 785 | + 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; | |
| 786 | + | |
| 787 | + })]; | |
| 788 | + | |
| 789 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 790 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 791 | + | |
| 792 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 793 | + }, function (bounds, pt) { | |
| 794 | + 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; | |
| 795 | + }); | |
| 869 | 796 | |
| 870 | 797 | handles.push(handle2); |
| 871 | - | |
| 872 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 873 | - { | |
| 874 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 875 | - var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 876 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 877 | - | |
| 878 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 879 | - }, function(bounds, pt) | |
| 880 | - { | |
| 881 | - 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; | |
| 882 | - }); | |
| 798 | + | |
| 799 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 800 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 801 | + var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 802 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 803 | + | |
| 804 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 805 | + }, function (bounds, pt) { | |
| 806 | + 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; | |
| 807 | + }); | |
| 883 | 808 | |
| 884 | 809 | handles.push(handle3); |
| 885 | - | |
| 810 | + | |
| 886 | 811 | return handles; |
| 887 | 812 | }; |
| 888 | 813 | |
| 889 | -mxShapeArrows2CalloutArrow.prototype.getConstraints = function(style, w, h) | |
| 890 | -{ | |
| 814 | +mxShapeArrows2CalloutArrow.prototype.getConstraints = function (style, w, h) { | |
| 891 | 815 | var constr = []; |
| 892 | 816 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 893 | 817 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -896,7 +820,7 @@ mxShapeArrows2CalloutArrow.prototype.getConstraints = function(style, w, h) |
| 896 | 820 | |
| 897 | 821 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false)); |
| 898 | 822 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, 0)); |
| 899 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null,notch, h * 0.5 - dy)); | |
| 823 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, h * 0.5 - dy)); | |
| 900 | 824 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy)); |
| 901 | 825 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h * 0.5 - dy - arrowHead)); |
| 902 | 826 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, h * 0.5)); |
| ... | ... | @@ -905,8 +829,8 @@ mxShapeArrows2CalloutArrow.prototype.getConstraints = function(style, w, h) |
| 905 | 829 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, h * 0.5 + dy)); |
| 906 | 830 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch, h)); |
| 907 | 831 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h)); |
| 908 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch * 0.5 , 0)); | |
| 909 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch * 0.5 , h)); | |
| 832 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch * 0.5, 0)); | |
| 833 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, notch * 0.5, h)); | |
| 910 | 834 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, (notch + w - dx) * 0.5, -dy)); |
| 911 | 835 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, (notch + w - dx) * 0.5, dy)); |
| 912 | 836 | |
| ... | ... | @@ -919,8 +843,7 @@ mxShapeArrows2CalloutArrow.prototype.getConstraints = function(style, w, h) |
| 919 | 843 | /** |
| 920 | 844 | * Extends mxShape. |
| 921 | 845 | */ |
| 922 | -function mxShapeArrows2BendArrow(bounds, fill, stroke, strokewidth) | |
| 923 | -{ | |
| 846 | +function mxShapeArrows2BendArrow(bounds, fill, stroke, strokewidth) { | |
| 924 | 847 | mxShape.call(this); |
| 925 | 848 | this.bounds = bounds; |
| 926 | 849 | this.fill = fill; |
| ... | ... | @@ -938,15 +861,15 @@ function mxShapeArrows2BendArrow(bounds, fill, stroke, strokewidth) |
| 938 | 861 | mxUtils.extend(mxShapeArrows2BendArrow, mxActor); |
| 939 | 862 | |
| 940 | 863 | mxShapeArrows2BendArrow.prototype.customProperties = [ |
| 941 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal: 38}, | |
| 942 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal: 15}, | |
| 943 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal: 0}, | |
| 944 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:55}, | |
| 945 | - {name: 'rounded', dispName: 'Rounded', type: 'boolean', defVal: false} | |
| 864 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 38 }, | |
| 865 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 15 }, | |
| 866 | + { name: 'notch', dispName: 'Notch', type: 'float', min: 0, defVal: 0 }, | |
| 867 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 55 }, | |
| 868 | + { name: 'rounded', dispName: 'Rounded', type: 'boolean', defVal: false } | |
| 946 | 869 | ]; |
| 947 | 870 | |
| 948 | 871 | mxShapeArrows2BendArrow.prototype.cst = { |
| 949 | - BEND_ARROW : 'mxgraph.arrows2.bendArrow' | |
| 872 | + BEND_ARROW: 'mxgraph.arrows2.bendArrow' | |
| 950 | 873 | }; |
| 951 | 874 | |
| 952 | 875 | /** |
| ... | ... | @@ -954,8 +877,7 @@ mxShapeArrows2BendArrow.prototype.cst = { |
| 954 | 877 | * |
| 955 | 878 | * Paints the vertex shape. |
| 956 | 879 | */ |
| 957 | -mxShapeArrows2BendArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 958 | -{ | |
| 880 | +mxShapeArrows2BendArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 959 | 881 | c.translate(x, y); |
| 960 | 882 | |
| 961 | 883 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -969,28 +891,24 @@ mxShapeArrows2BendArrow.prototype.paintVertexShape = function(c, x, y, w, h) |
| 969 | 891 | c.lineTo(w, arrowHead * 0.5); |
| 970 | 892 | c.lineTo(w - dx, arrowHead); |
| 971 | 893 | c.lineTo(w - dx, arrowHead / 2 + dy); |
| 972 | - | |
| 973 | - if (rounded == '1') | |
| 974 | - { | |
| 894 | + | |
| 895 | + if (rounded == '1') { | |
| 975 | 896 | c.lineTo(dy * 2.2, arrowHead / 2 + dy); |
| 976 | 897 | c.arcTo(dy * 0.2, dy * 0.2, 0, 0, 0, dy * 2, arrowHead / 2 + dy * 1.2); |
| 977 | 898 | } |
| 978 | - else | |
| 979 | - { | |
| 899 | + else { | |
| 980 | 900 | c.lineTo(dy * 2, arrowHead / 2 + dy); |
| 981 | 901 | } |
| 982 | - | |
| 902 | + | |
| 983 | 903 | c.lineTo(dy * 2, h); |
| 984 | 904 | c.lineTo(dy, h - notch); |
| 985 | 905 | c.lineTo(0, h); |
| 986 | - | |
| 987 | - if (rounded == '1') | |
| 988 | - { | |
| 906 | + | |
| 907 | + if (rounded == '1') { | |
| 989 | 908 | c.lineTo(0, arrowHead / 2 + dy); |
| 990 | 909 | c.arcTo(dy * 2, dy * 2, 0, 0, 1, dy * 2, arrowHead / 2 - dy); |
| 991 | 910 | } |
| 992 | - else | |
| 993 | - { | |
| 911 | + else { | |
| 994 | 912 | c.lineTo(0, arrowHead / 2 - dy); |
| 995 | 913 | } |
| 996 | 914 | |
| ... | ... | @@ -1003,55 +921,47 @@ mxCellRenderer.registerShape(mxShapeArrows2BendArrow.prototype.cst.BEND_ARROW, m |
| 1003 | 921 | |
| 1004 | 922 | mxShapeArrows2BendArrow.prototype.constraints = null; |
| 1005 | 923 | |
| 1006 | -Graph.handleFactory[mxShapeArrows2BendArrow.prototype.cst.BEND_ARROW] = function(state) | |
| 1007 | -{ | |
| 1008 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 1009 | - { | |
| 1010 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1011 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1012 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1013 | - | |
| 1014 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy); | |
| 1015 | - }, function(bounds, pt) | |
| 1016 | - { | |
| 1017 | - 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; | |
| 1018 | - 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; | |
| 1019 | - | |
| 1020 | - })]; | |
| 1021 | - | |
| 1022 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 1023 | - { | |
| 1024 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1025 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1026 | - | |
| 1027 | - var notch = Math.max(0, Math.min(bounds.height - arrowHead / 2 - dy, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 1028 | - | |
| 1029 | - return new mxPoint(bounds.x + dy, bounds.y + bounds.height - notch); | |
| 1030 | - }, function(bounds, pt) | |
| 1031 | - { | |
| 1032 | - 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; | |
| 1033 | - }); | |
| 1034 | - | |
| 924 | +Graph.handleFactory[mxShapeArrows2BendArrow.prototype.cst.BEND_ARROW] = function (state) { | |
| 925 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 926 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 927 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 928 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 929 | + | |
| 930 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy); | |
| 931 | + }, function (bounds, pt) { | |
| 932 | + 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; | |
| 933 | + 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; | |
| 934 | + | |
| 935 | + })]; | |
| 936 | + | |
| 937 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 938 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 939 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 940 | + | |
| 941 | + var notch = Math.max(0, Math.min(bounds.height - arrowHead / 2 - dy, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 942 | + | |
| 943 | + return new mxPoint(bounds.x + dy, bounds.y + bounds.height - notch); | |
| 944 | + }, function (bounds, pt) { | |
| 945 | + 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; | |
| 946 | + }); | |
| 947 | + | |
| 1035 | 948 | handles.push(handle2); |
| 1036 | 949 | |
| 1037 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1038 | - { | |
| 1039 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1040 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1041 | - | |
| 1042 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead); | |
| 1043 | - }, function(bounds, pt) | |
| 1044 | - { | |
| 1045 | - 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; | |
| 1046 | - }); | |
| 1047 | - | |
| 950 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 951 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 952 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 953 | + | |
| 954 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead); | |
| 955 | + }, function (bounds, pt) { | |
| 956 | + 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; | |
| 957 | + }); | |
| 958 | + | |
| 1048 | 959 | handles.push(handle3); |
| 1049 | 960 | |
| 1050 | 961 | return handles; |
| 1051 | 962 | }; |
| 1052 | 963 | |
| 1053 | -mxShapeArrows2BendArrow.prototype.getConstraints = function(style, w, h) | |
| 1054 | -{ | |
| 964 | +mxShapeArrows2BendArrow.prototype.getConstraints = function (style, w, h) { | |
| 1055 | 965 | var constr = []; |
| 1056 | 966 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 1057 | 967 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -1072,17 +982,15 @@ mxShapeArrows2BendArrow.prototype.getConstraints = function(style, w, h) |
| 1072 | 982 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h)); |
| 1073 | 983 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - arrowHead / 2 - dy) * 0.5 + arrowHead / 2 + dy)); |
| 1074 | 984 | |
| 1075 | - if (rounded == '1') | |
| 1076 | - { | |
| 985 | + if (rounded == '1') { | |
| 1077 | 986 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy * 0.586, arrowHead / 2 - dy * 0.414)); |
| 1078 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2 * dy + dy * 0.0586, arrowHead / 2 + dy + dy * 0.0586)); | |
| 987 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 2 * dy + dy * 0.0586, arrowHead / 2 + dy + dy * 0.0586)); | |
| 1079 | 988 | } |
| 1080 | - else | |
| 1081 | - { | |
| 989 | + else { | |
| 1082 | 990 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, arrowHead / 2 - dy)); |
| 1083 | 991 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dy * 2, arrowHead / 2 + dy)); |
| 1084 | 992 | } |
| 1085 | - | |
| 993 | + | |
| 1086 | 994 | return (constr); |
| 1087 | 995 | }; |
| 1088 | 996 | |
| ... | ... | @@ -1092,8 +1000,7 @@ mxShapeArrows2BendArrow.prototype.getConstraints = function(style, w, h) |
| 1092 | 1000 | /** |
| 1093 | 1001 | * Extends mxShape. |
| 1094 | 1002 | */ |
| 1095 | -function mxShapeArrows2BendDoubleArrow(bounds, fill, stroke, strokewidth) | |
| 1096 | -{ | |
| 1003 | +function mxShapeArrows2BendDoubleArrow(bounds, fill, stroke, strokewidth) { | |
| 1097 | 1004 | mxShape.call(this); |
| 1098 | 1005 | this.bounds = bounds; |
| 1099 | 1006 | this.fill = fill; |
| ... | ... | @@ -1111,14 +1018,14 @@ function mxShapeArrows2BendDoubleArrow(bounds, fill, stroke, strokewidth) |
| 1111 | 1018 | mxUtils.extend(mxShapeArrows2BendDoubleArrow, mxActor); |
| 1112 | 1019 | |
| 1113 | 1020 | mxShapeArrows2BendDoubleArrow.prototype.customProperties = [ |
| 1114 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:38}, | |
| 1115 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:15}, | |
| 1116 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:55}, | |
| 1117 | - {name: 'rounded', dispName: 'Rounded', type: 'boolean', defVal:false} | |
| 1021 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 38 }, | |
| 1022 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 15 }, | |
| 1023 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 55 }, | |
| 1024 | + { name: 'rounded', dispName: 'Rounded', type: 'boolean', defVal: false } | |
| 1118 | 1025 | ]; |
| 1119 | 1026 | |
| 1120 | 1027 | mxShapeArrows2BendDoubleArrow.prototype.cst = { |
| 1121 | - BEND_DOUBLE_ARROW : 'mxgraph.arrows2.bendDoubleArrow' | |
| 1028 | + BEND_DOUBLE_ARROW: 'mxgraph.arrows2.bendDoubleArrow' | |
| 1122 | 1029 | }; |
| 1123 | 1030 | |
| 1124 | 1031 | /** |
| ... | ... | @@ -1126,8 +1033,7 @@ mxShapeArrows2BendDoubleArrow.prototype.cst = { |
| 1126 | 1033 | * |
| 1127 | 1034 | * Paints the vertex shape. |
| 1128 | 1035 | */ |
| 1129 | -mxShapeArrows2BendDoubleArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1130 | -{ | |
| 1036 | +mxShapeArrows2BendDoubleArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1131 | 1037 | c.translate(x, y); |
| 1132 | 1038 | |
| 1133 | 1039 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -1141,29 +1047,25 @@ mxShapeArrows2BendDoubleArrow.prototype.paintVertexShape = function(c, x, y, w, |
| 1141 | 1047 | c.lineTo(w - dx, arrowHead); |
| 1142 | 1048 | c.lineTo(w - dx, arrowHead / 2 + dy); |
| 1143 | 1049 | |
| 1144 | - if (rounded == '1') | |
| 1145 | - { | |
| 1050 | + if (rounded == '1') { | |
| 1146 | 1051 | c.lineTo(arrowHead / 2 + dy * 1.2, arrowHead / 2 + dy); |
| 1147 | - c.arcTo(dy * 0.2, dy * 0.2, 0, 0, 0, arrowHead /2 + dy, arrowHead / 2 + dy * 1.2); | |
| 1052 | + c.arcTo(dy * 0.2, dy * 0.2, 0, 0, 0, arrowHead / 2 + dy, arrowHead / 2 + dy * 1.2); | |
| 1148 | 1053 | } |
| 1149 | - else | |
| 1150 | - { | |
| 1054 | + else { | |
| 1151 | 1055 | c.lineTo(arrowHead / 2 + dy, arrowHead / 2 + dy); |
| 1152 | 1056 | } |
| 1153 | - | |
| 1057 | + | |
| 1154 | 1058 | c.lineTo(arrowHead / 2 + dy, h - dx); |
| 1155 | 1059 | c.lineTo(arrowHead, h - dx); |
| 1156 | 1060 | c.lineTo(arrowHead / 2, h); |
| 1157 | 1061 | c.lineTo(0, h - dx); |
| 1158 | 1062 | c.lineTo(arrowHead / 2 - dy, h - dx); |
| 1159 | - | |
| 1160 | - if (rounded == '1') | |
| 1161 | - { | |
| 1063 | + | |
| 1064 | + if (rounded == '1') { | |
| 1162 | 1065 | c.lineTo(arrowHead / 2 - dy, arrowHead / 2 + dy); |
| 1163 | 1066 | c.arcTo(dy * 2, dy * 2, 0, 0, 1, arrowHead / 2 + dy, arrowHead / 2 - dy); |
| 1164 | 1067 | } |
| 1165 | - else | |
| 1166 | - { | |
| 1068 | + else { | |
| 1167 | 1069 | c.lineTo(arrowHead / 2 - dy, arrowHead / 2 - dy); |
| 1168 | 1070 | } |
| 1169 | 1071 | |
| ... | ... | @@ -1176,47 +1078,41 @@ mxCellRenderer.registerShape(mxShapeArrows2BendDoubleArrow.prototype.cst.BEND_DO |
| 1176 | 1078 | |
| 1177 | 1079 | mxShapeArrows2BendDoubleArrow.prototype.constraints = null; |
| 1178 | 1080 | |
| 1179 | -Graph.handleFactory[mxShapeArrows2BendDoubleArrow.prototype.cst.BEND_DOUBLE_ARROW] = function(state) | |
| 1180 | -{ | |
| 1181 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 1182 | - { | |
| 1183 | - 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)))); | |
| 1184 | - var dx = Math.max(0, Math.min(Math.min(bounds.width, bounds.height) - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1185 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1186 | - | |
| 1187 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy); | |
| 1188 | - }, function(bounds, pt) | |
| 1189 | - { | |
| 1190 | - 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; | |
| 1191 | - 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; | |
| 1192 | - | |
| 1193 | - })]; | |
| 1194 | - | |
| 1195 | - var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1196 | - { | |
| 1197 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1198 | - var arrowHead = Math.max(0, Math.min(Math.min(bounds.height, bounds.width) - dx, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1199 | - | |
| 1200 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead); | |
| 1201 | - }, function(bounds, pt) | |
| 1202 | - { | |
| 1203 | - 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; | |
| 1204 | - }); | |
| 1205 | - | |
| 1081 | +Graph.handleFactory[mxShapeArrows2BendDoubleArrow.prototype.cst.BEND_DOUBLE_ARROW] = function (state) { | |
| 1082 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 1083 | + 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)))); | |
| 1084 | + var dx = Math.max(0, Math.min(Math.min(bounds.width, bounds.height) - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1085 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1086 | + | |
| 1087 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy); | |
| 1088 | + }, function (bounds, pt) { | |
| 1089 | + 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; | |
| 1090 | + 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; | |
| 1091 | + | |
| 1092 | + })]; | |
| 1093 | + | |
| 1094 | + var handle2 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 1095 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1096 | + var arrowHead = Math.max(0, Math.min(Math.min(bounds.height, bounds.width) - dx, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1097 | + | |
| 1098 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead); | |
| 1099 | + }, function (bounds, pt) { | |
| 1100 | + 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; | |
| 1101 | + }); | |
| 1102 | + | |
| 1206 | 1103 | handles.push(handle2); |
| 1207 | 1104 | |
| 1208 | 1105 | return handles; |
| 1209 | 1106 | }; |
| 1210 | 1107 | |
| 1211 | -mxShapeArrows2BendDoubleArrow.prototype.getConstraints = function(style, w, h) | |
| 1212 | -{ | |
| 1108 | +mxShapeArrows2BendDoubleArrow.prototype.getConstraints = function (style, w, h) { | |
| 1213 | 1109 | var constr = []; |
| 1214 | 1110 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 1215 | 1111 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1216 | 1112 | var arrowHead = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 1217 | 1113 | var rounded = mxUtils.getValue(this.style, 'rounded', '0'); |
| 1218 | 1114 | |
| 1219 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx , 0)); | |
| 1115 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0)); | |
| 1220 | 1116 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, arrowHead * 0.5)); |
| 1221 | 1117 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead)); |
| 1222 | 1118 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead / 2 + dy)); |
| ... | ... | @@ -1230,17 +1126,15 @@ mxShapeArrows2BendDoubleArrow.prototype.getConstraints = function(style, w, h) |
| 1230 | 1126 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h - dx)); |
| 1231 | 1127 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy, h - dx)); |
| 1232 | 1128 | |
| 1233 | - if (rounded == '1') | |
| 1234 | - { | |
| 1129 | + if (rounded == '1') { | |
| 1235 | 1130 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy * 0.414, arrowHead / 2 - dy * 0.414)); |
| 1236 | 1131 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 + dy + dy * 0.0586, arrowHead / 2 + dy + dy * 0.0586)); |
| 1237 | 1132 | } |
| 1238 | - else | |
| 1239 | - { | |
| 1133 | + else { | |
| 1240 | 1134 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 - dy, arrowHead / 2 - dy)); |
| 1241 | 1135 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead / 2 + dy, arrowHead / 2 + dy)); |
| 1242 | 1136 | } |
| 1243 | - | |
| 1137 | + | |
| 1244 | 1138 | return (constr); |
| 1245 | 1139 | }; |
| 1246 | 1140 | |
| ... | ... | @@ -1250,8 +1144,7 @@ mxShapeArrows2BendDoubleArrow.prototype.getConstraints = function(style, w, h) |
| 1250 | 1144 | /** |
| 1251 | 1145 | * Extends mxShape. |
| 1252 | 1146 | */ |
| 1253 | -function mxShapeArrows2CalloutDoubleArrow(bounds, fill, stroke, strokewidth) | |
| 1254 | -{ | |
| 1147 | +function mxShapeArrows2CalloutDoubleArrow(bounds, fill, stroke, strokewidth) { | |
| 1255 | 1148 | mxShape.call(this); |
| 1256 | 1149 | this.bounds = bounds; |
| 1257 | 1150 | this.fill = fill; |
| ... | ... | @@ -1269,14 +1162,14 @@ function mxShapeArrows2CalloutDoubleArrow(bounds, fill, stroke, strokewidth) |
| 1269 | 1162 | mxUtils.extend(mxShapeArrows2CalloutDoubleArrow, mxActor); |
| 1270 | 1163 | |
| 1271 | 1164 | mxShapeArrows2CalloutDoubleArrow.prototype.customProperties = [ |
| 1272 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20}, | |
| 1273 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10}, | |
| 1274 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10}, | |
| 1275 | - {name: 'notch', dispName: 'Rect Size', type: 'float', min:0, defVal:24} | |
| 1165 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 1166 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 1167 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 10 }, | |
| 1168 | + { name: 'notch', dispName: 'Rect Size', type: 'float', min: 0, defVal: 24 } | |
| 1276 | 1169 | ]; |
| 1277 | 1170 | |
| 1278 | 1171 | mxShapeArrows2CalloutDoubleArrow.prototype.cst = { |
| 1279 | - CALLOUT_DOUBLE_ARROW : 'mxgraph.arrows2.calloutDoubleArrow' | |
| 1172 | + CALLOUT_DOUBLE_ARROW: 'mxgraph.arrows2.calloutDoubleArrow' | |
| 1280 | 1173 | }; |
| 1281 | 1174 | |
| 1282 | 1175 | /** |
| ... | ... | @@ -1284,8 +1177,7 @@ mxShapeArrows2CalloutDoubleArrow.prototype.cst = { |
| 1284 | 1177 | * |
| 1285 | 1178 | * Paints the vertex shape. |
| 1286 | 1179 | */ |
| 1287 | -mxShapeArrows2CalloutDoubleArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1288 | -{ | |
| 1180 | +mxShapeArrows2CalloutDoubleArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1289 | 1181 | c.translate(x, y); |
| 1290 | 1182 | |
| 1291 | 1183 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -1320,53 +1212,45 @@ mxCellRenderer.registerShape(mxShapeArrows2CalloutDoubleArrow.prototype.cst.CALL |
| 1320 | 1212 | |
| 1321 | 1213 | mxShapeArrows2CalloutDoubleArrow.prototype.constraints = null; |
| 1322 | 1214 | |
| 1323 | -Graph.handleFactory[mxShapeArrows2CalloutDoubleArrow.prototype.cst.CALLOUT_DOUBLE_ARROW] = function(state) | |
| 1324 | -{ | |
| 1325 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 1326 | - { | |
| 1327 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1328 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1329 | - var dy = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1330 | - | |
| 1331 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 1332 | - }, function(bounds, pt) | |
| 1333 | - { | |
| 1334 | - 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; | |
| 1335 | - 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; | |
| 1336 | - | |
| 1337 | - })]; | |
| 1338 | - | |
| 1339 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 1340 | - { | |
| 1341 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 1342 | - | |
| 1343 | - return new mxPoint(bounds.x + bounds.width / 2 + notch, bounds.y + bounds.height / 2); | |
| 1344 | - }, function(bounds, pt) | |
| 1345 | - { | |
| 1346 | - 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; | |
| 1347 | - }); | |
| 1215 | +Graph.handleFactory[mxShapeArrows2CalloutDoubleArrow.prototype.cst.CALLOUT_DOUBLE_ARROW] = function (state) { | |
| 1216 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 1217 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1218 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1219 | + var dy = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1220 | + | |
| 1221 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 1222 | + }, function (bounds, pt) { | |
| 1223 | + 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; | |
| 1224 | + 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; | |
| 1225 | + | |
| 1226 | + })]; | |
| 1227 | + | |
| 1228 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 1229 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 1230 | + | |
| 1231 | + return new mxPoint(bounds.x + bounds.width / 2 + notch, bounds.y + bounds.height / 2); | |
| 1232 | + }, function (bounds, pt) { | |
| 1233 | + 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; | |
| 1234 | + }); | |
| 1348 | 1235 | |
| 1349 | 1236 | handles.push(handle2); |
| 1350 | - | |
| 1351 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1352 | - { | |
| 1353 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1354 | - var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1355 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1356 | - | |
| 1357 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 1358 | - }, function(bounds, pt) | |
| 1359 | - { | |
| 1360 | - 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; | |
| 1361 | - }); | |
| 1237 | + | |
| 1238 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 1239 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1240 | + var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1241 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1242 | + | |
| 1243 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 1244 | + }, function (bounds, pt) { | |
| 1245 | + 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; | |
| 1246 | + }); | |
| 1362 | 1247 | |
| 1363 | 1248 | handles.push(handle3); |
| 1364 | - | |
| 1249 | + | |
| 1365 | 1250 | return handles; |
| 1366 | 1251 | }; |
| 1367 | 1252 | |
| 1368 | -mxShapeArrows2CalloutDoubleArrow.prototype.getConstraints = function(style, w, h) | |
| 1369 | -{ | |
| 1253 | +mxShapeArrows2CalloutDoubleArrow.prototype.getConstraints = function (style, w, h) { | |
| 1370 | 1254 | var constr = []; |
| 1371 | 1255 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 1372 | 1256 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -1389,7 +1273,7 @@ mxShapeArrows2CalloutDoubleArrow.prototype.getConstraints = function(style, w, h |
| 1389 | 1273 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 1.5 - dx + notch) * 0.5, h * 0.5 + dy)); |
| 1390 | 1274 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - notch) * 0.5, h * 0.5 - dy)); |
| 1391 | 1275 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - notch) * 0.5, h * 0.5 + dy)); |
| 1392 | - | |
| 1276 | + | |
| 1393 | 1277 | return (constr); |
| 1394 | 1278 | }; |
| 1395 | 1279 | |
| ... | ... | @@ -1399,8 +1283,7 @@ mxShapeArrows2CalloutDoubleArrow.prototype.getConstraints = function(style, w, h |
| 1399 | 1283 | /** |
| 1400 | 1284 | * Extends mxShape. |
| 1401 | 1285 | */ |
| 1402 | -function mxShapeArrows2CalloutQuadArrow(bounds, fill, stroke, strokewidth) | |
| 1403 | -{ | |
| 1286 | +function mxShapeArrows2CalloutQuadArrow(bounds, fill, stroke, strokewidth) { | |
| 1404 | 1287 | mxShape.call(this); |
| 1405 | 1288 | this.bounds = bounds; |
| 1406 | 1289 | this.fill = fill; |
| ... | ... | @@ -1418,14 +1301,14 @@ function mxShapeArrows2CalloutQuadArrow(bounds, fill, stroke, strokewidth) |
| 1418 | 1301 | mxUtils.extend(mxShapeArrows2CalloutQuadArrow, mxActor); |
| 1419 | 1302 | |
| 1420 | 1303 | mxShapeArrows2CalloutQuadArrow.prototype.customProperties = [ |
| 1421 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20}, | |
| 1422 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal: 10}, | |
| 1423 | - {name: 'notch', dispName: 'Rect Size', type: 'float', min:0, defVal:24}, | |
| 1424 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10} | |
| 1304 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 1305 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 1306 | + { name: 'notch', dispName: 'Rect Size', type: 'float', min: 0, defVal: 24 }, | |
| 1307 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 10 } | |
| 1425 | 1308 | ]; |
| 1426 | 1309 | |
| 1427 | 1310 | mxShapeArrows2CalloutQuadArrow.prototype.cst = { |
| 1428 | - CALLOUT_QUAD_ARROW : 'mxgraph.arrows2.calloutQuadArrow' | |
| 1311 | + CALLOUT_QUAD_ARROW: 'mxgraph.arrows2.calloutQuadArrow' | |
| 1429 | 1312 | }; |
| 1430 | 1313 | |
| 1431 | 1314 | /** |
| ... | ... | @@ -1433,8 +1316,7 @@ mxShapeArrows2CalloutQuadArrow.prototype.cst = { |
| 1433 | 1316 | * |
| 1434 | 1317 | * Paints the vertex shape. |
| 1435 | 1318 | */ |
| 1436 | -mxShapeArrows2CalloutQuadArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1437 | -{ | |
| 1319 | +mxShapeArrows2CalloutQuadArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1438 | 1320 | c.translate(x, y); |
| 1439 | 1321 | |
| 1440 | 1322 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -1483,53 +1365,45 @@ mxCellRenderer.registerShape(mxShapeArrows2CalloutQuadArrow.prototype.cst.CALLOU |
| 1483 | 1365 | |
| 1484 | 1366 | mxShapeArrows2CalloutQuadArrow.prototype.constraints = null; |
| 1485 | 1367 | |
| 1486 | -Graph.handleFactory[mxShapeArrows2CalloutQuadArrow.prototype.cst.CALLOUT_QUAD_ARROW] = function(state) | |
| 1487 | -{ | |
| 1488 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 1489 | - { | |
| 1490 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1491 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1492 | - var dy = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1493 | - | |
| 1494 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 1495 | - }, function(bounds, pt) | |
| 1496 | - { | |
| 1497 | - 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; | |
| 1498 | - 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; | |
| 1499 | - | |
| 1500 | - })]; | |
| 1501 | - | |
| 1502 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 1503 | - { | |
| 1504 | - 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)))); | |
| 1505 | - | |
| 1506 | - return new mxPoint(bounds.x + bounds.width / 2 + notch, bounds.y + bounds.height / 2); | |
| 1507 | - }, function(bounds, pt) | |
| 1508 | - { | |
| 1509 | - 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; | |
| 1510 | - }); | |
| 1368 | +Graph.handleFactory[mxShapeArrows2CalloutQuadArrow.prototype.cst.CALLOUT_QUAD_ARROW] = function (state) { | |
| 1369 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 1370 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1371 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1372 | + var dy = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1373 | + | |
| 1374 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 1375 | + }, function (bounds, pt) { | |
| 1376 | + 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; | |
| 1377 | + 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; | |
| 1378 | + | |
| 1379 | + })]; | |
| 1380 | + | |
| 1381 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 1382 | + 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)))); | |
| 1383 | + | |
| 1384 | + return new mxPoint(bounds.x + bounds.width / 2 + notch, bounds.y + bounds.height / 2); | |
| 1385 | + }, function (bounds, pt) { | |
| 1386 | + 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; | |
| 1387 | + }); | |
| 1511 | 1388 | |
| 1512 | 1389 | handles.push(handle2); |
| 1513 | - | |
| 1514 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1515 | - { | |
| 1516 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1517 | - var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1518 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1519 | - | |
| 1520 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 1521 | - }, function(bounds, pt) | |
| 1522 | - { | |
| 1523 | - 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; | |
| 1524 | - }); | |
| 1390 | + | |
| 1391 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 1392 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1393 | + var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1394 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1395 | + | |
| 1396 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 1397 | + }, function (bounds, pt) { | |
| 1398 | + 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; | |
| 1399 | + }); | |
| 1525 | 1400 | |
| 1526 | 1401 | handles.push(handle3); |
| 1527 | - | |
| 1402 | + | |
| 1528 | 1403 | return handles; |
| 1529 | 1404 | }; |
| 1530 | 1405 | |
| 1531 | -mxShapeArrows2CalloutQuadArrow.prototype.getConstraints = function(style, w, h) | |
| 1532 | -{ | |
| 1406 | +mxShapeArrows2CalloutQuadArrow.prototype.getConstraints = function (style, w, h) { | |
| 1533 | 1407 | var constr = []; |
| 1534 | 1408 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 1535 | 1409 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -1568,7 +1442,7 @@ mxShapeArrows2CalloutQuadArrow.prototype.getConstraints = function(style, w, h) |
| 1568 | 1442 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.25 - (notch - dx) * 0.5, h * 0.5 + dy)); |
| 1569 | 1443 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - dy, h * 0.25 - (notch - dx) * 0.5)); |
| 1570 | 1444 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + dy, h * 0.25 - (notch - dx) * 0.5)); |
| 1571 | - | |
| 1445 | + | |
| 1572 | 1446 | return (constr); |
| 1573 | 1447 | }; |
| 1574 | 1448 | |
| ... | ... | @@ -1578,8 +1452,7 @@ mxShapeArrows2CalloutQuadArrow.prototype.getConstraints = function(style, w, h) |
| 1578 | 1452 | /** |
| 1579 | 1453 | * Extends mxShape. |
| 1580 | 1454 | */ |
| 1581 | -function mxShapeArrows2CalloutDouble90Arrow(bounds, fill, stroke, strokewidth) | |
| 1582 | -{ | |
| 1455 | +function mxShapeArrows2CalloutDouble90Arrow(bounds, fill, stroke, strokewidth) { | |
| 1583 | 1456 | mxShape.call(this); |
| 1584 | 1457 | this.bounds = bounds; |
| 1585 | 1458 | this.fill = fill; |
| ... | ... | @@ -1598,15 +1471,15 @@ function mxShapeArrows2CalloutDouble90Arrow(bounds, fill, stroke, strokewidth) |
| 1598 | 1471 | mxUtils.extend(mxShapeArrows2CalloutDouble90Arrow, mxActor); |
| 1599 | 1472 | |
| 1600 | 1473 | mxShapeArrows2CalloutDouble90Arrow.prototype.customProperties = [ |
| 1601 | - {name: 'dx1', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20}, | |
| 1602 | - {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, defVal: 10}, | |
| 1603 | - {name: 'dx2', dispName: 'Callout Width', type: 'float', min:0, defVal:70}, | |
| 1604 | - {name: 'dy2', dispName: 'Callout Height', type: 'float', min:0, defVal:70}, | |
| 1605 | - {name: 'arrowHead', dispName: 'ArrowHead Width', type: 'float', min:0, defVal:10} | |
| 1474 | + { name: 'dx1', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 1475 | + { name: 'dy1', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 1476 | + { name: 'dx2', dispName: 'Callout Width', type: 'float', min: 0, defVal: 70 }, | |
| 1477 | + { name: 'dy2', dispName: 'Callout Height', type: 'float', min: 0, defVal: 70 }, | |
| 1478 | + { name: 'arrowHead', dispName: 'ArrowHead Width', type: 'float', min: 0, defVal: 10 } | |
| 1606 | 1479 | ]; |
| 1607 | 1480 | |
| 1608 | 1481 | mxShapeArrows2CalloutDouble90Arrow.prototype.cst = { |
| 1609 | - CALLOUT_DOUBLE_90_ARROW : 'mxgraph.arrows2.calloutDouble90Arrow' | |
| 1482 | + CALLOUT_DOUBLE_90_ARROW: 'mxgraph.arrows2.calloutDouble90Arrow' | |
| 1610 | 1483 | }; |
| 1611 | 1484 | |
| 1612 | 1485 | /** |
| ... | ... | @@ -1614,8 +1487,7 @@ mxShapeArrows2CalloutDouble90Arrow.prototype.cst = { |
| 1614 | 1487 | * |
| 1615 | 1488 | * Paints the vertex shape. |
| 1616 | 1489 | */ |
| 1617 | -mxShapeArrows2CalloutDouble90Arrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1618 | -{ | |
| 1490 | +mxShapeArrows2CalloutDouble90Arrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1619 | 1491 | c.translate(x, y); |
| 1620 | 1492 | |
| 1621 | 1493 | var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| ... | ... | @@ -1651,55 +1523,47 @@ mxCellRenderer.registerShape(mxShapeArrows2CalloutDouble90Arrow.prototype.cst.CA |
| 1651 | 1523 | |
| 1652 | 1524 | mxShapeArrows2CalloutDouble90Arrow.prototype.constraints = null; |
| 1653 | 1525 | |
| 1654 | -Graph.handleFactory[mxShapeArrows2CalloutDouble90Arrow.prototype.cst.CALLOUT_DOUBLE_90_ARROW] = function(state) | |
| 1655 | -{ | |
| 1656 | - var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds) | |
| 1657 | - { | |
| 1658 | - 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)))); | |
| 1659 | - 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)))); | |
| 1660 | - 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)))); | |
| 1661 | - | |
| 1662 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - dy1); | |
| 1663 | - }, function(bounds, pt) | |
| 1664 | - { | |
| 1665 | - 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; | |
| 1666 | - 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; | |
| 1667 | - | |
| 1668 | - })]; | |
| 1669 | - | |
| 1670 | - var handle2 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds) | |
| 1671 | - { | |
| 1672 | - 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)))); | |
| 1673 | - 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)))); | |
| 1674 | - | |
| 1675 | - return new mxPoint(bounds.x + dx2, bounds.y + dy2); | |
| 1676 | - }, function(bounds, pt) | |
| 1677 | - { | |
| 1678 | - 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; | |
| 1679 | - 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; | |
| 1680 | - }); | |
| 1526 | +Graph.handleFactory[mxShapeArrows2CalloutDouble90Arrow.prototype.cst.CALLOUT_DOUBLE_90_ARROW] = function (state) { | |
| 1527 | + var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function (bounds) { | |
| 1528 | + 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)))); | |
| 1529 | + 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)))); | |
| 1530 | + 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)))); | |
| 1531 | + | |
| 1532 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - dy1); | |
| 1533 | + }, function (bounds, pt) { | |
| 1534 | + 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; | |
| 1535 | + 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; | |
| 1536 | + | |
| 1537 | + })]; | |
| 1538 | + | |
| 1539 | + var handle2 = Graph.createHandle(state, ['dx2', 'dy2'], function (bounds) { | |
| 1540 | + 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)))); | |
| 1541 | + 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)))); | |
| 1542 | + | |
| 1543 | + return new mxPoint(bounds.x + dx2, bounds.y + dy2); | |
| 1544 | + }, function (bounds, pt) { | |
| 1545 | + 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; | |
| 1546 | + 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; | |
| 1547 | + }); | |
| 1681 | 1548 | |
| 1682 | 1549 | handles.push(handle2); |
| 1683 | - | |
| 1684 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1685 | - { | |
| 1686 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 1687 | - 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)))); | |
| 1688 | - 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)))); | |
| 1689 | - | |
| 1690 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - dy1 - arrowHead); | |
| 1691 | - }, function(bounds, pt) | |
| 1692 | - { | |
| 1693 | - 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; | |
| 1694 | - }); | |
| 1550 | + | |
| 1551 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 1552 | + var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 1553 | + 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)))); | |
| 1554 | + 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)))); | |
| 1555 | + | |
| 1556 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)) / 2 - dy1 - arrowHead); | |
| 1557 | + }, function (bounds, pt) { | |
| 1558 | + 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; | |
| 1559 | + }); | |
| 1695 | 1560 | |
| 1696 | 1561 | handles.push(handle3); |
| 1697 | - | |
| 1562 | + | |
| 1698 | 1563 | return handles; |
| 1699 | 1564 | }; |
| 1700 | 1565 | |
| 1701 | -mxShapeArrows2CalloutDouble90Arrow.prototype.getConstraints = function(style, w, h) | |
| 1702 | -{ | |
| 1566 | +mxShapeArrows2CalloutDouble90Arrow.prototype.getConstraints = function (style, w, h) { | |
| 1703 | 1567 | var constr = []; |
| 1704 | 1568 | var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 1705 | 1569 | var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| ... | ... | @@ -1722,7 +1586,7 @@ mxShapeArrows2CalloutDouble90Arrow.prototype.getConstraints = function(style, w, |
| 1722 | 1586 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 / 2, h)); |
| 1723 | 1587 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx2 / 2 - dy1 - arrowHead, h - dx1)); |
| 1724 | 1588 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy2)); |
| 1725 | - | |
| 1589 | + | |
| 1726 | 1590 | return (constr); |
| 1727 | 1591 | }; |
| 1728 | 1592 | |
| ... | ... | @@ -1732,8 +1596,7 @@ mxShapeArrows2CalloutDouble90Arrow.prototype.getConstraints = function(style, w, |
| 1732 | 1596 | /** |
| 1733 | 1597 | * Extends mxShape. |
| 1734 | 1598 | */ |
| 1735 | -function mxShapeArrows2QuadArrow(bounds, fill, stroke, strokewidth) | |
| 1736 | -{ | |
| 1599 | +function mxShapeArrows2QuadArrow(bounds, fill, stroke, strokewidth) { | |
| 1737 | 1600 | mxShape.call(this); |
| 1738 | 1601 | this.bounds = bounds; |
| 1739 | 1602 | this.fill = fill; |
| ... | ... | @@ -1751,13 +1614,13 @@ function mxShapeArrows2QuadArrow(bounds, fill, stroke, strokewidth) |
| 1751 | 1614 | mxUtils.extend(mxShapeArrows2QuadArrow, mxActor); |
| 1752 | 1615 | |
| 1753 | 1616 | mxShapeArrows2QuadArrow.prototype.customProperties = [ |
| 1754 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20}, | |
| 1755 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10}, | |
| 1756 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:10} | |
| 1617 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 1618 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 1619 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 10 } | |
| 1757 | 1620 | ]; |
| 1758 | 1621 | |
| 1759 | 1622 | mxShapeArrows2QuadArrow.prototype.cst = { |
| 1760 | - QUAD_ARROW : 'mxgraph.arrows2.quadArrow' | |
| 1623 | + QUAD_ARROW: 'mxgraph.arrows2.quadArrow' | |
| 1761 | 1624 | }; |
| 1762 | 1625 | |
| 1763 | 1626 | /** |
| ... | ... | @@ -1765,8 +1628,7 @@ mxShapeArrows2QuadArrow.prototype.cst = { |
| 1765 | 1628 | * |
| 1766 | 1629 | * Paints the vertex shape. |
| 1767 | 1630 | */ |
| 1768 | -mxShapeArrows2QuadArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1769 | -{ | |
| 1631 | +mxShapeArrows2QuadArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1770 | 1632 | c.translate(x, y); |
| 1771 | 1633 | |
| 1772 | 1634 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -1806,41 +1668,35 @@ mxCellRenderer.registerShape(mxShapeArrows2QuadArrow.prototype.cst.QUAD_ARROW, m |
| 1806 | 1668 | |
| 1807 | 1669 | mxShapeArrows2QuadArrow.prototype.constraints = null; |
| 1808 | 1670 | |
| 1809 | -Graph.handleFactory[mxShapeArrows2QuadArrow.prototype.cst.QUAD_ARROW] = function(state) | |
| 1810 | -{ | |
| 1811 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 1812 | - { | |
| 1813 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1814 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1815 | - var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1816 | - | |
| 1817 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 1818 | - }, function(bounds, pt) | |
| 1819 | - { | |
| 1820 | - 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; | |
| 1821 | - 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; | |
| 1822 | - | |
| 1823 | - })]; | |
| 1824 | - | |
| 1825 | - var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1826 | - { | |
| 1827 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1828 | - var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1829 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1830 | - | |
| 1831 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 1832 | - }, function(bounds, pt) | |
| 1833 | - { | |
| 1834 | - 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; | |
| 1835 | - }); | |
| 1671 | +Graph.handleFactory[mxShapeArrows2QuadArrow.prototype.cst.QUAD_ARROW] = function (state) { | |
| 1672 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 1673 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1674 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1675 | + var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1676 | + | |
| 1677 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy); | |
| 1678 | + }, function (bounds, pt) { | |
| 1679 | + 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; | |
| 1680 | + 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; | |
| 1681 | + | |
| 1682 | + })]; | |
| 1683 | + | |
| 1684 | + var handle2 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 1685 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1686 | + var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1687 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1688 | + | |
| 1689 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height / 2 - dy - arrowHead); | |
| 1690 | + }, function (bounds, pt) { | |
| 1691 | + 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; | |
| 1692 | + }); | |
| 1836 | 1693 | |
| 1837 | 1694 | handles.push(handle2); |
| 1838 | - | |
| 1695 | + | |
| 1839 | 1696 | return handles; |
| 1840 | 1697 | }; |
| 1841 | 1698 | |
| 1842 | -mxShapeArrows2QuadArrow.prototype.getConstraints = function(style, w, h) | |
| 1843 | -{ | |
| 1699 | +mxShapeArrows2QuadArrow.prototype.getConstraints = function (style, w, h) { | |
| 1844 | 1700 | var constr = []; |
| 1845 | 1701 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 1846 | 1702 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -1866,7 +1722,7 @@ mxShapeArrows2QuadArrow.prototype.getConstraints = function(style, w, h) |
| 1866 | 1722 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dx - dy) * 0.5 + w * 0.25, h * 0.5 + dy)); |
| 1867 | 1723 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dy - dx) * 0.5 + w * 0.75, h * 0.5 - dy)); |
| 1868 | 1724 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (dy - dx) * 0.5 + w * 0.75, h * 0.5 + dy)); |
| 1869 | - | |
| 1725 | + | |
| 1870 | 1726 | return (constr); |
| 1871 | 1727 | }; |
| 1872 | 1728 | |
| ... | ... | @@ -1876,8 +1732,7 @@ mxShapeArrows2QuadArrow.prototype.getConstraints = function(style, w, h) |
| 1876 | 1732 | /** |
| 1877 | 1733 | * Extends mxShape. |
| 1878 | 1734 | */ |
| 1879 | -function mxShapeArrows2TriadArrow(bounds, fill, stroke, strokewidth) | |
| 1880 | -{ | |
| 1735 | +function mxShapeArrows2TriadArrow(bounds, fill, stroke, strokewidth) { | |
| 1881 | 1736 | mxShape.call(this); |
| 1882 | 1737 | this.bounds = bounds; |
| 1883 | 1738 | this.fill = fill; |
| ... | ... | @@ -1894,13 +1749,13 @@ function mxShapeArrows2TriadArrow(bounds, fill, stroke, strokewidth) |
| 1894 | 1749 | mxUtils.extend(mxShapeArrows2TriadArrow, mxActor); |
| 1895 | 1750 | |
| 1896 | 1751 | mxShapeArrows2TriadArrow.prototype.customProperties = [ |
| 1897 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:20}, | |
| 1898 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:10}, | |
| 1899 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:40} | |
| 1752 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 1753 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 1754 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 40 } | |
| 1900 | 1755 | ]; |
| 1901 | 1756 | |
| 1902 | 1757 | mxShapeArrows2TriadArrow.prototype.cst = { |
| 1903 | - TRIAD_ARROW : 'mxgraph.arrows2.triadArrow' | |
| 1758 | + TRIAD_ARROW: 'mxgraph.arrows2.triadArrow' | |
| 1904 | 1759 | }; |
| 1905 | 1760 | |
| 1906 | 1761 | /** |
| ... | ... | @@ -1908,8 +1763,7 @@ mxShapeArrows2TriadArrow.prototype.cst = { |
| 1908 | 1763 | * |
| 1909 | 1764 | * Paints the vertex shape. |
| 1910 | 1765 | */ |
| 1911 | -mxShapeArrows2TriadArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1912 | -{ | |
| 1766 | +mxShapeArrows2TriadArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1913 | 1767 | c.translate(x, y); |
| 1914 | 1768 | |
| 1915 | 1769 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -1942,41 +1796,35 @@ mxCellRenderer.registerShape(mxShapeArrows2TriadArrow.prototype.cst.TRIAD_ARROW, |
| 1942 | 1796 | |
| 1943 | 1797 | mxShapeArrows2TriadArrow.prototype.constraints = null; |
| 1944 | 1798 | |
| 1945 | -Graph.handleFactory[mxShapeArrows2TriadArrow.prototype.cst.TRIAD_ARROW] = function(state) | |
| 1946 | -{ | |
| 1947 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 1948 | - { | |
| 1949 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1950 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1951 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1952 | - | |
| 1953 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - dy); | |
| 1954 | - }, function(bounds, pt) | |
| 1955 | - { | |
| 1956 | - 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; | |
| 1957 | - 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; | |
| 1958 | - | |
| 1959 | - })]; | |
| 1960 | - | |
| 1961 | - var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 1962 | - { | |
| 1963 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1964 | - var dy = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1965 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1966 | - | |
| 1967 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - arrowHead); | |
| 1968 | - }, function(bounds, pt) | |
| 1969 | - { | |
| 1970 | - 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; | |
| 1971 | - }); | |
| 1799 | +Graph.handleFactory[mxShapeArrows2TriadArrow.prototype.cst.TRIAD_ARROW] = function (state) { | |
| 1800 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 1801 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1802 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 1803 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 1804 | + | |
| 1805 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - dy); | |
| 1806 | + }, function (bounds, pt) { | |
| 1807 | + 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; | |
| 1808 | + 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; | |
| 1809 | + | |
| 1810 | + })]; | |
| 1811 | + | |
| 1812 | + var handle2 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 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)))); | |
| 1815 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1816 | + | |
| 1817 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - arrowHead); | |
| 1818 | + }, function (bounds, pt) { | |
| 1819 | + 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; | |
| 1820 | + }); | |
| 1972 | 1821 | |
| 1973 | 1822 | handles.push(handle2); |
| 1974 | - | |
| 1823 | + | |
| 1975 | 1824 | return handles; |
| 1976 | 1825 | }; |
| 1977 | 1826 | |
| 1978 | -mxShapeArrows2TriadArrow.prototype.getConstraints = function(style, w, h) | |
| 1979 | -{ | |
| 1827 | +mxShapeArrows2TriadArrow.prototype.getConstraints = function (style, w, h) { | |
| 1980 | 1828 | var constr = []; |
| 1981 | 1829 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 1982 | 1830 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -1998,7 +1846,7 @@ mxShapeArrows2TriadArrow.prototype.getConstraints = function(style, w, h) |
| 1998 | 1846 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 0.5 + dx - arrowHead * 0.5 + dy) * 0.5, h - dy)); |
| 1999 | 1847 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 - arrowHead * 0.5 + dy, (dx + h - arrowHead + dy) * 0.5)); |
| 2000 | 1848 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5 + arrowHead * 0.5 - dy, (dx + h - arrowHead + dy) * 0.5)); |
| 2001 | - | |
| 1849 | + | |
| 2002 | 1850 | return (constr); |
| 2003 | 1851 | }; |
| 2004 | 1852 | |
| ... | ... | @@ -2008,8 +1856,7 @@ mxShapeArrows2TriadArrow.prototype.getConstraints = function(style, w, h) |
| 2008 | 1856 | /** |
| 2009 | 1857 | * Extends mxShape. |
| 2010 | 1858 | */ |
| 2011 | -function mxShapeArrows2TailedArrow(bounds, fill, stroke, strokewidth) | |
| 2012 | -{ | |
| 1859 | +function mxShapeArrows2TailedArrow(bounds, fill, stroke, strokewidth) { | |
| 2013 | 1860 | mxShape.call(this); |
| 2014 | 1861 | this.bounds = bounds; |
| 2015 | 1862 | this.fill = fill; |
| ... | ... | @@ -2027,16 +1874,16 @@ function mxShapeArrows2TailedArrow(bounds, fill, stroke, strokewidth) |
| 2027 | 1874 | mxUtils.extend(mxShapeArrows2TailedArrow, mxActor); |
| 2028 | 1875 | |
| 2029 | 1876 | mxShapeArrows2TailedArrow.prototype.customProperties = [ |
| 2030 | - {name: 'dx1', dispName: 'Arrowhead Length', type: 'float', min:0, defVal: 20}, | |
| 2031 | - {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, defVal: 10}, | |
| 2032 | - {name: 'dx2', dispName: 'Tail Length', type: 'float', min:0, defVal: 25}, | |
| 2033 | - {name: 'dy2', dispName: 'Tail Width', type: 'float', min:0, defVal:30}, | |
| 2034 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal: 0}, | |
| 2035 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:20} | |
| 1877 | + { name: 'dx1', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 20 }, | |
| 1878 | + { name: 'dy1', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 1879 | + { name: 'dx2', dispName: 'Tail Length', type: 'float', min: 0, defVal: 25 }, | |
| 1880 | + { name: 'dy2', dispName: 'Tail Width', type: 'float', min: 0, defVal: 30 }, | |
| 1881 | + { name: 'notch', dispName: 'Notch', type: 'float', min: 0, defVal: 0 }, | |
| 1882 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 20 } | |
| 2036 | 1883 | ]; |
| 2037 | 1884 | |
| 2038 | 1885 | mxShapeArrows2TailedArrow.prototype.cst = { |
| 2039 | - TAILED_ARROW : 'mxgraph.arrows2.tailedArrow' | |
| 1886 | + TAILED_ARROW: 'mxgraph.arrows2.tailedArrow' | |
| 2040 | 1887 | }; |
| 2041 | 1888 | |
| 2042 | 1889 | /** |
| ... | ... | @@ -2044,8 +1891,7 @@ mxShapeArrows2TailedArrow.prototype.cst = { |
| 2044 | 1891 | * |
| 2045 | 1892 | * Paints the vertex shape. |
| 2046 | 1893 | */ |
| 2047 | -mxShapeArrows2TailedArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2048 | -{ | |
| 1894 | +mxShapeArrows2TailedArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2049 | 1895 | c.translate(x, y); |
| 2050 | 1896 | |
| 2051 | 1897 | var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| ... | ... | @@ -2055,9 +1901,8 @@ mxShapeArrows2TailedArrow.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2055 | 1901 | var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch)))); |
| 2056 | 1902 | var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 2057 | 1903 | var x2 = 0; |
| 2058 | - | |
| 2059 | - if (dy2 != 0) | |
| 2060 | - { | |
| 1904 | + | |
| 1905 | + if (dy2 != 0) { | |
| 2061 | 1906 | x2 = dx2 + dy2 * (dy2 - dy1) / dy2; |
| 2062 | 1907 | } |
| 2063 | 1908 | |
| ... | ... | @@ -2082,68 +1927,58 @@ mxCellRenderer.registerShape(mxShapeArrows2TailedArrow.prototype.cst.TAILED_ARRO |
| 2082 | 1927 | |
| 2083 | 1928 | mxShapeArrows2TailedArrow.prototype.constraints = null; |
| 2084 | 1929 | |
| 2085 | -Graph.handleFactory[mxShapeArrows2TailedArrow.prototype.cst.TAILED_ARROW] = function(state) | |
| 2086 | -{ | |
| 2087 | - var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds) | |
| 2088 | - { | |
| 2089 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2090 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 2091 | - var dy1 = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 2092 | - | |
| 2093 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1); | |
| 2094 | - }, function(bounds, pt) | |
| 2095 | - { | |
| 2096 | - 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; | |
| 2097 | - 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; | |
| 2098 | - | |
| 2099 | - })]; | |
| 2100 | - | |
| 2101 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 2102 | - { | |
| 2103 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 2104 | - | |
| 2105 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 2106 | - }, function(bounds, pt) | |
| 2107 | - { | |
| 2108 | - 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; | |
| 2109 | - }); | |
| 1930 | +Graph.handleFactory[mxShapeArrows2TailedArrow.prototype.cst.TAILED_ARROW] = function (state) { | |
| 1931 | + var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function (bounds) { | |
| 1932 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1933 | + var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 1934 | + var dy1 = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 1935 | + | |
| 1936 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1); | |
| 1937 | + }, function (bounds, pt) { | |
| 1938 | + 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; | |
| 1939 | + 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; | |
| 1940 | + | |
| 1941 | + })]; | |
| 1942 | + | |
| 1943 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 1944 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 1945 | + | |
| 1946 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 1947 | + }, function (bounds, pt) { | |
| 1948 | + 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; | |
| 1949 | + }); | |
| 2110 | 1950 | |
| 2111 | 1951 | handles.push(handle2); |
| 2112 | - | |
| 2113 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 2114 | - { | |
| 2115 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 2116 | - var dy1 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 2117 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2118 | - | |
| 2119 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1 - arrowHead); | |
| 2120 | - }, function(bounds, pt) | |
| 2121 | - { | |
| 2122 | - 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; | |
| 2123 | - }); | |
| 1952 | + | |
| 1953 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 1954 | + var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 1955 | + var dy1 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 1956 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 1957 | + | |
| 1958 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1 - arrowHead); | |
| 1959 | + }, function (bounds, pt) { | |
| 1960 | + 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; | |
| 1961 | + }); | |
| 2124 | 1962 | |
| 2125 | 1963 | handles.push(handle3); |
| 2126 | - | |
| 2127 | - var handle4 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds) | |
| 2128 | - { | |
| 2129 | - var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 2130 | - var dy2 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)))); | |
| 2131 | - | |
| 2132 | - return new mxPoint(bounds.x + dx2, bounds.y + bounds.height / 2 - dy2); | |
| 2133 | - }, function(bounds, pt) | |
| 2134 | - { | |
| 2135 | - 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; | |
| 2136 | - 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; | |
| 2137 | - | |
| 2138 | - }); | |
| 1964 | + | |
| 1965 | + var handle4 = Graph.createHandle(state, ['dx2', 'dy2'], function (bounds) { | |
| 1966 | + var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 1967 | + var dy2 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)))); | |
| 1968 | + | |
| 1969 | + return new mxPoint(bounds.x + dx2, bounds.y + bounds.height / 2 - dy2); | |
| 1970 | + }, function (bounds, pt) { | |
| 1971 | + 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; | |
| 1972 | + 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; | |
| 1973 | + | |
| 1974 | + }); | |
| 2139 | 1975 | |
| 2140 | 1976 | handles.push(handle4); |
| 2141 | 1977 | |
| 2142 | 1978 | return handles; |
| 2143 | 1979 | }; |
| 2144 | 1980 | |
| 2145 | -mxShapeArrows2TailedArrow.prototype.getConstraints = function(style, w, h) | |
| 2146 | -{ | |
| 1981 | +mxShapeArrows2TailedArrow.prototype.getConstraints = function (style, w, h) { | |
| 2147 | 1982 | var constr = []; |
| 2148 | 1983 | var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 2149 | 1984 | var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| ... | ... | @@ -2152,9 +1987,8 @@ mxShapeArrows2TailedArrow.prototype.getConstraints = function(style, w, h) |
| 2152 | 1987 | var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch)))); |
| 2153 | 1988 | var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 2154 | 1989 | var x2 = 0; |
| 2155 | - | |
| 2156 | - if (dy2 != 0) | |
| 2157 | - { | |
| 1990 | + | |
| 1991 | + if (dy2 != 0) { | |
| 2158 | 1992 | x2 = dx2 + dy2 * (dy2 - dy1) / dy2; |
| 2159 | 1993 | } |
| 2160 | 1994 | |
| ... | ... | @@ -2168,7 +2002,7 @@ mxShapeArrows2TailedArrow.prototype.getConstraints = function(style, w, h) |
| 2168 | 2002 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + x2) * 0.5, h * 0.5 + dy1)); |
| 2169 | 2003 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h * 0.5 + dy1 + arrowHead)); |
| 2170 | 2004 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false)); |
| 2171 | - | |
| 2005 | + | |
| 2172 | 2006 | return (constr); |
| 2173 | 2007 | }; |
| 2174 | 2008 | |
| ... | ... | @@ -2178,8 +2012,7 @@ mxShapeArrows2TailedArrow.prototype.getConstraints = function(style, w, h) |
| 2178 | 2012 | /** |
| 2179 | 2013 | * Extends mxShape. |
| 2180 | 2014 | */ |
| 2181 | -function mxShapeArrows2TailedNotchedArrow(bounds, fill, stroke, strokewidth) | |
| 2182 | -{ | |
| 2015 | +function mxShapeArrows2TailedNotchedArrow(bounds, fill, stroke, strokewidth) { | |
| 2183 | 2016 | mxShape.call(this); |
| 2184 | 2017 | this.bounds = bounds; |
| 2185 | 2018 | this.fill = fill; |
| ... | ... | @@ -2197,16 +2030,16 @@ function mxShapeArrows2TailedNotchedArrow(bounds, fill, stroke, strokewidth) |
| 2197 | 2030 | mxUtils.extend(mxShapeArrows2TailedNotchedArrow, mxActor); |
| 2198 | 2031 | |
| 2199 | 2032 | mxShapeArrows2TailedNotchedArrow.prototype.customProperties = [ |
| 2200 | - {name: 'dx1', dispName: 'Arrowhead Length', type: 'float', mix:0, defVal:20}, | |
| 2201 | - {name: 'dy1', dispName: 'Arrow Width', type: 'float', min:0, defVal:10}, | |
| 2202 | - {name: 'dx2', dispName: 'Tail Length', type: 'float', min:0, defVal:25}, | |
| 2203 | - {name: 'dy2', dispName: 'Tail Width', type: 'float', min:0, defVal:30}, | |
| 2204 | - {name: 'notch', dispName: 'Notch', type: 'float', min:0, defVal:20}, | |
| 2205 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:20} | |
| 2033 | + { name: 'dx1', dispName: 'Arrowhead Length', type: 'float', mix: 0, defVal: 20 }, | |
| 2034 | + { name: 'dy1', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 10 }, | |
| 2035 | + { name: 'dx2', dispName: 'Tail Length', type: 'float', min: 0, defVal: 25 }, | |
| 2036 | + { name: 'dy2', dispName: 'Tail Width', type: 'float', min: 0, defVal: 30 }, | |
| 2037 | + { name: 'notch', dispName: 'Notch', type: 'float', min: 0, defVal: 20 }, | |
| 2038 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 20 } | |
| 2206 | 2039 | ]; |
| 2207 | 2040 | |
| 2208 | 2041 | mxShapeArrows2TailedNotchedArrow.prototype.cst = { |
| 2209 | - TAILED_NOTCHED_ARROW : 'mxgraph.arrows2.tailedNotchedArrow' | |
| 2042 | + TAILED_NOTCHED_ARROW: 'mxgraph.arrows2.tailedNotchedArrow' | |
| 2210 | 2043 | }; |
| 2211 | 2044 | |
| 2212 | 2045 | /** |
| ... | ... | @@ -2214,8 +2047,7 @@ mxShapeArrows2TailedNotchedArrow.prototype.cst = { |
| 2214 | 2047 | * |
| 2215 | 2048 | * Paints the vertex shape. |
| 2216 | 2049 | */ |
| 2217 | -mxShapeArrows2TailedNotchedArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2218 | -{ | |
| 2050 | +mxShapeArrows2TailedNotchedArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2219 | 2051 | c.translate(x, y); |
| 2220 | 2052 | |
| 2221 | 2053 | var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| ... | ... | @@ -2225,9 +2057,8 @@ mxShapeArrows2TailedNotchedArrow.prototype.paintVertexShape = function(c, x, y, |
| 2225 | 2057 | var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch)))); |
| 2226 | 2058 | var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 2227 | 2059 | var x2 = 0; |
| 2228 | - | |
| 2229 | - if (dy2 != 0) | |
| 2230 | - { | |
| 2060 | + | |
| 2061 | + if (dy2 != 0) { | |
| 2231 | 2062 | x2 = dx2 + notch * (dy2 - dy1) / dy2; |
| 2232 | 2063 | } |
| 2233 | 2064 | |
| ... | ... | @@ -2252,68 +2083,58 @@ mxCellRenderer.registerShape(mxShapeArrows2TailedNotchedArrow.prototype.cst.TAIL |
| 2252 | 2083 | |
| 2253 | 2084 | mxShapeArrows2TailedNotchedArrow.prototype.constraints = null; |
| 2254 | 2085 | |
| 2255 | -Graph.handleFactory[mxShapeArrows2TailedNotchedArrow.prototype.cst.TAILED_NOTCHED_ARROW] = function(state) | |
| 2256 | -{ | |
| 2257 | - var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function(bounds) | |
| 2258 | - { | |
| 2259 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2260 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 2261 | - var dy1 = Math.max(0, Math.min(bounds.height / 2 - arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 2262 | - | |
| 2263 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1); | |
| 2264 | - }, function(bounds, pt) | |
| 2265 | - { | |
| 2266 | - 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; | |
| 2267 | - 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; | |
| 2268 | - | |
| 2269 | - })]; | |
| 2270 | - | |
| 2271 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 2272 | - { | |
| 2273 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 2274 | - | |
| 2275 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 2276 | - }, function(bounds, pt) | |
| 2277 | - { | |
| 2278 | - 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; | |
| 2279 | - }); | |
| 2086 | +Graph.handleFactory[mxShapeArrows2TailedNotchedArrow.prototype.cst.TAILED_NOTCHED_ARROW] = function (state) { | |
| 2087 | + var handles = [Graph.createHandle(state, ['dx1', 'dy1'], function (bounds) { | |
| 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)))); | |
| 2091 | + | |
| 2092 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1); | |
| 2093 | + }, function (bounds, pt) { | |
| 2094 | + 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; | |
| 2095 | + 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; | |
| 2096 | + | |
| 2097 | + })]; | |
| 2098 | + | |
| 2099 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 2100 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 2101 | + | |
| 2102 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 2103 | + }, function (bounds, pt) { | |
| 2104 | + 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; | |
| 2105 | + }); | |
| 2280 | 2106 | |
| 2281 | 2107 | handles.push(handle2); |
| 2282 | - | |
| 2283 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 2284 | - { | |
| 2285 | - var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 2286 | - var dy1 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 2287 | - var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2288 | - | |
| 2289 | - return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1 - arrowHead); | |
| 2290 | - }, function(bounds, pt) | |
| 2291 | - { | |
| 2292 | - 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; | |
| 2293 | - }); | |
| 2108 | + | |
| 2109 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 2110 | + var dx1 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); | |
| 2111 | + var dy1 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); | |
| 2112 | + var arrowHead = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2113 | + | |
| 2114 | + return new mxPoint(bounds.x + bounds.width - dx1, bounds.y + bounds.height / 2 - dy1 - arrowHead); | |
| 2115 | + }, function (bounds, pt) { | |
| 2116 | + 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; | |
| 2117 | + }); | |
| 2294 | 2118 | |
| 2295 | 2119 | handles.push(handle3); |
| 2296 | - | |
| 2297 | - var handle4 = Graph.createHandle(state, ['dx2', 'dy2'], function(bounds) | |
| 2298 | - { | |
| 2299 | - var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 2300 | - var dy2 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)))); | |
| 2301 | - | |
| 2302 | - return new mxPoint(bounds.x + dx2, bounds.y + bounds.height / 2 - dy2); | |
| 2303 | - }, function(bounds, pt) | |
| 2304 | - { | |
| 2305 | - 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; | |
| 2306 | - 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; | |
| 2307 | - | |
| 2308 | - }); | |
| 2120 | + | |
| 2121 | + var handle4 = Graph.createHandle(state, ['dx2', 'dy2'], function (bounds) { | |
| 2122 | + var dx2 = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 2123 | + var dy2 = Math.max(0, Math.min(bounds.height / 2, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)))); | |
| 2124 | + | |
| 2125 | + return new mxPoint(bounds.x + dx2, bounds.y + bounds.height / 2 - dy2); | |
| 2126 | + }, function (bounds, pt) { | |
| 2127 | + 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; | |
| 2128 | + 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; | |
| 2129 | + | |
| 2130 | + }); | |
| 2309 | 2131 | |
| 2310 | 2132 | handles.push(handle4); |
| 2311 | 2133 | |
| 2312 | 2134 | return handles; |
| 2313 | 2135 | }; |
| 2314 | 2136 | |
| 2315 | -mxShapeArrows2TailedNotchedArrow.prototype.getConstraints = function(style, w, h) | |
| 2316 | -{ | |
| 2137 | +mxShapeArrows2TailedNotchedArrow.prototype.getConstraints = function (style, w, h) { | |
| 2317 | 2138 | var constr = []; |
| 2318 | 2139 | var dy1 = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 2319 | 2140 | var dx1 = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| ... | ... | @@ -2322,9 +2143,8 @@ mxShapeArrows2TailedNotchedArrow.prototype.getConstraints = function(style, w, h |
| 2322 | 2143 | var notch = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'notch', this.notch)))); |
| 2323 | 2144 | var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 2324 | 2145 | var x2 = 0; |
| 2325 | - | |
| 2326 | - if (dy2 != 0) | |
| 2327 | - { | |
| 2146 | + | |
| 2147 | + if (dy2 != 0) { | |
| 2328 | 2148 | x2 = dx2 + notch * (dy2 - dy1) / dy2; |
| 2329 | 2149 | } |
| 2330 | 2150 | |
| ... | ... | @@ -2338,7 +2158,7 @@ mxShapeArrows2TailedNotchedArrow.prototype.getConstraints = function(style, w, h |
| 2338 | 2158 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx1 + x2) * 0.5, h * 0.5 + dy1)); |
| 2339 | 2159 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx1, h * 0.5 + dy1 + arrowHead)); |
| 2340 | 2160 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false)); |
| 2341 | - | |
| 2161 | + | |
| 2342 | 2162 | return (constr); |
| 2343 | 2163 | }; |
| 2344 | 2164 | |
| ... | ... | @@ -2348,8 +2168,7 @@ mxShapeArrows2TailedNotchedArrow.prototype.getConstraints = function(style, w, h |
| 2348 | 2168 | /** |
| 2349 | 2169 | * Extends mxShape. |
| 2350 | 2170 | */ |
| 2351 | -function mxShapeArrows2StripedArrow(bounds, fill, stroke, strokewidth) | |
| 2352 | -{ | |
| 2171 | +function mxShapeArrows2StripedArrow(bounds, fill, stroke, strokewidth) { | |
| 2353 | 2172 | mxShape.call(this); |
| 2354 | 2173 | this.bounds = bounds; |
| 2355 | 2174 | this.fill = fill; |
| ... | ... | @@ -2366,13 +2185,13 @@ function mxShapeArrows2StripedArrow(bounds, fill, stroke, strokewidth) |
| 2366 | 2185 | mxUtils.extend(mxShapeArrows2StripedArrow, mxActor); |
| 2367 | 2186 | |
| 2368 | 2187 | mxShapeArrows2StripedArrow.prototype.customProperties = [ |
| 2369 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:40}, | |
| 2370 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, max:1, defVal:0.6}, | |
| 2371 | - {name: 'notch', dispName: 'Stripes Length', type: 'float', min:0, defVal:25} | |
| 2188 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 40 }, | |
| 2189 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, max: 1, defVal: 0.6 }, | |
| 2190 | + { name: 'notch', dispName: 'Stripes Length', type: 'float', min: 0, defVal: 25 } | |
| 2372 | 2191 | ]; |
| 2373 | 2192 | |
| 2374 | 2193 | mxShapeArrows2StripedArrow.prototype.cst = { |
| 2375 | - STRIPED_ARROW : 'mxgraph.arrows2.stripedArrow' | |
| 2194 | + STRIPED_ARROW: 'mxgraph.arrows2.stripedArrow' | |
| 2376 | 2195 | }; |
| 2377 | 2196 | |
| 2378 | 2197 | /** |
| ... | ... | @@ -2380,8 +2199,7 @@ mxShapeArrows2StripedArrow.prototype.cst = { |
| 2380 | 2199 | * |
| 2381 | 2200 | * Paints the vertex shape. |
| 2382 | 2201 | */ |
| 2383 | -mxShapeArrows2StripedArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2384 | -{ | |
| 2202 | +mxShapeArrows2StripedArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2385 | 2203 | c.translate(x, y); |
| 2386 | 2204 | |
| 2387 | 2205 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -2414,37 +2232,31 @@ mxCellRenderer.registerShape(mxShapeArrows2StripedArrow.prototype.cst.STRIPED_AR |
| 2414 | 2232 | |
| 2415 | 2233 | mxShapeArrows2StripedArrow.prototype.constraints = null; |
| 2416 | 2234 | |
| 2417 | -Graph.handleFactory[mxShapeArrows2StripedArrow.prototype.cst.STRIPED_ARROW] = function(state) | |
| 2418 | -{ | |
| 2419 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 2420 | - { | |
| 2421 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 2422 | - var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2423 | - | |
| 2424 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 2425 | - }, function(bounds, pt) | |
| 2426 | - { | |
| 2427 | - 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; | |
| 2428 | - this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 2429 | - })]; | |
| 2430 | - | |
| 2431 | - var handle2 = Graph.createHandle(state, ['notch'], function(bounds) | |
| 2432 | - { | |
| 2433 | - var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 2434 | - | |
| 2435 | - return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 2436 | - }, function(bounds, pt) | |
| 2437 | - { | |
| 2438 | - 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; | |
| 2439 | - }); | |
| 2440 | - | |
| 2235 | +Graph.handleFactory[mxShapeArrows2StripedArrow.prototype.cst.STRIPED_ARROW] = function (state) { | |
| 2236 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 2237 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 2238 | + var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2239 | + | |
| 2240 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + dy * bounds.height / 2); | |
| 2241 | + }, function (bounds, pt) { | |
| 2242 | + 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; | |
| 2243 | + this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (((pt.y - bounds.y) / bounds.height) * 2)))) / 100; | |
| 2244 | + })]; | |
| 2245 | + | |
| 2246 | + var handle2 = Graph.createHandle(state, ['notch'], function (bounds) { | |
| 2247 | + var notch = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'notch', this.notch)))); | |
| 2248 | + | |
| 2249 | + return new mxPoint(bounds.x + notch, bounds.y + bounds.height / 2); | |
| 2250 | + }, function (bounds, pt) { | |
| 2251 | + 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; | |
| 2252 | + }); | |
| 2253 | + | |
| 2441 | 2254 | handles.push(handle2); |
| 2442 | - | |
| 2255 | + | |
| 2443 | 2256 | return handles; |
| 2444 | 2257 | }; |
| 2445 | 2258 | |
| 2446 | -mxShapeArrows2StripedArrow.prototype.getConstraints = function(style, w, h) | |
| 2447 | -{ | |
| 2259 | +mxShapeArrows2StripedArrow.prototype.getConstraints = function (style, w, h) { | |
| 2448 | 2260 | var constr = []; |
| 2449 | 2261 | var dy = h * 0.5 * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 2450 | 2262 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -2460,7 +2272,7 @@ mxShapeArrows2StripedArrow.prototype.getConstraints = function(style, w, h) |
| 2460 | 2272 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, h)); |
| 2461 | 2273 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, dy)); |
| 2462 | 2274 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, h - dy)); |
| 2463 | - | |
| 2275 | + | |
| 2464 | 2276 | return (constr); |
| 2465 | 2277 | }; |
| 2466 | 2278 | |
| ... | ... | @@ -2470,8 +2282,7 @@ mxShapeArrows2StripedArrow.prototype.getConstraints = function(style, w, h) |
| 2470 | 2282 | /** |
| 2471 | 2283 | * Extends mxShape. |
| 2472 | 2284 | */ |
| 2473 | -function mxShapeArrows2JumpInArrow(bounds, fill, stroke, strokewidth) | |
| 2474 | -{ | |
| 2285 | +function mxShapeArrows2JumpInArrow(bounds, fill, stroke, strokewidth) { | |
| 2475 | 2286 | mxShape.call(this); |
| 2476 | 2287 | this.bounds = bounds; |
| 2477 | 2288 | this.fill = fill; |
| ... | ... | @@ -2488,13 +2299,13 @@ function mxShapeArrows2JumpInArrow(bounds, fill, stroke, strokewidth) |
| 2488 | 2299 | mxUtils.extend(mxShapeArrows2JumpInArrow, mxActor); |
| 2489 | 2300 | |
| 2490 | 2301 | mxShapeArrows2JumpInArrow.prototype.customProperties = [ |
| 2491 | - {name: 'dx', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:38}, | |
| 2492 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:15}, | |
| 2493 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:55} | |
| 2302 | + { name: 'dx', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 38 }, | |
| 2303 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 15 }, | |
| 2304 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 55 } | |
| 2494 | 2305 | ]; |
| 2495 | 2306 | |
| 2496 | 2307 | mxShapeArrows2JumpInArrow.prototype.cst = { |
| 2497 | - JUMP_IN_ARROW : 'mxgraph.arrows2.jumpInArrow' | |
| 2308 | + JUMP_IN_ARROW: 'mxgraph.arrows2.jumpInArrow' | |
| 2498 | 2309 | }; |
| 2499 | 2310 | |
| 2500 | 2311 | /** |
| ... | ... | @@ -2502,8 +2313,7 @@ mxShapeArrows2JumpInArrow.prototype.cst = { |
| 2502 | 2313 | * |
| 2503 | 2314 | * Paints the vertex shape. |
| 2504 | 2315 | */ |
| 2505 | -mxShapeArrows2JumpInArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2506 | -{ | |
| 2316 | +mxShapeArrows2JumpInArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2507 | 2317 | c.translate(x, y); |
| 2508 | 2318 | |
| 2509 | 2319 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -2525,40 +2335,34 @@ mxCellRenderer.registerShape(mxShapeArrows2JumpInArrow.prototype.cst.JUMP_IN_ARR |
| 2525 | 2335 | |
| 2526 | 2336 | mxShapeArrows2JumpInArrow.prototype.constraints = null; |
| 2527 | 2337 | |
| 2528 | -Graph.handleFactory[mxShapeArrows2JumpInArrow.prototype.cst.JUMP_IN_ARROW] = function(state) | |
| 2529 | -{ | |
| 2530 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 2531 | - { | |
| 2532 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2533 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 2534 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2535 | - | |
| 2536 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy); | |
| 2537 | - }, function(bounds, pt) | |
| 2538 | - { | |
| 2539 | - this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width, bounds.x + bounds.width - pt.x))) / 100; | |
| 2540 | - 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; | |
| 2541 | - | |
| 2542 | - })]; | |
| 2543 | - | |
| 2544 | - var handle2 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 2545 | - { | |
| 2546 | - var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 2547 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2548 | - | |
| 2549 | - return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead); | |
| 2550 | - }, function(bounds, pt) | |
| 2551 | - { | |
| 2552 | - 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; | |
| 2553 | - }); | |
| 2554 | - | |
| 2338 | +Graph.handleFactory[mxShapeArrows2JumpInArrow.prototype.cst.JUMP_IN_ARROW] = function (state) { | |
| 2339 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 2340 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2341 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 2342 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2343 | + | |
| 2344 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead / 2 - dy); | |
| 2345 | + }, function (bounds, pt) { | |
| 2346 | + this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.width, bounds.x + bounds.width - pt.x))) / 100; | |
| 2347 | + 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; | |
| 2348 | + | |
| 2349 | + })]; | |
| 2350 | + | |
| 2351 | + var handle2 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 2352 | + var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); | |
| 2353 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2354 | + | |
| 2355 | + return new mxPoint(bounds.x + bounds.width - dx, bounds.y + arrowHead); | |
| 2356 | + }, function (bounds, pt) { | |
| 2357 | + 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; | |
| 2358 | + }); | |
| 2359 | + | |
| 2555 | 2360 | handles.push(handle2); |
| 2556 | 2361 | |
| 2557 | 2362 | return handles; |
| 2558 | 2363 | }; |
| 2559 | 2364 | |
| 2560 | -mxShapeArrows2JumpInArrow.prototype.getConstraints = function(style, w, h) | |
| 2561 | -{ | |
| 2365 | +mxShapeArrows2JumpInArrow.prototype.getConstraints = function (style, w, h) { | |
| 2562 | 2366 | var constr = []; |
| 2563 | 2367 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 2564 | 2368 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -2568,7 +2372,7 @@ mxShapeArrows2JumpInArrow.prototype.getConstraints = function(style, w, h) |
| 2568 | 2372 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, 0)); |
| 2569 | 2373 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, arrowHead * 0.5)); |
| 2570 | 2374 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, arrowHead)); |
| 2571 | - | |
| 2375 | + | |
| 2572 | 2376 | return (constr); |
| 2573 | 2377 | }; |
| 2574 | 2378 | |
| ... | ... | @@ -2578,8 +2382,7 @@ mxShapeArrows2JumpInArrow.prototype.getConstraints = function(style, w, h) |
| 2578 | 2382 | /** |
| 2579 | 2383 | * Extends mxShape. |
| 2580 | 2384 | */ |
| 2581 | -function mxShapeArrows2UTurnArrow(bounds, fill, stroke, strokewidth) | |
| 2582 | -{ | |
| 2385 | +function mxShapeArrows2UTurnArrow(bounds, fill, stroke, strokewidth) { | |
| 2583 | 2386 | mxShape.call(this); |
| 2584 | 2387 | this.bounds = bounds; |
| 2585 | 2388 | this.fill = fill; |
| ... | ... | @@ -2596,13 +2399,13 @@ function mxShapeArrows2UTurnArrow(bounds, fill, stroke, strokewidth) |
| 2596 | 2399 | mxUtils.extend(mxShapeArrows2UTurnArrow, mxActor); |
| 2597 | 2400 | |
| 2598 | 2401 | mxShapeArrows2UTurnArrow.prototype.customProperties = [ |
| 2599 | - {name: 'dx2', dispName: 'Arrowhead Length', type: 'float', min:0, defVal:25}, | |
| 2600 | - {name: 'dy', dispName: 'Arrow Width', type: 'float', min:0, defVal:11}, | |
| 2601 | - {name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min:0, defVal:43} | |
| 2402 | + { name: 'dx2', dispName: 'Arrowhead Length', type: 'float', min: 0, defVal: 25 }, | |
| 2403 | + { name: 'dy', dispName: 'Arrow Width', type: 'float', min: 0, defVal: 11 }, | |
| 2404 | + { name: 'arrowHead', dispName: 'Arrowhead Width', type: 'float', min: 0, defVal: 43 } | |
| 2602 | 2405 | ]; |
| 2603 | 2406 | |
| 2604 | 2407 | mxShapeArrows2UTurnArrow.prototype.cst = { |
| 2605 | - U_TURN_ARROW : 'mxgraph.arrows2.uTurnArrow' | |
| 2408 | + U_TURN_ARROW: 'mxgraph.arrows2.uTurnArrow' | |
| 2606 | 2409 | }; |
| 2607 | 2410 | |
| 2608 | 2411 | /** |
| ... | ... | @@ -2610,15 +2413,14 @@ mxShapeArrows2UTurnArrow.prototype.cst = { |
| 2610 | 2413 | * |
| 2611 | 2414 | * Paints the vertex shape. |
| 2612 | 2415 | */ |
| 2613 | -mxShapeArrows2UTurnArrow.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2614 | -{ | |
| 2416 | +mxShapeArrows2UTurnArrow.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2615 | 2417 | c.translate(x, y); |
| 2616 | 2418 | |
| 2617 | 2419 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 2618 | 2420 | var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 2619 | 2421 | var dx = (h - arrowHead / 2 + dy) / 2; |
| 2620 | 2422 | var dx2 = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))); |
| 2621 | - | |
| 2423 | + | |
| 2622 | 2424 | c.begin(); |
| 2623 | 2425 | c.moveTo(dx, 0); |
| 2624 | 2426 | c.lineTo(dx + dx2, arrowHead * 0.5); |
| ... | ... | @@ -2637,65 +2439,57 @@ mxCellRenderer.registerShape(mxShapeArrows2UTurnArrow.prototype.cst.U_TURN_ARROW |
| 2637 | 2439 | |
| 2638 | 2440 | mxShapeArrows2UTurnArrow.prototype.constraints = null; |
| 2639 | 2441 | |
| 2640 | -Graph.handleFactory[mxShapeArrows2UTurnArrow.prototype.cst.U_TURN_ARROW] = function(state) | |
| 2641 | -{ | |
| 2642 | - var handles = [Graph.createHandle(state, ['dy'], function(bounds) | |
| 2643 | - { | |
| 2644 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2645 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2646 | - var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2647 | - | |
| 2648 | - return new mxPoint(bounds.x + dx, bounds.y + arrowHead / 2 - dy); | |
| 2649 | - }, function(bounds, pt) | |
| 2650 | - { | |
| 2651 | - 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; | |
| 2652 | - | |
| 2653 | - })]; | |
| 2654 | - | |
| 2655 | - var handle2 = Graph.createHandle(state, ['dx2'], function(bounds) | |
| 2656 | - { | |
| 2657 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2658 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2659 | - var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2660 | - | |
| 2661 | - var dx2 = Math.max(0, Math.min(bounds.width - dx, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 2662 | - | |
| 2663 | - return new mxPoint(bounds.x + dx + dx2, bounds.y + arrowHead / 2); | |
| 2664 | - }, function(bounds, pt) | |
| 2665 | - { | |
| 2666 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2667 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2668 | - var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2669 | - this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(Math.max(bounds.width, dx), pt.x - bounds.x - dx))) / 100; | |
| 2670 | - }); | |
| 2671 | - | |
| 2442 | +Graph.handleFactory[mxShapeArrows2UTurnArrow.prototype.cst.U_TURN_ARROW] = function (state) { | |
| 2443 | + var handles = [Graph.createHandle(state, ['dy'], function (bounds) { | |
| 2444 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2445 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2446 | + var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2447 | + | |
| 2448 | + return new mxPoint(bounds.x + dx, bounds.y + arrowHead / 2 - dy); | |
| 2449 | + }, function (bounds, pt) { | |
| 2450 | + 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; | |
| 2451 | + | |
| 2452 | + })]; | |
| 2453 | + | |
| 2454 | + var handle2 = Graph.createHandle(state, ['dx2'], function (bounds) { | |
| 2455 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2456 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2457 | + var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2458 | + | |
| 2459 | + var dx2 = Math.max(0, Math.min(bounds.width - dx, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); | |
| 2460 | + | |
| 2461 | + return new mxPoint(bounds.x + dx + dx2, bounds.y + arrowHead / 2); | |
| 2462 | + }, function (bounds, pt) { | |
| 2463 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2464 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2465 | + var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2466 | + this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(Math.max(bounds.width, dx), pt.x - bounds.x - dx))) / 100; | |
| 2467 | + }); | |
| 2468 | + | |
| 2672 | 2469 | handles.push(handle2); |
| 2673 | 2470 | |
| 2674 | - var handle3 = Graph.createHandle(state, ['arrowHead'], function(bounds) | |
| 2675 | - { | |
| 2676 | - var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2677 | - var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2678 | - var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2679 | - | |
| 2680 | - return new mxPoint(bounds.x + dx, bounds.y + arrowHead); | |
| 2681 | - }, function(bounds, pt) | |
| 2682 | - { | |
| 2683 | - 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; | |
| 2684 | - }); | |
| 2685 | - | |
| 2471 | + var handle3 = Graph.createHandle(state, ['arrowHead'], function (bounds) { | |
| 2472 | + var arrowHead = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'arrowHead', this.arrowHead)))); | |
| 2473 | + var dy = Math.max(0, Math.min(arrowHead, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); | |
| 2474 | + var dx = (bounds.height - arrowHead / 2 + dy) / 2; | |
| 2475 | + | |
| 2476 | + return new mxPoint(bounds.x + dx, bounds.y + arrowHead); | |
| 2477 | + }, function (bounds, pt) { | |
| 2478 | + 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; | |
| 2479 | + }); | |
| 2480 | + | |
| 2686 | 2481 | handles.push(handle3); |
| 2687 | 2482 | |
| 2688 | 2483 | return handles; |
| 2689 | 2484 | }; |
| 2690 | 2485 | |
| 2691 | -mxShapeArrows2UTurnArrow.prototype.getConstraints = function(style, w, h) | |
| 2692 | -{ | |
| 2486 | +mxShapeArrows2UTurnArrow.prototype.getConstraints = function (style, w, h) { | |
| 2693 | 2487 | var constr = []; |
| 2694 | 2488 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 2695 | 2489 | var arrowHead = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'arrowHead', this.arrowHead)))); |
| 2696 | 2490 | var dx = (h - arrowHead / 2 + dy) / 2; |
| 2697 | 2491 | var dx2 = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2))); |
| 2698 | - | |
| 2492 | + | |
| 2699 | 2493 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, 0)); |
| 2700 | 2494 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx + dx2, arrowHead * 0.5)); |
| 2701 | 2495 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, arrowHead)); |
| ... | ... | @@ -2707,15 +2501,14 @@ mxShapeArrows2UTurnArrow.prototype.getConstraints = function(style, w, h) |
| 2707 | 2501 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, h)); |
| 2708 | 2502 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h + arrowHead * 0.5 - dy) * 0.5)); |
| 2709 | 2503 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, arrowHead - 2 * dy, (h + arrowHead * 0.5 - dy) * 0.5)); |
| 2710 | - | |
| 2504 | + | |
| 2711 | 2505 | return (constr); |
| 2712 | 2506 | }; |
| 2713 | 2507 | |
| 2714 | 2508 | //********************************************************************************************************************************************************** |
| 2715 | 2509 | //Wedge Arrow |
| 2716 | 2510 | //********************************************************************************************************************************************************** |
| 2717 | -function mxShapeArrowsWedgeArrow() | |
| 2718 | -{ | |
| 2511 | +function mxShapeArrowsWedgeArrow() { | |
| 2719 | 2512 | mxArrow.call(this); |
| 2720 | 2513 | }; |
| 2721 | 2514 | |
| ... | ... | @@ -2724,11 +2517,10 @@ mxUtils.extend(mxShapeArrowsWedgeArrow, mxArrow); |
| 2724 | 2517 | mxShapeArrowsWedgeArrow.prototype.useSvgBoundingBox = true; |
| 2725 | 2518 | |
| 2726 | 2519 | mxShapeArrowsWedgeArrow.prototype.customProperties = [ |
| 2727 | - {name: 'startWidth', dispName: 'Wedge Width', type: 'float', min:0, defVal:25} | |
| 2520 | + { name: 'startWidth', dispName: 'Wedge Width', type: 'float', min: 0, defVal: 25 } | |
| 2728 | 2521 | ]; |
| 2729 | 2522 | |
| 2730 | -mxShapeArrowsWedgeArrow.prototype.paintEdgeShape = function(c, pts) | |
| 2731 | -{ | |
| 2523 | +mxShapeArrowsWedgeArrow.prototype.paintEdgeShape = function (c, pts) { | |
| 2732 | 2524 | var sw = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'startWidth', 20))); |
| 2733 | 2525 | |
| 2734 | 2526 | // Base vector (between end points) |
| ... | ... | @@ -2737,7 +2529,7 @@ mxShapeArrowsWedgeArrow.prototype.paintEdgeShape = function(c, pts) |
| 2737 | 2529 | |
| 2738 | 2530 | var dx = pe.x - p0.x; |
| 2739 | 2531 | var dy = pe.y - p0.y; |
| 2740 | - var dist = Math.sqrt(dx * dx + dy * dy); | |
| 2532 | + var dist = Math.sqrt(dx * dx + dy * dy); | |
| 2741 | 2533 | var nx = dx * sw / dist; |
| 2742 | 2534 | var ny = dy * sw / dist; |
| 2743 | 2535 | |
| ... | ... | @@ -2754,8 +2546,7 @@ mxCellRenderer.registerShape('mxgraph.arrows2.wedgeArrow', mxShapeArrowsWedgeArr |
| 2754 | 2546 | //********************************************************************************************************************************************************** |
| 2755 | 2547 | //Wedge Arrow Dashed |
| 2756 | 2548 | //********************************************************************************************************************************************************** |
| 2757 | -function mxShapeArrowsWedgeArrowDashed() | |
| 2758 | -{ | |
| 2549 | +function mxShapeArrowsWedgeArrowDashed() { | |
| 2759 | 2550 | mxArrowConnector.call(this); |
| 2760 | 2551 | }; |
| 2761 | 2552 | |
| ... | ... | @@ -2764,11 +2555,10 @@ mxUtils.extend(mxShapeArrowsWedgeArrowDashed, mxArrow); |
| 2764 | 2555 | mxShapeArrowsWedgeArrowDashed.prototype.useSvgBoundingBox = true; |
| 2765 | 2556 | |
| 2766 | 2557 | mxShapeArrowsWedgeArrowDashed.prototype.customProperties = [ |
| 2767 | - {name: 'startWidth', dispName: 'Wedge Width', type: 'float', min:0, defVal:25} | |
| 2558 | + { name: 'startWidth', dispName: 'Wedge Width', type: 'float', min: 0, defVal: 25 } | |
| 2768 | 2559 | ]; |
| 2769 | 2560 | |
| 2770 | -mxShapeArrowsWedgeArrowDashed.prototype.paintEdgeShape = function(c, pts) | |
| 2771 | -{ | |
| 2561 | +mxShapeArrowsWedgeArrowDashed.prototype.paintEdgeShape = function (c, pts) { | |
| 2772 | 2562 | var startWidth = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'startWidth', 20))); |
| 2773 | 2563 | var steps = 8; |
| 2774 | 2564 | // Base vector (between end points) |
| ... | ... | @@ -2777,7 +2567,7 @@ mxShapeArrowsWedgeArrowDashed.prototype.paintEdgeShape = function(c, pts) |
| 2777 | 2567 | |
| 2778 | 2568 | var dx = pe.x - p0.x; |
| 2779 | 2569 | var dy = pe.y - p0.y; |
| 2780 | - var dist = Math.sqrt(dx * dx + dy * dy); | |
| 2570 | + var dist = Math.sqrt(dx * dx + dy * dy); | |
| 2781 | 2571 | var nx = dx * startWidth / dist; |
| 2782 | 2572 | var ny = dy * startWidth / dist; |
| 2783 | 2573 | var cnx = nx; // current nx |
| ... | ... | @@ -2786,30 +2576,28 @@ mxShapeArrowsWedgeArrowDashed.prototype.paintEdgeShape = function(c, pts) |
| 2786 | 2576 | var pcy = p0.y; // current y on edge |
| 2787 | 2577 | |
| 2788 | 2578 | c.begin(); |
| 2789 | - | |
| 2790 | - for (var i = 0; i <= steps; i++) | |
| 2791 | - { | |
| 2579 | + | |
| 2580 | + for (var i = 0; i <= steps; i++) { | |
| 2792 | 2581 | cnx = nx * (steps - i) / steps; |
| 2793 | 2582 | cny = ny * (steps - i) / steps; |
| 2794 | 2583 | |
| 2795 | - if (i == steps) | |
| 2796 | - { | |
| 2584 | + if (i == steps) { | |
| 2797 | 2585 | cnx = nx * (steps - i * 0.98) / steps; |
| 2798 | 2586 | cny = ny * (steps - i * 0.98) / steps; |
| 2799 | 2587 | } |
| 2800 | - | |
| 2588 | + | |
| 2801 | 2589 | var px1 = pcx + cny; |
| 2802 | 2590 | var py1 = pcy - cnx; |
| 2803 | 2591 | var px2 = pcx - cny; |
| 2804 | 2592 | var py2 = pcy + cnx; |
| 2805 | - | |
| 2593 | + | |
| 2806 | 2594 | c.moveTo(px1, py1); |
| 2807 | 2595 | c.lineTo(px2, py2); |
| 2808 | - | |
| 2596 | + | |
| 2809 | 2597 | pcx = pcx + dx / steps; |
| 2810 | 2598 | pcy = pcy + dy / steps; |
| 2811 | - } | |
| 2812 | - | |
| 2599 | + } | |
| 2600 | + | |
| 2813 | 2601 | c.stroke(); |
| 2814 | 2602 | }; |
| 2815 | 2603 | |
| ... | ... | @@ -2818,8 +2606,7 @@ mxCellRenderer.registerShape('mxgraph.arrows2.wedgeArrowDashed', mxShapeArrowsWe |
| 2818 | 2606 | //********************************************************************************************************************************************************** |
| 2819 | 2607 | //Wedge Arrow Dashed v2 |
| 2820 | 2608 | //********************************************************************************************************************************************************** |
| 2821 | -function mxShapeArrowsWedgeArrowDashed2() | |
| 2822 | -{ | |
| 2609 | +function mxShapeArrowsWedgeArrowDashed2() { | |
| 2823 | 2610 | mxArrowConnector.call(this); |
| 2824 | 2611 | }; |
| 2825 | 2612 | |
| ... | ... | @@ -2828,12 +2615,11 @@ mxUtils.extend(mxShapeArrowsWedgeArrowDashed2, mxArrow); |
| 2828 | 2615 | mxShapeArrowsWedgeArrowDashed2.prototype.useSvgBoundingBox = true; |
| 2829 | 2616 | |
| 2830 | 2617 | mxShapeArrowsWedgeArrowDashed2.prototype.customProperties = [ |
| 2831 | - {name: 'startWidth', dispName: 'Wedge Width', type: 'float', min:0, defVal:25}, | |
| 2832 | - {name: 'stepSize', dispName: 'Step Size', type: 'float', min:0, defVal:25} | |
| 2618 | + { name: 'startWidth', dispName: 'Wedge Width', type: 'float', min: 0, defVal: 25 }, | |
| 2619 | + { name: 'stepSize', dispName: 'Step Size', type: 'float', min: 0, defVal: 25 } | |
| 2833 | 2620 | ]; |
| 2834 | 2621 | |
| 2835 | -mxShapeArrowsWedgeArrowDashed2.prototype.paintEdgeShape = function(c, pts) | |
| 2836 | -{ | |
| 2622 | +mxShapeArrowsWedgeArrowDashed2.prototype.paintEdgeShape = function (c, pts) { | |
| 2837 | 2623 | var startWidth = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'startWidth', 20))); |
| 2838 | 2624 | var stepSize = Math.max(0, parseFloat(mxUtils.getValue(this.style, 'stepSize', 10))); |
| 2839 | 2625 | |
| ... | ... | @@ -2843,7 +2629,7 @@ mxShapeArrowsWedgeArrowDashed2.prototype.paintEdgeShape = function(c, pts) |
| 2843 | 2629 | |
| 2844 | 2630 | var dx = pe.x - p0.x; |
| 2845 | 2631 | var dy = pe.y - p0.y; |
| 2846 | - var dist = Math.sqrt(dx * dx + dy * dy); | |
| 2632 | + var dist = Math.sqrt(dx * dx + dy * dy); | |
| 2847 | 2633 | var nx = dx * startWidth / dist; |
| 2848 | 2634 | var ny = dy * startWidth / dist; |
| 2849 | 2635 | var cnx = nx; // current nx |
| ... | ... | @@ -2853,30 +2639,28 @@ mxShapeArrowsWedgeArrowDashed2.prototype.paintEdgeShape = function(c, pts) |
| 2853 | 2639 | var steps = Math.floor(dist / stepSize); |
| 2854 | 2640 | |
| 2855 | 2641 | c.begin(); |
| 2856 | - | |
| 2857 | - for (var i = 0; i <= steps; i++) | |
| 2858 | - { | |
| 2642 | + | |
| 2643 | + for (var i = 0; i <= steps; i++) { | |
| 2859 | 2644 | cnx = nx * (steps - i) / steps; |
| 2860 | 2645 | cny = ny * (steps - i) / steps; |
| 2861 | 2646 | |
| 2862 | - if (i == steps) | |
| 2863 | - { | |
| 2647 | + if (i == steps) { | |
| 2864 | 2648 | cnx = nx * (steps - i * 0.98) / steps; |
| 2865 | 2649 | cny = ny * (steps - i * 0.98) / steps; |
| 2866 | 2650 | } |
| 2867 | - | |
| 2651 | + | |
| 2868 | 2652 | var px1 = pcx + cny; |
| 2869 | 2653 | var py1 = pcy - cnx; |
| 2870 | 2654 | var px2 = pcx - cny; |
| 2871 | 2655 | var py2 = pcy + cnx; |
| 2872 | - | |
| 2656 | + | |
| 2873 | 2657 | c.moveTo(px1, py1); |
| 2874 | 2658 | c.lineTo(px2, py2); |
| 2875 | - | |
| 2659 | + | |
| 2876 | 2660 | pcx = pcx + dx / steps; |
| 2877 | 2661 | pcy = pcy + dy / steps; |
| 2878 | - } | |
| 2879 | - | |
| 2662 | + } | |
| 2663 | + | |
| 2880 | 2664 | c.stroke(); |
| 2881 | 2665 | }; |
| 2882 | 2666 | ... | ... |
| ... | ... | @@ -8,8 +8,7 @@ |
| 8 | 8 | /** |
| 9 | 9 | * Extends mxShape. |
| 10 | 10 | */ |
| 11 | -function mxShapeBasicCross(bounds, fill, stroke, strokewidth) | |
| 12 | -{ | |
| 11 | +function mxShapeBasicCross(bounds, fill, stroke, strokewidth) { | |
| 13 | 12 | mxShape.call(this); |
| 14 | 13 | this.bounds = bounds; |
| 15 | 14 | this.fill = fill; |
| ... | ... | @@ -23,15 +22,14 @@ function mxShapeBasicCross(bounds, fill, stroke, strokewidth) |
| 23 | 22 | */ |
| 24 | 23 | mxUtils.extend(mxShapeBasicCross, mxActor); |
| 25 | 24 | |
| 26 | -mxShapeBasicCross.prototype.cst = {CROSS : 'mxgraph.basic.cross2'}; | |
| 25 | +mxShapeBasicCross.prototype.cst = { CROSS: 'mxgraph.basic.cross2' }; | |
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * Function: paintVertexShape |
| 30 | 29 | * |
| 31 | 30 | * Paints the vertex shape. |
| 32 | 31 | */ |
| 33 | -mxShapeBasicCross.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 34 | -{ | |
| 32 | +mxShapeBasicCross.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 35 | 33 | c.translate(x, y); |
| 36 | 34 | |
| 37 | 35 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -57,18 +55,15 @@ mxCellRenderer.registerShape(mxShapeBasicCross.prototype.cst.CROSS, mxShapeBasic |
| 57 | 55 | |
| 58 | 56 | mxShapeBasicCross.prototype.constraints = null; |
| 59 | 57 | |
| 60 | -Graph.handleFactory[mxShapeBasicCross.prototype.cst.CROSS] = function(state) | |
| 61 | -{ | |
| 62 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 63 | - { | |
| 58 | +Graph.handleFactory[mxShapeBasicCross.prototype.cst.CROSS] = function (state) { | |
| 59 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 64 | 60 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 65 | 61 | |
| 66 | 62 | return new mxPoint(bounds.x + bounds.width / 2 + dx, bounds.y + bounds.height / 2 - dx); |
| 67 | - }, function(bounds, pt) | |
| 68 | - { | |
| 63 | + }, function (bounds, pt) { | |
| 69 | 64 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x - bounds.width / 2))) / 100; |
| 70 | 65 | })]; |
| 71 | - | |
| 66 | + | |
| 72 | 67 | return handles; |
| 73 | 68 | }; |
| 74 | 69 | |
| ... | ... | @@ -78,8 +73,7 @@ Graph.handleFactory[mxShapeBasicCross.prototype.cst.CROSS] = function(state) |
| 78 | 73 | /** |
| 79 | 74 | * Extends mxShape. |
| 80 | 75 | */ |
| 81 | -function mxShapeBasicRectCallout(bounds, fill, stroke, strokewidth) | |
| 82 | -{ | |
| 76 | +function mxShapeBasicRectCallout(bounds, fill, stroke, strokewidth) { | |
| 83 | 77 | mxShape.call(this); |
| 84 | 78 | this.bounds = bounds; |
| 85 | 79 | this.fill = fill; |
| ... | ... | @@ -95,19 +89,18 @@ function mxShapeBasicRectCallout(bounds, fill, stroke, strokewidth) |
| 95 | 89 | mxUtils.extend(mxShapeBasicRectCallout, mxActor); |
| 96 | 90 | |
| 97 | 91 | mxShapeBasicRectCallout.prototype.customProperties = [ |
| 98 | - {name: 'dx', dispName: 'Callout Position', type: 'float', min:0, defVal:30}, | |
| 99 | - {name: 'dy', dispName: 'Callout Size', type: 'float', min:0, defVal:15} | |
| 92 | + { name: 'dx', dispName: 'Callout Position', type: 'float', min: 0, defVal: 30 }, | |
| 93 | + { name: 'dy', dispName: 'Callout Size', type: 'float', min: 0, defVal: 15 } | |
| 100 | 94 | ]; |
| 101 | 95 | |
| 102 | -mxShapeBasicRectCallout.prototype.cst = {RECT_CALLOUT : 'mxgraph.basic.rectCallout'}; | |
| 96 | +mxShapeBasicRectCallout.prototype.cst = { RECT_CALLOUT: 'mxgraph.basic.rectCallout' }; | |
| 103 | 97 | |
| 104 | 98 | /** |
| 105 | 99 | * Function: paintVertexShape |
| 106 | 100 | * |
| 107 | 101 | * Paints the vertex shape. |
| 108 | 102 | */ |
| 109 | -mxShapeBasicRectCallout.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 110 | -{ | |
| 103 | +mxShapeBasicRectCallout.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 111 | 104 | c.translate(x, y); |
| 112 | 105 | |
| 113 | 106 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -125,38 +118,32 @@ mxShapeBasicRectCallout.prototype.paintVertexShape = function(c, x, y, w, h) |
| 125 | 118 | c.fillAndStroke(); |
| 126 | 119 | }; |
| 127 | 120 | |
| 128 | -mxShapeBasicRectCallout.prototype.getLabelMargins = function() | |
| 129 | -{ | |
| 130 | - if (mxUtils.getValue(this.style, 'boundedLbl', false)) | |
| 131 | - { | |
| 121 | +mxShapeBasicRectCallout.prototype.getLabelMargins = function () { | |
| 122 | + if (mxUtils.getValue(this.style, 'boundedLbl', false)) { | |
| 132 | 123 | return new mxRectangle(0, 0, 0, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)) * this.scale); |
| 133 | 124 | } |
| 134 | - | |
| 125 | + | |
| 135 | 126 | return null; |
| 136 | 127 | }; |
| 137 | 128 | |
| 138 | 129 | mxCellRenderer.registerShape(mxShapeBasicRectCallout.prototype.cst.RECT_CALLOUT, mxShapeBasicRectCallout); |
| 139 | 130 | |
| 140 | -Graph.handleFactory[mxShapeBasicRectCallout.prototype.cst.RECT_CALLOUT] = function(state) | |
| 141 | -{ | |
| 142 | - var handles = [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 143 | - { | |
| 131 | +Graph.handleFactory[mxShapeBasicRectCallout.prototype.cst.RECT_CALLOUT] = function (state) { | |
| 132 | + var handles = [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 144 | 133 | var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 145 | 134 | var dy = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); |
| 146 | 135 | |
| 147 | 136 | return new mxPoint(bounds.x + dx, bounds.y + bounds.height - dy); |
| 148 | - }, function(bounds, pt) | |
| 149 | - { | |
| 137 | + }, function (bounds, pt) { | |
| 150 | 138 | var y = parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)) * 0.6; |
| 151 | 139 | this.state.style['dx'] = Math.round(100 * Math.max(y, Math.min(bounds.width - y, pt.x - bounds.x))) / 100; |
| 152 | 140 | this.state.style['dy'] = Math.round(Math.max(0, Math.min(bounds.height, bounds.y + bounds.height - pt.y))); |
| 153 | 141 | })]; |
| 154 | - | |
| 142 | + | |
| 155 | 143 | return handles; |
| 156 | 144 | }; |
| 157 | 145 | |
| 158 | -mxShapeBasicRectCallout.prototype.getConstraints = function(style, w, h) | |
| 159 | -{ | |
| 146 | +mxShapeBasicRectCallout.prototype.getConstraints = function (style, w, h) { | |
| 160 | 147 | var constr = []; |
| 161 | 148 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 162 | 149 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -181,8 +168,7 @@ mxShapeBasicRectCallout.prototype.getConstraints = function(style, w, h) |
| 181 | 168 | /** |
| 182 | 169 | * Extends mxShape. |
| 183 | 170 | */ |
| 184 | -function mxShapeBasicRoundRectCallout(bounds, fill, stroke, strokewidth) | |
| 185 | -{ | |
| 171 | +function mxShapeBasicRoundRectCallout(bounds, fill, stroke, strokewidth) { | |
| 186 | 172 | mxShape.call(this); |
| 187 | 173 | this.bounds = bounds; |
| 188 | 174 | this.fill = fill; |
| ... | ... | @@ -198,14 +184,14 @@ function mxShapeBasicRoundRectCallout(bounds, fill, stroke, strokewidth) |
| 198 | 184 | */ |
| 199 | 185 | mxUtils.extend(mxShapeBasicRoundRectCallout, mxActor); |
| 200 | 186 | |
| 201 | -mxShapeBasicRoundRectCallout.prototype.cst = {ROUND_RECT_CALLOUT : 'mxgraph.basic.roundRectCallout'}; | |
| 187 | +mxShapeBasicRoundRectCallout.prototype.cst = { ROUND_RECT_CALLOUT: 'mxgraph.basic.roundRectCallout' }; | |
| 202 | 188 | |
| 203 | 189 | mxShapeBasicRoundRectCallout.prototype.getLabelMargins = mxShapeBasicRectCallout.prototype.getLabelMargins; |
| 204 | 190 | |
| 205 | 191 | mxShapeBasicRoundRectCallout.prototype.customProperties = [ |
| 206 | - {name: 'size', dispName: 'Arc Size', type: 'float', min:0, defVal:5}, | |
| 207 | - {name: 'dx', dispName: 'Callout Position', type: 'float', min:0, defVal:30}, | |
| 208 | - {name: 'dy', dispName: 'Callout Size', type: 'float', min:0, defVal:15} | |
| 192 | + { name: 'size', dispName: 'Arc Size', type: 'float', min: 0, defVal: 5 }, | |
| 193 | + { name: 'dx', dispName: 'Callout Position', type: 'float', min: 0, defVal: 30 }, | |
| 194 | + { name: 'dy', dispName: 'Callout Size', type: 'float', min: 0, defVal: 15 } | |
| 209 | 195 | ]; |
| 210 | 196 | |
| 211 | 197 | /** |
| ... | ... | @@ -213,8 +199,7 @@ mxShapeBasicRoundRectCallout.prototype.customProperties = [ |
| 213 | 199 | * |
| 214 | 200 | * Paints the vertex shape. |
| 215 | 201 | */ |
| 216 | -mxShapeBasicRoundRectCallout.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 217 | -{ | |
| 202 | +mxShapeBasicRoundRectCallout.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 218 | 203 | c.translate(x, y); |
| 219 | 204 | |
| 220 | 205 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -224,7 +209,7 @@ mxShapeBasicRoundRectCallout.prototype.paintVertexShape = function(c, x, y, w, h |
| 224 | 209 | r = Math.min((h - dy) / 2, w / 2, r); |
| 225 | 210 | dx = Math.max(r + dy * 0.5, dx); |
| 226 | 211 | dx = Math.min(w - r - dy * 0.5, dx); |
| 227 | - | |
| 212 | + | |
| 228 | 213 | c.begin(); |
| 229 | 214 | c.moveTo(dx - dy * 0.5, h - dy); |
| 230 | 215 | c.lineTo(r, h - dy); |
| ... | ... | @@ -246,33 +231,27 @@ mxCellRenderer.registerShape(mxShapeBasicRoundRectCallout.prototype.cst.ROUND_RE |
| 246 | 231 | |
| 247 | 232 | mxShapeBasicRoundRectCallout.prototype.constraints = null; |
| 248 | 233 | |
| 249 | -Graph.handleFactory[mxShapeBasicRoundRectCallout.prototype.cst.ROUND_RECT_CALLOUT] = function(state) | |
| 250 | -{ | |
| 251 | - return [Graph.createHandle(state, ['dx', 'dy'], function(bounds) | |
| 252 | - { | |
| 234 | +Graph.handleFactory[mxShapeBasicRoundRectCallout.prototype.cst.ROUND_RECT_CALLOUT] = function (state) { | |
| 235 | + return [Graph.createHandle(state, ['dx', 'dy'], function (bounds) { | |
| 253 | 236 | var dx = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 254 | 237 | var dy = Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); |
| 255 | 238 | |
| 256 | 239 | return new mxPoint(bounds.x + dx, bounds.y + bounds.height - dy); |
| 257 | - }, function(bounds, pt) | |
| 258 | - { | |
| 240 | + }, function (bounds, pt) { | |
| 259 | 241 | var y = parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)) * 0.6; |
| 260 | 242 | this.state.style['dx'] = Math.round(100 * Math.max(y, Math.min(bounds.width - y, pt.x - bounds.x))) / 100; |
| 261 | 243 | this.state.style['dy'] = Math.round(Math.max(0, Math.min(bounds.height, bounds.y + bounds.height - pt.y))); |
| 262 | - }), Graph.createHandle(state, ['size'], function(bounds) | |
| 263 | - { | |
| 244 | + }), Graph.createHandle(state, ['size'], function (bounds) { | |
| 264 | 245 | var size = Math.max(0, Math.min(bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'size', this.size)))); |
| 265 | 246 | |
| 266 | 247 | return new mxPoint(bounds.x + bounds.width - size, bounds.y + 10); |
| 267 | - }, function(bounds, pt) | |
| 268 | - { | |
| 248 | + }, function (bounds, pt) { | |
| 269 | 249 | var dy = parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)); |
| 270 | 250 | this.state.style['size'] = Math.round(100 * Math.max(0, Math.min(bounds.width / 2, (bounds.height - dy) / 2, bounds.x + bounds.width - pt.x))) / 100; |
| 271 | 251 | })]; |
| 272 | 252 | }; |
| 273 | 253 | |
| 274 | -mxShapeBasicRoundRectCallout.prototype.getConstraints = function(style, w, h) | |
| 275 | -{ | |
| 254 | +mxShapeBasicRoundRectCallout.prototype.getConstraints = function (style, w, h) { | |
| 276 | 255 | var constr = []; |
| 277 | 256 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 278 | 257 | var dy = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -281,15 +260,13 @@ mxShapeBasicRoundRectCallout.prototype.getConstraints = function(style, w, h) |
| 281 | 260 | r = Math.min((h - dy) / 2, w / 2, r); |
| 282 | 261 | dx = Math.max(r + dy * 0.5, dx); |
| 283 | 262 | dx = Math.min(w - r - dy * 0.5, dx); |
| 284 | - | |
| 285 | - if (r < w * 0.25) | |
| 286 | - { | |
| 263 | + | |
| 264 | + if (r < w * 0.25) { | |
| 287 | 265 | constr.push(new mxConnectionConstraint(new mxPoint(0.25, 0), false)); |
| 288 | 266 | constr.push(new mxConnectionConstraint(new mxPoint(0.75, 0), false)); |
| 289 | 267 | } |
| 290 | - | |
| 291 | - if (r < (h - dy) * 0.25) | |
| 292 | - { | |
| 268 | + | |
| 269 | + if (r < (h - dy) * 0.25) { | |
| 293 | 270 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, (h - dy) * 0.25)); |
| 294 | 271 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, (h - dy) * 0.75)); |
| 295 | 272 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, (h - dy) * 0.25)); |
| ... | ... | @@ -314,8 +291,7 @@ mxShapeBasicRoundRectCallout.prototype.getConstraints = function(style, w, h) |
| 314 | 291 | /** |
| 315 | 292 | * Extends mxShape. |
| 316 | 293 | */ |
| 317 | -function mxShapeBasicWave(bounds, fill, stroke, strokewidth) | |
| 318 | -{ | |
| 294 | +function mxShapeBasicWave(bounds, fill, stroke, strokewidth) { | |
| 319 | 295 | mxShape.call(this); |
| 320 | 296 | this.bounds = bounds; |
| 321 | 297 | this.fill = fill; |
| ... | ... | @@ -330,23 +306,22 @@ function mxShapeBasicWave(bounds, fill, stroke, strokewidth) |
| 330 | 306 | mxUtils.extend(mxShapeBasicWave, mxActor); |
| 331 | 307 | |
| 332 | 308 | mxShapeBasicWave.prototype.customProperties = [ |
| 333 | - {name: 'dy', dispName: 'Wave Size', type: 'float', min:0, max:1, defVal: 0.3} | |
| 309 | + { name: 'dy', dispName: 'Wave Size', type: 'float', min: 0, max: 1, defVal: 0.3 } | |
| 334 | 310 | ]; |
| 335 | 311 | |
| 336 | -mxShapeBasicWave.prototype.cst = {WAVE : 'mxgraph.basic.wave2'}; | |
| 312 | +mxShapeBasicWave.prototype.cst = { WAVE: 'mxgraph.basic.wave2' }; | |
| 337 | 313 | |
| 338 | 314 | /** |
| 339 | 315 | * Function: paintVertexShape |
| 340 | 316 | * |
| 341 | 317 | * Paints the vertex shape. |
| 342 | 318 | */ |
| 343 | -mxShapeBasicWave.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 344 | -{ | |
| 319 | +mxShapeBasicWave.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 345 | 320 | c.translate(x, y); |
| 346 | 321 | |
| 347 | 322 | var dy = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 348 | 323 | var fy = 1.4 |
| 349 | - | |
| 324 | + | |
| 350 | 325 | c.begin(); |
| 351 | 326 | c.moveTo(0, dy / 2); |
| 352 | 327 | c.quadTo(w / 6, dy * (1 - fy), w / 3, dy / 2); |
| ... | ... | @@ -364,27 +339,23 @@ mxCellRenderer.registerShape(mxShapeBasicWave.prototype.cst.WAVE, mxShapeBasicWa |
| 364 | 339 | |
| 365 | 340 | mxShapeBasicWave.prototype.constraints = null; |
| 366 | 341 | |
| 367 | -Graph.handleFactory[mxShapeBasicWave.prototype.cst.WAVE] = function(state) | |
| 368 | -{ | |
| 369 | - var handles = [Graph.createHandle(state, ['dy'], function(bounds) | |
| 370 | - { | |
| 342 | +Graph.handleFactory[mxShapeBasicWave.prototype.cst.WAVE] = function (state) { | |
| 343 | + var handles = [Graph.createHandle(state, ['dy'], function (bounds) { | |
| 371 | 344 | var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); |
| 372 | 345 | |
| 373 | 346 | return new mxPoint(bounds.x + bounds.width / 2, bounds.y + dy * bounds.height); |
| 374 | - }, function(bounds, pt) | |
| 375 | - { | |
| 347 | + }, function (bounds, pt) { | |
| 376 | 348 | this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 100; |
| 377 | 349 | })]; |
| 378 | 350 | |
| 379 | 351 | return handles; |
| 380 | 352 | }; |
| 381 | 353 | |
| 382 | -mxShapeBasicWave.prototype.getConstraints = function(style, w, h) | |
| 383 | -{ | |
| 354 | +mxShapeBasicWave.prototype.getConstraints = function (style, w, h) { | |
| 384 | 355 | var constr = []; |
| 385 | 356 | var dy = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 386 | 357 | var fy = 1.4 |
| 387 | - | |
| 358 | + | |
| 388 | 359 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, dy * 0.5)); |
| 389 | 360 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w / 6, h * 0.015)); |
| 390 | 361 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w / 3, dy * 0.5)); |
| ... | ... | @@ -411,8 +382,7 @@ mxShapeBasicWave.prototype.getConstraints = function(style, w, h) |
| 411 | 382 | /** |
| 412 | 383 | * Extends mxShape. |
| 413 | 384 | */ |
| 414 | -function mxShapeBasicOctagon(bounds, fill, stroke, strokewidth) | |
| 415 | -{ | |
| 385 | +function mxShapeBasicOctagon(bounds, fill, stroke, strokewidth) { | |
| 416 | 386 | mxShape.call(this); |
| 417 | 387 | this.bounds = bounds; |
| 418 | 388 | this.fill = fill; |
| ... | ... | @@ -427,24 +397,23 @@ function mxShapeBasicOctagon(bounds, fill, stroke, strokewidth) |
| 427 | 397 | mxUtils.extend(mxShapeBasicOctagon, mxActor); |
| 428 | 398 | |
| 429 | 399 | mxShapeBasicOctagon.prototype.customProperties = [ |
| 430 | - {name: 'dx', dispName: 'Cutoff Size', type: 'float', min:0, defVal:15} | |
| 400 | + { name: 'dx', dispName: 'Cutoff Size', type: 'float', min: 0, defVal: 15 } | |
| 431 | 401 | ]; |
| 432 | 402 | |
| 433 | -mxShapeBasicOctagon.prototype.cst = {OCTAGON : 'mxgraph.basic.octagon2'}; | |
| 403 | +mxShapeBasicOctagon.prototype.cst = { OCTAGON: 'mxgraph.basic.octagon2' }; | |
| 434 | 404 | |
| 435 | 405 | /** |
| 436 | 406 | * Function: paintVertexShape |
| 437 | 407 | * |
| 438 | 408 | * Paints the vertex shape. |
| 439 | 409 | */ |
| 440 | -mxShapeBasicOctagon.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 441 | -{ | |
| 410 | +mxShapeBasicOctagon.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 442 | 411 | c.translate(x, y); |
| 443 | 412 | |
| 444 | 413 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 445 | 414 | |
| 446 | 415 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 447 | - | |
| 416 | + | |
| 448 | 417 | c.begin(); |
| 449 | 418 | c.moveTo(dx, 0); |
| 450 | 419 | c.lineTo(w - dx, 0); |
| ... | ... | @@ -462,28 +431,24 @@ mxCellRenderer.registerShape(mxShapeBasicOctagon.prototype.cst.OCTAGON, mxShapeB |
| 462 | 431 | |
| 463 | 432 | mxShapeBasicOctagon.prototype.constraints = null; |
| 464 | 433 | |
| 465 | -Graph.handleFactory[mxShapeBasicOctagon.prototype.cst.OCTAGON] = function(state) | |
| 466 | -{ | |
| 467 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 468 | - { | |
| 434 | +Graph.handleFactory[mxShapeBasicOctagon.prototype.cst.OCTAGON] = function (state) { | |
| 435 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 469 | 436 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 470 | 437 | |
| 471 | 438 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 472 | - }, function(bounds, pt) | |
| 473 | - { | |
| 439 | + }, function (bounds, pt) { | |
| 474 | 440 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 475 | 441 | })]; |
| 476 | - | |
| 442 | + | |
| 477 | 443 | return handles; |
| 478 | 444 | }; |
| 479 | 445 | |
| 480 | -mxShapeBasicOctagon.prototype.getConstraints = function(style, w, h) | |
| 481 | -{ | |
| 446 | +mxShapeBasicOctagon.prototype.getConstraints = function (style, w, h) { | |
| 482 | 447 | var constr = []; |
| 483 | 448 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 484 | 449 | |
| 485 | 450 | dx = Math.min(w * 0.5, h * 0.5, dx) * 0.5; |
| 486 | - | |
| 451 | + | |
| 487 | 452 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| 488 | 453 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false)); |
| 489 | 454 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false)); |
| ... | ... | @@ -502,8 +467,7 @@ mxShapeBasicOctagon.prototype.getConstraints = function(style, w, h) |
| 502 | 467 | /** |
| 503 | 468 | * Extends mxShape. |
| 504 | 469 | */ |
| 505 | -function mxShapeBasicIsoCube(bounds, fill, stroke, strokewidth) | |
| 506 | -{ | |
| 470 | +function mxShapeBasicIsoCube(bounds, fill, stroke, strokewidth) { | |
| 507 | 471 | mxShape.call(this); |
| 508 | 472 | this.bounds = bounds; |
| 509 | 473 | this.fill = fill; |
| ... | ... | @@ -518,23 +482,22 @@ function mxShapeBasicIsoCube(bounds, fill, stroke, strokewidth) |
| 518 | 482 | mxUtils.extend(mxShapeBasicIsoCube, mxActor); |
| 519 | 483 | |
| 520 | 484 | mxShapeBasicIsoCube.prototype.customProperties = [ |
| 521 | - {name: 'isoAngle', dispName: 'Perspective Angle', type: 'float', min:0, defVal:15} | |
| 485 | + { name: 'isoAngle', dispName: 'Perspective Angle', type: 'float', min: 0, defVal: 15 } | |
| 522 | 486 | ]; |
| 523 | 487 | |
| 524 | -mxShapeBasicIsoCube.prototype.cst = {ISO_CUBE : 'mxgraph.basic.isocube'}; | |
| 488 | +mxShapeBasicIsoCube.prototype.cst = { ISO_CUBE: 'mxgraph.basic.isocube' }; | |
| 525 | 489 | |
| 526 | 490 | /** |
| 527 | 491 | * Function: paintVertexShape |
| 528 | 492 | * |
| 529 | 493 | * Paints the vertex shape. |
| 530 | 494 | */ |
| 531 | -mxShapeBasicIsoCube.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 532 | -{ | |
| 495 | +mxShapeBasicIsoCube.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 533 | 496 | c.translate(x, y); |
| 534 | 497 | |
| 535 | - var isoAngle = Math.max(0.01, Math.min(94, parseFloat(mxUtils.getValue(this.style, 'isoAngle', this.isoAngle)))) * Math.PI / 200 ; | |
| 498 | + var isoAngle = Math.max(0.01, Math.min(94, parseFloat(mxUtils.getValue(this.style, 'isoAngle', this.isoAngle)))) * Math.PI / 200; | |
| 536 | 499 | var isoH = Math.min(w * Math.tan(isoAngle), h * 0.5); |
| 537 | - | |
| 500 | + | |
| 538 | 501 | c.begin(); |
| 539 | 502 | c.moveTo(w * 0.5, 0); |
| 540 | 503 | c.lineTo(w, isoH); |
| ... | ... | @@ -546,7 +509,7 @@ mxShapeBasicIsoCube.prototype.paintVertexShape = function(c, x, y, w, h) |
| 546 | 509 | c.fillAndStroke(); |
| 547 | 510 | |
| 548 | 511 | c.setShadow(false); |
| 549 | - | |
| 512 | + | |
| 550 | 513 | c.begin(); |
| 551 | 514 | c.moveTo(0, isoH); |
| 552 | 515 | c.lineTo(w * 0.5, 2 * isoH); |
| ... | ... | @@ -560,28 +523,24 @@ mxCellRenderer.registerShape(mxShapeBasicIsoCube.prototype.cst.ISO_CUBE, mxShape |
| 560 | 523 | |
| 561 | 524 | mxShapeBasicIsoCube.prototype.constraints = null; |
| 562 | 525 | |
| 563 | -Graph.handleFactory[mxShapeBasicIsoCube.prototype.cst.ISO_CUBE] = function(state) | |
| 564 | -{ | |
| 565 | - var handles = [Graph.createHandle(state, ['isoAngle'], function(bounds) | |
| 566 | - { | |
| 567 | - var isoAngle = Math.max(0.01, Math.min(94, parseFloat(mxUtils.getValue(this.state.style, 'isoAngle', this.isoAngle)))) * Math.PI / 200 ; | |
| 526 | +Graph.handleFactory[mxShapeBasicIsoCube.prototype.cst.ISO_CUBE] = function (state) { | |
| 527 | + var handles = [Graph.createHandle(state, ['isoAngle'], function (bounds) { | |
| 528 | + var isoAngle = Math.max(0.01, Math.min(94, parseFloat(mxUtils.getValue(this.state.style, 'isoAngle', this.isoAngle)))) * Math.PI / 200; | |
| 568 | 529 | var isoH = Math.min(bounds.width * Math.tan(isoAngle), bounds.height * 0.5); |
| 569 | 530 | |
| 570 | 531 | return new mxPoint(bounds.x, bounds.y + isoH); |
| 571 | - }, function(bounds, pt) | |
| 572 | - { | |
| 532 | + }, function (bounds, pt) { | |
| 573 | 533 | this.state.style['isoAngle'] = Math.round(100 * Math.max(0, Math.min(100, pt.y - bounds.y))) / 100; |
| 574 | 534 | })]; |
| 575 | - | |
| 535 | + | |
| 576 | 536 | return handles; |
| 577 | 537 | }; |
| 578 | 538 | |
| 579 | -mxShapeBasicIsoCube.prototype.getConstraints = function(style, w, h) | |
| 580 | -{ | |
| 539 | +mxShapeBasicIsoCube.prototype.getConstraints = function (style, w, h) { | |
| 581 | 540 | var constr = []; |
| 582 | - var isoAngle = Math.max(0.01, Math.min(94, parseFloat(mxUtils.getValue(this.style, 'isoAngle', this.isoAngle)))) * Math.PI / 200 ; | |
| 541 | + var isoAngle = Math.max(0.01, Math.min(94, parseFloat(mxUtils.getValue(this.style, 'isoAngle', this.isoAngle)))) * Math.PI / 200; | |
| 583 | 542 | var isoH = Math.min(w * Math.tan(isoAngle), h * 0.5); |
| 584 | - | |
| 543 | + | |
| 585 | 544 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| 586 | 545 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, isoH)); |
| 587 | 546 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false)); |
| ... | ... | @@ -600,8 +559,7 @@ mxShapeBasicIsoCube.prototype.getConstraints = function(style, w, h) |
| 600 | 559 | /** |
| 601 | 560 | * Extends mxShape. |
| 602 | 561 | */ |
| 603 | -function mxShapeBasicTriangleAcute(bounds, fill, stroke, strokewidth) | |
| 604 | -{ | |
| 562 | +function mxShapeBasicTriangleAcute(bounds, fill, stroke, strokewidth) { | |
| 605 | 563 | mxShape.call(this); |
| 606 | 564 | this.bounds = bounds; |
| 607 | 565 | this.fill = fill; |
| ... | ... | @@ -616,22 +574,21 @@ function mxShapeBasicTriangleAcute(bounds, fill, stroke, strokewidth) |
| 616 | 574 | mxUtils.extend(mxShapeBasicTriangleAcute, mxActor); |
| 617 | 575 | |
| 618 | 576 | mxShapeBasicTriangleAcute.prototype.customProperties = [ |
| 619 | - {name: 'dx', dispName: 'Top', type: 'float', min:0, max:1, defVal:0.5} | |
| 577 | + { name: 'dx', dispName: 'Top', type: 'float', min: 0, max: 1, defVal: 0.5 } | |
| 620 | 578 | ]; |
| 621 | 579 | |
| 622 | -mxShapeBasicTriangleAcute.prototype.cst = {ACUTE_TRIANGLE : 'mxgraph.basic.acute_triangle'}; | |
| 580 | +mxShapeBasicTriangleAcute.prototype.cst = { ACUTE_TRIANGLE: 'mxgraph.basic.acute_triangle' }; | |
| 623 | 581 | |
| 624 | 582 | /** |
| 625 | 583 | * Function: paintVertexShape |
| 626 | 584 | * |
| 627 | 585 | * Paints the vertex shape. |
| 628 | 586 | */ |
| 629 | -mxShapeBasicTriangleAcute.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 630 | -{ | |
| 587 | +mxShapeBasicTriangleAcute.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 631 | 588 | c.translate(x, y); |
| 632 | 589 | |
| 633 | 590 | var dx = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 634 | - | |
| 591 | + | |
| 635 | 592 | c.begin(); |
| 636 | 593 | c.moveTo(0, h); |
| 637 | 594 | c.lineTo(dx, 0); |
| ... | ... | @@ -644,26 +601,22 @@ mxCellRenderer.registerShape(mxShapeBasicTriangleAcute.prototype.cst.ACUTE_TRIAN |
| 644 | 601 | |
| 645 | 602 | mxShapeBasicTriangleAcute.prototype.constraints = null; |
| 646 | 603 | |
| 647 | -Graph.handleFactory[mxShapeBasicTriangleAcute.prototype.cst.ACUTE_TRIANGLE] = function(state) | |
| 648 | -{ | |
| 649 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 650 | - { | |
| 604 | +Graph.handleFactory[mxShapeBasicTriangleAcute.prototype.cst.ACUTE_TRIANGLE] = function (state) { | |
| 605 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 651 | 606 | var dx = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 652 | 607 | |
| 653 | 608 | return new mxPoint(bounds.x + dx * bounds.width, bounds.y + 10); |
| 654 | - }, function(bounds, pt) | |
| 655 | - { | |
| 609 | + }, function (bounds, pt) { | |
| 656 | 610 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; |
| 657 | 611 | })]; |
| 658 | 612 | |
| 659 | 613 | return handles; |
| 660 | 614 | }; |
| 661 | 615 | |
| 662 | -mxShapeBasicTriangleAcute.prototype.getConstraints = function(style, w, h) | |
| 663 | -{ | |
| 616 | +mxShapeBasicTriangleAcute.prototype.getConstraints = function (style, w, h) { | |
| 664 | 617 | var constr = []; |
| 665 | 618 | var dx = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 666 | - | |
| 619 | + | |
| 667 | 620 | constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false)); |
| 668 | 621 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false)); |
| 669 | 622 | constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false)); |
| ... | ... | @@ -680,8 +633,7 @@ mxShapeBasicTriangleAcute.prototype.getConstraints = function(style, w, h) |
| 680 | 633 | /** |
| 681 | 634 | * Extends mxShape. |
| 682 | 635 | */ |
| 683 | -function mxShapeBasicTriangleObtuse(bounds, fill, stroke, strokewidth) | |
| 684 | -{ | |
| 636 | +function mxShapeBasicTriangleObtuse(bounds, fill, stroke, strokewidth) { | |
| 685 | 637 | mxShape.call(this); |
| 686 | 638 | this.bounds = bounds; |
| 687 | 639 | this.fill = fill; |
| ... | ... | @@ -696,22 +648,21 @@ function mxShapeBasicTriangleObtuse(bounds, fill, stroke, strokewidth) |
| 696 | 648 | mxUtils.extend(mxShapeBasicTriangleObtuse, mxActor); |
| 697 | 649 | |
| 698 | 650 | mxShapeBasicTriangleObtuse.prototype.customProperties = [ |
| 699 | - {name: 'dx', dispName: 'Bottom', type: 'float', min:0, max:1, defVal:0.25} | |
| 651 | + { name: 'dx', dispName: 'Bottom', type: 'float', min: 0, max: 1, defVal: 0.25 } | |
| 700 | 652 | ]; |
| 701 | 653 | |
| 702 | -mxShapeBasicTriangleObtuse.prototype.cst = {OBTUSE_TRIANGLE : 'mxgraph.basic.obtuse_triangle'}; | |
| 654 | +mxShapeBasicTriangleObtuse.prototype.cst = { OBTUSE_TRIANGLE: 'mxgraph.basic.obtuse_triangle' }; | |
| 703 | 655 | |
| 704 | 656 | /** |
| 705 | 657 | * Function: paintVertexShape |
| 706 | 658 | * |
| 707 | 659 | * Paints the vertex shape. |
| 708 | 660 | */ |
| 709 | -mxShapeBasicTriangleObtuse.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 710 | -{ | |
| 661 | +mxShapeBasicTriangleObtuse.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 711 | 662 | c.translate(x, y); |
| 712 | 663 | |
| 713 | 664 | var dx = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 714 | - | |
| 665 | + | |
| 715 | 666 | c.begin(); |
| 716 | 667 | c.moveTo(dx, h); |
| 717 | 668 | c.lineTo(0, 0); |
| ... | ... | @@ -724,26 +675,22 @@ mxCellRenderer.registerShape(mxShapeBasicTriangleObtuse.prototype.cst.OBTUSE_TRI |
| 724 | 675 | |
| 725 | 676 | mxShapeBasicTriangleObtuse.prototype.constraints = null; |
| 726 | 677 | |
| 727 | -Graph.handleFactory[mxShapeBasicTriangleObtuse.prototype.cst.OBTUSE_TRIANGLE] = function(state) | |
| 728 | -{ | |
| 729 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 730 | - { | |
| 678 | +Graph.handleFactory[mxShapeBasicTriangleObtuse.prototype.cst.OBTUSE_TRIANGLE] = function (state) { | |
| 679 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 731 | 680 | var dx = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 732 | 681 | |
| 733 | 682 | return new mxPoint(bounds.x + dx * bounds.width, bounds.y + bounds.height - 10); |
| 734 | - }, function(bounds, pt) | |
| 735 | - { | |
| 683 | + }, function (bounds, pt) { | |
| 736 | 684 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; |
| 737 | 685 | })]; |
| 738 | 686 | |
| 739 | 687 | return handles; |
| 740 | 688 | }; |
| 741 | 689 | |
| 742 | -mxShapeBasicTriangleObtuse.prototype.getConstraints = function(style, w, h) | |
| 743 | -{ | |
| 690 | +mxShapeBasicTriangleObtuse.prototype.getConstraints = function (style, w, h) { | |
| 744 | 691 | var constr = []; |
| 745 | 692 | var dx = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 746 | - | |
| 693 | + | |
| 747 | 694 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false)); |
| 748 | 695 | constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false)); |
| 749 | 696 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5, h * 0.5)); |
| ... | ... | @@ -760,8 +707,7 @@ mxShapeBasicTriangleObtuse.prototype.getConstraints = function(style, w, h) |
| 760 | 707 | /** |
| 761 | 708 | * Extends mxShape. |
| 762 | 709 | */ |
| 763 | -function mxShapeBasicDrop(bounds, fill, stroke, strokewidth) | |
| 764 | -{ | |
| 710 | +function mxShapeBasicDrop(bounds, fill, stroke, strokewidth) { | |
| 765 | 711 | mxShape.call(this); |
| 766 | 712 | this.bounds = bounds; |
| 767 | 713 | this.fill = fill; |
| ... | ... | @@ -774,26 +720,25 @@ function mxShapeBasicDrop(bounds, fill, stroke, strokewidth) |
| 774 | 720 | */ |
| 775 | 721 | mxUtils.extend(mxShapeBasicDrop, mxActor); |
| 776 | 722 | |
| 777 | -mxShapeBasicDrop.prototype.cst = {DROP : 'mxgraph.basic.drop'}; | |
| 723 | +mxShapeBasicDrop.prototype.cst = { DROP: 'mxgraph.basic.drop' }; | |
| 778 | 724 | |
| 779 | 725 | /** |
| 780 | 726 | * Function: paintVertexShape |
| 781 | 727 | * |
| 782 | 728 | * Paints the vertex shape. |
| 783 | 729 | */ |
| 784 | -mxShapeBasicDrop.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 785 | -{ | |
| 730 | +mxShapeBasicDrop.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 786 | 731 | c.translate(x, y); |
| 787 | 732 | |
| 788 | 733 | var r = Math.min(h, w) * 0.5; |
| 789 | 734 | var d = h - r; |
| 790 | 735 | var a = Math.sqrt(d * d - r * r); |
| 791 | - | |
| 736 | + | |
| 792 | 737 | var angle = Math.atan(a / r); |
| 793 | - | |
| 738 | + | |
| 794 | 739 | var x1 = r * Math.sin(angle); |
| 795 | 740 | var y1 = r * Math.cos(angle); |
| 796 | - | |
| 741 | + | |
| 797 | 742 | c.begin(); |
| 798 | 743 | c.moveTo(w * 0.5, 0); |
| 799 | 744 | c.lineTo(w * 0.5 + x1, h - r - y1); |
| ... | ... | @@ -815,8 +760,7 @@ mxShapeBasicDrop.prototype.constraints = null; |
| 815 | 760 | /** |
| 816 | 761 | * Extends mxShape. |
| 817 | 762 | */ |
| 818 | -function mxShapeBasicCone2(bounds, fill, stroke, strokewidth) | |
| 819 | -{ | |
| 763 | +function mxShapeBasicCone2(bounds, fill, stroke, strokewidth) { | |
| 820 | 764 | mxShape.call(this); |
| 821 | 765 | this.bounds = bounds; |
| 822 | 766 | this.fill = fill; |
| ... | ... | @@ -832,41 +776,38 @@ function mxShapeBasicCone2(bounds, fill, stroke, strokewidth) |
| 832 | 776 | mxUtils.extend(mxShapeBasicCone2, mxActor); |
| 833 | 777 | |
| 834 | 778 | mxShapeBasicCone2.prototype.customProperties = [ |
| 835 | - {name: 'dx', dispName: 'Top', type: 'float', min:0, max:1, defVal:0.5}, | |
| 836 | - {name: 'dy', dispName: 'Bottom', type: 'float', min:0, max:1, defVal:0.9} | |
| 779 | + { name: 'dx', dispName: 'Top', type: 'float', min: 0, max: 1, defVal: 0.5 }, | |
| 780 | + { name: 'dy', dispName: 'Bottom', type: 'float', min: 0, max: 1, defVal: 0.9 } | |
| 837 | 781 | ]; |
| 838 | 782 | |
| 839 | -mxShapeBasicCone2.prototype.cst = {CONE2 : 'mxgraph.basic.cone2'}; | |
| 783 | +mxShapeBasicCone2.prototype.cst = { CONE2: 'mxgraph.basic.cone2' }; | |
| 840 | 784 | |
| 841 | 785 | /** |
| 842 | 786 | * Function: paintVertexShape |
| 843 | 787 | * |
| 844 | 788 | * Paints the vertex shape. |
| 845 | 789 | */ |
| 846 | -mxShapeBasicCone2.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 847 | -{ | |
| 790 | +mxShapeBasicCone2.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 848 | 791 | c.translate(x, y); |
| 849 | 792 | |
| 850 | 793 | var dx = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 851 | 794 | var dy = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 852 | - | |
| 795 | + | |
| 853 | 796 | var ry = h - dy; |
| 854 | - | |
| 797 | + | |
| 855 | 798 | c.begin(); |
| 856 | 799 | c.moveTo(dx, 0); |
| 857 | - | |
| 858 | - if (ry > 0) | |
| 859 | - { | |
| 800 | + | |
| 801 | + if (ry > 0) { | |
| 860 | 802 | c.lineTo(w, h - ry); |
| 861 | 803 | c.arcTo(w * 0.5, ry, 0, 0, 1, w * 0.5, h); |
| 862 | 804 | c.arcTo(w * 0.5, ry, 0, 0, 1, 0, h - ry); |
| 863 | 805 | } |
| 864 | - else | |
| 865 | - { | |
| 806 | + else { | |
| 866 | 807 | c.lineTo(w, h); |
| 867 | 808 | c.lineTo(0, h); |
| 868 | 809 | } |
| 869 | - | |
| 810 | + | |
| 870 | 811 | c.close(); |
| 871 | 812 | c.fillAndStroke(); |
| 872 | 813 | }; |
| ... | ... | @@ -875,40 +816,34 @@ mxCellRenderer.registerShape(mxShapeBasicCone2.prototype.cst.CONE2, mxShapeBasic |
| 875 | 816 | |
| 876 | 817 | mxShapeBasicCone2.prototype.constraints = null; |
| 877 | 818 | |
| 878 | -Graph.handleFactory[mxShapeBasicCone2.prototype.cst.CONE2] = function(state) | |
| 879 | -{ | |
| 880 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 881 | - { | |
| 819 | +Graph.handleFactory[mxShapeBasicCone2.prototype.cst.CONE2] = function (state) { | |
| 820 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 882 | 821 | var dx = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 883 | 822 | |
| 884 | 823 | return new mxPoint(bounds.x + dx * bounds.width, bounds.y + 10); |
| 885 | - }, function(bounds, pt) | |
| 886 | - { | |
| 824 | + }, function (bounds, pt) { | |
| 887 | 825 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; |
| 888 | 826 | })]; |
| 889 | 827 | |
| 890 | - var handle2 = Graph.createHandle(state, ['dy'], function(bounds) | |
| 891 | - { | |
| 828 | + var handle2 = Graph.createHandle(state, ['dy'], function (bounds) { | |
| 892 | 829 | var dy = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); |
| 893 | 830 | |
| 894 | 831 | return new mxPoint(bounds.x + 10, bounds.y + dy * bounds.height); |
| 895 | - }, function(bounds, pt) | |
| 896 | - { | |
| 832 | + }, function (bounds, pt) { | |
| 897 | 833 | this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 100; |
| 898 | 834 | }); |
| 899 | - | |
| 835 | + | |
| 900 | 836 | handles.push(handle2); |
| 901 | - | |
| 837 | + | |
| 902 | 838 | return handles; |
| 903 | 839 | }; |
| 904 | 840 | |
| 905 | -mxShapeBasicCone2.prototype.getConstraints = function(style, w, h) | |
| 906 | -{ | |
| 841 | +mxShapeBasicCone2.prototype.getConstraints = function (style, w, h) { | |
| 907 | 842 | var constr = []; |
| 908 | 843 | var dx = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 909 | 844 | var dy = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| 910 | 845 | var ry = h - dy; |
| 911 | - | |
| 846 | + | |
| 912 | 847 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, 0)); |
| 913 | 848 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, h - ry)); |
| 914 | 849 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w * 0.5, h)); |
| ... | ... | @@ -923,8 +858,7 @@ mxShapeBasicCone2.prototype.getConstraints = function(style, w, h) |
| 923 | 858 | /** |
| 924 | 859 | * Extends mxShape. |
| 925 | 860 | */ |
| 926 | -function mxShapeBasicPyramid(bounds, fill, stroke, strokewidth) | |
| 927 | -{ | |
| 861 | +function mxShapeBasicPyramid(bounds, fill, stroke, strokewidth) { | |
| 928 | 862 | mxShape.call(this); |
| 929 | 863 | this.bounds = bounds; |
| 930 | 864 | this.fill = fill; |
| ... | ... | @@ -942,28 +876,27 @@ function mxShapeBasicPyramid(bounds, fill, stroke, strokewidth) |
| 942 | 876 | mxUtils.extend(mxShapeBasicPyramid, mxActor); |
| 943 | 877 | |
| 944 | 878 | mxShapeBasicPyramid.prototype.customProperties = [ |
| 945 | - {name: 'dx1', dispName: 'Top', type: 'float', min:0, max:1, defVal:0.4}, | |
| 946 | - {name: 'dx2', dispName: 'Bottom', type: 'float', min:0, max:1, defVal:0.6}, | |
| 947 | - {name: 'dy1', dispName: 'Perspective Left', type: 'float', min:0, max:1, defVal:0.9}, | |
| 948 | - {name: 'dy2', dispName: 'Perspective Right', type: 'float', min:0, max:1, defVal:0.8} | |
| 879 | + { name: 'dx1', dispName: 'Top', type: 'float', min: 0, max: 1, defVal: 0.4 }, | |
| 880 | + { name: 'dx2', dispName: 'Bottom', type: 'float', min: 0, max: 1, defVal: 0.6 }, | |
| 881 | + { name: 'dy1', dispName: 'Perspective Left', type: 'float', min: 0, max: 1, defVal: 0.9 }, | |
| 882 | + { name: 'dy2', dispName: 'Perspective Right', type: 'float', min: 0, max: 1, defVal: 0.8 } | |
| 949 | 883 | ]; |
| 950 | 884 | |
| 951 | -mxShapeBasicPyramid.prototype.cst = {PYRAMID : 'mxgraph.basic.pyramid'}; | |
| 885 | +mxShapeBasicPyramid.prototype.cst = { PYRAMID: 'mxgraph.basic.pyramid' }; | |
| 952 | 886 | |
| 953 | 887 | /** |
| 954 | 888 | * Function: paintVertexShape |
| 955 | 889 | * |
| 956 | 890 | * Paints the vertex shape. |
| 957 | 891 | */ |
| 958 | -mxShapeBasicPyramid.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 959 | -{ | |
| 892 | +mxShapeBasicPyramid.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 960 | 893 | c.translate(x, y); |
| 961 | 894 | |
| 962 | 895 | var dx1 = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| 963 | 896 | var dx2 = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2)))); |
| 964 | 897 | var dy1 = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 965 | 898 | var dy2 = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2)))); |
| 966 | - | |
| 899 | + | |
| 967 | 900 | c.begin(); |
| 968 | 901 | c.moveTo(dx1, 0); |
| 969 | 902 | c.lineTo(w, dy2); |
| ... | ... | @@ -971,9 +904,9 @@ mxShapeBasicPyramid.prototype.paintVertexShape = function(c, x, y, w, h) |
| 971 | 904 | c.lineTo(0, dy1); |
| 972 | 905 | c.close(); |
| 973 | 906 | c.fillAndStroke(); |
| 974 | - | |
| 907 | + | |
| 975 | 908 | c.setShadow(false); |
| 976 | - | |
| 909 | + | |
| 977 | 910 | c.begin(); |
| 978 | 911 | c.moveTo(dx1, 0); |
| 979 | 912 | c.lineTo(dx2, h); |
| ... | ... | @@ -984,65 +917,55 @@ mxCellRenderer.registerShape(mxShapeBasicPyramid.prototype.cst.PYRAMID, mxShapeB |
| 984 | 917 | |
| 985 | 918 | mxShapeBasicPyramid.prototype.constraints = null; |
| 986 | 919 | |
| 987 | -Graph.handleFactory[mxShapeBasicPyramid.prototype.cst.PYRAMID] = function(state) | |
| 988 | -{ | |
| 989 | - var handles = [Graph.createHandle(state, ['dx1'], function(bounds) | |
| 990 | - { | |
| 920 | +Graph.handleFactory[mxShapeBasicPyramid.prototype.cst.PYRAMID] = function (state) { | |
| 921 | + var handles = [Graph.createHandle(state, ['dx1'], function (bounds) { | |
| 991 | 922 | var dx1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dx1', this.dx1)))); |
| 992 | 923 | |
| 993 | 924 | return new mxPoint(bounds.x + dx1 * bounds.width, bounds.y + 10); |
| 994 | - }, function(bounds, pt) | |
| 995 | - { | |
| 925 | + }, function (bounds, pt) { | |
| 996 | 926 | this.state.style['dx1'] = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; |
| 997 | 927 | })]; |
| 998 | 928 | |
| 999 | - var handle2 = Graph.createHandle(state, ['dx2'], function(bounds) | |
| 1000 | - { | |
| 929 | + var handle2 = Graph.createHandle(state, ['dx2'], function (bounds) { | |
| 1001 | 930 | var dx2 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dx2', this.dx2)))); |
| 1002 | 931 | |
| 1003 | 932 | return new mxPoint(bounds.x + dx2 * bounds.width, bounds.y + bounds.height - 10); |
| 1004 | - }, function(bounds, pt) | |
| 1005 | - { | |
| 933 | + }, function (bounds, pt) { | |
| 1006 | 934 | this.state.style['dx2'] = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; |
| 1007 | 935 | }); |
| 1008 | - | |
| 936 | + | |
| 1009 | 937 | handles.push(handle2); |
| 1010 | - | |
| 1011 | - var handle3 = Graph.createHandle(state, ['dy1'], function(bounds) | |
| 1012 | - { | |
| 938 | + | |
| 939 | + var handle3 = Graph.createHandle(state, ['dy1'], function (bounds) { | |
| 1013 | 940 | var dy1 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy1', this.dy1)))); |
| 1014 | 941 | |
| 1015 | 942 | return new mxPoint(bounds.x + 10, bounds.y + dy1 * bounds.height); |
| 1016 | - }, function(bounds, pt) | |
| 1017 | - { | |
| 943 | + }, function (bounds, pt) { | |
| 1018 | 944 | this.state.style['dy1'] = Math.round(100 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 100; |
| 1019 | 945 | }); |
| 1020 | - | |
| 946 | + | |
| 1021 | 947 | handles.push(handle3); |
| 1022 | - | |
| 1023 | - var handle4 = Graph.createHandle(state, ['dy2'], function(bounds) | |
| 1024 | - { | |
| 948 | + | |
| 949 | + var handle4 = Graph.createHandle(state, ['dy2'], function (bounds) { | |
| 1025 | 950 | var dy2 = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dy2', this.dy2)))); |
| 1026 | 951 | |
| 1027 | 952 | return new mxPoint(bounds.x + bounds.width - 10, bounds.y + dy2 * bounds.height); |
| 1028 | - }, function(bounds, pt) | |
| 1029 | - { | |
| 953 | + }, function (bounds, pt) { | |
| 1030 | 954 | this.state.style['dy2'] = Math.round(100 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 100; |
| 1031 | 955 | }); |
| 1032 | - | |
| 956 | + | |
| 1033 | 957 | handles.push(handle4); |
| 1034 | - | |
| 958 | + | |
| 1035 | 959 | return handles; |
| 1036 | 960 | }; |
| 1037 | 961 | |
| 1038 | -mxShapeBasicPyramid.prototype.getConstraints = function(style, w, h) | |
| 1039 | -{ | |
| 962 | +mxShapeBasicPyramid.prototype.getConstraints = function (style, w, h) { | |
| 1040 | 963 | var constr = []; |
| 1041 | 964 | var dx1 = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx1', this.dx1)))); |
| 1042 | 965 | var dx2 = w * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx2', this.dx2)))); |
| 1043 | 966 | var dy1 = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy1', this.dy1)))); |
| 1044 | 967 | var dy2 = h * Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'dy2', this.dy2)))); |
| 1045 | - | |
| 968 | + | |
| 1046 | 969 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx1, 0)); |
| 1047 | 970 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w + dx1) * 0.5, dy2 * 0.5)); |
| 1048 | 971 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w, dy2)); |
| ... | ... | @@ -1061,8 +984,7 @@ mxShapeBasicPyramid.prototype.getConstraints = function(style, w, h) |
| 1061 | 984 | /** |
| 1062 | 985 | * Extends mxShape. |
| 1063 | 986 | */ |
| 1064 | -function mxShapeBasic4PointStar2(bounds, fill, stroke, strokewidth) | |
| 1065 | -{ | |
| 987 | +function mxShapeBasic4PointStar2(bounds, fill, stroke, strokewidth) { | |
| 1066 | 988 | mxShape.call(this); |
| 1067 | 989 | this.bounds = bounds; |
| 1068 | 990 | this.fill = fill; |
| ... | ... | @@ -1077,18 +999,17 @@ function mxShapeBasic4PointStar2(bounds, fill, stroke, strokewidth) |
| 1077 | 999 | mxUtils.extend(mxShapeBasic4PointStar2, mxActor); |
| 1078 | 1000 | |
| 1079 | 1001 | mxShapeBasic4PointStar2.prototype.customProperties = [ |
| 1080 | - {name: 'dx', dispName: 'Thickness', type: 'float', min:0, max:1, defVal:0.8} | |
| 1002 | + { name: 'dx', dispName: 'Thickness', type: 'float', min: 0, max: 1, defVal: 0.8 } | |
| 1081 | 1003 | ]; |
| 1082 | 1004 | |
| 1083 | -mxShapeBasic4PointStar2.prototype.cst = {FOUR_POINT_STAR_2 : 'mxgraph.basic.4_point_star_2'}; | |
| 1005 | +mxShapeBasic4PointStar2.prototype.cst = { FOUR_POINT_STAR_2: 'mxgraph.basic.4_point_star_2' }; | |
| 1084 | 1006 | |
| 1085 | 1007 | /** |
| 1086 | 1008 | * Function: paintVertexShape |
| 1087 | 1009 | * |
| 1088 | 1010 | * Paints the vertex shape. |
| 1089 | 1011 | */ |
| 1090 | -mxShapeBasic4PointStar2.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1091 | -{ | |
| 1012 | +mxShapeBasic4PointStar2.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1092 | 1013 | c.translate(x, y); |
| 1093 | 1014 | |
| 1094 | 1015 | var dx = 0.5 * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| ... | ... | @@ -1110,23 +1031,19 @@ mxCellRenderer.registerShape(mxShapeBasic4PointStar2.prototype.cst.FOUR_POINT_ST |
| 1110 | 1031 | |
| 1111 | 1032 | mxShapeBasic4PointStar2.prototype.constraints = null; |
| 1112 | 1033 | |
| 1113 | -Graph.handleFactory[mxShapeBasic4PointStar2.prototype.cst.FOUR_POINT_STAR_2] = function(state) | |
| 1114 | -{ | |
| 1115 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1116 | - { | |
| 1034 | +Graph.handleFactory[mxShapeBasic4PointStar2.prototype.cst.FOUR_POINT_STAR_2] = function (state) { | |
| 1035 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1117 | 1036 | var dx = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1118 | 1037 | |
| 1119 | 1038 | return new mxPoint(bounds.x + dx * bounds.width / 2, bounds.y + dx * bounds.height / 2); |
| 1120 | - }, function(bounds, pt) | |
| 1121 | - { | |
| 1039 | + }, function (bounds, pt) { | |
| 1122 | 1040 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(1, 2 * (pt.x - bounds.x) / bounds.width))) / 100; |
| 1123 | 1041 | })]; |
| 1124 | 1042 | |
| 1125 | 1043 | return handles; |
| 1126 | 1044 | }; |
| 1127 | 1045 | |
| 1128 | -mxShapeBasic4PointStar2.prototype.getConstraints = function(style, w, h) | |
| 1129 | -{ | |
| 1046 | +mxShapeBasic4PointStar2.prototype.getConstraints = function (style, w, h) { | |
| 1130 | 1047 | var constr = []; |
| 1131 | 1048 | var dx = 0.5 * Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1132 | 1049 | |
| ... | ... | @@ -1148,8 +1065,7 @@ mxShapeBasic4PointStar2.prototype.getConstraints = function(style, w, h) |
| 1148 | 1065 | /** |
| 1149 | 1066 | * Extends mxShape. |
| 1150 | 1067 | */ |
| 1151 | -function mxShapeBasicDiagSnipRect(bounds, fill, stroke, strokewidth) | |
| 1152 | -{ | |
| 1068 | +function mxShapeBasicDiagSnipRect(bounds, fill, stroke, strokewidth) { | |
| 1153 | 1069 | mxShape.call(this); |
| 1154 | 1070 | this.bounds = bounds; |
| 1155 | 1071 | this.fill = fill; |
| ... | ... | @@ -1164,24 +1080,23 @@ function mxShapeBasicDiagSnipRect(bounds, fill, stroke, strokewidth) |
| 1164 | 1080 | mxUtils.extend(mxShapeBasicDiagSnipRect, mxActor); |
| 1165 | 1081 | |
| 1166 | 1082 | mxShapeBasicDiagSnipRect.prototype.customProperties = [ |
| 1167 | - {name: 'dx', dispName: 'Snip', type: 'float', min:0, deVal:6}, | |
| 1083 | + { name: 'dx', dispName: 'Snip', type: 'float', min: 0, deVal: 6 }, | |
| 1168 | 1084 | ]; |
| 1169 | 1085 | |
| 1170 | -mxShapeBasicDiagSnipRect.prototype.cst = {DIAG_SNIP_RECT : 'mxgraph.basic.diag_snip_rect'}; | |
| 1086 | +mxShapeBasicDiagSnipRect.prototype.cst = { DIAG_SNIP_RECT: 'mxgraph.basic.diag_snip_rect' }; | |
| 1171 | 1087 | |
| 1172 | 1088 | /** |
| 1173 | 1089 | * Function: paintVertexShape |
| 1174 | 1090 | * |
| 1175 | 1091 | * Paints the vertex shape. |
| 1176 | 1092 | */ |
| 1177 | -mxShapeBasicDiagSnipRect.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1178 | -{ | |
| 1093 | +mxShapeBasicDiagSnipRect.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1179 | 1094 | c.translate(x, y); |
| 1180 | 1095 | |
| 1181 | 1096 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 1182 | 1097 | |
| 1183 | 1098 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1184 | - | |
| 1099 | + | |
| 1185 | 1100 | c.begin(); |
| 1186 | 1101 | c.moveTo(dx, 0); |
| 1187 | 1102 | c.lineTo(w, 0); |
| ... | ... | @@ -1197,23 +1112,19 @@ mxCellRenderer.registerShape(mxShapeBasicDiagSnipRect.prototype.cst.DIAG_SNIP_RE |
| 1197 | 1112 | |
| 1198 | 1113 | mxShapeBasicDiagSnipRect.prototype.constraints = null; |
| 1199 | 1114 | |
| 1200 | -Graph.handleFactory[mxShapeBasicDiagSnipRect.prototype.cst.DIAG_SNIP_RECT] = function(state) | |
| 1201 | -{ | |
| 1202 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1203 | - { | |
| 1115 | +Graph.handleFactory[mxShapeBasicDiagSnipRect.prototype.cst.DIAG_SNIP_RECT] = function (state) { | |
| 1116 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1204 | 1117 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1205 | 1118 | |
| 1206 | 1119 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1207 | - }, function(bounds, pt) | |
| 1208 | - { | |
| 1120 | + }, function (bounds, pt) { | |
| 1209 | 1121 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 1210 | 1122 | })]; |
| 1211 | - | |
| 1123 | + | |
| 1212 | 1124 | return handles; |
| 1213 | 1125 | }; |
| 1214 | 1126 | |
| 1215 | -mxShapeBasicDiagSnipRect.prototype.getConstraints = function(style, w, h) | |
| 1216 | -{ | |
| 1127 | +mxShapeBasicDiagSnipRect.prototype.getConstraints = function (style, w, h) { | |
| 1217 | 1128 | var constr = []; |
| 1218 | 1129 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 1219 | 1130 | |
| ... | ... | @@ -1237,8 +1148,7 @@ mxShapeBasicDiagSnipRect.prototype.getConstraints = function(style, w, h) |
| 1237 | 1148 | /** |
| 1238 | 1149 | * Extends mxShape. |
| 1239 | 1150 | */ |
| 1240 | -function mxShapeBasicDiagRoundRect(bounds, fill, stroke, strokewidth) | |
| 1241 | -{ | |
| 1151 | +function mxShapeBasicDiagRoundRect(bounds, fill, stroke, strokewidth) { | |
| 1242 | 1152 | mxShape.call(this); |
| 1243 | 1153 | this.bounds = bounds; |
| 1244 | 1154 | this.fill = fill; |
| ... | ... | @@ -1253,24 +1163,23 @@ function mxShapeBasicDiagRoundRect(bounds, fill, stroke, strokewidth) |
| 1253 | 1163 | mxUtils.extend(mxShapeBasicDiagRoundRect, mxActor); |
| 1254 | 1164 | |
| 1255 | 1165 | mxShapeBasicDiagRoundRect.prototype.customProperties = [ |
| 1256 | - {name: 'dx', dispName: 'Rounding Size', type: 'float', min:0, defVal:6}, | |
| 1166 | + { name: 'dx', dispName: 'Rounding Size', type: 'float', min: 0, defVal: 6 }, | |
| 1257 | 1167 | ]; |
| 1258 | 1168 | |
| 1259 | -mxShapeBasicDiagRoundRect.prototype.cst = {DIAG_ROUND_RECT : 'mxgraph.basic.diag_round_rect'}; | |
| 1169 | +mxShapeBasicDiagRoundRect.prototype.cst = { DIAG_ROUND_RECT: 'mxgraph.basic.diag_round_rect' }; | |
| 1260 | 1170 | |
| 1261 | 1171 | /** |
| 1262 | 1172 | * Function: paintVertexShape |
| 1263 | 1173 | * |
| 1264 | 1174 | * Paints the vertex shape. |
| 1265 | 1175 | */ |
| 1266 | -mxShapeBasicDiagRoundRect.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1267 | -{ | |
| 1176 | +mxShapeBasicDiagRoundRect.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1268 | 1177 | c.translate(x, y); |
| 1269 | 1178 | |
| 1270 | 1179 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 1271 | 1180 | |
| 1272 | 1181 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1273 | - | |
| 1182 | + | |
| 1274 | 1183 | c.begin(); |
| 1275 | 1184 | c.moveTo(dx, 0); |
| 1276 | 1185 | c.lineTo(w, 0); |
| ... | ... | @@ -1287,23 +1196,19 @@ mxCellRenderer.registerShape(mxShapeBasicDiagRoundRect.prototype.cst.DIAG_ROUND_ |
| 1287 | 1196 | |
| 1288 | 1197 | mxShapeBasicDiagRoundRect.prototype.constraints = null; |
| 1289 | 1198 | |
| 1290 | -Graph.handleFactory[mxShapeBasicDiagRoundRect.prototype.cst.DIAG_ROUND_RECT] = function(state) | |
| 1291 | -{ | |
| 1292 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1293 | - { | |
| 1199 | +Graph.handleFactory[mxShapeBasicDiagRoundRect.prototype.cst.DIAG_ROUND_RECT] = function (state) { | |
| 1200 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1294 | 1201 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1295 | 1202 | |
| 1296 | 1203 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1297 | - }, function(bounds, pt) | |
| 1298 | - { | |
| 1204 | + }, function (bounds, pt) { | |
| 1299 | 1205 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 1300 | 1206 | })]; |
| 1301 | - | |
| 1207 | + | |
| 1302 | 1208 | return handles; |
| 1303 | 1209 | }; |
| 1304 | 1210 | |
| 1305 | -mxShapeBasicDiagRoundRect.prototype.getConstraints = function(style, w, h) | |
| 1306 | -{ | |
| 1211 | +mxShapeBasicDiagRoundRect.prototype.getConstraints = function (style, w, h) { | |
| 1307 | 1212 | var constr = []; |
| 1308 | 1213 | |
| 1309 | 1214 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| ... | ... | @@ -1322,8 +1227,7 @@ mxShapeBasicDiagRoundRect.prototype.getConstraints = function(style, w, h) |
| 1322 | 1227 | /** |
| 1323 | 1228 | * Extends mxShape. |
| 1324 | 1229 | */ |
| 1325 | -function mxShapeBasicCornerRoundRect(bounds, fill, stroke, strokewidth) | |
| 1326 | -{ | |
| 1230 | +function mxShapeBasicCornerRoundRect(bounds, fill, stroke, strokewidth) { | |
| 1327 | 1231 | mxShape.call(this); |
| 1328 | 1232 | this.bounds = bounds; |
| 1329 | 1233 | this.fill = fill; |
| ... | ... | @@ -1338,24 +1242,23 @@ function mxShapeBasicCornerRoundRect(bounds, fill, stroke, strokewidth) |
| 1338 | 1242 | mxUtils.extend(mxShapeBasicCornerRoundRect, mxActor); |
| 1339 | 1243 | |
| 1340 | 1244 | mxShapeBasicCornerRoundRect.prototype.customProperties = [ |
| 1341 | - {name: 'dx', dispName: 'Rounding Size', type: 'float', min:0, defVal:6}, | |
| 1245 | + { name: 'dx', dispName: 'Rounding Size', type: 'float', min: 0, defVal: 6 }, | |
| 1342 | 1246 | ]; |
| 1343 | 1247 | |
| 1344 | -mxShapeBasicCornerRoundRect.prototype.cst = {CORNER_ROUND_RECT : 'mxgraph.basic.corner_round_rect'}; | |
| 1248 | +mxShapeBasicCornerRoundRect.prototype.cst = { CORNER_ROUND_RECT: 'mxgraph.basic.corner_round_rect' }; | |
| 1345 | 1249 | |
| 1346 | 1250 | /** |
| 1347 | 1251 | * Function: paintVertexShape |
| 1348 | 1252 | * |
| 1349 | 1253 | * Paints the vertex shape. |
| 1350 | 1254 | */ |
| 1351 | -mxShapeBasicCornerRoundRect.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1352 | -{ | |
| 1255 | +mxShapeBasicCornerRoundRect.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1353 | 1256 | c.translate(x, y); |
| 1354 | 1257 | |
| 1355 | 1258 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 1356 | 1259 | |
| 1357 | 1260 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1358 | - | |
| 1261 | + | |
| 1359 | 1262 | c.begin(); |
| 1360 | 1263 | c.moveTo(dx, 0); |
| 1361 | 1264 | c.lineTo(w, 0); |
| ... | ... | @@ -1371,23 +1274,19 @@ mxCellRenderer.registerShape(mxShapeBasicCornerRoundRect.prototype.cst.CORNER_RO |
| 1371 | 1274 | |
| 1372 | 1275 | mxShapeBasicCornerRoundRect.prototype.constraints = null; |
| 1373 | 1276 | |
| 1374 | -Graph.handleFactory[mxShapeBasicCornerRoundRect.prototype.cst.CORNER_ROUND_RECT] = function(state) | |
| 1375 | -{ | |
| 1376 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1377 | - { | |
| 1277 | +Graph.handleFactory[mxShapeBasicCornerRoundRect.prototype.cst.CORNER_ROUND_RECT] = function (state) { | |
| 1278 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1378 | 1279 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1379 | 1280 | |
| 1380 | 1281 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1381 | - }, function(bounds, pt) | |
| 1382 | - { | |
| 1282 | + }, function (bounds, pt) { | |
| 1383 | 1283 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 1384 | 1284 | })]; |
| 1385 | - | |
| 1285 | + | |
| 1386 | 1286 | return handles; |
| 1387 | 1287 | }; |
| 1388 | 1288 | |
| 1389 | -mxShapeBasicCornerRoundRect.prototype.getConstraints = function(style, w, h) | |
| 1390 | -{ | |
| 1289 | +mxShapeBasicCornerRoundRect.prototype.getConstraints = function (style, w, h) { | |
| 1391 | 1290 | var constr = []; |
| 1392 | 1291 | |
| 1393 | 1292 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| ... | ... | @@ -1407,8 +1306,7 @@ mxShapeBasicCornerRoundRect.prototype.getConstraints = function(style, w, h) |
| 1407 | 1306 | /** |
| 1408 | 1307 | * Extends mxShape. |
| 1409 | 1308 | */ |
| 1410 | -function mxShapeBasicPlaque(bounds, fill, stroke, strokewidth) | |
| 1411 | -{ | |
| 1309 | +function mxShapeBasicPlaque(bounds, fill, stroke, strokewidth) { | |
| 1412 | 1310 | mxShape.call(this); |
| 1413 | 1311 | this.bounds = bounds; |
| 1414 | 1312 | this.fill = fill; |
| ... | ... | @@ -1423,24 +1321,23 @@ function mxShapeBasicPlaque(bounds, fill, stroke, strokewidth) |
| 1423 | 1321 | mxUtils.extend(mxShapeBasicPlaque, mxActor); |
| 1424 | 1322 | |
| 1425 | 1323 | mxShapeBasicPlaque.prototype.customProperties = [ |
| 1426 | - {name: 'dx', dispName: 'Cutoff Size', type: 'float', min:0, defVal:6}, | |
| 1324 | + { name: 'dx', dispName: 'Cutoff Size', type: 'float', min: 0, defVal: 6 }, | |
| 1427 | 1325 | ]; |
| 1428 | 1326 | |
| 1429 | -mxShapeBasicPlaque.prototype.cst = {PLAQUE : 'mxgraph.basic.plaque'}; | |
| 1327 | +mxShapeBasicPlaque.prototype.cst = { PLAQUE: 'mxgraph.basic.plaque' }; | |
| 1430 | 1328 | |
| 1431 | 1329 | /** |
| 1432 | 1330 | * Function: paintVertexShape |
| 1433 | 1331 | * |
| 1434 | 1332 | * Paints the vertex shape. |
| 1435 | 1333 | */ |
| 1436 | -mxShapeBasicPlaque.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1437 | -{ | |
| 1334 | +mxShapeBasicPlaque.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1438 | 1335 | c.translate(x, y); |
| 1439 | 1336 | |
| 1440 | 1337 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 1441 | 1338 | |
| 1442 | 1339 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1443 | - | |
| 1340 | + | |
| 1444 | 1341 | c.begin(); |
| 1445 | 1342 | c.moveTo(w - dx, 0); |
| 1446 | 1343 | c.arcTo(dx, dx, 0, 0, 0, w, dx); |
| ... | ... | @@ -1458,23 +1355,19 @@ mxCellRenderer.registerShape(mxShapeBasicPlaque.prototype.cst.PLAQUE, mxShapeBas |
| 1458 | 1355 | |
| 1459 | 1356 | mxShapeBasicPlaque.prototype.constraints = null; |
| 1460 | 1357 | |
| 1461 | -Graph.handleFactory[mxShapeBasicPlaque.prototype.cst.PLAQUE] = function(state) | |
| 1462 | -{ | |
| 1463 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1464 | - { | |
| 1358 | +Graph.handleFactory[mxShapeBasicPlaque.prototype.cst.PLAQUE] = function (state) { | |
| 1359 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1465 | 1360 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1466 | 1361 | |
| 1467 | 1362 | return new mxPoint(bounds.x + dx * 1.41, bounds.y + dx * 1.41); |
| 1468 | - }, function(bounds, pt) | |
| 1469 | - { | |
| 1363 | + }, function (bounds, pt) { | |
| 1470 | 1364 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 1471 | 1365 | })]; |
| 1472 | - | |
| 1366 | + | |
| 1473 | 1367 | return handles; |
| 1474 | 1368 | }; |
| 1475 | 1369 | |
| 1476 | -mxShapeBasicPlaque.prototype.getConstraints = function(style, w, h) | |
| 1477 | -{ | |
| 1370 | +mxShapeBasicPlaque.prototype.getConstraints = function (style, w, h) { | |
| 1478 | 1371 | var constr = []; |
| 1479 | 1372 | |
| 1480 | 1373 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| ... | ... | @@ -1491,8 +1384,7 @@ mxShapeBasicPlaque.prototype.getConstraints = function(style, w, h) |
| 1491 | 1384 | /** |
| 1492 | 1385 | * Extends mxShape. |
| 1493 | 1386 | */ |
| 1494 | -function mxShapeBasicFrame(bounds, fill, stroke, strokewidth) | |
| 1495 | -{ | |
| 1387 | +function mxShapeBasicFrame(bounds, fill, stroke, strokewidth) { | |
| 1496 | 1388 | mxShape.call(this); |
| 1497 | 1389 | this.bounds = bounds; |
| 1498 | 1390 | this.fill = fill; |
| ... | ... | @@ -1507,24 +1399,23 @@ function mxShapeBasicFrame(bounds, fill, stroke, strokewidth) |
| 1507 | 1399 | mxUtils.extend(mxShapeBasicFrame, mxActor); |
| 1508 | 1400 | |
| 1509 | 1401 | mxShapeBasicFrame.prototype.customProperties = [ |
| 1510 | - {name: 'dx', dispName: 'Width', type: 'float', min:0, defVal:10}, | |
| 1402 | + { name: 'dx', dispName: 'Width', type: 'float', min: 0, defVal: 10 }, | |
| 1511 | 1403 | ]; |
| 1512 | 1404 | |
| 1513 | -mxShapeBasicFrame.prototype.cst = {FRAME : 'mxgraph.basic.frame'}; | |
| 1405 | +mxShapeBasicFrame.prototype.cst = { FRAME: 'mxgraph.basic.frame' }; | |
| 1514 | 1406 | |
| 1515 | 1407 | /** |
| 1516 | 1408 | * Function: paintVertexShape |
| 1517 | 1409 | * |
| 1518 | 1410 | * Paints the vertex shape. |
| 1519 | 1411 | */ |
| 1520 | -mxShapeBasicFrame.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1521 | -{ | |
| 1412 | +mxShapeBasicFrame.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1522 | 1413 | c.translate(x, y); |
| 1523 | 1414 | |
| 1524 | 1415 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1525 | 1416 | |
| 1526 | 1417 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1527 | - | |
| 1418 | + | |
| 1528 | 1419 | c.begin(); |
| 1529 | 1420 | c.moveTo(w, 0); |
| 1530 | 1421 | c.lineTo(w, h); |
| ... | ... | @@ -1543,23 +1434,19 @@ mxCellRenderer.registerShape(mxShapeBasicFrame.prototype.cst.FRAME, mxShapeBasic |
| 1543 | 1434 | |
| 1544 | 1435 | mxShapeBasicFrame.prototype.constraints = null; |
| 1545 | 1436 | |
| 1546 | -Graph.handleFactory[mxShapeBasicFrame.prototype.cst.FRAME] = function(state) | |
| 1547 | -{ | |
| 1548 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1549 | - { | |
| 1437 | +Graph.handleFactory[mxShapeBasicFrame.prototype.cst.FRAME] = function (state) { | |
| 1438 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1550 | 1439 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1551 | 1440 | |
| 1552 | 1441 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1553 | - }, function(bounds, pt) | |
| 1554 | - { | |
| 1442 | + }, function (bounds, pt) { | |
| 1555 | 1443 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x))) / 100; |
| 1556 | 1444 | })]; |
| 1557 | - | |
| 1445 | + | |
| 1558 | 1446 | return handles; |
| 1559 | 1447 | }; |
| 1560 | 1448 | |
| 1561 | -mxShapeBasicFrame.prototype.getConstraints = function(style, w, h) | |
| 1562 | -{ | |
| 1449 | +mxShapeBasicFrame.prototype.getConstraints = function (style, w, h) { | |
| 1563 | 1450 | var constr = []; |
| 1564 | 1451 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1565 | 1452 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| ... | ... | @@ -1581,17 +1468,17 @@ mxShapeBasicFrame.prototype.getConstraints = function(style, w, h) |
| 1581 | 1468 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false)); |
| 1582 | 1469 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, 0, h * 0.25)); |
| 1583 | 1470 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, dx)); |
| 1584 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - 2 * dx)* 0.25 + dx, dx)); | |
| 1471 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - 2 * dx) * 0.25 + dx, dx)); | |
| 1585 | 1472 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false, null, 0, dx)); |
| 1586 | 1473 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w * 1.5 - dx) * 0.5, dx)); |
| 1587 | 1474 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false, null, -dx, dx)); |
| 1588 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, (h - 2 * dx)* 0.25 + dx)); | |
| 1475 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, (h - 2 * dx) * 0.25 + dx)); | |
| 1589 | 1476 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0.5), false, null, -dx, 0)); |
| 1590 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, (h - 2 * dx) * 0.75 + dx)); | |
| 1477 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, w - dx, (h - 2 * dx) * 0.75 + dx)); | |
| 1591 | 1478 | constr.push(new mxConnectionConstraint(new mxPoint(1, 1), false, null, -dx, -dx)); |
| 1592 | 1479 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - 2 * dx) * 0.75 + dx, h - dx)); |
| 1593 | 1480 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 1), false, null, 0, -dx)); |
| 1594 | - constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - 2 * dx) * 0.25 + dx, h - dx)); | |
| 1481 | + constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - 2 * dx) * 0.25 + dx, h - dx)); | |
| 1595 | 1482 | constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false, null, dx, -dx)); |
| 1596 | 1483 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, dx, (h - 2 * dx) * 0.75 + dx)); |
| 1597 | 1484 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0.5), false, null, dx, 0)); |
| ... | ... | @@ -1606,8 +1493,7 @@ mxShapeBasicFrame.prototype.getConstraints = function(style, w, h) |
| 1606 | 1493 | /** |
| 1607 | 1494 | * Extends mxShape. |
| 1608 | 1495 | */ |
| 1609 | -function mxShapeBasicPlaqueFrame(bounds, fill, stroke, strokewidth) | |
| 1610 | -{ | |
| 1496 | +function mxShapeBasicPlaqueFrame(bounds, fill, stroke, strokewidth) { | |
| 1611 | 1497 | mxShape.call(this); |
| 1612 | 1498 | this.bounds = bounds; |
| 1613 | 1499 | this.fill = fill; |
| ... | ... | @@ -1621,24 +1507,23 @@ function mxShapeBasicPlaqueFrame(bounds, fill, stroke, strokewidth) |
| 1621 | 1507 | mxUtils.extend(mxShapeBasicPlaqueFrame, mxActor); |
| 1622 | 1508 | |
| 1623 | 1509 | mxShapeBasicPlaqueFrame.prototype.customProperties = [ |
| 1624 | - {name: 'dx', dispName: 'Width', type: 'float', mix:0, defVal:10}, | |
| 1510 | + { name: 'dx', dispName: 'Width', type: 'float', mix: 0, defVal: 10 }, | |
| 1625 | 1511 | ]; |
| 1626 | 1512 | |
| 1627 | -mxShapeBasicPlaqueFrame.prototype.cst = {PLAQUE_FRAME : 'mxgraph.basic.plaque_frame'}; | |
| 1513 | +mxShapeBasicPlaqueFrame.prototype.cst = { PLAQUE_FRAME: 'mxgraph.basic.plaque_frame' }; | |
| 1628 | 1514 | |
| 1629 | 1515 | /** |
| 1630 | 1516 | * Function: paintVertexShape |
| 1631 | 1517 | * |
| 1632 | 1518 | * Paints the vertex shape. |
| 1633 | 1519 | */ |
| 1634 | -mxShapeBasicPlaqueFrame.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1635 | -{ | |
| 1520 | +mxShapeBasicPlaqueFrame.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1636 | 1521 | c.translate(x, y); |
| 1637 | 1522 | |
| 1638 | 1523 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1639 | 1524 | |
| 1640 | 1525 | dx = Math.min(w * 0.25, h * 0.25, dx); |
| 1641 | - | |
| 1526 | + | |
| 1642 | 1527 | c.begin(); |
| 1643 | 1528 | c.moveTo(w - dx, 0); |
| 1644 | 1529 | c.arcTo(dx, dx, 0, 0, 0, w, dx); |
| ... | ... | @@ -1649,7 +1534,7 @@ mxShapeBasicPlaqueFrame.prototype.paintVertexShape = function(c, x, y, w, h) |
| 1649 | 1534 | c.lineTo(0, dx); |
| 1650 | 1535 | c.arcTo(dx, dx, 0, 0, 0, dx, 0); |
| 1651 | 1536 | c.close(); |
| 1652 | - | |
| 1537 | + | |
| 1653 | 1538 | c.moveTo(dx * 2, dx); |
| 1654 | 1539 | c.arcTo(dx * 2, dx * 2, 0, 0, 1, dx, dx * 2); |
| 1655 | 1540 | c.lineTo(dx, h - 2 * dx); |
| ... | ... | @@ -1668,23 +1553,19 @@ mxCellRenderer.registerShape(mxShapeBasicPlaqueFrame.prototype.cst.PLAQUE_FRAME, |
| 1668 | 1553 | |
| 1669 | 1554 | mxShapeBasicPlaqueFrame.prototype.constraints = null; |
| 1670 | 1555 | |
| 1671 | -Graph.handleFactory[mxShapeBasicPlaqueFrame.prototype.cst.PLAQUE_FRAME] = function(state) | |
| 1672 | -{ | |
| 1673 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1674 | - { | |
| 1556 | +Graph.handleFactory[mxShapeBasicPlaqueFrame.prototype.cst.PLAQUE_FRAME] = function (state) { | |
| 1557 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1675 | 1558 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1676 | 1559 | |
| 1677 | 1560 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1678 | - }, function(bounds, pt) | |
| 1679 | - { | |
| 1561 | + }, function (bounds, pt) { | |
| 1680 | 1562 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 1681 | 1563 | })]; |
| 1682 | - | |
| 1564 | + | |
| 1683 | 1565 | return handles; |
| 1684 | 1566 | }; |
| 1685 | 1567 | |
| 1686 | -mxShapeBasicPlaqueFrame.prototype.getConstraints = function(style, w, h) | |
| 1687 | -{ | |
| 1568 | +mxShapeBasicPlaqueFrame.prototype.getConstraints = function (style, w, h) { | |
| 1688 | 1569 | var constr = []; |
| 1689 | 1570 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1690 | 1571 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| ... | ... | @@ -1707,8 +1588,7 @@ mxShapeBasicPlaqueFrame.prototype.getConstraints = function(style, w, h) |
| 1707 | 1588 | /** |
| 1708 | 1589 | * Extends mxShape. |
| 1709 | 1590 | */ |
| 1710 | -function mxShapeBasicRoundedFrame(bounds, fill, stroke, strokewidth) | |
| 1711 | -{ | |
| 1591 | +function mxShapeBasicRoundedFrame(bounds, fill, stroke, strokewidth) { | |
| 1712 | 1592 | mxShape.call(this); |
| 1713 | 1593 | this.bounds = bounds; |
| 1714 | 1594 | this.fill = fill; |
| ... | ... | @@ -1723,24 +1603,23 @@ function mxShapeBasicRoundedFrame(bounds, fill, stroke, strokewidth) |
| 1723 | 1603 | mxUtils.extend(mxShapeBasicRoundedFrame, mxActor); |
| 1724 | 1604 | |
| 1725 | 1605 | mxShapeBasicRoundedFrame.prototype.customProperties = [ |
| 1726 | - {name: 'dx', dispName: 'Width', type: 'float', min:0, defVal:10}, | |
| 1606 | + { name: 'dx', dispName: 'Width', type: 'float', min: 0, defVal: 10 }, | |
| 1727 | 1607 | ]; |
| 1728 | 1608 | |
| 1729 | -mxShapeBasicRoundedFrame.prototype.cst = {ROUNDED_FRAME : 'mxgraph.basic.rounded_frame'}; | |
| 1609 | +mxShapeBasicRoundedFrame.prototype.cst = { ROUNDED_FRAME: 'mxgraph.basic.rounded_frame' }; | |
| 1730 | 1610 | |
| 1731 | 1611 | /** |
| 1732 | 1612 | * Function: paintVertexShape |
| 1733 | 1613 | * |
| 1734 | 1614 | * Paints the vertex shape. |
| 1735 | 1615 | */ |
| 1736 | -mxShapeBasicRoundedFrame.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1737 | -{ | |
| 1616 | +mxShapeBasicRoundedFrame.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1738 | 1617 | c.translate(x, y); |
| 1739 | 1618 | |
| 1740 | 1619 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1741 | 1620 | |
| 1742 | 1621 | dx = Math.min(w * 0.25, h * 0.25, dx); |
| 1743 | - | |
| 1622 | + | |
| 1744 | 1623 | c.begin(); |
| 1745 | 1624 | c.moveTo(w - 2 * dx, 0); |
| 1746 | 1625 | c.arcTo(dx * 2, dx * 2, 0, 0, 1, w, 2 * dx); |
| ... | ... | @@ -1751,7 +1630,7 @@ mxShapeBasicRoundedFrame.prototype.paintVertexShape = function(c, x, y, w, h) |
| 1751 | 1630 | c.lineTo(0, 2 * dx); |
| 1752 | 1631 | c.arcTo(dx * 2, dx * 2, 0, 0, 1, 2 * dx, 0); |
| 1753 | 1632 | c.close(); |
| 1754 | - | |
| 1633 | + | |
| 1755 | 1634 | c.moveTo(dx * 2, dx); |
| 1756 | 1635 | c.arcTo(dx, dx, 0, 0, 0, dx, dx * 2); |
| 1757 | 1636 | c.lineTo(dx, h - 2 * dx); |
| ... | ... | @@ -1770,23 +1649,19 @@ mxCellRenderer.registerShape(mxShapeBasicRoundedFrame.prototype.cst.ROUNDED_FRAM |
| 1770 | 1649 | |
| 1771 | 1650 | mxShapeBasicRoundedFrame.prototype.constraints = null; |
| 1772 | 1651 | |
| 1773 | -Graph.handleFactory[mxShapeBasicRoundedFrame.prototype.cst.ROUNDED_FRAME] = function(state) | |
| 1774 | -{ | |
| 1775 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1776 | - { | |
| 1652 | +Graph.handleFactory[mxShapeBasicRoundedFrame.prototype.cst.ROUNDED_FRAME] = function (state) { | |
| 1653 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1777 | 1654 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1778 | 1655 | |
| 1779 | 1656 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1780 | - }, function(bounds, pt) | |
| 1781 | - { | |
| 1657 | + }, function (bounds, pt) { | |
| 1782 | 1658 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 1783 | 1659 | })]; |
| 1784 | - | |
| 1660 | + | |
| 1785 | 1661 | return handles; |
| 1786 | 1662 | }; |
| 1787 | 1663 | |
| 1788 | -mxShapeBasicRoundedFrame.prototype.getConstraints = function(style, w, h) | |
| 1789 | -{ | |
| 1664 | +mxShapeBasicRoundedFrame.prototype.getConstraints = function (style, w, h) { | |
| 1790 | 1665 | var constr = []; |
| 1791 | 1666 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1792 | 1667 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| ... | ... | @@ -1809,8 +1684,7 @@ mxShapeBasicRoundedFrame.prototype.getConstraints = function(style, w, h) |
| 1809 | 1684 | /** |
| 1810 | 1685 | * Extends mxShape. |
| 1811 | 1686 | */ |
| 1812 | -function mxShapeBasicFrameCorner(bounds, fill, stroke, strokewidth) | |
| 1813 | -{ | |
| 1687 | +function mxShapeBasicFrameCorner(bounds, fill, stroke, strokewidth) { | |
| 1814 | 1688 | mxShape.call(this); |
| 1815 | 1689 | this.bounds = bounds; |
| 1816 | 1690 | this.fill = fill; |
| ... | ... | @@ -1825,24 +1699,23 @@ function mxShapeBasicFrameCorner(bounds, fill, stroke, strokewidth) |
| 1825 | 1699 | mxUtils.extend(mxShapeBasicFrameCorner, mxActor); |
| 1826 | 1700 | |
| 1827 | 1701 | mxShapeBasicFrameCorner.prototype.customProperties = [ |
| 1828 | - {name: 'dx', dispName: 'Width', type: 'float', min:0, defVal:10}, | |
| 1702 | + { name: 'dx', dispName: 'Width', type: 'float', min: 0, defVal: 10 }, | |
| 1829 | 1703 | ]; |
| 1830 | 1704 | |
| 1831 | -mxShapeBasicFrameCorner.prototype.cst = {FRAME_CORNER : 'mxgraph.basic.frame_corner'}; | |
| 1705 | +mxShapeBasicFrameCorner.prototype.cst = { FRAME_CORNER: 'mxgraph.basic.frame_corner' }; | |
| 1832 | 1706 | |
| 1833 | 1707 | /** |
| 1834 | 1708 | * Function: paintVertexShape |
| 1835 | 1709 | * |
| 1836 | 1710 | * Paints the vertex shape. |
| 1837 | 1711 | */ |
| 1838 | -mxShapeBasicFrameCorner.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1839 | -{ | |
| 1712 | +mxShapeBasicFrameCorner.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1840 | 1713 | c.translate(x, y); |
| 1841 | 1714 | |
| 1842 | 1715 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1843 | 1716 | |
| 1844 | 1717 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1845 | - | |
| 1718 | + | |
| 1846 | 1719 | c.begin(); |
| 1847 | 1720 | c.moveTo(0, 0); |
| 1848 | 1721 | c.lineTo(w, 0); |
| ... | ... | @@ -1858,28 +1731,24 @@ mxCellRenderer.registerShape(mxShapeBasicFrameCorner.prototype.cst.FRAME_CORNER, |
| 1858 | 1731 | |
| 1859 | 1732 | mxShapeBasicFrameCorner.prototype.constraints = null; |
| 1860 | 1733 | |
| 1861 | -Graph.handleFactory[mxShapeBasicFrameCorner.prototype.cst.FRAME_CORNER] = function(state) | |
| 1862 | -{ | |
| 1863 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1864 | - { | |
| 1734 | +Graph.handleFactory[mxShapeBasicFrameCorner.prototype.cst.FRAME_CORNER] = function (state) { | |
| 1735 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1865 | 1736 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1866 | 1737 | |
| 1867 | 1738 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 1868 | - }, function(bounds, pt) | |
| 1869 | - { | |
| 1739 | + }, function (bounds, pt) { | |
| 1870 | 1740 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x))) / 100; |
| 1871 | 1741 | })]; |
| 1872 | - | |
| 1742 | + | |
| 1873 | 1743 | return handles; |
| 1874 | 1744 | }; |
| 1875 | 1745 | |
| 1876 | -mxShapeBasicFrameCorner.prototype.getConstraints = function(style, w, h) | |
| 1877 | -{ | |
| 1746 | +mxShapeBasicFrameCorner.prototype.getConstraints = function (style, w, h) { | |
| 1878 | 1747 | var constr = []; |
| 1879 | 1748 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1880 | 1749 | |
| 1881 | 1750 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 1882 | - | |
| 1751 | + | |
| 1883 | 1752 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false)); |
| 1884 | 1753 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| 1885 | 1754 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false)); |
| ... | ... | @@ -1900,8 +1769,7 @@ mxShapeBasicFrameCorner.prototype.getConstraints = function(style, w, h) |
| 1900 | 1769 | /** |
| 1901 | 1770 | * Extends mxShape. |
| 1902 | 1771 | */ |
| 1903 | -function mxShapeBasicDiagStripe(bounds, fill, stroke, strokewidth) | |
| 1904 | -{ | |
| 1772 | +function mxShapeBasicDiagStripe(bounds, fill, stroke, strokewidth) { | |
| 1905 | 1773 | mxShape.call(this); |
| 1906 | 1774 | this.bounds = bounds; |
| 1907 | 1775 | this.fill = fill; |
| ... | ... | @@ -1916,24 +1784,23 @@ function mxShapeBasicDiagStripe(bounds, fill, stroke, strokewidth) |
| 1916 | 1784 | mxUtils.extend(mxShapeBasicDiagStripe, mxActor); |
| 1917 | 1785 | |
| 1918 | 1786 | mxShapeBasicDiagStripe.prototype.customProperties = [ |
| 1919 | - {name: 'dx', dispName: 'Width', type: 'float', mix:0, defVal:10}, | |
| 1787 | + { name: 'dx', dispName: 'Width', type: 'float', mix: 0, defVal: 10 }, | |
| 1920 | 1788 | ]; |
| 1921 | 1789 | |
| 1922 | -mxShapeBasicDiagStripe.prototype.cst = {DIAG_STRIPE : 'mxgraph.basic.diag_stripe'}; | |
| 1790 | +mxShapeBasicDiagStripe.prototype.cst = { DIAG_STRIPE: 'mxgraph.basic.diag_stripe' }; | |
| 1923 | 1791 | |
| 1924 | 1792 | /** |
| 1925 | 1793 | * Function: paintVertexShape |
| 1926 | 1794 | * |
| 1927 | 1795 | * Paints the vertex shape. |
| 1928 | 1796 | */ |
| 1929 | -mxShapeBasicDiagStripe.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 1930 | -{ | |
| 1797 | +mxShapeBasicDiagStripe.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 1931 | 1798 | c.translate(x, y); |
| 1932 | 1799 | |
| 1933 | 1800 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1934 | 1801 | |
| 1935 | 1802 | dx = Math.min(w, h, dx); |
| 1936 | - | |
| 1803 | + | |
| 1937 | 1804 | c.begin(); |
| 1938 | 1805 | c.moveTo(0, h); |
| 1939 | 1806 | c.lineTo(w, 0); |
| ... | ... | @@ -1947,27 +1814,23 @@ mxCellRenderer.registerShape(mxShapeBasicDiagStripe.prototype.cst.DIAG_STRIPE, m |
| 1947 | 1814 | |
| 1948 | 1815 | mxShapeBasicDiagStripe.prototype.constraints = null; |
| 1949 | 1816 | |
| 1950 | -Graph.handleFactory[mxShapeBasicDiagStripe.prototype.cst.DIAG_STRIPE] = function(state) | |
| 1951 | -{ | |
| 1952 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 1953 | - { | |
| 1817 | +Graph.handleFactory[mxShapeBasicDiagStripe.prototype.cst.DIAG_STRIPE] = function (state) { | |
| 1818 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 1954 | 1819 | var dx = Math.max(0, Math.min(bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 1955 | 1820 | |
| 1956 | 1821 | return new mxPoint(bounds.x + dx, bounds.y + bounds.height); |
| 1957 | - }, function(bounds, pt) | |
| 1958 | - { | |
| 1822 | + }, function (bounds, pt) { | |
| 1959 | 1823 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x))) / 100; |
| 1960 | 1824 | })]; |
| 1961 | - | |
| 1825 | + | |
| 1962 | 1826 | return handles; |
| 1963 | 1827 | }; |
| 1964 | 1828 | |
| 1965 | -mxShapeBasicDiagStripe.prototype.getConstraints = function(style, w, h) | |
| 1966 | -{ | |
| 1829 | +mxShapeBasicDiagStripe.prototype.getConstraints = function (style, w, h) { | |
| 1967 | 1830 | var constr = []; |
| 1968 | 1831 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 1969 | 1832 | dx = Math.min(w, h, dx); |
| 1970 | - | |
| 1833 | + | |
| 1971 | 1834 | constr.push(new mxConnectionConstraint(new mxPoint(0, 1), false)); |
| 1972 | 1835 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0.5), false)); |
| 1973 | 1836 | constr.push(new mxConnectionConstraint(new mxPoint(1, 0), false)); |
| ... | ... | @@ -1986,8 +1849,7 @@ mxShapeBasicDiagStripe.prototype.getConstraints = function(style, w, h) |
| 1986 | 1849 | /** |
| 1987 | 1850 | * Extends mxShape. |
| 1988 | 1851 | */ |
| 1989 | -function mxShapeBasicDonut(bounds, fill, stroke, strokewidth) | |
| 1990 | -{ | |
| 1852 | +function mxShapeBasicDonut(bounds, fill, stroke, strokewidth) { | |
| 1991 | 1853 | mxShape.call(this); |
| 1992 | 1854 | this.bounds = bounds; |
| 1993 | 1855 | this.fill = fill; |
| ... | ... | @@ -2002,24 +1864,23 @@ function mxShapeBasicDonut(bounds, fill, stroke, strokewidth) |
| 2002 | 1864 | mxUtils.extend(mxShapeBasicDonut, mxActor); |
| 2003 | 1865 | |
| 2004 | 1866 | mxShapeBasicDonut.prototype.customProperties = [ |
| 2005 | - {name: 'dx', dispName: 'Width', type: 'float', min:0, defVal:25} | |
| 1867 | + { name: 'dx', dispName: 'Width', type: 'float', min: 0, defVal: 25 } | |
| 2006 | 1868 | ]; |
| 2007 | 1869 | |
| 2008 | -mxShapeBasicDonut.prototype.cst = {DONUT : 'mxgraph.basic.donut'}; | |
| 1870 | +mxShapeBasicDonut.prototype.cst = { DONUT: 'mxgraph.basic.donut' }; | |
| 2009 | 1871 | |
| 2010 | 1872 | /** |
| 2011 | 1873 | * Function: paintVertexShape |
| 2012 | 1874 | * |
| 2013 | 1875 | * Paints the vertex shape. |
| 2014 | 1876 | */ |
| 2015 | -mxShapeBasicDonut.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2016 | -{ | |
| 1877 | +mxShapeBasicDonut.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2017 | 1878 | c.translate(x, y); |
| 2018 | 1879 | |
| 2019 | 1880 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 2020 | 1881 | |
| 2021 | 1882 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 2022 | - | |
| 1883 | + | |
| 2023 | 1884 | c.begin(); |
| 2024 | 1885 | c.moveTo(0, h * 0.5); |
| 2025 | 1886 | c.arcTo(w * 0.5, h * 0.5, 0, 0, 1, w * 0.5, 0); |
| ... | ... | @@ -2040,18 +1901,15 @@ mxCellRenderer.registerShape(mxShapeBasicDonut.prototype.cst.DONUT, mxShapeBasic |
| 2040 | 1901 | |
| 2041 | 1902 | mxShapeBasicDonut.prototype.constraints = null; |
| 2042 | 1903 | |
| 2043 | -Graph.handleFactory[mxShapeBasicDonut.prototype.cst.DONUT] = function(state) | |
| 2044 | -{ | |
| 2045 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 2046 | - { | |
| 1904 | +Graph.handleFactory[mxShapeBasicDonut.prototype.cst.DONUT] = function (state) { | |
| 1905 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 2047 | 1906 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 2048 | 1907 | |
| 2049 | 1908 | return new mxPoint(bounds.x + dx, bounds.y + bounds.height / 2); |
| 2050 | - }, function(bounds, pt) | |
| 2051 | - { | |
| 1909 | + }, function (bounds, pt) { | |
| 2052 | 1910 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x))) / 100; |
| 2053 | 1911 | })]; |
| 2054 | - | |
| 1912 | + | |
| 2055 | 1913 | return handles; |
| 2056 | 1914 | }; |
| 2057 | 1915 | |
| ... | ... | @@ -2061,8 +1919,7 @@ Graph.handleFactory[mxShapeBasicDonut.prototype.cst.DONUT] = function(state) |
| 2061 | 1919 | /** |
| 2062 | 1920 | * Extends mxShape. |
| 2063 | 1921 | */ |
| 2064 | -function mxShapeBasicLayeredRect(bounds, fill, stroke, strokewidth) | |
| 2065 | -{ | |
| 1922 | +function mxShapeBasicLayeredRect(bounds, fill, stroke, strokewidth) { | |
| 2066 | 1923 | mxShape.call(this); |
| 2067 | 1924 | this.bounds = bounds; |
| 2068 | 1925 | this.fill = fill; |
| ... | ... | @@ -2077,24 +1934,23 @@ function mxShapeBasicLayeredRect(bounds, fill, stroke, strokewidth) |
| 2077 | 1934 | mxUtils.extend(mxShapeBasicLayeredRect, mxActor); |
| 2078 | 1935 | |
| 2079 | 1936 | mxShapeBasicLayeredRect.prototype.customProperties = [ |
| 2080 | - {name: 'dx', dispName: 'Layer Distance', type: 'float', mix:0, defVal:10} | |
| 1937 | + { name: 'dx', dispName: 'Layer Distance', type: 'float', mix: 0, defVal: 10 } | |
| 2081 | 1938 | ]; |
| 2082 | 1939 | |
| 2083 | -mxShapeBasicLayeredRect.prototype.cst = {LAYERED_RECT : 'mxgraph.basic.layered_rect'}; | |
| 1940 | +mxShapeBasicLayeredRect.prototype.cst = { LAYERED_RECT: 'mxgraph.basic.layered_rect' }; | |
| 2084 | 1941 | |
| 2085 | 1942 | /** |
| 2086 | 1943 | * Function: paintVertexShape |
| 2087 | 1944 | * |
| 2088 | 1945 | * Paints the vertex shape. |
| 2089 | 1946 | */ |
| 2090 | -mxShapeBasicLayeredRect.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2091 | -{ | |
| 1947 | +mxShapeBasicLayeredRect.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2092 | 1948 | c.translate(x, y); |
| 2093 | 1949 | |
| 2094 | 1950 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 2095 | 1951 | |
| 2096 | 1952 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 2097 | - | |
| 1953 | + | |
| 2098 | 1954 | c.begin(); |
| 2099 | 1955 | c.moveTo(dx, dx); |
| 2100 | 1956 | c.lineTo(w, dx); |
| ... | ... | @@ -2102,7 +1958,7 @@ mxShapeBasicLayeredRect.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2102 | 1958 | c.lineTo(dx, h); |
| 2103 | 1959 | c.close(); |
| 2104 | 1960 | c.fillAndStroke(); |
| 2105 | - | |
| 1961 | + | |
| 2106 | 1962 | c.begin(); |
| 2107 | 1963 | c.moveTo(dx * 0.5, dx * 0.5); |
| 2108 | 1964 | c.lineTo(w - dx * 0.5, dx * 0.5); |
| ... | ... | @@ -2110,7 +1966,7 @@ mxShapeBasicLayeredRect.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2110 | 1966 | c.lineTo(dx * 0.5, h - dx * 0.5); |
| 2111 | 1967 | c.close(); |
| 2112 | 1968 | c.fillAndStroke(); |
| 2113 | - | |
| 1969 | + | |
| 2114 | 1970 | c.begin(); |
| 2115 | 1971 | c.moveTo(0, 0); |
| 2116 | 1972 | c.lineTo(w - dx, 0); |
| ... | ... | @@ -2124,27 +1980,23 @@ mxCellRenderer.registerShape(mxShapeBasicLayeredRect.prototype.cst.LAYERED_RECT, |
| 2124 | 1980 | |
| 2125 | 1981 | mxShapeBasicLayeredRect.prototype.constraints = null; |
| 2126 | 1982 | |
| 2127 | -Graph.handleFactory[mxShapeBasicLayeredRect.prototype.cst.LAYERED_RECT] = function(state) | |
| 2128 | -{ | |
| 2129 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 2130 | - { | |
| 1983 | +Graph.handleFactory[mxShapeBasicLayeredRect.prototype.cst.LAYERED_RECT] = function (state) { | |
| 1984 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 2131 | 1985 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 2132 | 1986 | |
| 2133 | 1987 | return new mxPoint(bounds.x + bounds.width - dx, bounds.y + bounds.height - dx); |
| 2134 | - }, function(bounds, pt) | |
| 2135 | - { | |
| 1988 | + }, function (bounds, pt) { | |
| 2136 | 1989 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, - pt.x + bounds.width + bounds.x))) / 100; |
| 2137 | 1990 | })]; |
| 2138 | - | |
| 1991 | + | |
| 2139 | 1992 | return handles; |
| 2140 | 1993 | }; |
| 2141 | 1994 | |
| 2142 | -mxShapeBasicLayeredRect.prototype.getConstraints = function(style, w, h) | |
| 2143 | -{ | |
| 1995 | +mxShapeBasicLayeredRect.prototype.getConstraints = function (style, w, h) { | |
| 2144 | 1996 | var constr = []; |
| 2145 | 1997 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 2146 | 1998 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 2147 | - | |
| 1999 | + | |
| 2148 | 2000 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false)); |
| 2149 | 2001 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.25, 0)); |
| 2150 | 2002 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false, null, (w - dx) * 0.5, 0)); |
| ... | ... | @@ -2175,8 +2027,7 @@ mxShapeBasicLayeredRect.prototype.getConstraints = function(style, w, h) |
| 2175 | 2027 | /** |
| 2176 | 2028 | * Extends mxShape. |
| 2177 | 2029 | */ |
| 2178 | -function mxShapeBasicButton(bounds, fill, stroke, strokewidth) | |
| 2179 | -{ | |
| 2030 | +function mxShapeBasicButton(bounds, fill, stroke, strokewidth) { | |
| 2180 | 2031 | mxShape.call(this); |
| 2181 | 2032 | this.bounds = bounds; |
| 2182 | 2033 | this.fill = fill; |
| ... | ... | @@ -2191,24 +2042,23 @@ function mxShapeBasicButton(bounds, fill, stroke, strokewidth) |
| 2191 | 2042 | mxUtils.extend(mxShapeBasicButton, mxActor); |
| 2192 | 2043 | |
| 2193 | 2044 | mxShapeBasicButton.prototype.customProperties = [ |
| 2194 | - {name: 'dx', dispName: 'Button Height', type: 'float', min:0, defVal:10} | |
| 2045 | + { name: 'dx', dispName: 'Button Height', type: 'float', min: 0, defVal: 10 } | |
| 2195 | 2046 | ]; |
| 2196 | 2047 | |
| 2197 | -mxShapeBasicButton.prototype.cst = {BUTTON : 'mxgraph.basic.button'}; | |
| 2048 | +mxShapeBasicButton.prototype.cst = { BUTTON: 'mxgraph.basic.button' }; | |
| 2198 | 2049 | |
| 2199 | 2050 | /** |
| 2200 | 2051 | * Function: paintVertexShape |
| 2201 | 2052 | * |
| 2202 | 2053 | * Paints the vertex shape. |
| 2203 | 2054 | */ |
| 2204 | -mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2205 | -{ | |
| 2055 | +mxShapeBasicButton.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2206 | 2056 | c.translate(x, y); |
| 2207 | 2057 | |
| 2208 | 2058 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 2209 | 2059 | |
| 2210 | 2060 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 2211 | - | |
| 2061 | + | |
| 2212 | 2062 | c.begin(); |
| 2213 | 2063 | c.moveTo(0, 0); |
| 2214 | 2064 | c.lineTo(w, 0); |
| ... | ... | @@ -2216,10 +2066,10 @@ mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2216 | 2066 | c.lineTo(0, h); |
| 2217 | 2067 | c.close(); |
| 2218 | 2068 | c.fillAndStroke(); |
| 2219 | - | |
| 2069 | + | |
| 2220 | 2070 | c.setShadow(false); |
| 2221 | 2071 | c.setLineJoin('round'); |
| 2222 | - | |
| 2072 | + | |
| 2223 | 2073 | c.begin(); |
| 2224 | 2074 | c.moveTo(0, h); |
| 2225 | 2075 | c.lineTo(0, 0); |
| ... | ... | @@ -2227,7 +2077,7 @@ mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2227 | 2077 | c.lineTo(dx, h - dx); |
| 2228 | 2078 | c.close(); |
| 2229 | 2079 | c.fillAndStroke(); |
| 2230 | - | |
| 2080 | + | |
| 2231 | 2081 | c.begin(); |
| 2232 | 2082 | c.moveTo(0, 0); |
| 2233 | 2083 | c.lineTo(w, 0); |
| ... | ... | @@ -2235,7 +2085,7 @@ mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2235 | 2085 | c.lineTo(dx, dx); |
| 2236 | 2086 | c.close(); |
| 2237 | 2087 | c.fillAndStroke(); |
| 2238 | - | |
| 2088 | + | |
| 2239 | 2089 | c.begin(); |
| 2240 | 2090 | c.moveTo(w, 0); |
| 2241 | 2091 | c.lineTo(w, h); |
| ... | ... | @@ -2243,7 +2093,7 @@ mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2243 | 2093 | c.lineTo(w - dx, dx); |
| 2244 | 2094 | c.close(); |
| 2245 | 2095 | c.fillAndStroke(); |
| 2246 | - | |
| 2096 | + | |
| 2247 | 2097 | c.begin(); |
| 2248 | 2098 | c.moveTo(0, h); |
| 2249 | 2099 | c.lineTo(dx, h - dx); |
| ... | ... | @@ -2251,7 +2101,7 @@ mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2251 | 2101 | c.lineTo(w, h); |
| 2252 | 2102 | c.close(); |
| 2253 | 2103 | c.fillAndStroke(); |
| 2254 | - | |
| 2104 | + | |
| 2255 | 2105 | c.begin(); |
| 2256 | 2106 | c.moveTo(0, h); |
| 2257 | 2107 | c.lineTo(0, 0); |
| ... | ... | @@ -2259,26 +2109,23 @@ mxShapeBasicButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2259 | 2109 | c.lineTo(dx, h - dx); |
| 2260 | 2110 | c.close(); |
| 2261 | 2111 | c.fillAndStroke(); |
| 2262 | - | |
| 2263 | - | |
| 2112 | + | |
| 2113 | + | |
| 2264 | 2114 | }; |
| 2265 | 2115 | |
| 2266 | 2116 | mxCellRenderer.registerShape(mxShapeBasicButton.prototype.cst.BUTTON, mxShapeBasicButton); |
| 2267 | 2117 | |
| 2268 | 2118 | mxShapeBasicButton.prototype.constraints = null; |
| 2269 | 2119 | |
| 2270 | -Graph.handleFactory[mxShapeBasicButton.prototype.cst.BUTTON] = function(state) | |
| 2271 | -{ | |
| 2272 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 2273 | - { | |
| 2120 | +Graph.handleFactory[mxShapeBasicButton.prototype.cst.BUTTON] = function (state) { | |
| 2121 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 2274 | 2122 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 2275 | 2123 | |
| 2276 | 2124 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 2277 | - }, function(bounds, pt) | |
| 2278 | - { | |
| 2125 | + }, function (bounds, pt) { | |
| 2279 | 2126 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x))) / 100; |
| 2280 | 2127 | })]; |
| 2281 | - | |
| 2128 | + | |
| 2282 | 2129 | return handles; |
| 2283 | 2130 | }; |
| 2284 | 2131 | |
| ... | ... | @@ -2288,8 +2135,7 @@ Graph.handleFactory[mxShapeBasicButton.prototype.cst.BUTTON] = function(state) |
| 2288 | 2135 | /** |
| 2289 | 2136 | * Extends mxShape. |
| 2290 | 2137 | */ |
| 2291 | -function mxShapeBasicShadedButton(bounds, fill, stroke, strokewidth) | |
| 2292 | -{ | |
| 2138 | +function mxShapeBasicShadedButton(bounds, fill, stroke, strokewidth) { | |
| 2293 | 2139 | mxShape.call(this); |
| 2294 | 2140 | this.bounds = bounds; |
| 2295 | 2141 | this.fill = fill; |
| ... | ... | @@ -2304,26 +2150,25 @@ function mxShapeBasicShadedButton(bounds, fill, stroke, strokewidth) |
| 2304 | 2150 | mxUtils.extend(mxShapeBasicShadedButton, mxActor); |
| 2305 | 2151 | |
| 2306 | 2152 | mxShapeBasicShadedButton.prototype.customProperties = [ |
| 2307 | - {name: 'dx', dispName: 'Button Height', type: 'float', min:0, defVal:10} | |
| 2153 | + { name: 'dx', dispName: 'Button Height', type: 'float', min: 0, defVal: 10 } | |
| 2308 | 2154 | ]; |
| 2309 | 2155 | |
| 2310 | -mxShapeBasicShadedButton.prototype.cst = {SHADED_BUTTON : 'mxgraph.basic.shaded_button'}; | |
| 2156 | +mxShapeBasicShadedButton.prototype.cst = { SHADED_BUTTON: 'mxgraph.basic.shaded_button' }; | |
| 2311 | 2157 | |
| 2312 | 2158 | /** |
| 2313 | 2159 | * Function: paintVertexShape |
| 2314 | 2160 | * |
| 2315 | 2161 | * Paints the vertex shape. |
| 2316 | 2162 | */ |
| 2317 | -mxShapeBasicShadedButton.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2318 | -{ | |
| 2163 | +mxShapeBasicShadedButton.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2319 | 2164 | c.translate(x, y); |
| 2320 | - | |
| 2165 | + | |
| 2321 | 2166 | c.setShadow(false); |
| 2322 | 2167 | |
| 2323 | 2168 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))); |
| 2324 | 2169 | |
| 2325 | 2170 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 2326 | - | |
| 2171 | + | |
| 2327 | 2172 | c.begin(); |
| 2328 | 2173 | c.moveTo(0, 0); |
| 2329 | 2174 | c.lineTo(w, 0); |
| ... | ... | @@ -2331,7 +2176,7 @@ mxShapeBasicShadedButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2331 | 2176 | c.lineTo(0, h); |
| 2332 | 2177 | c.close(); |
| 2333 | 2178 | c.fill(); |
| 2334 | - | |
| 2179 | + | |
| 2335 | 2180 | c.setFillColor('#ffffff'); |
| 2336 | 2181 | c.setAlpha(0.25); |
| 2337 | 2182 | c.begin(); |
| ... | ... | @@ -2341,7 +2186,7 @@ mxShapeBasicShadedButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2341 | 2186 | c.lineTo(dx, h - dx); |
| 2342 | 2187 | c.close(); |
| 2343 | 2188 | c.fill(); |
| 2344 | - | |
| 2189 | + | |
| 2345 | 2190 | c.setAlpha(0.5); |
| 2346 | 2191 | c.begin(); |
| 2347 | 2192 | c.moveTo(0, 0); |
| ... | ... | @@ -2350,7 +2195,7 @@ mxShapeBasicShadedButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2350 | 2195 | c.lineTo(dx, dx); |
| 2351 | 2196 | c.close(); |
| 2352 | 2197 | c.fill(); |
| 2353 | - | |
| 2198 | + | |
| 2354 | 2199 | c.setFillColor('#000000'); |
| 2355 | 2200 | c.setAlpha(0.25); |
| 2356 | 2201 | c.begin(); |
| ... | ... | @@ -2360,7 +2205,7 @@ mxShapeBasicShadedButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2360 | 2205 | c.lineTo(w - dx, dx); |
| 2361 | 2206 | c.close(); |
| 2362 | 2207 | c.fill(); |
| 2363 | - | |
| 2208 | + | |
| 2364 | 2209 | c.setAlpha(0.5); |
| 2365 | 2210 | c.begin(); |
| 2366 | 2211 | c.moveTo(0, h); |
| ... | ... | @@ -2369,26 +2214,23 @@ mxShapeBasicShadedButton.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2369 | 2214 | c.lineTo(w, h); |
| 2370 | 2215 | c.close(); |
| 2371 | 2216 | c.fill(); |
| 2372 | - | |
| 2373 | - | |
| 2217 | + | |
| 2218 | + | |
| 2374 | 2219 | }; |
| 2375 | 2220 | |
| 2376 | 2221 | mxCellRenderer.registerShape(mxShapeBasicShadedButton.prototype.cst.SHADED_BUTTON, mxShapeBasicShadedButton); |
| 2377 | 2222 | |
| 2378 | 2223 | mxShapeBasicShadedButton.prototype.constraints = null; |
| 2379 | 2224 | |
| 2380 | -Graph.handleFactory[mxShapeBasicShadedButton.prototype.cst.SHADED_BUTTON] = function(state) | |
| 2381 | -{ | |
| 2382 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 2383 | - { | |
| 2225 | +Graph.handleFactory[mxShapeBasicShadedButton.prototype.cst.SHADED_BUTTON] = function (state) { | |
| 2226 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 2384 | 2227 | var dx = Math.max(0, Math.min(bounds.width / 2, bounds.width / 2, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 2385 | 2228 | |
| 2386 | 2229 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 2387 | - }, function(bounds, pt) | |
| 2388 | - { | |
| 2230 | + }, function (bounds, pt) { | |
| 2389 | 2231 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, pt.x - bounds.x))) / 100; |
| 2390 | 2232 | })]; |
| 2391 | - | |
| 2233 | + | |
| 2392 | 2234 | return handles; |
| 2393 | 2235 | }; |
| 2394 | 2236 | |
| ... | ... | @@ -2398,8 +2240,7 @@ Graph.handleFactory[mxShapeBasicShadedButton.prototype.cst.SHADED_BUTTON] = func |
| 2398 | 2240 | /** |
| 2399 | 2241 | * Extends mxShape. |
| 2400 | 2242 | */ |
| 2401 | -function mxShapeBasicPie(bounds, fill, stroke, strokewidth) | |
| 2402 | -{ | |
| 2243 | +function mxShapeBasicPie(bounds, fill, stroke, strokewidth) { | |
| 2403 | 2244 | mxShape.call(this); |
| 2404 | 2245 | this.bounds = bounds; |
| 2405 | 2246 | this.fill = fill; |
| ... | ... | @@ -2415,19 +2256,18 @@ function mxShapeBasicPie(bounds, fill, stroke, strokewidth) |
| 2415 | 2256 | mxUtils.extend(mxShapeBasicPie, mxActor); |
| 2416 | 2257 | |
| 2417 | 2258 | mxShapeBasicPie.prototype.customProperties = [ |
| 2418 | - {name: 'startAngle', dispName: 'Start Angle', type: 'float', min:0, max:1, defVal: 0.2}, | |
| 2419 | - {name: 'endAngle', dispName: 'End Angle', type: 'float', min:0, max:1, defVal: 0.9} | |
| 2259 | + { name: 'startAngle', dispName: 'Start Angle', type: 'float', min: 0, max: 1, defVal: 0.2 }, | |
| 2260 | + { name: 'endAngle', dispName: 'End Angle', type: 'float', min: 0, max: 1, defVal: 0.9 } | |
| 2420 | 2261 | ]; |
| 2421 | 2262 | |
| 2422 | -mxShapeBasicPie.prototype.cst = {PIE : 'mxgraph.basic.pie'}; | |
| 2263 | +mxShapeBasicPie.prototype.cst = { PIE: 'mxgraph.basic.pie' }; | |
| 2423 | 2264 | |
| 2424 | 2265 | /** |
| 2425 | 2266 | * Function: paintVertexShape |
| 2426 | 2267 | * |
| 2427 | 2268 | * Paints the vertex shape. |
| 2428 | 2269 | */ |
| 2429 | -mxShapeBasicPie.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2430 | -{ | |
| 2270 | +mxShapeBasicPie.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2431 | 2271 | c.translate(x, y); |
| 2432 | 2272 | var startAngleSource = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'startAngle', this.startAngle)))); |
| 2433 | 2273 | var endAngleSource = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'endAngle', this.endAngle)))); |
| ... | ... | @@ -2435,51 +2275,46 @@ mxShapeBasicPie.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2435 | 2275 | var endAngle = 2 * Math.PI * endAngleSource; |
| 2436 | 2276 | var rx = w * 0.5; |
| 2437 | 2277 | var ry = h * 0.5; |
| 2438 | - | |
| 2278 | + | |
| 2439 | 2279 | var startX = rx + Math.sin(startAngle) * rx; |
| 2440 | 2280 | var startY = ry - Math.cos(startAngle) * ry; |
| 2441 | 2281 | var endX = rx + Math.sin(endAngle) * rx; |
| 2442 | 2282 | var endY = ry - Math.cos(endAngle) * ry; |
| 2443 | - | |
| 2283 | + | |
| 2444 | 2284 | var angDiff = endAngle - startAngle; |
| 2445 | - | |
| 2446 | - if (angDiff < 0) | |
| 2447 | - { | |
| 2285 | + | |
| 2286 | + if (angDiff < 0) { | |
| 2448 | 2287 | angDiff = angDiff + Math.PI * 2; |
| 2449 | 2288 | } |
| 2450 | - | |
| 2289 | + | |
| 2451 | 2290 | var bigArc = 0; |
| 2452 | - | |
| 2453 | - if (angDiff >= Math.PI) | |
| 2454 | - { | |
| 2291 | + | |
| 2292 | + if (angDiff >= Math.PI) { | |
| 2455 | 2293 | bigArc = 1; |
| 2456 | 2294 | } |
| 2457 | - | |
| 2295 | + | |
| 2458 | 2296 | c.begin(); |
| 2459 | 2297 | var startAngleDiff = startAngleSource % 1; |
| 2460 | 2298 | var endAngleDiff = endAngleSource % 1; |
| 2461 | - | |
| 2462 | - if (startAngleDiff == 0 && endAngleDiff == 0.5) | |
| 2463 | - { | |
| 2299 | + | |
| 2300 | + if (startAngleDiff == 0 && endAngleDiff == 0.5) { | |
| 2464 | 2301 | c.moveTo(rx, ry); |
| 2465 | 2302 | c.lineTo(startX, startY); |
| 2466 | 2303 | c.arcTo(rx, ry, 0, 0, 1, w, h * 0.5); |
| 2467 | 2304 | c.arcTo(rx, ry, 0, 0, 1, w * 0.5, h); |
| 2468 | 2305 | } |
| 2469 | - else if (startAngleDiff == 0.5 && endAngleDiff == 0) | |
| 2470 | - { | |
| 2306 | + else if (startAngleDiff == 0.5 && endAngleDiff == 0) { | |
| 2471 | 2307 | c.moveTo(rx, ry); |
| 2472 | 2308 | c.lineTo(startX, startY); |
| 2473 | 2309 | c.arcTo(rx, ry, 0, 0, 1, 0, h * 0.5); |
| 2474 | 2310 | c.arcTo(rx, ry, 0, 0, 1, w * 0.5, 0); |
| 2475 | 2311 | } |
| 2476 | - else | |
| 2477 | - { | |
| 2312 | + else { | |
| 2478 | 2313 | c.moveTo(rx, ry); |
| 2479 | 2314 | c.lineTo(startX, startY); |
| 2480 | 2315 | c.arcTo(rx, ry, 0, bigArc, 1, endX, endY); |
| 2481 | 2316 | } |
| 2482 | - | |
| 2317 | + | |
| 2483 | 2318 | c.close(); |
| 2484 | 2319 | c.fillAndStroke(); |
| 2485 | 2320 | }; |
| ... | ... | @@ -2488,51 +2323,44 @@ mxCellRenderer.registerShape(mxShapeBasicPie.prototype.cst.PIE, mxShapeBasicPie) |
| 2488 | 2323 | |
| 2489 | 2324 | mxShapeBasicPie.prototype.constraints = null; |
| 2490 | 2325 | |
| 2491 | -Graph.handleFactory[mxShapeBasicPie.prototype.cst.PIE] = function(state) | |
| 2492 | -{ | |
| 2493 | - var handles = [Graph.createHandle(state, ['startAngle'], function(bounds) | |
| 2494 | - { | |
| 2326 | +Graph.handleFactory[mxShapeBasicPie.prototype.cst.PIE] = function (state) { | |
| 2327 | + var handles = [Graph.createHandle(state, ['startAngle'], function (bounds) { | |
| 2495 | 2328 | var startAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'startAngle', this.startAngle)))); |
| 2496 | 2329 | |
| 2497 | 2330 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(startAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(startAngle) * bounds.height * 0.5); |
| 2498 | - }, function(bounds, pt) | |
| 2499 | - { | |
| 2331 | + }, function (bounds, pt) { | |
| 2500 | 2332 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2501 | 2333 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2502 | - | |
| 2503 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2504 | - | |
| 2505 | - if (res < 0) | |
| 2506 | - { | |
| 2334 | + | |
| 2335 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2336 | + | |
| 2337 | + if (res < 0) { | |
| 2507 | 2338 | res = 1 + res; |
| 2508 | 2339 | } |
| 2509 | 2340 | |
| 2510 | 2341 | this.state.style['startAngle'] = res; |
| 2511 | - | |
| 2342 | + | |
| 2512 | 2343 | })]; |
| 2513 | 2344 | |
| 2514 | - var handle2 = Graph.createHandle(state, ['endAngle'], function(bounds) | |
| 2515 | - { | |
| 2345 | + var handle2 = Graph.createHandle(state, ['endAngle'], function (bounds) { | |
| 2516 | 2346 | var endAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'endAngle', this.endAngle)))); |
| 2517 | 2347 | |
| 2518 | 2348 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(endAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(endAngle) * bounds.height * 0.5); |
| 2519 | - }, function(bounds, pt) | |
| 2520 | - { | |
| 2349 | + }, function (bounds, pt) { | |
| 2521 | 2350 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2522 | 2351 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2523 | - | |
| 2524 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2525 | - | |
| 2526 | - if (res < 0) | |
| 2527 | - { | |
| 2352 | + | |
| 2353 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2354 | + | |
| 2355 | + if (res < 0) { | |
| 2528 | 2356 | res = 1 + res; |
| 2529 | 2357 | } |
| 2530 | - | |
| 2358 | + | |
| 2531 | 2359 | this.state.style['endAngle'] = res; |
| 2532 | 2360 | }); |
| 2533 | - | |
| 2361 | + | |
| 2534 | 2362 | handles.push(handle2); |
| 2535 | - | |
| 2363 | + | |
| 2536 | 2364 | return handles; |
| 2537 | 2365 | }; |
| 2538 | 2366 | |
| ... | ... | @@ -2542,8 +2370,7 @@ Graph.handleFactory[mxShapeBasicPie.prototype.cst.PIE] = function(state) |
| 2542 | 2370 | /** |
| 2543 | 2371 | * Extends mxShape. |
| 2544 | 2372 | */ |
| 2545 | -function mxShapeBasicArc(bounds, fill, stroke, strokewidth) | |
| 2546 | -{ | |
| 2373 | +function mxShapeBasicArc(bounds, fill, stroke, strokewidth) { | |
| 2547 | 2374 | mxShape.call(this); |
| 2548 | 2375 | this.bounds = bounds; |
| 2549 | 2376 | this.fill = fill; |
| ... | ... | @@ -2559,19 +2386,18 @@ function mxShapeBasicArc(bounds, fill, stroke, strokewidth) |
| 2559 | 2386 | mxUtils.extend(mxShapeBasicArc, mxActor); |
| 2560 | 2387 | |
| 2561 | 2388 | mxShapeBasicArc.prototype.customProperties = [ |
| 2562 | - {name: 'startAngle', dispName: 'Start Angle', type: 'float', min:0, max:1, defVal: 0.3}, | |
| 2563 | - {name: 'endAngle', dispName: 'End Angle', type: 'float', min:0, max:1, defVal:0.1} | |
| 2389 | + { name: 'startAngle', dispName: 'Start Angle', type: 'float', min: 0, max: 1, defVal: 0.3 }, | |
| 2390 | + { name: 'endAngle', dispName: 'End Angle', type: 'float', min: 0, max: 1, defVal: 0.1 } | |
| 2564 | 2391 | ]; |
| 2565 | 2392 | |
| 2566 | -mxShapeBasicArc.prototype.cst = {ARC : 'mxgraph.basic.arc'}; | |
| 2393 | +mxShapeBasicArc.prototype.cst = { ARC: 'mxgraph.basic.arc' }; | |
| 2567 | 2394 | |
| 2568 | 2395 | /** |
| 2569 | 2396 | * Function: paintVertexShape |
| 2570 | 2397 | * |
| 2571 | 2398 | * Paints the vertex shape. |
| 2572 | 2399 | */ |
| 2573 | -mxShapeBasicArc.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2574 | -{ | |
| 2400 | +mxShapeBasicArc.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2575 | 2401 | c.translate(x, y); |
| 2576 | 2402 | |
| 2577 | 2403 | var startAngleSource = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'startAngle', this.startAngle)))); |
| ... | ... | @@ -2580,45 +2406,40 @@ mxShapeBasicArc.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2580 | 2406 | var endAngle = 2 * Math.PI * endAngleSource; |
| 2581 | 2407 | var rx = w * 0.5; |
| 2582 | 2408 | var ry = h * 0.5; |
| 2583 | - | |
| 2409 | + | |
| 2584 | 2410 | var startX = rx + Math.sin(startAngle) * rx; |
| 2585 | 2411 | var startY = ry - Math.cos(startAngle) * ry; |
| 2586 | 2412 | var endX = rx + Math.sin(endAngle) * rx; |
| 2587 | 2413 | var endY = ry - Math.cos(endAngle) * ry; |
| 2588 | - | |
| 2414 | + | |
| 2589 | 2415 | var angDiff = endAngle - startAngle; |
| 2590 | - | |
| 2591 | - if (angDiff < 0) | |
| 2592 | - { | |
| 2416 | + | |
| 2417 | + if (angDiff < 0) { | |
| 2593 | 2418 | angDiff = angDiff + Math.PI * 2; |
| 2594 | 2419 | } |
| 2595 | - | |
| 2420 | + | |
| 2596 | 2421 | var bigArc = 0; |
| 2597 | - | |
| 2598 | - if (angDiff > Math.PI) | |
| 2599 | - { | |
| 2422 | + | |
| 2423 | + if (angDiff > Math.PI) { | |
| 2600 | 2424 | bigArc = 1; |
| 2601 | 2425 | } |
| 2602 | - | |
| 2426 | + | |
| 2603 | 2427 | c.begin(); |
| 2604 | - | |
| 2428 | + | |
| 2605 | 2429 | var startAngleDiff = startAngleSource % 1; |
| 2606 | 2430 | var endAngleDiff = endAngleSource % 1; |
| 2607 | - | |
| 2608 | - if (startAngleDiff == 0 && endAngleDiff == 0.5) | |
| 2609 | - { | |
| 2431 | + | |
| 2432 | + if (startAngleDiff == 0 && endAngleDiff == 0.5) { | |
| 2610 | 2433 | c.moveTo(startX, startY); |
| 2611 | 2434 | c.arcTo(rx, ry, 0, 0, 1, w, h * 0.5); |
| 2612 | 2435 | c.arcTo(rx, ry, 0, 0, 1, w * 0.5, h); |
| 2613 | 2436 | } |
| 2614 | - else if (startAngleDiff == 0.5 && endAngleDiff == 0) | |
| 2615 | - { | |
| 2437 | + else if (startAngleDiff == 0.5 && endAngleDiff == 0) { | |
| 2616 | 2438 | c.moveTo(startX, startY); |
| 2617 | 2439 | c.arcTo(rx, ry, 0, 0, 1, 0, h * 0.5); |
| 2618 | 2440 | c.arcTo(rx, ry, 0, 0, 1, w * 0.5, 0); |
| 2619 | 2441 | } |
| 2620 | - else | |
| 2621 | - { | |
| 2442 | + else { | |
| 2622 | 2443 | c.moveTo(startX, startY); |
| 2623 | 2444 | c.arcTo(rx, ry, 0, bigArc, 1, endX, endY); |
| 2624 | 2445 | } |
| ... | ... | @@ -2630,51 +2451,44 @@ mxCellRenderer.registerShape(mxShapeBasicArc.prototype.cst.ARC, mxShapeBasicArc) |
| 2630 | 2451 | |
| 2631 | 2452 | mxShapeBasicArc.prototype.constraints = null; |
| 2632 | 2453 | |
| 2633 | -Graph.handleFactory[mxShapeBasicArc.prototype.cst.ARC] = function(state) | |
| 2634 | -{ | |
| 2635 | - var handles = [Graph.createHandle(state, ['startAngle'], function(bounds) | |
| 2636 | - { | |
| 2454 | +Graph.handleFactory[mxShapeBasicArc.prototype.cst.ARC] = function (state) { | |
| 2455 | + var handles = [Graph.createHandle(state, ['startAngle'], function (bounds) { | |
| 2637 | 2456 | var startAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'startAngle', this.startAngle)))); |
| 2638 | 2457 | |
| 2639 | 2458 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(startAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(startAngle) * bounds.height * 0.5); |
| 2640 | - }, function(bounds, pt) | |
| 2641 | - { | |
| 2459 | + }, function (bounds, pt) { | |
| 2642 | 2460 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2643 | 2461 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2644 | - | |
| 2645 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2646 | - | |
| 2647 | - if (res < 0) | |
| 2648 | - { | |
| 2462 | + | |
| 2463 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2464 | + | |
| 2465 | + if (res < 0) { | |
| 2649 | 2466 | res = 1 + res; |
| 2650 | 2467 | } |
| 2651 | 2468 | |
| 2652 | 2469 | this.state.style['startAngle'] = res; |
| 2653 | - | |
| 2470 | + | |
| 2654 | 2471 | })]; |
| 2655 | 2472 | |
| 2656 | - var handle2 = Graph.createHandle(state, ['endAngle'], function(bounds) | |
| 2657 | - { | |
| 2473 | + var handle2 = Graph.createHandle(state, ['endAngle'], function (bounds) { | |
| 2658 | 2474 | var endAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'endAngle', this.endAngle)))); |
| 2659 | 2475 | |
| 2660 | 2476 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(endAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(endAngle) * bounds.height * 0.5); |
| 2661 | - }, function(bounds, pt) | |
| 2662 | - { | |
| 2477 | + }, function (bounds, pt) { | |
| 2663 | 2478 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2664 | 2479 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2665 | - | |
| 2666 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2667 | - | |
| 2668 | - if (res < 0) | |
| 2669 | - { | |
| 2480 | + | |
| 2481 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2482 | + | |
| 2483 | + if (res < 0) { | |
| 2670 | 2484 | res = 1 + res; |
| 2671 | 2485 | } |
| 2672 | - | |
| 2486 | + | |
| 2673 | 2487 | this.state.style['endAngle'] = res; |
| 2674 | 2488 | }); |
| 2675 | - | |
| 2489 | + | |
| 2676 | 2490 | handles.push(handle2); |
| 2677 | - | |
| 2491 | + | |
| 2678 | 2492 | return handles; |
| 2679 | 2493 | }; |
| 2680 | 2494 | |
| ... | ... | @@ -2684,8 +2498,7 @@ Graph.handleFactory[mxShapeBasicArc.prototype.cst.ARC] = function(state) |
| 2684 | 2498 | /** |
| 2685 | 2499 | * Extends mxShape. |
| 2686 | 2500 | */ |
| 2687 | -function mxShapeBasicPartConcEllipse(bounds, fill, stroke, strokewidth) | |
| 2688 | -{ | |
| 2501 | +function mxShapeBasicPartConcEllipse(bounds, fill, stroke, strokewidth) { | |
| 2689 | 2502 | mxShape.call(this); |
| 2690 | 2503 | this.bounds = bounds; |
| 2691 | 2504 | this.fill = fill; |
| ... | ... | @@ -2702,20 +2515,19 @@ function mxShapeBasicPartConcEllipse(bounds, fill, stroke, strokewidth) |
| 2702 | 2515 | mxUtils.extend(mxShapeBasicPartConcEllipse, mxActor); |
| 2703 | 2516 | |
| 2704 | 2517 | mxShapeBasicPartConcEllipse.prototype.customProperties = [ |
| 2705 | - {name: 'startAngle', dispName: 'Start Angle', type: 'float', min:0, max:1, defVal:0.25}, | |
| 2706 | - {name: 'endAngle', dispName: 'End Angle', type: 'float', min:0, max:1, defVal:0.1}, | |
| 2707 | - {name: 'arcWidth', dispName: 'Arc Width', type: 'float', min:0, max:1, defVal:0.5} | |
| 2518 | + { name: 'startAngle', dispName: 'Start Angle', type: 'float', min: 0, max: 1, defVal: 0.25 }, | |
| 2519 | + { name: 'endAngle', dispName: 'End Angle', type: 'float', min: 0, max: 1, defVal: 0.1 }, | |
| 2520 | + { name: 'arcWidth', dispName: 'Arc Width', type: 'float', min: 0, max: 1, defVal: 0.5 } | |
| 2708 | 2521 | ]; |
| 2709 | 2522 | |
| 2710 | -mxShapeBasicPartConcEllipse.prototype.cst = {PART_CONC_ELLIPSE : 'mxgraph.basic.partConcEllipse'}; | |
| 2523 | +mxShapeBasicPartConcEllipse.prototype.cst = { PART_CONC_ELLIPSE: 'mxgraph.basic.partConcEllipse' }; | |
| 2711 | 2524 | |
| 2712 | 2525 | /** |
| 2713 | 2526 | * Function: paintVertexShape |
| 2714 | 2527 | * |
| 2715 | 2528 | * Paints the vertex shape. |
| 2716 | 2529 | */ |
| 2717 | -mxShapeBasicPartConcEllipse.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2718 | -{ | |
| 2530 | +mxShapeBasicPartConcEllipse.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2719 | 2531 | c.translate(x, y); |
| 2720 | 2532 | |
| 2721 | 2533 | var startAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'startAngle', this.startAngle)))); |
| ... | ... | @@ -2725,18 +2537,16 @@ mxShapeBasicPartConcEllipse.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2725 | 2537 | var ry = h * 0.5; |
| 2726 | 2538 | var rx2 = rx * arcWidth; |
| 2727 | 2539 | var ry2 = ry * arcWidth; |
| 2728 | - | |
| 2540 | + | |
| 2729 | 2541 | var angDiff = endAngle - startAngle; |
| 2730 | - | |
| 2731 | - if (angDiff < 0) | |
| 2732 | - { | |
| 2542 | + | |
| 2543 | + if (angDiff < 0) { | |
| 2733 | 2544 | angDiff = angDiff + Math.PI * 2; |
| 2734 | 2545 | } |
| 2735 | - else if (angDiff == Math.PI) | |
| 2736 | - { | |
| 2546 | + else if (angDiff == Math.PI) { | |
| 2737 | 2547 | endAngle = endAngle + 0.00001; |
| 2738 | 2548 | } |
| 2739 | - | |
| 2549 | + | |
| 2740 | 2550 | var startX = rx + Math.sin(startAngle) * rx; |
| 2741 | 2551 | var startY = ry - Math.cos(startAngle) * ry; |
| 2742 | 2552 | var innerStartX = rx + Math.sin(startAngle) * rx2; |
| ... | ... | @@ -2745,15 +2555,14 @@ mxShapeBasicPartConcEllipse.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2745 | 2555 | var endY = ry - Math.cos(endAngle) * ry; |
| 2746 | 2556 | var innerEndX = rx + Math.sin(endAngle) * rx2; |
| 2747 | 2557 | var innerEndY = ry - Math.cos(endAngle) * ry2; |
| 2748 | - | |
| 2749 | - | |
| 2558 | + | |
| 2559 | + | |
| 2750 | 2560 | var bigArc = 0; |
| 2751 | - | |
| 2752 | - if (angDiff >= Math.PI) | |
| 2753 | - { | |
| 2561 | + | |
| 2562 | + if (angDiff >= Math.PI) { | |
| 2754 | 2563 | bigArc = 1; |
| 2755 | 2564 | } |
| 2756 | - | |
| 2565 | + | |
| 2757 | 2566 | c.begin(); |
| 2758 | 2567 | c.moveTo(startX, startY); |
| 2759 | 2568 | c.arcTo(rx, ry, 0, bigArc, 1, endX, endY); |
| ... | ... | @@ -2767,63 +2576,54 @@ mxCellRenderer.registerShape(mxShapeBasicPartConcEllipse.prototype.cst.PART_CONC |
| 2767 | 2576 | |
| 2768 | 2577 | mxShapeBasicPartConcEllipse.prototype.constraints = null; |
| 2769 | 2578 | |
| 2770 | -Graph.handleFactory[mxShapeBasicPartConcEllipse.prototype.cst.PART_CONC_ELLIPSE] = function(state) | |
| 2771 | -{ | |
| 2772 | - var handles = [Graph.createHandle(state, ['startAngle'], function(bounds) | |
| 2773 | - { | |
| 2579 | +Graph.handleFactory[mxShapeBasicPartConcEllipse.prototype.cst.PART_CONC_ELLIPSE] = function (state) { | |
| 2580 | + var handles = [Graph.createHandle(state, ['startAngle'], function (bounds) { | |
| 2774 | 2581 | var startAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'startAngle', this.startAngle)))); |
| 2775 | 2582 | |
| 2776 | 2583 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(startAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(startAngle) * bounds.height * 0.5); |
| 2777 | - }, function(bounds, pt) | |
| 2778 | - { | |
| 2584 | + }, function (bounds, pt) { | |
| 2779 | 2585 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2780 | 2586 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2781 | - | |
| 2782 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2783 | - | |
| 2784 | - if (res < 0) | |
| 2785 | - { | |
| 2587 | + | |
| 2588 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2589 | + | |
| 2590 | + if (res < 0) { | |
| 2786 | 2591 | res = 1 + res; |
| 2787 | 2592 | } |
| 2788 | 2593 | |
| 2789 | 2594 | this.state.style['startAngle'] = res; |
| 2790 | - | |
| 2595 | + | |
| 2791 | 2596 | })]; |
| 2792 | 2597 | |
| 2793 | - var handle2 = Graph.createHandle(state, ['endAngle'], function(bounds) | |
| 2794 | - { | |
| 2598 | + var handle2 = Graph.createHandle(state, ['endAngle'], function (bounds) { | |
| 2795 | 2599 | var endAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'endAngle', this.endAngle)))); |
| 2796 | 2600 | |
| 2797 | 2601 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(endAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(endAngle) * bounds.height * 0.5); |
| 2798 | - }, function(bounds, pt) | |
| 2799 | - { | |
| 2602 | + }, function (bounds, pt) { | |
| 2800 | 2603 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2801 | 2604 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2802 | - | |
| 2803 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2804 | - | |
| 2805 | - if (res < 0) | |
| 2806 | - { | |
| 2605 | + | |
| 2606 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2607 | + | |
| 2608 | + if (res < 0) { | |
| 2807 | 2609 | res = 1 + res; |
| 2808 | 2610 | } |
| 2809 | - | |
| 2611 | + | |
| 2810 | 2612 | this.state.style['endAngle'] = res; |
| 2811 | 2613 | }); |
| 2812 | - | |
| 2614 | + | |
| 2813 | 2615 | handles.push(handle2); |
| 2814 | - | |
| 2815 | - var handle3 = Graph.createHandle(state, ['arcWidth'], function(bounds) | |
| 2816 | - { | |
| 2616 | + | |
| 2617 | + var handle3 = Graph.createHandle(state, ['arcWidth'], function (bounds) { | |
| 2817 | 2618 | var arcWidth = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'arcWidth', this.arcWidth)))); |
| 2818 | 2619 | |
| 2819 | 2620 | return new mxPoint(bounds.x + bounds.width / 2, bounds.y + arcWidth * bounds.height * 0.5); |
| 2820 | - }, function(bounds, pt) | |
| 2821 | - { | |
| 2621 | + }, function (bounds, pt) { | |
| 2822 | 2622 | this.state.style['arcWidth'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, (pt.y - bounds.y) / (bounds.height * 0.5)))) / 100; |
| 2823 | 2623 | }); |
| 2824 | - | |
| 2624 | + | |
| 2825 | 2625 | handles.push(handle3); |
| 2826 | - | |
| 2626 | + | |
| 2827 | 2627 | return handles; |
| 2828 | 2628 | }; |
| 2829 | 2629 | |
| ... | ... | @@ -2833,8 +2633,7 @@ Graph.handleFactory[mxShapeBasicPartConcEllipse.prototype.cst.PART_CONC_ELLIPSE] |
| 2833 | 2633 | /** |
| 2834 | 2634 | * Extends mxShape. |
| 2835 | 2635 | */ |
| 2836 | -function mxShapeBasicNumEntryVert(bounds, fill, stroke, strokewidth) | |
| 2837 | -{ | |
| 2636 | +function mxShapeBasicNumEntryVert(bounds, fill, stroke, strokewidth) { | |
| 2838 | 2637 | mxShape.call(this); |
| 2839 | 2638 | this.bounds = bounds; |
| 2840 | 2639 | this.fill = fill; |
| ... | ... | @@ -2848,15 +2647,14 @@ function mxShapeBasicNumEntryVert(bounds, fill, stroke, strokewidth) |
| 2848 | 2647 | */ |
| 2849 | 2648 | mxUtils.extend(mxShapeBasicNumEntryVert, mxActor); |
| 2850 | 2649 | |
| 2851 | -mxShapeBasicNumEntryVert.prototype.cst = {NUM_ENTRY_VERT : 'mxgraph.basic.numberedEntryVert'}; | |
| 2650 | +mxShapeBasicNumEntryVert.prototype.cst = { NUM_ENTRY_VERT: 'mxgraph.basic.numberedEntryVert' }; | |
| 2852 | 2651 | |
| 2853 | 2652 | /** |
| 2854 | 2653 | * Function: paintVertexShape |
| 2855 | 2654 | * |
| 2856 | 2655 | * Paints the vertex shape. |
| 2857 | 2656 | */ |
| 2858 | -mxShapeBasicNumEntryVert.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2859 | -{ | |
| 2657 | +mxShapeBasicNumEntryVert.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2860 | 2658 | c.translate(x, y); |
| 2861 | 2659 | |
| 2862 | 2660 | var dy = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dy', this.dy)))); |
| ... | ... | @@ -2864,10 +2662,10 @@ mxShapeBasicNumEntryVert.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2864 | 2662 | var inset = 5; |
| 2865 | 2663 | |
| 2866 | 2664 | var d = Math.min(dy, w - 2 * inset, h - inset); |
| 2867 | - | |
| 2665 | + | |
| 2868 | 2666 | c.ellipse(w * 0.5 - d * 0.5, 0, d, d); |
| 2869 | 2667 | c.fillAndStroke(); |
| 2870 | - | |
| 2668 | + | |
| 2871 | 2669 | c.begin(); |
| 2872 | 2670 | c.moveTo(0, d * 0.5); |
| 2873 | 2671 | c.lineTo(w * 0.5 - d * 0.5 - inset, d * 0.5); |
| ... | ... | @@ -2883,18 +2681,15 @@ mxCellRenderer.registerShape(mxShapeBasicNumEntryVert.prototype.cst.NUM_ENTRY_VE |
| 2883 | 2681 | |
| 2884 | 2682 | mxShapeBasicNumEntryVert.prototype.constraints = null; |
| 2885 | 2683 | |
| 2886 | -Graph.handleFactory[mxShapeBasicNumEntryVert.prototype.cst.NUM_ENTRY_VERT] = function(state) | |
| 2887 | -{ | |
| 2888 | - var handles = [Graph.createHandle(state, ['dy'], function(bounds) | |
| 2889 | - { | |
| 2684 | +Graph.handleFactory[mxShapeBasicNumEntryVert.prototype.cst.NUM_ENTRY_VERT] = function (state) { | |
| 2685 | + var handles = [Graph.createHandle(state, ['dy'], function (bounds) { | |
| 2890 | 2686 | var dy = Math.max(0, Math.min(bounds.width, bounds.width, parseFloat(mxUtils.getValue(this.state.style, 'dy', this.dy)))); |
| 2891 | 2687 | |
| 2892 | 2688 | return new mxPoint(bounds.x + bounds.width / 2, bounds.y + dy); |
| 2893 | - }, function(bounds, pt) | |
| 2894 | - { | |
| 2689 | + }, function (bounds, pt) { | |
| 2895 | 2690 | this.state.style['dy'] = Math.round(100 * Math.max(0, Math.min(bounds.height, bounds.width, pt.y - bounds.y))) / 100; |
| 2896 | 2691 | })]; |
| 2897 | - | |
| 2692 | + | |
| 2898 | 2693 | return handles; |
| 2899 | 2694 | }; |
| 2900 | 2695 | |
| ... | ... | @@ -2904,8 +2699,7 @@ Graph.handleFactory[mxShapeBasicNumEntryVert.prototype.cst.NUM_ENTRY_VERT] = fun |
| 2904 | 2699 | /** |
| 2905 | 2700 | * Extends mxShape. |
| 2906 | 2701 | */ |
| 2907 | -function mxShapeBasicBendingArch(bounds, fill, stroke, strokewidth) | |
| 2908 | -{ | |
| 2702 | +function mxShapeBasicBendingArch(bounds, fill, stroke, strokewidth) { | |
| 2909 | 2703 | mxShape.call(this); |
| 2910 | 2704 | this.bounds = bounds; |
| 2911 | 2705 | this.fill = fill; |
| ... | ... | @@ -2921,15 +2715,14 @@ function mxShapeBasicBendingArch(bounds, fill, stroke, strokewidth) |
| 2921 | 2715 | */ |
| 2922 | 2716 | mxUtils.extend(mxShapeBasicBendingArch, mxActor); |
| 2923 | 2717 | |
| 2924 | -mxShapeBasicBendingArch.prototype.cst = {BENDING_ARCH : 'mxgraph.basic.bendingArch'}; | |
| 2718 | +mxShapeBasicBendingArch.prototype.cst = { BENDING_ARCH: 'mxgraph.basic.bendingArch' }; | |
| 2925 | 2719 | |
| 2926 | 2720 | /** |
| 2927 | 2721 | * Function: paintVertexShape |
| 2928 | 2722 | * |
| 2929 | 2723 | * Paints the vertex shape. |
| 2930 | 2724 | */ |
| 2931 | -mxShapeBasicBendingArch.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 2932 | -{ | |
| 2725 | +mxShapeBasicBendingArch.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2933 | 2726 | c.translate(x, y); |
| 2934 | 2727 | |
| 2935 | 2728 | var startAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'startAngle', this.startAngle)))); |
| ... | ... | @@ -2939,7 +2732,7 @@ mxShapeBasicBendingArch.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2939 | 2732 | var ry = h * 0.5; |
| 2940 | 2733 | var rx2 = rx * arcWidth; |
| 2941 | 2734 | var ry2 = ry * arcWidth; |
| 2942 | - | |
| 2735 | + | |
| 2943 | 2736 | var startX = rx + Math.sin(startAngle) * rx; |
| 2944 | 2737 | var startY = ry - Math.cos(startAngle) * ry; |
| 2945 | 2738 | var innerStartX = rx + Math.sin(startAngle) * rx2; |
| ... | ... | @@ -2948,18 +2741,16 @@ mxShapeBasicBendingArch.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2948 | 2741 | var endY = ry - Math.cos(endAngle) * ry; |
| 2949 | 2742 | var innerEndX = rx + Math.sin(endAngle) * rx2; |
| 2950 | 2743 | var innerEndY = ry - Math.cos(endAngle) * ry2; |
| 2951 | - | |
| 2744 | + | |
| 2952 | 2745 | var angDiff = endAngle - startAngle; |
| 2953 | - | |
| 2954 | - if (angDiff < 0) | |
| 2955 | - { | |
| 2746 | + | |
| 2747 | + if (angDiff < 0) { | |
| 2956 | 2748 | angDiff = angDiff + Math.PI * 2; |
| 2957 | 2749 | } |
| 2958 | - | |
| 2750 | + | |
| 2959 | 2751 | var bigArc = 0; |
| 2960 | - | |
| 2961 | - if (angDiff > Math.PI) | |
| 2962 | - { | |
| 2752 | + | |
| 2753 | + if (angDiff > Math.PI) { | |
| 2963 | 2754 | bigArc = 1; |
| 2964 | 2755 | } |
| 2965 | 2756 | |
| ... | ... | @@ -2968,7 +2759,7 @@ mxShapeBasicBendingArch.prototype.paintVertexShape = function(c, x, y, w, h) |
| 2968 | 2759 | |
| 2969 | 2760 | c.ellipse(w * 0.5 - rx3, h * 0.5 - ry3, 2 * rx3, 2 * ry3); |
| 2970 | 2761 | c.fillAndStroke(); |
| 2971 | - | |
| 2762 | + | |
| 2972 | 2763 | c.begin(); |
| 2973 | 2764 | c.moveTo(startX, startY); |
| 2974 | 2765 | c.arcTo(rx, ry, 0, bigArc, 1, endX, endY); |
| ... | ... | @@ -2982,63 +2773,54 @@ mxCellRenderer.registerShape(mxShapeBasicBendingArch.prototype.cst.BENDING_ARCH, |
| 2982 | 2773 | |
| 2983 | 2774 | mxShapeBasicBendingArch.prototype.constraints = null; |
| 2984 | 2775 | |
| 2985 | -Graph.handleFactory[mxShapeBasicBendingArch.prototype.cst.BENDING_ARCH] = function(state) | |
| 2986 | -{ | |
| 2987 | - var handles = [Graph.createHandle(state, ['startAngle'], function(bounds) | |
| 2988 | - { | |
| 2776 | +Graph.handleFactory[mxShapeBasicBendingArch.prototype.cst.BENDING_ARCH] = function (state) { | |
| 2777 | + var handles = [Graph.createHandle(state, ['startAngle'], function (bounds) { | |
| 2989 | 2778 | var startAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'startAngle', this.startAngle)))); |
| 2990 | 2779 | |
| 2991 | 2780 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(startAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(startAngle) * bounds.height * 0.5); |
| 2992 | - }, function(bounds, pt) | |
| 2993 | - { | |
| 2781 | + }, function (bounds, pt) { | |
| 2994 | 2782 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 2995 | 2783 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 2996 | - | |
| 2997 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2998 | - | |
| 2999 | - if (res < 0) | |
| 3000 | - { | |
| 2784 | + | |
| 2785 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2786 | + | |
| 2787 | + if (res < 0) { | |
| 3001 | 2788 | res = 1 + res; |
| 3002 | 2789 | } |
| 3003 | 2790 | |
| 3004 | 2791 | this.state.style['startAngle'] = res; |
| 3005 | - | |
| 2792 | + | |
| 3006 | 2793 | })]; |
| 3007 | 2794 | |
| 3008 | - var handle2 = Graph.createHandle(state, ['endAngle'], function(bounds) | |
| 3009 | - { | |
| 2795 | + var handle2 = Graph.createHandle(state, ['endAngle'], function (bounds) { | |
| 3010 | 2796 | var endAngle = 2 * Math.PI * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'endAngle', this.endAngle)))); |
| 3011 | 2797 | |
| 3012 | 2798 | return new mxPoint(bounds.x + bounds.width * 0.5 + Math.sin(endAngle) * bounds.width * 0.5, bounds.y + bounds.height * 0.5 - Math.cos(endAngle) * bounds.height * 0.5); |
| 3013 | - }, function(bounds, pt) | |
| 3014 | - { | |
| 2799 | + }, function (bounds, pt) { | |
| 3015 | 2800 | var handleX = Math.round(100 * Math.max(-1, Math.min(1, (pt.x - bounds.x - bounds.width * 0.5) / (bounds.width * 0.5)))) / 100; |
| 3016 | 2801 | var handleY = -Math.round(100 * Math.max(-1, Math.min(1, (pt.y - bounds.y - bounds.height * 0.5) / (bounds.height * 0.5)))) / 100; |
| 3017 | - | |
| 3018 | - var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 3019 | - | |
| 3020 | - if (res < 0) | |
| 3021 | - { | |
| 2802 | + | |
| 2803 | + var res = 0.5 * Math.atan2(handleX, handleY) / Math.PI; | |
| 2804 | + | |
| 2805 | + if (res < 0) { | |
| 3022 | 2806 | res = 1 + res; |
| 3023 | 2807 | } |
| 3024 | - | |
| 2808 | + | |
| 3025 | 2809 | this.state.style['endAngle'] = res; |
| 3026 | 2810 | }); |
| 3027 | - | |
| 2811 | + | |
| 3028 | 2812 | handles.push(handle2); |
| 3029 | - | |
| 3030 | - var handle3 = Graph.createHandle(state, ['arcWidth'], function(bounds) | |
| 3031 | - { | |
| 2813 | + | |
| 2814 | + var handle3 = Graph.createHandle(state, ['arcWidth'], function (bounds) { | |
| 3032 | 2815 | var arcWidth = Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.state.style, 'arcWidth', this.arcWidth)))); |
| 3033 | 2816 | |
| 3034 | 2817 | return new mxPoint(bounds.x + bounds.width / 2, bounds.y + arcWidth * bounds.height * 0.5); |
| 3035 | - }, function(bounds, pt) | |
| 3036 | - { | |
| 2818 | + }, function (bounds, pt) { | |
| 3037 | 2819 | this.state.style['arcWidth'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 2, bounds.width / 2, (pt.y - bounds.y) / (bounds.height * 0.5)))) / 100; |
| 3038 | 2820 | }); |
| 3039 | - | |
| 2821 | + | |
| 3040 | 2822 | handles.push(handle3); |
| 3041 | - | |
| 2823 | + | |
| 3042 | 2824 | return handles; |
| 3043 | 2825 | }; |
| 3044 | 2826 | |
| ... | ... | @@ -3048,8 +2830,7 @@ Graph.handleFactory[mxShapeBasicBendingArch.prototype.cst.BENDING_ARCH] = functi |
| 3048 | 2830 | /** |
| 3049 | 2831 | * Extends mxShape. |
| 3050 | 2832 | */ |
| 3051 | -function mxShapeBasicThreeCornerRoundRect(bounds, fill, stroke, strokewidth) | |
| 3052 | -{ | |
| 2833 | +function mxShapeBasicThreeCornerRoundRect(bounds, fill, stroke, strokewidth) { | |
| 3053 | 2834 | mxShape.call(this); |
| 3054 | 2835 | this.bounds = bounds; |
| 3055 | 2836 | this.fill = fill; |
| ... | ... | @@ -3064,24 +2845,23 @@ function mxShapeBasicThreeCornerRoundRect(bounds, fill, stroke, strokewidth) |
| 3064 | 2845 | mxUtils.extend(mxShapeBasicThreeCornerRoundRect, mxActor); |
| 3065 | 2846 | |
| 3066 | 2847 | mxShapeBasicThreeCornerRoundRect.prototype.customProperties = [ |
| 3067 | - {name: 'dx', dispName: 'Rounding Size', type: 'float', min:0, defVal:6} | |
| 2848 | + { name: 'dx', dispName: 'Rounding Size', type: 'float', min: 0, defVal: 6 } | |
| 3068 | 2849 | ]; |
| 3069 | 2850 | |
| 3070 | -mxShapeBasicThreeCornerRoundRect.prototype.cst = {THREE_CORNER_ROUND_RECT : 'mxgraph.basic.three_corner_round_rect'}; | |
| 2851 | +mxShapeBasicThreeCornerRoundRect.prototype.cst = { THREE_CORNER_ROUND_RECT: 'mxgraph.basic.three_corner_round_rect' }; | |
| 3071 | 2852 | |
| 3072 | 2853 | /** |
| 3073 | 2854 | * Function: paintVertexShape |
| 3074 | 2855 | * |
| 3075 | 2856 | * Paints the vertex shape. |
| 3076 | 2857 | */ |
| 3077 | -mxShapeBasicThreeCornerRoundRect.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 3078 | -{ | |
| 2858 | +mxShapeBasicThreeCornerRoundRect.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 3079 | 2859 | c.translate(x, y); |
| 3080 | 2860 | |
| 3081 | 2861 | var dx = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'dx', this.dx)))) * 2; |
| 3082 | 2862 | |
| 3083 | 2863 | dx = Math.min(w * 0.5, h * 0.5, dx); |
| 3084 | - | |
| 2864 | + | |
| 3085 | 2865 | c.begin(); |
| 3086 | 2866 | c.moveTo(dx, 0); |
| 3087 | 2867 | c.lineTo(w - dx, 0); |
| ... | ... | @@ -3099,23 +2879,19 @@ mxCellRenderer.registerShape(mxShapeBasicThreeCornerRoundRect.prototype.cst.THRE |
| 3099 | 2879 | |
| 3100 | 2880 | mxShapeBasicThreeCornerRoundRect.prototype.constraints = null; |
| 3101 | 2881 | |
| 3102 | -Graph.handleFactory[mxShapeBasicThreeCornerRoundRect.prototype.cst.THREE_CORNER_ROUND_RECT] = function(state) | |
| 3103 | -{ | |
| 3104 | - var handles = [Graph.createHandle(state, ['dx'], function(bounds) | |
| 3105 | - { | |
| 2882 | +Graph.handleFactory[mxShapeBasicThreeCornerRoundRect.prototype.cst.THREE_CORNER_ROUND_RECT] = function (state) { | |
| 2883 | + var handles = [Graph.createHandle(state, ['dx'], function (bounds) { | |
| 3106 | 2884 | var dx = Math.max(0, Math.min(bounds.width / 4, bounds.width / 4, parseFloat(mxUtils.getValue(this.state.style, 'dx', this.dx)))); |
| 3107 | 2885 | |
| 3108 | 2886 | return new mxPoint(bounds.x + dx, bounds.y + dx); |
| 3109 | - }, function(bounds, pt) | |
| 3110 | - { | |
| 2887 | + }, function (bounds, pt) { | |
| 3111 | 2888 | this.state.style['dx'] = Math.round(100 * Math.max(0, Math.min(bounds.height / 4, bounds.width / 4, pt.x - bounds.x))) / 100; |
| 3112 | 2889 | })]; |
| 3113 | - | |
| 2890 | + | |
| 3114 | 2891 | return handles; |
| 3115 | 2892 | }; |
| 3116 | 2893 | |
| 3117 | -mxShapeBasicThreeCornerRoundRect.prototype.getConstraints = function(style, w, h) | |
| 3118 | -{ | |
| 2894 | +mxShapeBasicThreeCornerRoundRect.prototype.getConstraints = function (style, w, h) { | |
| 3119 | 2895 | var constr = []; |
| 3120 | 2896 | |
| 3121 | 2897 | constr.push(new mxConnectionConstraint(new mxPoint(0.5, 0), false)); |
| ... | ... | @@ -3133,8 +2909,7 @@ mxShapeBasicThreeCornerRoundRect.prototype.getConstraints = function(style, w, h |
| 3133 | 2909 | /** |
| 3134 | 2910 | * Extends mxShape. |
| 3135 | 2911 | */ |
| 3136 | -function mxShapeBasicPolygon(bounds, fill, stroke, strokewidth) | |
| 3137 | -{ | |
| 2912 | +function mxShapeBasicPolygon(bounds, fill, stroke, strokewidth) { | |
| 3138 | 2913 | mxShape.call(this); |
| 3139 | 2914 | this.bounds = bounds; |
| 3140 | 2915 | this.fill = fill; |
| ... | ... | @@ -3150,86 +2925,73 @@ function mxShapeBasicPolygon(bounds, fill, stroke, strokewidth) |
| 3150 | 2925 | mxUtils.extend(mxShapeBasicPolygon, mxActor); |
| 3151 | 2926 | |
| 3152 | 2927 | mxShapeBasicPolygon.prototype.customProperties = [ |
| 3153 | - {name: 'polyline', dispName: 'Polyline', type: 'bool', defVal:false}, | |
| 2928 | + { name: 'polyline', dispName: 'Polyline', type: 'bool', defVal: false }, | |
| 3154 | 2929 | ]; |
| 3155 | 2930 | |
| 3156 | -mxShapeBasicPolygon.prototype.cst = {POLYGON : 'mxgraph.basic.polygon'}; | |
| 2931 | +mxShapeBasicPolygon.prototype.cst = { POLYGON: 'mxgraph.basic.polygon' }; | |
| 3157 | 2932 | |
| 3158 | 2933 | /** |
| 3159 | 2934 | * Function: paintVertexShape |
| 3160 | 2935 | * |
| 3161 | 2936 | * Paints the vertex shape. |
| 3162 | 2937 | */ |
| 3163 | -mxShapeBasicPolygon.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 3164 | -{ | |
| 3165 | - try | |
| 3166 | - { | |
| 3167 | - c.translate(x, y); | |
| 3168 | - var coords = JSON.parse(mxUtils.getValue(this.state.style, 'polyCoords', '[]')); | |
| 3169 | - var polyline = mxUtils.getValue(this.style, 'polyline', false); | |
| 3170 | - | |
| 3171 | - if (coords.length > 0) | |
| 3172 | - { | |
| 3173 | - c.begin(); | |
| 3174 | - c.moveTo(coords[0][0] * w, coords[0][1] * h); | |
| 3175 | - | |
| 3176 | - for (var i = 1; i < coords.length; i++) | |
| 3177 | - { | |
| 3178 | - c.lineTo(coords[i][0] * w, coords[i][1] * h); | |
| 3179 | - } | |
| 3180 | - | |
| 3181 | - if (polyline == false) | |
| 3182 | - { | |
| 3183 | - c.close(); | |
| 3184 | - } | |
| 3185 | - | |
| 3186 | - c.end(); | |
| 3187 | - c.fillAndStroke(); | |
| 3188 | - } | |
| 3189 | - } | |
| 3190 | - catch (e) | |
| 3191 | - { | |
| 3192 | - // ignore | |
| 3193 | - } | |
| 3194 | -}; | |
| 3195 | - | |
| 2938 | +mxShapeBasicPolygon.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 2939 | + try { | |
| 2940 | + c.translate(x, y); | |
| 2941 | + var coords = JSON.parse(mxUtils.getValue(this.state.style, 'polyCoords', '[]')); | |
| 2942 | + var polyline = mxUtils.getValue(this.style, 'polyline', false); | |
| 2943 | + | |
| 2944 | + if (coords.length > 0) { | |
| 2945 | + c.begin(); | |
| 2946 | + c.moveTo(coords[0][0] * w, coords[0][1] * h); | |
| 2947 | + | |
| 2948 | + for (var i = 1; i < coords.length; i++) { | |
| 2949 | + c.lineTo(coords[i][0] * w, coords[i][1] * h); | |
| 2950 | + } | |
| 2951 | + | |
| 2952 | + if (polyline == false) { | |
| 2953 | + c.close(); | |
| 2954 | + } | |
| 2955 | + | |
| 2956 | + c.end(); | |
| 2957 | + c.fillAndStroke(); | |
| 2958 | + } | |
| 2959 | + } | |
| 2960 | + catch (e) { | |
| 2961 | + // ignore | |
| 2962 | + } | |
| 2963 | +}; | |
| 2964 | + | |
| 3196 | 2965 | mxCellRenderer.registerShape(mxShapeBasicPolygon.prototype.cst.POLYGON, mxShapeBasicPolygon); |
| 3197 | 2966 | |
| 3198 | 2967 | mxShapeBasicPolygon.prototype.constraints = null; |
| 3199 | - | |
| 3200 | -Graph.handleFactory[mxShapeBasicPolygon.prototype.cst.POLYGON] = function(state) | |
| 3201 | -{ | |
| 3202 | - var handles = []; | |
| 3203 | - | |
| 3204 | - try | |
| 3205 | - { | |
| 3206 | - var c = JSON.parse(mxUtils.getValue(state.style, 'polyCoords', '[]')); | |
| 3207 | - | |
| 3208 | - for (var i = 0; i < c.length; i++) | |
| 3209 | - { | |
| 3210 | - (function(index) | |
| 3211 | - { | |
| 3212 | - handles.push(Graph.createHandle(state, ['polyCoords'], function(bounds) | |
| 3213 | - { | |
| 3214 | - return new mxPoint(bounds.x + c[index][0] * bounds.width, bounds.y + c[index][1] * bounds.height); | |
| 3215 | - }, function(bounds, pt) | |
| 3216 | - { | |
| 3217 | - var x = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; | |
| 3218 | - var y = Math.round(100 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 100; | |
| 3219 | - | |
| 3220 | - c[index] = [x, y]; | |
| 3221 | - state.style['polyCoords'] = JSON.stringify(c); | |
| 3222 | - | |
| 3223 | - }, false)); | |
| 3224 | - })(i); | |
| 3225 | - } | |
| 3226 | - } | |
| 3227 | - catch (e) | |
| 3228 | - { | |
| 3229 | - // ignore | |
| 3230 | - } | |
| 3231 | - | |
| 3232 | - return handles; | |
| 2968 | + | |
| 2969 | +Graph.handleFactory[mxShapeBasicPolygon.prototype.cst.POLYGON] = function (state) { | |
| 2970 | + var handles = []; | |
| 2971 | + | |
| 2972 | + try { | |
| 2973 | + var c = JSON.parse(mxUtils.getValue(state.style, 'polyCoords', '[]')); | |
| 2974 | + | |
| 2975 | + for (var i = 0; i < c.length; i++) { | |
| 2976 | + (function (index) { | |
| 2977 | + handles.push(Graph.createHandle(state, ['polyCoords'], function (bounds) { | |
| 2978 | + return new mxPoint(bounds.x + c[index][0] * bounds.width, bounds.y + c[index][1] * bounds.height); | |
| 2979 | + }, function (bounds, pt) { | |
| 2980 | + var x = Math.round(100 * Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width))) / 100; | |
| 2981 | + var y = Math.round(100 * Math.max(0, Math.min(1, (pt.y - bounds.y) / bounds.height))) / 100; | |
| 2982 | + | |
| 2983 | + c[index] = [x, y]; | |
| 2984 | + state.style['polyCoords'] = JSON.stringify(c); | |
| 2985 | + | |
| 2986 | + }, false)); | |
| 2987 | + })(i); | |
| 2988 | + } | |
| 2989 | + } | |
| 2990 | + catch (e) { | |
| 2991 | + // ignore | |
| 2992 | + } | |
| 2993 | + | |
| 2994 | + return handles; | |
| 3233 | 2995 | }; |
| 3234 | 2996 | |
| 3235 | 2997 | //********************************************************************************************************************************************************** |
| ... | ... | @@ -3238,8 +3000,7 @@ Graph.handleFactory[mxShapeBasicPolygon.prototype.cst.POLYGON] = function(state) |
| 3238 | 3000 | /** |
| 3239 | 3001 | * Extends mxShape. |
| 3240 | 3002 | */ |
| 3241 | -function mxShapeBasicPatternFillRect(bounds, fill, stroke, strokewidth) | |
| 3242 | -{ | |
| 3003 | +function mxShapeBasicPatternFillRect(bounds, fill, stroke, strokewidth) { | |
| 3243 | 3004 | mxShape.call(this); |
| 3244 | 3005 | this.bounds = bounds; |
| 3245 | 3006 | this.fill = fill; |
| ... | ... | @@ -3253,26 +3014,28 @@ function mxShapeBasicPatternFillRect(bounds, fill, stroke, strokewidth) |
| 3253 | 3014 | */ |
| 3254 | 3015 | mxUtils.extend(mxShapeBasicPatternFillRect, mxActor); |
| 3255 | 3016 | |
| 3256 | -mxShapeBasicPatternFillRect.prototype.cst = {PATTERN_FILL_RECT : 'mxgraph.basic.patternFillRect'}; | |
| 3017 | +mxShapeBasicPatternFillRect.prototype.cst = { PATTERN_FILL_RECT: 'mxgraph.basic.patternFillRect' }; | |
| 3257 | 3018 | |
| 3258 | 3019 | mxShapeBasicPatternFillRect.prototype.customProperties = [ |
| 3259 | - {name: 'step', dispName: 'Fill Step', type: 'float', min:0, defVal:5}, | |
| 3260 | - {name: 'fillStyle', dispName: 'Fill Style', type: 'enum', defVal:'none', | |
| 3261 | - enumList:[ | |
| 3262 | - {val: 'none', dispName: 'None'}, | |
| 3263 | - {val: 'diag', dispName: 'Diagonal'}, | |
| 3264 | - {val: 'diagRev', dispName: 'Diagonal Reverse'}, | |
| 3265 | - {val: 'vert', dispName: 'Vertical'}, | |
| 3266 | - {val: 'hor', dispName: 'Horizontal'}, | |
| 3267 | - {val: 'grid', dispName: 'Grid'}, | |
| 3268 | - {val: 'diagGrid', dispName: 'Diagonal Grid'} | |
| 3269 | - ]}, | |
| 3270 | - {name: 'fillStrokeWidth', dispName: 'Fill Stroke Width', type: 'float', min:0, defVal:1}, | |
| 3271 | - {name: 'fillStrokeColor', dispName: 'Fill Stroke Color', type: 'color', defVal:'#cccccc'}, | |
| 3272 | - {name: 'top', dispName: 'Top Line', type: 'bool', defVal:true}, | |
| 3273 | - {name: 'right', dispName: 'Right Line', type: 'bool', defVal:true}, | |
| 3274 | - {name: 'bottom', dispName: 'Bottom Line', type: 'bool', defVal:true}, | |
| 3275 | - {name: 'left', dispName: 'Left Line', type: 'bool', defVal:true} | |
| 3020 | + { name: 'step', dispName: 'Fill Step', type: 'float', min: 0, defVal: 5 }, | |
| 3021 | + { | |
| 3022 | + name: 'fillStyle', dispName: 'Fill Style', type: 'enum', defVal: 'none', | |
| 3023 | + enumList: [ | |
| 3024 | + { val: 'none', dispName: 'None' }, | |
| 3025 | + { val: 'diag', dispName: 'Diagonal' }, | |
| 3026 | + { val: 'diagRev', dispName: 'Diagonal Reverse' }, | |
| 3027 | + { val: 'vert', dispName: 'Vertical' }, | |
| 3028 | + { val: 'hor', dispName: 'Horizontal' }, | |
| 3029 | + { val: 'grid', dispName: 'Grid' }, | |
| 3030 | + { val: 'diagGrid', dispName: 'Diagonal Grid' } | |
| 3031 | + ] | |
| 3032 | + }, | |
| 3033 | + { name: 'fillStrokeWidth', dispName: 'Fill Stroke Width', type: 'float', min: 0, defVal: 1 }, | |
| 3034 | + { name: 'fillStrokeColor', dispName: 'Fill Stroke Color', type: 'color', defVal: '#cccccc' }, | |
| 3035 | + { name: 'top', dispName: 'Top Line', type: 'bool', defVal: true }, | |
| 3036 | + { name: 'right', dispName: 'Right Line', type: 'bool', defVal: true }, | |
| 3037 | + { name: 'bottom', dispName: 'Bottom Line', type: 'bool', defVal: true }, | |
| 3038 | + { name: 'left', dispName: 'Left Line', type: 'bool', defVal: true } | |
| 3276 | 3039 | ]; |
| 3277 | 3040 | |
| 3278 | 3041 | /** |
| ... | ... | @@ -3280,201 +3043,171 @@ mxShapeBasicPatternFillRect.prototype.customProperties = [ |
| 3280 | 3043 | * |
| 3281 | 3044 | * Paints the vertex shape. |
| 3282 | 3045 | */ |
| 3283 | -mxShapeBasicPatternFillRect.prototype.paintVertexShape = function(c, x, y, w, h) | |
| 3284 | -{ | |
| 3046 | +mxShapeBasicPatternFillRect.prototype.paintVertexShape = function (c, x, y, w, h) { | |
| 3285 | 3047 | c.translate(x, y); |
| 3286 | - | |
| 3048 | + | |
| 3287 | 3049 | var strokeColor = mxUtils.getValue(this.style, 'strokeColor', '#000000'); |
| 3288 | 3050 | var strokeWidth = mxUtils.getValue(this.style, 'strokeWidth', '1'); |
| 3289 | - | |
| 3051 | + | |
| 3290 | 3052 | c.rect(0, 0, w, h); |
| 3291 | 3053 | c.fill(); |
| 3292 | 3054 | |
| 3293 | 3055 | var fillStrokeColor = mxUtils.getValue(this.style, 'fillStrokeColor', '#cccccc'); |
| 3294 | 3056 | var fillStrokeWidth = parseFloat(mxUtils.getValue(this.style, 'fillStrokeWidth', 1)); |
| 3295 | - | |
| 3057 | + | |
| 3296 | 3058 | c.setStrokeColor(fillStrokeColor); |
| 3297 | 3059 | c.setStrokeWidth(fillStrokeWidth); |
| 3298 | - | |
| 3060 | + | |
| 3299 | 3061 | var step = parseFloat(mxUtils.getValue(this.style, 'step', 5)); |
| 3300 | 3062 | var fillStyle = mxUtils.getValue(this.style, 'fillStyle', 'none'); |
| 3301 | 3063 | |
| 3302 | - if (fillStyle == 'diag' || fillStyle == 'diagGrid') | |
| 3303 | - { | |
| 3064 | + if (fillStyle == 'diag' || fillStyle == 'diagGrid') { | |
| 3304 | 3065 | step = step * 1.41; |
| 3305 | 3066 | var i = 0; |
| 3306 | - | |
| 3067 | + | |
| 3307 | 3068 | c.begin(); |
| 3308 | - | |
| 3309 | - while (i < (h + w)) | |
| 3310 | - { | |
| 3069 | + | |
| 3070 | + while (i < (h + w)) { | |
| 3311 | 3071 | var cx = 0; |
| 3312 | 3072 | var cy = 0; |
| 3313 | - | |
| 3314 | - if (i <= h) | |
| 3315 | - { | |
| 3073 | + | |
| 3074 | + if (i <= h) { | |
| 3316 | 3075 | c.moveTo(0, i); |
| 3317 | - | |
| 3318 | - if(i <= w) | |
| 3319 | - { | |
| 3076 | + | |
| 3077 | + if (i <= w) { | |
| 3320 | 3078 | c.lineTo(i, 0); |
| 3321 | 3079 | } |
| 3322 | - else | |
| 3323 | - { | |
| 3080 | + else { | |
| 3324 | 3081 | c.lineTo(w, i - w); |
| 3325 | 3082 | } |
| 3326 | 3083 | } |
| 3327 | - else | |
| 3328 | - { | |
| 3084 | + else { | |
| 3329 | 3085 | c.moveTo(i - h, h); |
| 3330 | - | |
| 3331 | - if(i <= w) | |
| 3332 | - { | |
| 3086 | + | |
| 3087 | + if (i <= w) { | |
| 3333 | 3088 | c.lineTo(i, 0); |
| 3334 | 3089 | } |
| 3335 | - else | |
| 3336 | - { | |
| 3090 | + else { | |
| 3337 | 3091 | c.lineTo(w, i - w); |
| 3338 | 3092 | } |
| 3339 | 3093 | } |
| 3340 | - | |
| 3094 | + | |
| 3341 | 3095 | i = i + step; |
| 3342 | 3096 | } |
| 3343 | - | |
| 3097 | + | |
| 3344 | 3098 | c.stroke(); |
| 3345 | 3099 | } |
| 3346 | - else if (fillStyle == 'vert' || fillStyle == 'grid') | |
| 3347 | - { | |
| 3100 | + else if (fillStyle == 'vert' || fillStyle == 'grid') { | |
| 3348 | 3101 | c.begin(); |
| 3349 | 3102 | var i = 0; |
| 3350 | - | |
| 3351 | - while (i <= w) | |
| 3352 | - { | |
| 3103 | + | |
| 3104 | + while (i <= w) { | |
| 3353 | 3105 | var cx = 0; |
| 3354 | 3106 | var cy = 0; |
| 3355 | - | |
| 3107 | + | |
| 3356 | 3108 | c.moveTo(i, 0); |
| 3357 | 3109 | c.lineTo(i, h); |
| 3358 | - | |
| 3110 | + | |
| 3359 | 3111 | i = i + step; |
| 3360 | 3112 | } |
| 3361 | - | |
| 3113 | + | |
| 3362 | 3114 | c.stroke(); |
| 3363 | 3115 | } |
| 3364 | - | |
| 3365 | - if (fillStyle == 'diagRev' || fillStyle == 'diagGrid') | |
| 3366 | - { | |
| 3367 | - if (fillStyle == 'diagRev') | |
| 3368 | - { | |
| 3116 | + | |
| 3117 | + if (fillStyle == 'diagRev' || fillStyle == 'diagGrid') { | |
| 3118 | + if (fillStyle == 'diagRev') { | |
| 3369 | 3119 | step = step * 1.41; |
| 3370 | 3120 | } |
| 3371 | 3121 | |
| 3372 | 3122 | var i = 0; |
| 3373 | - | |
| 3123 | + | |
| 3374 | 3124 | c.begin(); |
| 3375 | - | |
| 3376 | - while (i < (h + w)) | |
| 3377 | - { | |
| 3125 | + | |
| 3126 | + while (i < (h + w)) { | |
| 3378 | 3127 | var cx = 0; |
| 3379 | 3128 | var cy = 0; |
| 3380 | - | |
| 3381 | - if (i <= h) | |
| 3382 | - { | |
| 3129 | + | |
| 3130 | + if (i <= h) { | |
| 3383 | 3131 | c.moveTo(w, i); |
| 3384 | - | |
| 3385 | - if(i <= w) | |
| 3386 | - { | |
| 3132 | + | |
| 3133 | + if (i <= w) { | |
| 3387 | 3134 | c.lineTo(w - i, 0); |
| 3388 | 3135 | } |
| 3389 | - else | |
| 3390 | - { | |
| 3136 | + else { | |
| 3391 | 3137 | c.lineTo(w - w, i - w); |
| 3392 | 3138 | } |
| 3393 | 3139 | } |
| 3394 | - else | |
| 3395 | - { | |
| 3140 | + else { | |
| 3396 | 3141 | c.moveTo(w - i + h, h); |
| 3397 | - | |
| 3398 | - if(i <= w) | |
| 3399 | - { | |
| 3142 | + | |
| 3143 | + if (i <= w) { | |
| 3400 | 3144 | c.lineTo(w - i, 0); |
| 3401 | 3145 | } |
| 3402 | - else | |
| 3403 | - { | |
| 3146 | + else { | |
| 3404 | 3147 | c.lineTo(0, i - w); |
| 3405 | 3148 | } |
| 3406 | 3149 | } |
| 3407 | - | |
| 3150 | + | |
| 3408 | 3151 | i = i + step; |
| 3409 | 3152 | } |
| 3410 | - | |
| 3153 | + | |
| 3411 | 3154 | c.stroke(); |
| 3412 | 3155 | } |
| 3413 | - else if (fillStyle == 'hor' || fillStyle == 'grid') | |
| 3414 | - { | |
| 3156 | + else if (fillStyle == 'hor' || fillStyle == 'grid') { | |
| 3415 | 3157 | c.begin(); |
| 3416 | 3158 | var i = 0; |
| 3417 | - | |
| 3418 | - while (i <= h) | |
| 3419 | - { | |
| 3159 | + | |
| 3160 | + while (i <= h) { | |
| 3420 | 3161 | var cx = 0; |
| 3421 | 3162 | var cy = 0; |
| 3422 | - | |
| 3163 | + | |
| 3423 | 3164 | c.moveTo(0, i); |
| 3424 | 3165 | c.lineTo(w, i); |
| 3425 | - | |
| 3166 | + | |
| 3426 | 3167 | i = i + step; |
| 3427 | 3168 | } |
| 3428 | - | |
| 3169 | + | |
| 3429 | 3170 | c.stroke(); |
| 3430 | 3171 | } |
| 3431 | 3172 | |
| 3432 | 3173 | c.setStrokeColor(strokeColor); |
| 3433 | 3174 | c.setStrokeWidth(strokeWidth); |
| 3434 | - | |
| 3175 | + | |
| 3435 | 3176 | c.begin(); |
| 3436 | 3177 | c.moveTo(0, 0); |
| 3437 | - | |
| 3438 | - if (mxUtils.getValue(this.style, 'top', '1') == '1') | |
| 3439 | - { | |
| 3178 | + | |
| 3179 | + if (mxUtils.getValue(this.style, 'top', '1') == '1') { | |
| 3440 | 3180 | c.lineTo(w, 0); |
| 3441 | 3181 | } |
| 3442 | - else | |
| 3443 | - { | |
| 3182 | + else { | |
| 3444 | 3183 | c.moveTo(w, 0); |
| 3445 | 3184 | } |
| 3446 | - | |
| 3447 | - if (mxUtils.getValue(this.style, 'right', '1') == '1') | |
| 3448 | - { | |
| 3185 | + | |
| 3186 | + if (mxUtils.getValue(this.style, 'right', '1') == '1') { | |
| 3449 | 3187 | c.lineTo(w, h); |
| 3450 | 3188 | } |
| 3451 | - else | |
| 3452 | - { | |
| 3189 | + else { | |
| 3453 | 3190 | c.moveTo(w, h); |
| 3454 | 3191 | } |
| 3455 | - | |
| 3456 | - if (mxUtils.getValue(this.style, 'bottom', '1') == '1') | |
| 3457 | - { | |
| 3192 | + | |
| 3193 | + if (mxUtils.getValue(this.style, 'bottom', '1') == '1') { | |
| 3458 | 3194 | c.lineTo(0, h); |
| 3459 | 3195 | } |
| 3460 | - else | |
| 3461 | - { | |
| 3196 | + else { | |
| 3462 | 3197 | c.moveTo(0, h); |
| 3463 | 3198 | } |
| 3464 | - | |
| 3465 | - if (mxUtils.getValue(this.style, 'left', '1') == '1') | |
| 3466 | - { | |
| 3199 | + | |
| 3200 | + if (mxUtils.getValue(this.style, 'left', '1') == '1') { | |
| 3467 | 3201 | c.lineTo(0, 0); |
| 3468 | 3202 | } |
| 3469 | - | |
| 3203 | + | |
| 3470 | 3204 | c.end(); |
| 3471 | 3205 | c.stroke(); |
| 3472 | 3206 | }; |
| 3473 | 3207 | |
| 3474 | 3208 | mxCellRenderer.registerShape(mxShapeBasicPatternFillRect.prototype.cst.PATTERN_FILL_RECT, mxShapeBasicPatternFillRect); |
| 3475 | 3209 | |
| 3476 | -mxShapeBasicPatternFillRect.prototype.getConstraints = function(style, w, h) | |
| 3477 | -{ | |
| 3210 | +mxShapeBasicPatternFillRect.prototype.getConstraints = function (style, w, h) { | |
| 3478 | 3211 | var constr = []; |
| 3479 | 3212 | |
| 3480 | 3213 | constr.push(new mxConnectionConstraint(new mxPoint(0, 0), false)); | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxAlarmListComponent.prototype.customProperties = [ |
| 15 | 15 | mxAlarmListComponent.prototype.shapeKey = 'mxgraph.thingskit/alarmListComponent' |
| 16 | 16 | |
| 17 | 17 | mxAlarmListComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h); | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxAlarmListComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxAlarmListComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxCircularFlowMeterComponent.prototype.customProperties = [ |
| 15 | 15 | mxCircularFlowMeterComponent.prototype.shapeKey = 'mxgraph.thingskit/circularFlowMeterComponent' |
| 16 | 16 | |
| 17 | 17 | mxCircularFlowMeterComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxCircularFlowMeterComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxCircularFlowMeterComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxDigitalClockComponent.prototype.customProperties = [ |
| 15 | 15 | mxDigitalClockComponent.prototype.shapeKey = 'mxgraph.thingskit/digitalClockComponent' |
| 16 | 16 | |
| 17 | 17 | mxDigitalClockComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxDigitalClockComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxDigitalClockComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxHistogramChartComponent.prototype.customProperties = [ |
| 15 | 15 | mxHistogramChartComponent.prototype.shapeKey = 'mxgraph.thingskit/histogramChartComponent' |
| 16 | 16 | |
| 17 | 17 | mxHistogramChartComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxHistogramChartComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxHistogramChartComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxImageComponent.prototype.customProperties = [ |
| 15 | 15 | mxImageComponent.prototype.shapeKey = 'mxgraph.thingskit/imageComponent' |
| 16 | 16 | |
| 17 | 17 | mxImageComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxImageComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxImageComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxInstrumentChartComponent.prototype.customProperties = [ |
| 15 | 15 | mxInstrumentChartComponent.prototype.shapeKey = 'mxgraph.thingskit/instrumentChartComponent' |
| 16 | 16 | |
| 17 | 17 | mxInstrumentChartComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxInstrumentChartComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxInstrumentChartComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxLineChartComponent.prototype.customProperties = [ |
| 15 | 15 | mxLineChartComponent.prototype.shapeKey = 'mxgraph.thingskit/lineChartComponent' |
| 16 | 16 | |
| 17 | 17 | mxLineChartComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxLineChartComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxLineChartComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxParameterSettingsComponent.prototype.customProperties = [ |
| 15 | 15 | mxParameterSettingsComponent.prototype.shapeKey = 'mxgraph.thingskit/parameterSettingsComponent' |
| 16 | 16 | |
| 17 | 17 | mxParameterSettingsComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxParameterSettingsComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxParameterSettingsComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxRectFlowMeterComponent.prototype.customProperties = [ |
| 15 | 15 | mxRectFlowMeterComponent.prototype.shapeKey = 'mxgraph.thingskit/rectFlowMeterComponent' |
| 16 | 16 | |
| 17 | 17 | mxRectFlowMeterComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxRectFlowMeterComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxRectFlowMeterComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxSwitchComponent.prototype.customProperties = [ |
| 15 | 15 | mxSwitchComponent.prototype.shapeKey = 'mxgraph.thingskit/switchComponent' |
| 16 | 16 | |
| 17 | 17 | mxSwitchComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxSwitchComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxSwitchComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxThermometerComponent.prototype.customProperties = [ |
| 15 | 15 | mxThermometerComponent.prototype.shapeKey = 'mxgraph.thingskit/thermometerComponent' |
| 16 | 16 | |
| 17 | 17 | mxThermometerComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxThermometerComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxThermometerComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -15,9 +15,15 @@ mxVariableImageComponent.prototype.customProperties = [ |
| 15 | 15 | mxVariableImageComponent.prototype.shapeKey = 'mxgraph.thingskit/variableImageComponent' |
| 16 | 16 | |
| 17 | 17 | mxVariableImageComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 18 | + this.paintBackground(c, x, y, w, h) | |
| 18 | 19 | this.foreground(c, x, y, w, h) |
| 19 | 20 | } |
| 20 | 21 | |
| 22 | +mxVariableImageComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 23 | + svgCanvas.rect(x, y, w, h); | |
| 24 | + svgCanvas.fillAndStroke() | |
| 25 | +} | |
| 26 | + | |
| 21 | 27 | mxVariableImageComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 22 | 28 | var cell = this.state.cell |
| 23 | 29 | var status = getCellStatus(this.state.view.graph) | ... | ... |
| ... | ... | @@ -13,9 +13,15 @@ mxVideoComponent.prototype.customProperties = [{ componentType: 'text' }] |
| 13 | 13 | mxVideoComponent.prototype.shapeKey = 'mxgraph.thingskit/videoComponent' |
| 14 | 14 | |
| 15 | 15 | mxVideoComponent.prototype.paintVertexShape = function (c, x, y, w, h) { |
| 16 | + // this.paintBackground(c, x, y, w, h) | |
| 16 | 17 | this.foreground(c, x, y, w, h) |
| 17 | 18 | } |
| 18 | 19 | |
| 20 | +mxVideoComponent.prototype.paintBackground = function (svgCanvas, x, y, w, h) { | |
| 21 | + svgCanvas.rect(x, y, w, h); | |
| 22 | + svgCanvas.fillAndStroke() | |
| 23 | +} | |
| 24 | + | |
| 19 | 25 | mxVideoComponent.prototype.foreground = function (svgCanvas, x, y, w, h) { |
| 20 | 26 | var cell = this.state.cell |
| 21 | 27 | cell.setAttribute('shapeKey', this.shapeKey) | ... | ... |
| 1 | +import type { AlarmStatusEnum } from '@/enums/datasource' | |
| 2 | + | |
| 1 | 3 | /** |
| 2 | 4 | * 告警列表 |
| 3 | 5 | */ |
| ... | ... | @@ -28,7 +30,7 @@ export interface AlarmListItemType { |
| 28 | 30 | deviceName: string |
| 29 | 31 | type: string |
| 30 | 32 | severity: string |
| 31 | - status: string | |
| 33 | + status: AlarmStatusEnum | |
| 32 | 34 | startTs: string |
| 33 | 35 | endTs: string |
| 34 | 36 | ackTs: string | ... | ... |
| ... | ... | @@ -41,7 +41,7 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { |
| 41 | 41 | // transportType:判断是什么类型的设备 code:设备地址码 deviceType:设备类型 |
| 42 | 42 | let codeType: string | null = '' |
| 43 | 43 | const { transportType, deviceType, codeType: deviceCodeType } = deviceInfo || {} |
| 44 | - codeType = deviceCodeType || (deviceId ? contentDataStore.diveceDetailMap?.[deviceId].codeType : null) | |
| 44 | + codeType = deviceCodeType || (deviceId ? contentDataStore.diveceDetailMap?.[deviceId]?.codeType : null) | |
| 45 | 45 | const isTemplate = contentDataStore.isTemplate // 判断是否是模板 |
| 46 | 46 | return [ |
| 47 | 47 | { |
| ... | ... | @@ -124,8 +124,17 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { |
| 124 | 124 | |
| 125 | 125 | function setOptions() { |
| 126 | 126 | // 是模板的话选择不到设备标识符类型所以就判断为放开自定义命令 |
| 127 | - if (isTemplate) | |
| 127 | + if (isTemplate) { | |
| 128 | + if (transportType !== TransportTypeEnum.TCP) | |
| 129 | + options.push(serviceOption) | |
| 128 | 130 | return |
| 131 | + } | |
| 132 | + | |
| 133 | + if (transportType !== TransportTypeEnum.TCP && deviceType === DeviceTypeEnum.SENSOR) { | |
| 134 | + // 判断不是TCP但是是网关子 | |
| 135 | + options.push(serviceOption) | |
| 136 | + return | |
| 137 | + } | |
| 129 | 138 | |
| 130 | 139 | if (deviceType !== DeviceTypeEnum.SENSOR) |
| 131 | 140 | options.push(serviceOption) |
| ... | ... | @@ -148,6 +157,7 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { |
| 148 | 157 | [FormFieldsEnum.SERVICE]: undefined, |
| 149 | 158 | [FormFieldsEnum.CUSTOM_COMMAND]: null, |
| 150 | 159 | [FormFieldsEnum.WAY]: CommandWayEnum.ONE_WAY, |
| 160 | + [FormFieldsEnum.THINGS_MODEL]: null, | |
| 151 | 161 | }) |
| 152 | 162 | }, |
| 153 | 163 | } |
| ... | ... | @@ -205,6 +215,9 @@ export const getFormSchemas = (event: EventTypeEnum): FormSchema[] => { |
| 205 | 215 | formModel[FormFieldsEnum.THINGS_MODEL] = value ? options : null |
| 206 | 216 | formModel.callType = options.callType |
| 207 | 217 | }, |
| 218 | + onChange(value: string | number | undefined) { // 因为select不会执行清除选择 所以使用change时间 | |
| 219 | + if (!value) formModel[FormFieldsEnum.THINGS_MODEL] = null | |
| 220 | + }, | |
| 208 | 221 | onOptionsChange(options: ThingsModel[]) { |
| 209 | 222 | const service = formModel[FormFieldsEnum.SERVICE] |
| 210 | 223 | if (service) { | ... | ... |
| ... | ... | @@ -60,7 +60,7 @@ export const formSchemas = (componentKey?: string): FormSchema[] => { |
| 60 | 60 | formModel[ContentDataFieldsEnum.ATTR] = null |
| 61 | 61 | }, |
| 62 | 62 | filterOption: (inputValue: string, option: DeviceItemType) => { |
| 63 | - option.alias?.includes?.(inputValue) || option.name?.includes?.(inputValue) | |
| 63 | + return option.alias?.includes?.(inputValue) || option.name?.includes?.(inputValue) | |
| 64 | 64 | }, |
| 65 | 65 | } |
| 66 | 66 | }, |
| ... | ... | @@ -89,8 +89,9 @@ export const formSchemas = (componentKey?: string): FormSchema[] => { |
| 89 | 89 | onSelect(value: string, option: ThingsModelItemType) { |
| 90 | 90 | formModel[ContentDataFieldsEnum.ATTR_INFO] = value && option ? toRaw(unref(option)) : null |
| 91 | 91 | }, |
| 92 | - filterOption: (inputValue: string, option: ThingsModelItemType) => | |
| 93 | - option.name.includes(inputValue), | |
| 92 | + filterOption: (inputValue: string, option: ThingsModelItemType) => { | |
| 93 | + return option.name.includes(inputValue) | |
| 94 | + }, | |
| 94 | 95 | } |
| 95 | 96 | }, |
| 96 | 97 | }, | ... | ... |
src/core/Library/hook/useComponentStyle.ts
0 → 100644
| 1 | +import type { CSSProperties } from 'vue' | |
| 2 | +import type { RenderComponentProps } from '../types' | |
| 3 | +import { NodeUtils } from '@/hooks/business/useNodeUtils' | |
| 4 | +import { EnableEnum, GradientDirectionEnum, type MxShapeStyleType } from '@/fitCore/types' | |
| 5 | + | |
| 6 | +const gradientDirectionMap = { | |
| 7 | + [GradientDirectionEnum.NORTH]: 'to top', | |
| 8 | + [GradientDirectionEnum.EAST]: 'to right', | |
| 9 | + [GradientDirectionEnum.SOUTH]: 'to bottom', | |
| 10 | + [GradientDirectionEnum.WEST]: 'to left', | |
| 11 | +} | |
| 12 | + | |
| 13 | +export interface UseComponentStyleReturnType { | |
| 14 | + style: CSSProperties | |
| 15 | + textAalign?: string | |
| 16 | + borderColor?: string | |
| 17 | + borderWidth?: number | |
| 18 | + borderStyle?: string | |
| 19 | + backgroundColor?: string | |
| 20 | + fontFamily?: string | |
| 21 | + color?: string | |
| 22 | + fontSize?: number | |
| 23 | + gradientBackgroundColor?: string | |
| 24 | + gradientDirection?: GradientDirectionEnum | |
| 25 | + opacity?: number | |
| 26 | +} | |
| 27 | + | |
| 28 | +export function useComponentStyle(props: RenderComponentProps): UseComponentStyleReturnType { | |
| 29 | + const result: UseComponentStyleReturnType = { style: {} } | |
| 30 | + | |
| 31 | + const nodeUtils = new NodeUtils() | |
| 32 | + const { cellInfo } = props.config | |
| 33 | + const { id } = cellInfo || {} | |
| 34 | + if (!id) return result | |
| 35 | + const cell = nodeUtils.getCellById(id) | |
| 36 | + | |
| 37 | + if (!cell) return result | |
| 38 | + | |
| 39 | + const cellState = nodeUtils.getCellState(cell) | |
| 40 | + | |
| 41 | + const { | |
| 42 | + align, | |
| 43 | + dashed, | |
| 44 | + fillColor, | |
| 45 | + fontColor, | |
| 46 | + fontFamily, | |
| 47 | + fontSize, | |
| 48 | + gradientColor, | |
| 49 | + gradientDirection, | |
| 50 | + opacity, | |
| 51 | + // shadow, | |
| 52 | + strokeColor, | |
| 53 | + // sketch, | |
| 54 | + strokeWidth = 1, | |
| 55 | + } = cellState.style as MxShapeStyleType | |
| 56 | + | |
| 57 | + const getBackgroundColor = () => { | |
| 58 | + return { | |
| 59 | + background: gradientColor !== 'none' | |
| 60 | + ? gradientDirection === GradientDirectionEnum.RADIAL | |
| 61 | + ? `radial-gradient(${fillColor}, ${gradientColor})` | |
| 62 | + : `linear-gradient(${gradientDirectionMap[gradientDirection]}, ${fillColor}, ${gradientColor})` | |
| 63 | + : fillColor, | |
| 64 | + } as CSSProperties | |
| 65 | + } | |
| 66 | + | |
| 67 | + const getBorderStyle = () => { | |
| 68 | + return { | |
| 69 | + borderColor: strokeColor, | |
| 70 | + borderWidth: strokeWidth, | |
| 71 | + borderStyle: strokeColor | |
| 72 | + ? dashed === EnableEnum.ENABLE | |
| 73 | + ? 'dashed' | |
| 74 | + : 'solid' | |
| 75 | + : 'none', | |
| 76 | + } as CSSProperties | |
| 77 | + } | |
| 78 | + | |
| 79 | + return { | |
| 80 | + style: { | |
| 81 | + textAlign: align, | |
| 82 | + opacity, | |
| 83 | + fontSize, | |
| 84 | + fontFamily, | |
| 85 | + color: fontColor, | |
| 86 | + ...getBorderStyle(), | |
| 87 | + ...getBackgroundColor(), | |
| 88 | + }, | |
| 89 | + textAalign: align, | |
| 90 | + borderColor: strokeColor, | |
| 91 | + borderWidth: strokeWidth, | |
| 92 | + borderStyle: dashed === EnableEnum.ENABLE ? 'dashed' : 'solid', | |
| 93 | + backgroundColor: fillColor, | |
| 94 | + fontFamily, | |
| 95 | + color: fontColor, | |
| 96 | + fontSize, | |
| 97 | + gradientBackgroundColor: gradientColor, | |
| 98 | + gradientDirection, | |
| 99 | + opacity, | |
| 100 | + } | |
| 101 | +} | ... | ... |
| 1 | +import type { CSSProperties } from 'vue' | |
| 2 | +import { | |
| 3 | + computed, | |
| 4 | + defineComponent, | |
| 5 | + getCurrentInstance, | |
| 6 | + nextTick, | |
| 7 | + onBeforeMount, | |
| 8 | + onMounted, | |
| 9 | + ref, | |
| 10 | + watch, | |
| 11 | +} from 'vue' | |
| 12 | +import { useThrottleFn } from '@vueuse/core' | |
| 13 | + | |
| 14 | +interface PropsType { | |
| 15 | + modelValue: boolean | |
| 16 | + list: Array<unknown> | |
| 17 | + step: number | |
| 18 | + limitScrollNum: number | |
| 19 | + hover: boolean | |
| 20 | + direction: String | |
| 21 | + singleHeight: number | |
| 22 | + singleWidth: number | |
| 23 | + singleWaitTime: number | |
| 24 | + isRemUnit: boolean | |
| 25 | + isWatch: boolean | |
| 26 | + delay: number | |
| 27 | + ease: any | |
| 28 | + count: number | |
| 29 | + copyNum: number | |
| 30 | + wheel: boolean | |
| 31 | + singleLine: boolean | |
| 32 | +} | |
| 33 | + | |
| 34 | +function useExpose(apis: Record<string, any>) { | |
| 35 | + const instance = getCurrentInstance() | |
| 36 | + if (instance) | |
| 37 | + Object.assign(instance.proxy as Object, apis) | |
| 38 | +} | |
| 39 | + | |
| 40 | +const Props = { | |
| 41 | + // 是否开启自动滚动 | |
| 42 | + modelValue: { | |
| 43 | + type: Boolean, | |
| 44 | + default: true, | |
| 45 | + }, | |
| 46 | + // 原始数据列表 | |
| 47 | + list: { | |
| 48 | + type: Array, | |
| 49 | + required: true, | |
| 50 | + default: [], | |
| 51 | + }, | |
| 52 | + // 步进速度,step 需是单步大小的约数 | |
| 53 | + step: { | |
| 54 | + type: Number, | |
| 55 | + default: 1, | |
| 56 | + }, | |
| 57 | + // 开启滚动的数据量 | |
| 58 | + limitScrollNum: { | |
| 59 | + type: Number, | |
| 60 | + default: 3, | |
| 61 | + }, | |
| 62 | + // 是否开启鼠标悬停 | |
| 63 | + hover: { | |
| 64 | + type: Boolean, | |
| 65 | + default: false, | |
| 66 | + }, | |
| 67 | + // 控制滚动方向 | |
| 68 | + direction: { | |
| 69 | + type: String, | |
| 70 | + default: 'up', | |
| 71 | + }, | |
| 72 | + // 单步运动停止的高度 | |
| 73 | + singleHeight: { | |
| 74 | + type: Number, | |
| 75 | + default: 0, | |
| 76 | + }, | |
| 77 | + // 单步运动停止的宽度 | |
| 78 | + singleWidth: { | |
| 79 | + type: Number, | |
| 80 | + default: 0, | |
| 81 | + }, | |
| 82 | + // 单步停止等待时间 (默认值 1000ms) | |
| 83 | + singleWaitTime: { | |
| 84 | + type: Number, | |
| 85 | + default: 1000, | |
| 86 | + }, | |
| 87 | + // 是否开启 rem 度量 | |
| 88 | + isRemUnit: { | |
| 89 | + type: Boolean, | |
| 90 | + default: false, | |
| 91 | + }, | |
| 92 | + // 开启数据更新监听 | |
| 93 | + isWatch: { | |
| 94 | + type: Boolean, | |
| 95 | + default: true, | |
| 96 | + }, | |
| 97 | + // 动画时间 | |
| 98 | + delay: { | |
| 99 | + type: Number, | |
| 100 | + default: 0, | |
| 101 | + }, | |
| 102 | + // 动画方式 | |
| 103 | + ease: { | |
| 104 | + type: [String, Object], | |
| 105 | + default: 'ease-in', | |
| 106 | + }, | |
| 107 | + // 动画循环次数,-1 表示一直动画 | |
| 108 | + count: { | |
| 109 | + type: Number, | |
| 110 | + default: -1, | |
| 111 | + }, | |
| 112 | + // 拷贝几份滚动列表 | |
| 113 | + copyNum: { | |
| 114 | + type: Number, | |
| 115 | + default: 1, | |
| 116 | + }, | |
| 117 | + // 开启鼠标悬停时支持滚轮滚动 | |
| 118 | + wheel: { | |
| 119 | + type: Boolean, | |
| 120 | + default: false, | |
| 121 | + }, | |
| 122 | + // 启用单行滚动 | |
| 123 | + singleLine: { | |
| 124 | + type: Boolean, | |
| 125 | + default: false, | |
| 126 | + }, | |
| 127 | +} | |
| 128 | + | |
| 129 | +globalThis.window.cancelAnimationFrame = (function () { | |
| 130 | + return ( | |
| 131 | + globalThis.window.cancelAnimationFrame | |
| 132 | + || function (id) { | |
| 133 | + return globalThis.window.clearTimeout(id) | |
| 134 | + } | |
| 135 | + ) | |
| 136 | +})() | |
| 137 | +globalThis.window.requestAnimationFrame = (function () { | |
| 138 | + return ( | |
| 139 | + globalThis.window.requestAnimationFrame | |
| 140 | + || function (callback) { | |
| 141 | + return globalThis.window.setTimeout(callback, 1000 / 60) | |
| 142 | + } | |
| 143 | + ) | |
| 144 | +})() | |
| 145 | + | |
| 146 | +function dataWarm(list: any[]) { | |
| 147 | + if (list && typeof list !== 'boolean' && list.length > 100) { | |
| 148 | + console.warn( | |
| 149 | + `数据达到了${list.length}条有点多哦~,可能会造成部分老旧浏览器卡顿。`, | |
| 150 | + ) | |
| 151 | + } | |
| 152 | +} | |
| 153 | + | |
| 154 | +const ScrollList = defineComponent({ | |
| 155 | + name: 'ScrollList', | |
| 156 | + inheritAttrs: false, | |
| 157 | + props: Props, | |
| 158 | + emits: ['stop', 'count', 'move'], | |
| 159 | + setup(_props, { slots, emit, attrs }) { | |
| 160 | + const props = _props as unknown as PropsType | |
| 161 | + const scrollRef = ref(null) | |
| 162 | + const slotListRef = ref<HTMLDivElement | null>(null) | |
| 163 | + const realBoxRef = ref<HTMLDivElement | null>(null) | |
| 164 | + const reqFrame = ref<number | null>(null) | |
| 165 | + const singleWaitTimeout = ref<NodeJS.Timeout | null>(null) | |
| 166 | + const realBoxWidth = ref(0) | |
| 167 | + const realBoxHeight = ref(0) | |
| 168 | + const xPos = ref(0) | |
| 169 | + const yPos = ref(0) | |
| 170 | + const isHover = ref(false) | |
| 171 | + const _count = ref(0) | |
| 172 | + | |
| 173 | + const isScroll = computed(() => props.list ? (props.list.length >= props.limitScrollNum) : false) | |
| 174 | + | |
| 175 | + const realBoxStyle = computed(() => { | |
| 176 | + return { | |
| 177 | + width: realBoxWidth.value ? `${realBoxWidth.value}px` : 'auto', | |
| 178 | + transform: `translate(${xPos.value}px,${yPos.value}px)`, | |
| 179 | + | |
| 180 | + transition: `all ${typeof props.ease === 'string' | |
| 181 | + ? props.ease | |
| 182 | + : `cubic-bezier(${ | |
| 183 | + props.ease.x1 | |
| 184 | + },${ | |
| 185 | + props.ease.y1 | |
| 186 | + },${ | |
| 187 | + props.ease.x2 | |
| 188 | + },${ | |
| 189 | + props.ease.y2 | |
| 190 | + })` | |
| 191 | + } ${props.delay}ms`, | |
| 192 | + overflow: 'hidden', | |
| 193 | + display: props.singleLine ? 'flex' : 'block', | |
| 194 | + } | |
| 195 | + }) | |
| 196 | + | |
| 197 | + const isHorizontal = computed( | |
| 198 | + () => props.direction === 'left' || props.direction === 'right', | |
| 199 | + ) | |
| 200 | + | |
| 201 | + const floatStyle = computed<CSSProperties>(() => { | |
| 202 | + return isHorizontal.value | |
| 203 | + ? { | |
| 204 | + float: 'left', | |
| 205 | + overflow: 'hidden', | |
| 206 | + display: props.singleLine ? 'flex' : 'block', | |
| 207 | + flexShrink: props.singleLine ? 0 : 1, | |
| 208 | + } | |
| 209 | + : { overflow: 'hidden' } | |
| 210 | + }) | |
| 211 | + | |
| 212 | + const baseFontSize = computed(() => { | |
| 213 | + return props.isRemUnit | |
| 214 | + ? parseInt( | |
| 215 | + globalThis.window.getComputedStyle( | |
| 216 | + globalThis.document.documentElement, | |
| 217 | + null, | |
| 218 | + ).fontSize, | |
| 219 | + ) | |
| 220 | + : 1 | |
| 221 | + }) | |
| 222 | + | |
| 223 | + const realSingleStopWidth = computed( | |
| 224 | + () => props.singleWidth * baseFontSize.value, | |
| 225 | + ) | |
| 226 | + | |
| 227 | + const realSingleStopHeight = computed( | |
| 228 | + () => props.singleHeight * baseFontSize.value, | |
| 229 | + ) | |
| 230 | + | |
| 231 | + const step = computed(() => { | |
| 232 | + let singleStep: number | |
| 233 | + const _step = props.step | |
| 234 | + if (isHorizontal.value) | |
| 235 | + singleStep = realSingleStopWidth.value | |
| 236 | + | |
| 237 | + else | |
| 238 | + singleStep = realSingleStopHeight.value | |
| 239 | + | |
| 240 | + if (singleStep > 0 && singleStep % _step > 0) { | |
| 241 | + console.error( | |
| 242 | + '如果设置了单步滚动, step 需是单步大小的约数,否则无法保证单步滚动结束的位置是否准确。~~~~~', | |
| 243 | + ) | |
| 244 | + } | |
| 245 | + return _step | |
| 246 | + }) | |
| 247 | + | |
| 248 | + const cancel = () => { | |
| 249 | + cancelAnimationFrame(reqFrame.value as number) | |
| 250 | + reqFrame.value = null | |
| 251 | + } | |
| 252 | + | |
| 253 | + const animation = ( | |
| 254 | + _direction: 'up' | 'down' | 'left' | 'right', | |
| 255 | + _step: number, | |
| 256 | + isWheel?: boolean, | |
| 257 | + ) => { | |
| 258 | + reqFrame.value = requestAnimationFrame(() => { | |
| 259 | + const h = realBoxHeight.value / 2 | |
| 260 | + const w = realBoxWidth.value / 2 | |
| 261 | + if (_direction === 'up') { | |
| 262 | + if (Math.abs(yPos.value) >= h) { | |
| 263 | + yPos.value = 0 | |
| 264 | + _count.value += 1 | |
| 265 | + emit('count', _count.value) | |
| 266 | + } | |
| 267 | + yPos.value -= _step | |
| 268 | + } | |
| 269 | + else if (_direction === 'down') { | |
| 270 | + if (yPos.value >= 0) { | |
| 271 | + yPos.value = h * -1 | |
| 272 | + _count.value += 1 | |
| 273 | + emit('count', _count.value) | |
| 274 | + } | |
| 275 | + yPos.value += _step | |
| 276 | + } | |
| 277 | + else if (_direction === 'left') { | |
| 278 | + if (Math.abs(xPos.value) >= w) { | |
| 279 | + xPos.value = 0 | |
| 280 | + _count.value += 1 | |
| 281 | + emit('count', _count.value) | |
| 282 | + } | |
| 283 | + xPos.value -= _step | |
| 284 | + } | |
| 285 | + else if (_direction === 'right') { | |
| 286 | + if (xPos.value >= 0) { | |
| 287 | + xPos.value = w * -1 | |
| 288 | + _count.value += 1 | |
| 289 | + emit('count', _count.value) | |
| 290 | + } | |
| 291 | + xPos.value += _step | |
| 292 | + } | |
| 293 | + if (isWheel) | |
| 294 | + return | |
| 295 | + | |
| 296 | + const { singleWaitTime } = props | |
| 297 | + if (singleWaitTimeout.value) | |
| 298 | + clearTimeout(singleWaitTimeout.value) | |
| 299 | + | |
| 300 | + if (realSingleStopHeight.value) { | |
| 301 | + if (Math.abs(yPos.value) % realSingleStopHeight.value < _step) { | |
| 302 | + singleWaitTimeout.value = setTimeout(() => { | |
| 303 | + move() | |
| 304 | + }, singleWaitTime) | |
| 305 | + } | |
| 306 | + else { | |
| 307 | + move() | |
| 308 | + } | |
| 309 | + } | |
| 310 | + else if (realSingleStopWidth.value) { | |
| 311 | + if (Math.abs(xPos.value) % realSingleStopWidth.value < _step) { | |
| 312 | + singleWaitTimeout.value = setTimeout(() => { | |
| 313 | + move() | |
| 314 | + }, singleWaitTime) | |
| 315 | + } | |
| 316 | + else { | |
| 317 | + move() | |
| 318 | + } | |
| 319 | + } | |
| 320 | + else { | |
| 321 | + move() | |
| 322 | + } | |
| 323 | + }) | |
| 324 | + } | |
| 325 | + | |
| 326 | + function move() { | |
| 327 | + cancel() | |
| 328 | + if (isHover.value || !isScroll.value || _count.value === props.count) { | |
| 329 | + emit('stop', _count.value) | |
| 330 | + _count.value = 0 | |
| 331 | + return | |
| 332 | + } | |
| 333 | + animation( | |
| 334 | + props.direction as 'up' | 'down' | 'left' | 'right', | |
| 335 | + step.value, | |
| 336 | + false, | |
| 337 | + ) | |
| 338 | + } | |
| 339 | + | |
| 340 | + const initMove = () => { | |
| 341 | + dataWarm(props.list) | |
| 342 | + if (isHorizontal.value) { | |
| 343 | + let slotListWidth = (slotListRef.value as HTMLDivElement).offsetWidth | |
| 344 | + slotListWidth = slotListWidth * 2 + 1 | |
| 345 | + realBoxWidth.value = slotListWidth | |
| 346 | + } | |
| 347 | + | |
| 348 | + if (isScroll.value) { | |
| 349 | + realBoxHeight.value = (realBoxRef.value as HTMLDivElement).offsetHeight | |
| 350 | + if (props.modelValue) | |
| 351 | + move() | |
| 352 | + } | |
| 353 | + else { | |
| 354 | + cancel() | |
| 355 | + yPos.value = xPos.value = 0 | |
| 356 | + } | |
| 357 | + } | |
| 358 | + | |
| 359 | + const startMove = () => { | |
| 360 | + isHover.value = false | |
| 361 | + move() | |
| 362 | + } | |
| 363 | + | |
| 364 | + const stopMove = () => { | |
| 365 | + isHover.value = true | |
| 366 | + if (singleWaitTimeout.value) | |
| 367 | + clearTimeout(singleWaitTimeout.value) | |
| 368 | + | |
| 369 | + cancel() | |
| 370 | + } | |
| 371 | + | |
| 372 | + const hoverStop = computed( | |
| 373 | + () => props.hover && props.modelValue && isScroll.value, | |
| 374 | + ) | |
| 375 | + | |
| 376 | + const throttleFunc = useThrottleFn((e: WheelEvent) => { | |
| 377 | + cancel() | |
| 378 | + const singleHeight = realSingleStopHeight.value | |
| 379 | + ? realSingleStopHeight.value | |
| 380 | + : 15 | |
| 381 | + if (e.deltaY < 0) | |
| 382 | + animation('down', singleHeight, true) | |
| 383 | + | |
| 384 | + if (e.deltaY > 0) | |
| 385 | + animation('up', singleHeight, true) | |
| 386 | + }, 30) | |
| 387 | + | |
| 388 | + const onWheel = (e: WheelEvent) => { | |
| 389 | + throttleFunc(e) | |
| 390 | + } | |
| 391 | + | |
| 392 | + const reset = () => { | |
| 393 | + cancel() | |
| 394 | + isHover.value = false | |
| 395 | + initMove() | |
| 396 | + } | |
| 397 | + | |
| 398 | + const Reset = () => { | |
| 399 | + reset() | |
| 400 | + } | |
| 401 | + | |
| 402 | + useExpose({ Reset }) | |
| 403 | + | |
| 404 | + watch( | |
| 405 | + () => props.list, | |
| 406 | + () => { | |
| 407 | + if (props.isWatch) { | |
| 408 | + nextTick(() => { | |
| 409 | + reset() | |
| 410 | + }) | |
| 411 | + } | |
| 412 | + }, | |
| 413 | + { | |
| 414 | + deep: true, | |
| 415 | + }, | |
| 416 | + ) | |
| 417 | + | |
| 418 | + watch( | |
| 419 | + () => props.modelValue, | |
| 420 | + (newValue) => { | |
| 421 | + if (newValue) | |
| 422 | + startMove() | |
| 423 | + | |
| 424 | + else | |
| 425 | + stopMove() | |
| 426 | + }, | |
| 427 | + ) | |
| 428 | + | |
| 429 | + watch( | |
| 430 | + () => props.count, | |
| 431 | + (newValue) => { | |
| 432 | + if (newValue !== 0) | |
| 433 | + startMove() | |
| 434 | + }, | |
| 435 | + ) | |
| 436 | + | |
| 437 | + onBeforeMount(() => { | |
| 438 | + cancel() | |
| 439 | + clearTimeout(singleWaitTimeout.value as unknown as number) | |
| 440 | + }) | |
| 441 | + | |
| 442 | + onMounted(() => { | |
| 443 | + if (isScroll.value) | |
| 444 | + initMove() | |
| 445 | + }) | |
| 446 | + | |
| 447 | + const { default: $default, html } = slots | |
| 448 | + const copyNum = new Array(props.copyNum).fill(null) | |
| 449 | + | |
| 450 | + const getHtml = () => { | |
| 451 | + return ( | |
| 452 | + <> | |
| 453 | + <div ref={slotListRef} style={floatStyle.value}> | |
| 454 | + {$default && $default()} | |
| 455 | + </div> | |
| 456 | + {isScroll.value | |
| 457 | + ? copyNum.map(() => { | |
| 458 | + if (html && typeof html === 'function') | |
| 459 | + return <div style={floatStyle.value}>{html()}</div> | |
| 460 | + | |
| 461 | + else | |
| 462 | + return <div style={floatStyle.value}>{$default && $default()}</div> | |
| 463 | + }) | |
| 464 | + : null} | |
| 465 | + </> | |
| 466 | + ) | |
| 467 | + } | |
| 468 | + | |
| 469 | + return () => ( | |
| 470 | + <div ref={scrollRef} class={attrs.class}> | |
| 471 | + {props.wheel && props.hover | |
| 472 | + ? ( | |
| 473 | + <div | |
| 474 | + ref={realBoxRef} | |
| 475 | + style={realBoxStyle.value} | |
| 476 | + onMouseenter={() => { | |
| 477 | + if (hoverStop.value) | |
| 478 | + stopMove() | |
| 479 | + }} | |
| 480 | + onMouseleave={() => { | |
| 481 | + if (hoverStop.value) | |
| 482 | + startMove() | |
| 483 | + }} | |
| 484 | + onWheel={(e) => { | |
| 485 | + if (hoverStop.value) | |
| 486 | + onWheel(e) | |
| 487 | + }} | |
| 488 | + > | |
| 489 | + {getHtml()} | |
| 490 | + </div> | |
| 491 | + ) | |
| 492 | + : ( | |
| 493 | + <div | |
| 494 | + ref={realBoxRef} | |
| 495 | + style={realBoxStyle.value} | |
| 496 | + onMouseenter={() => { | |
| 497 | + if (hoverStop.value) | |
| 498 | + stopMove() | |
| 499 | + }} | |
| 500 | + onMouseleave={() => { | |
| 501 | + if (hoverStop.value) | |
| 502 | + startMove() | |
| 503 | + }} | |
| 504 | + > | |
| 505 | + {getHtml()} | |
| 506 | + </div> | |
| 507 | + )} | |
| 508 | + </div> | |
| 509 | + ) | |
| 510 | + }, | |
| 511 | +}) | |
| 512 | + | |
| 513 | +export default ScrollList | |
| 514 | + | |
| 515 | +export { ScrollList } | ... | ... |
| ... | ... | @@ -8,7 +8,7 @@ import { ComponentEnum } from '@/components/Form/src/enum' |
| 8 | 8 | import { useContentDataStoreWithOut } from '@/store/modules/contentData' |
| 9 | 9 | import { DateFormatEnum } from '@/enums/timeEnum' |
| 10 | 10 | import type { BasicColumn } from '@/components/Table' |
| 11 | -import type { CodeTypeEnum, ContentDataFieldsEnum } from '@/enums/datasource' | |
| 11 | +import { AlarmStatusEnum, type CodeTypeEnum, type ContentDataFieldsEnum } from '@/enums/datasource' | |
| 12 | 12 | |
| 13 | 13 | const contentDataStore = useContentDataStoreWithOut() |
| 14 | 14 | |
| ... | ... | @@ -31,37 +31,12 @@ export interface TableRecordItemType { |
| 31 | 31 | [ContentDataFieldsEnum.CODE_TYPE]?: Nullable<CodeTypeEnum> |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -// 告警状态 | |
| 35 | -export const alarmStatus = [ | |
| 36 | - { | |
| 37 | - label: '清除未确认', | |
| 38 | - value: 'CLEARED_UNACK', | |
| 39 | - color: 'red', | |
| 40 | - }, | |
| 41 | - { | |
| 42 | - label: '激活未确认', | |
| 43 | - value: 'ACTIVE_UNACK', | |
| 44 | - color: 'orange', | |
| 45 | - }, | |
| 46 | - { | |
| 47 | - label: '清除已确认', | |
| 48 | - value: 'CLEARED_ACK', | |
| 49 | - color: 'cyan', | |
| 50 | - }, | |
| 51 | - { | |
| 52 | - label: '激活已确认', | |
| 53 | - value: 'ACTIVE_ACK', | |
| 54 | - color: 'green', | |
| 55 | - }, | |
| 56 | -] | |
| 57 | - | |
| 58 | -export interface alarmListInterface { | |
| 59 | - deviceName: string | |
| 60 | - deviceAlias: string | |
| 61 | - status: string | |
| 62 | - startTs: string | |
| 34 | +export const AlarmColorMap = { | |
| 35 | + [AlarmStatusEnum.CLEARED_UN_ACK]: 'red', | |
| 36 | + [AlarmStatusEnum.ACTIVE_UN_ACK]: 'orange', | |
| 37 | + [AlarmStatusEnum.CLEARED_ACK]: 'cyan', | |
| 38 | + [AlarmStatusEnum.ACTIVE_ACK]: 'green', | |
| 63 | 39 | } |
| 64 | - | |
| 65 | 40 | /** |
| 66 | 41 | * 告警列表相关枚举 |
| 67 | 42 | */ | ... | ... |
| 1 | 1 | <script setup lang="ts"> |
| 2 | 2 | import { computed, nextTick, onMounted, reactive, unref } from 'vue' |
| 3 | 3 | import { Divider, Tag } from 'ant-design-vue' |
| 4 | -import Vue3SeamlessScroll from 'vue3-seamless-scroll/package/Vue3SeamlessScroll' | |
| 5 | -import { useAlarmList } from './useAlarmList.hook' | |
| 6 | -import { type alarmListInterface, alarmStatus } from './form.config' | |
| 4 | +import { ScrollList } from './ScrollList' | |
| 7 | 5 | import { fetchAlarmList } from '@/api/alarm' |
| 6 | +import type { AlarmListItemType } from '@/api/alarm/model' | |
| 8 | 7 | import type { CreateComponentType } from '@/core/Library/types' |
| 9 | 8 | import { useContentDataStore } from '@/store/modules/contentData' |
| 10 | 9 | import { isLightboxMode } from '@/utils/env' |
| 10 | +import { AlarmStatusColorEnum, AlarmStatusEnum, AlarmStatusNameEnum } from '@/enums/datasource' | |
| 11 | 11 | import { formatToDateTime } from '@/utils/dateUtil' |
| 12 | 12 | |
| 13 | 13 | const props = defineProps<{ |
| ... | ... | @@ -20,10 +20,8 @@ const getCellBounds = computed( |
| 20 | 20 | |
| 21 | 21 | const contentDataStore = useContentDataStore() |
| 22 | 22 | |
| 23 | -const { byStatusFindLabel } = useAlarmList() | |
| 24 | - | |
| 25 | 23 | const initOptions = reactive<{ |
| 26 | - alarmList: alarmListInterface[] | |
| 24 | + alarmList: AlarmListItemType[] | |
| 27 | 25 | scroll: boolean |
| 28 | 26 | interval: number |
| 29 | 27 | polling: number |
| ... | ... | @@ -72,6 +70,7 @@ onMounted(async () => { |
| 72 | 70 | setInterval(initFetchAlarmList, initOptions.polling * 1000) |
| 73 | 71 | } |
| 74 | 72 | else { |
| 73 | + const statusList = Object.values(AlarmStatusEnum) | |
| 75 | 74 | Object.assign(initOptions, { |
| 76 | 75 | scroll: false, |
| 77 | 76 | interval: 0, |
| ... | ... | @@ -80,9 +79,7 @@ onMounted(async () => { |
| 80 | 79 | deviceName: `示例设备${index + 1}`, |
| 81 | 80 | deviceAlias: `示例设备${index + 1}`, |
| 82 | 81 | startTs: formatToDateTime(), |
| 83 | - status: alarmStatus.map(item => item.value)[ | |
| 84 | - Math.floor(Math.random() * alarmStatus.length) | |
| 85 | - ], | |
| 82 | + status: statusList[index % 4], | |
| 86 | 83 | })), |
| 87 | 84 | }) |
| 88 | 85 | } |
| ... | ... | @@ -91,26 +88,28 @@ onMounted(async () => { |
| 91 | 88 | |
| 92 | 89 | <template> |
| 93 | 90 | <div class="seamless-scroll w-full h-full flex justify-center items-center overflow-y-scroll"> |
| 94 | - <Vue3SeamlessScroll | |
| 95 | - v-model="initOptions.scroll" :single-wait-time="initOptions.interval" | |
| 96 | - :list="initOptions.alarmList" :limit-scroll-num="10" :is-rem-unit="true" :delay="10" :wheel="true" hover :style="{ | |
| 91 | + <ScrollList | |
| 92 | + v-model="initOptions.scroll" :single-wait-time="initOptions.interval" :list="initOptions.alarmList" | |
| 93 | + :limit-scroll-num="10" :is-rem-unit="true" :delay="10" :wheel="true" hover :style="{ | |
| 97 | 94 | width: `${getCellBounds.width}px`, |
| 98 | 95 | height: `${getCellBounds.height}px`, |
| 99 | 96 | }" |
| 100 | 97 | > |
| 101 | 98 | <div v-for="(item, index) in initOptions.alarmList" :key="index" class="flex flex-col items-start h-15 px-2"> |
| 102 | 99 | <p class="text-xs"> |
| 103 | - 设备:{{ item.deviceAlias || item.deviceName }} | |
| 100 | + <span>设备:</span> | |
| 101 | + <span class="ml-1">{{ item.deviceAlias || item.deviceName }}</span> | |
| 104 | 102 | </p> |
| 105 | - <div class="flex items-center justify-between -mt-2"> | |
| 106 | - <span class="text-xs">时间:{{ item.startTs }}</span> | |
| 107 | - <Tag class="ml-2 text-xs" :color="byStatusFindLabel(item.status, 'color')"> | |
| 108 | - {{ byStatusFindLabel(item.status, "") }} | |
| 103 | + <div class="flex items-center justify-between -mt-2 text-xs"> | |
| 104 | + <span>时间:</span> | |
| 105 | + <span class="ml-1">{{ item.startTs }}</span> | |
| 106 | + <Tag class="ml-2" :color="AlarmStatusColorEnum[item.status]"> | |
| 107 | + {{ AlarmStatusNameEnum[item.status] }} | |
| 109 | 108 | </Tag> |
| 110 | 109 | </div> |
| 111 | 110 | <Divider class="mt-2 divider" /> |
| 112 | 111 | </div> |
| 113 | - </Vue3SeamlessScroll> | |
| 112 | + </ScrollList> | |
| 114 | 113 | </div> |
| 115 | 114 | </template> |
| 116 | 115 | ... | ... |
src/core/Library/packages/Basic/AlarmList/useAlarmList.hook.ts
deleted
100644 → 0
| 1 | -import { alarmStatus } from './form.config' | |
| 2 | - | |
| 3 | -export const useAlarmList = () => { | |
| 4 | - // 映射label | |
| 5 | - const byStatusFindLabel = (status: string, color: string) => { | |
| 6 | - if (!color) return alarmStatus.find(item => item.value === status)?.label | |
| 7 | - return alarmStatus.find(item => item.value === status)?.color | |
| 8 | - } | |
| 9 | - return { | |
| 10 | - byStatusFindLabel, | |
| 11 | - } | |
| 12 | -} |
| ... | ... | @@ -7,7 +7,7 @@ import type { CommandSource } from '@/core/websocket/processor' |
| 7 | 7 | import type { SubscriptionUpdateMsg } from '@/core/websocket/type/message' |
| 8 | 8 | import type { NodeDataDataSourceJsonType } from '@/api/node/model' |
| 9 | 9 | |
| 10 | -const imageSrc = ref('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M19 2H5a3.009 3.009 0 0 0-3 3v8.86l3.88-3.88a3.075 3.075 0 0 1 4.24 0l2.871 2.887l.888-.888a3.008 3.008 0 0 1 4.242 0L22 15.86V5a3.009 3.009 0 0 0-3-3z" opacity=".5"%2F%3E%3Cpath fill="currentColor" d="M10.12 9.98a3.075 3.075 0 0 0-4.24 0L2 13.86V19a3.009 3.009 0 0 0 3 3h14a3 3 0 0 0 2.16-.92L10.12 9.98z"%2F%3E%3Cpath fill="currentColor" d="m22 15.858l-3.879-3.879a3.008 3.008 0 0 0-4.242 0l-.888.888l8.165 8.209c.542-.555.845-1.3.844-2.076v-3.142z" opacity=".25"%2F%3E%3C%2Fsvg%3E') | |
| 10 | +const imageSrc = ref('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="48" height="48" viewBox="0 0 48 48"%3E%3Cpath fill="%238CBCD6" d="M40 41H8c-2.2 0-4-1.8-4-4V11c0-2.2 1.8-4 4-4h32c2.2 0 4 1.8 4 4v26c0 2.2-1.8 4-4 4z"%2F%3E%3Ccircle cx="35" cy="16" r="3" fill="%23B3DDF5"%2F%3E%3Cpath fill="%239AC9E3" d="M20 16L9 32h22z"%2F%3E%3Cpath fill="%23B3DDF5" d="m31 22l-8 10h16z"%2F%3E%3Ccircle cx="38" cy="38" r="10" fill="%2343A047"%2F%3E%3Cg fill="%23fff"%3E%3Cpath d="M36 32h4v12h-4z"%2F%3E%3Cpath d="M32 36h12v4H32z"%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E') | |
| 11 | 11 | |
| 12 | 12 | const onReceiveDataSourceMessage = (commandSource: CommandSource, message: SubscriptionUpdateMsg) => { |
| 13 | 13 | const { data } = commandSource | ... | ... |
| ... | ... | @@ -10,7 +10,7 @@ import { useLatestMessageValue } from '@/core/Library/hook/useLatestMessageValue |
| 10 | 10 | import { useOnMessage } from '@/core/Library/hook/useOnMessage' |
| 11 | 11 | import type { SubscriptionUpdateMsg } from '@/core/websocket/type/message' |
| 12 | 12 | |
| 13 | -const imgSrc = ref('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M13.18 19c.17.72.46 1.39.85 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v6.18c-.5-.11-1-.18-1.5-.18c-.17 0-.33 0-.5.03V5H5v14h8.18m-1.97-3.17l-1.96-2.36L6.5 17h6.53c.11-1.46.7-2.78 1.61-3.81l-.68-.9l-2.75 3.54M19 13.5V12l-2.25 2.25L19 16.5V15a2.5 2.5 0 0 1 2.5 2.5c0 .4-.09.78-.26 1.12l1.09 1.09c.42-.63.67-1.39.67-2.21c0-2.21-1.79-4-4-4m0 6.5a2.5 2.5 0 0 1-2.5-2.5c0-.4.09-.78.26-1.12l-1.09-1.09c-.42.63-.67 1.39-.67 2.21c0 2.21 1.79 4 4 4V23l2.25-2.25L19 18.5V20Z"%2F%3E%3C%2Fsvg%3E') | |
| 13 | +const imgSrc = ref('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="48" height="48" viewBox="0 0 48 48"%3E%3Cpath fill="%238CBCD6" d="M31 41H8c-2.2 0-4-1.8-4-4V11c0-2.2 1.8-4 4-4h32c2.2 0 4 1.8 4 4v17c0 7.2-5.8 13-13 13z"%2F%3E%3Ccircle cx="35" cy="16" r="3" fill="%23B3DDF5"%2F%3E%3Cpath fill="%239AC9E3" d="M20 16L9 32h22z"%2F%3E%3Cpath fill="%23B3DDF5" d="m31 22l-8 10h16z"%2F%3E%3Cpath fill="%23E57373" d="m47.7 29.1l-2.8-2.8c-.4-.4-1.1-.4-1.6 0L42 27.6l4.4 4.4l1.3-1.3c.4-.4.4-1.1 0-1.6z"%2F%3E%3Cpath fill="%23FF9800" d="M27.467 42.167L39.77 29.865l4.384 4.384L31.85 46.55z"%2F%3E%3Cpath fill="%23B0BEC5" d="m46.4 32.038l-2.192 2.192l-4.383-4.384l2.192-2.191z"%2F%3E%3Cpath fill="%23FFC107" d="M27.5 42.2L26 48l5.8-1.5z"%2F%3E%3Cpath fill="%2337474F" d="m26.7 45l-.7 3l3-.7z"%2F%3E%3C%2Fsvg%3E') | |
| 14 | 14 | |
| 15 | 15 | const onReceiveActMessage = (commandSource: CommandSource, message: SubscriptionUpdateMsg) => { |
| 16 | 16 | const { node, data, type } = commandSource | ... | ... |
| ... | ... | @@ -8,6 +8,7 @@ import type { ConfigComponentProps } from '@/core/Library/types' |
| 8 | 8 | import { useMessage } from '@/hooks/web/useMessage' |
| 9 | 9 | import type { FlowMeterColorItemType, NodeDataDataSourceJsonType } from '@/api/node/model' |
| 10 | 10 | import { useSavePageContent } from '@/core/Library/hook/useSavePageContent' |
| 11 | +import { useContentDataStoreWithOut } from '@/store/modules/contentData' | |
| 11 | 12 | const props = defineProps<ConfigComponentProps>() |
| 12 | 13 | |
| 13 | 14 | const { createMessage } = useMessage() |
| ... | ... | @@ -24,12 +25,18 @@ const dataSourceFormRef = ref<Nullable<InstanceType<typeof DataSourceForm>>>(nul |
| 24 | 25 | |
| 25 | 26 | const { savePageContent } = useSavePageContent() |
| 26 | 27 | |
| 28 | +const contentDataStore = useContentDataStoreWithOut() | |
| 29 | + | |
| 27 | 30 | const handleSubmit = async () => { |
| 28 | 31 | try { |
| 29 | 32 | loading.value = true |
| 30 | 33 | await unref(dataSourceFormRef)?.validate() |
| 31 | 34 | const formValues = unref(dataSourceFormRef)?.getFieldsValue() |
| 32 | - saveNodeAllData({ dataSourceJson: { ...formValues, circularFlowMeterOption: unref(colorConfig) } }) | |
| 35 | + let dataSourceJson = formValues | |
| 36 | + if (contentDataStore.getIsTemplate) | |
| 37 | + dataSourceJson = { ...formValues, deviceProfileId: formValues?.deviceProfileTemplateId, deviceId: null } | |
| 38 | + | |
| 39 | + saveNodeAllData({ dataSourceJson: { ...dataSourceJson, circularFlowMeterOption: unref(colorConfig) } }) | |
| 33 | 40 | createMessage.success('保存成功~') |
| 34 | 41 | savePageContent() |
| 35 | 42 | } | ... | ... |
| ... | ... | @@ -50,24 +50,24 @@ export const setOption = (value: number = 40, circularFlowMeterOption: FlowMeter |
| 50 | 50 | borderDistance: 1, |
| 51 | 51 | itemStyle: { |
| 52 | 52 | borderWidth: 0, |
| 53 | - color: { | |
| 54 | - type: 'linear', | |
| 55 | - x: 0, | |
| 56 | - y: 0, | |
| 57 | - x2: 1, | |
| 58 | - y2: 0, | |
| 59 | - colorStops: [ | |
| 60 | - { | |
| 61 | - offset: 0, | |
| 62 | - color: '#0b2355', // 这里设置水球外边框 0% 处的颜色 | |
| 63 | - }, | |
| 64 | - { | |
| 65 | - offset: 1, | |
| 66 | - color: '#195b9d', // 这里设置水球外边框 100% 处的颜色 | |
| 67 | - }, | |
| 68 | - ], | |
| 69 | - global: false, | |
| 70 | - }, | |
| 53 | + // color: { | |
| 54 | + // type: 'linear', | |
| 55 | + // x: 0, | |
| 56 | + // y: 0, | |
| 57 | + // x2: 1, | |
| 58 | + // y2: 0, | |
| 59 | + // colorStops: [ | |
| 60 | + // { | |
| 61 | + // offset: 0, | |
| 62 | + // color: '#0b2355', // 这里设置水球外边框 0% 处的颜色 | |
| 63 | + // }, | |
| 64 | + // { | |
| 65 | + // offset: 1, | |
| 66 | + // color: '#195b9d', // 这里设置水球外边框 100% 处的颜色 | |
| 67 | + // }, | |
| 68 | + // ], | |
| 69 | + // global: false, | |
| 70 | + // }, | |
| 71 | 71 | }, |
| 72 | 72 | }, |
| 73 | 73 | }, | ... | ... |
| ... | ... | @@ -34,9 +34,14 @@ function initChartInstance() { |
| 34 | 34 | const { onMessage } = useOnMessage({ |
| 35 | 35 | onReceiveDataSourceMessage(commandSource, message) { |
| 36 | 36 | const { data } = commandSource |
| 37 | + const { deviceInfo, attrInfo } = data || {} | |
| 38 | + const { deviceName } = deviceInfo || {} | |
| 37 | 39 | const { attr } = data as NodeDataDataSourceJsonType |
| 38 | 40 | const { latestValue } = useLatestMessageValue(message.data, attr) |
| 39 | 41 | unref(chartInstance)?.setOption({ |
| 42 | + title: { | |
| 43 | + text: `${deviceName || ''}-${attrInfo.name || ''}`, | |
| 44 | + }, | |
| 40 | 45 | series: [{ |
| 41 | 46 | data: getSetValue(Number(latestValue)), |
| 42 | 47 | }], | ... | ... |
| ... | ... | @@ -12,6 +12,7 @@ import type { ConfigComponentProps } from '@/core/Library/types' |
| 12 | 12 | import { useNodeData } from '@/core/Library/hook/useNodeData' |
| 13 | 13 | import { useMessage } from '@/hooks/web/useMessage' |
| 14 | 14 | import { useSavePageContent } from '@/core/Library/hook/useSavePageContent' |
| 15 | +import { useContentDataStoreWithOut } from '@/store/modules/contentData' | |
| 15 | 16 | |
| 16 | 17 | const props = defineProps<ConfigComponentProps>() |
| 17 | 18 | const loading = ref(false) |
| ... | ... | @@ -32,6 +33,7 @@ const [register, { getFieldsValue, setFieldsValue, validate }] = useForm({ |
| 32 | 33 | const { createMessage } = useMessage() |
| 33 | 34 | |
| 34 | 35 | const { savePageContent } = useSavePageContent() |
| 36 | +const contentDataStore = useContentDataStoreWithOut() | |
| 35 | 37 | |
| 36 | 38 | const handleSubmit = async () => { |
| 37 | 39 | try { |
| ... | ... | @@ -40,7 +42,11 @@ const handleSubmit = async () => { |
| 40 | 42 | await validate() |
| 41 | 43 | const value = unref(dataSourceElRef)?.getFieldsValue() |
| 42 | 44 | const values = getFieldsValue() |
| 43 | - await saveNodeAllData({ dataSourceJson: { ...value, chartOption: { ...values } } }) | |
| 45 | + let dataSourceJson = value | |
| 46 | + if (contentDataStore.getIsTemplate) | |
| 47 | + dataSourceJson = { ...value, deviceProfileId: value?.deviceProfileTemplateId, deviceId: null } | |
| 48 | + | |
| 49 | + await saveNodeAllData({ dataSourceJson: { ...dataSourceJson, chartOption: { ...values } } }) | |
| 44 | 50 | savePageContent() |
| 45 | 51 | createMessage.success('操作成功~') |
| 46 | 52 | } |
| ... | ... | @@ -51,9 +57,9 @@ const handleSubmit = async () => { |
| 51 | 57 | |
| 52 | 58 | const handleSetFormValues = async () => { |
| 53 | 59 | const { dataSourceJson } = unref(getNodeData) || {} |
| 54 | - const { deviceId, attr, chartOption, deviceProfileId, deviceProfileTemplateId, attrInfo } = dataSourceJson || {} | |
| 60 | + const { deviceId, attr, chartOption, deviceProfileId, deviceProfileTemplateId, attrInfo, deviceInfo } = dataSourceJson || {} | |
| 55 | 61 | await nextTick() |
| 56 | - unref(dataSourceElRef)?.setFieldsValue({ deviceId, attr, deviceProfileId, attrInfo, deviceProfileTemplateId }) | |
| 62 | + unref(dataSourceElRef)?.setFieldsValue({ deviceId, attr, deviceProfileId, attrInfo, deviceProfileTemplateId, deviceInfo }) | |
| 57 | 63 | setFieldsValue({ ...chartOption }) |
| 58 | 64 | } |
| 59 | 65 | ... | ... |
| ... | ... | @@ -55,9 +55,9 @@ const handleSubmit = async () => { |
| 55 | 55 | |
| 56 | 56 | const handleSetFormValues = async () => { |
| 57 | 57 | const { dataSourceJson } = unref(getNodeData) || {} |
| 58 | - const { deviceId, attr, chartOption, deviceProfileId, attrInfo, deviceProfileTemplateId } = dataSourceJson || {} | |
| 58 | + const { deviceId, attr, chartOption, deviceProfileId, attrInfo, deviceProfileTemplateId, deviceInfo } = dataSourceJson || {} | |
| 59 | 59 | await nextTick() |
| 60 | - unref(dataSourceElRef)?.setFieldsValue({ deviceId, attr, deviceProfileId, attrInfo, deviceProfileTemplateId }) | |
| 60 | + unref(dataSourceElRef)?.setFieldsValue({ deviceId, attr, deviceProfileId, attrInfo, deviceInfo, deviceProfileTemplateId }) | |
| 61 | 61 | setFieldsValue({ ...chartOption }) |
| 62 | 62 | } |
| 63 | 63 | ... | ... |
| ... | ... | @@ -36,9 +36,19 @@ onMounted(() => { |
| 36 | 36 | |
| 37 | 37 | const onReceiveDataSourceMessage = (commandSource: CommandSource, message: SubscriptionUpdateMsg) => { |
| 38 | 38 | const { data } = commandSource |
| 39 | + const { deviceInfo, attrInfo } = data || {} | |
| 40 | + const { deviceName } = deviceInfo || {} | |
| 39 | 41 | const { attr } = data as NodeDataDataSourceJsonType |
| 40 | 42 | const { latestValue } = useLatestMessageValue(message.data, attr) |
| 41 | - unref(chartInstance)?.setOption({ series: [{ data: [{ value: latestValue }] }] } as EChartsOption) | |
| 43 | + unref(chartInstance)?.setOption({ | |
| 44 | + series: [{ | |
| 45 | + data: [{ value: latestValue }], | |
| 46 | + | |
| 47 | + }], | |
| 48 | + title: { | |
| 49 | + text: `${deviceName || ''}-${attrInfo.name || ''}`, | |
| 50 | + }, | |
| 51 | + } as EChartsOption) | |
| 42 | 52 | } |
| 43 | 53 | |
| 44 | 54 | const { onMessage } = useOnMessage({ onReceiveDataSourceMessage }) | ... | ... |
| ... | ... | @@ -12,6 +12,7 @@ import type { ConfigComponentProps } from '@/core/Library/types' |
| 12 | 12 | import { createPublicFormContext } from '@/core/Library/components/PublicForm/usePublicFormContext' |
| 13 | 13 | import { useMessage } from '@/hooks/web/useMessage' |
| 14 | 14 | import { useSavePageContent } from '@/core/Library/hook/useSavePageContent' |
| 15 | +import { useContentDataStoreWithOut } from '@/store/modules/contentData' | |
| 15 | 16 | |
| 16 | 17 | const props = defineProps<ConfigComponentProps>() |
| 17 | 18 | |
| ... | ... | @@ -32,14 +33,16 @@ const dataSourceElRef = ref<Nullable<InstanceType<typeof DataSourceForm>>>() |
| 32 | 33 | |
| 33 | 34 | const handleSetFormValues = async () => { |
| 34 | 35 | const { dataSourceJson } = unref(getNodeData) || {} |
| 35 | - const { deviceId, attr, chartOption, deviceProfileId, deviceProfileTemplateId, attrInfo } = dataSourceJson || {} | |
| 36 | + const { deviceId, attr, chartOption, deviceProfileId, deviceProfileTemplateId, attrInfo, deviceInfo } = dataSourceJson || {} | |
| 36 | 37 | await nextTick() |
| 37 | - unref(dataSourceElRef)?.setFieldsValue({ deviceId, attr, deviceProfileId, deviceProfileTemplateId, attrInfo }) | |
| 38 | + unref(dataSourceElRef)?.setFieldsValue({ deviceId, attr, deviceProfileId, deviceProfileTemplateId, attrInfo, deviceInfo }) | |
| 38 | 39 | setFieldsValue({ ...chartOption }) |
| 39 | 40 | } |
| 40 | 41 | |
| 41 | 42 | const { createMessage } = useMessage() |
| 42 | 43 | const { savePageContent } = useSavePageContent() |
| 44 | +const contentDataStore = useContentDataStoreWithOut() | |
| 45 | + | |
| 43 | 46 | const handleSubmit = async () => { |
| 44 | 47 | try { |
| 45 | 48 | loading.value = true |
| ... | ... | @@ -47,7 +50,11 @@ const handleSubmit = async () => { |
| 47 | 50 | await validate() |
| 48 | 51 | const value = unref(dataSourceElRef)?.getFieldsValue() |
| 49 | 52 | const values = getFieldsValue() |
| 50 | - saveNodeAllData({ dataSourceJson: { ...value, chartOption: { ...values } } }) | |
| 53 | + let dataSourceJson = value | |
| 54 | + if (contentDataStore.getIsTemplate) | |
| 55 | + dataSourceJson = { ...value, deviceProfileId: value?.deviceProfileTemplateId, deviceId: null } | |
| 56 | + | |
| 57 | + saveNodeAllData({ dataSourceJson: { ...dataSourceJson, chartOption: { ...values } } }) | |
| 51 | 58 | createMessage.success('操作成功~') |
| 52 | 59 | savePageContent() |
| 53 | 60 | } | ... | ... |
| ... | ... | @@ -8,6 +8,7 @@ import type { ConfigComponentProps } from '@/core/Library/types' |
| 8 | 8 | import { useMessage } from '@/hooks/web/useMessage' |
| 9 | 9 | import type { FlowMeterColorItemType } from '@/api/node/model' |
| 10 | 10 | import { useSavePageContent } from '@/core/Library/hook/useSavePageContent' |
| 11 | +import { useContentDataStoreWithOut } from '@/store/modules/contentData' | |
| 11 | 12 | |
| 12 | 13 | const props = defineProps<ConfigComponentProps>() |
| 13 | 14 | |
| ... | ... | @@ -24,13 +25,18 @@ const { getNodeAllData, saveNodeAllData, getNodeData } = nodeDataActinType |
| 24 | 25 | const dataSourceFormRef = ref<Nullable<InstanceType<typeof DataSourceForm>>>(null) |
| 25 | 26 | |
| 26 | 27 | const { savePageContent } = useSavePageContent() |
| 28 | +const contentDataStore = useContentDataStoreWithOut() | |
| 27 | 29 | |
| 28 | 30 | const handleSubmit = async () => { |
| 29 | 31 | try { |
| 30 | 32 | loading.value = true |
| 31 | 33 | await unref(dataSourceFormRef)?.validate() |
| 32 | 34 | const formValues = unref(dataSourceFormRef)?.getFieldsValue() |
| 33 | - await saveNodeAllData({ dataSourceJson: { ...formValues, rectFlowMeterOption: unref(colorConfig) } }) | |
| 35 | + let dataSourceJson = formValues | |
| 36 | + if (contentDataStore.getIsTemplate) | |
| 37 | + dataSourceJson = { ...formValues, deviceProfileId: formValues?.deviceProfileTemplateId, deviceId: null } | |
| 38 | + | |
| 39 | + await saveNodeAllData({ dataSourceJson: { ...dataSourceJson, rectFlowMeterOption: unref(colorConfig) } }) | |
| 34 | 40 | createMessage.success('保存成功') |
| 35 | 41 | savePageContent() |
| 36 | 42 | } | ... | ... |
| ... | ... | @@ -51,24 +51,6 @@ export const setOption = (value: number = 40, circularFlowMeterOption: FlowMeter |
| 51 | 51 | borderDistance: 1, |
| 52 | 52 | itemStyle: { |
| 53 | 53 | borderWidth: 0, |
| 54 | - color: { | |
| 55 | - type: 'linear', | |
| 56 | - x: 0, | |
| 57 | - y: 0, | |
| 58 | - x2: 1, | |
| 59 | - y2: 0, | |
| 60 | - colorStops: [ | |
| 61 | - { | |
| 62 | - offset: 0, | |
| 63 | - color: '#0b2355', // 这里设置水球外边框 0% 处的颜色 | |
| 64 | - }, | |
| 65 | - { | |
| 66 | - offset: 1, | |
| 67 | - color: '#195b9d', // 这里设置水球外边框 100% 处的颜色 | |
| 68 | - }, | |
| 69 | - ], | |
| 70 | - global: false, | |
| 71 | - }, | |
| 72 | 54 | }, |
| 73 | 55 | }, |
| 74 | 56 | }, | ... | ... |
| ... | ... | @@ -34,9 +34,14 @@ function initChartInstance() { |
| 34 | 34 | const { onMessage } = useOnMessage({ |
| 35 | 35 | onReceiveDataSourceMessage(commandSource, message) { |
| 36 | 36 | const { data } = commandSource |
| 37 | + const { deviceInfo, attrInfo } = data || {} | |
| 38 | + const { deviceName } = deviceInfo || {} | |
| 37 | 39 | const { attr } = data as NodeDataDataSourceJsonType |
| 38 | 40 | const { latestValue } = useLatestMessageValue(message.data, attr) |
| 39 | 41 | unref(chartInstance)?.setOption({ |
| 42 | + title: { | |
| 43 | + text: `${deviceName || ''}-${attrInfo.name || ''}`, | |
| 44 | + }, | |
| 40 | 45 | series: [{ |
| 41 | 46 | data: getSetValue(Number(latestValue)), |
| 42 | 47 | }], | ... | ... |
| 1 | 1 | import { cloneDeep } from 'lodash-es' |
| 2 | 2 | import { ThermometerConfig } from '.' |
| 3 | 3 | import { ModeEnum } from '@/enums/modeEnum' |
| 4 | -import type { CreateComponentParamsType, CreateComponentType } from '@/core/Library/types' | |
| 5 | - | |
| 6 | -export const options = { | |
| 7 | - | |
| 4 | +import type { ConfigPresetOptionsType, CreateComponentParamsType, CreateComponentType } from '@/core/Library/types' | |
| 5 | + | |
| 6 | +export const options: ConfigPresetOptionsType = { | |
| 7 | + publicFormSetting: { | |
| 8 | + dataSourceSetting: true, | |
| 9 | + eventSetting: false, | |
| 10 | + actSetting: false, | |
| 11 | + }, | |
| 8 | 12 | } |
| 9 | - | |
| 10 | 13 | export default class Config implements CreateComponentType { |
| 11 | 14 | public key: string = ThermometerConfig.key |
| 12 | 15 | ... | ... |
| 1 | 1 | <script setup lang="ts"> |
| 2 | -import { Button, Divider } from 'ant-design-vue' | |
| 3 | -import { onMounted, ref, unref } from 'vue' | |
| 4 | -import { DataSourceForm } from '@/core/Library/components/PublicForm/components/DataSourceForm' | |
| 5 | -import { useNodeData } from '@/core/Library/hook/useNodeData' | |
| 6 | -import { useMessage } from '@/hooks/web/useMessage' | |
| 7 | 2 | import type { ConfigComponentProps } from '@/core/Library/types' |
| 8 | -import { useSavePageContent } from '@/core/Library/hook/useSavePageContent' | |
| 3 | +import { PublicForm } from '@/core/Library/components/PublicForm' | |
| 9 | 4 | |
| 10 | 5 | const props = defineProps<ConfigComponentProps>() |
| 11 | - | |
| 12 | -const { createMessage } = useMessage() | |
| 13 | - | |
| 14 | -const loading = ref(false) | |
| 15 | - | |
| 16 | -const dataSourceFormRef = ref<Nullable<InstanceType<typeof DataSourceForm>>>(null) | |
| 17 | - | |
| 18 | -const nodeDataActinType = useNodeData({ cell: props.cell!, immediate: false }) | |
| 19 | - | |
| 20 | -const { getNodeAllData, saveNodeAllData, getNodeData } = nodeDataActinType | |
| 21 | - | |
| 22 | -const { savePageContent } = useSavePageContent() | |
| 23 | - | |
| 24 | -const handleSubmit = async () => { | |
| 25 | - try { | |
| 26 | - loading.value = true | |
| 27 | - await unref(dataSourceFormRef)?.validate() | |
| 28 | - const formValues = unref(dataSourceFormRef)?.getFieldsValue() | |
| 29 | - await saveNodeAllData({ dataSourceJson: { ...formValues } }) | |
| 30 | - createMessage.success('保存成功~') | |
| 31 | - savePageContent() | |
| 32 | - } | |
| 33 | - finally { | |
| 34 | - loading.value = false | |
| 35 | - } | |
| 36 | -} | |
| 37 | - | |
| 38 | -onMounted(async () => { | |
| 39 | - await getNodeAllData() | |
| 40 | - const { dataSourceJson } = unref(getNodeData) || {} | |
| 41 | - if (dataSourceJson) | |
| 42 | - dataSourceFormRef.value?.setFieldsValue(dataSourceJson) | |
| 43 | -}) | |
| 44 | 6 | </script> |
| 45 | 7 | |
| 46 | 8 | <template> |
| 47 | - <main class="w-full h-full flex flex-col px-2 py-4 box-border"> | |
| 48 | - <main class="form-container"> | |
| 49 | - <Divider orientation="left"> | |
| 50 | - 数据源 | |
| 51 | - </Divider> | |
| 52 | - <DataSourceForm ref="dataSourceFormRef" /> | |
| 53 | - </main> | |
| 54 | - <Button class="mt-3" type="primary" :loading="loading" @click="handleSubmit"> | |
| 55 | - 保存 | |
| 56 | - </Button> | |
| 9 | + <main class="w-full flex flex-col"> | |
| 10 | + <PublicForm v-bind="props" /> | |
| 57 | 11 | </main> |
| 58 | 12 | </template> | ... | ... |
| ... | ... | @@ -26,9 +26,16 @@ function initChartInstance() { |
| 26 | 26 | const { onMessage } = useOnMessage({ |
| 27 | 27 | onReceiveDataSourceMessage(commandSource, message) { |
| 28 | 28 | const { data } = commandSource |
| 29 | + const { deviceInfo, attrInfo } = data || {} | |
| 30 | + const { deviceName } = deviceInfo || {} | |
| 29 | 31 | const { attr } = data as NodeDataDataSourceJsonType |
| 30 | 32 | const { latestValue } = useLatestMessageValue(message.data, attr) |
| 31 | - unref(chartInstance)?.setOption({ series: [{ data: [{ value: getShowValue(Number(latestValue)) }] }] } as EChartsOption) | |
| 33 | + unref(chartInstance)?.setOption({ | |
| 34 | + title: { | |
| 35 | + text: `${deviceName || ''}-${attrInfo.name || ''}`, | |
| 36 | + }, | |
| 37 | + series: [{ data: [{ value: getShowValue(Number(latestValue)) }] }], | |
| 38 | + } as EChartsOption) | |
| 32 | 39 | }, |
| 33 | 40 | }) |
| 34 | 41 | ... | ... |
| ... | ... | @@ -335,3 +335,25 @@ export enum SocketSubscriberEnum { |
| 335 | 335 | TS_SUB_CMDS = 'tsSubCmds', |
| 336 | 336 | HISTORY_CMDS = 'historyCmds', |
| 337 | 337 | } |
| 338 | + | |
| 339 | +export enum AlarmStatusEnum { | |
| 340 | + CLEARED_UN_ACK = 'CLEARED_UNACK', | |
| 341 | + ACTIVE_UN_ACK = 'ACTIVE_UNACK', | |
| 342 | + CLEARED_ACK = 'CLEARED_ACK', | |
| 343 | + ACTIVE_ACK = 'ACTIVE_ACK', | |
| 344 | +} | |
| 345 | + | |
| 346 | +export enum AlarmStatusColorEnum { | |
| 347 | + CLEARED_UNACK = 'red', | |
| 348 | + ACTIVE_UNACK = 'orange', | |
| 349 | + CLEARED_ACK = 'cyan', | |
| 350 | + ACTIVE_ACK = 'green', | |
| 351 | +} | |
| 352 | + | |
| 353 | +export enum AlarmStatusNameEnum { | |
| 354 | + CLEARED_UNACK = '清除未确认', | |
| 355 | + ACTIVE_UNACK = '激活未确认', | |
| 356 | + CLEARED_ACK = '清除已确认', | |
| 357 | + ACTIVE_ACK = '激活已确认', | |
| 358 | +} | |
| 359 | + | ... | ... |
| ... | ... | @@ -18,6 +18,39 @@ export type MxState = mxgraph.mxCellState |
| 18 | 18 | |
| 19 | 19 | export type MxEditor = mxgraph.mxEditor |
| 20 | 20 | |
| 21 | +export enum EnableEnum { | |
| 22 | + ENABLE = 1, | |
| 23 | + CLOSE = 0, | |
| 24 | +} | |
| 25 | + | |
| 26 | +export enum GradientDirectionEnum { | |
| 27 | + WEST = 'west', | |
| 28 | + NORTH = 'north', | |
| 29 | + EAST = 'east', | |
| 30 | + SOUTH = 'south', | |
| 31 | + RADIAL = 'radial', | |
| 32 | +} | |
| 33 | + | |
| 34 | +export interface MxShapeStyleType { | |
| 35 | + align: 'center' | |
| 36 | + dashed: EnableEnum | |
| 37 | + fillColor: string | |
| 38 | + fontColor: string | |
| 39 | + fontFamily: string | |
| 40 | + fontSize: number | |
| 41 | + gradientColor: string | |
| 42 | + gradientDirection: GradientDirectionEnum | |
| 43 | + opacity: number | |
| 44 | + shadow: EnableEnum | |
| 45 | + strokeColor: string | |
| 46 | + // fillStyle: | |
| 47 | + /** | |
| 48 | + * @description 草图模式 | |
| 49 | + */ | |
| 50 | + sketch: EnableEnum | |
| 51 | + strokeWidth: number | |
| 52 | +} | |
| 53 | + | |
| 21 | 54 | interface Entries { |
| 22 | 55 | title: string |
| 23 | 56 | key?: string | ... | ... |