/* Copyright (c) 2004-2012, 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.UnderlineAnnotation"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojox.sketch.UnderlineAnnotation"] = true; dojo.provide("dojox.sketch.UnderlineAnnotation"); dojo.require("dojox.sketch.Annotation"); dojo.require("dojox.sketch.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); })(); }