UNPKG

pads_app

Version:

playground of algorithms for Distributed Systems(PADS)

100 lines (77 loc) 3.11 kB
/*globals define, _, WebGMEGlobal*/ /*jshint browser: true*/ /** * Generated by VisualizerGenerator 1.7.0 from webgme on Mon May 23 2016 13:09:52 GMT-0500 (CDT). */ define(['js/PanelBase/PanelBaseWithHeader', 'js/PanelManager/IActivePanel', 'widgets/Visualizers/VisualizersWidget', './VisualizersControl' ], function (PanelBaseWithHeader, IActivePanel, VisualizersWidget, VisualizersControl) { 'use strict'; var VisualizersPanel; VisualizersPanel = function (layoutManager, params) { var options = {}; //set properties from options options[PanelBaseWithHeader.OPTIONS.LOGGER_INSTANCE_NAME] = 'VisualizersPanel'; options[PanelBaseWithHeader.OPTIONS.FLOATING_TITLE] = true; //call parent's constructor PanelBaseWithHeader.apply(this, [options, layoutManager]); this._client = params.client; //initialize UI this._initialize(); this.logger.debug('ctor finished'); }; //inherit from PanelBaseWithHeader _.extend(VisualizersPanel.prototype, PanelBaseWithHeader.prototype); _.extend(VisualizersPanel.prototype, IActivePanel.prototype); VisualizersPanel.prototype._initialize = function () { var self = this; //set Widget title this.setTitle(''); this.widget = new VisualizersWidget(this.logger, this.$el); this.widget.setTitle = function (title) { self.setTitle(title); }; this.control = new VisualizersControl({ logger: this.logger, client: this._client, widget: this.widget }); this.onActivate(); }; /* OVERRIDE FROM WIDGET-WITH-HEADER */ /* METHOD CALLED WHEN THE WIDGET'S READ-ONLY PROPERTY CHANGES */ VisualizersPanel.prototype.onReadOnlyChanged = function (isReadOnly) { //apply parent's onReadOnlyChanged PanelBaseWithHeader.prototype.onReadOnlyChanged.call(this, isReadOnly); }; VisualizersPanel.prototype.onResize = function (width, height) { this.logger.debug('onResize --> width: ' + width + ', height: ' + height); this.widget.onWidgetContainerResize(width, height); }; /* * * * * * * * Visualizer life cycle callbacks * * * * * * * */ VisualizersPanel.prototype.destroy = function () { this.control.destroy(); this.widget.destroy(); PanelBaseWithHeader.prototype.destroy.call(this); WebGMEGlobal.KeyboardManager.setListener(undefined); WebGMEGlobal.Toolbar.refresh(); }; VisualizersPanel.prototype.onActivate = function () { this.widget.onActivate(); this.control.onActivate(); WebGMEGlobal.KeyboardManager.setListener(this.widget); WebGMEGlobal.Toolbar.refresh(); }; VisualizersPanel.prototype.onDeactivate = function () { this.widget.onDeactivate(); this.control.onDeactivate(); WebGMEGlobal.KeyboardManager.setListener(undefined); WebGMEGlobal.Toolbar.refresh(); }; return VisualizersPanel; });