API Docs for:
Show:

File: view\InfoPanelView.js

  1. /*
  2. * BGPlay.js #9660
  3. * A web-based service for the visualization of the Internet routing
  4. *
  5. * Copyright (c) 2012 Roma Tre University and RIPE NCC
  6. *
  7. * See the file LICENSE.txt for copying permission.
  8. */
  9.  
  10. /**
  11. * InfoPanelView provides a panel in which the other modules can publish information.
  12. * Template: infoPanel.html
  13. * @class InfoPanelView
  14. * @module modules
  15. */
  16. var InfoPanelView=Backbone.View.extend({
  17.  
  18. /**
  19. * The initialization method of this object.
  20. * @method initialize
  21. * @param {Map} A map of parameters
  22. */
  23. initialize:function(){
  24. this.environment=this.options.environment;
  25. this.bgplay=this.environment.bgplay;
  26. this.fileRoot=this.environment.fileRoot;
  27. this.eventAggregator=this.environment.eventAggregator;
  28.  
  29. this.eventAggregator.trigger("moduleLoading", true);
  30. this.el=this.options.el;
  31.  
  32. this.eventAggregator.on("destroyAll", function(){
  33. this.destroyMe();
  34. },this);
  35.  
  36. this.eventAggregator.on('selectedNode',function(node){
  37. this.node=node;
  38. this.render()
  39. },this);
  40.  
  41. this.eventAggregator.on('infoPanelReleased',function(released){
  42. this.node=null;
  43. this.path=null;
  44. this.render();
  45. },this);
  46.  
  47. this.eventAggregator.on("selectedPath",function(pathView){
  48. this.path=pathView.path;
  49. this.pathString=this.path.toString();
  50. this.pathStatistics=pathView.getStatistics();
  51. this.render();
  52. },this);
  53.  
  54. this.bgplay.on('change:cur_instant',function(){
  55. this.lastEvent=this.bgplay.get("allEvents").get(this.bgplay.get("cur_instant"));
  56. this.render();
  57. },this);
  58.  
  59. this.render();
  60. log("InfoPanel view loaded.");
  61. this.eventAggregator.trigger("moduleLoading", false);
  62. },
  63. url:'infoPanel',
  64.  
  65. /**
  66. * This method draws this module (eg. inject the DOM and elements).
  67. * @method render
  68. */
  69. render:function(){
  70. parseTemplate('infoPanel.html',this,this.el);
  71. rotateTextInElement(this.$el.find('.bgplayTitle'));
  72. return this;
  73. }
  74. });