text: /**
   * MassEnterComponent component.
   */
  MassEnterComponent.DrawComponent = {
      ext_lang: 'mass_enter_component',
      formats: ['format_mass_enter_json'],
      struct_support: true,
      factory: function (sandbox) {
          return new MassEnterComponent.DrawWindow(sandbox);
      }
  };
  
  MassEnterComponent.DrawWindow = function (sandbox) {
      this.sandbox = sandbox;
      this.paintPanel = new MassEnterComponent.PaintPanel(this.sandbox.container);
      this.paintPanel.init();
      this.recieveData = function (data) {
          console.log("in recieve data" + data);
      };
  
      var scElements = {};
  
      function drawAllElements() {
          var dfd = new jQuery.Deferred();
         // for (var addr in scElements) {
              jQuery.each(scElements, function(j, val){
                  var obj = scElements[j];
                  if (!obj || obj.translated) return;
  // check if object is an arc
                  if (obj.data.type & sc_type_arc_pos_const_perm) {
                      var begin = obj.data.begin;
                      var end = obj.data.end;
                      // logic for component update should go here
                  }
  
          });
          SCWeb.ui.Locker.hide();
          dfd.resolve();
          return dfd.promise();
      }
  
  // resolve keynodes
      var self = this;
      this.needUpdate = false;
      this.requestUpdate = function () {
          var updateVisual = function () {
  // check if object is an arc
              var dfd1 = drawAllElements();
              dfd1.done(function (r) {
                  return;
              });
  
  
  /// @todo: Don't update if there are no new elements
              window.clearTimeout(self.structTimeout);
              delete self.structTimeout;
              if (self.needUpdate)
                  self.requestUpdate();
              return dfd1.promise();
          };
          self.needUpdate = true;
          if (!self.structTimeout) {
              self.needUpdate = false;
              SCWeb.ui.Locker.show();
              self.structTimeout = window.setTimeout(updateVisual, 1000);
          }
      }
      
      this.eventStructUpdate = function (added, element, arc) {
          window.sctpClient.get_arc(arc).done(function (r) {
              var addr = r[1];
              window.sctpClient.get_element_type(addr).done(function (t) {
                  var type = t;
                  var obj = new Object();
                  obj.data = new Object();
                  obj.data.type = type;
                  obj.data.addr = addr;
                  if (type & sc_type_arc_mask) {
                      window.sctpClient.get_arc(addr).done(function (a) {
                          obj.data.begin = a[0];
                          obj.data.end = a[1];
                          scElements[addr] = obj;
                          self.requestUpdate();
                      });
                  }
              });
          });
      };
  // delegate event handlers
      this.sandbox.eventDataAppend = $.proxy(this.receiveData, this);
      this.sandbox.eventStructUpdate = $.proxy(this.eventStructUpdate, this);
      this.sandbox.updateContent();
  };
  SCWeb.core.ComponentManager.appendComponentInitialize(MassEnterComponent.DrawComponent);