How to use drawLine method in stryker-parent

Best JavaScript code snippet using stryker-parent

ivr-connection.js

Source:ivr-connection.js Github

copy

Full Screen

...69 switch (connectionType) {70 case 11:71 zone = "NN ---> Z8";72 line.clear();73 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);74 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);75 line.drawLine(endx, minTopDistance - 15, endx, endy);76 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));77 line.paint();78 break;79 case 12:80 zone = "NE ---> Z8";81 line.clear();82 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);83 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);84 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));85 line.paint();86 break;87 case 13:88 zone = "NS ---> Z8";89 line.clear();90 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));91 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));92 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);93 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));94 line.paint();95 break;96 case 14:97 zone = "NW ---> Z8";98 line.clear();99 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));100 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));101 line.drawLine(targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, endy);102 line.drawLine(targetNodeX - 10, endy, endx, endy);103 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));104 line.paint();105 break;106 case 21:107 zone = "EN ---> Z8";108 line.clear();109 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);110 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);111 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);112 line.drawLine(endx, minTopDistance - 10, endx, endy);113 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));114 line.paint();115 break;116 case 22:117 zone = "EE ---> Z8";118 line.clear();119 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);120 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);121 line.drawLine(maxRightDistance + 10, endy, endx, endy);122 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));123 line.paint();124 break;125 case 23:126 zone = "ES ---> Z8";127 line.clear();128 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);129 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));130 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));131 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);132 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));133 line.paint();134 break;135 case 24:136 zone = "EW ---> Z8";137 line.clear();138 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);139 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));140 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));141 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);142 line.drawLine(targetNodeX - 10, endy, endx, endy);143 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));144 line.paint();145 break;146 case 31:147 zone = "SN ---> Z8";148 line.clear();149 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);150 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);151 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10);152 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10, endx, endy - 10);153 line.drawLine(endx, endy - 10, endx, endy);154 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));155 line.paint();156157 break;158 case 32:159 zone = "SE ---> Z8";160 line.clear();161 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);162 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);163 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);164 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);165 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));166 line.paint();167 break;168 case 33:169 zone = "SS ---> Z8";170 line.clear();171 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);172 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);173 line.drawLine(endx, maxBottomDistance + 10, endx, endy);174 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));175 line.paint();176 break;177 case 34:178 zone = "SW ---> Z8";179 line.clear();180 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);181 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);182 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);183 line.drawLine(minLeftDistance - 10, endy, endx, endy);184 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));185 line.paint();186 break;187 case 41:188 zone = "WN ---> Z8";189 line.clear();190 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);191 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10);192 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);193 line.drawLine(endx, targetNodeY - 10, endx, endy);194 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));195 line.paint();196 break;197 case 42:198 zone = "WE ---> Z8";199 line.clear();200 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);201 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);202 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);203 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));204 line.paint();205 break;206 case 43:207 zone = "WS ---> Z8";208 line.clear();209 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);210 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);211 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));212 line.paint();213 break;214 case 44:215 zone = "WW ---> Z8";216 line.clear();217 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);218 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);219 line.drawLine(minLeftDistance - 10, endy, endx, endy);220 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));221 line.paint();222 break;223224 }225226 } else {227 zone = "Z1A";228 switch (connectionType) {229 case 11:230 zone = "NN ---> Z1A";231 line.clear();232 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);233 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);234 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, endy - 10);235 line.drawLine(minLeftDistance - 10, endy - 10, endx, endy - 10);236 line.drawLine(endx, endy - 10, endx, endy);237 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));238 line.paint();239 break;240 case 12:241 zone = "NE ---> Z1A";242 line.clear();243 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);244 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);245 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));246 line.paint();247 break;248 case 13:249 zone = "NS ---> Z1A";250 line.clear();251 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));252 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));253 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);254 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));255 line.paint();256 break;257 case 14:258 zone = "NW ---> Z1A";259 line.clear();260 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));261 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));262 line.drawLine(targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, endy);263 line.drawLine(targetNodeX - 10, endy, endx, endy);264 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));265 line.paint();266 break;267 case 21:268 zone = "EN ---> Z1A";269 line.clear();270 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);271 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);272 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);273 line.drawLine(endx, minTopDistance - 10, endx, endy);274 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));275 line.paint();276 break;277 case 22:278 zone = "EE ---> Z1A";279 line.clear();280 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);281 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);282 line.drawLine(maxRightDistance + 10, endy, endx, endy);283 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));284 line.paint();285 break;286 case 23:287 zone = "ES ---> Z1A";288 line.clear();289 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);290 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));291 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));292 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);293 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));294 line.paint();295 break;296 case 24:297 zone = "EW ---> Z1A";298 line.clear();299 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);300 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));301 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));302 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);303 line.drawLine(targetNodeX - 10, endy, endx, endy);304 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));305 line.paint();306 break;307 case 31:308 zone = "SN ---> Z1A";309 line.clear();310 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);311 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, minLeftDistance - 10, sourceNodeY + sourceNodeHeight + 10);312 line.drawLine(minLeftDistance - 10, sourceNodeY + sourceNodeHeight + 10, minLeftDistance - 10, minTopDistance - 10);313 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);314 line.drawLine(endx, minTopDistance - 10, endx, endy);315 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));316 line.paint();317 break;318 case 32:319 zone = "SE ---> Z1A";320 line.clear();321 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);322 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);323 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);324 line.drawLine(maxRightDistance + 10, endy, endx, endy);325 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));326 line.paint();327 break;328 case 33:329 zone = "SS ---> Z1A";330 line.clear();331 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);332 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10);333 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10, sourceNodeX - 10, targetNodeY + targetNodeHeight + 10);334 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);335 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);336 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));337 line.paint();338 break;339 case 34:340 zone = "SW ---> Z1A";341 line.clear();342 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);343 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);344 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);345 line.drawLine(minLeftDistance - 10, endy, endx, endy);346 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));347 line.paint();348 break;349 case 41:350 zone = "WN ---> Z1A";351 line.clear();352 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);353 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);354 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);355 line.drawLine(endx, minTopDistance - 10, endx, endy);356 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));357 line.paint();358 break;359 case 42:360 zone = "WE ---> Z1A";361 line.clear();362 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);363 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));364 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));365 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, endy);366 line.drawLine(endx + 10, endy, endx, endy);367 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));368 line.paint();369 break;370 case 43:371 zone = "WS ---> Z1A";372 line.clear();373 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);374 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));375 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));376 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);377 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));378 line.paint();379 break;380 case 44:381 zone = "WW ---> Z1A";382 line.clear();383 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);384 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);385 line.drawLine(minLeftDistance - 10, endy, endx, endy);386 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));387 line.paint();388 break;389 }390391 }392 }393394 } else {395 if (endx <= sourceNodeX - 10) {396 zone = "Z7B";397 switch (connectionType) {398 case 11:399 zone = "NN ---> Z7B";400 line.clear();401 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);402 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);403 line.drawLine(endx, minTopDistance - 15, endx, endy);404 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));405 line.paint();406 break;407 case 12:408 zone = "NE ---> Z7B";409 line.clear();410 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);411 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);412 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);413 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);414 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));415 line.paint();416 break;417 case 13:418 zone = "NS ---> Z7B";419 line.clear();420 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);421 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10);422 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);423 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);424 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);425 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));426 line.paint();427 break;428 case 14:429 zone = "NW ---> Z7B";430 line.clear();431 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, minTopDistance - 10);432 line.drawLine(sourceNodeX + halfSourceNodeWidth, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);433 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);434 line.drawLine(targetNodeX - 10, endy, endx, endy);435 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));436 line.paint();437 break;438 case 21:439 zone = "EN ---> Z7B";440 line.clear();441 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);442 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);443 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);444 line.drawLine(endx, minTopDistance - 10, endx, endy);445 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));446 line.paint();447 break;448 case 22:449 zone = "EE ---> Z7B";450 line.clear();451 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);452 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY - 10);453 line.drawLine(maxRightDistance + 10, sourceNodeY - 10, endx + 10, sourceNodeY - 10);454 line.drawLine(endx + 10, sourceNodeY - 10, endx + 10, endy);455 line.drawLine(endx + 10, endy, endx, endy);456 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));457 line.paint();458 break;459 case 23:460 zone = "ES ---> Z7B";461 line.clear();462 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);463 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);464 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);465 line.drawLine(endx, maxBottomDistance + 10, endx, endy);466 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));467 line.paint();468 break;469 case 24:470 zone = "EW ---> Z7B";471 line.clear();472 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);473 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, minTopDistance - 10);474 line.drawLine(sourceNodeX + sourceNodeWidth + 10, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);475 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);476 line.drawLine(targetNodeX - 10, endy, endx, endy);477 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));478 line.paint();479 break;480 case 31:481 zone = "SN ---> Z7B";482 line.clear();483 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);484 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);485 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10);486 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10, endx, endy - 10);487 line.drawLine(endx, endy - 10, endx, endy);488 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));489 line.paint();490 break;491 case 32:492 zone = "SE ---> Z7B";493 line.clear();494 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);495 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);496 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);497 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);498 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));499 line.paint();500 break;501 case 33:502 zone = "SS ---> Z7B";503 line.clear();504 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);505 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);506 line.drawLine(endx, maxBottomDistance + 10, endx, endy);507 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));508 line.paint();509 break;510 case 34:511 zone = "SW ---> Z7B";512 line.clear();513 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);514 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);515 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);516 line.drawLine(minLeftDistance - 10, endy, endx, endy);517 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));518 line.paint();519 break;520 case 41:521 zone = "WN ---> Z7B";522 line.clear();523 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);524 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10);525 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);526 line.drawLine(endx, targetNodeY - 10, endx, endy);527 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));528 line.paint();529 break;530 case 42:531 zone = "WE ---> Z7B";532 line.clear();533 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);534 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);535 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);536 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));537 line.paint();538 break;539 case 43:540 zone = "WS ---> Z7B";541 line.clear();542 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);543 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);544 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));545 line.paint();546 break;547 case 44:548 zone = "WW ---> Z7B";549 line.clear();550 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);551 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10);552 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10, endx - 10, targetNodeY - 10);553 line.drawLine(endx - 10, targetNodeY - 10, endx - 10, endy);554 line.drawLine(endx - 10, endy, endx, endy);555 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));556 line.paint();557 break;558 }559560 } else {561 zone = "Z7B10";562 //line.clear();563 }564565 }566 } else // Bottom Left Corner567 {568 if (endy >= sourceNodeY + sourceNodeHeight) // z6, z5b569 {570 if ((endy <= sourceNodeY + sourceNodeHeight + 10) && (endx >= sourceNodeX)) {571 zone = "Z5B10";572 //line.clear();573 } else {574 if (endx <= sourceNodeX - 10) {575 zone = "Z6";576 switch (connectionType) {577 case 11:578 zone = "NN ---> Z6";579 line.clear();580 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);581 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);582 line.drawLine(endx, minTopDistance - 15, endx, endy);583 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));584 line.paint();585 break;586 case 12:587 zone = "NE ---> Z6";588 line.clear();589 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);590 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);591 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);592 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);593 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));594 line.paint();595 break;596 case 13:597 zone = "NS ---> Z6";598 line.clear();599 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);600 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10);601 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);602 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);603 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);604 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));605 line.paint();606607 break;608 case 14:609 zone = "NW ---> Z6";610 line.clear();611 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, minTopDistance - 10);612 line.drawLine(sourceNodeX + halfSourceNodeWidth, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);613 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);614 line.drawLine(targetNodeX - 10, endy, endx, endy);615 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));616 line.paint();617 break;618 case 21:619 zone = "EN ---> Z6";620 line.clear();621 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);622 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));623 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));624 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);625 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));626 line.paint();627 break;628 case 22:629 zone = "EE ---> Z6";630 line.clear();631 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);632 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);633 line.drawLine(maxRightDistance + 10, endy, endx, endy);634 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));635 line.paint();636 break;637 case 23:638 zone = "ES ---> Z6";639 line.clear();640 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);641 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);642 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);643 line.drawLine(endx, maxBottomDistance + 10, endx, endy);644 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));645 line.paint();646 break;647 case 24:648 zone = "EW ---> Z6";649 line.clear();650 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);651 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));652 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));653 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);654 line.drawLine(targetNodeX - 10, endy, endx, endy);655 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));656 line.paint();657 break;658 case 31:659 zone = "SN ---> Z6";660 line.clear();661 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));662 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));663 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);664 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));665 line.paint();666 break;667 case 32:668 zone = "SE ---> Z6";669 line.clear();670 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);671 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);672 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));673 line.paint();674 break;675 case 33:676 zone = "SS ---> Z6";677 line.clear();678 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);679 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);680 line.drawLine(endx, maxBottomDistance + 10, endx, endy);681 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));682 line.paint();683 break;684 case 34:685 zone = "SW ---> Z6";686 line.clear();687 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));688 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));689 line.drawLine(endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, endy);690 line.drawLine(endx - 10, endy, endx, endy);691 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));692 line.paint();693 break;694 case 41:695 zone = "WN ---> Z6";696 line.clear();697 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);698 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);699 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));700 line.paint();701 break;702 case 42:703 zone = "WE ---> Z6";704 line.clear();705 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);706 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);707 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);708 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));709 line.paint();710 break;711 case 43:712 zone = "WS ---> Z6";713 line.clear();714 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);715 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10);716 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10, endx, endy + 10);717 line.drawLine(endx, endy + 10, endx, endy);718 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));719 line.paint();720 break;721 case 44:722 zone = "WW ---> Z6";723 line.clear();724 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);725 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);726 line.drawLine(minLeftDistance - 10, endy, endx, endy);727 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));728 line.paint();729 break;730 }731732 } else {733 zone = "Z5B";734 switch (connectionType) {735 case 11:736 zone = "NN ---> Z5B";737 line.clear();738 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);739 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX - 10, sourceNodeY - 10);740 line.drawLine(sourceNodeX - 10, sourceNodeY - 10, sourceNodeX - 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));741 line.drawLine(sourceNodeX - 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));742 line.drawLine(endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);743 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));744 line.paint();745 break;746 case 12:747 zone = "NE ---> Z5B";748 line.clear();749 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);750 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, maxRightDistance + 10, minTopDistance - 10);751 line.drawLine(maxRightDistance + 10, minTopDistance - 10, maxRightDistance + 10, endy);752 line.drawLine(maxRightDistance + 10, endy, endx, endy);753 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));754 line.paint();755 break;756 case 13:757 zone = "NS ---> Z5B";758 line.clear();759 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);760 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);761 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, targetNodeY + targetNodeHeight + 10);762 line.drawLine(minLeftDistance - 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);763 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);764 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));765 line.paint();766 break;767 case 14:768 zone = "NW ---> Z5B";769 line.clear();770 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);771 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);772 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, endy);773 line.drawLine(minLeftDistance - 10, endy, endx, endy);774 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));775 line.paint();776 break;777 case 21:778 zone = "EN ---> Z5B";779 line.clear();780 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);781 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));782 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));783 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);784 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));785 line.paint();786 break;787 case 22:788 zone = "EE ---> Z5B";789 line.clear();790 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);791 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);792 line.drawLine(maxRightDistance + 10, endy, endx, endy);793 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));794 line.paint();795 break;796 case 23:797 zone = "ES ---> Z5B";798 line.clear();799 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);800 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);801 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);802 line.drawLine(endx, maxBottomDistance + 10, endx, endy);803 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));804 line.paint();805 break;806 case 24:807 zone = "EW ---> Z5B";808 line.clear();809 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);810 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));811 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));812 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);813 line.drawLine(targetNodeX - 10, endy, endx, endy);814 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));815 line.paint();816 break;817 case 31:818 zone = "SN ---> Z5B";819 line.clear();820 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));821 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));822 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);823 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));824 line.paint();825 break;826 case 32:827 zone = "SE ---> Z5B";828 line.clear();829 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);830 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);831 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));832 line.paint();833 break;834 case 33:835 zone = "SS ---> Z5B";836 line.clear();837 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));838 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));839 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy + 10);840 line.drawLine(targetNodeX - 10, endy + 10, endx, endy + 10);841 line.drawLine(endx, endy + 10, endx, endy);842 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));843 line.paint();844 break;845 case 34:846 zone = "SW ---> Z5B";847 line.clear();848 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));849 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));850 line.drawLine(endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, endy);851 line.drawLine(endx - 10, endy, endx, endy);852 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));853 line.paint();854 break;855 case 41:856 zone = "WN ---> Z5B";857 line.clear();858 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);859 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));860 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));861 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);862 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));863 line.paint();864 break;865 case 42:866 zone = "WE ---> Z5B";867 line.clear();868 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);869 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));870 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));871 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);872 line.drawLine(endx + 10, endy, endx, endy);873 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));874 line.paint();875 break;876 case 43:877 zone = "WS ---> Z5B";878 line.clear();879 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);880 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);881 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);882 line.drawLine(endx, maxBottomDistance + 10, endx, endy);883 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));884 line.paint();885 break;886 case 44:887 zone = "WW ---> Z5B";888 line.clear();889 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);890 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);891 line.drawLine(minLeftDistance - 10, endy, endx, endy);892 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));893 line.paint();894 break;895 }896897 }898 }899900 } else {901 if (endx <= sourceNodeX - 10) {902 zone = "Z7A";903 switch (connectionType) {904 case 11:905 zone = "NN ---> Z7A";906 line.clear();907 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);908 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);909 line.drawLine(endx, minTopDistance - 15, endx, endy);910 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));911 line.paint();912 break;913 case 12:914 zone = "NE ---> Z7A";915 line.clear();916 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);917 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);918 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);919 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);920 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));921 line.paint();922 break;923 case 13:924 zone = "NS ---> Z7A";925 line.clear();926 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);927 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10);928 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);929 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);930 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);931 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));932 line.paint();933 break;934 case 14:935 zone = "NW ---> Z7A";936 line.clear();937 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, minTopDistance - 10);938 line.drawLine(sourceNodeX + halfSourceNodeWidth, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);939 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);940 line.drawLine(targetNodeX - 10, endy, endx, endy);941 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));942 line.paint();943 break;944 case 21:945 zone = "EN ---> Z7A";946 line.clear();947 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);948 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);949 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);950 line.drawLine(endx, minTopDistance - 10, endx, endy);951 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));952 line.paint();953 break;954 case 22:955 zone = "EE ---> Z7A";956 line.clear();957 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);958 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10);959 line.drawLine(maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10, endx + 10, sourceNodeY + sourceNodeHeight + 10);960 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + 10, endx + 10, endy);961 line.drawLine(endx + 10, endy, endx, endy);962 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));963 line.paint();964 break;965 case 23:966 zone = "ES ---> Z7A";967 line.clear();968 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);969 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);970 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);971 line.drawLine(endx, maxBottomDistance + 10, endx, endy);972 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));973 line.paint();974 break;975 case 24:976 zone = "EW ---> Z7A";977 line.clear();978 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);979 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, maxBottomDistance + 10);980 line.drawLine(sourceNodeX + sourceNodeWidth + 10, maxBottomDistance + 10, targetNodeX - 10, maxBottomDistance + 10);981 line.drawLine(targetNodeX - 10, maxBottomDistance + 10, targetNodeX - 10, endy);982 line.drawLine(targetNodeX - 10, endy, endx, endy);983 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));984 line.paint();985 break;986 case 31:987 zone = "SN ---> Z7A";988 line.clear();989 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);990 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);991 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10);992 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10, endx, endy - 10);993 line.drawLine(endx, endy - 10, endx, endy);994 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));995 line.paint();996 break;997 case 32:998 zone = "SE ---> Z7A";999 line.clear();1000 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1001 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1002 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);1003 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);1004 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1005 line.paint(); break;1006 case 33:1007 zone = "SS ---> Z7A";1008 line.clear();1009 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1010 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1011 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1012 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1013 line.paint();1014 break;1015 case 34:1016 zone = "SW ---> Z7A";1017 line.clear();1018 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1019 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);1020 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);1021 line.drawLine(minLeftDistance - 10, endy, endx, endy);1022 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1023 line.paint();1024 break;1025 case 41:1026 zone = "WN ---> Z7A";1027 line.clear();1028 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1029 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1030 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1031 line.paint();1032 break;1033 case 42:1034 zone = "WE ---> Z7A";1035 line.clear();1036 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1037 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);1038 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);1039 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1040 line.paint();1041 break;1042 case 43:1043 zone = "WS ---> Z7A";1044 line.clear();1045 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1046 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10);1047 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10, endx, endy + 10);1048 line.drawLine(endx, endy + 10, endx, endy);1049 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1050 line.paint();1051 break;1052 case 44:1053 zone = "WW ---> Z7A";1054 line.clear();1055 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1056 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1057 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx - 10, targetNodeY + targetNodeHeight + 10);1058 line.drawLine(endx - 10, targetNodeY + targetNodeHeight + 10, endx - 10, endy);1059 line.drawLine(endx - 10, endy, endx, endy);1060 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1061 line.paint();1062 break;1063 }10641065 } else {1066 zone = "Z7A10";1067 //line.clear();1068 }10691070 }10711072 }10731074 } else {1075 if (endy <= (sourceNodeY + halfSourceNodeHeight)) // Top Right Corner1076 {1077 if (endy <= sourceNodeY) // z1b, z21078 {1079 if (endy >= sourceNodeY - 10 && endx <= sourceNodeWidth) {1080 zone = "Z1B10";1081 //line.clear();1082 } else {1083 if (endx <= sourceNodeX + sourceNodeWidth) {1084 zone = "Z1B";1085 switch (connectionType) {1086 case 11:1087 zone = "NN ---> Z1B";1088 line.clear();1089 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);1090 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, maxRightDistance + 10, sourceNodeY - 10);1091 line.drawLine(maxRightDistance + 10, sourceNodeY - 10, maxRightDistance + 10, endy - 10);1092 line.drawLine(maxRightDistance + 10, endy - 10, endx, endy - 10);1093 line.drawLine(endx, endy - 10, endx, endy);1094 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1095 line.paint();1096 break;1097 case 12:1098 zone = "NE ---> Z1B";1099 line.clear();1100 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1101 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1102 line.drawLine(endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, endy);1103 line.drawLine(endx + 15, endy, endx, endy);1104 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1105 line.paint();1106 break;1107 case 13:1108 zone = "NS ---> Z1B";1109 line.clear();1110 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1111 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1112 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);1113 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1114 line.paint();1115 break;1116 case 14:1117 zone = "NW ---> Z1B";1118 line.clear();1119 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);1120 line.drawLine(sourceNodeX + halfSourceNodeWidth, endy, endx, endy);1121 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1122 line.paint();1123 break;1124 case 21:1125 zone = "EN ---> Z1B";1126 line.clear();1127 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1128 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);1129 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);1130 line.drawLine(endx, minTopDistance - 10, endx, endy);1131 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1132 line.paint();1133 break;1134 case 22:1135 zone = "EE ---> Z1B";1136 line.clear();1137 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1138 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1139 line.drawLine(maxRightDistance + 10, endy, endx, endy);1140 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1141 line.paint();1142 break;1143 case 23:1144 zone = "ES ---> Z1B";1145 line.clear();1146 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1147 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1148 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1149 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);1150 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1151 line.paint();1152 break;1153 case 24:1154 zone = "EW ---> Z1B";1155 line.clear();1156 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1157 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1158 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1159 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);1160 line.drawLine(targetNodeX - 10, endy, endx, endy);1161 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1162 line.paint();1163 break;1164 case 31:1165 zone = "SN ---> Z1B";1166 line.clear();1167 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1168 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10);1169 line.drawLine(maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10, maxRightDistance + 10, minTopDistance - 10);1170 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);1171 line.drawLine(endx, minTopDistance - 10, endx, endy);1172 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1173 line.paint();1174 break;1175 case 32:1176 zone = "SE ---> Z1B";1177 line.clear();1178 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1179 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);1180 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);1181 line.drawLine(maxRightDistance + 10, endy, endx, endy);1182 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1183 line.paint();1184 break;1185 case 33:1186 zone = "SS ---> Z1B";1187 line.clear();1188 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1189 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + 10);1190 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + 10);1191 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1192 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1193 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1194 line.paint();1195 break;1196 case 34:1197 zone = "SW ---> Z1B";1198 line.clear();1199 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1200 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);1201 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);1202 line.drawLine(minLeftDistance - 10, endy, endx, endy);1203 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1204 line.paint();1205 break;1206 case 41:1207 zone = "WN ---> Z1B";1208 line.clear();1209 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1210 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);1211 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);1212 line.drawLine(endx, minTopDistance - 10, endx, endy);1213 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1214 line.paint();1215 break;1216 case 42:1217 zone = "WE ---> Z1B";1218 line.clear();1219 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1220 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1221 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1222 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, endy);1223 line.drawLine(endx + 10, endy, endx, endy);1224 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1225 line.paint();1226 break;1227 case 43:1228 zone = "WS ---> Z1B";1229 line.clear();1230 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1231 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1232 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1233 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);1234 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1235 line.paint();1236 break;1237 case 44:1238 zone = "WW ---> Z1B";1239 line.clear();1240 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1241 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1242 line.drawLine(minLeftDistance - 10, endy, endx, endy);1243 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1244 line.paint();1245 break;1246 }12471248 } else {1249 zone = "Z2";1250 switch (connectionType) {1251 case 11:1252 zone = "NN ---> Z2";1253 line.clear();1254 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1255 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1256 line.drawLine(endx, minTopDistance - 15, endx, endy);1257 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1258 line.paint();1259 break;1260 case 12:1261 zone = "NE ---> Z2";1262 line.clear();1263 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1264 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1265 line.drawLine(endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, endy);1266 line.drawLine(endx + 15, endy, endx, endy);1267 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1268 line.paint();1269 break;1270 case 13:1271 zone = "NS ---> Z2";1272 line.clear();1273 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1274 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1275 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);1276 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1277 line.paint();1278 break;1279 case 14:1280 zone = "NW ---> Z2";1281 line.clear();1282 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);1283 line.drawLine(sourceNodeX + halfSourceNodeWidth, endy, endx, endy);1284 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1285 line.paint();1286 break;1287 case 21:1288 zone = "EN ---> Z2";1289 line.clear();1290 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1291 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10);1292 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10, endx, minTopDistance - 10);1293 line.drawLine(endx, minTopDistance - 10, endx, endy);1294 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1295 line.paint();1296 break;1297 case 22:1298 zone = "EE ---> Z2";1299 line.clear();1300 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1301 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1302 line.drawLine(maxRightDistance + 10, endy, endx, endy);1303 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1304 line.paint();1305 break;1306 case 23:1307 zone = "ES ---> Z2";1308 line.clear();1309 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1310 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1311 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1312 line.paint();1313 break;1314 case 24:1315 zone = "EW ---> Z2";1316 line.clear();1317 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1318 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1319 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1320 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1321 line.paint();1322 break;1323 case 31:1324 zone = "SN ---> Z2";1325 line.clear();1326 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1327 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1328 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);1329 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);1330 line.drawLine(endx, targetNodeY - 10, endx, endy);1331 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1332 line.paint();1333 break;1334 case 32:1335 zone = "SE ---> Z2";1336 line.clear();1337 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1338 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);1339 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);1340 line.drawLine(maxRightDistance + 10, endy, endx, endy);1341 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1342 line.paint();1343 break;1344 case 33:1345 zone = "SS ---> Z2";1346 line.clear();1347 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1348 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1349 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1350 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1351 line.paint();1352 break;1353 case 34:1354 zone = "SW ---> Z2";1355 line.clear();1356 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1357 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1358 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1359 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1360 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1361 line.paint();1362 break;1363 case 41:1364 zone = "WN ---> Z2";1365 line.clear();1366 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1367 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);1368 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);1369 line.drawLine(endx, minTopDistance - 10, endx, endy);1370 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1371 line.paint();1372 break;1373 case 42:1374 zone = "WE ---> Z2";1375 line.clear();1376 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1377 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1378 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1379 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, endy);1380 line.drawLine(endx + 10, endy, endx, endy);1381 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1382 line.paint();1383 break;1384 case 43:1385 zone = "WS ---> Z2";1386 line.clear();1387 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1388 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1389 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1390 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);1391 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1392 line.paint();1393 break;1394 case 44:1395 zone = "WW ---> Z2";1396 line.clear();1397 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1398 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1399 line.drawLine(minLeftDistance - 10, endy, endx, endy);1400 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1401 line.paint();1402 break;1403 }14041405 }1406 }14071408 } else {1409 if (endx <= sourceNodeX + sourceNodeWidth + 10) {1410 zone = "Z3A10";1411 //line.clear();1412 } else {1413 zone = "Z3A";1414 switch (connectionType) {1415 case 11:1416 zone = "NN ---> Z3A";1417 line.clear();1418 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1419 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1420 line.drawLine(endx, minTopDistance - 15, endx, endy);1421 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1422 line.paint();1423 break;1424 case 12:1425 zone = "NE ---> Z3A";1426 line.clear();1427 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1428 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);1429 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);1430 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);1431 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1432 line.paint();1433 break;1434 case 13:1435 zone = "NS ---> Z3A";1436 line.clear();1437 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1438 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1439 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1440 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1441 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1442 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1443 line.paint();1444 break;1445 case 14:1446 zone = "NW ---> Z3A";1447 line.clear();1448 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1449 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1450 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1451 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1452 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1453 line.paint();1454 break;1455 case 21:1456 zone = "EN ---> Z3A";1457 line.clear();1458 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1459 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10);1460 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10, endx, minTopDistance - 10);1461 line.drawLine(endx, minTopDistance - 10, endx, endy);1462 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1463 line.paint();1464 break;1465 case 22:1466 zone = "EE ---> Z3A";1467 line.clear();1468 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1469 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);1470 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx + 10, targetNodeY - 10);1471 line.drawLine(endx + 10, targetNodeY - 10, endx + 10, endy);1472 line.drawLine(endx + 10, endy, endx, endy);1473 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1474 line.paint();1475 break;1476 case 23:1477 zone = "ES ---> Z3A";1478 line.clear();1479 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1480 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1481 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1482 line.paint();1483 break;1484 case 24:1485 zone = "EW ---> Z3A";1486 line.clear();1487 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1488 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1489 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1490 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1491 line.paint();1492 break;1493 case 31:1494 zone = "SN ---> Z3A";1495 line.clear();1496 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1497 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1498 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);1499 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);1500 line.drawLine(endx, targetNodeY - 10, endx, endy);1501 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1502 line.paint();1503 break;1504 case 32:1505 zone = "SE ---> Z3A";1506 line.clear();1507 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1508 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);1509 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);1510 line.drawLine(maxRightDistance + 10, endy, endx, endy);1511 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1512 line.paint();1513 break;1514 case 33:1515 zone = "SS ---> Z3A";1516 line.clear();1517 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1518 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1519 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1520 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1521 line.paint();1522 break;1523 case 34:1524 zone = "SW ---> Z3A";1525 line.clear();1526 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1527 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1528 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1529 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1530 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1531 line.paint();1532 break;1533 case 41:1534 zone = "WN ---> Z3A";1535 line.clear();1536 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1537 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);1538 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);1539 line.drawLine(endx, minTopDistance - 10, endx, endy);1540 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1541 line.paint();1542 break;1543 case 42:1544 zone = "WE ---> Z3A";1545 line.clear();1546 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1547 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, minTopDistance - 10);1548 line.drawLine(sourceNodeX - 10, minTopDistance - 10, maxRightDistance + 10, minTopDistance - 10);1549 line.drawLine(maxRightDistance + 10, minTopDistance - 10, maxRightDistance + 10, endy);1550 line.drawLine(maxRightDistance + 10, endy, endx, endy);1551 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1552 line.paint();1553 break;1554 case 43:1555 zone = "WS ---> Z3A";1556 line.clear();1557 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1558 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);1559 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1560 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1561 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1562 line.paint();1563 break;1564 case 44:1565 zone = "WW ---> Z3A";1566 line.clear();1567 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1568 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY - 10);1569 line.drawLine(sourceNodeX - 10, sourceNodeY - 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1570 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1571 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1572 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1573 line.paint();1574 break;1575 }15761577 }15781579 }15801581 } else // Bottom Right Corner1582 {1583 if (endy >= sourceNodeY + sourceNodeHeight) // z5a, z41584 {1585 if ((endy <= sourceNodeY + sourceNodeHeight + 10) && (endx <= sourceNodeX + sourceNodeWidth)) {1586 zone = "Z5A10";1587 //line.clear();1588 } else {1589 if (endx <= sourceNodeX + sourceNodeWidth) {1590 zone = "Z5A";1591 switch (connectionType) {1592 case 11:1593 zone = "NN ---> Z5A";1594 line.clear();1595 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);1596 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + 10, sourceNodeY - 10);1597 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1598 line.drawLine(sourceNodeX + sourceNodeWidth + 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1599 line.drawLine(endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1600 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1601 line.paint();1602 break;1603 case 12:1604 zone = "NE ---> Z5A";1605 line.clear();1606 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1607 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, maxRightDistance + 10, minTopDistance - 10);1608 line.drawLine(maxRightDistance + 10, minTopDistance - 10, maxRightDistance + 10, endy);1609 line.drawLine(maxRightDistance + 10, endy, endx, endy);1610 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1611 line.paint();1612 break;1613 case 13:1614 zone = "NS ---> Z5A";1615 line.clear();1616 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1617 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, maxRightDistance + 10, sourceNodeY - 10);1618 line.drawLine(maxRightDistance + 10, sourceNodeY - 10, maxRightDistance + 10, targetNodeY + targetNodeHeight + 10);1619 line.drawLine(maxRightDistance + 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1620 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1621 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1622 line.paint();1623 break;1624 case 14:1625 zone = "NW ---> Z5A";1626 line.clear();1627 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1628 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);1629 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, endy);1630 line.drawLine(minLeftDistance - 10, endy, endx, endy);1631 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1632 line.paint();1633 break;1634 case 21:1635 zone = "EN ---> Z5A";1636 line.clear();1637 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1638 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1639 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1640 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1641 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1642 line.paint();1643 break;1644 case 22:1645 zone = "EE ---> Z5A";1646 line.clear();1647 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1648 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1649 line.drawLine(maxRightDistance + 10, endy, endx, endy);1650 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1651 line.paint();1652 break;1653 case 23:1654 zone = "ES ---> Z5A";1655 line.clear();1656 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1657 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);1658 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1659 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1660 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1661 line.paint();1662 break;1663 case 24:1664 zone = "EW ---> Z5A";1665 line.clear();1666 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1667 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1668 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1669 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);1670 line.drawLine(targetNodeX - 10, endy, endx, endy);1671 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1672 line.paint();1673 break;1674 case 31:1675 zone = "SN ---> Z5A";1676 line.clear();1677 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1678 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1679 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1680 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1681 line.paint();1682 break;1683 case 32:1684 zone = "SE ---> Z5A";1685 line.clear();1686 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1687 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1688 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1689 line.drawLine(endx + 10, endy, endx, endy);1690 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1691 line.paint();1692 break;1693 case 33:1694 zone = "SS ---> Z5A";1695 line.clear();1696 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1697 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX + targetNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1698 line.drawLine(targetNodeX + targetNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX + targetNodeWidth + 10, endy + 10);1699 line.drawLine(targetNodeX + targetNodeWidth + 10, endy + 10, endx, endy + 10);1700 line.drawLine(endx, endy + 10, endx, endy);1701 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1702 line.paint();1703 break;1704 case 34:1705 zone = "SW ---> Z5A";1706 line.clear();1707 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);1708 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);1709 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1710 line.paint();1711 break;1712 case 41:1713 zone = "WN ---> Z5A";1714 line.clear();1715 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1716 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1717 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1718 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1719 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1720 line.paint();1721 break;1722 case 42:1723 zone = "WE ---> Z5A";1724 line.clear();1725 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1726 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1727 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1728 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1729 line.drawLine(endx + 10, endy, endx, endy);1730 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1731 line.paint();1732 break;1733 case 43:1734 zone = "WS ---> Z5A";1735 line.clear();1736 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1737 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);1738 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1739 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1740 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1741 line.paint();1742 break;1743 case 44:1744 zone = "WW ---> Z5A";1745 line.clear();1746 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1747 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1748 line.drawLine(minLeftDistance - 10, endy, endx, endy);1749 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1750 line.paint();1751 break;1752 }17531754 } else {1755 zone = "Z4";1756 switch (connectionType) {1757 case 11:1758 zone = "NN ---> Z4";1759 line.clear();1760 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1761 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1762 line.drawLine(endx, minTopDistance - 15, endx, endy);1763 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1764 line.paint();1765 break;1766 case 12:1767 zone = "NE ---> Z4";1768 line.clear();1769 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1770 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);1771 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);1772 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);1773 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1774 line.paint();1775 break;1776 case 13:1777 zone = "NS ---> Z4";1778 line.clear();1779 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1780 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1781 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1782 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1783 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1784 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1785 line.paint();1786 break;1787 case 14:1788 zone = "NW ---> Z4";1789 line.clear();1790 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1791 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1792 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1793 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1794 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1795 line.paint();1796 break;1797 case 21:1798 zone = "EN ---> Z4";1799 line.clear();1800 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1801 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1802 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1803 line.paint();1804 break;1805 case 22:1806 zone = "EE ---> Z4";1807 line.clear();1808 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1809 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1810 line.drawLine(maxRightDistance + 10, endy, endx, endy);1811 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1812 line.paint();1813 break;1814 case 23:1815 zone = "ES ---> Z4";1816 line.clear();1817 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1818 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10);1819 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10, endx, endy + 10);1820 line.drawLine(endx, endy + 10, endx, endy);1821 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1822 line.paint();1823 break;1824 case 24:1825 zone = "EW ---> Z4";1826 line.clear();1827 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1828 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1829 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1830 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1831 line.paint();1832 break;1833 case 31:1834 zone = "SN ---> Z4";1835 line.clear();1836 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1837 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1838 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1839 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1840 line.paint();1841 break;1842 case 32:1843 zone = "SE ---> Z4";1844 line.clear();1845 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1846 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1847 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1848 line.drawLine(endx + 10, endy, endx, endy);1849 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1850 line.paint();1851 break;1852 case 33:1853 zone = "SS ---> Z4";1854 line.clear();1855 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1856 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1857 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1858 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1859 line.paint();1860 break;1861 case 34:1862 zone = "SW ---> Z4";1863 line.clear();1864 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);1865 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);1866 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1867 line.paint();1868 break;1869 case 41:1870 zone = "WN ---> Z4";1871 line.clear();1872 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1873 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1874 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1875 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1876 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1877 line.paint();1878 break;1879 case 42:1880 zone = "WE ---> Z4";1881 line.clear();1882 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1883 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1884 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1885 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1886 line.drawLine(endx + 10, endy, endx, endy);1887 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1888 line.paint();1889 break;1890 case 43:1891 zone = "WS ---> Z4";1892 line.clear();1893 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1894 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);1895 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1896 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1897 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1898 line.paint();1899 break;1900 case 44:1901 zone = "WW ---> Z4";1902 line.clear();1903 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1904 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1905 line.drawLine(minLeftDistance - 10, endy, endx, endy);1906 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1907 line.paint();1908 break;1909 }19101911 }1912 }19131914 } else {1915 if (endx <= sourceNodeX + sourceNodeWidth + 10) {1916 zone = "Z3B10";1917 //line.clear();1918 } else {1919 zone = "Z3B";1920 switch (connectionType) {1921 case 11:1922 zone = "NN ---> Z3B";1923 line.clear();1924 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1925 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1926 line.drawLine(endx, minTopDistance - 15, endx, endy);1927 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1928 line.paint();1929 break;1930 case 12:1931 zone = "NE ---> Z3B";1932 line.clear();1933 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1934 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);1935 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);1936 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);1937 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1938 line.paint();1939 break;1940 case 13:1941 zone = "NS ---> Z3B";1942 line.clear();1943 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1944 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1945 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1946 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1947 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1948 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1949 line.paint();1950 break;1951 case 14:1952 zone = "NW ---> Z3B";1953 line.clear();1954 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1955 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1956 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1957 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1958 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1959 line.paint();1960 break;1961 case 21:1962 zone = "EN ---> Z3B";1963 line.clear();1964 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1965 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1966 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1967 line.paint();1968 break;1969 case 22:1970 zone = "EE ---> Z3B";1971 line.clear();1972 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1973 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1974 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx + 10, targetNodeY + targetNodeHeight + 10);1975 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + 10, endx + 10, endy);1976 line.drawLine(endx + 10, endy, endx, endy);1977 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1978 line.paint();1979 break;1980 case 23:1981 zone = "ES ---> Z3B";1982 line.clear();1983 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1984 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10);1985 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10, endx, endy + 10);1986 line.drawLine(endx, endy + 10, endx, endy);1987 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1988 line.paint();1989 break;1990 case 24:1991 zone = "EW ---> Z3B";1992 line.clear();1993 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1994 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1995 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1996 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1997 line.paint();19981999 break;2000 case 31:2001 zone = "SN ---> Z3B";2002 line.clear();2003 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);2004 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);2005 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);2006 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);2007 line.drawLine(endx, targetNodeY - 10, endx, endy);2008 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));2009 line.paint();2010 break;2011 case 32:2012 zone = "SE ---> Z3B";2013 line.clear();2014 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);2015 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);2016 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);2017 line.drawLine(maxRightDistance + 10, endy, endx, endy);2018 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));2019 line.paint();2020 break;2021 case 33:2022 zone = "SS ---> Z3B";2023 line.clear();2024 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);2025 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);2026 line.drawLine(endx, maxBottomDistance + 10, endx, endy);2027 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));2028 line.paint();2029 break;2030 case 34:2031 zone = "SW ---> Z3B";2032 line.clear();2033 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);2034 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);2035 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);2036 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);2037 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));2038 line.paint();2039 break;2040 case 41:2041 zone = "WN ---> Z3B";2042 line.clear();2043 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);2044 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);2045 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);2046 line.drawLine(endx, minTopDistance - 10, endx, endy);2047 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));2048 line.paint();2049 break;2050 case 42:2051 zone = "WE ---> Z3B";2052 line.clear();2053 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);2054 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, maxBottomDistance + 10);2055 line.drawLine(sourceNodeX - 10, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);2056 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);2057 line.drawLine(maxRightDistance + 10, endy, endx, endy);2058 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));2059 line.paint();2060 break;2061 case 43:2062 zone = "WS ---> Z3B";2063 line.clear();2064 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);2065 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);2066 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);2067 line.drawLine(endx, maxBottomDistance + 10, endx, endy);2068 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));2069 line.paint();2070 break;2071 case 44:2072 zone = "WW ---> Z3B";2073 line.clear();2074 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);2075 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10);2076 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);2077 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);2078 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);2079 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));2080 line.paint();2081 break;2082 }2083 }2084 }2085 }2086 }2087}20882089function drawTempConnection(node, direction, port, canvasobj, line) {20902091 direction = node + "_" + direction;20922093 var startx;2094 var starty;2095 var endx = port.position().left + $("#" + node).position().left + $(canvasobj.getCanvas).scrollLeft();2096 var endy = port.position().top + $("#" + node).position().top + $(canvasobj.getCanvas).scrollTop();2097 var nodex = $("#" + node).position().left + $(canvasobj.getCanvas).scrollLeft();2098 var nodey = $("#" + node).position().top + $(canvasobj.getCanvas).scrollTop();2099 var nodeWidth = $("#" + node).width();2100 var nodeHeight = $("#" + node).height();2101 var halfNodeWidth = Math.floor(nodeWidth / 2);2102 var halfNodeHeight = Math.floor(nodeHeight / 2);2103 var zone;2104 var portNumber;21052106 if (direction.match(/_n$/)) {2107 startx = nodex + halfNodeWidth;2108 starty = nodey;2109 portNumber = 1;2110 } else if (direction.match(/_e$/)) {2111 startx = nodex + nodeWidth;2112 starty = nodey + halfNodeHeight;2113 portNumber = 2;2114 } else if (direction.match(/_s$/)) {2115 startx = nodex + halfNodeWidth;2116 starty = nodey + nodeHeight;2117 portNumber = 3;2118 } else if (direction.match(/_w$/)) {2119 startx = nodex;2120 starty = nodey + halfNodeHeight;2121 portNumber = 4;2122 }21232124212521262127 if (endx <= (nodex + halfNodeWidth)) {2128 if (endy <= (nodey + halfNodeHeight)) /* Top Left Corner*/ {2129 if (endy <= nodey) /* z8, z1a*/ {2130 if (endy >= nodey - 10 && endx > nodex) {2131 zone = "Z1A10";2132 line.clear();2133 } else {2134 if (endx <= nodex - 10) {2135 zone = "Z8";2136 switch (portNumber) {2137 case 1:2138 zone = "N ---> Z8";2139 line.clear();2140 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2141 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2142 line.paint();2143 break;2144 case 2:2145 zone = "E ---> Z8";2146 line.clear();2147 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2148 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2149 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2150 line.paint();2151 break;2152 case 3:2153 zone = "S ---> Z8";2154 line.clear();2155 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2156 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2157 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2158 line.paint();2159 break;2160 case 4:2161 zone = "W ---> Z8";2162 line.clear();2163 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2164 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2165 line.paint();2166 break;2167 }21682169 } else {2170 zone = "Z1A";2171 switch (portNumber) {2172 case 1:2173 zone = "N ---> Z1A";2174 line.clear();2175 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2176 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2177 line.paint();2178 break;2179 case 2:2180 zone = "E ---> Z1A";2181 line.clear();2182 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2183 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2184 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2185 line.paint();2186 break;2187 case 3:2188 zone = "S ---> Z1A";2189 line.clear();2190 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2191 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, nodex - 10, nodey + nodeHeight + 10);2192 line.drawLine(nodex - 10, nodey + nodeHeight + 10, nodex - 10, endy);2193 line.drawLine(nodex - 10, endy, endx, endy);2194 line.paint();2195 break;2196 case 4:2197 zone = "W ---> Z1A";2198 line.clear();2199 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2200 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2201 line.drawLine(nodex - 10, endy, endx, endy);2202 line.paint();2203 break;2204 }22052206 }2207 }22082209 } else {2210 if (endx <= nodex - 10) {2211 zone = "Z7B";2212 switch (portNumber) {2213 case 1:2214 zone = "N ---> Z7B";2215 line.clear();2216 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2217 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2218 line.drawLine(endx, nodey - 10, endx, endy);2219 line.paint();2220 break;2221 case 2:2222 zone = "E ---> Z7B";2223 line.clear();2224 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2225 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey - 10);2226 line.drawLine((nodex) + nodeWidth + 10, nodey - 10, endx, nodey - 10);2227 line.drawLine(endx, nodey - 10, endx, endy);2228 line.paint();2229 break;2230 case 3:2231 zone = "S ---> Z7B";2232 line.clear();2233 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2234 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2235 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2236 line.paint();2237 break;2238 case 4:2239 zone = "W ---> Z7B";2240 line.clear();2241 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2242 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2243 line.paint();2244 break;2245 }22462247 } else {2248 zone = "Z7B10";2249 line.clear();2250 }22512252 }2253 } else /* Bottom Left Corner*/ {2254 if (endy >= nodey + nodeHeight) /* z6, z5b*/ {2255 if ((endy <= nodey + nodeHeight + 10) && (endx >= nodex)) {2256 zone = "Z5B10";2257 line.clear();2258 } else {2259 if (endx <= nodex - 10) {2260 zone = "Z6";2261 switch (portNumber) {2262 case 1:2263 zone = "N ---> Z6";2264 line.clear();2265 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2266 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2267 line.drawLine(endx, nodey - 10, endx, endy - 10);2268 line.paint();2269 break;2270 case 2:2271 zone = "E ---> Z6";2272 line.clear();2273 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2274 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2275 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2276 line.paint();2277 break;2278 case 3:2279 zone = "S ---> Z6";2280 line.clear();2281 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2282 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2283 line.paint();2284 break;2285 case 4:2286 zone = "W ---> Z6";2287 line.clear();2288 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2289 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2290 line.paint();2291 break;2292 }22932294 } else {2295 zone = "Z5B";2296 switch (portNumber) {2297 case 1:2298 zone = "N ---> Z5B";2299 line.clear();2300 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2301 line.drawLine((nodex) + halfNodeWidth, nodey - 10, nodex - 20, nodey - 10);2302 line.drawLine(nodex - 20, nodey - 10, nodex - 20, endy);2303 line.drawLine(nodex - 20, endy, endx, endy);2304 line.paint();2305 break;2306 case 2:2307 zone = "E ---> Z5B";2308 line.clear();2309 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2310 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2311 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2312 line.paint();2313 break;2314 case 3:2315 zone = "S ---> Z5B";2316 line.clear();2317 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2318 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2319 line.paint();2320 break;2321 case 4:2322 zone = "W ---> Z5B";2323 line.clear();2324 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2325 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2326 line.drawLine(nodex - 10, endy, endx, endy);2327 line.paint();2328 break;2329 }23302331 }2332 }23332334 } else {2335 if (endx <= nodex - 10) {2336 /*zone="Z7A";*/2337 switch (portNumber) {2338 case 1:2339 zone = "N ---> Z7A";2340 line.clear();2341 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2342 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2343 line.drawLine(endx, nodey - 10, endx, endy);2344 line.paint();23452346 break;2347 case 2:2348 zone = "E ---> Z7A";2349 line.clear();2350 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2351 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + nodeHeight + 10);2352 line.drawLine((nodex) + nodeWidth + 10, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2353 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2354 line.paint();2355 break;2356 case 3:2357 zone = "S ---> Z7A";2358 line.clear();2359 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2360 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2361 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2362 line.paint();2363 break;2364 case 4:2365 zone = "W ---> Z7A";2366 line.clear();2367 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2368 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2369 line.paint();23702371 break;2372 }23732374 } else {2375 zone = "Z7A10";2376 line.clear();2377 }23782379 }23802381 }23822383 } else {2384 if (endy <= (nodey + halfNodeHeight)) /* Top Right Corner*/ {2385 if (endy <= nodey) /* z1b, z2*/ {2386 if (endy >= nodey - 10 && endx <= nodeWidth) {2387 zone = "Z1B10";2388 line.clear();2389 } else {2390 if (endx <= nodex + nodeWidth) {2391 zone = "Z1B";2392 switch (portNumber) {2393 case 1:2394 zone = "N ---> Z1B";2395 line.clear();2396 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2397 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2398 line.paint();2399 break;2400 case 2:2401 zone = "E ---> Z1B";2402 line.clear();2403 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2404 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2405 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2406 line.paint();2407 break;2408 case 3:2409 zone = "S ---> Z1B";2410 line.clear();2411 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2412 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, nodex + nodeWidth + 10, nodey + nodeHeight + 10);2413 line.drawLine(nodex + nodeWidth + 10, nodey + nodeHeight + 10, nodex + nodeWidth + 10, endy);2414 line.drawLine(nodex + nodeWidth + 10, endy, endx, endy);2415 line.paint();2416 break;2417 case 4:2418 zone = "W ---> Z1B";2419 line.clear();2420 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2421 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2422 line.drawLine(nodex - 10, endy, endx, endy);2423 line.paint();2424 break;2425 }24262427 } else {2428 zone = "Z2";2429 switch (portNumber) {2430 case 1:2431 zone = "N ---> Z2";2432 line.clear();2433 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2434 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2435 line.paint();2436 break;2437 case 2:2438 zone = "E ---> Z2";2439 line.clear();2440 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2441 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2442 line.paint();2443 break;2444 case 3:2445 zone = "S ---> Z2";2446 line.clear();2447 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2448 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2449 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2450 line.paint();2451 break;2452 case 4:2453 zone = "W ---> Z2";2454 line.clear();2455 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2456 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2457 line.drawLine(nodex - 10, endy, endx, endy);2458 line.paint();2459 break;2460 }24612462 }2463 }24642465 } else {2466 if (endx <= nodex + nodeWidth + 10) {2467 zone = "Z3A10";2468 line.clear();2469 } else {2470 zone = "Z3A";2471 switch (portNumber) {2472 case 1:2473 zone = "N ---> Z3A";2474 line.clear();2475 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2476 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2477 line.drawLine(endx, nodey - 10, endx, endy);2478 line.paint();2479 break;2480 case 2:2481 zone = "E ---> Z3A";2482 line.clear();2483 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2484 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2485 line.paint();2486 break;2487 case 3:2488 zone = "S ---> Z3A";2489 line.clear();2490 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2491 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2492 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2493 line.paint();2494 break;2495 case 4:2496 zone = "W ---> Z3A";2497 line.clear();2498 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2499 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, nodey - 10);2500 line.drawLine(nodex - 10, nodey - 10, endx, nodey - 10);2501 line.drawLine(endx, nodey - 10, endx, endy);2502 line.paint();2503 break;2504 }25052506 }25072508 }25092510 } else /* Bottom Right Corner*/ {2511 if (endy >= nodey + nodeHeight) /* z5a, z4*/ {2512 if ((endy <= nodey + nodeHeight + 10) && (endx <= nodex + nodeWidth)) {2513 zone = "Z5A10";2514 line.clear();2515 } else {2516 if (endx <= nodex + nodeWidth) {2517 zone = "Z5A";2518 switch (portNumber) {2519 case 1:2520 zone = "N ---> Z5A";2521 line.clear();2522 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2523 line.drawLine((nodex) + halfNodeWidth, nodey - 10, nodex + nodeWidth + 10, nodey - 10);2524 line.drawLine(nodex + nodeWidth + 10, nodey - 10, nodex + nodeWidth + 10, endy);2525 line.drawLine(nodex + nodeWidth + 10, endy, endx, endy);2526 line.paint();2527 break;2528 case 2:2529 zone = "E ---> Z5A";2530 line.clear();2531 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2532 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2533 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2534 line.paint();2535 break;2536 case 3:2537 zone = "S ---> Z5A";2538 line.clear();2539 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2540 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2541 line.paint();2542 break;2543 case 4:2544 zone = "W ---> Z5A";2545 line.clear();2546 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2547 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2548 line.drawLine(nodex - 10, endy, endx, endy);2549 line.paint();2550 break;2551 }25522553 } else {2554 zone = "Z4";2555 switch (portNumber) {2556 case 1:2557 zone = "N ---> Z4";2558 line.clear();2559 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2560 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2561 line.drawLine(endx, nodey - 10, endx, endy);2562 line.paint();2563 break;2564 case 2:2565 zone = "E ---> Z4";2566 line.clear();2567 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2568 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2569 line.paint();2570 break;2571 case 3:2572 zone = "S ---> Z4";2573 line.clear();2574 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2575 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2576 line.paint();2577 break;2578 case 4:2579 zone = "W ---> Z4";2580 line.clear();2581 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2582 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2583 line.drawLine(nodex - 10, endy, endx, endy);2584 line.paint();2585 break;2586 }25872588 }2589 }25902591 } else {2592 if (endx <= nodex + nodeWidth + 10) {2593 zone = "Z3B10";2594 line.clear();2595 } else {2596 zone = "Z3B";2597 switch (portNumber) {2598 case 1:2599 zone = "N ---> Z3B";2600 line.clear();2601 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2602 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2603 line.drawLine(endx, nodey - 10, endx, endy);2604 line.paint();2605 break;2606 case 2:2607 zone = "E ---> Z3B";2608 line.clear();2609 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2610 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2611 line.paint();2612 break;2613 case 3:2614 zone = "S ---> Z3B";2615 line.clear();2616 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2617 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2618 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2619 line.paint();2620 break;2621 case 4:2622 zone = "W ---> Z3B";2623 line.clear();2624 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2625 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, nodey + nodeHeight + 10);2626 line.drawLine(nodex - 10, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2627 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2628 line.paint();2629 break;2630 }2631 }2632 }2633 }2634 }2635} ...

Full Screen

Full Screen

edit-ivr-connection.js

Source:edit-ivr-connection.js Github

copy

Full Screen

...67 switch (connectionType) {68 case 11:69 zone = "NN ---> Z8";70 line.clear();71 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);72 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);73 line.drawLine(endx, minTopDistance - 15, endx, endy);74 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));75 line.paint();76 break;77 case 12:78 zone = "NE ---> Z8";79 line.clear();80 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);81 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);82 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));83 line.paint();84 break;85 case 13:86 zone = "NS ---> Z8";87 line.clear();88 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));89 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));90 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);91 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));92 line.paint();93 break;94 case 14:95 zone = "NW ---> Z8";96 line.clear();97 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));98 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));99 line.drawLine(targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, endy);100 line.drawLine(targetNodeX - 10, endy, endx, endy);101 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));102 line.paint();103 break;104 case 21:105 zone = "EN ---> Z8";106 line.clear();107 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);108 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);109 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);110 line.drawLine(endx, minTopDistance - 10, endx, endy);111 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));112 line.paint();113 break;114 case 22:115 zone = "EE ---> Z8";116 line.clear();117 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);118 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);119 line.drawLine(maxRightDistance + 10, endy, endx, endy);120 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));121 line.paint();122 break;123 case 23:124 zone = "ES ---> Z8";125 line.clear();126 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);127 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));128 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));129 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);130 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));131 line.paint();132 break;133 case 24:134 zone = "EW ---> Z8";135 line.clear();136 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);137 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));138 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));139 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);140 line.drawLine(targetNodeX - 10, endy, endx, endy);141 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));142 line.paint();143 break;144 case 31:145 zone = "SN ---> Z8";146 line.clear();147 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);148 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);149 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10);150 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10, endx, endy - 10);151 line.drawLine(endx, endy - 10, endx, endy);152 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));153 line.paint();154155 break;156 case 32:157 zone = "SE ---> Z8";158 line.clear();159 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);160 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);161 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);162 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);163 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));164 line.paint();165 break;166 case 33:167 zone = "SS ---> Z8";168 line.clear();169 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);170 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);171 line.drawLine(endx, maxBottomDistance + 10, endx, endy);172 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));173 line.paint();174 break;175 case 34:176 zone = "SW ---> Z8";177 line.clear();178 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);179 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);180 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);181 line.drawLine(minLeftDistance - 10, endy, endx, endy);182 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));183 line.paint();184 break;185 case 41:186 zone = "WN ---> Z8";187 line.clear();188 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);189 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10);190 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);191 line.drawLine(endx, targetNodeY - 10, endx, endy);192 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));193 line.paint();194 break;195 case 42:196 zone = "WE ---> Z8";197 line.clear();198 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);199 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);200 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);201 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));202 line.paint();203 break;204 case 43:205 zone = "WS ---> Z8";206 line.clear();207 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);208 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);209 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));210 line.paint();211 break;212 case 44:213 zone = "WW ---> Z8";214 line.clear();215 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);216 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);217 line.drawLine(minLeftDistance - 10, endy, endx, endy);218 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));219 line.paint();220 break;221222 }223224 } else {225 zone = "Z1A";226 switch (connectionType) {227 case 11:228 zone = "NN ---> Z1A";229 line.clear();230 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);231 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);232 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, endy - 10);233 line.drawLine(minLeftDistance - 10, endy - 10, endx, endy - 10);234 line.drawLine(endx, endy - 10, endx, endy);235 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));236 line.paint();237 break;238 case 12:239 zone = "NE ---> Z1A";240 line.clear();241 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);242 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);243 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));244 line.paint();245 break;246 case 13:247 zone = "NS ---> Z1A";248 line.clear();249 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));250 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));251 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);252 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));253 line.paint();254 break;255 case 14:256 zone = "NW ---> Z1A";257 line.clear();258 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));259 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));260 line.drawLine(targetNodeX - 10, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), targetNodeX - 10, endy);261 line.drawLine(targetNodeX - 10, endy, endx, endy);262 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));263 line.paint();264 break;265 case 21:266 zone = "EN ---> Z1A";267 line.clear();268 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);269 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);270 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);271 line.drawLine(endx, minTopDistance - 10, endx, endy);272 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));273 line.paint();274 break;275 case 22:276 zone = "EE ---> Z1A";277 line.clear();278 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);279 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);280 line.drawLine(maxRightDistance + 10, endy, endx, endy);281 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));282 line.paint();283 break;284 case 23:285 zone = "ES ---> Z1A";286 line.clear();287 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);288 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));289 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));290 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);291 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));292 line.paint();293 break;294 case 24:295 zone = "EW ---> Z1A";296 line.clear();297 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);298 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));299 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));300 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);301 line.drawLine(targetNodeX - 10, endy, endx, endy);302 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));303 line.paint();304 break;305 case 31:306 zone = "SN ---> Z1A";307 line.clear();308 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);309 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, minLeftDistance - 10, sourceNodeY + sourceNodeHeight + 10);310 line.drawLine(minLeftDistance - 10, sourceNodeY + sourceNodeHeight + 10, minLeftDistance - 10, minTopDistance - 10);311 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);312 line.drawLine(endx, minTopDistance - 10, endx, endy);313 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));314 line.paint();315 break;316 case 32:317 zone = "SE ---> Z1A";318 line.clear();319 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);320 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);321 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);322 line.drawLine(maxRightDistance + 10, endy, endx, endy);323 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));324 line.paint();325 break;326 case 33:327 zone = "SS ---> Z1A";328 line.clear();329 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);330 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10);331 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10, sourceNodeX - 10, targetNodeY + targetNodeHeight + 10);332 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);333 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);334 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));335 line.paint();336 break;337 case 34:338 zone = "SW ---> Z1A";339 line.clear();340 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);341 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);342 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);343 line.drawLine(minLeftDistance - 10, endy, endx, endy);344 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));345 line.paint();346 break;347 case 41:348 zone = "WN ---> Z1A";349 line.clear();350 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);351 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);352 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);353 line.drawLine(endx, minTopDistance - 10, endx, endy);354 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));355 line.paint();356 break;357 case 42:358 zone = "WE ---> Z1A";359 line.clear();360 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);361 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));362 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));363 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, endy);364 line.drawLine(endx + 10, endy, endx, endy);365 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));366 line.paint();367 break;368 case 43:369 zone = "WS ---> Z1A";370 line.clear();371 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);372 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));373 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));374 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);375 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));376 line.paint();377 break;378 case 44:379 zone = "WW ---> Z1A";380 line.clear();381 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);382 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);383 line.drawLine(minLeftDistance - 10, endy, endx, endy);384 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));385 line.paint();386 break;387 }388389 }390 }391392 } else {393 if (endx <= sourceNodeX - 10) {394 zone = "Z7B";395 switch (connectionType) {396 case 11:397 zone = "NN ---> Z7B";398 line.clear();399 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);400 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);401 line.drawLine(endx, minTopDistance - 15, endx, endy);402 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));403 line.paint();404 break;405 case 12:406 zone = "NE ---> Z7B";407 line.clear();408 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);409 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);410 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);411 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);412 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));413 line.paint();414 break;415 case 13:416 zone = "NS ---> Z7B";417 line.clear();418 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);419 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10);420 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);421 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);422 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);423 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));424 line.paint();425 break;426 case 14:427 zone = "NW ---> Z7B";428 line.clear();429 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, minTopDistance - 10);430 line.drawLine(sourceNodeX + halfSourceNodeWidth, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);431 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);432 line.drawLine(targetNodeX - 10, endy, endx, endy);433 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));434 line.paint();435 break;436 case 21:437 zone = "EN ---> Z7B";438 line.clear();439 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);440 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);441 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);442 line.drawLine(endx, minTopDistance - 10, endx, endy);443 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));444 line.paint();445 break;446 case 22:447 zone = "EE ---> Z7B";448 line.clear();449 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);450 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY - 10);451 line.drawLine(maxRightDistance + 10, sourceNodeY - 10, endx + 10, sourceNodeY - 10);452 line.drawLine(endx + 10, sourceNodeY - 10, endx + 10, endy);453 line.drawLine(endx + 10, endy, endx, endy);454 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));455 line.paint();456 break;457 case 23:458 zone = "ES ---> Z7B";459 line.clear();460 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);461 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);462 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);463 line.drawLine(endx, maxBottomDistance + 10, endx, endy);464 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));465 line.paint();466 break;467 case 24:468 zone = "EW ---> Z7B";469 line.clear();470 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);471 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, minTopDistance - 10);472 line.drawLine(sourceNodeX + sourceNodeWidth + 10, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);473 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);474 line.drawLine(targetNodeX - 10, endy, endx, endy);475 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));476 line.paint();477 break;478 case 31:479 zone = "SN ---> Z7B";480 line.clear();481 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);482 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);483 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10);484 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10, endx, endy - 10);485 line.drawLine(endx, endy - 10, endx, endy);486 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));487 line.paint();488 break;489 case 32:490 zone = "SE ---> Z7B";491 line.clear();492 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);493 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);494 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);495 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);496 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));497 line.paint();498 break;499 case 33:500 zone = "SS ---> Z7B";501 line.clear();502 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);503 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);504 line.drawLine(endx, maxBottomDistance + 10, endx, endy);505 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));506 line.paint();507 break;508 case 34:509 zone = "SW ---> Z7B";510 line.clear();511 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);512 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);513 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);514 line.drawLine(minLeftDistance - 10, endy, endx, endy);515 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));516 line.paint();517 break;518 case 41:519 zone = "WN ---> Z7B";520 line.clear();521 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);522 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10);523 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);524 line.drawLine(endx, targetNodeY - 10, endx, endy);525 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));526 line.paint();527 break;528 case 42:529 zone = "WE ---> Z7B";530 line.clear();531 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);532 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);533 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);534 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));535 line.paint();536 break;537 case 43:538 zone = "WS ---> Z7B";539 line.clear();540 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);541 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);542 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));543 line.paint();544 break;545 case 44:546 zone = "WW ---> Z7B";547 line.clear();548 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);549 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10);550 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY - 10, endx - 10, targetNodeY - 10);551 line.drawLine(endx - 10, targetNodeY - 10, endx - 10, endy);552 line.drawLine(endx - 10, endy, endx, endy);553 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));554 line.paint();555 break;556 }557558 } else {559 zone = "Z7B10";560 //line.clear();561 }562563 }564 } else // Bottom Left Corner565 {566 if (endy >= sourceNodeY + sourceNodeHeight) // z6, z5b567 {568 if ((endy <= sourceNodeY + sourceNodeHeight + 10) && (endx >= sourceNodeX)) {569 zone = "Z5B10";570 //line.clear();571 } else {572 if (endx <= sourceNodeX - 10) {573 zone = "Z6";574 switch (connectionType) {575 case 11:576 zone = "NN ---> Z6";577 line.clear();578 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);579 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);580 line.drawLine(endx, minTopDistance - 15, endx, endy);581 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));582 line.paint();583 break;584 case 12:585 zone = "NE ---> Z6";586 line.clear();587 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);588 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);589 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);590 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);591 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));592 line.paint();593 break;594 case 13:595 zone = "NS ---> Z6";596 line.clear();597 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);598 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10);599 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);600 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);601 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);602 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));603 line.paint();604605 break;606 case 14:607 zone = "NW ---> Z6";608 line.clear();609 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, minTopDistance - 10);610 line.drawLine(sourceNodeX + halfSourceNodeWidth, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);611 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);612 line.drawLine(targetNodeX - 10, endy, endx, endy);613 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));614 line.paint();615 break;616 case 21:617 zone = "EN ---> Z6";618 line.clear();619 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);620 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));621 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));622 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);623 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));624 line.paint();625 break;626 case 22:627 zone = "EE ---> Z6";628 line.clear();629 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);630 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);631 line.drawLine(maxRightDistance + 10, endy, endx, endy);632 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));633 line.paint();634 break;635 case 23:636 zone = "ES ---> Z6";637 line.clear();638 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);639 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);640 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);641 line.drawLine(endx, maxBottomDistance + 10, endx, endy);642 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));643 line.paint();644 break;645 case 24:646 zone = "EW ---> Z6";647 line.clear();648 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);649 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));650 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));651 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);652 line.drawLine(targetNodeX - 10, endy, endx, endy);653 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));654 line.paint();655 break;656 case 31:657 zone = "SN ---> Z6";658 line.clear();659 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));660 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));661 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);662 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));663 line.paint();664 break;665 case 32:666 zone = "SE ---> Z6";667 line.clear();668 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);669 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);670 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));671 line.paint();672 break;673 case 33:674 zone = "SS ---> Z6";675 line.clear();676 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);677 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);678 line.drawLine(endx, maxBottomDistance + 10, endx, endy);679 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));680 line.paint();681 break;682 case 34:683 zone = "SW ---> Z6";684 line.clear();685 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));686 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));687 line.drawLine(endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, endy);688 line.drawLine(endx - 10, endy, endx, endy);689 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));690 line.paint();691 break;692 case 41:693 zone = "WN ---> Z6";694 line.clear();695 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);696 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);697 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));698 line.paint();699 break;700 case 42:701 zone = "WE ---> Z6";702 line.clear();703 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);704 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);705 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);706 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));707 line.paint();708 break;709 case 43:710 zone = "WS ---> Z6";711 line.clear();712 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);713 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10);714 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10, endx, endy + 10);715 line.drawLine(endx, endy + 10, endx, endy);716 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));717 line.paint();718 break;719 case 44:720 zone = "WW ---> Z6";721 line.clear();722 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);723 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);724 line.drawLine(minLeftDistance - 10, endy, endx, endy);725 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));726 line.paint();727 break;728 }729730 } else {731 zone = "Z5B";732 switch (connectionType) {733 case 11:734 zone = "NN ---> Z5B";735 line.clear();736 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);737 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX - 10, sourceNodeY - 10);738 line.drawLine(sourceNodeX - 10, sourceNodeY - 10, sourceNodeX - 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));739 line.drawLine(sourceNodeX - 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));740 line.drawLine(endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);741 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));742 line.paint();743 break;744 case 12:745 zone = "NE ---> Z5B";746 line.clear();747 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);748 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, maxRightDistance + 10, minTopDistance - 10);749 line.drawLine(maxRightDistance + 10, minTopDistance - 10, maxRightDistance + 10, endy);750 line.drawLine(maxRightDistance + 10, endy, endx, endy);751 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));752 line.paint();753 break;754 case 13:755 zone = "NS ---> Z5B";756 line.clear();757 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);758 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);759 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, targetNodeY + targetNodeHeight + 10);760 line.drawLine(minLeftDistance - 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);761 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);762 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));763 line.paint();764 break;765 case 14:766 zone = "NW ---> Z5B";767 line.clear();768 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);769 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);770 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, endy);771 line.drawLine(minLeftDistance - 10, endy, endx, endy);772 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));773 line.paint();774 break;775 case 21:776 zone = "EN ---> Z5B";777 line.clear();778 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);779 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));780 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));781 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);782 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));783 line.paint();784 break;785 case 22:786 zone = "EE ---> Z5B";787 line.clear();788 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);789 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);790 line.drawLine(maxRightDistance + 10, endy, endx, endy);791 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));792 line.paint();793 break;794 case 23:795 zone = "ES ---> Z5B";796 line.clear();797 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);798 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);799 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);800 line.drawLine(endx, maxBottomDistance + 10, endx, endy);801 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));802 line.paint();803 break;804 case 24:805 zone = "EW ---> Z5B";806 line.clear();807 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);808 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));809 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));810 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);811 line.drawLine(targetNodeX - 10, endy, endx, endy);812 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));813 line.paint();814 break;815 case 31:816 zone = "SN ---> Z5B";817 line.clear();818 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));819 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));820 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);821 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));822 line.paint();823 break;824 case 32:825 zone = "SE ---> Z5B";826 line.clear();827 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);828 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);829 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));830 line.paint();831 break;832 case 33:833 zone = "SS ---> Z5B";834 line.clear();835 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));836 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));837 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy + 10);838 line.drawLine(targetNodeX - 10, endy + 10, endx, endy + 10);839 line.drawLine(endx, endy + 10, endx, endy);840 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));841 line.paint();842 break;843 case 34:844 zone = "SW ---> Z5B";845 line.clear();846 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));847 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));848 line.drawLine(endx - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx - 10, endy);849 line.drawLine(endx - 10, endy, endx, endy);850 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));851 line.paint();852 break;853 case 41:854 zone = "WN ---> Z5B";855 line.clear();856 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);857 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));858 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));859 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);860 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));861 line.paint();862 break;863 case 42:864 zone = "WE ---> Z5B";865 line.clear();866 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);867 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));868 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));869 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);870 line.drawLine(endx + 10, endy, endx, endy);871 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));872 line.paint();873 break;874 case 43:875 zone = "WS ---> Z5B";876 line.clear();877 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);878 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);879 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);880 line.drawLine(endx, maxBottomDistance + 10, endx, endy);881 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));882 line.paint();883 break;884 case 44:885 zone = "WW ---> Z5B";886 line.clear();887 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);888 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);889 line.drawLine(minLeftDistance - 10, endy, endx, endy);890 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));891 line.paint();892 break;893 }894895 }896 }897898 } else {899 if (endx <= sourceNodeX - 10) {900 zone = "Z7A";901 switch (connectionType) {902 case 11:903 zone = "NN ---> Z7A";904 line.clear();905 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);906 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);907 line.drawLine(endx, minTopDistance - 15, endx, endy);908 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));909 line.paint();910 break;911 case 12:912 zone = "NE ---> Z7A";913 line.clear();914 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);915 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);916 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);917 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);918 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));919 line.paint();920 break;921 case 13:922 zone = "NS ---> Z7A";923 line.clear();924 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);925 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10);926 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY - 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);927 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);928 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);929 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));930 line.paint();931 break;932 case 14:933 zone = "NW ---> Z7A";934 line.clear();935 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, minTopDistance - 10);936 line.drawLine(sourceNodeX + halfSourceNodeWidth, minTopDistance - 10, targetNodeX - 10, minTopDistance - 10);937 line.drawLine(targetNodeX - 10, minTopDistance - 10, targetNodeX - 10, endy);938 line.drawLine(targetNodeX - 10, endy, endx, endy);939 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));940 line.paint();941 break;942 case 21:943 zone = "EN ---> Z7A";944 line.clear();945 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);946 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);947 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);948 line.drawLine(endx, minTopDistance - 10, endx, endy);949 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));950 line.paint();951 break;952 case 22:953 zone = "EE ---> Z7A";954 line.clear();955 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);956 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10);957 line.drawLine(maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10, endx + 10, sourceNodeY + sourceNodeHeight + 10);958 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + 10, endx + 10, endy);959 line.drawLine(endx + 10, endy, endx, endy);960 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));961 line.paint();962 break;963 case 23:964 zone = "ES ---> Z7A";965 line.clear();966 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);967 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);968 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);969 line.drawLine(endx, maxBottomDistance + 10, endx, endy);970 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));971 line.paint();972 break;973 case 24:974 zone = "EW ---> Z7A";975 line.clear();976 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);977 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, maxBottomDistance + 10);978 line.drawLine(sourceNodeX + sourceNodeWidth + 10, maxBottomDistance + 10, targetNodeX - 10, maxBottomDistance + 10);979 line.drawLine(targetNodeX - 10, maxBottomDistance + 10, targetNodeX - 10, endy);980 line.drawLine(targetNodeX - 10, endy, endx, endy);981 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));982 line.paint();983 break;984 case 31:985 zone = "SN ---> Z7A";986 line.clear();987 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);988 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);989 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10);990 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy - 10, endx, endy - 10);991 line.drawLine(endx, endy - 10, endx, endy);992 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));993 line.paint();994 break;995 case 32:996 zone = "SE ---> Z7A";997 line.clear();998 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);999 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1000 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);1001 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);1002 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1003 line.paint(); break;1004 case 33:1005 zone = "SS ---> Z7A";1006 line.clear();1007 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1008 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1009 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1010 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1011 line.paint();1012 break;1013 case 34:1014 zone = "SW ---> Z7A";1015 line.clear();1016 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1017 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);1018 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);1019 line.drawLine(minLeftDistance - 10, endy, endx, endy);1020 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1021 line.paint();1022 break;1023 case 41:1024 zone = "WN ---> Z7A";1025 line.clear();1026 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1027 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1028 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1029 line.paint();1030 break;1031 case 42:1032 zone = "WE ---> Z7A";1033 line.clear();1034 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, (targetNodeX + targetNodeWidth) + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1035 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy);1036 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy, endx, endy);1037 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1038 line.paint();1039 break;1040 case 43:1041 zone = "WS ---> Z7A";1042 line.clear();1043 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1044 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10);1045 line.drawLine(sourceNodeX - Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), endy + 10, endx, endy + 10);1046 line.drawLine(endx, endy + 10, endx, endy);1047 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1048 line.paint();1049 break;1050 case 44:1051 zone = "WW ---> Z7A";1052 line.clear();1053 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1054 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1055 line.drawLine(targetNodeX + targetNodeWidth + Math.floor((sourceNodeX - (targetNodeX + targetNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx - 10, targetNodeY + targetNodeHeight + 10);1056 line.drawLine(endx - 10, targetNodeY + targetNodeHeight + 10, endx - 10, endy);1057 line.drawLine(endx - 10, endy, endx, endy);1058 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1059 line.paint();1060 break;1061 }10621063 } else {1064 zone = "Z7A10";1065 //line.clear();1066 }10671068 }10691070 }10711072 } else {1073 if (endy <= (sourceNodeY + halfSourceNodeHeight)) // Top Right Corner1074 {1075 if (endy <= sourceNodeY) // z1b, z21076 {1077 if (endy >= sourceNodeY - 10 && endx <= sourceNodeWidth) {1078 zone = "Z1B10";1079 //line.clear();1080 } else {1081 if (endx <= sourceNodeX + sourceNodeWidth) {1082 zone = "Z1B";1083 switch (connectionType) {1084 case 11:1085 zone = "NN ---> Z1B";1086 line.clear();1087 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);1088 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, maxRightDistance + 10, sourceNodeY - 10);1089 line.drawLine(maxRightDistance + 10, sourceNodeY - 10, maxRightDistance + 10, endy - 10);1090 line.drawLine(maxRightDistance + 10, endy - 10, endx, endy - 10);1091 line.drawLine(endx, endy - 10, endx, endy);1092 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1093 line.paint();1094 break;1095 case 12:1096 zone = "NE ---> Z1B";1097 line.clear();1098 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1099 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1100 line.drawLine(endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, endy);1101 line.drawLine(endx + 15, endy, endx, endy);1102 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1103 line.paint();1104 break;1105 case 13:1106 zone = "NS ---> Z1B";1107 line.clear();1108 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1109 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1110 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);1111 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1112 line.paint();1113 break;1114 case 14:1115 zone = "NW ---> Z1B";1116 line.clear();1117 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);1118 line.drawLine(sourceNodeX + halfSourceNodeWidth, endy, endx, endy);1119 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1120 line.paint();1121 break;1122 case 21:1123 zone = "EN ---> Z1B";1124 line.clear();1125 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1126 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, minTopDistance - 10);1127 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);1128 line.drawLine(endx, minTopDistance - 10, endx, endy);1129 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1130 line.paint();1131 break;1132 case 22:1133 zone = "EE ---> Z1B";1134 line.clear();1135 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1136 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1137 line.drawLine(maxRightDistance + 10, endy, endx, endy);1138 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1139 line.paint();1140 break;1141 case 23:1142 zone = "ES ---> Z1B";1143 line.clear();1144 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1145 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1146 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1147 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);1148 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1149 line.paint();1150 break;1151 case 24:1152 zone = "EW ---> Z1B";1153 line.clear();1154 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1155 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1156 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1157 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);1158 line.drawLine(targetNodeX - 10, endy, endx, endy);1159 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1160 line.paint();1161 break;1162 case 31:1163 zone = "SN ---> Z1B";1164 line.clear();1165 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1166 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10);1167 line.drawLine(maxRightDistance + 10, sourceNodeY + sourceNodeHeight + 10, maxRightDistance + 10, minTopDistance - 10);1168 line.drawLine(maxRightDistance + 10, minTopDistance - 10, endx, minTopDistance - 10);1169 line.drawLine(endx, minTopDistance - 10, endx, endy);1170 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1171 line.paint();1172 break;1173 case 32:1174 zone = "SE ---> Z1B";1175 line.clear();1176 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1177 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);1178 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);1179 line.drawLine(maxRightDistance + 10, endy, endx, endy);1180 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1181 line.paint();1182 break;1183 case 33:1184 zone = "SS ---> Z1B";1185 line.clear();1186 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1187 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + 10);1188 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + 10);1189 line.drawLine(sourceNodeX + sourceNodeWidth + 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1190 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1191 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1192 line.paint();1193 break;1194 case 34:1195 zone = "SW ---> Z1B";1196 line.clear();1197 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1198 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, minLeftDistance - 10, maxBottomDistance + 10);1199 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, minLeftDistance - 10, endy);1200 line.drawLine(minLeftDistance - 10, endy, endx, endy);1201 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1202 line.paint();1203 break;1204 case 41:1205 zone = "WN ---> Z1B";1206 line.clear();1207 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1208 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);1209 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);1210 line.drawLine(endx, minTopDistance - 10, endx, endy);1211 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1212 line.paint();1213 break;1214 case 42:1215 zone = "WE ---> Z1B";1216 line.clear();1217 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1218 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1219 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1220 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, endy);1221 line.drawLine(endx + 10, endy, endx, endy);1222 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1223 line.paint();1224 break;1225 case 43:1226 zone = "WS ---> Z1B";1227 line.clear();1228 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1229 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1230 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1231 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);1232 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1233 line.paint();1234 break;1235 case 44:1236 zone = "WW ---> Z1B";1237 line.clear();1238 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1239 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1240 line.drawLine(minLeftDistance - 10, endy, endx, endy);1241 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1242 line.paint();1243 break;1244 }12451246 } else {1247 zone = "Z2";1248 switch (connectionType) {1249 case 11:1250 zone = "NN ---> Z2";1251 line.clear();1252 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1253 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1254 line.drawLine(endx, minTopDistance - 15, endx, endy);1255 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1256 line.paint();1257 break;1258 case 12:1259 zone = "NE ---> Z2";1260 line.clear();1261 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1262 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1263 line.drawLine(endx + 15, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx + 15, endy);1264 line.drawLine(endx + 15, endy, endx, endy);1265 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1266 line.paint();1267 break;1268 case 13:1269 zone = "NS ---> Z2";1270 line.clear();1271 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1272 line.drawLine((sourceNodeX) + halfSourceNodeWidth, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)));1273 line.drawLine(endx, (sourceNodeY - Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2)), endx, endy);1274 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1275 line.paint();1276 break;1277 case 14:1278 zone = "NW ---> Z2";1279 line.clear();1280 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, endy);1281 line.drawLine(sourceNodeX + halfSourceNodeWidth, endy, endx, endy);1282 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1283 line.paint();1284 break;1285 case 21:1286 zone = "EN ---> Z2";1287 line.clear();1288 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1289 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10);1290 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10, endx, minTopDistance - 10);1291 line.drawLine(endx, minTopDistance - 10, endx, endy);1292 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1293 line.paint();1294 break;1295 case 22:1296 zone = "EE ---> Z2";1297 line.clear();1298 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1299 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1300 line.drawLine(maxRightDistance + 10, endy, endx, endy);1301 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1302 line.paint();1303 break;1304 case 23:1305 zone = "ES ---> Z2";1306 line.clear();1307 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1308 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1309 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1310 line.paint();1311 break;1312 case 24:1313 zone = "EW ---> Z2";1314 line.clear();1315 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1316 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1317 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1318 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1319 line.paint();1320 break;1321 case 31:1322 zone = "SN ---> Z2";1323 line.clear();1324 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1325 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1326 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);1327 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);1328 line.drawLine(endx, targetNodeY - 10, endx, endy);1329 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1330 line.paint();1331 break;1332 case 32:1333 zone = "SE ---> Z2";1334 line.clear();1335 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1336 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);1337 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);1338 line.drawLine(maxRightDistance + 10, endy, endx, endy);1339 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1340 line.paint();1341 break;1342 case 33:1343 zone = "SS ---> Z2";1344 line.clear();1345 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1346 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1347 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1348 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1349 line.paint();1350 break;1351 case 34:1352 zone = "SW ---> Z2";1353 line.clear();1354 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1355 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1356 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1357 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1358 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1359 line.paint();1360 break;1361 case 41:1362 zone = "WN ---> Z2";1363 line.clear();1364 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1365 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);1366 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);1367 line.drawLine(endx, minTopDistance - 10, endx, endy);1368 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1369 line.paint();1370 break;1371 case 42:1372 zone = "WE ---> Z2";1373 line.clear();1374 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1375 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1376 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1377 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx + 10, endy);1378 line.drawLine(endx + 10, endy, endx, endy);1379 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1380 line.paint();1381 break;1382 case 43:1383 zone = "WS ---> Z2";1384 line.clear();1385 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1386 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1387 line.drawLine(sourceNodeX - 10, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2));1388 line.drawLine(endx, targetNodeY + targetNodeHeight + Math.floor((sourceNodeY - (targetNodeY + targetNodeHeight)) / 2), endx, endy);1389 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1390 line.paint();1391 break;1392 case 44:1393 zone = "WW ---> Z2";1394 line.clear();1395 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1396 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1397 line.drawLine(minLeftDistance - 10, endy, endx, endy);1398 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1399 line.paint();1400 break;1401 }14021403 }1404 }14051406 } else {1407 if (endx <= sourceNodeX + sourceNodeWidth + 10) {1408 zone = "Z3A10";1409 //line.clear();1410 } else {1411 zone = "Z3A";1412 switch (connectionType) {1413 case 11:1414 zone = "NN ---> Z3A";1415 line.clear();1416 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1417 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1418 line.drawLine(endx, minTopDistance - 15, endx, endy);1419 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1420 line.paint();1421 break;1422 case 12:1423 zone = "NE ---> Z3A";1424 line.clear();1425 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1426 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);1427 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);1428 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);1429 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1430 line.paint();1431 break;1432 case 13:1433 zone = "NS ---> Z3A";1434 line.clear();1435 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1436 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1437 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1438 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1439 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1440 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1441 line.paint();1442 break;1443 case 14:1444 zone = "NW ---> Z3A";1445 line.clear();1446 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1447 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1448 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1449 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1450 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1451 line.paint();1452 break;1453 case 21:1454 zone = "EN ---> Z3A";1455 line.clear();1456 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1457 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10);1458 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), minTopDistance - 10, endx, minTopDistance - 10);1459 line.drawLine(endx, minTopDistance - 10, endx, endy);1460 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1461 line.paint();1462 break;1463 case 22:1464 zone = "EE ---> Z3A";1465 line.clear();1466 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1467 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);1468 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx + 10, targetNodeY - 10);1469 line.drawLine(endx + 10, targetNodeY - 10, endx + 10, endy);1470 line.drawLine(endx + 10, endy, endx, endy);1471 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1472 line.paint();1473 break;1474 case 23:1475 zone = "ES ---> Z3A";1476 line.clear();1477 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1478 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1479 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1480 line.paint();1481 break;1482 case 24:1483 zone = "EW ---> Z3A";1484 line.clear();1485 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1486 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1487 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1488 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1489 line.paint();1490 break;1491 case 31:1492 zone = "SN ---> Z3A";1493 line.clear();1494 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1495 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1496 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);1497 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);1498 line.drawLine(endx, targetNodeY - 10, endx, endy);1499 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1500 line.paint();1501 break;1502 case 32:1503 zone = "SE ---> Z3A";1504 line.clear();1505 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1506 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);1507 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);1508 line.drawLine(maxRightDistance + 10, endy, endx, endy);1509 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1510 line.paint();1511 break;1512 case 33:1513 zone = "SS ---> Z3A";1514 line.clear();1515 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1516 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1517 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1518 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1519 line.paint();1520 break;1521 case 34:1522 zone = "SW ---> Z3A";1523 line.clear();1524 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);1525 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);1526 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1527 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1528 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1529 line.paint();1530 break;1531 case 41:1532 zone = "WN ---> Z3A";1533 line.clear();1534 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1535 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);1536 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);1537 line.drawLine(endx, minTopDistance - 10, endx, endy);1538 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1539 line.paint();1540 break;1541 case 42:1542 zone = "WE ---> Z3A";1543 line.clear();1544 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1545 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, minTopDistance - 10);1546 line.drawLine(sourceNodeX - 10, minTopDistance - 10, maxRightDistance + 10, minTopDistance - 10);1547 line.drawLine(maxRightDistance + 10, minTopDistance - 10, maxRightDistance + 10, endy);1548 line.drawLine(maxRightDistance + 10, endy, endx, endy);1549 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1550 line.paint();1551 break;1552 case 43:1553 zone = "WS ---> Z3A";1554 line.clear();1555 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1556 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);1557 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1558 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1559 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1560 line.paint();1561 break;1562 case 44:1563 zone = "WW ---> Z3A";1564 line.clear();1565 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1566 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY - 10);1567 line.drawLine(sourceNodeX - 10, sourceNodeY - 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1568 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1569 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1570 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1571 line.paint();1572 break;1573 }15741575 }15761577 }15781579 } else // Bottom Right Corner1580 {1581 if (endy >= sourceNodeY + sourceNodeHeight) // z5a, z41582 {1583 if ((endy <= sourceNodeY + sourceNodeHeight + 10) && (endx <= sourceNodeX + sourceNodeWidth)) {1584 zone = "Z5A10";1585 //line.clear();1586 } else {1587 if (endx <= sourceNodeX + sourceNodeWidth) {1588 zone = "Z5A";1589 switch (connectionType) {1590 case 11:1591 zone = "NN ---> Z5A";1592 line.clear();1593 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10);1594 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + 10, sourceNodeY - 10);1595 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1596 line.drawLine(sourceNodeX + sourceNodeWidth + 10, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1597 line.drawLine(endx, (sourceNodeY + sourceNodeHeight) + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1598 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1599 line.paint();1600 break;1601 case 12:1602 zone = "NE ---> Z5A";1603 line.clear();1604 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1605 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, maxRightDistance + 10, minTopDistance - 10);1606 line.drawLine(maxRightDistance + 10, minTopDistance - 10, maxRightDistance + 10, endy);1607 line.drawLine(maxRightDistance + 10, endy, endx, endy);1608 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1609 line.paint();1610 break;1611 case 13:1612 zone = "NS ---> Z5A";1613 line.clear();1614 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1615 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, maxRightDistance + 10, sourceNodeY - 10);1616 line.drawLine(maxRightDistance + 10, sourceNodeY - 10, maxRightDistance + 10, targetNodeY + targetNodeHeight + 10);1617 line.drawLine(maxRightDistance + 10, targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1618 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1619 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1620 line.paint();1621 break;1622 case 14:1623 zone = "NW ---> Z5A";1624 line.clear();1625 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1626 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, minLeftDistance - 10, sourceNodeY - 10);1627 line.drawLine(minLeftDistance - 10, sourceNodeY - 10, minLeftDistance - 10, endy);1628 line.drawLine(minLeftDistance - 10, endy, endx, endy);1629 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1630 line.paint();1631 break;1632 case 21:1633 zone = "EN ---> Z5A";1634 line.clear();1635 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1636 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1637 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1638 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1639 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1640 line.paint();1641 break;1642 case 22:1643 zone = "EE ---> Z5A";1644 line.clear();1645 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1646 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1647 line.drawLine(maxRightDistance + 10, endy, endx, endy);1648 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1649 line.paint();1650 break;1651 case 23:1652 zone = "ES ---> Z5A";1653 line.clear();1654 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1655 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, maxBottomDistance + 10);1656 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1657 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1658 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1659 line.paint();1660 break;1661 case 24:1662 zone = "EW ---> Z5A";1663 line.clear();1664 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight);1665 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1666 line.drawLine(sourceNodeX + sourceNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1667 line.drawLine(targetNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX - 10, endy);1668 line.drawLine(targetNodeX - 10, endy, endx, endy);1669 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1670 line.paint();1671 break;1672 case 31:1673 zone = "SN ---> Z5A";1674 line.clear();1675 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1676 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1677 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1678 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1679 line.paint();1680 break;1681 case 32:1682 zone = "SE ---> Z5A";1683 line.clear();1684 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1685 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1686 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1687 line.drawLine(endx + 10, endy, endx, endy);1688 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1689 line.paint();1690 break;1691 case 33:1692 zone = "SS ---> Z5A";1693 line.clear();1694 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1695 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX + targetNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1696 line.drawLine(targetNodeX + targetNodeWidth + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), targetNodeX + targetNodeWidth + 10, endy + 10);1697 line.drawLine(targetNodeX + targetNodeWidth + 10, endy + 10, endx, endy + 10);1698 line.drawLine(endx, endy + 10, endx, endy);1699 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1700 line.paint();1701 break;1702 case 34:1703 zone = "SW ---> Z5A";1704 line.clear();1705 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);1706 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);1707 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1708 line.paint();1709 break;1710 case 41:1711 zone = "WN ---> Z5A";1712 line.clear();1713 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1714 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1715 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1716 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1717 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1718 line.paint();1719 break;1720 case 42:1721 zone = "WE ---> Z5A";1722 line.clear();1723 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1724 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1725 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1726 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1727 line.drawLine(endx + 10, endy, endx, endy);1728 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1729 line.paint();1730 break;1731 case 43:1732 zone = "WS ---> Z5A";1733 line.clear();1734 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1735 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);1736 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1737 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1738 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1739 line.paint();1740 break;1741 case 44:1742 zone = "WW ---> Z5A";1743 line.clear();1744 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1745 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1746 line.drawLine(minLeftDistance - 10, endy, endx, endy);1747 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1748 line.paint();1749 break;1750 }17511752 } else {1753 zone = "Z4";1754 switch (connectionType) {1755 case 11:1756 zone = "NN ---> Z4";1757 line.clear();1758 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1759 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1760 line.drawLine(endx, minTopDistance - 15, endx, endy);1761 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1762 line.paint();1763 break;1764 case 12:1765 zone = "NE ---> Z4";1766 line.clear();1767 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1768 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);1769 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);1770 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);1771 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1772 line.paint();1773 break;1774 case 13:1775 zone = "NS ---> Z4";1776 line.clear();1777 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1778 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1779 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1780 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1781 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1782 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1783 line.paint();1784 break;1785 case 14:1786 zone = "NW ---> Z4";1787 line.clear();1788 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1789 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1790 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1791 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1792 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1793 line.paint();1794 break;1795 case 21:1796 zone = "EN ---> Z4";1797 line.clear();1798 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1799 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1800 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1801 line.paint();1802 break;1803 case 22:1804 zone = "EE ---> Z4";1805 line.clear();1806 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight);1807 line.drawLine(maxRightDistance + 10, sourceNodeY + halfSourceNodeHeight, maxRightDistance + 10, endy);1808 line.drawLine(maxRightDistance + 10, endy, endx, endy);1809 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1810 line.paint();1811 break;1812 case 23:1813 zone = "ES ---> Z4";1814 line.clear();1815 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1816 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10);1817 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10, endx, endy + 10);1818 line.drawLine(endx, endy + 10, endx, endy);1819 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1820 line.paint();1821 break;1822 case 24:1823 zone = "EW ---> Z4";1824 line.clear();1825 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1826 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1827 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1828 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1829 line.paint();1830 break;1831 case 31:1832 zone = "SN ---> Z4";1833 line.clear();1834 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1835 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1836 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1837 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1838 line.paint();1839 break;1840 case 32:1841 zone = "SE ---> Z4";1842 line.clear();1843 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1844 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1845 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1846 line.drawLine(endx + 10, endy, endx, endy);1847 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1848 line.paint();1849 break;1850 case 33:1851 zone = "SS ---> Z4";1852 line.clear();1853 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);1854 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);1855 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1856 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1857 line.paint();1858 break;1859 case 34:1860 zone = "SW ---> Z4";1861 line.clear();1862 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, endy);1863 line.drawLine((sourceNodeX) + halfSourceNodeWidth, endy, endx, endy);1864 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1865 line.paint();1866 break;1867 case 41:1868 zone = "WN ---> Z4";1869 line.clear();1870 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1871 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1872 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1873 line.drawLine(endx, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx, endy);1874 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1875 line.paint();1876 break;1877 case 42:1878 zone = "WE ---> Z4";1879 line.clear();1880 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);1881 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1882 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2));1883 line.drawLine(endx + 10, sourceNodeY + sourceNodeHeight + Math.floor((targetNodeY - (sourceNodeY + sourceNodeHeight)) / 2), endx + 10, endy);1884 line.drawLine(endx + 10, endy, endx, endy);1885 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1886 line.paint();1887 break;1888 case 43:1889 zone = "WS ---> Z4";1890 line.clear();1891 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1892 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);1893 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);1894 line.drawLine(endx, maxBottomDistance + 10, endx, endy);1895 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1896 line.paint();1897 break;1898 case 44:1899 zone = "WW ---> Z4";1900 line.clear();1901 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);1902 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, endy);1903 line.drawLine(minLeftDistance - 10, endy, endx, endy);1904 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1905 line.paint();1906 break;1907 }19081909 }1910 }19111912 } else {1913 if (endx <= sourceNodeX + sourceNodeWidth + 10) {1914 zone = "Z3B10";1915 //line.clear();1916 } else {1917 zone = "Z3B";1918 switch (connectionType) {1919 case 11:1920 zone = "NN ---> Z3B";1921 line.clear();1922 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15);1923 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 15, endx, minTopDistance - 15);1924 line.drawLine(endx, minTopDistance - 15, endx, endy);1925 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1926 line.paint();1927 break;1928 case 12:1929 zone = "NE ---> Z3B";1930 line.clear();1931 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY, (sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10);1932 line.drawLine((sourceNodeX) + halfSourceNodeWidth, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, minTopDistance - 10);1933 line.drawLine(targetNodeX + targetNodeWidth + 10, minTopDistance - 10, targetNodeX + targetNodeWidth + 10, endy);1934 line.drawLine(targetNodeX + targetNodeWidth + 10, endy, endx, endy);1935 line.fillPolygon(new Array(endx, endx, endx - 5), new Array(endy - 5, endy + 5, endy));1936 line.paint();1937 break;1938 case 13:1939 zone = "NS ---> Z3B";1940 line.clear();1941 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1942 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1943 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1944 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx, targetNodeY + targetNodeHeight + 10);1945 line.drawLine(endx, targetNodeY + targetNodeHeight + 10, endx, endy);1946 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1947 line.paint();1948 break;1949 case 14:1950 zone = "NW ---> Z3B";1951 line.clear();1952 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY, sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10);1953 line.drawLine(sourceNodeX + halfSourceNodeWidth, sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10);1954 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY - 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1955 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1956 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1957 line.paint();1958 break;1959 case 21:1960 zone = "EN ---> Z3B";1961 line.clear();1962 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, endx, sourceNodeY + halfSourceNodeHeight);1963 line.drawLine(endx, sourceNodeY + halfSourceNodeHeight, endx, endy);1964 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));1965 line.paint();1966 break;1967 case 22:1968 zone = "EE ---> Z3B";1969 line.clear();1970 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1971 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10);1972 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY + targetNodeHeight + 10, endx + 10, targetNodeY + targetNodeHeight + 10);1973 line.drawLine(endx + 10, targetNodeY + targetNodeHeight + 10, endx + 10, endy);1974 line.drawLine(endx + 10, endy, endx, endy);1975 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));1976 line.paint();1977 break;1978 case 23:1979 zone = "ES ---> Z3B";1980 line.clear();1981 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1982 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10);1983 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy + 10, endx, endy + 10);1984 line.drawLine(endx, endy + 10, endx, endy);1985 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));1986 line.paint();1987 break;1988 case 24:1989 zone = "EW ---> Z3B";1990 line.clear();1991 line.drawLine(sourceNodeX + sourceNodeWidth, sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight);1992 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + halfSourceNodeHeight, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);1993 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);1994 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));1995 line.paint();19961997 break;1998 case 31:1999 zone = "SN ---> Z3B";2000 line.clear();2001 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 15, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);2002 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);2003 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10);2004 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), targetNodeY - 10, endx, targetNodeY - 10);2005 line.drawLine(endx, targetNodeY - 10, endx, endy);2006 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));2007 line.paint();2008 break;2009 case 32:2010 zone = "SE ---> Z3B";2011 line.clear();2012 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);2013 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);2014 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);2015 line.drawLine(maxRightDistance + 10, endy, endx, endy);2016 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));2017 line.paint();2018 break;2019 case 33:2020 zone = "SS ---> Z3B";2021 line.clear();2022 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10);2023 line.drawLine((sourceNodeX) + halfSourceNodeWidth, maxBottomDistance + 10, endx, maxBottomDistance + 10);2024 line.drawLine(endx, maxBottomDistance + 10, endx, endy);2025 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));2026 line.paint();2027 break;2028 case 34:2029 zone = "SW ---> Z3B";2030 line.clear();2031 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight, (sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10);2032 line.drawLine((sourceNodeX) + halfSourceNodeWidth, sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);2033 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);2034 line.drawLine(sourceNodeX + sourceNodeWidth + Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);2035 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));2036 line.paint();2037 break;2038 case 41:2039 zone = "WN ---> Z3B";2040 line.clear();2041 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);2042 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, minTopDistance - 10);2043 line.drawLine(minLeftDistance - 10, minTopDistance - 10, endx, minTopDistance - 10);2044 line.drawLine(endx, minTopDistance - 10, endx, endy);2045 line.fillPolygon(new Array(endx - 5, endx + 5, endx), new Array(endy, endy, endy + 5));2046 line.paint();2047 break;2048 case 42:2049 zone = "WE ---> Z3B";2050 line.clear();2051 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);2052 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, maxBottomDistance + 10);2053 line.drawLine(sourceNodeX - 10, maxBottomDistance + 10, maxRightDistance + 10, maxBottomDistance + 10);2054 line.drawLine(maxRightDistance + 10, maxBottomDistance + 10, maxRightDistance + 10, endy);2055 line.drawLine(maxRightDistance + 10, endy, endx, endy);2056 line.fillPolygon(new Array(endx + 5, endx + 5, endx), new Array(endy - 5, endy + 5, endy));2057 line.paint();2058 break;2059 case 43:2060 zone = "WS ---> Z3B";2061 line.clear();2062 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight);2063 line.drawLine(minLeftDistance - 10, sourceNodeY + halfSourceNodeHeight, minLeftDistance - 10, maxBottomDistance + 10);2064 line.drawLine(minLeftDistance - 10, maxBottomDistance + 10, endx, maxBottomDistance + 10);2065 line.drawLine(endx, maxBottomDistance + 10, endx, endy);2066 line.fillPolygon(new Array(endx, endx - 5, endx + 5), new Array(endy - 5, endy + 5, endy + 5));2067 line.paint();2068 break;2069 case 44:2070 zone = "WW ---> Z3B";2071 line.clear();2072 line.drawLine(sourceNodeX, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight);2073 line.drawLine(sourceNodeX - 10, sourceNodeY + halfSourceNodeHeight, sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10);2074 line.drawLine(sourceNodeX - 10, sourceNodeY + sourceNodeHeight + 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10);2075 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), sourceNodeY + sourceNodeHeight + 10, targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy);2076 line.drawLine(targetNodeX - Math.floor((targetNodeX - (sourceNodeX + sourceNodeWidth)) / 2), endy, endx, endy);2077 line.fillPolygon(new Array(endx, endx, endx + 5), new Array(endy - 5, endy + 5, endy));2078 line.paint();2079 break;2080 }2081 }2082 }2083 }2084 }2085}20862087function drawTempConnection(node, direction, port, canvasobj, line) {20882089 direction = node + "_" + direction;20902091 var startx;2092 var starty;2093 var endx = port.position().left + $("#" + node).position().left + $(canvasobj.getCanvas).scrollLeft();2094 var endy = port.position().top + $("#" + node).position().top + $(canvasobj.getCanvas).scrollTop();2095 var nodex = $("#" + node).position().left + $(canvasobj.getCanvas).scrollLeft();2096 var nodey = $("#" + node).position().top + $(canvasobj.getCanvas).scrollTop();2097 var nodeWidth = $("#" + node).width();2098 var nodeHeight = $("#" + node).height();2099 var halfNodeWidth = Math.floor(nodeWidth / 2);2100 var halfNodeHeight = Math.floor(nodeHeight / 2);2101 var zone;2102 var portNumber;21032104 if (direction.match(/_n$/)) {2105 startx = nodex + halfNodeWidth;2106 starty = nodey;2107 portNumber = 1;2108 } else if (direction.match(/_e$/)) {2109 startx = nodex + nodeWidth;2110 starty = nodey + halfNodeHeight;2111 portNumber = 2;2112 } else if (direction.match(/_s$/)) {2113 startx = nodex + halfNodeWidth;2114 starty = nodey + nodeHeight;2115 portNumber = 3;2116 } else if (direction.match(/_w$/)) {2117 startx = nodex;2118 starty = nodey + halfNodeHeight;2119 portNumber = 4;2120 }21212122212321242125 if (endx <= (nodex + halfNodeWidth)) {2126 if (endy <= (nodey + halfNodeHeight)) /* Top Left Corner*/ {2127 if (endy <= nodey) /* z8, z1a*/ {2128 if (endy >= nodey - 10 && endx > nodex) {2129 zone = "Z1A10";2130 line.clear();2131 } else {2132 if (endx <= nodex - 10) {2133 zone = "Z8";2134 switch (portNumber) {2135 case 1:2136 zone = "N ---> Z8";2137 line.clear();2138 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2139 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2140 line.paint();2141 break;2142 case 2:2143 zone = "E ---> Z8";2144 line.clear();2145 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2146 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2147 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2148 line.paint();2149 break;2150 case 3:2151 zone = "S ---> Z8";2152 line.clear();2153 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2154 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2155 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2156 line.paint();2157 break;2158 case 4:2159 zone = "W ---> Z8";2160 line.clear();2161 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2162 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2163 line.paint();2164 break;2165 }21662167 } else {2168 zone = "Z1A";2169 switch (portNumber) {2170 case 1:2171 zone = "N ---> Z1A";2172 line.clear();2173 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2174 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2175 line.paint();2176 break;2177 case 2:2178 zone = "E ---> Z1A";2179 line.clear();2180 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2181 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2182 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2183 line.paint();2184 break;2185 case 3:2186 zone = "S ---> Z1A";2187 line.clear();2188 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2189 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, nodex - 10, nodey + nodeHeight + 10);2190 line.drawLine(nodex - 10, nodey + nodeHeight + 10, nodex - 10, endy);2191 line.drawLine(nodex - 10, endy, endx, endy);2192 line.paint();2193 break;2194 case 4:2195 zone = "W ---> Z1A";2196 line.clear();2197 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2198 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2199 line.drawLine(nodex - 10, endy, endx, endy);2200 line.paint();2201 break;2202 }22032204 }2205 }22062207 } else {2208 if (endx <= nodex - 10) {2209 zone = "Z7B";2210 switch (portNumber) {2211 case 1:2212 zone = "N ---> Z7B";2213 line.clear();2214 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2215 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2216 line.drawLine(endx, nodey - 10, endx, endy);2217 line.paint();2218 break;2219 case 2:2220 zone = "E ---> Z7B";2221 line.clear();2222 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2223 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey - 10);2224 line.drawLine((nodex) + nodeWidth + 10, nodey - 10, endx, nodey - 10);2225 line.drawLine(endx, nodey - 10, endx, endy);2226 line.paint();2227 break;2228 case 3:2229 zone = "S ---> Z7B";2230 line.clear();2231 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2232 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2233 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2234 line.paint();2235 break;2236 case 4:2237 zone = "W ---> Z7B";2238 line.clear();2239 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2240 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2241 line.paint();2242 break;2243 }22442245 } else {2246 zone = "Z7B10";2247 line.clear();2248 }22492250 }2251 } else /* Bottom Left Corner*/ {2252 if (endy >= nodey + nodeHeight) /* z6, z5b*/ {2253 if ((endy <= nodey + nodeHeight + 10) && (endx >= nodex)) {2254 zone = "Z5B10";2255 line.clear();2256 } else {2257 if (endx <= nodex - 10) {2258 zone = "Z6";2259 switch (portNumber) {2260 case 1:2261 zone = "N ---> Z6";2262 line.clear();2263 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2264 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2265 line.drawLine(endx, nodey - 10, endx, endy - 10);2266 line.paint();2267 break;2268 case 2:2269 zone = "E ---> Z6";2270 line.clear();2271 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2272 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2273 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2274 line.paint();2275 break;2276 case 3:2277 zone = "S ---> Z6";2278 line.clear();2279 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2280 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2281 line.paint();2282 break;2283 case 4:2284 zone = "W ---> Z6";2285 line.clear();2286 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2287 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2288 line.paint();2289 break;2290 }22912292 } else {2293 zone = "Z5B";2294 switch (portNumber) {2295 case 1:2296 zone = "N ---> Z5B";2297 line.clear();2298 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2299 line.drawLine((nodex) + halfNodeWidth, nodey - 10, nodex - 20, nodey - 10);2300 line.drawLine(nodex - 20, nodey - 10, nodex - 20, endy);2301 line.drawLine(nodex - 20, endy, endx, endy);2302 line.paint();2303 break;2304 case 2:2305 zone = "E ---> Z5B";2306 line.clear();2307 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2308 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2309 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2310 line.paint();2311 break;2312 case 3:2313 zone = "S ---> Z5B";2314 line.clear();2315 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2316 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2317 line.paint();2318 break;2319 case 4:2320 zone = "W ---> Z5B";2321 line.clear();2322 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2323 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2324 line.drawLine(nodex - 10, endy, endx, endy);2325 line.paint();2326 break;2327 }23282329 }2330 }23312332 } else {2333 if (endx <= nodex - 10) {2334 /*zone="Z7A";*/2335 switch (portNumber) {2336 case 1:2337 zone = "N ---> Z7A";2338 line.clear();2339 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2340 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2341 line.drawLine(endx, nodey - 10, endx, endy);2342 line.paint();23432344 break;2345 case 2:2346 zone = "E ---> Z7A";2347 line.clear();2348 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2349 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + nodeHeight + 10);2350 line.drawLine((nodex) + nodeWidth + 10, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2351 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2352 line.paint();2353 break;2354 case 3:2355 zone = "S ---> Z7A";2356 line.clear();2357 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2358 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2359 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2360 line.paint();2361 break;2362 case 4:2363 zone = "W ---> Z7A";2364 line.clear();2365 line.drawLine(nodex, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2366 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2367 line.paint();23682369 break;2370 }23712372 } else {2373 zone = "Z7A10";2374 line.clear();2375 }23762377 }23782379 }23802381 } else {2382 if (endy <= (nodey + halfNodeHeight)) /* Top Right Corner*/ {2383 if (endy <= nodey) /* z1b, z2*/ {2384 if (endy >= nodey - 10 && endx <= nodeWidth) {2385 zone = "Z1B10";2386 line.clear();2387 } else {2388 if (endx <= nodex + nodeWidth) {2389 zone = "Z1B";2390 switch (portNumber) {2391 case 1:2392 zone = "N ---> Z1B";2393 line.clear();2394 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2395 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2396 line.paint();2397 break;2398 case 2:2399 zone = "E ---> Z1B";2400 line.clear();2401 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2402 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2403 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2404 line.paint();2405 break;2406 case 3:2407 zone = "S ---> Z1B";2408 line.clear();2409 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2410 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, nodex + nodeWidth + 10, nodey + nodeHeight + 10);2411 line.drawLine(nodex + nodeWidth + 10, nodey + nodeHeight + 10, nodex + nodeWidth + 10, endy);2412 line.drawLine(nodex + nodeWidth + 10, endy, endx, endy);2413 line.paint();2414 break;2415 case 4:2416 zone = "W ---> Z1B";2417 line.clear();2418 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2419 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2420 line.drawLine(nodex - 10, endy, endx, endy);2421 line.paint();2422 break;2423 }24242425 } else {2426 zone = "Z2";2427 switch (portNumber) {2428 case 1:2429 zone = "N ---> Z2";2430 line.clear();2431 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, endy);2432 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2433 line.paint();2434 break;2435 case 2:2436 zone = "E ---> Z2";2437 line.clear();2438 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2439 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2440 line.paint();2441 break;2442 case 3:2443 zone = "S ---> Z2";2444 line.clear();2445 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2446 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2447 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2448 line.paint();2449 break;2450 case 4:2451 zone = "W ---> Z2";2452 line.clear();2453 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2454 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2455 line.drawLine(nodex - 10, endy, endx, endy);2456 line.paint();2457 break;2458 }24592460 }2461 }24622463 } else {2464 if (endx <= nodex + nodeWidth + 10) {2465 zone = "Z3A10";2466 line.clear();2467 } else {2468 zone = "Z3A";2469 switch (portNumber) {2470 case 1:2471 zone = "N ---> Z3A";2472 line.clear();2473 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2474 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2475 line.drawLine(endx, nodey - 10, endx, endy);2476 line.paint();2477 break;2478 case 2:2479 zone = "E ---> Z3A";2480 line.clear();2481 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2482 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2483 line.paint();2484 break;2485 case 3:2486 zone = "S ---> Z3A";2487 line.clear();2488 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2489 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2490 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2491 line.paint();2492 break;2493 case 4:2494 zone = "W ---> Z3A";2495 line.clear();2496 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2497 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, nodey - 10);2498 line.drawLine(nodex - 10, nodey - 10, endx, nodey - 10);2499 line.drawLine(endx, nodey - 10, endx, endy);2500 line.paint();2501 break;2502 }25032504 }25052506 }25072508 } else /* Bottom Right Corner*/ {2509 if (endy >= nodey + nodeHeight) /* z5a, z4*/ {2510 if ((endy <= nodey + nodeHeight + 10) && (endx <= nodex + nodeWidth)) {2511 zone = "Z5A10";2512 line.clear();2513 } else {2514 if (endx <= nodex + nodeWidth) {2515 zone = "Z5A";2516 switch (portNumber) {2517 case 1:2518 zone = "N ---> Z5A";2519 line.clear();2520 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2521 line.drawLine((nodex) + halfNodeWidth, nodey - 10, nodex + nodeWidth + 10, nodey - 10);2522 line.drawLine(nodex + nodeWidth + 10, nodey - 10, nodex + nodeWidth + 10, endy);2523 line.drawLine(nodex + nodeWidth + 10, endy, endx, endy);2524 line.paint();2525 break;2526 case 2:2527 zone = "E ---> Z5A";2528 line.clear();2529 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, nodey + halfNodeHeight);2530 line.drawLine((nodex) + nodeWidth + 10, nodey + halfNodeHeight, (nodex) + nodeWidth + 10, endy);2531 line.drawLine((nodex) + nodeWidth + 10, endy, endx, endy);2532 line.paint();2533 break;2534 case 3:2535 zone = "S ---> Z5A";2536 line.clear();2537 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2538 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2539 line.paint();2540 break;2541 case 4:2542 zone = "W ---> Z5A";2543 line.clear();2544 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2545 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2546 line.drawLine(nodex - 10, endy, endx, endy);2547 line.paint();2548 break;2549 }25502551 } else {2552 zone = "Z4";2553 switch (portNumber) {2554 case 1:2555 zone = "N ---> Z4";2556 line.clear();2557 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2558 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2559 line.drawLine(endx, nodey - 10, endx, endy);2560 line.paint();2561 break;2562 case 2:2563 zone = "E ---> Z4";2564 line.clear();2565 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2566 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2567 line.paint();2568 break;2569 case 3:2570 zone = "S ---> Z4";2571 line.clear();2572 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, endy);2573 line.drawLine((nodex) + halfNodeWidth, endy, endx, endy);2574 line.paint();2575 break;2576 case 4:2577 zone = "W ---> Z4";2578 line.clear();2579 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2580 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, endy);2581 line.drawLine(nodex - 10, endy, endx, endy);2582 line.paint();2583 break;2584 }25852586 }2587 }25882589 } else {2590 if (endx <= nodex + nodeWidth + 10) {2591 zone = "Z3B10";2592 line.clear();2593 } else {2594 zone = "Z3B";2595 switch (portNumber) {2596 case 1:2597 zone = "N ---> Z3B";2598 line.clear();2599 line.drawLine((nodex) + halfNodeWidth, nodey, (nodex) + halfNodeWidth, nodey - 10);2600 line.drawLine((nodex) + halfNodeWidth, nodey - 10, endx, nodey - 10);2601 line.drawLine(endx, nodey - 10, endx, endy);2602 line.paint();2603 break;2604 case 2:2605 zone = "E ---> Z3B";2606 line.clear();2607 line.drawLine((nodex) + nodeWidth, nodey + halfNodeHeight, endx, nodey + halfNodeHeight);2608 line.drawLine(endx, nodey + halfNodeHeight, endx, endy);2609 line.paint();2610 break;2611 case 3:2612 zone = "S ---> Z3B";2613 line.clear();2614 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight, (nodex) + halfNodeWidth, nodey + nodeHeight + 10);2615 line.drawLine((nodex) + halfNodeWidth, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2616 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2617 line.paint();2618 break;2619 case 4:2620 zone = "W ---> Z3B";2621 line.clear();2622 line.drawLine(nodex, nodey + halfNodeHeight, nodex - 10, nodey + halfNodeHeight);2623 line.drawLine(nodex - 10, nodey + halfNodeHeight, nodex - 10, nodey + nodeHeight + 10);2624 line.drawLine(nodex - 10, nodey + nodeHeight + 10, endx, nodey + nodeHeight + 10);2625 line.drawLine(endx, nodey + nodeHeight + 10, endx, endy);2626 line.paint();2627 break;2628 }2629 }2630 }2631 }2632 }2633} ...

Full Screen

Full Screen

wargames.js

Source:wargames.js Github

copy

Full Screen

...20 picture.lineColor = color.FromArgb(251, 251, 251);21 picture.fillColor = color.FromArgb(124, 146, 124);22 picture.clear();23 picture.fillRectangle(boxX, boxY, boxW, boxH, color.FromArgb(51, 51, 51));24 picture.drawLine(boxX, boxY, boxX + boxW, boxY, color.FromArgb(18, 18, 13));25 picture.drawLine(boxX, boxY, boxX, boxY + boxH, color.FromArgb(41, 41, 32));26 picture.drawLine(boxX, boxY + boxH, boxX + boxW, boxY + boxH, color.FromArgb(162, 159, 112));27 picture.drawLine(boxX + boxW, boxY, boxX + boxW, boxY + boxH, color.FromArgb(18, 19, 16));28 drawW(textX, textY);29 textX += wWidth + 3;30 drawO(textX, textY);31 textX += oWidth + 3;32 drawP(textX, textY);33 textX += pWidth + 3;34 drawR(textX, textY);35 let title = prompt("LOGON:");36 application.Title = title;37}38else39{40 alert("STRANGE GAME");41 application.Quit();42}43function drawW(x, y)44{45 picture.drawLine(x , y , x , y + 3);46 picture.drawLine(x + 1 , y , x + 1 , y + 6);47 picture.drawLine(x + 2 , y + 4, x + 2 , y + 8);48 picture.drawLine(x + 3 , y + 6, x + 3 , y + 8);49 picture.drawLine(x + 4 , y + 1, x + 4 , y + 7);50 picture.drawLine(x + 5 , y , x + 5 , y + 4);51 picture.drawLine(x + 6 , y , x + 6 , y + 4);52 picture.drawLine(x + 7 , y + 1, x + 7 , y + 7);53 picture.drawLine(x + 8 , y + 6, x + 8 , y + 8);54 picture.drawLine(x + 9 , y + 4, x + 9 , y + 8);55 picture.drawLine(x + 10, y , x + 10, y + 6);56 picture.drawLine(x + 11, y , x + 11, y + 3);57}58function drawO(x, y)59{60 picture.drawLine(x, y + 3, x, y + 5);61 picture.drawLine(x + 1, y + 1, x + 1, y + 7);62 picture.drawLine(x + 2, y , x + 2, y + 8);63 picture.drawLine(x + 3, y , x + 6, y );64 picture.plot (x + 3, y + 1);65 picture.plot (x + 6, y + 1);66 picture.plot (x + 7, y + 7);67 picture.plot (x + 3, y + 7);68 picture.drawLine(x + 3, y + 8, x + 7, y + 8);69 picture.drawLine(x + 7, y , x + 7, y + 2);70 picture.drawLine(x + 8, y + 1, x + 8, y + 8);71 picture.drawLine(x + 9, y + 2, x + 9, y + 6);72 picture.drawLine(x + 4, y + 9, x + 6, y + 9);73}74function drawP(x, y)75{76 picture.drawLine(x , y , x , y + 8);77 picture.drawLine(x + 1, y , x + 1, y + 8);78 picture.drawLine(x + 2, y , x + 5, y );79 picture.drawLine(x + 2, y + 4, x + 5, y + 4);80 picture.drawLine(x + 2, y + 5, x + 5, y + 5);81 picture.plot (x + 5, y + 1);82 picture.drawLine(x + 6, y , x + 6, y + 4);83 picture.drawLine(x + 7, y + 1, x + 7, y + 3);84}85function drawR(x, y)86{87 picture.drawLine(x , y , x , y + 8);88 picture.drawLine(x + 1, y , x + 1, y + 8);89 picture.drawLine(x + 2, y , x + 5, y );90 picture.drawLine(x + 2, y + 4, x + 5, y + 4);91 picture.drawLine(x + 2, y + 5, x + 5, y + 5);92 picture.plot (x + 5, y + 1);93 picture.drawLine(x + 6, y , x + 6, y + 8);94 picture.plot (x + 5, y + 6);95 picture.drawLine(x + 7, y + 1, x + 7, y + 3);96 picture.drawLine(x + 7, y + 6, x + 7, y + 8);...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var strykerParent = require('stryker-parent');2var drawLine = strykerParent.drawLine;3var strykerChild = require('stryker-child');4var drawLine = strykerChild.drawLine;5var strykerGrandChild = require('stryker-grandchild');6var drawLine = strykerGrandChild.drawLine;7var strykerGreatGrandChild = require('stryker-greatgrandchild');8var drawLine = strykerGreatGrandChild.drawLine;9var strykerGreatGreatGrandChild = require('stryker-greatgreatgrandchild');10var drawLine = strykerGreatGreatGrandChild.drawLine;11var strykerGreatGreatGreatGrandChild = require('stryker-greatgreatgreatgrandchild');12var drawLine = strykerGreatGreatGreatGrandChild.drawLine;13var strykerGreatGreatGreatGreatGrandChild = require('stryker-greatgreatgreatgreatgrandchild');14var drawLine = strykerGreatGreatGreatGreatGrandChild.drawLine;15var strykerGreatGreatGreatGreatGreatGrandChild = require('stryker-greatgreatgreatgreatgreatgrandchild');16var drawLine = strykerGreatGreatGreatGreatGreatGrandChild.drawLine;17var strykerGreatGreatGreatGreatGreatGreatGrandChild = require('stryker-greatgreatgreatgreatgreatgreatgrandchild');18var drawLine = strykerGreatGreatGreatGreatGreatGreatGrandChild.drawLine;19var strykerGreatGreatGreatGreatGreatGreatGreatGrandChild = require('stryker-greatgreatgreatgreatgreatgreatgreatgrandchild');20var drawLine = strykerGreatGreatGreatGreatGreatGreatGreatGrandChild.drawLine;

Full Screen

Using AI Code Generation

copy

Full Screen

1var drawLine = require('stryker-parent').drawLine;2drawLine(10, 10, 100, 100);3var drawLine = require('stryker-parent').drawLine;4drawLine(10, 10, 100, 100);5var drawLine = require('stryker-parent').drawLine;6drawLine(10, 10, 100, 100);7var drawLine = require('stryker-parent').drawLine;8drawLine(10, 10, 100, 100);9var drawLine = require('stryker-parent').drawLine;10drawLine(10, 10, 100, 100);11var drawLine = require('stryker-parent').drawLine;12drawLine(10, 10, 100, 100);13var drawLine = require('stryker-parent').drawLine;14drawLine(10, 10, 100, 100);15var drawLine = require('stryker-parent').drawLine;16drawLine(10, 10, 100, 100);17var drawLine = require('stryker-parent').drawLine;18drawLine(10, 10, 100, 100);19var drawLine = require('stryker-parent').drawLine;20drawLine(10, 10, 100, 100);21var drawLine = require('stryker-parent').drawLine;22drawLine(10, 10, 100, 100);

Full Screen

Using AI Code Generation

copy

Full Screen

1drawLine(10, 10, 100, 100);2stryker-child.drawLine(10, 10, 100, 100);3drawLine(10, 10, 100, 100);4stryker-child.drawLine(10, 10, 100, 100);5drawLine(10, 10, 100, 100);6stryker-child.drawLine(10, 10, 100, 100);7drawLine(10, 10, 100, 100);8stryker-child.drawLine(10, 10, 100, 100);9drawLine(10, 10, 100, 100);10stryker-child.drawLine(10, 10, 100, 100);11drawLine(10, 10, 100, 100);12stryker-child.drawLine(10, 10, 100, 100);13drawLine(10, 10, 100, 100);14stryker-child.drawLine(10, 10, 100, 100);15drawLine(10, 10, 100, 100);16stryker-child.drawLine(10, 10, 100, 100);17drawLine(

Full Screen

Using AI Code Generation

copy

Full Screen

1var drawLine = require('stryker-parent').drawLine;2drawLine(0,0,10,10);3var drawLine = require('stryker-parent').drawLine;4drawLine(0,0,10,10);5var drawLine = require('stryker-parent').drawLine;6drawLine(0,0,10,10);7var drawLine = require('stryker-parent').drawLine;8drawLine(0,0,10,10);9var drawLine = require('stryker-parent').drawLine;10drawLine(0,0,10,10);11var drawLine = require('stryker-parent').drawLine;12drawLine(0,0,10,10);13var drawLine = require('stryker-parent').drawLine;14drawLine(0,0,10,10);15var drawLine = require('stryker-parent').drawLine;16drawLine(0,0,10,10);17var drawLine = require('stryker-parent').drawLine;18drawLine(0,0,10,10);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stryker-parent automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful