/* Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.sketch.LeadAnnotation"]){dojo._hasResource["dojox.sketch.LeadAnnotation"]=true;dojo.provide("dojox.sketch.LeadAnnotation");dojo.require("dojox.sketch.Annotation");dojo.require("dojox.sketch.Anchor");(function(){var ta=dojox.sketch;ta.LeadAnnotation=function(_1,id){ta.Annotation.call(this,_1,id);this.transform={dx:0,dy:0};this.start={x:0,y:0};this.control={x:100,y:-50};this.end={x:200,y:0};this.textPosition={x:0,y:0};this.textOffset=4;this.textYOffset=10;this.pathShape=null;this.labelShape=null;this.anchors.start=new ta.Anchor(this,"start");this.anchors.control=new ta.Anchor(this,"control");this.anchors.end=new ta.Anchor(this,"end");};ta.LeadAnnotation.prototype=new ta.Annotation;var p=ta.LeadAnnotation.prototype;p.constructor=ta.LeadAnnotation;p.type=function(){return "Lead";};p.getType=function(){return ta.LeadAnnotation;};p._pos=function(){var _2=this.textOffset,x=0,y=0;var _3=this.calculate.slope(this.control,this.end);this.textAlign="middle";if(Math.abs(_3)>=1){x=this.end.x+this.calculate.dx(this.control,this.end,_2);if(this.control.y>this.end.y){y=this.end.y-_2;}else{y=this.end.y+_2+this.textYOffset;}}else{if(_3==0){x=this.end.x+_2;y=this.end.y+this.textYOffset;}else{if(this.start.x>this.end.x){x=this.end.x-_2;this.textAlign="end";}else{x=this.end.x+_2;this.textAlign="start";}if(this.start.y"+""+""+this.property("label")+""+"";};ta.Annotation.register("Lead");})();}