Fixing various GUI traffic/usage issues.
Reduced key help font.

Change-Id: I273f840aec85c13763688dfee8b3f26c8d1d5233
diff --git a/tools/package/archetypes/pom.xml b/tools/package/archetypes/pom.xml
index 6e169d1..b0b61a8 100644
--- a/tools/package/archetypes/pom.xml
+++ b/tools/package/archetypes/pom.xml
@@ -33,7 +33,6 @@
 
     <modules>
         <module>bundle</module>
-        <!--module>web-bundle</module-->
     </modules>
 
 </project>
diff --git a/tools/package/archetypes/web-bundle/pom.save.xml b/tools/package/archetypes/web-bundle/save.xml
similarity index 100%
rename from tools/package/archetypes/web-bundle/pom.save.xml
rename to tools/package/archetypes/web-bundle/save.xml
diff --git a/tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppComponent.java b/tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppComponent.java
deleted file mode 100644
index 1d17f5f..0000000
--- a/tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppComponent.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2014 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package sample.bundle;
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Service;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Skeletal ONOS application component.
- */
-@Component(immediate = true)
-@Service
-public class AppComponent implements AppService {
-
-    private static Logger log = LoggerFactory.getLogger(AppComponent.class);
-
-    @Activate
-    protected void activate() {
-        log.info("Started");
-    }
-
-    @Deactivate
-    protected void deactivate() {
-        log.info("Stopped");
-    }
-
-}
diff --git a/tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppService.java b/tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppService.java
deleted file mode 100644
index 9e658d4..0000000
--- a/tools/package/archetypes/web-bundle/src/main/java/sample/bundle/AppService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2014 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package sample.bundle;
-
-/**
- * Skeletal ONOS application API.
- */
-public interface AppService {
-
-}
diff --git a/tools/package/archetypes/web-bundle/src/test/java/sample/bundle/AppComponentTest.java b/tools/package/archetypes/web-bundle/src/test/java/sample/bundle/AppComponentTest.java
deleted file mode 100644
index d18ba0d..0000000
--- a/tools/package/archetypes/web-bundle/src/test/java/sample/bundle/AppComponentTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2014 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package sample.bundle;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Set of tests of the ONOS application component.
- */
-public class AppComponentTest {
-
-    private AppComponent component;
-
-    @Before
-    public void setUp() {
-        component = new AppComponent();
-        component.activate();
-
-    }
-
-    @After
-    public void tearDown() {
-        component.deactivate();
-    }
-
-    @Test
-    public void basics() {
-
-    }
-
-}
diff --git a/web/gui/src/main/java/org/onosproject/gui/TopologyViewWebSocket.java b/web/gui/src/main/java/org/onosproject/gui/TopologyViewWebSocket.java
index 899a7b0..0353a25 100644
--- a/web/gui/src/main/java/org/onosproject/gui/TopologyViewWebSocket.java
+++ b/web/gui/src/main/java/org/onosproject/gui/TopologyViewWebSocket.java
@@ -213,6 +213,7 @@
             processMessage((ObjectNode) mapper.reader().readTree(data));
         } catch (Exception e) {
             log.warn("Unable to parse GUI request {} due to {}", data, e);
+            log.warn("Boom!!!", e);
         }
     }
 
@@ -384,7 +385,6 @@
     }
 
 
