this.sendToBack(); this.setAttribute('origWidth', this.width); this.setAttribute('origHeight', this.height); /* * From now on, the devview will keep references to all created nodes and edges. */ this.nodes = new Array(); this.edges = new Array(); if (this.selectedobj) this.selectedobj.unhighlight(); this.selectedobj.highlight(); this.setAttribute('width', 5000/zoomMag); this.setAttribute('height', 3000/zoomMag); //this.setAttribute('x', ((this.xPercentage*this.width)+parent.width/2)); //this.setAttribute('y', ((this.yPercentage*this.height)+parent.height/2)); this.setAttribute('x', this.xPercentage*this.width); this.setAttribute('y', this.yPercentage*this.height); if (this.x >= 0){ this.setAttribute('x', 0); } if (this.y >= 0){ this.setAttribute('y',0); } if ((parent.width-this.width) >= this.x){ this.setAttribute('x', parent.width - this.width); } if ((parent.height-this.height) >= this.y){ this.setAttribute('y', parent.height - this.height); } //this.setAttribute("xPercentage" , (this.x - (parent.width/2))/this.width); this.setAttribute("xPercentage" , this.x/this.width); //this.setAttribute("yPercentage" , (this.y - (parent.height/2))/this.height); this.setAttribute("yPercentage" , this.y/this.height); //The +10 offset is so that the newly created edge does not intercept mouse clicks if (parent.mousex >= 0) { setX(parent.mousex + 10); } if (parent.mousey >= 0) { setY(parent.mousey + 10); } //Debug.write("current mode is", this.modeFlag); switch (modeFlag) { case "ADD_CONNECTOR": LzCursor.setCursorGlobal('concursor'); break; default: //is there an edge that is following the cursor? if (this.followingCon != null) { this.followingCon.destroy(); Debug.write("follower destroyed"); } LzCursor.restoreCursor(); break; } //when we click on the development view somewhere outside an object //unhighlight the currently selected object, if any if (this.selectedobj != null) { // Send deselect event to parent this.ondeselectedobj.sendEvent(); this.selectedobj.unhighlight(); this.setAttribute('selectedobj', null); } //also release the modeflag this.setAttribute('modeFlag', 'NONE'); Debug.write("dview clicked"); obj.destroy(); //create an attributes dictionary var offset = 0; //if this is the first node. We want the first node not get covered by the leftp if (this.nodes.length == 0) { offset = 200; } var attr = {x:this.coord+offset, y:this.coord}; switch (nodeShapes) { case 'box': var nc = new box(this, attr); break; case 'fancybox': var nc = new fancybox(this, attr); break; case 'roundrectnode': var nc = new roundrectnode(this, attr); break; default: setAttribute(nodeShapes, 'circle'); var nc= new circle(this, attr); break; } //maintain a reference to the just created node this.nodes.push(nc); this.setAttribute('coord', this.coord+40); //send notification that a node was added. Note that we're sending the model part of the node along with the event this.nodeAdded.sendEvent(nc.modelnode); //return a reference to the just added node. return nc; 0) { var tSize = simEdges[0].parent.thint.width; var off = 2; for (var i=0; i < simEdges.length; i++) { if (i >0) { var tSize = simEdges[i-1].parent.thint.width; } var nOffset = (i-Math.floor(simEdges.length/2))*(tSize+off); simEdges[i].parent.animate('thintoffset', nOffset, 700, true,{motion:'easeout', relative: false}); } } ]]> if (canvas.topp.buttons.zoomslider.value > 0){ canvas.topp.buttons.zoomslider.setAttribute('value', canvas.topp.buttons.zoomslider.value - 1); } if (3 > canvas.topp.buttons.zoomslider.value){ canvas.topp.buttons.zoomslider.setAttribute('value', canvas.topp.buttons.zoomslider.value + 1); } LzCursor.showHandCursor(false); LzCursor.showHandCursor(true); var delKey = 46; var plusKey = 187; var minusKey = 189; if (k==delKey) deleteSelected(); else if (k==plusKey) zoomIn(); else if (k==minusKey) zoomOut();