home *** CD-ROM | disk | FTP | other *** search
/ The Complete Idiot's Guide to Microsoft Excel 2010 / CIGExcel.iso / Videos / Flash / controller.swf / scripts / __Packages / mx / controls / Tree.as < prev    next >
Encoding:
Text File  |  2010-09-09  |  19.7 KB  |  671 lines

  1. class mx.controls.Tree extends mx.controls.List
  2. {
  3.    var nodeIcons;
  4.    var invUpdateControl;
  5.    var branchNodes;
  6.    var treeDataProvider;
  7.    var openNodes;
  8.    var nodeList;
  9.    var rowIndex;
  10.    var tween;
  11.    var opening;
  12.    var rows;
  13.    var maskList;
  14.    var rowList;
  15.    var __viewMetrics;
  16.    var __width;
  17.    var __maxHPosition;
  18.    var topRowZ;
  19.    var listContent;
  20.    var __dataProvider;
  21.    var eventAfterTween;
  22.    var invScrollProps;
  23.    var eventPending;
  24.    var vScroller;
  25.    var setSelectedIndex;
  26.    var getSelectedItem;
  27.    var setSelectedIndices;
  28.    var getSelectedItems;
  29.    var nodeIndices;
  30.    var dispatchEvent;
  31.    static var symbolName = "Tree";
  32.    static var symbolOwner = mx.controls.Tree;
  33.    var className = "Tree";
  34.    static var version = "2.0.2.126";
  35.    static var mixIt2 = mx.controls.treeclasses.TreeDataProvider.Initialize(XMLNode);
  36.    var isNewRowStyle = {depthColors:true,indentation:true,disclosureOpenIcon:true,disclosureClosedIcon:true,folderOpenIcon:true,folderClosedIcon:true,defaultLeafIcon:true};
  37.    var __rowRenderer = "TreeRow";
  38.    var isOpening = false;
  39.    var minScrollInterval = 50;
  40.    function Tree()
  41.    {
  42.       super();
  43.    }
  44.    function setIcon(node, iconID, iconID2)
  45.    {
  46.       if(this.nodeIcons == undefined)
  47.       {
  48.          this.nodeIcons = new Object();
  49.       }
  50.       if(iconID2 == undefined)
  51.       {
  52.          iconID2 = iconID;
  53.       }
  54.       var _loc0_ = null;
  55.       var _loc4_ = this.nodeIcons[node.getID()] = {iconID:iconID,iconID2:iconID2};
  56.       this.invUpdateControl = true;
  57.       this.invalidate();
  58.    }
  59.    function getIsBranch(node)
  60.    {
  61.       return node.hasChildNodes() || this.branchNodes[node.getID()] != undefined;
  62.    }
  63.    function setIsBranch(node, branch)
  64.    {
  65.       if(this.branchNodes == undefined)
  66.       {
  67.          this.branchNodes = new Object();
  68.       }
  69.       if(!branch)
  70.       {
  71.          delete this.branchNodes[node.getID()];
  72.       }
  73.       else
  74.       {
  75.          this.branchNodes[node.getID()] = true;
  76.       }
  77.       if(this.isNodeVisible(node))
  78.       {
  79.          this.invUpdateControl = true;
  80.          this.invalidate();
  81.       }
  82.    }
  83.    function getNodeDepth(node)
  84.    {
  85.       var _loc3_ = 0;
  86.       var _loc2_ = node;
  87.       while(_loc2_.parentNode != undefined && _loc2_ != this.treeDataProvider)
  88.       {
  89.          _loc3_ = _loc3_ + 1;
  90.          _loc2_ = _loc2_.parentNode;
  91.       }
  92.       return _loc3_;
  93.    }
  94.    function getIsOpen(node)
  95.    {
  96.       return this.openNodes[node.getID()] == true;
  97.    }
  98.    function setIsOpen(node, open, animate, fireEvent)
  99.    {
  100.       if(!this.getIsBranch(node) || this.getIsOpen(node) == open || this.isOpening)
  101.       {
  102.          return undefined;
  103.       }
  104.       if(open)
  105.       {
  106.          this.openNodes[node.getID()] = open;
  107.       }
  108.       if(this.isNodeVisible(node))
  109.       {
  110.          this.nodeList = this.getDisplayList(node,!open);
  111.          this.rowIndex = this.getDisplayIndex(node) + 1 - this.__vPosition;
  112.          var _loc6_ = Math.min(this.nodeList.length,this.__rowCount - this.rowIndex);
  113.          var _loc13_ = this.getStyle("openDuration");
  114.          if(animate && this.rowIndex < this.__rowCount && _loc6_ > 0 && _loc6_ < 20 && _loc13_ != 0)
  115.          {
  116.             this.tween.endTween();
  117.             this.opening = open;
  118.             this.isOpening = true;
  119.             var _loc7_ = _loc6_ * this.__rowHeight;
  120.             var _loc15_ = this.rowIndex;
  121.             while(_loc15_ < this.__rowCount)
  122.             {
  123.                this.rows[_loc15_].__lastY = this.rows[_loc15_]._y;
  124.                _loc15_ = _loc15_ + 1;
  125.             }
  126.             this.maskList = new Array();
  127.             this.rowList = new Array();
  128.             var _loc4_ = this.__viewMetrics;
  129.             var _loc12_ = !(this.__hScrollPolicy == "on" || this.__hScrollPolicy == "auto") ? this.__width - _loc4_.left - _loc4_.right : this.__width + this.__maxHPosition;
  130.             _loc15_ = 0;
  131.             while(_loc15_ < _loc6_)
  132.             {
  133.                var _loc0_ = null;
  134.                var _loc3_ = this.maskList[_loc15_] = this.attachMovie("BoundingBox","openMask" + _loc15_,2001 + _loc15_);
  135.                _loc3_._width = this.__width - _loc4_.left - _loc4_.right;
  136.                _loc3_._x = _loc4_.left;
  137.                _loc3_._height = _loc7_;
  138.                _loc3_._y = this.rows[this.rowIndex]._y;
  139.                var _loc0_ = null;
  140.                var _loc2_ = this.rowList[_loc15_] = this.listContent.createObject(this.__rowRenderer,"treeRow" + this.topRowZ++,this.topRowZ,{owner:this,styleName:this});
  141.                _loc2_._x = _loc4_.left;
  142.                _loc2_.setSize(_loc12_,this.__rowHeight);
  143.                if(open)
  144.                {
  145.                   _loc2_.drawRow(this.nodeList[_loc15_],"normal");
  146.                   _loc2_._y = this.rows[this.rowIndex]._y - _loc7_ + this.__rowHeight * _loc15_;
  147.                   _loc2_.setMask(_loc3_);
  148.                }
  149.                else
  150.                {
  151.                   var _loc5_ = Math.max(this.__vPosition + this.__rowCount + _loc15_ + this.nodeList.length - _loc6_,this.rowIndex + this.nodeList.length);
  152.                   _loc2_.drawRow(this.__dataProvider.getItemAt(_loc5_),this.getStateAt(_loc5_));
  153.                   _loc2_._y = this.rows[this.__rowCount - 1]._y + (_loc15_ + 1) * this.__rowHeight;
  154.                   this.rows[this.rowIndex + _loc15_].setMask(_loc3_);
  155.                }
  156.                _loc2_.__lastY = _loc2_._y;
  157.                _loc15_ = _loc15_ + 1;
  158.             }
  159.             _loc13_ *= Math.max(_loc6_ / 5,1);
  160.             if(fireEvent)
  161.             {
  162.                this.eventAfterTween = node;
  163.             }
  164.             this.tween = new mx.effects.Tween(this,0,!open ? -1 * _loc7_ : _loc7_,_loc13_,5);
  165.             var _loc16_ = this.getStyle("openEasing");
  166.             if(_loc16_ != undefined)
  167.             {
  168.                this.tween.easingEquation = _loc16_;
  169.             }
  170.          }
  171.          else
  172.          {
  173.             this.isOpening = false;
  174.             if(open)
  175.             {
  176.                this.addItemsAt(this.getDisplayIndex(node) + 1,this.nodeList);
  177.             }
  178.             else
  179.             {
  180.                this.__dataProvider.removeItemsAt(this.getDisplayIndex(node) + 1,this.nodeList.length);
  181.             }
  182.             this.invScrollProps = true;
  183.             if(fireEvent)
  184.             {
  185.                this.eventPending = node;
  186.             }
  187.             this.invalidate();
  188.          }
  189.       }
  190.       if(!open)
  191.       {
  192.          this.openNodes[node.getID()] = open;
  193.       }
  194.       _loc15_ = this.getDisplayIndex(node);
  195.       var _loc14_ = this.rows[_loc15_ - this.__vPosition];
  196.       _loc14_.drawRow(_loc14_.item,this.getStateAt(_loc15_));
  197.    }
  198.    function onTweenUpdate(val)
  199.    {
  200.       var _loc2_ = this.rowIndex;
  201.       while(_loc2_ < this.__rowCount)
  202.       {
  203.          this.rows[_loc2_]._y = this.rows[_loc2_].__lastY + val;
  204.          _loc2_ = _loc2_ + 1;
  205.       }
  206.       _loc2_ = 0;
  207.       while(_loc2_ < this.rowList.length)
  208.       {
  209.          this.rowList[_loc2_]._y = this.rowList[_loc2_].__lastY + val;
  210.          _loc2_ = _loc2_ + 1;
  211.       }
  212.    }
  213.    function onTweenEnd(val)
  214.    {
  215.       var _loc2_ = this.rowIndex;
  216.       while(_loc2_ < this.__rowCount)
  217.       {
  218.          this.rows[_loc2_]._y = this.rows[_loc2_].__lastY + val;
  219.          delete this.rows[_loc2_].__lastY;
  220.          if(_loc2_ >= this.__rowCount - this.rowList.length && this.opening)
  221.          {
  222.             this.rows[_loc2_].removeMovieClip();
  223.          }
  224.          _loc2_ = _loc2_ + 1;
  225.       }
  226.       _loc2_ = 0;
  227.       while(_loc2_ < this.rowList.length)
  228.       {
  229.          this.rowList[_loc2_]._y = this.rowList[_loc2_].__lastY + val;
  230.          if(this.opening)
  231.          {
  232.             this.rowList[_loc2_].setMask(undefined);
  233.          }
  234.          else
  235.          {
  236.             this.rows[this.rowIndex + _loc2_].removeMovieClip();
  237.          }
  238.          this.maskList[_loc2_].removeMovieClip();
  239.          _loc2_ = _loc2_ + 1;
  240.       }
  241.       this.isOpening = false;
  242.       this.vScroller.scrollPosition = this.__vPosition;
  243.       if(this.opening)
  244.       {
  245.          var _loc4_ = this.rowIndex + this.rowList.length;
  246.          _loc2_ = this.__rowCount - 1;
  247.          while(_loc2_ >= _loc4_)
  248.          {
  249.             this.rows[_loc2_] = this.rows[_loc2_ - this.rowList.length];
  250.             this.rows[_loc2_].rowIndex = _loc2_;
  251.             _loc2_ = _loc2_ - 1;
  252.          }
  253.          _loc2_ = this.rowIndex;
  254.          while(_loc2_ < _loc4_)
  255.          {
  256.             this.rows[_loc2_] = this.rowList[_loc2_ - this.rowIndex];
  257.             this.rows[_loc2_].rowIndex = _loc2_;
  258.             _loc2_ = _loc2_ + 1;
  259.          }
  260.          this.addItemsAt(this.rowIndex + this.__vPosition,this.nodeList);
  261.       }
  262.       else
  263.       {
  264.          var _loc3_ = this.__rowCount - this.rowList.length;
  265.          _loc2_ = this.rowIndex;
  266.          while(_loc2_ < _loc3_)
  267.          {
  268.             this.rows[_loc2_] = this.rows[_loc2_ + this.rowList.length];
  269.             this.rows[_loc2_].rowIndex = _loc2_;
  270.             _loc2_ = _loc2_ + 1;
  271.          }
  272.          _loc2_ = _loc3_;
  273.          while(_loc2_ < this.__rowCount)
  274.          {
  275.             this.rows[_loc2_] = this.rowList[_loc2_ - _loc3_];
  276.             this.rows[_loc2_].rowIndex = _loc2_;
  277.             _loc2_ = _loc2_ + 1;
  278.          }
  279.          this.__dataProvider.removeItemsAt(this.rowIndex + this.__vPosition,this.nodeList.length);
  280.       }
  281.       if(this.eventAfterTween != undefined)
  282.       {
  283.          this.eventPending = this.eventAfterTween;
  284.          this.invalidate();
  285.          delete this.eventAfterTween;
  286.       }
  287.       delete this.tween;
  288.       delete this.invUpdateControl;
  289.    }
  290.    function size(Void)
  291.    {
  292.       this.tween.endTween();
  293.       super.size();
  294.    }
  295.    function setVPosition(pos)
  296.    {
  297.       if(this.isOpening)
  298.       {
  299.          return undefined;
  300.       }
  301.       super.setVPosition(pos);
  302.    }
  303.    function onScroll(evt)
  304.    {
  305.       if(this.isOpening)
  306.       {
  307.          return undefined;
  308.       }
  309.       super.onScroll(evt);
  310.    }
  311.    function addItemsAt(index, arr)
  312.    {
  313.       var _loc4_ = this.__dataProvider.slice(0,index);
  314.       var _loc3_ = this.__dataProvider.slice(index);
  315.       this.__dataProvider = _loc4_.concat(arr,_loc3_);
  316.       this.__dataProvider.addEventListener("modelChanged",this);
  317.       this.modelChanged({eventName:"addItems",firstItem:index,lastItem:index + arr.length - 1});
  318.    }
  319.    function setDataProvider(dP)
  320.    {
  321.       if(this.treeDataProvider != undefined)
  322.       {
  323.          this.treeDataProvider.removeEventListener(this);
  324.       }
  325.       if(typeof dP == "string")
  326.       {
  327.          dP = new XML(dP);
  328.       }
  329.       this.treeDataProvider = dP;
  330.       this.treeDataProvider.isTreeRoot = true;
  331.       this.setIsBranch(this.treeDataProvider,true);
  332.       this.setIsOpen(this.treeDataProvider,true);
  333.       this.setDisplayIndex(this.treeDataProvider,-1);
  334.       this.treeDataProvider.addEventListener("modelChanged",this);
  335.       this.modelChanged({eventName:"updateTree"});
  336.    }
  337.    function getDataProvider()
  338.    {
  339.       return this.treeDataProvider;
  340.    }
  341.    function refresh()
  342.    {
  343.       this.updateControl();
  344.    }
  345.    function addTreeNode(label, data)
  346.    {
  347.       if(this.treeDataProvider == undefined)
  348.       {
  349.          this.setDataProvider(new XML());
  350.       }
  351.       return this.treeDataProvider.addTreeNode(label,data);
  352.    }
  353.    function addTreeNodeAt(index, label, data)
  354.    {
  355.       if(this.treeDataProvider == undefined)
  356.       {
  357.          this.setDataProvider(new XML());
  358.       }
  359.       return this.treeDataProvider.addTreeNodeAt(index,label,data);
  360.    }
  361.    function getTreeNodeAt(index)
  362.    {
  363.       return this.treeDataProvider.getTreeNodeAt(index);
  364.    }
  365.    function removeTreeNodeAt(index)
  366.    {
  367.       return this.treeDataProvider.removeTreeNodeAt(index);
  368.    }
  369.    function removeAll()
  370.    {
  371.       return this.treeDataProvider.removeAll();
  372.    }
  373.    function getNodeDisplayedAt(index)
  374.    {
  375.       return this.__dataProvider.getItemAt(index);
  376.    }
  377.    function modelChanged(eventObj)
  378.    {
  379.       var _loc6_ = eventObj.eventName;
  380.       if(_loc6_ == "updateTree")
  381.       {
  382.          this.__dataProvider = this.getDisplayList(this.treeDataProvider);
  383.          this.__dataProvider.addEventListener("modelChanged",this);
  384.          super.modelChanged({eventName:"updateAll"});
  385.       }
  386.       else if(_loc6_ == "addNode")
  387.       {
  388.          var _loc8_ = eventObj.node;
  389.          if(this.isNodeVisible(_loc8_))
  390.          {
  391.             if(_loc8_.nextSibling != undefined)
  392.             {
  393.                this.setDisplayIndex(_loc8_,this.getDisplayIndex(_loc8_.nextSibling));
  394.             }
  395.             else if(_loc8_.previousSibling != undefined)
  396.             {
  397.                var _loc7_ = this.getDisplayList(_loc8_.previousSibling);
  398.                if(_loc7_.length > 0)
  399.                {
  400.                   this.setDisplayIndex(_loc8_,this.getDisplayIndex(_loc7_.pop()) + 1);
  401.                }
  402.                else
  403.                {
  404.                   this.setDisplayIndex(_loc8_,this.getDisplayIndex(_loc8_.previousSibling) + 1);
  405.                }
  406.             }
  407.             else
  408.             {
  409.                this.setDisplayIndex(_loc8_,this.getDisplayIndex(_loc8_.parentNode) + 1);
  410.             }
  411.             var _loc10_ = this.getDisplayList(_loc8_);
  412.             _loc10_.unshift(_loc8_);
  413.             this.addItemsAt(this.getDisplayIndex(_loc8_),_loc10_);
  414.          }
  415.          else
  416.          {
  417.             this.invUpdateControl = true;
  418.             this.invalidate();
  419.          }
  420.       }
  421.       else if(_loc6_ == "removeNode")
  422.       {
  423.          _loc8_ = eventObj.node;
  424.          var _loc9_ = this.getDisplayIndex(_loc8_);
  425.          if(_loc9_ != undefined)
  426.          {
  427.             var _loc11_ = this.getDisplayList(_loc8_);
  428.             this.__dataProvider.removeItemsAt(_loc9_,_loc11_.length + 1);
  429.          }
  430.       }
  431.       else if(_loc6_ == "addItems")
  432.       {
  433.          super.modelChanged(eventObj);
  434.          var _loc5_ = this.__dataProvider;
  435.          var _loc3_ = eventObj.firstItem;
  436.          while(_loc3_ < _loc5_.length)
  437.          {
  438.             this.setDisplayIndex(_loc5_[_loc3_],_loc3_);
  439.             _loc3_ = _loc3_ + 1;
  440.          }
  441.       }
  442.       else if(_loc6_ == "removeItems")
  443.       {
  444.          _loc5_ = this.__dataProvider;
  445.          _loc3_ = eventObj.firstItem;
  446.          while(_loc3_ < _loc5_.length)
  447.          {
  448.             this.setDisplayIndex(_loc5_[_loc3_],_loc3_);
  449.             _loc3_ = _loc3_ + 1;
  450.          }
  451.          super.modelChanged(eventObj);
  452.       }
  453.       else
  454.       {
  455.          super.modelChanged(eventObj);
  456.       }
  457.    }
  458.    function isNodeVisible(node)
  459.    {
  460.       return this.getDisplayIndex(node) != undefined || this.getDisplayIndex(node.parentNode) != undefined && this.getIsOpen(node.parentNode);
  461.    }
  462.    function getFirstVisibleNode()
  463.    {
  464.       return this.__dataProvider.getItemAt(this.__vPosition);
  465.    }
  466.    function setFirstVisibleNode(node)
  467.    {
  468.       var _loc2_ = this.getDisplayIndex(node);
  469.       if(_loc2_ == undefined)
  470.       {
  471.          return undefined;
  472.       }
  473.       this.setVPosition(_loc2_);
  474.    }
  475.    function set firstVisibleNode(node)
  476.    {
  477.       this.setFirstVisibleNode(node);
  478.    }
  479.    function get firstVisibleNode()
  480.    {
  481.       return this.getFirstVisibleNode();
  482.    }
  483.    function set selectedNode(node)
  484.    {
  485.       var _loc2_ = this.getDisplayIndex(node);
  486.       if(_loc2_ >= 0)
  487.       {
  488.          this.setSelectedIndex(_loc2_);
  489.       }
  490.    }
  491.    function get selectedNode()
  492.    {
  493.       return this.getSelectedItem();
  494.    }
  495.    function set selectedNodes(nodeArray)
  496.    {
  497.       var _loc5_ = new Array();
  498.       var _loc3_ = undefined;
  499.       var _loc2_ = 0;
  500.       while(_loc2_ < nodeArray.length)
  501.       {
  502.          _loc3_ = this.getDisplayIndex(nodeArray[_loc2_]);
  503.          if(_loc3_ != undefined)
  504.          {
  505.             _loc5_.push(_loc3_);
  506.          }
  507.          _loc2_ = _loc2_ + 1;
  508.       }
  509.       this.setSelectedIndices(_loc5_);
  510.    }
  511.    function get selectedNodes()
  512.    {
  513.       return this.getSelectedItems();
  514.    }
  515.    function getDisplayList(node, removed)
  516.    {
  517.       var _loc5_ = new Array();
  518.       if(!this.isNodeVisible(node) || !this.getIsOpen(node))
  519.       {
  520.          return _loc5_;
  521.       }
  522.       var _loc6_ = this.getDisplayIndex(node);
  523.       var _loc3_ = new Array();
  524.       var _loc2_ = node.firstChild;
  525.       var _loc4_ = _loc2_ == undefined;
  526.       while(!_loc4_)
  527.       {
  528.          if(removed)
  529.          {
  530.             this.setDisplayIndex(_loc2_,undefined);
  531.          }
  532.          else
  533.          {
  534.             this.setDisplayIndex(_loc2_,_loc6_ = _loc6_ + 1);
  535.          }
  536.          _loc5_.push(_loc2_);
  537.          if(_loc2_.childNodes.length > 0 && this.getIsOpen(_loc2_))
  538.          {
  539.             if(_loc2_.nextSibling != undefined)
  540.             {
  541.                _loc3_.push(_loc2_.nextSibling);
  542.             }
  543.             _loc2_ = _loc2_.firstChild;
  544.          }
  545.          else if(_loc2_.nextSibling != undefined)
  546.          {
  547.             _loc2_ = _loc2_.nextSibling;
  548.          }
  549.          else if(_loc3_.length == 0)
  550.          {
  551.             _loc4_ = true;
  552.          }
  553.          else
  554.          {
  555.             _loc2_ = _loc3_.pop();
  556.          }
  557.       }
  558.       return _loc5_;
  559.    }
  560.    function getDisplayIndex(node)
  561.    {
  562.       return this.nodeIndices[node.getID()];
  563.    }
  564.    function setDisplayIndex(node, UID)
  565.    {
  566.       this.nodeIndices[node.getID()] = UID;
  567.    }
  568.    function keyDown(e)
  569.    {
  570.       if(this.isOpening)
  571.       {
  572.          return undefined;
  573.       }
  574.       var _loc3_ = this.selectedNode;
  575.       if(e.ctrlKey)
  576.       {
  577.          super.keyDown(e);
  578.       }
  579.       else if(e.code == 32)
  580.       {
  581.          if(this.getIsBranch(_loc3_))
  582.          {
  583.             var _loc6_ = !this.getIsOpen(_loc3_);
  584.             this.setIsOpen(_loc3_,_loc6_,true,true);
  585.          }
  586.       }
  587.       else if(e.code == 37)
  588.       {
  589.          if(this.getIsOpen(_loc3_))
  590.          {
  591.             this.setIsOpen(_loc3_,false,true,true);
  592.          }
  593.          else
  594.          {
  595.             this.selectedNode = _loc3_.parentNode;
  596.             this.dispatchEvent({type:"change"});
  597.             var _loc5_ = this.getDisplayIndex(this.selectedNode);
  598.             if(_loc5_ < this.__vPosition)
  599.             {
  600.                this.setVPosition(_loc5_);
  601.             }
  602.          }
  603.       }
  604.       else if(e.code == 39)
  605.       {
  606.          if(this.getIsBranch(_loc3_))
  607.          {
  608.             if(this.getIsOpen(_loc3_))
  609.             {
  610.                this.selectedNode = _loc3_.firstChild;
  611.                this.dispatchEvent({type:"change"});
  612.             }
  613.             else
  614.             {
  615.                this.setIsOpen(_loc3_,true,true,true);
  616.             }
  617.          }
  618.       }
  619.       else
  620.       {
  621.          super.keyDown(e);
  622.       }
  623.    }
  624.    function init()
  625.    {
  626.       super.init();
  627.       this.openNodes = new Object();
  628.       this.nodeIndices = new Object();
  629.    }
  630.    function invalidateStyle(propName)
  631.    {
  632.       if(this.isNewRowStyle[propName])
  633.       {
  634.          this.invUpdateControl = true;
  635.          this.invalidate();
  636.       }
  637.       super.invalidateStyle(propName);
  638.    }
  639.    function layoutContent(x, y, tW, tH, dW, dH)
  640.    {
  641.       var _loc5_ = 0;
  642.       var _loc6_ = 0;
  643.       var _loc3_ = 0;
  644.       while(_loc3_ < this.rows.length)
  645.       {
  646.          var _loc4_ = this.rows[_loc3_].getDepth();
  647.          if(_loc4_ > _loc5_)
  648.          {
  649.             _loc5_ = _loc4_;
  650.             _loc6_ = _loc3_;
  651.          }
  652.          _loc3_ = _loc3_ + 1;
  653.       }
  654.       var _loc7_ = _loc5_ + this.rows.length - _loc6_;
  655.       if(this.topRowZ < _loc7_)
  656.       {
  657.          this.topRowZ = _loc7_;
  658.       }
  659.       super.layoutContent(x,y,tW,tH,dW,dH);
  660.    }
  661.    function draw(Void)
  662.    {
  663.       super.draw();
  664.       if(this.eventPending != undefined)
  665.       {
  666.          this.dispatchEvent({type:(!this.getIsOpen(this.eventPending) ? "nodeClose" : "nodeOpen"),node:this.eventPending});
  667.          delete this.eventPending;
  668.       }
  669.    }
  670. }
  671.