home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- import com.livebrush.data.FileManager;
- import com.livebrush.data.Settings;
- import com.livebrush.events.*;
- import com.livebrush.styles.StyleManager;
- import com.livebrush.utils.Update;
-
- public class BrushPropsModel extends UIModel
- {
- public static const BEHAVIOR:String = "behavorProps";
-
- public var lineStyleView:LineStyleView;
-
- public var currentGroup:int = 0;
-
- public var decoStyleView:DecoStyleView;
-
- public var brushBehaveView:BrushBehaveView;
-
- public var brushPropsView:BrushPropsView;
-
- public var propGroups:Array;
-
- public var ui:UI;
-
- public function BrushPropsModel(ui:UI)
- {
- super();
- this.ui = ui;
- this.init();
- }
-
- public function toggleProps(index:int) : void
- {
- this.currentGroup = index;
- updateViews(Update.uiUpdate());
- }
-
- public function pullStyleProps() : void
- {
- var settings:Settings = new Settings();
- settings.list = this.ui.styleListView.settings;
- settings.behavior = this.brushBehaveView.settings;
- settings.line = this.lineStyleView.settings;
- settings.deco = this.decoStyleView.settings;
- this.styleManager.pullStyle(settings);
- }
-
- public function removeStyle(id:int) : void
- {
- this.ui.styleManager.removeStyle(id);
- }
-
- private function init() : void
- {
- this.brushPropsView = BrushPropsView(registerView(new BrushPropsView(this)));
- this.brushBehaveView = BrushBehaveView(registerView(new BrushBehaveView(this)));
- this.lineStyleView = LineStyleView(registerView(new LineStyleView(this)));
- this.decoStyleView = DecoStyleView(registerView(new DecoStyleView(this)));
- this.propGroups = [this.brushBehaveView,this.lineStyleView,this.decoStyleView];
- this.toggleProps(0);
- }
-
- public function createStyle(name:String = null) : void
- {
- this.styleManager.createStyle(name == null || name == "" ? this.styleManager.activeStyle.name : name);
- }
-
- public function importStyle() : void
- {
- this.ui.main.importToProject(FileManager.STYLE);
- }
-
- public function get styleManager() : StyleManager
- {
- return this.ui.styleManager;
- }
-
- public function exportStyle() : void
- {
- this.ui.main.export(FileManager.STYLE);
- }
- }
- }
-
-