a:25:{s:9:"#provides";s:32:"dojox.sketch.UnderlineAnnotation";s:9:"#resource";s:29:"sketch/UnderlineAnnotation.js";s:9:"#requires";a:2:{i:0;a:2:{i:0;s:6:"common";i:1;s:23:"dojox.sketch.Annotation";}i:1;a:2:{i:0;s:6:"common";i:1;s:19:"dojox.sketch.Anchor";}}s:42:"dojox.sketch.UnderlineAnnotation.prototype";a:1:{s:7:"summary";s:0:"";}s:54:"dojox.sketch.UnderlineAnnotation.prototype.constructor";a:1:{s:7:"summary";s:0:"";}s:32:"dojox.sketch.UnderlineAnnotation";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:6:"figure";a:1:{s:4:"type";s:0:"";}s:2:"id";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:225:"		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");";s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:42:"dojox.sketch.UnderlineAnnotation.transform";a:2:{s:8:"instance";s:32:"dojox.sketch.UnderlineAnnotation";s:7:"summary";s:0:"";}s:38:"dojox.sketch.UnderlineAnnotation.start";a:2:{s:8:"instance";s:32:"dojox.sketch.UnderlineAnnotation";s:7:"summary";s:0:"";}s:43:"dojox.sketch.UnderlineAnnotation.labelShape";a:2:{s:8:"instance";s:32:"dojox.sketch.UnderlineAnnotation";s:7:"summary";s:0:"";}s:42:"dojox.sketch.UnderlineAnnotation.lineShape";a:2:{s:8:"instance";s:32:"dojox.sketch.UnderlineAnnotation";s:7:"summary";s:0:"";}s:27:"ta.UnderlineAnnotation.type";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:40:"	p.type=function(){ return 'Underline'; ";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:30:"ta.UnderlineAnnotation.getType";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:54:"	p.getType=function(){ return ta.UnderlineAnnotation; ";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:28:"ta.UnderlineAnnotation.apply";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"obj";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:865:"		if(!obj){ return; }
		if(obj.documentElement){ obj=obj.documentElement; }
		this.readCommonAttrs(obj);

		
		for(var i=0; i<obj.childNodes.length; i++){
			var c=obj.childNodes[i];
			if(c.localName=="text"){
				this.property('label',c.childNodes[0].nodeValue);
				var style=c.getAttribute('style');
				var m=style.match(/fill:([^;]+);/);
				if(m){
					var stroke=this.property('stroke');
					stroke.collor=m[1];
					this.property('stroke',stroke);
					this.property('fill',stroke.collor);
				}
			}/*else if(c.localName=="line"){
				var stroke=this.property('stroke');
				var style=c.getAttribute('style');
				var m=style.match(/stroke:([^;]+);/)[1];
				if(m){
					stroke.color=m;
					this.property('fill',m);
				}
				m=style.match(/stroke-width:([^;]+);/)[1];
				if(m){
					stroke.width=m;
				}
				this.property('stroke',stroke);
			}*/
		}";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:33:"ta.UnderlineAnnotation.initialize";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"obj";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:2535:"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<obj.childNodes.length; i++){
			var c=obj.childNodes[i];
			if(c.localName=="text"){
				this.property('label',c.childNodes[0].nodeValue);
				var style=c.getAttribute('style');
				var m=style.match(/fill:([^;]+);/);
				if(m){
					var stroke=this.property('stroke');
					stroke.collor=m[1];
					this.property('stroke',stroke);
					this.property('fill',stroke.collor);
				}
			}/*else if(c.localName=="line"){
				var stroke=this.property('stroke');
				var style=c.getAttribute('style');
				var m=style.match(/stroke:([^;]+);/)[1];
				if(m){
					stroke.color=m;
					this.property('fill',m);
				}
				m=style.match(/stroke-width:([^;]+);/)[1];
				if(m){
					stroke.width=m;
				}
				this.property('stroke',stroke);
			}*/
		}
	};

	
	p.initialize=function(obj){
		//var font=(ta.Annotation.labelFont)?ta.Annotation.labelFont:{family:"Times", size:"16px"};
		this.apply(obj);


		//	create either from scratch or based on the passed node
		this.shape=this.figure.group.createGroup();
		this.shape.getEventSource().setAttribute("id", this.id);
		//if(this.transform.dx || this.transform.dy){ this.shape.setTransform(this.transform); }


		this.labelShape=this.shape.createText({
				x:0, 
				y:0, 
				text:this.property('label'), 
				decoration:"underline",
				align:"start"
			})
			//.setFont(font)
			//.setFill(this.property('fill'));
		this.labelShape.getEventSource().setAttribute('id',this.id+"-labelShape");


		this.lineShape=this.shape.createLine({ 
				x1:1, 
				x2:this.labelShape.getTextWidth(), 
				y1:2, 
				y2:2 
			})
			//.setStroke({ color:this.property('fill'), width:1 });
		this.lineShape.getEventSource().setAttribute("shape-rendering","crispEdges");
		this.draw();";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:4:"this";}}s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:28:"ta.UnderlineAnnotation.shape";a:2:{s:8:"instance";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:33:"ta.UnderlineAnnotation.labelShape";a:2:{s:8:"instance";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:32:"ta.UnderlineAnnotation.lineShape";a:2:{s:8:"instance";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:30:"ta.UnderlineAnnotation.destroy";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:193:"		if(!this.shape){ return; }
		this.shape.remove(this.labelShape);
		this.shape.remove(this.lineShape);
		this.figure.group.remove(this.shape);
		this.shape=this.lineShape=this.labelShape=null;";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:30:"ta.UnderlineAnnotation.getBBox";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:125:"		var b=this.getTextBox();
		var z=this.figure.zoomFactor;


		return { x:0, y:(b.h*-1+4)/z, width:(b.w+2)/z, height:b.h/z };";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:27:"ta.UnderlineAnnotation.draw";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"obj";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:182:"		this.apply(obj);
		this.shape.setTransform(this.transform);
		this.labelShape.setShape({ x:0, y:0, text:this.property('label') })
			.setFill(this.property('fill'));
		this.zoom();";s:6:"chains";a:1:{s:4:"call";a:1:{i:0;s:4:"this";}}s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:27:"ta.UnderlineAnnotation.zoom";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"pct";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:505:"		if(this.labelShape){
			pct = pct || this.figure.zoomFactor;
			var textwidthadj=dojox.gfx.renderer=='vml'?0:2/pct;
			ta.Annotation.prototype.zoom.call(this,pct);
			pct = dojox.gfx.renderer=='vml'?1:pct;
			this.lineShape.setShape({ x1:0, x2:this.getBBox().width-textwidthadj, y1:2, y2:2 })
				.setStroke({ color:this.property('fill'), width:1/pct });
			if(this.mode==ta.Annotation.Modes.Edit){
				this.drawBBox(); //the bbox is dependent on the size of the text, so need to update it here
			}
		}";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:27:"ta.UnderlineAnnotation.mode";a:2:{s:8:"instance";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:32:"ta.UnderlineAnnotation.serialize";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:386:"		var s=this.property('stroke');
		return '<g '+this.writeCommonAttrs()+'>'
			//+ '<line x1="1" x2="'+this.labelShape.getTextWidth()+1+'" y1="5" y2="5" style="stroke:'+s.color+';stroke-width:'+s.width+';" />'
			+ '<text style="fill:'+this.property('fill')+';" font-weight="bold" text-decoration="underline" '
			+ 'x="0" y="0">'
			+ this.property('label')
			+ '</text>'
			+ '</g>';";s:9:"prototype";s:22:"ta.UnderlineAnnotation";s:7:"summary";s:0:"";}s:12:"dojox.sketch";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}