From eb2c366290ec875cd6324f18fd01e90bdf643ff5 Mon Sep 17 00:00:00 2001 From: Chisu Yu Date: Tue, 5 Mar 2013 08:06:14 +0000 Subject: [PATCH] =?UTF-8?q?[=EC=9C=A0=EC=B9=98=EC=88=98]=20[NOBTS]=201.=20?= =?UTF-8?q?=EA=B3=B5=EB=B0=B1=EC=97=90=EC=84=9C=20=EB=A7=88=EC=9A=B0?= =?UTF-8?q?=EC=8A=A4=20=EB=93=9C=EB=9E=98=EA=B7=B8=ED=95=98=EB=A9=B4=20?= =?UTF-8?q?=EB=85=B8=EB=93=9C=20=EC=82=AC=EB=9D=BC=EC=A7=80=EB=8A=94=20?= =?UTF-8?q?=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95=202.=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=A0=88=EC=9D=B4=EC=96=B4=EA=B0=80=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=ED=95=A0=20=EB=95=8C=EB=A7=88=EB=8B=A4=20=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?3.=20=ED=81=B4=EB=A6=AD=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=EB=A5=BC?= =?UTF-8?q?=20=EB=8D=94=EB=B8=94=ED=81=B4=EB=A6=AD=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@1294 84d0f5b1-2673-498c-a247-62c4ff18d310 --- .../webapp/common/js/hippo/chart-springy.js | 2 + .../js/hippo/servermap/hippoServerMap.js | 39 ++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/common/js/hippo/chart-springy.js b/src/main/webapp/common/js/hippo/chart-springy.js index 333b41350..11cb37903 100644 --- a/src/main/webapp/common/js/hippo/chart-springy.js +++ b/src/main/webapp/common/js/hippo/chart-springy.js @@ -32,6 +32,7 @@ function drawSpringy(graphdata, targetId, width, height) { $('#console').val('Node onMouseOver : ' + this.id + '\r' + $('#console').val()) }, onMouseClick : function(e){ + // TODO 정보 layer가 중복으로 보이지 않도록 함. if ($("DIV.nodeinfo" + i).length == 0 && this.data.hosts.length > 0) { var htOffset = $(targetId).offset(); var box = $('#ServerBox') @@ -56,6 +57,7 @@ function drawSpringy(graphdata, targetId, width, height) { $('#console').val('Edge onMouseOver : ' + this.id + '\r' + $('#console').val()); }, onMouseClick : function(e){ + // TODO 정보 layer가 중복으로 보이지 않도록 함. if ($("DIV.linkinfo" + i).length > 0) { return; } diff --git a/src/main/webapp/common/js/hippo/servermap/hippoServerMap.js b/src/main/webapp/common/js/hippo/servermap/hippoServerMap.js index 0817513c4..40aa8a8b4 100644 --- a/src/main/webapp/common/js/hippo/servermap/hippoServerMap.js +++ b/src/main/webapp/common/js/hippo/servermap/hippoServerMap.js @@ -116,6 +116,9 @@ jQuery.fn.hippoServerMap = function(params) { renderer.startOnce(); }); + // + // TODO double click 할 때 정보를 보여주도록 수정함. + // jQuery(canvas).mousedown(function(e) { e.preventDefault(); var pos = jQuery(this).offset(); @@ -123,19 +126,45 @@ jQuery.fn.hippoServerMap = function(params) { selectedEdge = layout.edgeHover({x: e.pageX - pos.left, y: e.pageY - pos.top}, nEdgeHoverWeight); if(selectedNode.node !== null){ selected = true; +// if(typeof selectedNode.node.data.onMouseClick === 'function'){ +// selectedNode.node.data.onMouseClick.call(selectedNode.node, e); +// } + $(this).css('cursor','pointer'); + }else if(selectedEdge.edge !== null){ +// if(typeof selectedEdge.edge.data.onMouseClick === 'function'){ +// selectedEdge.edge.data.onMouseClick.call(selectedEdge.edge, e); +// } + }else{ + // TODO 공백에서 드래그 했을 때 그래프가 사라지는 현상 방지. + if (selectedNode.node !== null) { + dragged = true; + htLastPos.pageY = e.pageY; + htLastPos.pageX = e.pageX; + } + } + }); + + jQuery(canvas).dblclick(function(e) { + e.preventDefault(); + var pos = jQuery(this).offset(); + selectedNode = layout.selectNode({x: e.pageX - pos.left, y: e.pageY - pos.top}); + selectedEdge = layout.edgeHover({x: e.pageX - pos.left, y: e.pageY - pos.top}, nEdgeHoverWeight); + if(selectedNode.node !== null){ +// selected = true; if(typeof selectedNode.node.data.onMouseClick === 'function'){ selectedNode.node.data.onMouseClick.call(selectedNode.node, e); } - $(this).css('cursor','pointer'); +// $(this).css('cursor','pointer'); }else if(selectedEdge.edge !== null){ if(typeof selectedEdge.edge.data.onMouseClick === 'function'){ selectedEdge.edge.data.onMouseClick.call(selectedEdge.edge, e); } - }else{ - dragged = true; - htLastPos.pageY = e.pageY; - htLastPos.pageX = e.pageX; } +// else{ +// dragged = true; +// htLastPos.pageY = e.pageY; +// htLastPos.pageX = e.pageX; +// } }); var lastSelectedNodeId = null, lastSelectedEdge = {edge : null};