annotate show.html @ 38:217a7b059553 draft

implemented get inspect
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Sat, 23 Mar 2013 09:29:01 +0900
parents 4b3fd472120b
children 3b597b795ea8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #{extends 'main.html' /}
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #{set title:messages.get('AAEvidenceSiftingModel.userdesktops.show.title') /}
18
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
3
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
4 #{set 'moreStyles'}
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
5 <link rel="stylesheet" href="/aat/public/viewer/css/viewer_form.css">
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
6 #{/set}
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
7 #{set 'moreScripts'}
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
8 <script type="text/javascript" src="@{'/public/viewer/js/lib/jquery-ui-1.8.23-min.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
9 <script type="text/javascript" src="@{'/public/viewer/js/lib/jquery.ui.touch-punch.min.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
10 <script type="text/javascript" src="@{'/public/viewer/js/lib/jsBezier-0.4-min.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
11 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-util-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
12 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-dom-adapter-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
13 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
14 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-defaults-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
15 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-svg-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
16 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-canvas-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
17 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jsPlumb-renderers-vml-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
18 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jquery.jsPlumb-1.3.15-RC1.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
19 <script type="text/javascript" src="@{'/public/viewer/js/1.3.15/jquery.jsPlumb-1.3.15-all-min.js'}" charset="${_response_encoding}"></script>
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
20 #{/set}
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 <div id="page">
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 <div class="title">
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 &{'AAEvidenceSiftingModel.userdesktops.show.title'}&nbsp;[ ${desktop.project.name} ]
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 </div>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 <ul >
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 <li>&gt; <a href="@{AAEvidenceSiftingModel.UserHomes.index()}">&{'navigation.back'}</a></li>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 <li>&gt; <a href="@{AAEvidenceSiftingModel.Projects.show(desktop.id)}">&{'AAEvidenceSiftingModel.projects.show.title'}</a></li>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 </ul>
18
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
30 <script type="text/javascript">var _desktopid = ${desktop.id};function desktopid(){return _desktopid;}</script>
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
31
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 <div id="miniDisplay" style='position:fixed; width:250px; height:250px; border:solid 1px; border-radius:5px; opacity:1; z-index:10; visibility:visible;'>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.5;'></div>
13
37d68fe602c2 add 'px'
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
35 <div id="closeMiniDisplay" style='position:absolute; right:5px; top:-3px; z-index:10; color:white;' onclick="$('#miniDisplay').css('visibility','hidden');" onmouseover="$('#closeMiniDisplay').css('color','yellow');" onmouseout="$('#closeMiniDisplay').css('color','white')" >CLOSE</div>
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 <div style='position:absolute; width:90%; height:90%;'>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 <div id="miniDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'>
25
a51dd2e558ab modified edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
39 Evidence Title
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 </div>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 <div id="miniDisplayBody" style='position:absolute; left:20px; top:40px;'>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 Please click any node.
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 </div>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 </div>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 </div>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 </div>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47
26
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
48 <div class="graphMainCss" style="position:absolute; left:0; bottom:0; width:100%; height:75%;" id='graphMain'>
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
49 <div style="position:absolute; width:0; height:0;left:0;" id='graphRoot'>
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
50 </div>
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
51 </div>
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
52
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
53 <div id='menuDisplay' class='menuDisplayCss' style='left:0; top:20; z-index:20;'>
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
54 <div id="closeMenuDisplay" style='position:absolute; right:5px; top:-15px; z-index:10; color:white;' onclick="closeSelectMenu();" onmouseover="$('#closeEdgeInfoDisplay').css('color','yellow');" onmouseout="$('#closeMenuDisplay').css('color','white')" >CLOSE</div>
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
55 <div class='menu' id='stateMenu'>
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
56 <div class='menuTitleCss' id='stateMenuTitle'>StateSelect</div>
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
57 <div class='menuTitleBodyCss' id='stateMenuBody'>
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
58 </div>
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
59 </div>
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
60 <div class='menu' id='traverseMenu' style=''>
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
61 <div class='menuTitleCss' id='traverseMenuTitle'>TraverseSelect</div>
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
62 <div class='menuTitleBodyCss'id='traverseMenuBody'>
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
63 </div>
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
64 </div>
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
65 <div class='menu' id='' style=''>
38
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
66 <div class='menuTitleCss' onclick="getInspect(CURRENT_DATA.nodeId);" id='accesDocument'>Read Document Now!!</div>
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
67 </div>
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
68 </div>
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
69
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
70
26
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
71
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 <script type="text/javascript">
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
73 var CURRENT_DATA = {};
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
74
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 if(!Array.prototype.filter){
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 Array.prototype.filter=function(func){
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 var arr=[];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 for(var i=0;i<this.length;i++)if(func(this[i]))arr.push(this[i]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 return arr;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
83 var arrowConnector = {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
84 connector:"StateMachine",
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
85 // paintStyle:{lineWidth:3,strokeStyle:"#056"},
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
86 paintStyle:{lineWidth:2,strokeStyle:"#aaf"},
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
87 hoverPaintStyle:{strokeStyle:"#dbe300"},
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
88 endpoint:"Blank",
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
89 anchor:"Continuous",
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
90 overlays:[ ["PlainArrow", {location:1, width:20, length:12} ]]
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
91 };
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
92 var arrowBothConnector = {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
93 connector:"StateMachine",
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
94 paintStyle:{lineWidth:2,strokeStyle:"#aaf"},
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
95 hoverPaintStyle:{strokeStyle:"#dbe300"},
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
96 endpoint:"Blank",
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
97 };
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 function GraphData() {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 var graphData = {};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 graphData.nodes = {};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 graphData.edges = {};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 return graphData;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 var DragHandler = {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 _oElem : null,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 _id : null,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 attach : function(oElem) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 oElem.onmousedown = DragHandler._dragBegin;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 return oElem;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 },
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 _dragBegin : function(e) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 var oElem = DragHandler._oElem = this;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 if (isNaN(parseInt(oElem.style.left))) { oElem.style.left = '0px'; }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 if (isNaN(parseInt(oElem.style.top))) { oElem.style.top = '0px'; }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 var x = parseInt(oElem.style.left);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 var y = parseInt(oElem.style.top);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 e = e ? e : window.event;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 oElem.mouseX = e.clientX;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 oElem.mouseY = e.clientY;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 document.onmousemove = DragHandler._drag;
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
121 document.onmouseup = DragHandler._dragEnd;
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 return false;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 },
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 _drag : function(e) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 var oElem = DragHandler._oElem;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 var x = parseInt(oElem.style.left);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 var y = parseInt(oElem.style.top);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 e = e ? e : window.event;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 var nextX = x + (e.clientX - oElem.mouseX);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 var nextY = y + (e.clientY - oElem.mouseY);
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
131 if (nextX < 0) nextX = 0;
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
132 if (nextY < 0) nextY = 0;
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 oElem.style.left = nextX + 'px';
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 oElem.style.top = nextY + 'px';
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 oElem.mouseX = e.clientX;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 oElem.mouseY = e.clientY;
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
137 if (oElem.nodeId) {
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
138 var id = oElem.nodeId;
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
139 var node = GRAPH_DATA.nodes[id];
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 node.position.x = nextX;
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
141 node.position.y = nextY;
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 return false;
18
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
144 },
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 _dragEnd : function() {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 var oElem = DragHandler._oElem;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 document.onmousemove = null;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 document.onmouseup = null;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 DragHandler._oElem = null;
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
150 if (oElem.nodeId) {
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
151 var x = parseInt(oElem.style.left);
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
152 var y = parseInt(oElem.style.top);
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
153 var node = GRAPH_DATA.nodes[oElem.nodeId];
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
154 if (x < 0) x = 0;
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
155 if (y < 0) y = 0;
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
156 node.position.x = x;
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
157 node.position.y = y;
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
158 nodePositionPost(node);
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
159 }
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 };
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 function writeMiniDisplay(title,str) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 $('#miniDisplayBody')[0].innerHTML = str;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 if(title) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 $('#miniDisplayTitle')[0].innerHTML = title;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 function writeJSONDataToMiniDisplay(jsonObj) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 var str = "";
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 for (var key in jsonObj.property) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 if (key != 'edgeInfo' ) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 str = str + key + ": "+ jsonObj.property[key] + "<br>";
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 writeMiniDisplay(jsonObj.property.title, str);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
180 function setEdgeInfoClickFunction(nodeId, edgeInfo, edgeInfoDiv) {
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
181 edgeInfoDiv.click(function(){ getEvidence(nodeId, edgeInfo); });
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
182 edgeInfoDiv.hover(
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
183 function(){edgeInfoDiv.css("box-shadow","black 0 0 50px"); },
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
184 function(){edgeInfoDiv.css("box-shadow","");}
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
185 );
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
186 }
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
187
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
188 function createEdgeInfoDiv(nodeId, edgeInfo) {
25
a51dd2e558ab modified edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
189 function createEdgeInfoinnerHTML(_edgeInfo) {
a51dd2e558ab modified edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
190 return _edgeInfo.kind + " : " + _edgeInfo.num + ": " + _edgeInfo.direction;
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
191 }
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
192 var edgeInfoDiv = $('<div class="menuContent"/>')
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
193 edgeInfoDiv[0].innerHTML = createEdgeInfoinnerHTML(edgeInfo);
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
194 setEdgeInfoClickFunction(nodeId, edgeInfo, edgeInfoDiv);
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
195 return edgeInfoDiv;
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
196 }
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
197
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
198 function updateEdgeInfoDisplay() {
25
a51dd2e558ab modified edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 24
diff changeset
199 var nodeId = CURRENT_DATA.nodeId;
23
c0066a07acd0 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
200 var node = GRAPH_DATA.nodes[nodeId];
c0066a07acd0 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
201 showEdgeInfoDisplay(node);
c0066a07acd0 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
202 }
c0066a07acd0 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
203
c0066a07acd0 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
204 function showEdgeInfoDisplay(node) {
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
205 removeTraverseMenuBody();
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
206 var tMenuBody = $('#traverseMenuBody');
23
c0066a07acd0 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 22
diff changeset
207 var edgeInfoArray = node.property.edgeInfo;
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
208 for (var i=0; i<edgeInfoArray.length; i++) {
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
209 var edgeInfo = edgeInfoArray[i];
24
eb324ada669a modified edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
210 if (!edgeInfo.view) {
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
211 edgeInfo.view = createEdgeInfoDiv(node.property.id, edgeInfo);
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
212 } else {
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
213 setEdgeInfoClickFunction(node.property.id, edgeInfo, edgeInfo.view);
24
eb324ada669a modified edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 23
diff changeset
214 }
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
215 appendMenuBody(tMenuBody, edgeInfo.view);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
216 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
217 updateMenuDisplayHeight();
38
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
218 $('#accesDocument').click(function(){ });
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
219 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
220
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
221 function calcChildrenHeight(childArray) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
222 var height = 0;
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
223 for (var i=0; i<childArray.length; i++) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
224 height = height + childArray[i].offsetHeight + BASE_MARGIN;
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
225 }
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
226 return height;
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
227 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
228
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
229 function appendMenuBody(menuBodyDiv, menuContentDiv) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
230 menuBodyDiv.append(menuContentDiv);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
231 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
232
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
233 function removeTraverseMenuBody() {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
234 $('#traverseMenuBody').children().remove();
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
235 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
236
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
237 function removeStateMenuBody() {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
238 $('#stateMenuBody').children().remove();
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
239 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
240
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
241 function showMenuBody(menu) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
242 var body = $(menu.children()[1]);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
243 var childArray = body.children();
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
244 $(childArray).css('visibility','visible');
36
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
245 body[0].viewFlag = true;
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
246 var height = calcChildrenHeight(childArray);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
247 menu.css('height', height+'px');
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
248 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
249
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
250 function showStateMenuBody() {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
251 showMenuBody($('#stateMenu'));
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
252 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
253
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
254 function showTraverseMenuBody(node) {
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
255 $('#traverseMenu').css('visibility','visible');;
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
256 showEdgeInfoDisplay(node);
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
257 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
258
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
259 function hiddenMenuBody(menu, height) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
260 var body = $(menu.children()[1]);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
261 var childArray = body.children();
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
262 $(childArray).css('visibility','hidden');
36
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
263 body[0].viewFlag = false;
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
264 menu.css('height', height+'px');
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
265 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
266
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
267 function hiddenStateMenuBody() {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
268 var height = DefaultSelectMenuInfo.stateMenuHeight;
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
269 hiddenMenuBody($('#stateMenu'), height);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
270 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
271
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
272 function hiddenTraverseMenuBody() {
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
273 var menu = $('#traverseMenu');
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
274 menu.css('visibility','hidden');
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
275 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
276
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
277 var MENU_BORDER_MARGIN = 2*parseInt($('.menu').css('border-top-width').split('px')[0]);
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
278 var DefaultSelectMenuInfo = {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
279 stateMenuHeight : $('#stateMenu')[0].offsetHeight - MENU_BORDER_MARGIN,
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
280 traverseMenuHeight : $('#traverseMenu')[0].offsetHeight - MENU_BORDER_MARGIN
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
281 };
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
282
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
283 function appendStateSelectDiv(body, div, state) {
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
284 div.click(function(){if (!CURRENT_DATA.nodeId) { alert("please click any node.");return; } stateTraversePost(state); });
36
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
285 div.hover(
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
286 function(){div.css("box-shadow","black 0 0 50px"); },
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
287 function(){div.css("box-shadow","");}
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
288 );
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
289 appendMenuBody(body, div);
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
290 }
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
291
36
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
292 function clickStateSelect() {
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
293 var flag = $('#stateMenuBody')[0].viewFlag;
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
294 if (flag) {
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
295 hiddenStateMenuBody();
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
296 } else {
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
297 showStateMenuBody();
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
298 }
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
299 }
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
300
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
301 function createStateSelectMenu() {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
302 removeStateMenuBody();
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
303 var stateMenu = $('#stateMenu');
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
304 var body = $('#stateMenuBody');
36
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
305 body[0].viewFlag = true;
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
306 var title = $('#stateMenuTitle');
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
307 title.click(function(){clickStateSelect(); updateMenuDisplayHeight(); });
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
308 title.hover(
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
309 function(){title.css("box-shadow","black 0 0 50px"); },
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
310 function(){title.css("box-shadow","");}
9d31b5239170 implemented hover and click function on StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 35
diff changeset
311 );
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
312 body.viewFlag = true;
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
313 for (var state in stateObj) {
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
314 var div = $('<div class="menuContent" >'+state+'</div>');
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
315 appendStateSelectDiv(body, div, stateObj[state]);
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
316 }
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
317 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
318
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
319 var MARGIN = parseInt($('.menu').css('margin-top').split('px')[0]);
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
320 var BASE_MARGIN = 2*MARGIN +
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
321 parseInt($('.menuDisplayCss').css('border-top-width').split('px')[0])*2;
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
322
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
323 function updateMenuDisplayHeight() {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
324 function calcMenuDisplayHeight(menuD, childArray) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
325 var menuArray = $('.menu');
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
326 var height = 0;
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
327 for (var i=0; i<menuArray.length; i++) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
328 height = height + menuArray[i].offsetHeight
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
329 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
330 return height;
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
331 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
332 function updateMenuTop(childArray) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
333 var height = 0;
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
334 for (var i=0; i<childArray.length; i++) {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
335 childArray[i].style.top = height + 'px';
38
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
336 height = height + childArray[i].offsetHeight + MARGIN;
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
337 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
338 }
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
339 var menuD = $('#menuDisplay');
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
340 var menuArray = $('.menu');
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
341 updateMenuTop(menuArray);
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
342 var height = calcMenuDisplayHeight(menuD, menuArray) + BASE_MARGIN;
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
343 menuD.css('height', height + 'px');
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
344 }
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
345
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
346 function closeSelectMenu() {
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
347 hiddenStateMenuBody();
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
348 hiddenTraverseMenuBody();
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
349 $('#menuDisplay').css('visibility','hidden');
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
350 }
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
351
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
352 function showSelectMenu(node) {
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
353 $('#menuDisplay').css('visibility','visible');
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
354 showStateMenuBody();
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
355 showTraverseMenuBody(node);
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
356 }
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
357
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 function init() {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 jsPlumb.importDefaults({
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 Connector : [ "Straight", { curviness:50 } ],
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 PaintStyle : { strokeStyle:"gray", lineWidth:2 },
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 EndpointStyle : {},
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 Anchors: ["BottomCenter","TopCenter"],
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 });
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 var rootDiv = $('#graphMain');
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 var rootLeft = rootDiv.offset().left;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 var rootTop = rootDiv.offset().top;
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
368 $('#miniDisplay').css( {
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
369 left: rootLeft + 'px',
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
370 top: rootTop + 'px'
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 });
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
372 var heightStr = $('#miniDisplay').css('height').split('px')[0];
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 var height = parseInt(heightStr);
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
374 $('#menuDisplay').css({
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
375 left: rootLeft + 'px',
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
376 top: rootTop + height + 50 +'px'
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 });
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
378 createStateSelectMenu();
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
379 // hiddenStateMenuBody();
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
380 updateMenuDisplayHeight();
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 function showMiniDisplay(node) {
26
b6031eb79cc0 remove unnecesarry code
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 25
diff changeset
384 CURRENT_DATA.nodeId = node.property.id;
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 $("#miniDisplay").css("visibility", "visible");
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 writeJSONDataToMiniDisplay(node);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 var nodeNum = 0;
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
390 var OFFSET = 300;
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 var miniD = $('#miniDisplay')[0].style;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 var offsetLeft = parseInt(miniD.width.split('px')[0]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 var offsetTop = parseInt(miniD.height.split('px')[0]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 function calcNewNodePosition() {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 var position = {};
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
396 position = {x: offsetLeft+OFFSET, y: nodeNum*OFFSET + offsetTop / 3};
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 nodeNum++;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 return position;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 /*
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 *
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 */
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 function clickNodeDiv(id) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 var graphData = GRAPH_DATA;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 var node = graphData.nodes[id];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 var rels = {evidence:1,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 dependency:1,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 derived:1,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 version:1,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 agreement:1};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 showRelationNodes(graphData, node, rels);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 function addEdgeInfo(id, kind, direction) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416 var nodes = GRAPH_DATA.nodes;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 var edges = GRAPH_DATA.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
420
12
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
421 function showEdgesAndNodes(graphData,jsonData,kind) {
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 var nodes = graphData.nodes;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 var jsonNodes = jsonData.nodes;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 for (var i=0; i<jsonNodes.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 var id = jsonNodes[i].id;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 updateNode(nodes[id]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 var edges = graphData.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 var jsonEdges = jsonData.edges;
12
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
430 for (var i=0; i<jsonEdges.length; i++) {
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
431 var edge = edges[jsonEdges[i].id];
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
432 edge.property.kind = kind;
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
433 showEdge(graphData, edge);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 showAllEdge(graphData);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437
38
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
438 function getInspect(id) {
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
439 $.ajax({
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
440 url:"/aat/aaevidencesiftingmodel.userdesktops/inspect?id="+id,
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
441 success:function(o) { console.log(o); document.location = o; },
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
442 type:"GET", cache:true,
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
443 error:function(o) { console.log("getEvidence error : ", o); }
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
444 });
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
445 }
217a7b059553 implemented get inspect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 37
diff changeset
446
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
447 function getEvidence(nodeId, edgeInfo) {
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 $.ajax({
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
449 url:"/aat/aaevidencesiftingmodel.userdesktops/get?desktopid="+desktopid() +"&id="+nodeId+"&edgeinfoid="+edgeInfo.id,
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
450 success:function(o) { if(!o){return;} parseJSONGraphData(GRAPH_DATA, o); recursiveCalcPosition(GRAPH_DATA, GRAPH_DATA.nodes[nodeId]); showEdgesAndNodes(GRAPH_DATA, o, edgeInfo.kind);},
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 type:"GET", cache:true,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 error:function(o) { console.log("getEvidence error : ", o); }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 });
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
456 function postToServer(parameter) {
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
457 $.ajax({
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
458 url:"/aat/aaevidencesiftingmodel.userdesktops/update?desktopid="+desktopid()+"&"+parameter,
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
459 success:function(o) { console.log(this.url);},
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
460 type:"POST", cache:true,
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
461 error:function(o) { console.log("post error : ", o); }
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
462 });
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
463 }
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
464
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
465 var stateObj = {
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
466 accept:"Accepted",
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
467 reject:"Rejected",
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
468 retract:"Retract"
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
469 };
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
470
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
471 function statePost(button) {
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
472 var id = CURRENT_DATA.nodeId;
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
473 var state = buttonEle.html();
20
864c47b06e85 edge paint
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
474 var node = GRAPH_DATA.nodes[id];
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
475 node.property.state = stateObj[state];
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
476 postToServer("id="+id+"&state="+stateObj[state]);
20
864c47b06e85 edge paint
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
477 showMiniDisplay(node);
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
478 updateNodeElement(node);
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
479 }
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
480
35
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
481 function stateTraversePost(state) {
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
482 var id = CURRENT_DATA.nodeId;
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
483 var node = GRAPH_DATA.nodes[id];
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
484 node.property.state = state;
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
485 postToServer("id="+id+"&state="+state);
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
486 showMiniDisplay(node);
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
487 updateNodeElement(node);
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
488 }
26eaf273efbf implemented StateSelect
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 34
diff changeset
489
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
490 function nodePositionPost(node) {
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
491 postToServer("id="+node.property.id+"&coordX="+node.position.x+"&coordY="+node.position.y);
17
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
492 }
02b5c7fe5d08 implemented post function for state change and node position
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 16
diff changeset
493
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 function createNodeDiv(node) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 node.view = $("<div class='graphNode'/>");
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
496 node.view.click(function(){ clickNodeDiv(node.property.id); });
19
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
497 if(!node.position) {
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
498 node.position = calcNewNodePosition();
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
499 }
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 var div = $("<div class='graphNodeContent' />")[0];
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
501 div.id = node.property.id;
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 div.innerHTML = node.property.title;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503 node.view[0].appendChild(div);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 return node;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
507 var StateColor = {
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
508 Accepted:"#48f",
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
509 Rejected:"#a66",
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
510 Retracted:"#fff"
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
511 };
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
512
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
513 var borderStyle = {
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
514 // kind : 'style',
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
515 Document:'solid',
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
516 Context:'dashed'
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
517 };
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
518
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519 function updateNodeElement(node) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 var created = false;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521 if(!node.view) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 created = true;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 createNodeDiv(node);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 var div = node.view;
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
526 div.hover(
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
527 function(){div.css("box-shadow","white 0 0 50px"); },
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
528 function(){div.css("box-shadow","");}
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
529 );
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
530 node.view[0].nodeId = node.property.id;
37
4b3fd472120b modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 36
diff changeset
531 div.click(function(){ showMiniDisplay(node); showSelectMenu(node);});
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
532 DragHandler.attach($(node.view)[0]);
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
533 div.css('border-style',borderStyle[node.property.kind]);
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
534 div.css("background", StateColor[node.property.state]||"white");
27
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
535 // var kindBorder = {agree:"#66a", rejected:"#a66"};
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
536 // div.css("border-color", kindBorder[node.property.state] ||"#58f");
992372c53479 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 26
diff changeset
537 div.css("border-color","#444");
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538 div.css({
19
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
539 left: node.position.x + 'px',
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
540 top: node.position.y + 'px'
15
ed6b969b2fc8 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 14
diff changeset
541 });
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
542 var contentDiv = $(div[0].firstChild);
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
543 contentDiv.css("background", StateColor[node.property.state]||"white");
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 return created;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 function updateNode(node) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 if(updateNodeElement(node)) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 var fc = $('#graphRoot')[0].firstChild;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 if(fc) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 $('#graphRoot')[0].insertBefore(node.view[0], fc);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 } else {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 $('#graphRoot').append(node.view);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 }
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
557 nodePositionPost(node);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 function parseJSONGraphData(memory ,jsonObj) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 var nodes = jsonObj.nodes;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562 for (var i=0; i<nodes.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 var node = nodes[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 if (memory.nodes[node.id]) continue;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 memory.nodes[node.id] = {};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
566 memory.nodes[node.id].in = [];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
567 memory.nodes[node.id].out = [];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568 memory.nodes[node.id].both = [];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569 memory.nodes[node.id].property = node;
19
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
570 if (node.coordX) {
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
571 memory.nodes[node.id].position = {};
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
572 memory.nodes[node.id].position.x = node.coordX;
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
573 memory.nodes[node.id].position.y = node.coordY;
3c02336869d4 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 18
diff changeset
574 }
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 if (!jsonObj.edges) return memory;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
577 var edges = jsonObj.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 for (var i=0; i<edges.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 var edge = edges[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 var edgeId = edge.id;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 if (memory.edges[edgeId]) continue;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 memory.edges[edgeId] = {};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
583 memory.edges[edgeId].property = edge;
12
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
584 memory.edges[edgeId].visible = false;
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
585 memory.nodes[edge.from].out.push(edgeId);
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
586 memory.nodes[edge.to].in.push(edgeId);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
587 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
588 return memory;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
590
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 function showEdge(graphData, edge) {
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
592 function connectEdge(fromNode, toNode, kind) {
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
593 var c;
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
594 c = jsPlumb.connect({source:fromNode.view[0], target:toNode.view[0]}, arrowConnector);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
595 // jsPlumb.select({source:fromNode.view[0]}).removeAllOverlays();
12
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
596 c.setLabel({label:"<span style='color:#129; font-size:1.5em;'>"+kind+"</span>",cssStyle:""});
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
597 return c;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
598 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599 if (edge.visible) return;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 var fromNode = graphData.nodes[edge.property.from];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 var toNode = graphData.nodes[edge.property.to];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602 if (!fromNode.view && !toNode.view) return;
12
549962a324ac modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 11
diff changeset
603 var kind = edge.property.kind;
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
604 connectEdge(fromNode, toNode, kind);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 edge.visible = true;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
607
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 function createNodeFromEdge(graphData, edge, baseNode) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 if(edge.visible) return;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
610 var fromNode = graphData.nodes[edge.property.from];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 if (!fromNode.view) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
612 updateNode(fromNode);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
613 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
614 var toNode = graphData.nodes[edge.property.to];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 if (!toNode.view) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
616 updateNode(toNode);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
617 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
618 showEdge(graphData, edge);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
619 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
620
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
621 function getRelationEdgeIds(node) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
622 var edgeIds = [];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
623 for (var i=0; i<node.in.length; i++) edgeIds.push(node.in[i]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
624 for (var i=0; i<node.out.length; i++) edgeIds.push(node.out[i]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
625 for (var i=0; i<node.both.length; i++) edgeIds.push(node.both[i]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
626 return edgeIds;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
627 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
628
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
629 function getRelationNodeIds(graphData, node) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
630 var nodes = graphData.nodes;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
631 var edges = graphData.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
632 var nodeIds = [];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 for (var i=0; i<node.in.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634 var edgeId = node.in[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
635 nodeIds.push(edges[edgeId].property.from);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
636 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
637 for (var i=0; i<node.out.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 var edgeId = node.out[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
639 nodeIds.push(edges[edgeId].property.to);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
640 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641 for (var i=0; i<node.both.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 var edgeId = node.both[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 var fromId = edges[edgeId].property.from;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 var toId = edges[edgeId].property.to;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 if (fromId == node.property.id) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646 nodeIds.push(toId);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
647 } else {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 nodeIds.push(fromId);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
649 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 return nodeIds;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
654 /*
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 * This function output all NODE that are related [node]
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
656 */
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 function updateRelationNodes(graphData, node) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
658 var id = node.property.id;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
659 var edges = graphData.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660 var edgeIds = getRelationEdgeIds(node);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 for (var i=0; i<edgeIds.length; i++ ) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
662 createNodeFromEdge(graphData, edges[edgeIds[i]]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
664 jsPlumb.removeAllEndpoints();
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
665 jsPlumb.draggable($('.graphNode'));
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
667
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668 /*
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
669 * rels = {dependency:1, evidence:1};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 * showRelationNodes(graphData, node, rels);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
671 */
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
672 function showRelationNodes(graphData, node, rels) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
673 var id = node.property.id;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
674 var edges = graphData.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
675 var edgeIds = getRelationEdgeIds(node);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
676 for (var i=0; i<edgeIds.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
677 var edge = edges[edgeIds[i]];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
678 if (rels[edge.property.rel]) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 createNodeFromEdge(graphData, edges[edgeIds[i]]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
680 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
681 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682 jsPlumb.removeAllEndpoints();
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
683 jsPlumb.draggable($('.graphNode'));
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 var BASE_THETA = -30;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 var BASE_ANGLE = 180;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 var BASE_DISTANCE = 180;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
689 function calcChildNodePosition(parent, num) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
690 var pX = parent.position.x;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 var pY = parent.position.y;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
692 var deg = BASE_ANGLE - num * BASE_THETA;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693 var theta = deg * (Math.PI / 180);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
694 var cX = pX - (BASE_DISTANCE * Math.cos(theta));
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695 var cY = pY - (BASE_DISTANCE * Math.sin(theta));
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 return {x:cX, y:cY};
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
698
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 function showAllEdge(graphData) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
700 var edges = graphData.edges;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 for (var id in edges) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 showEdge(graphData, edges[id]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704 jsPlumb.removeAllEndpoints();
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 jsPlumb.draggable($('.graphNode'));
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
706 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
707
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
708 function recursiveCalcPosition(graphData, parentNode) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709 if (!parentNode.position) updateNode(parentNode);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
710 childNodeIds = getRelationNodeIds(graphData, parentNode);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
711 /* calcration of childNode position */
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
712 var numCalcChild = 0;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
713 var childArray = {};
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
714 for (var i=0; i<childNodeIds.length; i++) {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
715 var id = childNodeIds[i];
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
716 var childNode = graphData.nodes[id];
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
717 if (childNode.position) {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
718 numCalcChild++;
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
719 }
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
720 }
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
721 for (var i=0; i<childNodeIds.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
722 var id = childNodeIds[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
723 var childNode = graphData.nodes[id];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
724 childArray[id] = childNode;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 if (!childNode.position) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
726 childNode.position = calcChildNodePosition(parentNode, numCalcChild);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
727 numCalcChild++;
22
892b68564117 add edgeInfoDisplay
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 20
diff changeset
728 nodePositionPost(childNode);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
729 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
730 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
731 /* calcration of grandchildNode position */
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
732 for (var id in childArray) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
733 var childNode = childArray[id];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
734 var grandChildIds = getRelationNodeIds(graphData, childNode);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
735 for (var i=0; i<grandChildIds.length; i++) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
736 var gId = grandChildIds[i];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
737 var grandChild = graphData.nodes[gId];
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
738 if (!grandChild.position) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
739 recursiveCalcPosition(graphData, childNode);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
740 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
741 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
742 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
743 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
744
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
745 var GRAPH_DATA = new GraphData();
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
746 function startUserDesktopUI() {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
747 function showFirstEvidenceList(graphData) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
748 var nodes = graphData.nodes;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
749 for (var id in nodes) {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
750 updateNode(nodes[id]);
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
751 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
752 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
753 var gData = GRAPH_DATA;
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
754 showFirstEvidenceList(gData);
20
864c47b06e85 edge paint
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 19
diff changeset
755 showAllEdge(gData);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
756 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
757
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
758 function start() {
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
759 init();
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
760 $.ajax({
18
cfdce8445a14 modified show.html for post edgeInfoId
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 17
diff changeset
761 url:"/aat/aaevidencesiftingmodel.userdesktops/get?desktopid="+desktopid(),
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
762 success:function(o) { parseJSONGraphData(GRAPH_DATA, o); startUserDesktopUI();},
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
763 type:"GET", cache:false,
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
764 error:function(o) { console.log("first get error : ",o); }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
765 });
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
766 }
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
767
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
768 function addLoadEvent(func) {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
769 var oldonload = window.onload;
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
770 if (typeof window.onload != 'function') {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
771 window.onload = func;
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
772 } else {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
773 window.onload = function() {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
774 if (oldonload) {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
775 oldonload();
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
776 }
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
777 func();
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
778 }
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
779 }
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
780 }
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
781
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
782 addLoadEvent(function() {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
783 beginScript();
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
784 });
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
785
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
786 function beginScript() {
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
787 DragHandler.attach($('#miniDisplay')[0]);
34
fdad911675bc implemented menu
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 27
diff changeset
788 DragHandler.attach($('#menuDisplay')[0]);
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
789 start();
16
1af36503e849 modified show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 15
diff changeset
790 }
11
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
791
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
792 </script>
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
793
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
794
8c4171f77fcc add show.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
795