home *** CD-ROM | disk | FTP | other *** search
- package com.livebrush.ui
- {
- import com.livebrush.Main;
- import com.livebrush.data.FileManager;
- import com.livebrush.data.GlobalSettings;
- import com.livebrush.data.Help;
- import com.livebrush.data.Settings;
- import com.livebrush.data.StateManager;
- import com.livebrush.events.*;
- import com.livebrush.graphics.canvas.Canvas;
- import com.livebrush.graphics.canvas.CanvasManager;
- import com.livebrush.graphics.canvas.Layer;
- import com.livebrush.styles.StyleManager;
- import com.livebrush.tools.*;
- import com.livebrush.utils.Update;
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageDisplayState;
- import flash.display.StageScaleMode;
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.geom.Point;
-
- public class UI extends UIModel
- {
- public static var DIALOG_HOLDER:Sprite;
-
- public static var TOOLTIP_HOLDER:Sprite;
-
- public static var WINDOW_HOLDER:Sprite;
-
- public static var MAIN_UI:UI;
-
- public static var PREVIEW_HOLDER:Sprite;
-
- public static var TOP_UI_HOLDER:Sprite;
-
- public static var UI_HOLDER:Sprite;
-
- public static const WINDOW_MENU_HEIGHT:int = 19;
-
- public static const OPEN:int = 1;
-
- public static const CLOSED:int = 0;
-
- public static const CONSOL_DEPTH:int = 2;
-
- public static var HEIGHT:int = 1280;
-
- public static var WIDTH:int = 1024;
-
- public var titlebarView:TitlebarView;
-
- public var locked:Boolean = false;
-
- public var layersView:LayersView;
-
- private var onCanvas:Boolean = true;
-
- public var brushPropsView:BrushPropsView;
-
- public var transformPropsView:TransformPropsView;
-
- public var styleListView:StyleListView;
-
- public var canvasManager:CanvasManager;
-
- public var visibleState:Number = 0;
-
- public var registeredDialogIDList:Array;
-
- public var globalColorView:GlobalColorView;
-
- public var windowDialogHolder:Sprite;
-
- private var stylePreviewHolder:Sprite;
-
- public var bucketPropsView:BucketPropsView;
-
- public var emptyPropsView:EmptyPropsView;
-
- public var brushPropsModel:BrushPropsModel;
-
- public var toolPropsView:ToolPropsView;
-
- private var tooltipHolder:Sprite;
-
- private var _state:int;
-
- private var _stateManLocked:Boolean = true;
-
- public var newProjectView:NewProjectView;
-
- public var saveImageView:SaveImageView;
-
- public var globalSettingsView:GlobalSettingsView;
-
- private var holder:Sprite;
-
- public var contextMenu:ContextMenuView;
-
- public var samplePropsView:SamplePropsView;
-
- private var mainMenu:MainMenuView;
-
- public var main:Main;
-
- public var styleManager:StyleManager;
-
- private var activeTool:Tool;
-
- public var toolbarView:ToolbarView;
-
- public var projectLoadDialog:Dialog;
-
- public var consol:Consol;
-
- public var aboutView:BasicWindowView;
-
- public var panelState:int = 1;
-
- public var toolManager:ToolManager;
-
- public function UI(owner:Main)
- {
- super();
- this.main = owner;
- this.stylePreviewHolder = PREVIEW_HOLDER = Sprite(this.main.addChild(new Sprite()));
- this.windowDialogHolder = DIALOG_HOLDER = WINDOW_HOLDER = Sprite(this.main.addChild(new Sprite()));
- this.holder = Sprite(owner.addChild(new Sprite()));
- TOP_UI_HOLDER = Sprite(this.main.addChild(new Sprite()));
- this.tooltipHolder = TOOLTIP_HOLDER = Sprite(this.main.addChild(new Sprite()));
- UI_HOLDER = this.holder;
- MAIN_UI = this;
- this.registeredDialogIDList = [];
- this.init();
- }
-
- public static function get windowCenter() : Point
- {
- return new Point(centerX,centerY);
- }
-
- public static function get centerX() : Number
- {
- return UI.MAIN_UI.main.stage.stageWidth / 2;
- }
-
- public static function get centerY() : Number
- {
- return UI.MAIN_UI.main.stage.stageHeight / 2;
- }
-
- public static function setStatus(s:String) : void
- {
- UI.MAIN_UI.titlebarView.status = s;
- }
-
- public function closeWindow(view:UIView) : void
- {
- this.toggle(true);
- if(view == this.aboutView)
- {
- this.aboutView = null;
- }
- unregisterView(view);
- view.die();
- }
-
- public function newDialog(type:String, data:Object = null) : Dialog
- {
- var d:Dialog = null;
- if(data.id == null || data.id != null && this.registeredDialogIDList.indexOf(data.id) == -1)
- {
- this.toggle(false);
- d = new Dialog(type,data);
- registerView(d.dialogView);
- if(data.id != null)
- {
- this.registerDialog(d);
- }
- }
- return d;
- }
-
- private function init() : void
- {
- this.setupAppWindow();
- Tooltip.getInstance();
- this.holder.stage.addEventListener(Event.RESIZE,this.resizeListener);
- this.brushPropsModel = new BrushPropsModel(this);
- this.styleListView = StyleListView(registerView(new StyleListView(this)));
- this.transformPropsView = TransformPropsView(registerView(new TransformPropsView(this)));
- this.emptyPropsView = EmptyPropsView(registerView(new EmptyPropsView(this)));
- this.bucketPropsView = BucketPropsView(registerView(new BucketPropsView(this)));
- this.samplePropsView = SamplePropsView(registerView(new SamplePropsView(this)));
- this.brushPropsView = BrushPropsView(registerView(this.brushPropsModel.brushPropsView));
- this.toolPropsView = ToolPropsView(registerView(new ToolPropsView(this)));
- this.layersView = LayersView(registerView(new LayersView(this)));
- this.toolbarView = ToolbarView(registerView(new ToolbarView(this)));
- this.titlebarView = TitlebarView(registerView(new TitlebarView(this)));
- this.globalColorView = GlobalColorView(registerView(new GlobalColorView(this)));
- this.mainMenu = MainMenuView(registerView(new MainMenuView(this)));
- this.holder.addEventListener(MouseEvent.MOUSE_DOWN,this.guiMouseDown);
- this.styleListView.panel.addEventListener(MouseEvent.MOUSE_DOWN,this.guiMouseDown);
- setStatus("Loading...");
- this.toggle(false);
- this.resizeInterface();
- }
-
- public function set state(s:int) : void
- {
- this._state = s;
- }
-
- public function pushTransformProps(data:Settings) : void
- {
- this.updateViews(Update.transformUpdate(data));
- }
-
- override protected function updateViews(update:Update) : void
- {
- super.updateViews(update);
- this.brushPropsModel.update(update);
- }
-
- public function updateDialogs(update:Update) : void
- {
- for(var i:int = 0; i < views.length; i++)
- {
- if(views[i] is DialogView)
- {
- views[i].update(update);
- }
- }
- }
-
- public function showConsol() : void
- {
- this.holder.addChild(this.consol);
- }
-
- public function showErrorDialog(data:Object = null) : Dialog
- {
- return this.newDialog(Dialog.NOTICE,data);
- }
-
- public function showToolProps(toolProps:UIView) : void
- {
- if(toolProps != null)
- {
- this.toolPropsView.setContent(toolProps["uiAsset"]);
- }
- }
-
- public function showNewProject() : void
- {
- if(this.newProjectView == null)
- {
- this.newProjectView = NewProjectView(this.openWindow(NewProjectView));
- }
- }
-
- public function loadHelp(id:String) : void
- {
- if(id != "")
- {
- Help.loadHelp(id);
- }
- }
-
- public function toggleStylePreview() : void
- {
- this.canvasManager.stylePreviewLayer.toggle();
- if(this.canvasManager.stylePreviewLayer.visible)
- {
- this.canvas.lockContent();
- }
- else
- {
- this.canvas.unlockContent(true);
- }
- }
-
- public function toggleFullScreen() : void
- {
- this.main.stage.displayState = this.main.stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE ? StageDisplayState.NORMAL : StageDisplayState.FULL_SCREEN_INTERACTIVE;
- }
-
- public function toggle(b:Boolean, mainMenuToggle:Boolean = true, canvasToggle:Boolean = true, guiToggle:Boolean = true) : void
- {
- this.locked = !b;
- try
- {
- if(canvasToggle)
- {
- this.canvasManager.canvas.mouseChildren = b;
- }
- }
- catch(e:Error)
- {
- }
- if(guiToggle)
- {
- TOP_UI_HOLDER.mouseChildren = b;
- this.holder.mouseChildren = b;
- }
- if(mainMenuToggle)
- {
- this.mainMenu.toggle(b);
- }
- try
- {
- }
- catch(e:Error)
- {
- }
- }
-
- public function setProject(name:String) : void
- {
- this.updateViews(Update.projectUpdate({"project":name}));
- }
-
- public function pushLayerProps(data:Settings) : void
- {
- this.updateViews(Update.layerUpdate(data));
- }
-
- public function get canvas() : Canvas
- {
- return this.canvasManager.canvas;
- }
-
- public function closeDialog(dialog:Dialog) : void
- {
- this.toggle(true);
- unregisterView(dialog.dialogView);
- var regIndex:int = int(this.registeredDialogIDList.indexOf(dialog.id));
- if(regIndex > -1)
- {
- this.registeredDialogIDList.splice(regIndex,1);
- }
- dialog.dialogView.die();
- }
-
- private function setupAppWindow() : void
- {
- this.main.stage.scaleMode = StageScaleMode.NO_SCALE;
- this.main.stage.align = StageAlign.TOP_LEFT;
- this.main.stage.nativeWindow.x = 50;
- this.main.stage.nativeWindow.y = 40;
- this.main.stage.nativeWindow.minSize = new Point(1100,700);
- }
-
- public function createNewProject(sizeIndex:int) : void
- {
- this.main.newProject(sizeIndex);
- }
-
- private function canvasMouseDown(e:MouseEvent) : void
- {
- if(!this.onCanvas)
- {
- this.onCanvas = true;
- this.mainMenu.toggleEditShortcuts(this.onCanvas);
- }
- }
-
- public function toggleDrawMode(mode:int) : void
- {
- GlobalSettings.DRAW_MODE = mode;
- update(Update.drawModeUpdate({"mode":mode}));
- }
-
- public function closeDialogID(id:String) : void
- {
- var i:int;
- var d:Dialog = null;
- for(i = 0; i < views.length; i++)
- {
- if(views[i] is DialogView)
- {
- if(views[i].id == id)
- {
- d = views[i].dialogModel;
- }
- }
- }
- try
- {
- this.closeDialog(d);
- }
- catch(e:Error)
- {
- }
- }
-
- public function uiUpdate() : void
- {
- this.updateViews(Update.uiUpdate());
- }
-
- public function pushColorProps(data:Settings) : void
- {
- this.styleManager.lockedColorSettings = this.globalColorView.settings;
- this.styleManager.alphaLocked = this.styleManager.lockedColorSettings.alphaLocked;
- this.updateViews(Update.colorUpdate(data));
- }
-
- private function resizeListener(e:Event) : void
- {
- this.resizeInterface();
- }
-
- public function alert(data:Object = null) : Dialog
- {
- return this.newDialog(Dialog.NOTICE,data);
- }
-
- public function toggleGlobalColor() : void
- {
- this.globalColorView.toggle();
- }
-
- public function showGlobalPrefs() : void
- {
- if(this.globalSettingsView == null)
- {
- this.globalSettingsView = GlobalSettingsView(this.openWindow(GlobalSettingsView));
- }
- }
-
- public function get state() : int
- {
- return this._state;
- }
-
- public function showAbout() : void
- {
- if(this.aboutView == null)
- {
- this.aboutView = BasicWindowView(this.openWindow(BasicWindowView,{"message":Main.ABOUT_INFO}));
- }
- }
-
- public function showProcessDialog(data:Object = null) : Dialog
- {
- return this.newDialog(Dialog.PROCESS,data);
- }
-
- public function fileIO(e:FileEvent) : void
- {
- var data:XML = null;
- if(e.action == FileEvent.OPEN || e.action == FileEvent.BATCH_OPEN)
- {
- switch(e.fileType)
- {
- case FileManager.PROJECT:
- }
- }
- }
-
- private function getToolPropsByName(toolName:String) : UIView
- {
- var toolProps:UIView = null;
- switch(toolName)
- {
- case BrushTool.NAME:
- toolProps = this.brushPropsView;
- break;
- case ColorLayerTool.NAME:
- toolProps = this.bucketPropsView;
- break;
- case SampleTool.NAME:
- toolProps = this.bucketPropsView;
- break;
- case TransformTool.NAME:
- toolProps = this.transformPropsView;
- break;
- case PenTool.NAME:
- toolProps = this.brushPropsView;
- }
- return toolProps;
- }
-
- public function toolSelect(toolName:String) : void
- {
- this.toolManager.setToolByName(toolName);
- this.showToolProps(this.getToolPropsByName(toolName));
- }
-
- public function showLoadDialog(data:Object = null) : Dialog
- {
- return this.newDialog(Dialog.LOADING,data);
- }
-
- public function selectTool(toolName:String) : void
- {
- this.toolbarView.toggleTool(this.toolbarView.getBtnByToolName(toolName).name);
- this.showToolProps(this.getToolPropsByName(toolName));
- }
-
- public function promptForNewVersion(e:FileEvent) : void
- {
- var message:String = "";
- if(e.fileType == FileEvent.NEW_VERSION)
- {
- message = "There is a new major version of LiveBrush.\nWould you like more information?";
- this.newDialog(Dialog.QUESTION,{
- "message":message,
- "yesFunction":function():*
- {
- FileManager.getURL(Main.HOME_LINK);
- }
- });
- }
- else if(e.fileType == FileEvent.UPDATE_VERSION)
- {
- message = "There is a free update available (" + e.data.newVersion + ").\n" + "Your current version is: " + e.data.currentVersion;
- message += "\nWould you like to download and install this update?";
- this.newDialog(Dialog.QUESTION,{
- "message":message,
- "yesFunction":function():*
- {
- FileManager.getURL(Main.UPDATE_LINK);
- }
- });
- }
- else if(e.fileType == FileEvent.CURRENT_VERSION)
- {
- message = "You have the most recent version of Livebrush\nVersion " + e.data.currentVersion;
- this.newDialog(Dialog.NOTICE,{"message":message});
- }
- }
-
- public function mainMenuEvent(e:Event) : void
- {
- if((StateManager.state == StateManager.CLOSED && !this.toolManager.activeTool.isRunning || e.target.name == "togglePreview") && (this.registeredDialogIDList.length == 0 && !this.locked) || e.target.name == "stopAllBrushes" || e.target.name == "stopLastBrush")
- {
- switch(e.target.name)
- {
- case "new":
- this.main.saveFirst(this.main.newProject);
- break;
- case "open":
- this.main.openProject();
- break;
- case "save":
- this.main.saveProject();
- break;
- case "saveAs":
- this.main.saveProjectAs();
- break;
- case "saveImage":
- this.main.saveAsImage(0,true);
- break;
- case "saveLayerImage":
- this.main.export(FileManager.LAYER_IMAGE);
- break;
- case "revert":
- this.main.revertProject();
- break;
- case "cleanup":
- this.confirmActionDialog({
- "message":"This action removes project assets that are not being used. This action cannot be undone.\nWould you like to continue?",
- "yesFunction":this.main.cleanupProject,
- "id":"cleanupConfirm"
- });
- break;
- case "exit":
- this.main.exit();
- break;
- case "importProject":
- this.confirmActionDialog({
- "message":"This action will also cause your undo-history to be reset.\n\nWould you like to continue?",
- "yesFunction":this.main.importToProject,
- "yesProps":[FileManager.PROJECT],
- "id":"importConfirm"
- });
- break;
- case "importDeco":
- this.main.importToProject(FileManager.DECO);
- break;
- case "importDecoSet":
- this.main.importToProject(FileManager.DECOSET);
- break;
- case "importImage":
- this.confirmActionDialog({
- "message":"This action will also cause your undo-history to be reset.\n\nWould you like to continue?",
- "yesFunction":this.main.importToProject,
- "yesProps":[FileManager.LAYER_IMAGE],
- "id":"importConfirm"
- });
- break;
- case "importStyle":
- this.main.importToProject(FileManager.STYLE);
- break;
- case "importInputSWF":
- this.main.importInputSWF();
- break;
- case "exportSVG":
- this.main.export(FileManager.SVG);
- break;
- case "exportDecoSet":
- this.main.export(FileManager.DECOSET);
- break;
- case "exportStyle":
- this.main.export(FileManager.STYLE);
- break;
- case "exportLayer":
- this.main.export(FileManager.LAYER_IMAGE);
- break;
- case "undo":
- this.activeTool = this.toolManager.activeTool;
- StateManager.stepBack();
- this.toolManager.setTool(this.activeTool);
- break;
- case "redo":
- this.activeTool = this.toolManager.activeTool;
- StateManager.stepForward();
- this.toolManager.setTool(this.activeTool);
- break;
- case "cut":
- this.canvasManager.copyContent(true);
- break;
- case "copy":
- this.canvasManager.copyContent();
- break;
- case "paste":
- this.canvasManager.pasteContent();
- break;
- case "delete":
- this.canvasManager.deleteContent();
- break;
- case "selectAll":
- this.canvasManager.selectAll();
- break;
- case "deselectAll":
- this.canvasManager.deselectAll();
- break;
- case "showGlobalPrefs":
- this.showGlobalPrefs();
- break;
- case "flattenLayers":
- this.canvasManager.flattenLayers();
- break;
- case "dupLayer":
- this.canvasManager.dupLayer(this.canvasManager.activeLayerDepth);
- break;
- case "applyStyle":
- this.canvasManager.applyLineStyle();
- break;
- case "simplifyLine":
- this.canvasManager.simplifyLine();
- break;
- case "subdivideLine":
- this.canvasManager.subdivideLine();
- break;
- case "toStraightLine":
- this.canvasManager.convertLine(false);
- break;
- case "toSmoothLine":
- this.canvasManager.convertLine(true);
- break;
- case "redrawLayers":
- this.canvasManager.refreshLayers();
- break;
- case "copyEdgeDecos":
- this.confirmActionDialog({
- "message":"This action will also cause your undo-history to be reset.\nThe source layers will remain intact.\nWould you like to continue?",
- "yesFunction":this.canvasManager.detachEdgeDecosToLayers,
- "yesProps":[true],
- "id":"detachConfirm"
- });
- break;
- case "removeEdgeDecos":
- this.canvasManager.removeEdgeDecos();
- break;
- case "layerToDeco":
- this.canvasManager.layerToDeco(this.canvasManager.activeLayerDepth + 1,false,false);
- break;
- case "copyLayerToDeco":
- this.canvasManager.layerToDeco(this.canvasManager.activeLayerDepth + 1,true,false);
- break;
- case "iLayerToDeco":
- this.canvasManager.layerToDeco(this.canvasManager.activeLayerDepth + 1,false);
- break;
- case "iCopyLayerToDeco":
- this.canvasManager.layerToDeco(this.canvasManager.activeLayerDepth + 1,true);
- break;
- case "rotateClock":
- this.canvasManager.rotateLayer(90);
- break;
- case "rotateCounter":
- this.canvasManager.rotateLayer(-90);
- break;
- case "flipX":
- this.canvasManager.flipLayer(-1,1);
- break;
- case "flipY":
- this.canvasManager.flipLayer(1,-1);
- break;
- case "resetScale":
- this.canvasManager.resetLayerTransform(true,false,false);
- break;
- case "resetRotation":
- this.canvasManager.resetLayerTransform(false,true,false);
- break;
- case "resetSkew":
- this.canvasManager.resetLayerTransform(false,false,true);
- break;
- case "resetTransform":
- this.canvasManager.resetLayerTransform();
- break;
- case "styleDecoToLayer":
- this.canvasManager.styleDecoToLayer();
- break;
- case "layersToDeco":
- this.canvasManager.layersToStyleDeco();
- break;
- case "toggleStyleList":
- this.styleListView.toggle();
- this.uiUpdate();
- break;
- case "stylePreview":
- this.toggleStylePreview();
- break;
- case "toggleToolProps":
- this.toggleToolProps();
- break;
- case "toggleLayerProps":
- this.layersView.toggle();
- this.uiUpdate();
- break;
- case "toggleFullScreen":
- this.toggleFullScreen();
- break;
- case "toggleUI":
- this.toggleUI();
- break;
- case "stopAllBrushes":
- this.canvasManager.toolManager.brushTool.stopAllBrushes();
- break;
- case "stopLastBrush":
- this.canvasManager.toolManager.brushTool.stopLastBrush();
- break;
- case "shareStyles":
- FileManager.getURL(Main.FORUM_STYLES_LINK);
- break;
- case "develop":
- FileManager.getURL(Main.FORUM_DEVELOP_LINK);
- break;
- case "facebook":
- FileManager.getURL(Main.FACEBOOK_LINK);
- break;
- case "twitter":
- FileManager.getURL(Main.TWITTER_LINK);
- break;
- case "helpLink":
- this.loadHelp("main");
- break;
- case "supportLink":
- FileManager.getURL(Main.SUPPORT_LINK);
- break;
- case "feedbackLink":
- FileManager.getURL(Main.SUPPORT_LINK);
- break;
- case "forumLink":
- FileManager.getURL(Main.FORUM_LINK);
- break;
- case "homeLink":
- FileManager.getURL(Main.HOME_LINK);
- break;
- case "checkForUpdates":
- FileManager.checkForUpdates(true);
- break;
- case "about":
- this.showAbout();
- }
- }
- else
- {
- this.busyAlert();
- }
- }
-
- public function toggleToolProps() : void
- {
- if(this.panelState == OPEN)
- {
- this.toolPropsView.toggle();
- }
- else
- {
- this.toolPropsView.toggle(true);
- }
- this.togglePropsPanel(true);
- this.updateViews(Update.uiUpdate());
- }
-
- private function registerDialog(d:Dialog) : void
- {
- this.registeredDialogIDList.push(d.id);
- }
-
- public function initCanvasDependantViews() : void
- {
- this.contextMenu = ContextMenuView(registerView(new ContextMenuView(this)));
- this.canvas.addEventListener(MouseEvent.MOUSE_DOWN,this.canvasMouseDown);
- this.canvas.addEventListener(MouseEvent.MOUSE_OVER,this.canvasMouseDown);
- this.pushColorProps(this.globalColorView.settings);
- }
-
- public function saveImage() : void
- {
- if(this.saveImageView == null)
- {
- this.saveImageView = SaveImageView(this.openWindow(SaveImageView,{"allLayers":true}));
- }
- }
-
- public function openWindow(type:Class, data:Object = null) : UIView
- {
- this.toggle(false);
- var v:UIView = new type(this,data);
- registerView(v);
- return v;
- }
-
- public function busyAlert(generic:Boolean = false) : void
- {
- var message:String = null;
- if(GlobalSettings.SHOW_BUSY_WARNINGS)
- {
- if(generic)
- {
- message = "This action cannot be performed at this time.";
- }
- else if(this.toolManager.activeTool == this.toolManager.brushTool)
- {
- message = "Brush Tool is busy. Please wait.\n\nUse CTRL+SHIFT+B to stop all brushes.";
- }
- else if(this.toolManager.activeTool == this.toolManager.penTool)
- {
- message = "Pen Tool is busy. Please wait.";
- }
- else if(this.toolManager.activeTool == this.toolManager.transformTool)
- {
- message = "Transform Tool is busy. Please wait.";
- }
- else
- {
- message = "Processing your last request. Please wait.";
- }
- this.alert({
- "message":message,
- "id":"busyAlert"
- });
- }
- }
-
- public function resizeInterface() : void
- {
- WIDTH = this.holder.stage.stageWidth;
- HEIGHT = this.holder.stage.stageHeight;
- this.updateViews(Update.windowUpdate());
- }
-
- public function saveLayerImage() : void
- {
- if(this.saveImageView == null)
- {
- this.saveImageView = SaveImageView(this.openWindow(SaveImageView,{"allLayers":false}));
- }
- }
-
- public function toggleUI() : void
- {
- this.holder.visible = !this.holder.visible;
- this.globalColorView.visible = this.holder.visible;
- }
-
- public function get activeLayer() : Layer
- {
- return this.canvasManager.activeLayer;
- }
-
- private function guiMouseDown(e:MouseEvent) : void
- {
- if(this.onCanvas)
- {
- this.onCanvas = false;
- this.mainMenu.toggleEditShortcuts(this.onCanvas);
- }
- if(!this.holder.mouseChildren)
- {
- this.busyAlert(true);
- }
- }
-
- public function togglePropsPanel(force:Boolean = false) : void
- {
- this.panelState = this.panelState == CLOSED || force ? OPEN : CLOSED;
- this.toolPropsView.visible = this.panelState == OPEN;
- this.layersView.visible = this.panelState == OPEN;
- this.styleListView.visible = this.panelState == OPEN;
- this.updateViews(Update.uiUpdate());
- }
-
- public function pullToolProps(uiView:UIView) : void
- {
- this.toolManager.activeTool.settings = uiView.settings;
- this.pushColorProps(uiView.settings);
- }
-
- public function get activeLayers() : Array
- {
- return this.canvasManager.activeLayers;
- }
-
- public function confirmActionDialog(data:Object) : Dialog
- {
- return this.newDialog(Dialog.QUESTION,data);
- }
- }
- }
-
-