a:93:{s:9:"#provides";s:19:"dojox.sketch.Figure";s:9:"#resource";s:16:"sketch/Figure.js";s:9:"#requires";a:2:{i:0;a:2:{i:0;s:6:"common";i:1;s:9:"dojox.gfx";}i:1;a:2:{i:0;s:6:"common";i:1;s:22:"dojox.sketch.UndoStack";}}s:18:"dojox.sketch.tools";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:28:"e.target.parentNode.getValue";a:1:{s:7:"summary";s:0:"";}s:25:"dojox.sketch.registerTool";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"type";a:1:{s:4:"type";s:0:"";}s:2:"fn";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:56:" ta.registerTool=function(type, fn){ ta.tools[type]=fn; ";s:7:"summary";s:0:"";}s:19:"dojox.sketch.Figure";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"mixin";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:4582:" var self=this; this.annCounter=1; this.shapes=[]; this.image=null; this.imageSrc=null; this.size={ w:0, h:0 }; this.surface=null; this.group=null; this.node=null; this.zoomFactor=1; // multiplier for zooming. this.tools=null; // toolbar reference. this.obj={}; // lookup table for shapes. Not keen on this solution. dojo.mixin(this,mixin); // what is selected. this.selected=[]; this.hasSelections=function(){ return this.selected.length>0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj; }; this.clearSelections=function(){ for(var i=0; i-1){ self.selected.splice(idx,1,n); } }; // for the drag and drop handlers. this._c=null; // current shape this._ctr=null; // container measurements this._lp=null; // last position this._action=null; this._prevState=null; this._startPoint=null; // test to record a move. // if an object isn't selected and we're dragging anyways. this._ctool=null; // hard code it. this._start=null; this._end=null; this._absEnd=null; this._cshape=null; this._dblclick=function(e){ var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); } }; this._keydown=function(e){ var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); } }; // drag handlers. this._md=function(e){ var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; } }; this._mm=function(e){ if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } } }; this._mu=function(e){ if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null; }; this.initUndoStack();";s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:30:"dojox.sketch.Figure.annCounter";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:26:"dojox.sketch.Figure.shapes";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:25:"dojox.sketch.Figure.image";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:28:"dojox.sketch.Figure.imageSrc";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:24:"dojox.sketch.Figure.size";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:27:"dojox.sketch.Figure.surface";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:25:"dojox.sketch.Figure.group";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:24:"dojox.sketch.Figure.node";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:30:"dojox.sketch.Figure.zoomFactor";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:25:"dojox.sketch.Figure.tools";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:23:"dojox.sketch.Figure.obj";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:28:"dojox.sketch.Figure.selected";a:2:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:22:"dojox.sketch.Figure._c";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:24:"dojox.sketch.Figure._ctr";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:23:"dojox.sketch.Figure._lp";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"dojox.sketch.Figure._action";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:30:"dojox.sketch.Figure._prevState";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:31:"dojox.sketch.Figure._startPoint";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:26:"dojox.sketch.Figure._ctool";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:26:"dojox.sketch.Figure._start";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:24:"dojox.sketch.Figure._end";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"dojox.sketch.Figure._absEnd";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"dojox.sketch.Figure._cshape";a:3:{s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dojox.sketch.Figure.hasSelections";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:63:" this.hasSelections=function(){ return this.selected.length>0 ";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:30:"dojox.sketch.Figure.isSelected";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:113:" for(var i=0; i0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj;";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:35:"dojox.sketch.Figure.clearSelections";a:4:{s:4:"type";s:8:"Function";s:6:"source";s:129:" for(var i=0; i-1){ self.selected.splice(idx,1,n); }";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"summary";s:0:"";}s:29:"dojox.sketch.Figure._dblclick";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:72:" var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); }";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:28:"dojox.sketch.Figure._keydown";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:373:" var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); }";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:23:"dojox.sketch.Figure._md";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:853:" var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; }";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:23:"dojox.sketch.Figure._mm";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:662:" if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } }";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:23:"dojox.sketch.Figure._mu";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:276:" if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null;";s:8:"instance";s:19:"dojox.sketch.Figure";s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"e.target.parentNode.initUndoStack";a:3:{s:4:"type";s:8:"Function";s:6:"source";s:38:" this.history=new ta.UndoStack(this);";s:7:"summary";s:0:"";}s:41:"e.target.parentNode.initUndoStack.history";a:2:{s:8:"instance";s:33:"e.target.parentNode.initUndoStack";s:7:"summary";s:0:"";}s:27:"e.target.parentNode.setTool";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"t";a:1:{s:4:"type";s:20:"dojox.sketch._Plugin";}}s:6:"source";s:16:" this._ctool=t;";s:7:"summary";s:0:"";}s:34:"e.target.parentNode.setTool._ctool";a:3:{s:8:"instance";s:27:"e.target.parentNode.setTool";s:7:"private";b:1;s:7:"summary";s:0:"";}s:27:"e.target.parentNode._delete";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"arr";a:1:{s:4:"type";s:0:"";}s:6:"noundo";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:267:" for(var i=0; i0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj; }; this.clearSelections=function(){ for(var i=0; i-1){ self.selected.splice(idx,1,n); } }; // for the drag and drop handlers. this._c=null; // current shape this._ctr=null; // container measurements this._lp=null; // last position this._action=null; this._prevState=null; this._startPoint=null; // test to record a move. // if an object isn't selected and we're dragging anyways. this._ctool=null; // hard code it. this._start=null; this._end=null; this._absEnd=null; this._cshape=null; this._dblclick=function(e){ var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); } }; this._keydown=function(e){ var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); } }; // drag handlers. this._md=function(e){ var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; } }; this._mm=function(e){ if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } } }; this._mu=function(e){ if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null; }; this.initUndoStack(); }; var p=ta.Figure.prototype; p.initUndoStack=function(){ this.history=new ta.UndoStack(this); }; p.setTool=function(/*dojox.sketch._Plugin*/t){ this._ctool=t; }; p._delete=function(arr,noundo){ for(var i=0; i0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj; }; this.clearSelections=function(){ for(var i=0; i-1){ self.selected.splice(idx,1,n); } }; // for the drag and drop handlers. this._c=null; // current shape this._ctr=null; // container measurements this._lp=null; // last position this._action=null; this._prevState=null; this._startPoint=null; // test to record a move. // if an object isn't selected and we're dragging anyways. this._ctool=null; // hard code it. this._start=null; this._end=null; this._absEnd=null; this._cshape=null; this._dblclick=function(e){ var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); } }; this._keydown=function(e){ var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); } }; // drag handlers. this._md=function(e){ var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; } }; this._mm=function(e){ if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } } }; this._mu=function(e){ if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null; }; this.initUndoStack(); }; var p=ta.Figure.prototype; p.initUndoStack=function(){ this.history=new ta.UndoStack(this); }; p.setTool=function(/*dojox.sketch._Plugin*/t){ this._ctool=t; }; p._delete=function(arr,noundo){ for(var i=0; i0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj; }; this.clearSelections=function(){ for(var i=0; i-1){ self.selected.splice(idx,1,n); } }; // for the drag and drop handlers. this._c=null; // current shape this._ctr=null; // container measurements this._lp=null; // last position this._action=null; this._prevState=null; this._startPoint=null; // test to record a move. // if an object isn't selected and we're dragging anyways. this._ctool=null; // hard code it. this._start=null; this._end=null; this._absEnd=null; this._cshape=null; this._dblclick=function(e){ var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); } }; this._keydown=function(e){ var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); } }; // drag handlers. this._md=function(e){ var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; } }; this._mm=function(e){ if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } } }; this._mu=function(e){ if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null; }; this.initUndoStack(); }; var p=ta.Figure.prototype; p.initUndoStack=function(){ this.history=new ta.UndoStack(this); }; p.setTool=function(/*dojox.sketch._Plugin*/t){ this._ctool=t; }; p._delete=function(arr,noundo){ for(var i=0; i-1){ key=key.replace("-boundingBox",""); }else if(key&&key.indexOf("-labelShape")>-1){ key=key.replace("-labelShape",""); } return this.obj[key];";s:7:"private";b:1;s:7:"summary";s:0:"";}s:31:"e.target.parentNode._keyFromEvt";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:285:" var key=e.target.id+""; if(key.length==0){ // ancestor tree until you get to the end (meaning this.surface) var p=e.target.parentNode; var node=this.surface.getEventSource(); while(p && p.id.length==0 && p!=node){ p=p.parentNode; } key=p.id; } return key;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:28:"e.target.parentNode._fromEvt";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:40:" return this._get(this._keyFromEvt(e));";s:7:"private";b:1;s:7:"summary";s:0:"";}s:23:"e.target.parentNode.add";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:10:"annotation";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:143:" for(var i=0; i-1){ this.shapes.splice(idx, 1); } return annotation;";s:7:"summary";s:0:"";}s:23:"e.target.parentNode.get";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:2:"id";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:124:" for(var i=0; i0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj; }; this.clearSelections=function(){ for(var i=0; i-1){ self.selected.splice(idx,1,n); } }; // for the drag and drop handlers. this._c=null; // current shape this._ctr=null; // container measurements this._lp=null; // last position this._action=null; this._prevState=null; this._startPoint=null; // test to record a move. // if an object isn't selected and we're dragging anyways. this._ctool=null; // hard code it. this._start=null; this._end=null; this._absEnd=null; this._cshape=null; this._dblclick=function(e){ var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); } }; this._keydown=function(e){ var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); } }; // drag handlers. this._md=function(e){ var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; } }; this._mm=function(e){ if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } } }; this._mu=function(e){ if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null; }; this.initUndoStack(); }; var p=ta.Figure.prototype; p.initUndoStack=function(){ this.history=new ta.UndoStack(this); }; p.setTool=function(/*dojox.sketch._Plugin*/t){ this._ctool=t; }; p._delete=function(arr,noundo){ for(var i=0; i-1){ key=key.replace("-boundingBox",""); }else if(key&&key.indexOf("-labelShape")>-1){ key=key.replace("-labelShape",""); } return this.obj[key]; }; p._keyFromEvt=function(e){ var key=e.target.id+""; if(key.length==0){ // ancestor tree until you get to the end (meaning this.surface) var p=e.target.parentNode; var node=this.surface.getEventSource(); while(p && p.id.length==0 && p!=node){ p=p.parentNode; } key=p.id; } return key; }; p._fromEvt=function(e){ return this._get(this._keyFromEvt(e)); }; p.add=function(annotation){ for(var i=0; i-1){ this.shapes.splice(idx, 1); } return annotation; }; p.get=function(id){ for(var i=0; i0 }; this.isSelected=function(obj){ for(var i=0; i-1){ obj.setMode(ta.Annotation.Modes.View); self.selected.splice(idx,1); } return obj; }; this.clearSelections=function(){ for(var i=0; i-1){ self.selected.splice(idx,1,n); } }; // for the drag and drop handlers. this._c=null; // current shape this._ctr=null; // container measurements this._lp=null; // last position this._action=null; this._prevState=null; this._startPoint=null; // test to record a move. // if an object isn't selected and we're dragging anyways. this._ctool=null; // hard code it. this._start=null; this._end=null; this._absEnd=null; this._cshape=null; this._dblclick=function(e){ var o=self._fromEvt(e); if(o){ self.onDblClickShape(o,e); } }; this._keydown=function(e){ var prevent=false; if(e.ctrlKey){ if(e.keyCode===90){ //ctrl+z self.undo(); prevent = true; } else if(e.keyCode===89){ //ctrl+y self.redo(); prevent = true; } } if(e.keyCode===46 || e.keyCode===8){ //delete or backspace self._delete(self.selected); prevent = true; } if(prevent){ dojo.stopEvent(e); } }; // drag handlers. this._md=function(e){ var o=self._fromEvt(e); self._startPoint={ x:e.pageX, y:e.pageY }; // figure out the coordinates within the iframe self._ctr=dojo._abs(self.node); //var win = dijit.getDocumentWindow(self.node.ownerDocument); //var scroll=dojo.withGlobal(win,dojo._docScroll); self._ctr={x:self._ctr.x, y:self._ctr.y}; //-scroll.x -scroll.y var X=e.clientX-self._ctr.x, Y=e.clientY-self._ctr.y; self._lp={ x:X, y:Y }; // capture it separately self._start={ x:X, y:Y }; self._end={ x:X, y:Y }; self._absEnd={ x:X, y:Y }; if(!o){ self.clearSelections(); self._ctool.onMouseDown(e); }else{ if(o.type && o.type()!="Anchor"){ if(!self.isSelected(o)){ self.select(o); self._sameShapeSelected=false; }else{ self._sameShapeSelected=true; } } o.beginEdit(); self._c=o; } }; this._mm=function(e){ if(!self._ctr){ return; } var x=e.clientX-self._ctr.x; var y=e.clientY-self._ctr.y; var dx=x-self._lp.x; var dy=y-self._lp.y; self._absEnd={x:x, y:y}; if(self._c){ //self._c.doChange({dx:dx, dy:dy}); self._c.setBinding({dx:dx/self.zoomFactor, dy:dy/self.zoomFactor}); self._lp={x:x, y:y}; } else { self._end={x:dx, y:dy}; var rect={ x:Math.min(self._start.x,self._absEnd.x), y:Math.min(self._start.y,self._absEnd.y), width:Math.abs(self._start.x-self._absEnd.x), height:Math.abs(self._start.y-self._absEnd.y) } if(rect.width && rect.height){ self._ctool.onMouseMove(e,rect); } } }; this._mu=function(e){ if(self._c){ // record the event. self._c.endEdit(); }else{ self._ctool.onMouseUp(e); } // clear the stuff out. self._c=self._ctr=self._lp=self._action=self._prevState=self._startPoint=null; self._cshape=self._start=self._end=self._absEnd=null; }; this.initUndoStack(); }; var p=ta.Figure.prototype; p.initUndoStack=function(){ this.history=new ta.UndoStack(this); }; p.setTool=function(/*dojox.sketch._Plugin*/t){ this._ctool=t; }; p._delete=function(arr,noundo){ for(var i=0; i-1){ key=key.replace("-boundingBox",""); }else if(key&&key.indexOf("-labelShape")>-1){ key=key.replace("-labelShape",""); } return this.obj[key]; }; p._keyFromEvt=function(e){ var key=e.target.id+""; if(key.length==0){ // ancestor tree until you get to the end (meaning this.surface) var p=e.target.parentNode; var node=this.surface.getEventSource(); while(p && p.id.length==0 && p!=node){ p=p.parentNode; } key=p.id; } return key; }; p._fromEvt=function(e){ return this._get(this._keyFromEvt(e)); }; p.add=function(annotation){ for(var i=0; i-1){ this.shapes.splice(idx, 1); } return annotation; }; p.get=function(id){ for(var i=0; i' + '' + ''; for(var i=0; i