//>>built define("dojox/sketch/UnderlineAnnotation", ["./Annotation", "./Anchor"], function(){ var ta=dojox.sketch; ta.UnderlineAnnotation=function(figure, id){ ta.Annotation.call(this, figure, id); this.transform={dx:0, dy:0}; this.start={x:0, y:0}; this.property('label','#'); this.labelShape=null; this.lineShape=null; //this.anchors.start=new ta.Anchor(this, "start"); }; ta.UnderlineAnnotation.prototype=new ta.Annotation; var p=ta.UnderlineAnnotation.prototype; p.constructor=ta.UnderlineAnnotation; p.type=function(){ return 'Underline'; }; p.getType=function(){ return ta.UnderlineAnnotation; }; p.apply=function(obj){ if(!obj){ return; } if(obj.documentElement){ obj=obj.documentElement; } this.readCommonAttrs(obj); for(var i=0; i' //+ '' + '' + this.property('label') + '' + ''; }; //customize AnnotationTool to place a underlilne shape onmouseup, no need //to drag a box (like other shapes) dojo.declare("dojox.sketch.UnderlineAnnotationTool", ta.AnnotationTool, { onMouseDown: function(){}, onMouseUp: function(){ var f=this.figure; if(!f._start){ return; } //zero out end so that the clickover is shown at the right pos f._end={x:0,y:0}; this._create(f._start,{x:f._start.x+10,y:f._start.y+10}); }, onMouseMove: function(){} }); ta.Annotation.register("Underline", ta.UnderlineAnnotationTool); return dojox.sketch.UnderlineAnnotation; });