1 |
1e2b2c27
|
Tomáš Šimandl
|
<%@page import="cz.zcu.kiv.offscreen.graph.efp.EfpGraphicSettings"%>
|
2 |
|
|
<%--<%@page import="org.eclipse.jdt.internal.compiler.ast.ForeachStatement"%>--%>
|
3 |
|
|
<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
|
4 |
|
|
<%@page import="cz.zcu.kiv.comav.loaders.osgi.service.RequiredService"%>
|
5 |
|
|
<%@page import="sun.reflect.ReflectionFactory.GetReflectionFactoryAction"%>
|
6 |
|
|
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
7 |
|
|
<%@page import="java.util.Map"%>
|
8 |
|
|
<%@page import="com.google.gson.Gson"%>
|
9 |
|
|
<%@page import="com.google.gson.GsonBuilder"%>
|
10 |
|
|
|
11 |
|
|
<!DOCTYPE html>
|
12 |
|
|
<html>
|
13 |
|
|
<head>
|
14 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
15 |
|
|
|
16 |
|
|
<link rel="stylesheet" href="styles/libs/jquery-ui/smoothness/jquery-ui-1.10.3.custom.css" media="screen">
|
17 |
|
|
<link rel="stylesheet" href="styles/libs/jquery.contextMenu.css" media="screen">
|
18 |
|
|
<link rel="stylesheet" href="styles/libs/jquery.qtip.css" media="screen">
|
19 |
|
|
<link rel="stylesheet" href="styles/basic.css" media="screen">
|
20 |
|
|
<link rel="stylesheet" href="styles/tooltip.css" media="screen">
|
21 |
|
|
<link rel="stylesheet" href="styles/tree.css" media="screen">
|
22 |
|
|
<link rel="stylesheet" href="styles/dialog.css" media="screen">
|
23 |
|
|
|
24 |
|
|
<script src="js/libs/jquery-1.8.3.js"></script>
|
25 |
|
|
<script src="js/libs/jquery-ui-1.10.3.custom.js"></script>
|
26 |
|
|
<script src="js/libs/jquery.contextMenu.js"></script>
|
27 |
|
|
<script src="js/libs/jquery.qtip.js"></script>
|
28 |
|
|
<script src="js/libs/jquery.jstree.js"></script>
|
29 |
|
|
<script src="js/libs/saveSvgAsPng.js"></script>
|
30 |
|
|
<script src="js/libs/spin.js"></script>
|
31 |
|
|
|
32 |
|
|
<script src="js/app.js"></script>
|
33 |
|
|
<script src="js/util.js"></script>
|
34 |
|
|
<script src="js/svgFactory.js"></script>
|
35 |
|
|
<script src="js/graphManager.js"></script>
|
36 |
|
|
<script src="js/hash.js"></script>
|
37 |
|
|
<script src="js/mark.js"></script>
|
38 |
|
|
<script src="js/markSymbol.js"></script>
|
39 |
|
|
<script src="js/gridMark.js"></script>
|
40 |
|
|
<script src="js/group.js"></script>
|
41 |
|
|
<script src="js/groupManager.js"></script>
|
42 |
|
|
<script src="js/offScreenKiv.js"></script>
|
43 |
|
|
<script src="js/zoom.js"></script>
|
44 |
|
|
<script src="js/efps.js"></script>
|
45 |
|
|
<script src="js/viewportManager.js"></script>
|
46 |
|
|
<script src="js/dialog.js"></script>
|
47 |
|
|
<script src="js/tooltips.js"></script>
|
48 |
|
|
<script src="js/loader.js"></script>
|
49 |
|
|
<script src="js/diagram.js"></script>
|
50 |
|
|
<script src="js/user.js"></script>
|
51 |
|
|
|
52 |
|
|
<title>Visualization of large component diagrams</title>
|
53 |
|
|
</head>
|
54 |
|
|
|
55 |
|
|
<body>
|
56 |
|
|
<%
|
57 |
|
|
//String path = request.getContextPath();
|
58 |
|
|
String getProtocol=request.getScheme();
|
59 |
|
|
String getDomain=request.getServerName();
|
60 |
|
|
String getPort=Integer.toString(request.getServerPort());
|
61 |
|
|
String getPath = getProtocol+"://"+getDomain+":"+getPort+"/";
|
62 |
|
|
String getURI=request.getRequestURI();
|
63 |
|
|
|
64 |
|
|
// set graphic settings for EFP graph
|
65 |
|
|
ServletContext context = this.getServletContext();
|
66 |
|
|
EfpGraphicSettings efpSettings = new EfpGraphicSettings();
|
67 |
|
|
|
68 |
|
|
efpSettings.setMinInterfaceDiameter(Integer.valueOf(context.getInitParameter("minInterfaceDiameter")));
|
69 |
|
|
efpSettings.setMaxInterfaceDiameter(Integer.valueOf(context.getInitParameter("maxInterfaceDiameter")));
|
70 |
|
|
|
71 |
|
|
// JSONize graph settings
|
72 |
|
|
GsonBuilder gsonBuilder = new GsonBuilder();
|
73 |
|
|
Gson gson = gsonBuilder.create();
|
74 |
|
|
|
75 |
|
|
String efpSettingsJson = gson.toJson(efpSettings);
|
76 |
|
|
|
77 |
|
|
// logged-in user
|
78 |
|
|
boolean logged_user = false;
|
79 |
|
|
boolean diagram_id_hash_set = false;
|
80 |
|
|
if (request.getSession().getAttribute("logged_user") == "1"){
|
81 |
|
|
logged_user = true;
|
82 |
|
|
}
|
83 |
|
|
|
84 |
|
|
if (request.getParameter("diagram_id")!= null && request.getParameter("diagram_hash") != null) {
|
85 |
|
|
diagram_id_hash_set = true;
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
String diagram_url = "";
|
89 |
|
|
boolean show_icon_save = false;
|
90 |
|
|
if (logged_user && diagram_id_hash_set) {
|
91 |
|
|
diagram_url = "?diagram_id="+ request.getParameter("diagram_id")+"&diagram_hash=" + request.getParameter("diagram_hash");
|
92 |
|
|
show_icon_save = true;
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
boolean is_efp_diagram = false;
|
96 |
|
|
if (request.getAttribute("efpPortalRefererUrl") != null) {
|
97 |
|
|
is_efp_diagram = true;
|
98 |
|
|
}
|
99 |
|
|
%>
|
100 |
|
|
|
101 |
|
|
<div class="loader" id="loader">
|
102 |
|
|
<div class="loader-content" id="spinLoader">
|
103 |
|
|
<p>Loading graph...</p>
|
104 |
|
|
</div>
|
105 |
|
|
</div>
|
106 |
|
|
|
107 |
|
|
<div class="dialog" id="dialog" title="Group rename">
|
108 |
|
|
<p>Enter new group name:</p>
|
109 |
|
|
|
110 |
|
|
<input type="text" name="name" id="groupNameTextarea" />
|
111 |
|
|
<br>
|
112 |
|
|
|
113 |
|
|
<button type="button" name="button" id="clearNameButton" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Clear">
|
114 |
|
|
<span class="ui-button-text">Clear</span>
|
115 |
|
|
</button>
|
116 |
|
|
</div>
|
117 |
|
|
|
118 |
|
|
<div class="wrapper" id="envelope">
|
119 |
|
|
<header class="header" id="header">
|
120 |
|
|
<img src="images/logo.png" class="header-logo" alt="logo of University of West Bohemia" title="University of West Bohemia">
|
121 |
|
|
|
122 |
|
|
<h2 class="header-title color-blue">Visualization of large component diagrams </h2>
|
123 |
|
|
|
124 |
|
|
<% if (!is_efp_diagram) { %>
|
125 |
|
|
<jsp:include page="logged_user.jsp" />
|
126 |
|
|
<% } %>
|
127 |
|
|
</header>
|
128 |
|
|
|
129 |
|
|
<nav class="navbar" id="navigation">
|
130 |
|
|
<ul>
|
131 |
|
|
<li>
|
132 |
|
|
<button class="btn zoom" id="zoomOut" title="zoom-"><img src="images/zoom_out.png" alt="zoom-"/></button>
|
133 |
|
|
<span class="zoom-value" id="zoomValue">100%</span>
|
134 |
|
|
<button class="btn zoom" id="zoomIn" title="zoom+"><img src="images/zoom_in.png" alt="zoom+"/></button>
|
135 |
|
|
</li>
|
136 |
|
|
|
137 |
|
|
<li><hr class="navbar-separator"></li>
|
138 |
|
|
<li>
|
139 |
|
|
<input class="search-text" id="searchText" type="text" value="Search components..."/>
|
140 |
|
|
<button class="btn search" id="search"><img src="images/search.png" title="search" alt="search"></button>
|
141 |
|
|
<span class="search-count" id="countOfFinded" title="Count of components found">0</span>
|
142 |
|
|
</li>
|
143 |
|
|
|
144 |
|
|
<li><hr class="navbar-separator"></li>
|
145 |
|
|
<li>
|
146 |
|
|
<form>
|
147 |
|
|
<input type="radio" name="actionMove" value="move" id="move" checked><label for="move">move<img class="navbar-image" src="images/move.png" alt="move"></label>
|
148 |
|
|
<input type="radio" name="actionMove" value="exclude" id="remove"><label for="remove">exclude<img class="navbar-image" src="images/remove2.png" alt="remove"></label>
|
149 |
|
|
</form>
|
150 |
|
|
</li>
|
151 |
|
|
|
152 |
|
|
<li><hr class="navbar-separator"></li>
|
153 |
|
|
<li><button id="mostEdge" class="btn exclude-separately" title="Exclude components with the most count of edges separately."><img src="images/excludeSeparately.png" alt="excludeSeparately"/></button></li>
|
154 |
|
|
|
155 |
|
|
<li><hr class="navbar-separator"></li>
|
156 |
|
|
<li><button id="vertexToGroup" class="btn exclude-to-group" title="Exclude components with the most count of edges to group."><img src="images/package.png" alt="Exclude components to group"/></button></li>
|
157 |
|
|
|
158 |
|
|
<li><hr class="navbar-separator"></li>
|
159 |
|
|
<li>
|
160 |
|
|
<% if (!is_efp_diagram) { %>
|
161 |
|
|
<a href="<%=getServletContext().getInitParameter("HOME_URL")%><%= diagram_url %>" class="btn btn-block back-to-upload" id="view_back_to_upload" title="Back to upload"></a>
|
162 |
|
|
<% } else { %>
|
163 |
|
|
<a href="<%=request.getAttribute("efpPortalRefererUrl")%>" class="btn btn-block back-to-upload" id="view_back_to_upload" title="Back"></a>
|
164 |
|
|
<% } %>
|
165 |
|
|
</li>
|
166 |
|
|
|
167 |
|
|
<li><hr class="navbar-separator"></li>
|
168 |
|
|
<li>
|
169 |
|
|
<button class="btn" id="applyLayout" title="Apply layout to current graph.">
|
170 |
|
|
<img src="images/layout_off.png" id="applyLayoutImg" alt="Apply layout to current graph.">
|
171 |
|
|
</button>
|
172 |
|
|
</li>
|
173 |
|
|
|
174 |
|
|
<%
|
175 |
|
|
if (request.getAttribute("efpPortalEfpNames") != null) {
|
176 |
|
|
final Map<String, String> efpMappings = (Map<String, String>)request.getAttribute("efpPortalEfpNames");
|
177 |
|
|
if (!efpMappings.isEmpty()) {
|
178 |
|
|
%>
|
179 |
|
|
<li><hr class="navbar-separator"></li>
|
180 |
|
|
<li>
|
181 |
|
|
<select name="EFPselector" class="EFP-selector" id="EFPselector">
|
182 |
|
|
<option value="" selected="selected" class="option_default">none</option>
|
183 |
|
|
<% for (Map.Entry<String, String> entry : efpMappings.entrySet()) { %>
|
184 |
|
|
<option value="<%=entry.getValue()%>"><%=entry.getValue()%></option>
|
185 |
|
|
<% } %>
|
186 |
|
|
</select>
|
187 |
|
|
</li>
|
188 |
|
|
<%
|
189 |
|
|
}
|
190 |
|
|
}
|
191 |
|
|
%>
|
192 |
|
|
|
193 |
|
|
<% if (show_icon_save) { %>
|
194 |
|
|
<li><hr class="navbar-separator"></li>
|
195 |
|
|
<li><a href="#" class="btn btn-block view-save-diagram" id="view_save_diagram" onClick="saveDiagram(<%=request.getParameter("diagram_id")%>); return false;" title="Save diagram"></a></li>
|
196 |
|
|
|
197 |
|
|
<li><hr class="navbar-separator"></li>
|
198 |
|
|
<li><a href="<%=getServletContext().getInitParameter("HOME_URL")%>ShowGraph?diagram_id=<%=request.getParameter("diagram_id")%>&diagram_hash=<%=request.getParameter("diagram_hash")%>" class="btn btn-block view-refresh-diagram" id="view_refresh_diagram" title="Refresh diagram"></a></li>
|
199 |
|
|
|
200 |
|
|
<li><hr class="navbar-separator"></li>
|
201 |
|
|
<li><a href="<%=getServletContext().getInitParameter("HOME_URL")%>ShowGraph?diagram_id=<%=request.getParameter("diagram_id")%>&diagram_hash=<%=request.getParameter("diagram_hash")%>" class="btn btn-block view-refresh-reset-diagram" id="view_refresh_reset_diagram" onclick="return reset_diagram(<%=request.getParameter("diagram_id")%>,'<%=request.getParameter("diagram_hash")%>');" title="Refresh diagram - reset position"></a></li>
|
202 |
|
|
<% } %>
|
203 |
|
|
|
204 |
|
|
<li><hr class="navbar-separator"></li>
|
205 |
|
|
<li>
|
206 |
|
|
<button class="btn save-diagram" id="btnSaveDiagram" title="Save diagram as PNG." onclick="saveSvgAsPng(document.getElementById('svg1'), 'diagram.png', {scale: 1})">
|
207 |
|
|
<img src="images/png_save.png" id="applyLayoutImg" alt="Save diagram as PNG.">
|
208 |
|
|
</button>
|
209 |
|
|
</li>
|
210 |
|
|
</ul>
|
211 |
|
|
</nav>
|
212 |
|
|
|
213 |
|
|
<div class="content" id="content" >
|
214 |
|
|
<div class="viewport" id="viewport" contextmenu="contextMenu">
|
215 |
|
|
<img src="./images/zoom_help.png" class="zoom-help" id="zoom_help">
|
216 |
|
|
|
217 |
|
|
<ul class="contextMenu" id="myMenu"></ul>
|
218 |
|
|
|
219 |
|
|
<svg id="svg1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
220 |
|
|
<g class="graph" id="graph" transform="scale(1)">
|
221 |
|
|
<g class="edges" id="edges"></g>
|
222 |
|
|
<g class="vertices" id="vertices"></g>
|
223 |
|
|
</g>
|
224 |
|
|
</svg>
|
225 |
|
|
</div>
|
226 |
|
|
|
227 |
|
|
<div class="sidebar" id="rightPanel">
|
228 |
|
|
<div class="sidebar-navbar" id="uploadMenu">
|
229 |
|
|
<a class="button buttonClassic" id="postponed">Postponed</a>
|
230 |
|
|
<a class="button buttonClassic" id="toChange">To Change</a>
|
231 |
|
|
<a class="button buttonClassic" id="unconnected">Unconnected</a>
|
232 |
|
|
<a class="button buttonClassic" id="incompatible" style="display: none;">Incompatible</a>
|
233 |
|
|
</div>
|
234 |
|
|
|
235 |
|
|
<div class="components-count" id="allComps"></div>
|
236 |
|
|
|
237 |
|
|
<div class="components-box postponed-components" id="postponedComps">
|
238 |
|
|
<h5>Postponed components</h5>
|
239 |
|
|
</div>
|
240 |
|
|
|
241 |
|
|
<div class="components-box to-change-components" id="toChangeComps">
|
242 |
|
|
<h5>To Change components</h5>
|
243 |
|
|
<button type="button" id="proposeChanges">
|
244 |
|
|
<img class="buttonImage" src="images/tochange/crce-call-trans.gif" alt="Propose changes" title="Propose changes">
|
245 |
|
|
</button>
|
246 |
|
|
|
247 |
|
|
<!--
|
248 |
|
|
<h5>Proposed components</h5>
|
249 |
|
|
<div class="control-buttons">
|
250 |
|
|
<div class="button buttonClassic" id="accept-proposed">
|
251 |
|
|
<img class="buttonImage" src="images/tochange/accept-trans.gif" alt="Accept" title="Accept component change">
|
252 |
|
|
</div>
|
253 |
|
|
<div class="button buttonClassic" id="reject-proposed">
|
254 |
|
|
<img class="buttonImage" src="images/button_cancel.png" alt="Reject" title="Reject component change">
|
255 |
|
|
</div>
|
256 |
|
|
</div>
|
257 |
|
|
-->
|
258 |
|
|
</div>
|
259 |
|
|
|
260 |
|
|
<div class="components-box unconnected-components" id="unconComps">
|
261 |
|
|
<h5>Unconnected components</h5>
|
262 |
|
|
<div class="control-buttons">
|
263 |
|
|
<div class="button buttonClassic" id="showUnconnected">
|
264 |
|
|
<img src="images/unconnected/uncon_left.png" alt="<-" title="Show unconnected components">
|
265 |
|
|
</div>
|
266 |
|
|
<div class="button buttonClassic" id="hideUnconnected">
|
267 |
|
|
<img src="images/unconnected/uncon_right.png" alt="->" title="Hide unconnected components">
|
268 |
|
|
</div>
|
269 |
|
|
</div>
|
270 |
|
|
|
271 |
|
|
<ul id="unconCmpList"></ul>
|
272 |
|
|
</div>
|
273 |
|
|
|
274 |
|
|
<div class="components-box incompatible-components" id="allIncomps">
|
275 |
|
|
<h5 class="notCompatible">Incompatible components</h5>
|
276 |
|
|
|
277 |
|
|
<ul id="incomCmpList"></ul>
|
278 |
|
|
</div>
|
279 |
|
|
|
280 |
|
|
<div class="components-box excluded-components" id="excludedComponents">
|
281 |
|
|
<h5>Excluded components</h5>
|
282 |
|
|
|
283 |
|
|
<div class="btn-group">
|
284 |
|
|
<button type="button" class="sort-button" id="sortComponents_name_asc">
|
285 |
|
|
<span class="sort-icon">▲</span> Name
|
286 |
|
|
</button>
|
287 |
|
|
<button type="button" class="sort-button" id="sortComponents_name_desc">
|
288 |
|
|
<span class="sort-icon">▼</span> Name
|
289 |
|
|
</button>
|
290 |
|
|
<button type="button" class="sort-button" id="sortComponents_count_asc">
|
291 |
|
|
<span class="sort-icon">▲</span> #component
|
292 |
|
|
</button>
|
293 |
|
|
<button type="button" class="sort-button" id="sortComponents_count_desc">
|
294 |
|
|
<span class="sort-icon">▼</span> #component
|
295 |
|
|
</button>
|
296 |
|
|
|
297 |
|
|
<button type="button" class="include-components-button" id="includeAllComponents">
|
298 |
|
|
<img src="images/button_cancel.png" title="Include all components to graph">
|
299 |
|
|
</button>
|
300 |
|
|
</div>
|
301 |
|
|
</div>
|
302 |
|
|
</div>
|
303 |
|
|
</div>
|
304 |
|
|
</div>
|
305 |
|
|
|
306 |
|
|
<script>
|
307 |
|
|
var app = new App;
|
308 |
|
|
app.HOME_URL = '<%=getPath%>cocaex-compatibility/';
|
309 |
|
|
|
310 |
|
|
$(document).ready(function() {
|
311 |
|
|
// set theme path for jsTree lib
|
312 |
|
|
$.jstree._themes = "styles/libs/jstree/themes/";
|
313 |
|
|
|
314 |
|
|
var loaderFn;
|
315 |
|
|
<% if (request.getAttribute("graph_json") != null) { %>
|
316 |
|
|
loaderFn = app.efpLoader(<%= request.getAttribute("graph_json") %>, <%= efpSettingsJson %>);
|
317 |
|
|
<% } else { %>
|
318 |
|
|
loaderFn = app.diagramLoader(<%= request.getParameter("diagram_id") %>, <%= request.getParameter("diagram_hash") %>);
|
319 |
|
|
<% } %>
|
320 |
|
|
|
321 |
|
|
app.run(loaderFn);
|
322 |
|
|
});
|
323 |
|
|
</script>
|
324 |
|
|
</body>
|
325 |
|
|
</html>
|