home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / mx / controls / listClasses / ListBaseContentHolder.as < prev    next >
Encoding:
Text File  |  2010-06-23  |  3.7 KB  |  135 lines

  1. package mx.controls.listClasses
  2. {
  3.    import flash.display.Graphics;
  4.    import flash.display.Shape;
  5.    import flash.display.Sprite;
  6.    import mx.collections.IViewCursor;
  7.    import mx.core.FlexShape;
  8.    import mx.core.FlexSprite;
  9.    import mx.core.UIComponent;
  10.    import mx.core.mx_internal;
  11.    
  12.    use namespace mx_internal;
  13.    
  14.    public class ListBaseContentHolder extends UIComponent
  15.    {
  16.       mx_internal static const VERSION:String = "3.5.0.12683";
  17.       
  18.       public var listItems:Array;
  19.       
  20.       public var topOffset:Number = 0;
  21.       
  22.       public var rightOffset:Number = 0;
  23.       
  24.       private var maskShape:Shape;
  25.       
  26.       public var selectionLayer:Sprite;
  27.       
  28.       private var parentList:ListBase;
  29.       
  30.       public var iterator:IViewCursor;
  31.       
  32.       public var rowInfo:Array;
  33.       
  34.       public var bottomOffset:Number = 0;
  35.       
  36.       public var leftOffset:Number = 0;
  37.       
  38.       public var visibleData:Object;
  39.       
  40.       mx_internal var allowItemSizeChangeNotification:Boolean = true;
  41.       
  42.       public function ListBaseContentHolder(param1:ListBase)
  43.       {
  44.          var _loc2_:Graphics = null;
  45.          visibleData = {};
  46.          listItems = [];
  47.          rowInfo = [];
  48.          super();
  49.          this.parentList = param1;
  50.          setStyle("backgroundColor","");
  51.          setStyle("borderStyle","none");
  52.          if(!selectionLayer)
  53.          {
  54.             selectionLayer = new FlexSprite();
  55.             selectionLayer.name = "selectionLayer";
  56.             selectionLayer.mouseEnabled = false;
  57.             addChild(selectionLayer);
  58.             _loc2_ = selectionLayer.graphics;
  59.             _loc2_.beginFill(0,0);
  60.             _loc2_.drawRect(0,0,10,10);
  61.             _loc2_.endFill();
  62.          }
  63.       }
  64.       
  65.       override public function set focusPane(param1:Sprite) : void
  66.       {
  67.          var _loc2_:Graphics = null;
  68.          if(param1)
  69.          {
  70.             if(!maskShape)
  71.             {
  72.                maskShape = new FlexShape();
  73.                maskShape.name = "mask";
  74.                _loc2_ = maskShape.graphics;
  75.                _loc2_.beginFill(16777215);
  76.                _loc2_.drawRect(-2,-2,parentList.width + 2,parentList.height + 2);
  77.                _loc2_.endFill();
  78.                addChild(maskShape);
  79.             }
  80.             maskShape.visible = false;
  81.             param1.mask = maskShape;
  82.          }
  83.          else if(parentList.focusPane.mask == maskShape)
  84.          {
  85.             parentList.focusPane.mask = null;
  86.          }
  87.          parentList.focusPane = param1;
  88.          param1.x = x;
  89.          param1.y = y;
  90.       }
  91.       
  92.       public function get heightExcludingOffsets() : Number
  93.       {
  94.          return height + topOffset - bottomOffset;
  95.       }
  96.       
  97.       public function get widthExcludingOffsets() : Number
  98.       {
  99.          return width + leftOffset - rightOffset;
  100.       }
  101.       
  102.       override public function invalidateSize() : void
  103.       {
  104.          if(mx_internal::allowItemSizeChangeNotification)
  105.          {
  106.             parentList.invalidateList();
  107.          }
  108.       }
  109.       
  110.       mx_internal function getParentList() : ListBase
  111.       {
  112.          return parentList;
  113.       }
  114.       
  115.       override protected function updateDisplayList(param1:Number, param2:Number) : void
  116.       {
  117.          super.updateDisplayList(param1,param2);
  118.          var _loc3_:Graphics = selectionLayer.graphics;
  119.          _loc3_.clear();
  120.          if(param1 > 0 && param2 > 0)
  121.          {
  122.             _loc3_.beginFill(8421504,0);
  123.             _loc3_.drawRect(0,0,param1,param2);
  124.             _loc3_.endFill();
  125.          }
  126.          if(maskShape)
  127.          {
  128.             maskShape.width = param1;
  129.             maskShape.height = param2;
  130.          }
  131.       }
  132.    }
  133. }
  134.  
  135.