GUI -- TopoView - Linking Oblique module in.
- updated oblique test scenario events.

Change-Id: I590f22fbbc356c564cefe8d87e73fed701d88f98
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index e8266ff..89e2706 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -28,7 +28,7 @@
     ];
 
     // references to injected services etc.
-    var $log, fs, ks, zs, gs, ms, sus, flash, tes, tfs, tps, tis, tss, tts;
+    var $log, fs, ks, zs, gs, ms, sus, flash, tes, tfs, tps, tis, tss, tts, tos;
 
     // DOM elements
     var ovtopo, svg, defs, zoomLayer, mapG, forceG, noDevsLayer;
@@ -52,7 +52,7 @@
             //P: togglePorts,
 
             //X: [toggleNodeLock, 'Lock / unlock node positions'],
-            //Z: [toggleOblique, 'Toggle oblique view (Experimental)'],
+            Z: [tos.toggleOblique, 'Toggle oblique view (Experimental)'],
             L: [tfs.cycleDeviceLabels, 'Cycle device labels'],
             U: [tfs.unpin, 'Unpin node (hover mouse over)'],
             R: [resetZoom, 'Reset pan / zoom'],
@@ -214,10 +214,11 @@
             'GlyphService', 'MapService', 'SvgUtilService', 'FlashService',
             'TopoEventService', 'TopoForceService', 'TopoPanelService',
             'TopoInstService', 'TopoSelectService', 'TopoTrafficService',
+            'TopoObliqueService',
 
         function ($scope, _$log_, $loc, $timeout, _fs_, mast,
                   _ks_, _zs_, _gs_, _ms_, _sus_, _flash_,
-                  _tes_, _tfs_, _tps_, _tis_, _tss_, _tts_) {
+                  _tes_, _tfs_, _tps_, _tis_, _tss_, _tts_, _tos_) {
             var self = this,
                 projection,
                 dim,
@@ -238,10 +239,14 @@
             flash = _flash_;
             tes = _tes_;
             tfs = _tfs_;
+            // TODO: consider funnelling actions through TopoForceService...
+            //  rather than injecting references to these 'sub-modules',
+            //  just so we can invoke functions on them.
             tps = _tps_;
             tis = _tis_;
             tss = _tss_;
             tts = _tts_;
+            tos = _tos_;
 
             self.notifyResize = function () {
                 svgResized(fs.windowSize(mast.mastHeight()));
diff --git a/web/gui/src/main/webapp/app/view/topo/topoForce.js b/web/gui/src/main/webapp/app/view/topo/topoForce.js
index 334b10b..80a7b63 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoForce.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoForce.js
@@ -23,7 +23,7 @@
     'use strict';
 
     // injected refs
-    var $log, fs, sus, is, ts, flash, tis, tms, tss, tts, fltr,
+    var $log, fs, sus, is, ts, flash, tis, tms, tss, tts, tos, fltr,
         icfg, uplink;
 
     // configuration
@@ -1084,6 +1084,13 @@
         }
     }
 