-
     private Set<ConnectPoint> getHostLocations(Set<HostId> hostIds) {
         Set<ConnectPoint> points = new HashSet<>();
         for (HostId hostId : hostIds) {
@@ -459,21 +459,19 @@
         // Cancel any other traffic monitoring mode.
         stopTrafficMonitoring();
 
+        // Get the set of selected hosts and their intents.
+        ArrayNode ids = (ArrayNode) payload.path("ids");
+        selectedHosts = getHosts(ids);
+        selectedDevices = getDevices(ids);
+        selectedIntents = intentFilter.findPathIntents(selectedHosts, selectedDevices,
+                                                       intentService.getIntents());
+        currentIntentIndex = -1;
+
         String hover = string(payload, "hover");
         if (haveSelectedIntents()) {
-            // Get the set of selected hosts and their intents.
-            ArrayNode ids = (ArrayNode) payload.path("ids");
-            selectedHosts = getHosts(ids);
-            selectedDevices = getDevices(ids);
-            selectedIntents = intentFilter.findPathIntents(selectedHosts, selectedDevices,
-                                                           intentService.getIntents());
-            currentIntentIndex = -1;
-
             // Send a message to highlight all links of all monitored intents.
             sendMessage(trafficMessage(sid, new TrafficClass("primary", selectedIntents)));
-        }
-
-        if (!isNullOrEmpty(hover)) {
+        } else if (!isNullOrEmpty(hover)) {
             // If there is a hover node, include it in the selection and find intents.
             processExtendedSelection(sid, hover);
         }
@@ -484,19 +482,21 @@
     }
 
     private void processExtendedSelection(long sid, String hover) {
-        Set<Host> hoverSelHosts = new HashSet<>(selectedHosts);
-        Set<Device> hoverSelDevices = new HashSet<>(selectedDevices);
-        addHover(hoverSelHosts, hoverSelDevices, hover);
+        if (haveSelectedIntents()) {
+            Set<Host> hoverSelHosts = new HashSet<>(selectedHosts);
+            Set<Device> hoverSelDevices = new HashSet<>(selectedDevices);
+            addHover(hoverSelHosts, hoverSelDevices, hover);
 
-        List<Intent> primary =
-                intentFilter.findPathIntents(hoverSelHosts, hoverSelDevices,
-                                             selectedIntents);
-        Set<Intent> secondary = new HashSet<>(selectedIntents);
-        secondary.removeAll(primary);
+            List<Intent> primary =
+                    intentFilter.findPathIntents(hoverSelHosts, hoverSelDevices,
+                                                 selectedIntents);
+            Set<Intent> secondary = new HashSet<>(selectedIntents);
+            secondary.removeAll(primary);
 
-        // Send a message to highlight all links of all monitored intents.
-        sendMessage(trafficMessage(sid, new TrafficClass("primary", primary),
-                                   new TrafficClass("secondary", secondary)));
+            // Send a message to highlight all links of all monitored intents.
+            sendMessage(trafficMessage(sid, new TrafficClass("primary", primary),
+                                       new TrafficClass("secondary", secondary)));
+        }
     }
 
     // Requests next of the related intents.
@@ -522,6 +522,9 @@
     // Requests monitoring of traffic for the selected intent.
     private void requestSelectedIntentTraffic(ObjectNode event) {
         if (haveSelectedIntents()) {
+            if (currentIntentIndex < 0) {
+                currentIntentIndex = 0;
+            }
             Intent selectedIntent = selectedIntents.get(currentIntentIndex);
             log.info("Requested traffic for selected {}", selectedIntent.id());
 
diff --git a/web/gui/src/main/webapp/onosQuickHelp.css b/web/gui/src/main/webapp/onosQuickHelp.css
index 847a43d..eb400cf 100644
--- a/web/gui/src/main/webapp/onosQuickHelp.css
+++ b/web/gui/src/main/webapp/onosQuickHelp.css
@@ -36,7 +36,7 @@
 }
 
 #quickhelp svg text.title {
-    font-size: 10pt;
+    font-size: 8pt;
     font-style: italic;
     text-anchor: middle;
     fill: #999;
@@ -52,17 +52,17 @@
 }
 
 #quickhelp svg text {
-    font-size: 7pt;
+    font-size: 5pt;
     alignment-baseline: middle;
 }
 
 #quickhelp svg text.key {
-    font-size: 7pt;
+    font-size: 5pt;
     fill: #add;
 }
 
 #quickhelp svg text.desc {
-    font-size: 7pt;
+    font-size: 5pt;
     fill: #ddd;
 }
 
diff --git a/web/gui/src/main/webapp/onosQuickHelp.js b/web/gui/src/main/webapp/onosQuickHelp.js
index 9e2a5ec..1e3507d 100644
--- a/web/gui/src/main/webapp/onosQuickHelp.js
+++ b/web/gui/src/main/webapp/onosQuickHelp.js
@@ -74,7 +74,7 @@
     // layout configuration
     var pad = 8,
         offy = 45,
-        dy = 14,
+        dy = 10,
         offDesc = 8;
 
     // D3 magic