home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Utils / Livebrush / Install-LivebrushLite.air / livebrush.swf / scripts / com / livebrush / ui / BucketPropsView.as < prev    next >
Encoding:
Text File  |  2009-10-26  |  1.5 KB  |  55 lines

  1. package com.livebrush.ui
  2. {
  3.    import com.livebrush.data.Settings;
  4.    import com.livebrush.events.UpdateEvent;
  5.    import com.livebrush.utils.Update;
  6.    
  7.    public class BucketPropsView extends UIView
  8.    {
  9.       public var uiAsset:BucketPropsUI;
  10.       
  11.       public function BucketPropsView(ui:UI)
  12.       {
  13.          super(ui);
  14.          helpID = "bucketTool";
  15.          init();
  16.       }
  17.       
  18.       override protected function createView() : void
  19.       {
  20.          this.uiAsset = new BucketPropsUI();
  21.          this.uiAsset.cacheAsBitmap = true;
  22.          this.uiAsset.colorHead.label.text = "Color".toUpperCase();
  23.          this.uiAsset.alphaInput.label = "Opacity".toUpperCase();
  24.          this.uiAsset.alphaInput.value = 100;
  25.       }
  26.       
  27.       override public function set settings(data:Settings) : void
  28.       {
  29.          this.uiAsset.colorInput.color = data.color;
  30.       }
  31.       
  32.       override public function update(update:Update = null) : void
  33.       {
  34.          if(update.type == UpdateEvent.COLOR)
  35.          {
  36.             this.settings = Settings(update.data);
  37.          }
  38.       }
  39.       
  40.       override public function get settings() : Settings
  41.       {
  42.          var settings:Settings = new Settings();
  43.          settings.color = this.uiAsset.colorInput.color;
  44.          settings.alpha = Number(this.uiAsset.alphaInput.value) / 100;
  45.          return settings;
  46.       }
  47.       
  48.       override protected function createController() : void
  49.       {
  50.          controller = new BucketPropsController(this);
  51.       }
  52.    }
  53. }
  54.  
  55.