//>>built
define("dojox/gfx/Moveable","dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/_base/event dojo/topic dojo/touch dojo/dom-class dojo/_base/window ./Mover".split(" "),function(c,k,l,e,f,d,g,h,m){return k("dojox.gfx.Moveable",null,{constructor:function(a,b){this.shape=a;this.delay=b&&0<b.delay?b.delay:0;this.mover=b&&b.mover?b.mover:m;this.events=[this.shape.on(d.press,c.hitch(this,"onMouseDown"))]},destroy:function(){l.forEach(this.events,function(a){a.remove()});this.events=this.shape=null},
onMouseDown:function(a){this.delay?(this.events.push(this.shape.on(d.move,c.hitch(this,"onMouseMove")),this.shape.on(d.release,c.hitch(this,"onMouseUp"))),this._lastX=a.clientX,this._lastY=a.clientY):new this.mover(this.shape,a,this);e.stop(a)},onMouseMove:function(a){var b=a.clientY;if(Math.abs(a.clientX-this._lastX)>this.delay||Math.abs(b-this._lastY)>this.delay)this.onMouseUp(a),new this.mover(this.shape,a,this);e.stop(a)},onMouseUp:function(a){this.events.pop().remove()},onMoveStart:function(a){f.publish("/gfx/move/start",
a);g.add(h.body(),"dojoMove")},onMoveStop:function(a){f.publish("/gfx/move/stop",a);g.remove(h.body(),"dojoMove")},onFirstMove:function(a){},onMove:function(a,b){this.onMoving(a,b);this.shape.applyLeftTransform(b);this.onMoved(a,b)},onMoving:function(a,b){},onMoved:function(a,b){}})});