# HG changeset patch # User Nobuyasu Oshiro # Date 1363803265 -32400 # Node ID 1af36503e84970bd87a4efc17a521cbfae5a72f2 # Parent ed6b969b2fc8be8b472dd9892b19002baec000f7 modified show.html diff -r ed6b969b2fc8 -r 1af36503e849 show.html --- a/show.html Wed Mar 20 22:44:39 2013 +0900 +++ b/show.html Thu Mar 21 03:14:25 2013 +0900 @@ -79,6 +79,23 @@ } } +var arrowConnector = { + connector:"StateMachine", + // paintStyle:{lineWidth:3,strokeStyle:"#056"}, + paintStyle:{lineWidth:2,strokeStyle:"#aaf"}, + hoverPaintStyle:{strokeStyle:"#dbe300"}, + endpoint:"Blank", + anchor:"Continuous", + overlays:[ ["PlainArrow", {location:1, width:20, length:12} ]] +}; + +var arrowBothConnector = { + connector:"StateMachine", + paintStyle:{lineWidth:2,strokeStyle:"#aaf"}, + hoverPaintStyle:{strokeStyle:"#dbe300"}, + endpoint:"Blank", +}; + function GraphData() { var graphData = {}; graphData.nodes = {}; @@ -91,11 +108,6 @@ return obj; } -function beginScript() { - DragHandler.attach($('#miniDisplay')[0]); - DragHandler.attach($('#traverseDisplay')[0]); -} - var DragHandler = { _oElem : null, _id : null, @@ -146,24 +158,6 @@ }; -function addLoadEvent(func) { - var oldonload = window.onload; - if (typeof window.onload != 'function') { - window.onload = func; - } else { - window.onload = function() { - if (oldonload) { - oldonload(); - } - func(); - } - } -} - -addLoadEvent(function() { - beginScript(); -}); - function writeMiniDisplay(title,str) { $('#miniDisplayBody')[0].innerHTML = str; if(title) { @@ -236,8 +230,8 @@ var heightStr = $('#traverseDisplay').css('height').split('px')[0]; var height = parseInt(heightStr); $('#miniDisplay').css( { - left: rootLeft, - top: rootTop + height + 50 + left: rootLeft + 'px', + top: rootTop + height + 50 + 'px' }); } @@ -257,13 +251,13 @@ } var nodeNum = 0; -var OFFSET = 200; +var OFFSET = 300; var miniD = $('#miniDisplay')[0].style; var offsetLeft = parseInt(miniD.width.split('px')[0]); var offsetTop = parseInt(miniD.height.split('px')[0]); function calcNewNodePosition() { var position = {}; - position = {x: offsetLeft, y: nodeNum*OFFSET + offsetTop / 3}; + position = {x: offsetLeft+OFFSET, y: nodeNum*OFFSET + offsetTop / 3}; nodeNum++; return position; } @@ -392,23 +386,6 @@ intervalY:120 }; -var arrowConnector = { - connector:"StateMachine", - // paintStyle:{lineWidth:3,strokeStyle:"#056"}, - paintStyle:{lineWidth:2,strokeStyle:"#aaf"}, - hoverPaintStyle:{strokeStyle:"#dbe300"}, - endpoint:"Blank", - anchor:"Continuous", - overlays:[ ["PlainArrow", {location:1, width:20, length:12} ]] -}; - -var arrowBothConnector = { - connector:"StateMachine", - paintStyle:{lineWidth:2,strokeStyle:"#aaf"}, - hoverPaintStyle:{strokeStyle:"#dbe300"}, - endpoint:"Blank", -}; - function parseJSONGraphData(memory ,jsonObj) { var nodes = jsonObj.nodes; for (var i=0; i"+kind+"",cssStyle:""}); return c; @@ -457,8 +425,7 @@ var toNode = graphData.nodes[edge.property.to]; if (!fromNode.view && !toNode.view) return; var kind = edge.property.kind; - var type = edge.property.type; - connectEdge(fromNode, toNode, kind, type); + connectEdge(fromNode, toNode, kind); edge.visible = true; } @@ -576,6 +543,13 @@ /* calcration of childNode position */ var numCalcChild = 0; var childArray = {}; + for (var i=0; i