home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- import com.livebrush.data.Settings;
- import com.livebrush.events.UpdateEvent;
- import com.livebrush.utils.Update;
-
- public class BucketPropsView extends UIView
- {
- public var uiAsset:BucketPropsUI;
-
- public function BucketPropsView(ui:UI)
- {
- super(ui);
- helpID = "bucketTool";
- init();
- }
-
- override protected function createView() : void
- {
- this.uiAsset = new BucketPropsUI();
- this.uiAsset.cacheAsBitmap = true;
- this.uiAsset.colorHead.label.text = "Color".toUpperCase();
- this.uiAsset.alphaInput.label = "Opacity".toUpperCase();
- this.uiAsset.alphaInput.value = 100;
- }
-
- override public function set settings(data:Settings) : void
- {
- this.uiAsset.colorInput.color = data.color;
- }
-
- override public function update(update:Update = null) : void
- {
- if(update.type == UpdateEvent.COLOR)
- {
- this.settings = Settings(update.data);
- }
- }
-
- override public function get settings() : Settings
- {
- var settings:Settings = new Settings();
- settings.color = this.uiAsset.colorInput.color;
- settings.alpha = Number(this.uiAsset.alphaInput.value) / 100;
- return settings;
- }
-
- override protected function createController() : void
- {
- controller = new BucketPropsController(this);
- }
- }
- }
-
-