ONOS-2186 - GUI Topo Overlay - (WIP)
- Default behaviour is to "unsubdue" each node and link present in the Highlights message.
- Now added ability to tag nodes/links for remaining subdued when rendered
(this needed for BYON application).

Change-Id: I351ee0d135bf3ef8f46102f461a45ee48fe9a5cc
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoJson.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoJson.java
index 8b4b354..91cbc05 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoJson.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/TopoJson.java
@@ -90,20 +90,32 @@
     }
 
     private static ObjectNode json(DeviceHighlight dh) {
-        return objectNode()
+        ObjectNode n = objectNode()
                 .put(ID, dh.elementId());
+        if (dh.subdued()) {
+            n.put(SUBDUE, true);
+        }
+        return n;
     }
 
     private static ObjectNode json(HostHighlight hh) {
-        return objectNode()
+        ObjectNode n = objectNode()
                 .put(ID, hh.elementId());
+        if (hh.subdued()) {
+            n.put(SUBDUE, true);
+        }
+        return n;
     }
 
     private static ObjectNode json(LinkHighlight lh) {
-        return objectNode()
+        ObjectNode n = objectNode()
                 .put(ID, lh.elementId())
                 .put(LABEL, lh.label())
                 .put(CSS, lh.cssClasses());
+        if (lh.subdued()) {
+            n.put(SUBDUE, true);
+        }
+        return n;
     }
 
     /**
diff --git a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
index 6bd7762..7eb45ba 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
@@ -326,7 +326,9 @@
         data.hosts.forEach(function (host) {
             var hdata = api.findNodeById(host.id);
             if (hdata && !hdata.el.empty()) {
-                api.unsupNode(hdata.id, less);
+                if (!host.subdue) {
+                    api.unsupNode(hdata.id, less);
+                }
                 // TODO: further highlighting?
             }
         });
@@ -334,7 +336,9 @@
         data.devices.forEach(function (device) {
             var ddata = api.findNodeById(device.id);
             if (ddata && !ddata.el.empty()) {
-                api.unsupNode(ddata.id, less);
+                if (!device.subdue) {
+                    api.unsupNode(ddata.id, less);
+                }
                 // TODO: further highlighting?
             }
         });
@@ -345,10 +349,13 @@
                 units, portcls, magnitude;
 
             if (ldata && !ldata.el.empty()) {
-                api.unsupLink(ldata.key, less);
+                if (!link.subdue) {
+                    api.unsupLink(ldata.key, less);
+                }
                 ldata.el.classed(link.css, true);
                 ldata.label = lab;
 
+                // TODO: this needs to be pulled out into traffic overlay
                 // inject additional styling for port-based traffic
                 if (fs.endsWith(lab, 'bps')) {
                     units = lab.substring(lab.length-4);