/*
	Copyright (c) 2004-2011, 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
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.drawing.annotations.Label"],["require","dojox.drawing.stencil.Text"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.drawing.annotations.Label"]){_4._hasResource["dojox.drawing.annotations.Label"]=true;_4.provide("dojox.drawing.annotations.Label");_4.require("dojox.drawing.stencil.Text");_6.drawing.annotations.Label=_6.drawing.util.oo.declare(_6.drawing.stencil.Text,function(_7){this.master=_7.stencil;this.labelPosition=_7.labelPosition||"BR";if(_4.isFunction(this.labelPosition)){this.setLabel=this.setLabelCustom;}this.setLabel(_7.text||"");this.connect(this.master,"onTransform",this,"setLabel");this.connect(this.master,"destroy",this,"destroy");if(this.style.labelSameColor){this.connect(this.master,"attr",this,"beforeAttr");}},{_align:"start",drawingType:"label",setLabelCustom:function(_8){var d=_4.hitch(this.master,this.labelPosition)();this.setData({x:d.x,y:d.y,width:d.w||this.style.text.minWidth,height:d.h||this._lineHeight});if(_8&&!_8.split){_8=this.getText();}this.render(this.typesetter(_8));},setLabel:function(_9){var x,y,_a=this.master.getBounds();if(/B/.test(this.labelPosition)){y=_a.y2-this._lineHeight;}else{y=_a.y1;}if(/R/.test(this.labelPosition)){x=_a.x2;}else{y=_a.y1;this._align="end";}if(!this.labelWidth||(_9&&_9.split&&_9!=this.getText())){this.setData({x:x,y:y,height:this._lineHeight,width:this.style.text.minWidth});this.labelWidth=this.style.text.minWidth;this.render(this.typesetter(_9));}else{this.setData({x:x,y:y,height:this.data.height,width:this.data.width});this.render();}},beforeAttr:function(_b,_c){if(_c!==undefined){var k=_b;_b={};_b[k]=_c;}delete _b.x;delete _b.y;delete _b.width;delete _b.height;this.attr(_b);!this.created&&this.render();}});}}};});