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

100 lines (77 loc) 3.05 kB
/*globals define, _, WebGMEGlobal*/ /*jshint browser: true*/ /** * Generated by VisualizerGenerator 0.1.0 from webgme on Wed Mar 16 2016 12:18:29 GMT-0700 (PDT). */ define(['js/PanelBase/PanelBaseWithHeader', 'js/PanelManager/IActivePanel', 'widgets/RootViz/RootVizWidget', './RootVizControl' ], function (PanelBaseWithHeader, IActivePanel, RootVizWidget, RootVizControl) { 'use strict'; var RootVizPanel; RootVizPanel = function (layoutManager, params) { var options = {}; //set properties from options options[PanelBaseWithHeader.OPTIONS.LOGGER_INSTANCE_NAME] = 'RootVizPanel'; options[PanelBaseWithHeader.OPTIONS.FLOATING_TITLE] = false; //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(RootVizPanel.prototype, PanelBaseWithHeader.prototype); _.extend(RootVizPanel.prototype, IActivePanel.prototype); RootVizPanel.prototype._initialize = function () { var self = this; //set Widget title this.setTitle(''); this.widget = new RootVizWidget(this.logger, this.$el, this._client); this.widget.setTitle = function (title) { self.setTitle(title); }; this.control = new RootVizControl({ 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 */ RootVizPanel.prototype.onReadOnlyChanged = function (isReadOnly) { //apply parent's onReadOnlyChanged PanelBaseWithHeader.prototype.onReadOnlyChanged.call(this, isReadOnly); }; RootVizPanel.prototype.onResize = function (width, height) { this.logger.debug('onResize --> width: ' + width + ', height: ' + height); this.widget.onWidgetContainerResize(width, height); }; /* * * * * * * * Visualizer life cycle callbacks * * * * * * * */ RootVizPanel.prototype.destroy = function () { this.control.destroy(); this.widget.destroy(); PanelBaseWithHeader.prototype.destroy.call(this); WebGMEGlobal.KeyboardManager.setListener(undefined); WebGMEGlobal.Toolbar.refresh(); }; RootVizPanel.prototype.onActivate = function () { this.widget.onActivate(); this.control.onActivate(); WebGMEGlobal.KeyboardManager.setListener(this.widget); WebGMEGlobal.Toolbar.refresh(); }; RootVizPanel.prototype.onDeactivate = function () { this.widget.onDeactivate(); this.control.onDeactivate(); WebGMEGlobal.KeyboardManager.setListener(undefined); WebGMEGlobal.Toolbar.refresh(); }; return RootVizPanel; });