+
+ this.isMouseDown = false;
+ this.mouseDownPosition = new Point2D(0, 0);
+ this.lastMousePosition = new Point2D(0, 0);
+ this.canvas.onmousemove = function (e){
+ if(that.isMouseDown){
+ if(!e){
+ //for IE
+ e = window.event;
+ }
+ that.lastMousePosition = that.getMousePositionOnElement(e);
+ }
+ };
+ this.canvas.onmousedown = function (e){
+ if(!e){
+ //for IE
+ e = window.event;
+ }
+ that.lastMousePosition = that.getMousePositionOnElement(e);
+ that.mouseDownPosition = that.lastMousePosition;
+ var p = that.convertPointToGraphLayerFromCanvasLayerP(that.lastMousePosition);
+ console.log(p.x + "," + p.y);
+ var node = that.getNodeAtPointP(p);
+ if(node){
+ node.isSelected = true;
+ }
+ that.isMouseDown = true;
+ };
+ this.canvas.onmouseup = function (e){
+ that.isMouseDown = false;
+ };