<@doc hierarchy="GMLDOM"> Aspect for drawing quadrilateral pins (c) SAP AG 2003-2006. All rights reserved. #INCLUDE[gml:defs.inc] Aspect QPin for GmlDrawing; inherit Pin; ////////////////////////////////////////////////////////////////////////////////////// // OVERRIDEN METHODS override virtual method paint() this.supercall(); this.conceal(); end override virtual method reposition(reroute) var px=0, py=0; this.rectNode.setAttribute('transform', 'translate('+px+' '+py+')'); this.symbNode.setAttribute('transform', 'translate('+px+' '+py+')'); if (reroute) { var L=this.lines; for (var k in L) L[k].reroute(); } end override virtual method getCP(otherpin) var shape=this.shape; if (otherpin) { var shape2=otherpin.shape; var cx1=shape.ox+shape.cx*shape.os; var cy1=shape.oy+shape.cy*shape.os; var cx2=shape2.ox+shape2.cx*shape2.os; var cy2=shape2.oy+shape2.cy*shape2.os; var ang = Math.atan2(cy2-cy1, cx2-cx1)*SVG.R2D, abs=Math.abs(ang); this.rot = (abs<=45 ? 0 : abs>=135 ? 2 : ang<0 ? 1 : 3); } else { this.rot = 0; } switch (this.rot) { case 0: var x=shape.x2, y=(shape.y1+shape.y2)/2; break; case 1: var x=(shape.x1+shape.x2)/2, y=shape.y1; break; case 2: var x=shape.x1, y=(shape.y1+shape.y2)/2; break; case 3: var x=(shape.x1+shape.x2)/2, y=shape.y2; break; } return { x: shape.ox+x*shape.os, y: shape.oy+y*shape.os, rot: this.rot, scale: shape.os }; end override virtual method expose() SVG.display(this.rectNode, true); SVG.display(this.symbNode, true); end override virtual method conceal() SVG.display(this.rectNode, false); SVG.display(this.symbNode, false); end