You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/09/03 02:17:55 UTC
[22/30] Radii8 code base as accepted by IP Clearance
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/controller/RadiateReferences.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/controller/RadiateReferences.as b/Radii8Library/src/com/flexcapacitor/controller/RadiateReferences.as
new file mode 100644
index 0000000..f605d43
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/controller/RadiateReferences.as
@@ -0,0 +1,75 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.controller {
+ import com.flexcapacitor.tools.EyeDropper;
+ import com.flexcapacitor.tools.Selection;
+ import com.flexcapacitor.tools.Zoom;
+ import com.flexcapacitor.views.inspectors.BorderStyles;
+ import com.flexcapacitor.views.EyeDropperInspector;
+ import com.flexcapacitor.views.SelectionInspector;
+ import com.flexcapacitor.views.Size;
+ import com.flexcapacitor.views.ZoomInspector;
+ import com.flexcapacitor.views.inspectors.BasicBackgroundStyles;
+ import com.flexcapacitor.views.inspectors.FontStyles;
+ import com.flexcapacitor.views.inspectors.Identity;
+ import com.flexcapacitor.views.inspectors.Image;
+ import com.flexcapacitor.views.inspectors.TextInspector;
+
+ /**
+ * Create references so classes are included.
+ * */
+ public class RadiateReferences {
+
+
+ public function RadiateReferences()
+ {
+
+ }
+
+ ///////////////////////////////////////////////////////
+ // TOOLS CLASSES
+ ///////////////////////////////////////////////////////
+
+ public static var selectionTool:com.flexcapacitor.tools.Selection;
+ public static var selectionInspector:com.flexcapacitor.views.SelectionInspector;
+
+ public static var zoomTool:com.flexcapacitor.tools.Zoom;
+ public static var zoomInspector:com.flexcapacitor.views.ZoomInspector;
+
+ public static var eyeDropperTool:com.flexcapacitor.tools.EyeDropper;
+ public static var eyeDropperInspector:com.flexcapacitor.views.EyeDropperInspector;
+
+ ///////////////////////////////////////////////////////
+ // TOOLS CLASSES
+ ///////////////////////////////////////////////////////
+
+ public static var identity:com.flexcapacitor.views.inspectors.Identity;
+ public static var size:com.flexcapacitor.views.Size;
+ public static var borderStyles:com.flexcapacitor.views.inspectors.BorderStyles;
+ public static var fontStyles:com.flexcapacitor.views.inspectors.FontStyles;
+ public static var textInspector:com.flexcapacitor.views.inspectors.TextInspector;
+ public static var basicBackgroundInspector:com.flexcapacitor.views.inspectors.BasicBackgroundStyles;
+ public static var imageInspector:com.flexcapacitor.views.inspectors.Image;
+ public static var borderStylesInspector:com.flexcapacitor.views.inspectors.BorderStyles;
+
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/controller/RadiateTest.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/controller/RadiateTest.as b/Radii8Library/src/com/flexcapacitor/controller/RadiateTest.as
new file mode 100644
index 0000000..613f06f
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/controller/RadiateTest.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.controller {
+
+ /**
+ * Used to test radiate calls
+ * */
+ public class RadiateTest {
+
+ public function RadiateTest() {
+
+
+ }
+
+ public function start():void {
+
+ // import project XML
+ // - check if properties on
+ // - check if documents created
+
+ // import project data
+ // - check if properties set
+ // - check if documents created
+
+ // import document xml
+ // - check if properties set
+
+ // export project XML
+ // - check if properties on
+ // - check if documents created
+
+ // export project data
+ // - check if properties set
+ // - check if documents created
+
+ // export document xml
+ // - check if properties set
+
+
+ }
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/events/DragDropEvent.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/events/DragDropEvent.as b/Radii8Library/src/com/flexcapacitor/events/DragDropEvent.as
new file mode 100644
index 0000000..edf0f0c
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/events/DragDropEvent.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.events {
+ import flash.events.Event;
+ import flash.geom.Point;
+
+ import mx.core.DragSource;
+ import mx.core.IUIComponent;
+ import spark.layouts.supportClasses.DropLocation;
+ import mx.events.DragEvent;
+
+
+ public class DragDropEvent extends Event {
+
+ public static var DRAG_OVER:String = "dragOver";
+ public static var DRAG_DROP:String = "dragDrop";
+ public static var DRAG_DROP_COMPLETE:String = "dragDropComplete";
+
+ public var dragInitiator:IUIComponent;
+ public var dropTarget:Object;
+ public var draggedItem:Object;
+ public var dragSource:DragSource;
+ public var dropPoint:Point;
+ public var dropLocation:DropLocation;
+ public var dragEvent:DragEvent;
+ public var offsetPoint:Point;
+ public var isSkinnableContainer:Boolean;
+ public var isGroup:Boolean;
+ public var isTile:Boolean;
+ public var isVertical:Boolean;
+ public var isHorizontal:Boolean;
+ public var isBasicLayout:Boolean;
+ public var isDropTargetParent:Boolean;
+ public var isDropTargetOwner:Boolean;
+
+ public function DragDropEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+
+ override public function clone():Event {
+ var event:DragDropEvent = new DragDropEvent(type, bubbles, cancelable);
+ event.dragInitiator = dragInitiator;
+ event.dropTarget = dropTarget;
+ event.draggedItem = draggedItem;
+ event.dragSource = dragSource;
+ event.dropPoint = dropPoint;
+ event.dropLocation = dropLocation;
+ event.dragEvent = dragEvent;
+ event.offsetPoint = offsetPoint;
+ event.isGroup = isGroup;
+ event.isTile = isTile;
+ event.isVertical = isVertical;
+ event.isHorizontal = isHorizontal;
+ event.isBasicLayout = isBasicLayout;
+ event.isSkinnableContainer = isSkinnableContainer;
+ event.isDropTargetOwner = isDropTargetOwner;
+ event.isDropTargetParent = isDropTargetParent;
+ return event;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/events/HistoryEvent.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/events/HistoryEvent.as b/Radii8Library/src/com/flexcapacitor/events/HistoryEvent.as
new file mode 100644
index 0000000..417eaa6
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/events/HistoryEvent.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.events {
+
+ /**
+ * Container for history event items
+ * */
+ public class HistoryEvent extends HistoryEventItem {
+
+ public function HistoryEvent() {
+
+ }
+
+ /**
+ * Array of history event items
+ * */
+ public var historyEventItems:Array;
+
+ override public function purge():void {
+ super.purge();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/events/HistoryEventItem.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/events/HistoryEventItem.as b/Radii8Library/src/com/flexcapacitor/events/HistoryEventItem.as
new file mode 100644
index 0000000..ca12635
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/events/HistoryEventItem.as
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.events {
+ import flash.utils.Dictionary;
+
+ import mx.core.UIComponent;
+ import mx.effects.effectClasses.PropertyChanges;
+ import mx.states.AddItems;
+
+ /**
+ * Contains the information used to go forward and back in history.
+ *
+ * This is a description value object of a history event not a dispatched Event object.
+ *
+ * There are three types of events,
+ * add display object
+ * remove display object
+ * set property / style
+ * */
+ public class HistoryEventItem {
+
+ public static const ADD_ITEM:String = "addItem";
+ public static const REMOVE_ITEM:String = "removeItem";
+ public static const PROPERTY_CHANGE:String = "propertyChanged";
+ public static const STYLE_CHANGE:String = "styleChanged";
+
+ public function HistoryEventItem() {
+
+ }
+
+ /**
+ * Names of affected properties
+ * */
+ public var properties:Array;
+
+ /**
+ * Names of affected styles
+ * */
+ public var styles:Array;
+
+ /**
+ * Contains the original property changes object
+ * */
+ public var propertyChanges:PropertyChanges;
+
+ /**
+ * List of targets
+ * */
+ public var targets:Array = [];
+
+ /**
+ * Indicates if the property change has been reversed
+ * */
+ [Bindable]
+ public var reversed:Boolean;
+
+ /**
+ * Description of change.
+ * */
+ public var description:String;
+
+ /**
+ * Description of the action this event contains
+ * */
+ [Inspectable(enumeration="addItem,removeItem,propertyChanged,styleChanged")]
+ public var action:String;
+
+ /**
+ * @copy mx.states.AddItems
+ * */
+ public var addItemsInstance:AddItems;
+
+ /**
+ * @copy mx.states.AddItems
+ * */
+ public var removeItemsInstance:AddItems;
+
+ /**
+ * @copy mx.states.AddItems
+ * */
+ public var reverseItemsInstance:AddItems;
+
+ /**
+ * @copy mx.states.AddItems.apply()
+ * */
+ public var parent:UIComponent;
+
+ /**
+ * Stores the parents
+ * */
+ public var reverseRemoveItemsDictionary:Dictionary = new Dictionary();
+
+ /**
+ * Stores the parents
+ * */
+ public var reverseAddItemsDictionary:Dictionary = new Dictionary();
+
+ /**
+ * Called when item is removed from history.
+ * Needs to null out all references??? Does GC do that?
+ * We are only nulling targets.
+ * */
+ public function purge():void {
+ targets = null;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/events/InspectorEvent.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/events/InspectorEvent.as b/Radii8Library/src/com/flexcapacitor/events/InspectorEvent.as
new file mode 100644
index 0000000..24ed3ef
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/events/InspectorEvent.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+package com.flexcapacitor.events {
+
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+
+ public class InspectorEvent extends Event {
+
+ public static const CHANGE:String = "change";
+ public static const HIGHLIGHT:String = "highlight";
+ public static const SELECT:String = "select";
+
+ public var targetItem:Object;
+
+ public function InspectorEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, target:Object = null) {
+ super(type, bubbles, cancelable);
+
+ targetItem = target;
+ }
+
+
+ // override the inherited clone() method
+ override public function clone():Event {
+ return new InspectorEvent(type, bubbles, cancelable, targetItem);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/events/RadiateEvent.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/events/RadiateEvent.as b/Radii8Library/src/com/flexcapacitor/events/RadiateEvent.as
new file mode 100644
index 0000000..e10ac23
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/events/RadiateEvent.as
@@ -0,0 +1,363 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.events {
+ import com.flexcapacitor.tools.ITool;
+
+ import flash.events.Event;
+
+ import mx.states.AddItems;
+
+ /**
+ * Handles Radiate events.
+ * Need to refactor.
+ * */
+ public class RadiateEvent extends Event {
+
+ /**
+ * Dispatched when an asset is removed
+ * */
+ public static const ASSET_REMOVED:String = "assetRemoved";
+
+ /**
+ * Dispatched when an asset is added
+ * */
+ public static const ASSET_ADDED:String = "assetAdded";
+
+ /**
+ * Dispatched when the login results are received
+ * */
+ public static const LOGIN_RESULTS:String = "loginResults";
+
+ /**
+ * Dispatched when the logout results are received
+ * */
+ public static const LOGOUT_RESULTS:String = "logoutResults";
+
+ /**
+ * Dispatched when the register results are received
+ * */
+ public static const REGISTER_RESULTS:String = "registerResults";
+
+ /**
+ * Dispatched when the change password results are received
+ * */
+ public static const CHANGE_PASSWORD_RESULTS:String = "changePasswordResults";
+
+ /**
+ * Dispatched when the lost password results are received
+ * */
+ public static const LOST_PASSWORD_RESULTS:String = "lostPasswordResults";
+
+ /**
+ * Dispatched when the project is created
+ * */
+ public static const PROJECT_CREATED:String = "projectCreated";
+
+ /**
+ * Dispatched when the project is deleted
+ * */
+ public static const PROJECT_DELETED:String = "projectDeleted";
+
+ /**
+ * Dispatched when the project is added
+ * */
+ public static const PROJECT_ADDED:String = "projectAdded";
+
+ /**
+ * Dispatched when the project is removed
+ * */
+ public static const PROJECT_REMOVED:String = "projectRemoved";
+
+ /**
+ * Dispatched when the project is closing
+ * */
+ public static const PROJECT_CLOSING:String = "projectClosing";
+
+ /**
+ * Dispatched when the project is opened
+ * */
+ public static const PROJECT_OPENED:String = "projectOpened";
+
+ /**
+ * Dispatched when the project is closed
+ * */
+ public static const PROJECT_CLOSED:String = "projectClosed";
+
+ /**
+ * Dispatched when the projects are set
+ * */
+ public static const PROJECTS_SET:String = "projectsSet";
+
+ /**
+ * Dispatched when the project is changed
+ * */
+ public static const PROJECT_CHANGE:String = "projectChange";
+
+ /**
+ * Dispatched when the project is saved
+ * */
+ public static const PROJECT_SAVED:String = "projectSaved";
+
+ /**
+ * Dispatched when a list of projects are received
+ * */
+ public static const PROJECTS_LIST_RECEIVED:String = "projectsListReceived";
+
+ /**
+ * Dispatched when the project name is changed
+ * */
+ public static const PROJECT_RENAME:String = "projectRename";
+
+ /**
+ * Dispatched when the document name is changed
+ * */
+ public static const DOCUMENT_RENAME:String = "documentRename";
+
+ /**
+ * Dispatched when the document is removed
+ * */
+ public static const DOCUMENT_REMOVED:String = "documentRemoved";
+
+ /**
+ * Dispatched when the document is deleted
+ * */
+ public static const DOCUMENT_DELETED:String = "documentDeleted";
+
+ /**
+ * Dispatched when the document is added
+ * */
+ public static const DOCUMENT_ADDED:String = "documentAdded";
+
+ /**
+ * Dispatched when the document save is complete
+ * */
+ public static const DOCUMENT_SAVE_COMPLETE:String = "documentSaveComplete";
+
+ /**
+ * Dispatched when the document save is not complete
+ * */
+ public static const DOCUMENT_SAVE_FAULT:String = "documentSaveFault";
+
+ /**
+ * Dispatched when the document save as is canceled
+ * */
+ public static const DOCUMENT_SAVE_AS_CANCEL:String = "documentSaveAsCancel";
+
+ /**
+ * Dispatched when the document is changed
+ * */
+ public static const DOCUMENT_CHANGE:String = "documentChange";
+
+ /**
+ * Dispatched when the documents are set
+ * */
+ public static const DOCUMENTS_SET:String = "documentsSet";
+
+ /**
+ * Dispatched when the document is opening
+ * */
+ public static const DOCUMENT_OPENING:String = "documentOpening";
+
+ /**
+ * Dispatched when the document is open
+ * */
+ public static const DOCUMENT_OPEN:String = "documentOpen";
+
+ /**
+ * Dispatched when the canvas is changed
+ * */
+ public static const CANVAS_CHANGE:String = "canvasChange";
+
+ /**
+ * Dispatched when attachments are received
+ * */
+ public static const ATTACHMENTS_RECEIVED:String = "attachmentsReceived";
+
+ /**
+ * Dispatched when attachment is uploaded
+ * */
+ public static const ATTACHMENT_UPLOADED:String = "attachmentUploaded";
+
+ /**
+ * Dispatched when logged in status is received
+ * */
+ public static const LOGGED_IN_STATUS:String = "loggedInStatus";
+
+ /**
+ * Dispatched when the target is changed
+ * */
+ public static const TARGET_CHANGE:String = "targetChange";
+
+ /**
+ * Dispatched when a preview is requested
+ * */
+ public static const REQUEST_PREVIEW:String = "requestPreview";
+
+ /**
+ * Dispatched when a property is selected
+ * */
+ public static const PROPERTY_SELECTED:String = "propertySelected";
+
+ /**
+ * Dispatched when a color is selected
+ * */
+ public static const COLOR_SELECTED:String = "colorSelected";
+
+ /**
+ * Dispatched when a color is previewed before color selected event.
+ * */
+ public static const COLOR_PREVIEW:String = "colorPreview";
+
+ /**
+ * Dispatched when the generated code is updated
+ * */
+ public static const CODE_UPDATED:String = "codeUpdated";
+
+ /**
+ * Dispatched when an item (usually a display object) is added
+ * */
+ public static const ADD_ITEM:String = "addItem";
+
+ /**
+ * Dispatched when an item (usually a display object) is moved
+ * */
+ public static const MOVE_ITEM:String = "moveItem";
+
+ /**
+ * Dispatched when an item (usually a display object) is removed
+ * */
+ public static const REMOVE_ITEM:String = "removeItem";
+
+ /**
+ * Dispatched when an object is selected
+ * */
+ public static const OBJECT_SELECTED:String = "objectSelected";
+
+ /**
+ * Dispatched when a property on the target is changed
+ * */
+ public static const PROPERTY_CHANGED:String = "propertyChanged";
+
+ /**
+ * Dispatched when a property edit is requested
+ * */
+ public static const PROPERTY_EDIT:String = "propertyEdit";
+
+ /**
+ * Dispatched when at the beginning of the undo history stack
+ * */
+ public static const BEGINNING_OF_UNDO_HISTORY:String = "beginningOfUndoHistory";
+
+ /**
+ * Dispatched when at the end of the undo history stack
+ * */
+ public static const END_OF_UNDO_HISTORY:String = "endOfUndoHistory";
+
+ /**
+ * Dispatched when history is changed.
+ * */
+ public static const HISTORY_CHANGE:String = "historyChange";
+
+ /**
+ * Dispatched when document scale is changed.
+ * */
+ public static const SCALE_CHANGE:String = "scaleChange";
+
+ /**
+ * Dispatched when document size or scale is changed.
+ * */
+ public static const DOCUMENT_SIZE_CHANGE:String = "documentSizeChange";
+
+ /**
+ * Dispatched when the tool is changed.
+ * */
+ public static const TOOL_CHANGE:String = "toolChange";
+
+ /**
+ * Dispatched when the tools list is updated.
+ * */
+ public static const TOOLS_UPDATED:String = "toolsUpdated";
+
+ /**
+ * Dispatched when print job is cancelled.
+ * */
+ public static const PRINT_CANCELLED:String = "printCancelled";
+
+ /**
+ * Dispatched when print job is complete or sent to the printer.
+ * */
+ public static const PRINT_COMPLETE:String = "printComplete";
+
+
+ public var data:Object;
+ public var selectedItem:Object;
+ public var property:String;
+ public var properties:Array;
+ public var changes:Array;
+ public var value:*;
+ public var multipleSelection:Boolean;
+ public var addItemsInstance:AddItems;
+ public var moveItemsInstance:AddItems;
+ public var newIndex:int;
+ public var oldIndex:int;
+ public var historyEventItem:HistoryEventItem;
+ public var targets:Array;
+ public var tool:ITool;
+ public var previewType:String;
+ public var openInBrowser:Boolean;
+ public var color:uint;
+ public var invalid:Boolean;
+ public var isRollOver:Boolean;
+ public var scaleX:Number;
+ public var scaleY:Number;
+ public var status:String;
+ public var successful:Boolean;
+ public var faultEvent:Event;
+
+ /**
+ * Constructor. This is not up to date.
+ * */
+ public function RadiateEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false,
+ target:Object=null, changes:Array=null, properties:Array=null,
+ value:*=null, multipleSelection:Boolean = false, tool:ITool = null) {
+ super(type, bubbles, cancelable);
+
+ this.selectedItem = target;
+ this.properties = properties;
+ this.changes = changes;
+ this.value = value;
+ this.multipleSelection = multipleSelection;
+ this.tool = tool;
+
+ // not kept up
+ }
+
+ /**
+ * This is not up to date.
+ * */
+ override public function clone():Event {
+ throw new Error("do this");
+ return new RadiateEvent(type, bubbles, cancelable, selectedItem, changes, properties, value, multipleSelection, tool);
+ }
+
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/graphics/LayoutLines.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/graphics/LayoutLines.as b/Radii8Library/src/com/flexcapacitor/graphics/LayoutLines.as
new file mode 100644
index 0000000..d290b36
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/graphics/LayoutLines.as
@@ -0,0 +1,280 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+package com.flexcapacitor.graphics {
+
+ import flash.display.DisplayObject;
+ import flash.display.MovieClip;
+ import flash.geom.Point;
+
+ import mx.core.FlexGlobals;
+ import mx.graphics.SolidColorStroke;
+ import mx.managers.ISystemManager;
+ import mx.managers.SystemManager;
+
+ import spark.components.Group;
+ import spark.primitives.Line;
+
+ /**
+ * Draws an outline around the target object
+ * */
+ public class LayoutLines {
+
+ public var backgroundFillAlpha:Number = 0;
+ public var backgroundFillColor:uint = 0x000000;
+ public var lineAlpha:Number = 1;
+ public var lineColor:uint = 0x2da6e9;
+ public var horizontalOffset:int = -5;
+ public var verticalOffset:int = -5;
+ public var lineThickness:int = 1;
+ public var group:Group;
+
+ public function LayoutLines() {
+
+ }
+ private static var _instance:LayoutLines;
+
+ public static function getInstance():LayoutLines {
+
+ if (_instance!=null) {
+ return _instance;
+ }
+ else {
+ _instance = new LayoutLines();
+ return _instance;
+ }
+ }
+
+ /**
+ * Reference to LayoutLines instance
+ * */
+ public static function get instance():LayoutLines {
+
+ if (_instance==null) {
+ _instance = new LayoutLines();
+ }
+ return _instance;
+ }
+
+ /**
+ * Draws an outline around the target object
+ * */
+ public function drawLines(target:Object, systemManager:ISystemManager):void {
+ var point:Point;
+ var targetWidth:int;
+ var targetHeight:int;
+ var displayObject:DisplayObject;
+
+ if (target == null) {
+ if (group) {
+ group.graphics.clear();
+ }
+ return;
+ }
+
+ if (systemManager!=null) {
+ var isPopUp:Boolean;// = target is UIComponent ? UIComponent(target).isPopUp : false;
+
+ // if we add to the application we won't show on pop up manager elements
+ if (group==null || group.parent==null) {
+ group = new Group();
+ group.mouseEnabled = false;
+
+ systemManager.addChild(DisplayObject(group));
+ }
+ else {
+ group.graphics.clear();
+ }
+ }
+ else {
+ return;
+ }
+
+ if (!(target is DisplayObject)) {
+ return;
+ }
+ displayObject = DisplayObject(target);
+
+ targetWidth = displayObject.width;
+ targetHeight = displayObject.height;
+
+ point = new Point();
+ point = displayObject.localToGlobal(point);
+
+ var topOffset:Number = 0 - (lineThickness / 2);
+ var leftOffset:Number = 0 - (lineThickness / 2);
+ var rightOffset:Number = targetWidth + 0 - (lineThickness / 2);
+ var bottomOffset:Number = targetHeight + 0 - (lineThickness / 2);
+
+ // move group to new location
+ group.x = point.x;
+ group.y = point.y;
+
+ // add a background fill
+ group.graphics.beginFill(backgroundFillColor, backgroundFillAlpha);
+ group.graphics.drawRect(0, 0, targetWidth, targetHeight);
+ group.graphics.endFill();
+
+ // adds a thin line at the top
+ group.graphics.beginFill(lineColor, lineAlpha);
+ group.graphics.drawRect(horizontalOffset, topOffset, targetWidth + 10, lineThickness);
+ group.graphics.endFill();
+
+ // adds a thin line to the bottom of the spacer
+ group.graphics.beginFill(lineColor, lineAlpha);
+ group.graphics.drawRect(horizontalOffset, bottomOffset, targetWidth + 10, lineThickness);
+ group.graphics.endFill();
+
+ // adds a thin line to the left
+ group.graphics.beginFill(lineColor, lineAlpha);
+ group.graphics.drawRect(leftOffset, verticalOffset, lineThickness, targetHeight + 10);
+ group.graphics.endFill();
+
+ // adds a thin line to the right
+ group.graphics.beginFill(lineColor, lineAlpha);
+ group.graphics.drawRect(rightOffset, verticalOffset, lineThickness, targetHeight + 10);
+ group.graphics.endFill();
+ }
+
+ public function drawLines2(target:DisplayObject, groupTarget:DisplayObject = null):void {
+ var point:Point;
+ var targetWidth:int;
+ var targetHeight:int;
+ var systemManager:MovieClip = MovieClip(SystemManager.getSWFRoot(target));
+
+ if (target == null)
+ return;
+
+ if (systemManager!=null) {
+
+ if (group==null) {
+ group = new Group();
+ group.mouseEnabled = false;
+ systemManager.addChild(DisplayObject(group));
+ }
+ else {
+ group.removeAllElements();
+ }
+ }
+ else {
+ return;
+ }
+
+ targetWidth = DisplayObject(target).width;
+ targetHeight = DisplayObject(target).height;
+
+ point = new Point();
+ point = DisplayObject(target).localToGlobal(point);
+
+ var topLine:Line = new Line();
+ var bottomLine:Line = new Line();
+ var leftLine:Line = new Line();
+ var rightLine:Line = new Line();
+
+ var stroke:SolidColorStroke = new SolidColorStroke();
+ stroke.color = lineColor;
+ stroke.alpha = lineAlpha;
+ topLine.stroke = stroke;
+ bottomLine.stroke = stroke;
+ leftLine.stroke = stroke;
+ rightLine.stroke = stroke;
+
+ topLine.xFrom = 0;
+ topLine.xTo = systemManager.width;
+ topLine.y = point.y - (lineThickness / 2);
+
+ bottomLine.xFrom = 0;
+ bottomLine.xTo = systemManager.width;
+ bottomLine.y = point.y + targetHeight - (lineThickness / 2);
+
+ leftLine.x = point.x - (lineThickness / 2);
+ leftLine.yFrom = 0;
+ leftLine.yTo = systemManager.height;
+
+ rightLine.x = point.x + targetWidth - (lineThickness / 2);
+ rightLine.yFrom = 0;
+ rightLine.yTo = systemManager.height;
+
+ group.addElement(topLine);
+ group.addElement(bottomLine);
+ group.addElement(leftLine);
+ group.addElement(rightLine);
+
+ if (group.parent!=systemManager) {
+ systemManager.addChild(group);
+ }
+
+ }
+
+ /**
+ * Clears the outline
+ * */
+ public function clear(target:Object, systemManager:ISystemManager, remove:Boolean=false):void {
+
+ if (group) {
+ group.graphics.clear();
+
+ if (remove) {
+
+ if (systemManager.contains(group)) {
+ systemManager.removeChild(group);
+ }
+ }
+ }
+
+ }
+
+ public function remove(target:Object, groupTarget:Object=null):void {
+ var application:Object = FlexGlobals.topLevelApplication;
+ var systemManager:MovieClip = MovieClip(SystemManager.getSWFRoot(target));
+
+ if (systemManager) {
+
+ if (group && group.parent==systemManager) {
+ group.graphics.clear();
+ systemManager.removeChild(group);
+ }
+ }
+
+ if (application) {
+
+ if (group && group.parent==application) {
+ group.graphics.clear();
+ application.removeChild(group);
+ }
+ }
+ }
+
+ public function clear2(target:Object, groupTarget:Object=null):void {
+ var systemManager:MovieClip = MovieClip(SystemManager.getSWFRoot(target));
+
+ if (systemManager) {
+
+ if (group!=null) {
+ group.graphics.clear();
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/logging/RadiateLogTarget.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/logging/RadiateLogTarget.as b/Radii8Library/src/com/flexcapacitor/logging/RadiateLogTarget.as
new file mode 100644
index 0000000..49977b4
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/logging/RadiateLogTarget.as
@@ -0,0 +1,91 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.logging {
+ import mx.core.mx_internal;
+ import mx.logging.targets.LineFormattedTarget;
+
+ use namespace mx_internal;
+
+ /**
+ * Logging target
+ * */
+ public class RadiateLogTarget extends LineFormattedTarget {
+
+
+ public function RadiateLogTarget(console:Object = null) {
+ super();
+
+ this.console = console;
+ }
+
+ private var _console:Object;
+
+ public var messages:String = "";
+
+ public var storedMessages:String = "";
+
+ public var fallBackToTraceConsole:Boolean = true;
+
+ /**
+ * Store messages
+ * */
+ public var storeMessages:Boolean = false;
+
+ /**
+ * Shows messages deferred until console is created
+ * */
+ public var showDeferredMessages:Boolean = true;
+
+ [Bindable]
+ public function get console():Object {
+ return _console;
+ }
+
+ public function set console(value:Object):void {
+ if (_console == value) return;
+
+ _console = value;
+
+ if (value && showDeferredMessages && storedMessages) {
+ internalLog (storedMessages);
+ }
+ }
+
+ override mx_internal function internalLog(message : String) : void {
+ var shortMessage:String = message + "\n";
+
+ if (console) {
+ //console.text += shortMessage;
+ console.appendText(shortMessage);
+ }
+ else {
+ storedMessages += shortMessage;
+
+ if (fallBackToTraceConsole) {
+ trace(message);
+ }
+ }
+
+ if (storedMessages) {
+ messages += shortMessage;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/managers/HistoryManager.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/managers/HistoryManager.as b/Radii8Library/src/com/flexcapacitor/managers/HistoryManager.as
new file mode 100644
index 0000000..34cd81d
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/managers/HistoryManager.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package com.flexcapacitor.managers
+{
+
+ import flash.events.EventDispatcher;
+
+
+ /**
+ * Track changes
+ * */
+ public class HistoryManager extends EventDispatcher {
+
+
+ public function HistoryManager():void {
+
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/managers/PersistantDataManager.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/managers/PersistantDataManager.as b/Radii8Library/src/com/flexcapacitor/managers/PersistantDataManager.as
new file mode 100644
index 0000000..0f17f68
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/managers/PersistantDataManager.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.managers {
+ import com.flexcapacitor.model.Settings;
+ import com.flexcapacitor.utils.SharedObjectUtils;
+
+ import flash.net.SharedObject;
+
+
+ /**
+ * Handles saving and loading settings data
+ * */
+ public class PersistantDataManager {
+
+
+
+ public function PersistantDataManager() {
+
+ }
+
+ public var settings:Settings;
+
+ /**
+ * Get saved project
+ * */
+ public function getSavedSettings():Boolean {
+ var so:Object = SharedObjectUtils.getSharedObject("settings");
+
+ if (so is SharedObject) {
+ if (so.data && so.data is Settings) {
+ settings = Settings(so.data);
+ }
+ else {
+ settings = new Settings();
+ }
+ }
+ else {
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/managers/layoutClasses/LayoutDebugHelper.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/managers/layoutClasses/LayoutDebugHelper.as b/Radii8Library/src/com/flexcapacitor/managers/layoutClasses/LayoutDebugHelper.as
new file mode 100644
index 0000000..b3338fd
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/managers/layoutClasses/LayoutDebugHelper.as
@@ -0,0 +1,240 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.managers.layoutClasses
+{
+
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.Sprite;
+import flash.events.Event;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.utils.Dictionary;
+import flash.utils.getTimer;
+
+import mx.core.ILayoutElement;
+import mx.managers.ISystemManager;
+import mx.managers.LayoutManager;
+import mx.managers.SystemManagerGlobals;
+
+
+/**
+ * @private
+ * The LayoutDebugHelper class renders the layout bounds for the most
+ * recently validated visual items.
+ *
+ * Adapted from import mx.managers.layoutClasses.LayoutDebugHelper;
+ */
+public class LayoutDebugHelper extends Sprite {
+ //include "../../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function LayoutDebugHelper() {
+ super();
+ activeInvalidations = new Dictionary();
+ addEventListener("enterFrame", onEnterFrame);
+
+ }
+
+ /**
+ * @private
+ * The sole instance of this singleton class.
+ */
+ private static var instance:LayoutDebugHelper;
+
+ public static function getInstance():LayoutDebugHelper {
+ if (!instance)
+ instance = new LayoutDebugHelper();
+
+ return instance;
+ }
+
+ public function enable():void {
+ if (!instance) {
+ instance = getInstance();
+ }
+
+ Object(instance).mouseEnabled = false;
+ var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0]
+ sm.addChild(instance);
+
+ // return instance;
+ }
+
+ public function disable():void {
+ if (instance) {
+ var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0]
+ var index:int = sm.getChildIndex(instance);
+
+ if (index!=-1) {
+ sm.removeChildAt(index);
+ }
+ }
+
+ // return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ *
+ */
+ public static const highlightDelay:Number = 2500;
+
+ /**
+ * @private
+ */
+ public static const highlightColor:Number = 0xFF00;
+
+ /**
+ * @private
+ */
+ public var activeInvalidations:Dictionary;
+
+ /**
+ * @private
+ */
+ private var lastUpdate:Number = 0;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+ private static var _layoutDebugHelper:Boolean;
+
+ /**
+ * @private
+ */
+ public function addElement(item:ILayoutElement):void
+ {
+ activeInvalidations[item] = getTimer();
+ }
+
+ /**
+ * @private
+ */
+ public function removeElement(item:ILayoutElement):void
+ {
+ activeInvalidations[item] = null;
+ delete activeInvalidations[item];
+ }
+
+ /**
+ * @private
+ */
+ public function render():void
+ {
+ graphics.clear();
+ for (var item:* in activeInvalidations)
+ {
+ var lifespan:Number = getTimer() - activeInvalidations[item];
+ if (lifespan > highlightDelay)
+ {
+ removeElement(item);
+ }
+ else
+ {
+ var alpha:Number = 1.0 - (lifespan / highlightDelay);
+
+ if (item.parent)
+ {
+ var w:Number = item.getLayoutBoundsWidth(true);
+ var h:Number = item.getLayoutBoundsHeight(true);
+
+ var position:Point = new Point();
+ position.x = item.getLayoutBoundsX(true);
+ position.y = item.getLayoutBoundsY(true);
+ position = item.parent.localToGlobal(position);
+
+ graphics.lineStyle(2, highlightColor, alpha);
+ graphics.drawRect(position.x, position.y, w, h);
+ graphics.endFill();
+ }
+ }
+ }
+ }
+
+ /**
+ * Get a rectangle of the item
+ * */
+ public function getRectangleBounds(item:Object, container:* = null):Rectangle {
+
+ if (item && item.parent) {
+ var w:Number = item.getLayoutBoundsWidth(true);
+ var h:Number = item.getLayoutBoundsHeight(true);
+
+ var position:Point = new Point();
+ position.x = item.getLayoutBoundsX(true);
+ position.y = item.getLayoutBoundsY(true);
+ position = item.parent.localToGlobal(position);
+
+ var rectangle:Rectangle = new Rectangle();
+
+ if (container && container is DisplayObjectContainer) {
+ var anotherPoint:Point = DisplayObjectContainer(container).globalToLocal(position);
+ rectangle.x = anotherPoint.x;
+ rectangle.y = anotherPoint.y;
+ }
+ else {
+ rectangle.x = position.x;
+ rectangle.y = position.y;
+ }
+
+ rectangle.width = w;
+ rectangle.height = h;
+
+ return rectangle;
+ }
+
+ return null;
+ }
+
+ /**
+ * @private
+ */
+ public function onEnterFrame(e:Event):void
+ {
+ if (getTimer() - lastUpdate >= 100)
+ {
+ render();
+ lastUpdate = getTimer();
+ }
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/model/AccessorMetaData.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/model/AccessorMetaData.as b/Radii8Library/src/com/flexcapacitor/model/AccessorMetaData.as
new file mode 100644
index 0000000..aef2683
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/model/AccessorMetaData.as
@@ -0,0 +1,182 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package com.flexcapacitor.model {
+
+
+ /**
+ * Contains information on style metadata
+ * */
+ public class AccessorMetaData extends MetaData {
+
+
+ public function AccessorMetaData(item:XML = null, target:* = null) {
+ if (item) unmarshall(item, target);
+ }
+
+ /**
+ * Access type. Readonly, readwrite, writeonly.
+ * */
+ public var access:String;
+
+ /**
+ * Is property inspectable
+ * */
+ public var inspectable:Boolean;
+
+
+ /**
+ * Import metadata XML Style node into this instance
+ * */
+ override public function unmarshall(item:XML, target:* = null, getValue:Boolean = true):void {
+ super.unmarshall(item, target, getValue);
+ if (item==null) return;
+ var metadata:XMLList = item.metadata;
+ var args:XMLList;
+ var keyName:String;
+ var keyValue:String;
+ var propertyValue:*;
+ var dataname:String;
+
+ access = item.@access;
+
+ // loop through metadata objects
+ outerloop:
+ for each (var data:XML in metadata) {
+ dataname = data.@name;
+ args = data.arg;
+
+
+ // loop through arguments in each metadata
+ innerloop:
+ for each (var arg:XML in args) {
+ keyName = arg.@key;
+ keyValue = String(arg.@value);
+
+ // get inspectable meta data
+ if (dataname=="Inspectable") {
+ inspectable = true;
+
+ if (keyName=="arrayType") {
+ arrayType = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="category") {
+ category = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="defaultValue") {
+ defaultValue = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="enumeration") {
+ enumeration = keyValue.split(",");
+ continue innerloop;
+ }
+
+ else if (keyName=="environment") {
+ environment = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="format") {
+ format = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="minValue") {
+ minValue = int(keyValue);
+ continue innerloop;
+ }
+
+ else if (keyName=="maxValue") {
+ maxValue = int(keyValue);
+ continue innerloop;
+ }
+
+ else if (keyName=="theme") {
+ theme = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="type") {
+ type = keyValue;
+ continue innerloop;
+ }
+
+ else if (keyName=="verbose") {
+ verbose = keyValue=="1";
+ continue innerloop;
+ }
+
+ }
+
+ else if (dataname=="__go_to_definition_help") {
+ if (keyName=="pos") {
+ if (helpPositions==null) helpPositions = [];
+ helpPositions.push(keyValue);
+ }
+ }
+
+ else if (dataname=="ArrayElementType") {
+ if (keyName=="") {
+ arrayElementType = keyValue;
+ }
+ }
+
+ else if (dataname=="Bindable") {
+ if (keyName=="") {
+ if (bindable==null) bindable = [];
+ bindable.push(keyValue);
+ }
+ }
+
+ else if (dataname=="PercentProxy") {
+ if (keyName=="") {
+ if (percentProxy==null) percentProxy = [];
+ percentProxy.push(keyValue);
+ }
+ }
+ else if (dataname=="SkinPart") {
+ if (keyName=="") {
+ if (skinPart==null) skinPart = [];
+ skinPart.push(keyValue);
+ }
+ }
+
+ }
+
+ }
+
+ if (access!="writeonly") {
+ value = target && name in target ? target[name] : undefined;
+
+ textValue = value===undefined || value==null ? "": "" + value;
+
+ if (!getValue) value = undefined;
+ }
+
+ raw = item.toXMLString();
+
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/model/AttachmentData.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/model/AttachmentData.as b/Radii8Library/src/com/flexcapacitor/model/AttachmentData.as
new file mode 100644
index 0000000..7d28e3c
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/model/AttachmentData.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.model {
+ import flash.events.IEventDispatcher;
+
+ /**
+ *
+ * */
+ public class AttachmentData extends DocumentData {
+
+ /**
+ * Constructor
+ * */
+ public function AttachmentData(target:IEventDispatcher=null) {
+ super(target);
+ }
+
+ /**
+ * Mime type
+ * */
+ public var mimeType:String;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/model/Device.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/model/Device.as b/Radii8Library/src/com/flexcapacitor/model/Device.as
new file mode 100644
index 0000000..ec4cf13
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/model/Device.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.model {
+
+ /**
+ * Contains information about a device screen size
+ * */
+ public class Device extends Size {
+
+
+ public function Device(width:String="0", height:String="0", dpi:int=0)
+ {
+ super(width, height, dpi);
+ }
+
+
+ public var resolutionHeight:int;
+
+ public var resolutionWidth:int;
+
+ public var usableWidthPortrait:int;
+
+ public var usableHeightPortrait:int;
+
+ public var usableWidthLandscape:int;
+
+ public var usableHeightLandscape:int;
+
+ public var platformID:String;
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/model/Document.as
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/model/Document.as b/Radii8Library/src/com/flexcapacitor/model/Document.as
new file mode 100644
index 0000000..826316d
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/model/Document.as
@@ -0,0 +1,521 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package com.flexcapacitor.model {
+
+ import com.flexcapacitor.controller.Radiate;
+ import com.flexcapacitor.utils.DisplayObjectUtils;
+ import com.flexcapacitor.utils.MXMLDocumentImporter;
+ import com.flexcapacitor.utils.XMLUtils;
+ import com.flexcapacitor.utils.supportClasses.ComponentDescription;
+
+ import flash.display.DisplayObject;
+ import flash.events.IEventDispatcher;
+ import flash.utils.Dictionary;
+
+ import mx.collections.ArrayCollection;
+ import mx.core.IVisualElement;
+ import mx.utils.UIDUtil;
+
+
+
+ /**
+ * Document model
+ * */
+ public class Document extends DocumentData implements IDocument, ISavable {
+
+ /**
+ * Constructor
+ * */
+ public function Document(target:IEventDispatcher=null) {
+ super(target);
+ uid = UIDUtil.createUID();
+ }
+
+
+ /**
+ * URL to get code
+ * */
+ public var URL:String;
+
+ /**
+ * Dots per inch
+ * */
+ public var DPI:int;
+
+ /**
+ * Width of document
+ * */
+ public var width:String;
+
+ /**
+ * Height of document
+ * */
+ public var height:String;
+
+ private var _scale:Number = 1;
+
+ /**
+ * Scale of document
+ * */
+ public function get scale():Number {
+ return _scale;
+ }
+
+ /**
+ * Scale of document
+ * */
+ public function set scale(value:Number):void {
+ _scale = value;
+
+ if (instance) {
+ DisplayObject(instance).scaleX = value;
+ DisplayObject(instance).scaleY = value;
+ }
+ }
+
+ private var _projectID:String;
+
+ /**
+ * ID of project. Can be part of multiple projects so we may need to change this.
+ * */
+ public function get projectID():String {
+ return _projectID;
+ }
+
+ /**
+ * @private
+ */
+ public function set projectID(value:String):void {
+ _projectID = value;
+ }
+
+ private var _project:IProject;
+
+ /**
+ * Reference to parent project
+ * */
+ public function get project():IProject {
+ return _project;
+ }
+
+ /**
+ * @private
+ */
+ public function set project(value:IProject):void {
+ _project = value;
+ }
+
+ private var _containerType:Class;
+
+ /**
+ * @inheritDoc
+ * */
+ public function get containerType():Class {
+ return _containerType;
+ }
+
+ public function set containerType(value:Class):void {
+ _containerType = value;
+ }
+
+ private var _containerTypeName:String;
+
+ /**
+ * @inheritDoc
+ * */
+ public function get containerTypeName():String {
+ return _containerTypeName;
+ }
+
+ public function set containerTypeName(value:String):void {
+ _containerTypeName = value;
+ }
+
+
+ /**
+ * @private
+ * */
+ private var _componentDescription:ComponentDescription;
+
+ /**
+ * Reference to the component description
+ * */
+ public function get componentDescription():ComponentDescription {
+ if (!_componentDescription) {
+
+ if (instance) {
+ _componentDescription = DisplayObjectUtils.getComponentDisplayList2(instance, null, 0, descriptionsDictionary);
+ }
+ }
+ // com.flexcapacitor.utils.supportClasses.ComponentDescription (@1234c3539)
+ _componentDescription = DisplayObjectUtils.getComponentDisplayList2(instance, null, 0, descriptionsDictionary);
+
+ return _componentDescription;
+ }
+
+ /**
+ * @private
+ */
+ public function set componentDescription(value:ComponentDescription):void {
+ _componentDescription = value;
+ }
+
+
+ private var _instance:Object;
+
+ /**
+ * Instance of document
+ * */
+ public function get instance():Object {
+ return _instance;
+ }
+
+ /**
+ * @private
+ */
+ public function set instance(value:Object):void {
+ _instance = value;
+ }
+
+ /**
+ * @private
+ * */
+ private var _history:ArrayCollection = new ArrayCollection();
+
+ /**
+ * History
+ * */
+ public function get history():ArrayCollection {
+ return _history;
+ }
+
+ /**
+ * @private
+ */
+ [Bindable]
+ public function set history(value:ArrayCollection):void {
+ _history = value;
+ }
+
+
+ private var _historyIndex:int = -1;
+
+ /**
+ * Index of current event in history
+ * */
+ public function get historyIndex():int {
+ return _historyIndex;
+ }
+
+ /**
+ * @private
+ */
+ [Bindable]
+ public function set historyIndex(value:int):void {
+ _historyIndex = value;
+
+ if (value != lastSavedHistoryIndex) {
+ isChanged = true;
+ }
+ else {
+ isChanged = false;
+ }
+ }
+
+
+ private var _lastSavedHistoryIndex:int = -1;
+
+ /**
+ * Index of event in history when the document was last saved
+ * */
+ public function get lastSavedHistoryIndex():int {
+ return _lastSavedHistoryIndex;
+ }
+
+ /**
+ * @private
+ */
+ [Bindable]
+ public function set lastSavedHistoryIndex(value:int):void {
+ _lastSavedHistoryIndex = value;
+
+ isChanged = historyIndex!=value;
+ }
+
+ private var _isPreviewOpen:Boolean;
+
+ /**
+ * @inheritDoc
+ * */
+ public function get isPreviewOpen():Boolean {
+ return _isPreviewOpen;
+ }
+
+ public function set isPreviewOpen(value:Boolean):void {
+ _isPreviewOpen = value;
+ }
+
+
+ private var _descriptionsDictionary:Dictionary = new Dictionary(true);
+
+ /**
+ * Reference to component description for each component instance
+ * */
+ public function get descriptionsDictionary():Dictionary {
+ return _descriptionsDictionary;
+ }
+
+ /**
+ * @private
+ */
+ public function set descriptionsDictionary(value:Dictionary):void {
+ _descriptionsDictionary = value;
+ }
+
+ private var _documentData:IDocumentData;
+
+ /**
+ * Reference to the last saved data that was loaded in
+ * */
+ public function get documentData():IDocumentData {
+ return _documentData;
+ }
+
+ /**
+ * @private
+ */
+ public function set documentData(value:IDocumentData):void {
+ _documentData = value;
+ }
+
+ /**
+ * @inheritDoc
+ * */
+ override public function close():void {
+ super.close();
+ //Radiate.log.info("Close:" + source);
+ clearHistory();
+ }
+
+ /**
+ * Removes the history events
+ * */
+ public function clearHistory():void {
+ //history.refresh();
+ history.removeAll();
+ historyIndex = -1;
+ isChanged = false;
+ }
+
+ /**
+ * Save
+ * */
+ override public function save(locations:String = REMOTE_LOCATION, options:Object = null):Boolean {
+ var savedLocallyResult:Boolean = super.save(locations, options);
+
+ lastSavedHistoryIndex = historyIndex;
+
+ return savedLocallyResult;
+ }
+
+
+
+ /**
+ *
+ * */
+ override public function toString():String {
+ var output:String = exporter.export(this);
+
+ return output;
+ }
+
+ /**
+ * Exports to XML object
+ * */
+ override public function toXML(representation:Boolean = false):XML {
+ var output:XML = exporter.exportXML(this, representation);
+
+ return output;
+ }
+
+ /**
+ * Exports an XML string.
+ * If reference is true then just returns just enough basic information to locate it.
+ * */
+ /*override public function toXMLString(reference:Boolean = false):String {
+ var output:String;
+
+ output = exporter.exportXMLString(this, reference);
+
+ return output;
+ }*/
+
+ /**
+ * Exports an MXML string.
+ * If reference is true then just enough basic information to locate it.
+ * */
+ /*override public function toMXMLString(reference:Boolean = false):String {
+ var output:String;
+
+ output = internalExporter.exportXMLString(this, reference);
+
+ return output;
+
+ }*/
+
+ /**
+ * Exports a string
+ * */
+ /*public function export(exporter:IDocumentExporter):String {
+ var output:String = exporter.exportXMLString(this);
+
+ return output;
+
+ }*/
+
+ /**
+ * Get basic document data
+ * */
+ override public function unmarshall(data:Object):void {
+ super.unmarshall(data);
+
+ if (data is IDocumentData) {
+ //documentData = IDocumentData(data);// this and
+ //IDocumentData(data).document = this;// this should be removed just have references somewhere
+ }
+ }
+
+ /**
+ * Get source code for document.
+ * Exporters may not work if the document is not open.
+ * */
+ override public function getSource(target:Object = null):String {
+ var value:String;
+
+ if (isOpen) {
+ if (this.historyIndex==-1) {
+ //Radiate.log.info("Document history is empty!");
+ }
+
+ if (isChanged || source==null || source=="") {
+ value = internalExporter.export(this);
+ }
+ else if (source) {
+ value = source;
+ }
+ else if (originalSource) {
+ value = originalSource;
+ }
+
+ /*
+ Radiate.log.info("is changed=" + isChanged);
+ Radiate.log.info("original source null=" + (originalSource==null));
+ Radiate.log.info("history length=" + history.length);
+ Radiate.log.info("history index=" + historyIndex);
+ Radiate.log.info("instance stage=" + (instance?instance.stage:null));
+ Radiate.log.info("date saved=" + dateSaved);
+ Radiate.log.info(value);*/
+/* Main Thread (Suspended)
+ com.flexcapacitor.model::Document/getSource
+ com.flexcapacitor.model::DocumentData/close
+ com.flexcapacitor.model::Document/close
+ com.flexcapacitor.controller::Radiate/closeDocument
+ com.flexcapacitor.controller::Radiate/closeProject
+ com.flexcapacitor.views.panels::ProjectInspector/closeProjectIcon_clickHandler
+ com.flexcapacitor.views.panels::ProjectInspector/__closeProjectIcon_click
+*/
+ return value;
+
+ }
+ // return source;
+ return source;
+ }
+
+ /**
+ * Parses the code and builds a document.
+ * If code is null and source is set then parses source.
+ * If parent is set then imports code to the parent.
+ * */
+ public function parseSource(code:String = null, parent:IVisualElement = null):void {
+ var codeToParse:String = code ? code : source;
+ var currentChildren:XMLList;
+ var nodeName:String;
+ var child:XML;
+ var xml:XML;
+ var root:String;
+ var isValid:Boolean;
+ var rootNodeName:String = "RootWrapperNode";
+ var updatedCode:String;
+
+ isValid = XMLUtils.isValidXML(codeToParse);
+
+ if (!isValid) {
+ root = '<'+rootNodeName+ ' xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx">';
+ updatedCode = root + codeToParse + "</"+rootNodeName+">";
+
+ isValid = XMLUtils.isValidXML(updatedCode);
+ if (isValid) {
+ codeToParse = updatedCode;
+ }
+ }
+
+ // check for valid XML
+ try {
+ xml = new XML(codeToParse);
+ }
+ catch (error:Error) {
+ Radiate.log.error("Could not parse code for document " + name + ". " + error.message);
+ }
+
+
+ if (xml) {
+ // loop through each item and create an instance
+ // and set the properties and styles on it
+ /*currentChildren = xml.children();
+ while (child in currentChildren) {
+ nodeName = child.name();
+
+ }*/
+ //Radiate.log.info("Importing document: " + name);
+ //var mxmlLoader:MXMLImporter = new MXMLImporter( "testWindow", new XML( inSource ), canvasHolder );
+ var mxmlLoader:MXMLDocumentImporter;
+ var container:IVisualElement = parent ? parent as IVisualElement : instance as IVisualElement;
+ mxmlLoader = new MXMLDocumentImporter(this, "testWindow", xml, container);
+
+ if (container) {
+ Radiate.getInstance().setTarget(container);
+ }
+ }
+
+
+ /*_toolTipChildren = new SystemChildrenList(this,
+ new QName(mx_internal, "topMostIndex"),
+ new QName(mx_internal, "toolTipIndex"));*/
+ //return true;
+ }
+
+ /**
+ * Resets the save status after loading a document
+ * */
+ public function resetSaveStatus():void {
+ lastSavedHistoryIndex = historyIndex;
+ }
+ }
+}
\ No newline at end of file