accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1299899 - in /incubator/accumulo/branches/1.4/src/server/src/main: java/org/apache/accumulo/server/monitor/servlets/VisServlet.java resources/web/vis.xml
Date Mon, 12 Mar 2012 22:09:30 GMT
Author: billie
Date: Mon Mar 12 22:09:29 2012
New Revision: 1299899

URL: http://svn.apache.org/viewvc?rev=1299899&view=rev
Log:
ACCUMULO-453 fixed mouseover flashing

Modified:
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
    incubator/accumulo/branches/1.4/src/server/src/main/resources/web/vis.xml

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java?rev=1299899&r1=1299898&r2=1299899&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/monitor/servlets/VisServlet.java
Mon Mar 12 22:09:29 2012
@@ -186,10 +186,12 @@ public class VisServlet extends BasicSer
     sb.append("</select></span>\n");
     sb.append("&nbsp;&nbsp<span class='viscontrol'>(hover for info, click for
details)</span>");
     sb.append("</div>\n\n");
+    sb.append("<div id='hoverable'>\n");
     // floating info box
     sb.append("<div id='vishoverinfo'></div>\n\n");
     // canvas
     sb.append("<br><canvas id='visCanvas' width='").append(width).append("' height='").append(height).append("'>Browser
does not support canvas.</canvas>\n\n");
+    sb.append("</div>\n");
     sb.append("</div>\n\n");
   }
   

Modified: incubator/accumulo/branches/1.4/src/server/src/main/resources/web/vis.xml
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/resources/web/vis.xml?rev=1299899&r1=1299898&r2=1299899&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/resources/web/vis.xml (original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/resources/web/vis.xml Mon Mar 12 22:09:29
2012
@@ -28,7 +28,7 @@ var maxDotRadius = dotSpacing - dotPaddi
 var dotSize = new Array(numDots); // current sizes
 var dotSizeGrowing = new Array(numDots); // true when dot size is growing, false when shrinking
 var ids = new Array(numDots); // server ids
-var mousedDot = 0; // the dot currently under the mouse
+var mousedDot = -1; // the dot currently under the mouse
 
 var allStats = new Array(numDots);
 var colorPalette = ['#0000CC', '#0014B8', '#0029A3', '#003D8F', '#00527A', '#006666', '#007A52',
'#008F3D', '#00A329', '#00B814', '#00CC00', '#14D100', '#29D600', '#3DDB00', '#52E000', '#66E600',
'#7AEB00', '#8FF000', '#A3F500', '#B8FA00', '#CCFF00', '#CCFF00', '#CCF200', '#CCE600', '#CCD900',
'#CCCC00', '#CCBF00', '#CCB200', '#CCA600', '#CC9900', '#CC8C00', '#CC8000', '#CC7300', '#CC6600',
'#CC5900', '#CC4C00', '#CC4000', '#CC3300', '#CC2600', '#CC1A00', '#CC0D00', '#CC0000'];
@@ -42,9 +42,10 @@ var canvas = document.getElementById('vi
 var context = canvas.getContext('2d');
 
 // mouse handling for server information display
-canvas.addEventListener('mouseover', showId, false);
-canvas.addEventListener('mousemove', showId, false);
-canvas.addEventListener('mouseout', hideId, false);
+document.getElementById('hoverable').addEventListener('mouseover', showId, false);
+document.getElementById('hoverable').addEventListener('mousemove', showId, false);
+document.getElementById('hoverable').addEventListener('mouseout', hideId, false);
+document.getElementById('vishoverinfo').addEventListener('click', goToServer, false);
 canvas.addEventListener('click', goToServer, false);
 
 // initialize settings based on request parameters
@@ -238,7 +239,7 @@ function drawDots() {
     else
       drawDot(x,y,Math.floor(dotSize[i]),getColor(getStat(i,colorStatType)));
   }
-  if (mousedDot < numDots)
+  if (mousedDot >= 0 && mousedDot < numDots)
     document.getElementById('vishoverinfo').innerHTML=getInfo(mousedDot);
 }
 
@@ -388,7 +389,7 @@ function showId(e) {
   var rely = y - canvas.offsetTop - main.offsetTop;
   var width = Math.ceil(Math.sqrt(numDots));
   mousedDot = Math.floor(relx/(dotSpacing*2)) + width*Math.floor(rely/(dotSpacing*2));
-  if (relx < (width*dotSpacing*2) && mousedDot < numDots) {
+  if (relx < (width*dotSpacing*2) && mousedDot >= 0 && mousedDot <
numDots) {
     document.getElementById('vishoverinfo').style.left=relx+canvas.offsetLeft;
     document.getElementById('vishoverinfo').style.top=Math.max(0,rely+canvas.offsetTop-70);
     document.getElementById('vishoverinfo').style.visibility='visible';
@@ -405,7 +406,7 @@ function setState() {
 
 // go to server page on click
 function goToServer(e) {
-  if (mousedDot < numDots)
+  if (mousedDot >= 0 && mousedDot < numDots)
     window.location = serverurl + ids[mousedDot][0];
 }
 



Mime
View raw message