File: view\InfoPanelView.js
- /*
- * BGPlay.js #9660
- * A web-based service for the visualization of the Internet routing
- *
- * Copyright (c) 2012 Roma Tre University and RIPE NCC
- *
- * See the file LICENSE.txt for copying permission.
- */
-
- /**
- * InfoPanelView provides a panel in which the other modules can publish information.
- * Template: infoPanel.html
- * @class InfoPanelView
- * @module modules
- */
- var InfoPanelView=Backbone.View.extend({
-
- /**
- * The initialization method of this object.
- * @method initialize
- * @param {Map} A map of parameters
- */
- initialize:function(){
- this.environment=this.options.environment;
- this.bgplay=this.environment.bgplay;
- this.fileRoot=this.environment.fileRoot;
- this.eventAggregator=this.environment.eventAggregator;
-
- this.eventAggregator.trigger("moduleLoading", true);
- this.el=this.options.el;
-
- this.eventAggregator.on("destroyAll", function(){
- this.destroyMe();
- },this);
-
- this.eventAggregator.on('selectedNode',function(node){
- this.node=node;
- this.render()
- },this);
-
- this.eventAggregator.on('infoPanelReleased',function(released){
- this.node=null;
- this.path=null;
- this.render();
- },this);
-
- this.eventAggregator.on("selectedPath",function(pathView){
- this.path=pathView.path;
- this.pathString=this.path.toString();
- this.pathStatistics=pathView.getStatistics();
- this.render();
- },this);
-
- this.bgplay.on('change:cur_instant',function(){
- this.lastEvent=this.bgplay.get("allEvents").get(this.bgplay.get("cur_instant"));
- this.render();
- },this);
-
- this.render();
- log("InfoPanel view loaded.");
- this.eventAggregator.trigger("moduleLoading", false);
- },
- url:'infoPanel',
-
- /**
- * This method draws this module (eg. inject the DOM and elements).
- * @method render
- */
- render:function(){
- parseTemplate('infoPanel.html',this,this.el);
- rotateTextInElement(this.$el.find('.bgplayTitle'));
- return this;
- }
- });
-