Showing
1 changed file
with
770 additions
and
986 deletions
Too many changes to show.
To preserve performance only 1 of 2 files are displayed.
... | ... | @@ -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 | ... | ... |