+    function mkObliqueApi(uplink) {
+        return {
+            node: function () { return node; },
+            link: function () { return link; }
+        };
+    }
+
     function mkFilterApi(uplink) {
         return {
             node: function () { return node; },
@@ -1095,10 +1102,11 @@
     .factory('TopoForceService',
         ['$log', 'FnService', 'SvgUtilService', 'IconService', 'ThemeService',
             'FlashService', 'TopoInstService', 'TopoModelService',
-            'TopoSelectService', 'TopoTrafficService', 'TopoFilterService',
+            'TopoSelectService', 'TopoTrafficService',
+            'TopoObliqueService', 'TopoFilterService',
 
         function (_$log_, _fs_, _sus_, _is_, _ts_, _flash_,
-                  _tis_, _tms_, _tss_, _tts_, _fltr_) {
+                  _tis_, _tms_, _tss_, _tts_, _tos_, _fltr_) {
             $log = _$log_;
             fs = _fs_;
             sus = _sus_;
@@ -1109,6 +1117,7 @@
             tms = _tms_;
             tss = _tss_;
             tts = _tts_;
+            tos = _tos_;
             fltr = _fltr_;
 
             icfg = is.iconConfig();
@@ -1131,6 +1140,7 @@
                 tms.initModel(mkModelApi(uplink), dim);
                 tss.initSelect(mkSelectApi(uplink));
                 tts.initTraffic(mkTrafficApi(uplink));
+                tos.initOblique(mkObliqueApi(uplink));
                 fltr.initFilter(mkFilterApi(uplink), d3.select('#mast-right'));
 
                 settings = angular.extend({}, defaultSettings, opts);
@@ -1167,6 +1177,7 @@
 
             function destroyForce() {
                 fltr.destroyFilter();
+                tos.destroyOblique();
                 tts.destroyTraffic();
                 tss.destroySelect();
                 tms.destroyModel();
diff --git a/web/gui/src/main/webapp/app/view/topo/topoOblique.js b/web/gui/src/main/webapp/app/view/topo/topoOblique.js
index 2a2f81f..4b7bc50 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoOblique.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoOblique.js
@@ -38,6 +38,11 @@
 
     // ==========================
 
+
+    function toggleOblique() {
+        $log.log("TOGGLING OBLIQUE VIEW");
+    }
+
 // === -----------------------------------------------------
 // === MODULE DEFINITION ===
 
@@ -57,7 +62,9 @@
 
         return {
             initOblique: initOblique,
-            destroyOblique: destroyOblique
+            destroyOblique: destroyOblique,
+
+            toggleOblique: toggleOblique
         };
     }]);
 }());
diff --git a/web/gui/src/main/webapp/tests/app/view/topo/topoOblique-spec.js b/web/gui/src/main/webapp/tests/app/view/topo/topoOblique-spec.js
index 90c856a..5b8e120 100644
--- a/web/gui/src/main/webapp/tests/app/view/topo/topoOblique-spec.js
+++ b/web/gui/src/main/webapp/tests/app/view/topo/topoOblique-spec.js
@@ -34,9 +34,10 @@
 
     it('should define api functions', function () {
         expect(fs.areFunctions(tos, [
-            'initOblique', 'destroyOblique'
+            'initOblique', 'destroyOblique', 'toggleOblique'
         ])).toBeTruthy();
     });
 
     // TODO: more tests...
 });
+
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_10_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_10_addLink_2-2b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_10_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_10_addLink_2-2b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_11_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_11_addLink_3-3b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_11_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_11_addLink_3-3b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_12_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_12_addLink_4-4b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_12_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_12_addLink_4-4b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_1_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_1_addDevice_sw1b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_1_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_1_addDevice_sw1b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_2_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_2_addDevice_sw2b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_2_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_2_addDevice_sw2b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_3_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_3_addDevice_sw3b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_3_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_3_addDevice_sw3b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_4_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_4_addDevice_sw4b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_4_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_4_addDevice_sw4b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_5_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_5_addDevice_sw1.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_5_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_5_addDevice_sw1.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_6_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_6_addDevice_sw2.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_6_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_6_addDevice_sw2.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_7_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_7_addDevice_sw3.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_7_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_7_addDevice_sw3.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_8_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_8_addDevice_sw4.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_8_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_8_addDevice_sw4.json
diff --git a/web/gui/src/test/_karma/ev/oblique/ev_9_onos.json b/web/gui/src/test/_karma/ev/oblique/ev_9_addLink_1-1b.json
similarity index 100%
rename from web/gui/src/test/_karma/ev/oblique/ev_9_onos.json
rename to web/gui/src/test/_karma/ev/oblique/ev_9_addLink_1-1b.json
diff --git a/web/gui/src/test/_karma/ev/oblique/scenario.json b/web/gui/src/test/_karma/ev/oblique/scenario.json
index 7b349ea..ff55c18 100644
--- a/web/gui/src/test/_karma/ev/oblique/scenario.json
+++ b/web/gui/src/test/_karma/ev/oblique/scenario.json
@@ -4,8 +4,6 @@
     "lastAuto": 8
   },
   "description": [
-    "Test Scenario for Oblique view",
-    "",
-    "Press '=' to load initial events."
+    "Test Scenario for Oblique view"
   ]
 }