//>>built
define("dojox/sketch/Anchor",["dojo/_base/kernel","dojo/_base/lang","../gfx"],function(g){g.getObject("sketch",!0,dojox);dojox.sketch.Anchor=function(a,b,f){var h=this,e=null;this.type=function(){return"Anchor"};this.annotation=a;this.id=b;this._key="anchor-"+dojox.sketch.Anchor.count++;this.shape=null;this.isControl=null!=f?f:!0;this.beginEdit=function(){this.annotation.beginEdit(dojox.sketch.CommandTypes.Modify)};this.endEdit=function(){this.annotation.endEdit()};this.zoom=function(c){if(this.shape){var d=
Math.floor(4/c);c="vml"==dojox.gfx.renderer?1:1/c;this.shape.setShape({x:a[b].x-d,y:a[b].y-d,width:2*d,height:2*d}).setStroke({color:"black",width:c})}};this.setBinding=function(c){a[b]={x:a[b].x+c.dx,y:a[b].y+c.dy};a.draw();a.drawBBox()};this.setUndo=function(){a.setUndo()};this.enable=function(){a.shape&&(a.figure._add(this),e={x:a[b].x-4,y:a[b].y-4,width:8,height:8},this.shape=a.shape.createRect(e).setFill([255,255,255,.35]),this.shape.getEventSource().setAttribute("id",h._key),this.shape.getEventSource().setAttribute("shape-rendering",
"crispEdges"),this.zoom(a.figure.zoomFactor))};this.disable=function(){a.figure._remove(this);a.shape&&a.shape.remove(this.shape);e=this.shape=null}};dojox.sketch.Anchor.count=0;return dojox.sketch.Anchor});