UNPKG

webgme-rosmod

Version:

This repository contains ROSMOD developed for WebGME. ROSMOD is a web-based, collaborative, modeling and execution environment for distributed embedded applications built using ROS http://rosmod.rcps.isis.vanderbilt.edu

112 lines (88 loc) 3.59 kB
/*globals define, _, WebGMEGlobal*/ /*jshint browser: true*/ /** * Generated by VisualizerGenerator 0.1.0 from webgme on Wed Apr 06 2016 14:15:27 GMT-0500 (CDT). */ define(['js/PanelBase/PanelBase', 'js/PanelManager/IActivePanel', 'widgets/ResultsViz/ResultsVizWidget', './ResultsVizControl' ], function (PanelBaseWithHeader, IActivePanel, ResultsVizWidget, ResultsVizControl) { 'use strict'; var ResultsVizPanel; ResultsVizPanel = function (layoutManager, params) { var options = {}; //set properties from options options[PanelBaseWithHeader.OPTIONS.LOGGER_INSTANCE_NAME] = 'ResultsVizPanel'; 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(ResultsVizPanel.prototype, PanelBaseWithHeader.prototype); _.extend(ResultsVizPanel.prototype, IActivePanel.prototype); ResultsVizPanel.prototype._initialize = function () { var self = this; this.widget = new ResultsVizWidget({ logger: this.logger, container: this.$el, client: this._client }); this.widget.setTitle = function (title) { }; this.control = new ResultsVizControl({ logger: this.logger, client: this._client, widget: this.widget }); this.onActivate(); }; /* * * * * * * * Toolbar related Functions * * * * * * * */ ResultsVizPanel.prototype.getSplitPanelToolbarEl = function() { this._splitPanelToolbarEl = IActivePanel.prototype.getSplitPanelToolbarEl.call(this); // Set the size bigger than 40 x 40 and add some padding for the scroll-bar. this._splitPanelToolbarEl.css({ 'padding-right': '10px' }); this.widget._addSplitPanelToolbarBtns(this._splitPanelToolbarEl); return this._splitPanelToolbarEl; }; /* OVERRIDE FROM WIDGET-WITH-HEADER */ /* METHOD CALLED WHEN THE WIDGET'S READ-ONLY PROPERTY CHANGES */ ResultsVizPanel.prototype.onReadOnlyChanged = function (isReadOnly) { //apply parent's onReadOnlyChanged PanelBaseWithHeader.prototype.onReadOnlyChanged.call(this, isReadOnly); }; ResultsVizPanel.prototype.onResize = function (width, height) { this.logger.debug('onResize --> width: ' + width + ', height: ' + height); this.widget.onWidgetContainerResize(width, height); }; /* * * * * * * * Visualizer life cycle callbacks * * * * * * * */ ResultsVizPanel.prototype.destroy = function () { this.control.destroy(); this.widget.destroy(); PanelBaseWithHeader.prototype.destroy.call(this); WebGMEGlobal.KeyboardManager.setListener(undefined); WebGMEGlobal.Toolbar.refresh(); }; ResultsVizPanel.prototype.onActivate = function () { this.widget.onActivate(); this.control.onActivate(); WebGMEGlobal.KeyboardManager.setListener(this.widget); WebGMEGlobal.Toolbar.refresh(); }; ResultsVizPanel.prototype.onDeactivate = function () { this.widget.onDeactivate(); this.control.onDeactivate(); WebGMEGlobal.KeyboardManager.setListener(undefined); WebGMEGlobal.Toolbar.refresh(); }; return ResultsVizPanel; });