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 2016/02/13 01:14:44 UTC
[37/37] git commit: [flex-asjs] [refs/heads/spark] - copy of many
flex-sdk classes,
modified to try to compile on top of the FlexJS base classes. A COMPILE::LATER
flag is used to comment out features like multi-swf support and a few other
features that
copy of many flex-sdk classes, modified to try to compile on top of the FlexJS base classes. A COMPILE::LATER flag is used to comment out features like multi-swf support and a few other features that bring in huge dependency chains of hard-to-port code. Still needed: Proxy support, some way to replace some Dictionary usage, and an emulation of TextField and probably some other things
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/1f6418c4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1f6418c4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1f6418c4
Branch: refs/heads/spark
Commit: 1f6418c462d7e7d707019cb9d549ccbfb4047631
Parents: 190a653
Author: Alex Harui <ah...@apache.org>
Authored: Fri Feb 12 16:12:09 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Feb 12 16:12:09 2016 -0800
----------------------------------------------------------------------
.../MX/.externalToolBuilders/MXASJS.launch | 44 +
.../projects/MX/src/main/flex/MXClasses.as | 35 +
.../src/main/flex/flex/display/DisplayObject.as | 387 +
.../flex/flex/display/DisplayObjectContainer.as | 28 +
.../main/flex/flex/display/InteractiveObject.as | 26 +
.../MX/src/main/flex/flex/display/Loader.as | 27 +
.../MX/src/main/flex/flex/display/ModuleInfo.as | 53 +
.../MX/src/main/flex/flex/display/Sprite.as | 25 +
.../main/flex/flex/display/TopOfDisplayList.as | 45 +
.../MX/src/main/flex/flex/events/Event.as | 17 +
.../MX/src/main/flex/flex/events/EventPhase.as | 13 +
.../main/flex/flex/events/IEventDispatcher.as | 10 +
.../main/flex/flex/system/DefinitionManager.as | 54 +
.../MX/src/main/flex/flex/system/I18NManager.as | 24 +
.../MX/src/main/flex/flex/ui/Keyboard.as | 34 +
.../flex/mx/automation/IAutomationObject.as | 324 +
.../src/main/flex/mx/binding/BindabilityInfo.as | 280 +
.../MX/src/main/flex/mx/binding/Binding.as | 548 +
.../src/main/flex/mx/binding/BindingManager.as | 275 +
.../flex/mx/binding/EvalBindingResponder.as | 98 +
.../flex/mx/binding/FunctionReturnWatcher.as | 295 +
.../src/main/flex/mx/binding/IBindingClient.as | 35 +
.../src/main/flex/mx/binding/PropertyWatcher.as | 388 +
.../flex/mx/binding/StaticPropertyWatcher.as | 278 +
.../MX/src/main/flex/mx/binding/Watcher.as | 323 +
.../MX/src/main/flex/mx/binding/XMLWatcher.as | 191 +
.../MX/src/main/flex/mx/collections/IList.as | 271 +
.../mx/collections/errors/ItemPendingError.as | 133 +
.../main/flex/mx/controls/IFlexContextMenu.as | 75 +
.../MX/src/main/flex/mx/controls/ToolTip.as | 515 +
.../main/flex/mx/core/ComponentDescriptor.as | 436 +
.../flex/mx/core/ContainerCreationPolicy.as | 109 +
.../src/main/flex/mx/core/ContainerGlobals.as | 114 +
.../src/main/flex/mx/core/DPIClassification.as | 98 +
.../MX/src/main/flex/mx/core/DesignLayer.as | 447 +
.../MX/src/main/flex/mx/core/EdgeMetrics.as | 201 +
.../MX/src/main/flex/mx/core/EmbeddedFont.as | 223 +
.../MX/src/main/flex/mx/core/FlexGlobals.as | 55 +
.../MX/src/main/flex/mx/core/FlexVersion.as | 488 +
.../main/flex/mx/core/IAssetLayoutFeatures.as | 374 +
.../MX/src/main/flex/mx/core/IBorder.as | 70 +
.../MX/src/main/flex/mx/core/IButton.as | 77 +
.../MX/src/main/flex/mx/core/IChildList.as | 313 +
.../src/main/flex/mx/core/IConstraintClient.as | 96 +
.../MX/src/main/flex/mx/core/IContainer.as | 126 +
.../main/flex/mx/core/IDeferredContentOwner.as | 104 +
.../src/main/flex/mx/core/IDeferredInstance.as | 106 +
.../core/IDeferredInstantiationUIComponent.as | 170 +
.../mx/core/IDisplayObjectContainerInterface.as | 203 +
.../flex/mx/core/IDisplayObjectInterface.as | 380 +
.../main/flex/mx/core/IEmbeddedFontRegistry.as | 150 +
.../src/main/flex/mx/core/IFlexDisplayObject.as | 153 +
.../MX/src/main/flex/mx/core/IFlexModule.as | 47 +
.../src/main/flex/mx/core/IFlexModuleFactory.as | 276 +
.../main/flex/mx/core/IFontContextComponent.as | 68 +
.../flex/mx/core/IInteractiveObjectInterface.as | 87 +
.../MX/src/main/flex/mx/core/IInvalidating.as | 119 +
.../flex/mx/core/ILayoutDirectionElement.as | 82 +
.../MX/src/main/flex/mx/core/ILayoutElement.as | 851 +
.../MX/src/main/flex/mx/core/IMXMLObject.as | 61 +
.../src/main/flex/mx/core/IProgrammaticSkin.as | 55 +
.../flex/mx/core/IPropertyChangeNotifier.as | 97 +
.../main/flex/mx/core/IRawChildrenContainer.as | 65 +
.../src/main/flex/mx/core/IRectangularBorder.as | 87 +
.../MX/src/main/flex/mx/core/IRepeaterClient.as | 160 +
.../src/main/flex/mx/core/ISpriteInterface.as | 113 +
.../MX/src/main/flex/mx/core/IStateClient.as | 60 +
.../MX/src/main/flex/mx/core/IStateClient2.as | 103 +
.../main/flex/mx/core/ISystemCursorClient.as | 59 +
.../MX/src/main/flex/mx/core/IToolTip.as | 81 +
.../flex/mx/core/ITransientDeferredInstance.as | 65 +
.../MX/src/main/flex/mx/core/IUIComponent.as | 574 +
.../projects/MX/src/main/flex/mx/core/IUID.as | 62 +
.../MX/src/main/flex/mx/core/IVisualElement.as | 290 +
.../flex/mx/core/IVisualElementContainer.as | 281 +
.../MX/src/main/flex/mx/core/LayoutDirection.as | 77 +
.../mx/core/LayoutElementUIComponentUtils.as | 576 +
.../src/main/flex/mx/core/RuntimeDPIProvider.as | 182 +
.../MX/src/main/flex/mx/core/Singleton.as | 125 +
.../MX/src/main/flex/mx/core/UIComponent.as | 14827 +++++++++++++++++
.../main/flex/mx/core/UIComponentCachePolicy.as | 78 +
.../main/flex/mx/core/UIComponentDescriptor.as | 208 +
.../src/main/flex/mx/core/UIComponentGlobals.as | 161 +
.../MX/src/main/flex/mx/core/Version.as | 26 +
.../MX/src/main/flex/mx/core/mx_internal.as | 37 +
.../src/main/flex/mx/effects/EffectManager.as | 968 ++
.../main/flex/mx/effects/EffectTargetFilter.as | 331 +
.../src/main/flex/mx/effects/IAbstractEffect.as | 46 +
.../MX/src/main/flex/mx/effects/IEffect.as | 717 +
.../src/main/flex/mx/effects/IEffectInstance.as | 585 +
.../main/flex/mx/effects/IEffectTargetHost.as | 123 +
.../mx/effects/effectClasses/PropertyChanges.as | 149 +
.../mx/events/ChildExistenceChangedEvent.as | 213 +
.../MX/src/main/flex/mx/events/DynamicEvent.as | 109 +
.../MX/src/main/flex/mx/events/EffectEvent.as | 288 +
.../src/main/flex/mx/events/FlexChangeEvent.as | 187 +
.../MX/src/main/flex/mx/events/FlexEvent.as | 1474 ++
.../MX/src/main/flex/mx/events/FocusEvent.as | 159 +
.../MX/src/main/flex/mx/events/KeyboardEvent.as | 148 +
.../MX/src/main/flex/mx/events/MoveEvent.as | 160 +
.../main/flex/mx/events/PropertyChangeEvent.as | 282 +
.../flex/mx/events/PropertyChangeEventKind.as | 65 +
.../MX/src/main/flex/mx/events/Request.as | 127 +
.../MX/src/main/flex/mx/events/ResizeEvent.as | 161 +
.../src/main/flex/mx/events/StateChangeEvent.as | 205 +
.../MX/src/main/flex/mx/events/ToolTipEvent.as | 299 +
.../MX/src/main/flex/mx/events/TweenEvent.as | 229 +
.../flex/mx/events/ValidationResultEvent.as | 236 +
.../src/main/flex/mx/geom/RoundedRectangle.as | 94 +
.../src/main/flex/mx/managers/CursorManager.as | 429 +
.../main/flex/mx/managers/CursorManagerImpl.as | 1034 ++
.../flex/mx/managers/CursorManagerPriority.as | 79 +
.../src/main/flex/mx/managers/ICursorManager.as | 51 +
.../src/main/flex/mx/managers/IFocusManager.as | 300 +
.../flex/mx/managers/IFocusManagerComponent.as | 193 +
.../flex/mx/managers/IFocusManagerContainer.as | 130 +
.../src/main/flex/mx/managers/ILayoutManager.as | 320 +
.../flex/mx/managers/ILayoutManagerClient.as | 211 +
.../src/main/flex/mx/managers/ISystemManager.as | 506 +
.../mx/managers/ISystemManagerChildManager.as | 60 +
.../main/flex/mx/managers/IToolTipManager.as | 206 +
.../main/flex/mx/managers/IToolTipManager2.as | 219 +
.../flex/mx/managers/IToolTipManagerClient.as | 69 +
.../main/flex/mx/managers/SystemChildrenList.as | 300 +
.../src/main/flex/mx/managers/SystemManager.as | 3758 +++++
.../flex/mx/managers/SystemManagerGlobals.as | 56 +
.../flex/mx/managers/SystemRawChildrenList.as | 240 +
.../src/main/flex/mx/managers/ToolTipManager.as | 526 +
.../main/flex/mx/managers/ToolTipManagerImpl.as | 1717 ++
.../flex/mx/preloaders/IPreloaderDisplay.as | 193 +
.../MX/src/main/flex/mx/preloaders/Preloader.as | 684 +
.../main/flex/mx/resources/IResourceBundle.as | 256 +
.../main/flex/mx/resources/IResourceManager.as | 831 +
.../src/main/flex/mx/resources/LocaleSorter.as | 1084 ++
.../main/flex/mx/resources/ResourceBundle.as | 249 +
.../main/flex/mx/resources/ResourceManager.as | 129 +
.../flex/mx/resources/ResourceManagerImpl.as | 1430 ++
.../MX/src/main/flex/mx/rpc/IResponder.as | 60 +
.../MX/src/main/flex/mx/states/AddChild.as | 536 +
.../MX/src/main/flex/mx/states/AddItems.as | 1198 ++
.../MX/src/main/flex/mx/states/IOverride.as | 91 +
.../main/flex/mx/states/InterruptionBehavior.as | 62 +
.../MX/src/main/flex/mx/states/OverrideBase.as | 222 +
.../MX/src/main/flex/mx/states/RemoveChild.as | 211 +
.../src/main/flex/mx/states/SetEventHandler.as | 398 +
.../MX/src/main/flex/mx/states/SetProperty.as | 492 +
.../MX/src/main/flex/mx/states/SetStyle.as | 454 +
.../MX/src/main/flex/mx/states/State.as | 291 +
.../MX/src/main/flex/mx/states/Transition.as | 264 +
.../MX/src/main/flex/mx/styles/CSSCondition.as | 236 +
.../src/main/flex/mx/styles/CSSConditionKind.as | 84 +
.../MX/src/main/flex/mx/styles/CSSDimension.as | 152 +
.../MX/src/main/flex/mx/styles/CSSOSVersion.as | 108 +
.../MX/src/main/flex/mx/styles/CSSSelector.as | 328 +
.../main/flex/mx/styles/CSSStyleDeclaration.as | 1173 ++
.../main/flex/mx/styles/IAdvancedStyleClient.as | 161 +
.../main/flex/mx/styles/ISimpleStyleClient.as | 94 +
.../MX/src/main/flex/mx/styles/IStyleClient.as | 268 +
.../MX/src/main/flex/mx/styles/IStyleManager.as | 572 +
.../src/main/flex/mx/styles/IStyleManager2.as | 220 +
.../MX/src/main/flex/mx/styles/StyleManager.as | 834 +
.../src/main/flex/mx/styles/StyleManagerImpl.as | 2046 +++
.../src/main/flex/mx/styles/StyleProtoChain.as | 1065 ++
.../flex/mx/styles/metadata/AnchorStyles.as | 158 +
.../flex/mx/styles/metadata/BarColorStyle.as | 35 +
.../flex/mx/styles/metadata/BorderStyles.as | 250 +
.../metadata/ContainerBackgroundStyles.as | 65 +
.../main/flex/mx/styles/metadata/GapStyles.as | 42 +
.../flex/mx/styles/metadata/LeadingStyle.as | 31 +
.../flex/mx/styles/metadata/PaddingStyles.as | 51 +
.../main/flex/mx/styles/metadata/TextStyles.as | 351 +
.../MX/src/main/flex/mx/utils/ColorUtil.as | 166 +
.../MX/src/main/flex/mx/utils/DensityUtil.as | 98 +
.../src/main/flex/mx/utils/DescribeTypeCache.as | 173 +
.../flex/mx/utils/DescribeTypeCacheRecord.as | 129 +
.../MX/src/main/flex/mx/utils/GraphicsUtil.as | 298 +
.../MX/src/main/flex/mx/utils/IXMLNotifiable.as | 43 +
.../MX/src/main/flex/mx/utils/MatrixUtil.as | 1751 ++
.../src/main/flex/mx/utils/MediaQueryParser.as | 642 +
.../MX/src/main/flex/mx/utils/NameUtil.as | 187 +
.../MX/src/main/flex/mx/utils/ObjectProxy.as | 825 +
.../MX/src/main/flex/mx/utils/ObjectUtil.as | 1640 ++
.../flex/mx/utils/OnDemandEventDispatcher.as | 153 +
.../MX/src/main/flex/mx/utils/Platform.as | 337 +
.../MX/src/main/flex/mx/utils/StringUtil.as | 365 +
.../MX/src/main/flex/mx/utils/UIDUtil.as | 424 +
.../MX/src/main/flex/mx/utils/XMLNotifier.as | 264 +
.../MX/src/main/flex/mx/utils/object_proxy.as | 34 +
.../flex/mx/validators/IValidatorListener.as | 132 +
.../main/flex/mx/validators/ValidationResult.as | 147 +
.../src/main/resources/compile-asjs-config.xml | 85 +
.../MX/src/main/resources/compile-config.xml | 85 +
.../MX/src/main/resources/mx-manifest.xml | 26 +
193 files changed, 72606 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/.externalToolBuilders/MXASJS.launch
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/.externalToolBuilders/MXASJS.launch b/frameworks/projects/MX/.externalToolBuilders/MXASJS.launch
new file mode 100644
index 0000000..1cbae52
--- /dev/null
+++ b/frameworks/projects/MX/.externalToolBuilders/MXASJS.launch
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+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.
+
+-->
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="compile-asjs,compile-extern-swc,copy-js,"/>
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="compile-asjs,compile-extern-swc,copy-js,"/>
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 1.7"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="MX"/>
+<mapAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_PROPERTIES">
+<mapEntry key="eclipse.home" value="/Applications/Adobe Flash Builder 4.7/eclipse"/>
+<mapEntry key="eclipse.running" value="true"/>
+<mapEntry key="fb.running" value="true"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_PROPERTY_FILES" value="${PROJECT_FRAMEWORKS}/fb.properties,"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/MX/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/MX}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/MXClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/MXClasses.as b/frameworks/projects/MX/src/main/flex/MXClasses.as
new file mode 100644
index 0000000..0ab997a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/MXClasses.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+/**
+ * @private
+ * This class is used to link additional classes into rpc.swc
+ * beyond those that are found by dependecy analysis starting
+ * from the classes specified in manifest.xml.
+ */
+internal class MXClasses
+{
+
+ import mx.core.UIComponent; UIComponent;
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/DisplayObject.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/DisplayObject.as b/frameworks/projects/MX/src/main/flex/flex/display/DisplayObject.as
new file mode 100644
index 0000000..0cf041b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/DisplayObject.as
@@ -0,0 +1,387 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+import org.apache.flex.core.IUIBase;
+import org.apache.flex.geom.Point;
+import org.apache.flex.geom.Rectangle;
+
+public interface DisplayObject
+{
+/*
+ * The methods here would normally just be in IDisplayObject,
+ * but for backward compatibility, they have to be included
+ * directly into IFlexDisplayObject, so they are kept in
+ * this separate include file.
+ */
+
+ /**
+ * @copy flash.display.DisplayObject#root
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get root():DisplayObject;
+
+
+ /**
+ * @copy flash.display.DisplayObject#stage
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function get stage():Stage;
+
+
+ /**
+ * @copy flash.display.DisplayObject#name
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get name():String;
+ function set name(value:String):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#parent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get parent():IUIBase;
+
+
+ /**
+ * @copy flash.display.DisplayObject#mask
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mask():DisplayObject;
+ function set mask(value:DisplayObject):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#visible
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get visible():Boolean;
+ function set visible(value:Boolean):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#x
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get x():Number;
+ function set x(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#y
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get y():Number;
+ function set y(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#scaleX
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get scaleX():Number;
+ function set scaleX(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#scaleY
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get scaleY():Number;
+ function set scaleY(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#mouseX
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mouseX():Number; // note: no setter
+
+
+ /**
+ * @copy flash.display.DisplayObject#mouseY
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mouseY():Number; // note: no setter
+
+
+ /**
+ * @copy flash.display.DisplayObject#rotation
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get rotation():Number;
+ function set rotation(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#alpha
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get alpha():Number;
+ function set alpha(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#width
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get width():Number;
+ function set width(value:Number):void;
+
+ /**
+ * @copy flash.display.DisplayObject#height
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get height():Number;
+ function set height(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#cacheAsBitmap
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get cacheAsBitmap():Boolean;
+ function set cacheAsBitmap(value:Boolean):void;
+
+ /**
+ * @copy flash.display.DisplayObject#opaqueBackground
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get opaqueBackground():Object;
+ function set opaqueBackground(value:Object):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#scrollRect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get scrollRect():Rectangle;
+ function set scrollRect(value:Rectangle):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#filters
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get filters():Array;
+ function set filters(value:Array):void;
+
+ /**
+ * @copy flash.display.DisplayObject#blendMode
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get blendMode():String;
+ function set blendMode(value:String):void;
+
+ /**
+ * @copy flash.display.DisplayObject#transform
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function get transform():Transform;
+ COMPILE::LATER
+ function set transform(value:Transform):void;
+
+ /**
+ * @copy flash.display.DisplayObject#scale9Grid
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get scale9Grid():Rectangle;
+ function set scale9Grid(innerRectangle:Rectangle):void;
+
+ /**
+ * @copy flash.display.DisplayObject#globalToLocal()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function globalToLocal(point:Point):Point;
+
+ /**
+ * @copy flash.display.DisplayObject#localToGlobal()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function localToGlobal(point:Point):Point;
+
+ /**
+ * @copy flash.display.DisplayObject#getBounds()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getBounds(targetCoordinateSpace:DisplayObject):Rectangle;
+
+ /**
+ * @copy flash.display.DisplayObject#getRect()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getRect(targetCoordinateSpace:DisplayObject):Rectangle;
+
+ /**
+ * @copy flash.display.DisplayObject#loaderInfo
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function get loaderInfo() : LoaderInfo;
+
+ /**
+ * @copy flash.display.DisplayObject#hitTestObject()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function hitTestObject(obj:DisplayObject):Boolean;
+
+ /**
+ * @copy flash.display.DisplayObject#hitTestPoint()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function hitTestPoint(x:Number, y:Number, shapeFlag:Boolean=false):Boolean;
+
+ /**
+ * @copy flash.display.DisplayObject#accessibilityProperties
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function get accessibilityProperties() : AccessibilityProperties;
+ COMPILE::LATER
+ function set accessibilityProperties( value : AccessibilityProperties ) : void;
+
+}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/DisplayObjectContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/DisplayObjectContainer.as b/frameworks/projects/MX/src/main/flex/flex/display/DisplayObjectContainer.as
new file mode 100644
index 0000000..939725a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/DisplayObjectContainer.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+ import org.apache.flex.core.IUIBase;
+
+ public interface DisplayObjectContainer extends DisplayObject, IUIBase
+ {
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/InteractiveObject.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/InteractiveObject.as b/frameworks/projects/MX/src/main/flex/flex/display/InteractiveObject.as
new file mode 100644
index 0000000..4384c36
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/InteractiveObject.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+ public interface InteractiveObject extends DisplayObjectContainer
+ {
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/Loader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/Loader.as b/frameworks/projects/MX/src/main/flex/flex/display/Loader.as
new file mode 100644
index 0000000..78bec64
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/Loader.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+ // keeps UIComponent happy when compiling
+ public interface Loader extends DisplayObjectContainer
+ {
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as b/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
new file mode 100644
index 0000000..39d4c72
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+ COMPILE::AS3
+ {
+ import flash.display.LoaderInfo;
+ }
+
+ public class ModuleInfo
+ {
+
+ private var loaderInfo:LoaderInfo;
+
+ COMPILE::AS3
+ public function ModuleInfo(loaderInfo:LoaderInfo)
+ {
+ this.loaderInfo = loaderInfo;
+ }
+
+ public function get height():Number
+ {
+ return loaderInfo.height;
+ }
+
+ public function get width():Number
+ {
+ return loaderInfo.width;
+ }
+
+ public function get url():String
+ {
+ return loaderInfo.url;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as b/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
new file mode 100644
index 0000000..ff3e16e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
@@ -0,0 +1,25 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+ public interface Sprite extends InteractiveObject
+ {
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as b/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
new file mode 100644
index 0000000..41ef735
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.display
+{
+COMPILE::AS3
+{
+ import flash.display.Stage;
+}
+
+COMPILE::AS3
+public class TopOfDisplayList extends Stage
+{
+ public function TopOfDisplayList()
+ {
+ super();
+ }
+}
+
+COMPILE::JS
+public class TopOfDisplayList extends UIBase
+{
+ public function TopOfDisplayList()
+ {
+ super();
+ }
+}
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/events/Event.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/events/Event.as b/frameworks/projects/MX/src/main/flex/flex/events/Event.as
new file mode 100644
index 0000000..c8e9d2b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/events/Event.as
@@ -0,0 +1,17 @@
+package flex.events
+{
+ import org.apache.flex.events.Event;
+
+ public class Event extends org.apache.flex.events.Event
+ {
+ public function Event(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ public static const ADDED:String = "added";
+ public static const ENTER_FRAME:String = "enterFrame";
+ public static const REMOVED:String = "removed";
+ public static const REMOVED_FROM_STAGE:String = "removedFromStage";
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/events/EventPhase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/events/EventPhase.as b/frameworks/projects/MX/src/main/flex/flex/events/EventPhase.as
new file mode 100644
index 0000000..8f9db3b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/events/EventPhase.as
@@ -0,0 +1,13 @@
+package flex.events
+{
+ public class EventPhase
+ {
+ public function EventPhase()
+ {
+ }
+
+ public static const AT_TARGET:int = 2;
+ public static const BUBBLING_PHASE:int = 3;
+ public static const CAPTURING_PHASE:int = 1;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/events/IEventDispatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/events/IEventDispatcher.as b/frameworks/projects/MX/src/main/flex/flex/events/IEventDispatcher.as
new file mode 100644
index 0000000..e1017e4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/events/IEventDispatcher.as
@@ -0,0 +1,10 @@
+package flex.events
+{
+ import org.apache.flex.events.IEventDispatcher;
+
+ public interface IEventDispatcher extends org.apache.flex.events.IEventDispatcher
+ {
+ function get bindingEventDispatcher():org.apache.flex.events.IEventDispatcher;
+ function get effectEventDispatcher():org.apache.flex.events.IEventDispatcher;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/system/DefinitionManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/system/DefinitionManager.as b/frameworks/projects/MX/src/main/flex/flex/system/DefinitionManager.as
new file mode 100644
index 0000000..c130488
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/system/DefinitionManager.as
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.system
+{
+ import flash.system.ApplicationDomain;
+
+ public class DefinitionManager
+ {
+ COMPILE::AS3
+ public function DefinitionManager(appdom:ApplicationDomain = null)
+ {
+ if (appdom)
+ this.appdom = appdom;
+ else
+ this.appdom = ApplicationDomain.currentDomain;
+ }
+
+ COMPILE::AS3
+ private var appdom:ApplicationDomain;
+
+ public function hasDefinition(name:String):Boolean
+ {
+ COMPILE::AS3
+ {
+ return appdom.hasDefinition(name);
+ }
+ }
+
+ public function getDefinition(name:String):Object
+ {
+ COMPILE::AS3
+ {
+ return appdom.hasDefinition(name);
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/system/I18NManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/system/I18NManager.as b/frameworks/projects/MX/src/main/flex/flex/system/I18NManager.as
new file mode 100644
index 0000000..c838d89
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/system/I18NManager.as
@@ -0,0 +1,24 @@
+package flex.system
+{
+ import flash.system.Capabilities;
+
+ public class I18NManager
+ {
+ public function I18NManager()
+ {
+ }
+
+ public static function get languages():Array
+ {
+ COMPILE::AS3
+ {
+ // Capabilities.languages was added in AIR 1.1,
+ // so this API may not exist.
+ if (Capabilities["languages"])
+ return Capabilities["languages"];
+ else
+ return [ Capabilities.language ];
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/flex/ui/Keyboard.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/ui/Keyboard.as b/frameworks/projects/MX/src/main/flex/flex/ui/Keyboard.as
new file mode 100644
index 0000000..f301fc3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/ui/Keyboard.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flex.ui
+{
+ public class Keyboard
+ {
+ public function Keyboard()
+ {
+ }
+
+ public static const LEFT = 0x25;
+ public static const UP = 0x26;
+ public static const RIGHT = 0x27;
+ public static const DOWN = 0x28;
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/automation/IAutomationObject.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/automation/IAutomationObject.as b/frameworks/projects/MX/src/main/flex/mx/automation/IAutomationObject.as
new file mode 100644
index 0000000..61882a8
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/automation/IAutomationObject.as
@@ -0,0 +1,324 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.automation
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObjectContainer;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObjectContainer;
+}
+import flex.events.Event;
+
+/**
+ * The IAutomationObject interface defines the interface
+ * for a delegate object that implements automation
+ * for a component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IAutomationObject
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // automationDelegate
+ //----------------------------------
+
+ /**
+ * The delegate object that is handling the automation-related functionality.
+ * Automation sets this when it creates the delegate object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get automationDelegate():Object;
+
+ /**
+ * @private
+ */
+ function set automationDelegate(delegate:Object):void;
+
+ //----------------------------------
+ // automationName
+ //----------------------------------
+
+ /**
+ * Name that can be used as an identifier for this object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get automationName():String;
+
+ /**
+ * @private
+ */
+ function set automationName(name:String):void;
+
+ //----------------------------------
+ // automationValue
+ //----------------------------------
+
+ /**
+ * This value generally corresponds to the rendered appearance of the
+ * object and should be usable for correlating the identifier with
+ * the object as it appears visually within the application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get automationValue():Array;
+
+ /**
+ * The number of automation children this container has.
+ * This sum should not include any composite children, though
+ * it does include those children not significant within the
+ * automation hierarchy.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get numAutomationChildren():int;
+
+ /**
+ * A flag that determines if an automation object
+ * shows in the automation hierarchy.
+ * Children of containers that are not visible in the hierarchy
+ * appear as children of the next highest visible parent.
+ * Typically containers used for layout, such as boxes and Canvas,
+ * do not appear in the hierarchy.
+ *
+ * <p>Some controls force their children to appear
+ * in the hierarchy when appropriate.
+ * For example a List will always force item renderers,
+ * including boxes, to appear in the hierarchy.
+ * Implementers must support setting this property
+ * to <code>true</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get showInAutomationHierarchy():Boolean;
+
+ /**
+ * @private
+ */
+ function set showInAutomationHierarchy(value:Boolean):void;
+
+ /**
+ * An implementation of the <code>IAutomationTabularData</code> interface, which
+ * can be used to retrieve the data.
+ *
+ * @return An implementation of the <code>IAutomationTabularData</code> interface.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get automationTabularData():Object;
+
+ /**
+ * The owner of this component for automation purposes.
+ *
+ * @see mx.core.IVisualElement#owner
+ *
+ * @return The owner of this component
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ function get automationOwner():DisplayObjectContainer;
+
+ /**
+ * The parent of this component for automation purposes.
+ *
+ * @see mx.core.IVisualElement#parent
+ *
+ * @return The parent of this component
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ function get automationParent():DisplayObjectContainer;
+
+ /**
+ * True if this component is enabled for automation, false
+ * otherwise.
+ *
+ * @see mx.core.IUIComponent#enabled
+ *
+ * @return <code>true</code> if this component is enabled for automation,
+ * <code>false</code> otherwise.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ function get automationEnabled():Boolean;
+
+ /**
+ * True if this component is visible for automation, false
+ * otherwise.
+ *
+ * @see flash.display.DisplayObject#visible
+ *
+ * @return <code>true</code> if this component is visible for automation,
+ * <code>false</code> otherwise.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ function get automationVisible():Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns a set of properties that identify the child within
+ * this container. These values should not change during the
+ * lifespan of the application.
+ *
+ * @param child Child for which to provide the id.
+ *
+ * @return Sets of properties describing the child which can
+ * later be used to resolve the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function createAutomationIDPart(child:IAutomationObject):Object;
+
+ /**
+ * Returns a set of properties as automation IDs that identify the child within
+ * this container. These values should not change during the
+ * lifespan of the application
+ *
+ * @param child Child for which to provide the id.
+ *
+ * @param properties which needs to be considered for forming the Id.
+ *
+ * @return Sets of properties describing the child which can
+ * later be used to resolve the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function createAutomationIDPartWithRequiredProperties(child:IAutomationObject, properties:Array):Object;
+
+ /**
+ * Resolves a child by using the id provided. The id is a set
+ * of properties as provided by the <code>createAutomationIDPart()</code> method.
+ *
+ * @param criteria Set of properties describing the child.
+ * The criteria can contain regular expression values
+ * resulting in multiple children being matched.
+ * @return Array of children that matched the criteria
+ * or <code>null</code> if no children could not be resolved.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function resolveAutomationIDPart(criteria:Object):Array;
+
+ /**
+ * Provides the automation object at the specified index. This list
+ * should not include any children that are composites.
+ *
+ * @param index The index of the child to return
+ *
+ * @return The child at the specified index.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getAutomationChildAt(index:int):IAutomationObject;
+
+ /**
+ * Provides the automation object list . This list
+ * does not include any children that are composites.
+ *
+ * @return the automation children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getAutomationChildren():Array;
+
+ /**
+ * Replays the specified event. A component author should probably call
+ * super.replayAutomatableEvent in case default replay behavior has been defined
+ * in a superclass.
+ *
+ * @param event The event to replay.
+ *
+ * @return <code>true</code> if a replay was successful.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function replayAutomatableEvent(event:Event):Boolean;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as b/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as
new file mode 100644
index 0000000..5cbf6ef
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.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 mx.binding
+{
+
+import mx.events.PropertyChangeEvent;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * Bindability information for children (properties or methods)
+ * of a given class, based on the describeType() structure for that class.
+ */
+public class BindabilityInfo
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Name of [Bindable] metadata.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const BINDABLE:String = "Bindable";
+
+ /**
+ * Name of [Managed] metadata.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const MANAGED:String = "Managed";
+
+ /**
+ * Name of [ChangeEvent] metadata.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CHANGE_EVENT:String = "ChangeEvent";
+
+ /**
+ * Name of [NonCommittingChangeEvent] metadata.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const NON_COMMITTING_CHANGE_EVENT:String =
+ "NonCommittingChangeEvent";
+
+ /**
+ * Name of describeType() <accessor> element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ACCESSOR:String = "accessor";
+
+ /**
+ * Name of describeType() <method> element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const METHOD:String = "method";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function BindabilityInfo(typeDescription:XML)
+ {
+ super();
+
+ this.typeDescription = typeDescription;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var typeDescription:XML;
+
+ /**
+ * @private
+ * event name -> true
+ */
+ private var classChangeEvents:Object;
+
+ /**
+ * @private
+ * child name -> { event name -> true }
+ */
+ private var childChangeEvents:Object = {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Object containing { eventName: true } for each change event
+ * (class- or child-level) that applies to the specified child.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChangeEvents(childName:String):Object
+ {
+ var changeEvents:Object = childChangeEvents[childName];
+
+ if (!changeEvents)
+ {
+ // Seed with class-level events.
+ changeEvents = copyProps(getClassChangeEvents(), {});
+
+ // Get child-specific events.
+ var childDesc:XMLList =
+ typeDescription.accessor.(@name == childName) +
+ typeDescription.method.(@name == childName);
+
+ var numChildren:int = childDesc.length();
+
+ if (numChildren == 0)
+ {
+ // we've been asked for events on an unknown property
+ if (!typeDescription.@dynamic)
+ {
+ trace("warning: no describeType entry for '" +
+ childName + "' on non-dynamic type '" +
+ typeDescription.@name + "'");
+ }
+ }
+ else
+ {
+ if (numChildren > 1)
+ {
+ trace("warning: multiple describeType entries for '" +
+ childName + "' on type '" + typeDescription.@name +
+ "':\n" + childDesc);
+ }
+
+ addBindabilityEvents(childDesc.metadata, changeEvents);
+ }
+
+ childChangeEvents[childName] = changeEvents;
+ }
+
+ return changeEvents;
+ }
+
+ /**
+ * @private
+ * Build or return cached class change events object.
+ */
+ private function getClassChangeEvents():Object
+ {
+ if (!classChangeEvents)
+ {
+ classChangeEvents = {};
+
+ addBindabilityEvents(typeDescription.metadata, classChangeEvents);
+
+ // Class-level [Managed] means all properties
+ // dispatch propertyChange.
+ if (typeDescription.metadata.(@name == MANAGED).length() > 0)
+ {
+ classChangeEvents[PropertyChangeEvent.PROPERTY_CHANGE] = true;
+ }
+ }
+
+ return classChangeEvents;
+ }
+
+ /**
+ * @private
+ */
+ private function addBindabilityEvents(metadata:XMLList,
+ eventListObj:Object):void
+ {
+ addChangeEvents(metadata.(@name == BINDABLE), eventListObj, true);
+ addChangeEvents(metadata.(@name == CHANGE_EVENT), eventListObj, true);
+ addChangeEvents(metadata.(@name == NON_COMMITTING_CHANGE_EVENT),
+ eventListObj, false);
+ }
+
+ /**
+ * @private
+ * Transfer change events from a list of change-event-carrying metadata
+ * to an event list object.
+ * Note: metadata's first arg value is assumed to be change event name.
+ */
+ private function addChangeEvents(metadata:XMLList, eventListObj:Object, isCommit:Boolean):void
+ {
+ for each (var md:XML in metadata)
+ {
+ var arg:XMLList = md.arg;
+ if (arg.length() > 0)
+ {
+ var eventName:String = arg[0].@value;
+ eventListObj[eventName] = isCommit;
+ }
+ else
+ {
+ trace("warning: unconverted Bindable metadata in class '" +
+ typeDescription.@name + "'");
+ }
+ }
+ }
+
+ /**
+ * @private
+ * Copy properties from one object to another.
+ */
+ private function copyProps(from:Object, to:Object):Object
+ {
+ for (var propName:String in from)
+ {
+ to[propName] = from[propName];
+ }
+
+ return to;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as b/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
new file mode 100644
index 0000000..a8c569a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
@@ -0,0 +1,548 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.binding
+{
+
+import mx.collections.errors.ItemPendingError;
+import mx.core.mx_internal;
+import flash.utils.Dictionary;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class Binding
+{
+ include "../core/Version.as";
+
+ // Certain errors are normal during binding execution, so we swallow them.
+ // 1507 - invalid null argument
+ // 2005 - argument error (null gets converted to 0)
+ mx_internal static var allowedErrors:Object = generateAllowedErrors();
+ mx_internal static function generateAllowedErrors():Object
+ {
+ var o:Object = {};
+ o[1507] = 1;
+ o[2005] = 1;
+ return o;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Create a Binding object
+ *
+ * @param document The document that is the target of all of this work.
+ *
+ * @param srcFunc The function that returns us the value
+ * to use in this Binding.
+ *
+ * @param destFunc The function that will take a value
+ * and assign it to the destination.
+ *
+ * @param destString The destination represented as a String.
+ * We can then tell the ValidationManager to validate this field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function Binding(document:Object, srcFunc:Function,
+ destFunc:Function, destString:String,
+ srcString:String = null)
+ {
+ super();
+
+ this.document = document;
+ this.srcFunc = srcFunc;
+ this.destFunc = destFunc;
+ this.destString = destString;
+ this.srcString = srcString;
+ this.destFuncFailed = false;
+
+ if (this.srcFunc == null)
+ {
+ this.srcFunc = defaultSrcFunc;
+ }
+
+ if (this.destFunc == null)
+ {
+ this.destFunc = defaultDestFunc;
+ }
+
+ _isEnabled = true;
+ isExecuting = false;
+ isHandlingEvent = false;
+ hasHadValue = false;
+ uiComponentWatcher = -1;
+
+ BindingManager.addBinding(document, destString, this);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Internal storage for isEnabled property.
+ */
+ mx_internal var _isEnabled:Boolean;
+
+ /**
+ * @private
+ * Indicates that a Binding is enabled.
+ * Used to disable bindings.
+ */
+ mx_internal function get isEnabled():Boolean
+ {
+ return _isEnabled;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function set isEnabled(value:Boolean):void
+ {
+ _isEnabled = value;
+
+ if (value)
+ {
+ processDisabledRequests();
+ }
+ }
+
+ /**
+ * @private
+ * Indicates that a Binding is executing.
+ * Used to prevent circular bindings from causing infinite loops.
+ */
+ mx_internal var isExecuting:Boolean;
+
+ /**
+ * @private
+ * Indicates that the binding is currently handling an event.
+ * Used to prevent us from infinitely causing an event
+ * that re-executes the the binding.
+ */
+ mx_internal var isHandlingEvent:Boolean;
+
+ /**
+ * @private
+ * Queue of watchers that fired while we were disabled.
+ * We will resynch with our binding if isEnabled is set to true
+ * and one or more of our watchers fired while we were disabled.
+ */
+ mx_internal var disabledRequests:Dictionary;
+
+ /**
+ * @private
+ * True as soon as a non-null or non-empty-string value has been used.
+ * We don't auto-validate until this is true
+ */
+ private var hasHadValue:Boolean;
+
+ /**
+ * @private
+ * This is no longer used in Flex 3.0, but it is required to load
+ * Flex 2.0.0 and Flex 2.0.1 modules.
+ */
+ public var uiComponentWatcher:int;
+
+ /**
+ * @private
+ * It's possible that there is a two-way binding set up, in which case
+ * we'll do a rudimentary optimization by not executing ourselves
+ * if our counterpart is already executing.
+ */
+ public var twoWayCounterpart:Binding;
+
+ /**
+ * @private
+ * If there is a twoWayCounterpart, hasHadValue is false, and
+ * isTwoWayPrimary is true, then the twoWayCounterpart will be
+ * executed first.
+ */
+ public var isTwoWayPrimary:Boolean;
+
+ /**
+ * @private
+ * True if a wrapped function call does not throw an error. This is used by
+ * innerExecute() to tell if the srcFunc completed successfully.
+ */
+ private var wrappedFunctionSuccessful:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * All Bindings hang off of a document for now,
+ * but really it's just the root of where these functions live.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var document:Object;
+
+ /**
+ * The function that will return us the value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var srcFunc:Function;
+
+ /**
+ * The function that takes the value and assigns it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var destFunc:Function;
+
+ /**
+ * @private
+ */
+ mx_internal var destFuncFailed:Boolean;
+
+ /**
+ * The destination represented as a String.
+ * This will be used so we can signal validation on a field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var destString:String;
+
+ /**
+ * The source represented as a String.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ mx_internal var srcString:String;
+
+ /**
+ * @private
+ * Used to suppress calls to destFunc when incoming value is either
+ * a) an XML node identical to the previously assigned XML node, or
+ * b) an XMLList containing the identical node sequence as the previously assigned XMLList
+ */
+ private var lastValue:Object;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ private function defaultDestFunc(value:Object):void
+ {
+ var chain:Array = destString.split(".");
+ var element:Object = document;
+ var i:uint = 0;
+
+ if (chain[0] == "this")
+ {
+ i++;
+ }
+
+ while (i < (chain.length - 1))
+ {
+ element = element[chain[i++]];
+ //if the element does not exist : avoid exception as it's heavy on memory allocations
+ if (element == null) {
+ destFuncFailed = true;
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error = 1009");
+ }
+ return;
+ }
+ }
+
+ element[chain[i]] = value;
+ }
+
+ private function defaultSrcFunc():Object
+ {
+ return document[srcString];
+ }
+
+ /**
+ * Execute the binding.
+ * Call the source function and get the value we'll use.
+ * Then call the destination function passing the value as an argument.
+ * Finally try to validate the destination.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function execute(o:Object = null):void
+ {
+ if (!isEnabled)
+ {
+ if (o != null)
+ {
+ registerDisabledExecute(o);
+ }
+ return;
+ }
+
+ if (twoWayCounterpart && !twoWayCounterpart.hasHadValue && twoWayCounterpart.isTwoWayPrimary)
+ {
+ twoWayCounterpart.execute();
+ hasHadValue = true;
+ return;
+ }
+
+ if (isExecuting || (twoWayCounterpart && twoWayCounterpart.isExecuting))
+ {
+ // If there is a twoWayCounterpart already executing, that means that it is
+ // assigning something of value so even though we won't execute we should be
+ // sure to mark ourselves as having had a value so that future executions will
+ // be correct. If isExecuting is true but we re-entered, that means we
+ // clearly had a value so setting hasHadValue is safe.
+ hasHadValue = true;
+ return;
+ }
+
+ try
+ {
+ isExecuting = true;
+ wrapFunctionCall(this, innerExecute, o);
+ }
+ catch(error:Error)
+ {
+ if (allowedErrors[error.errorID] == null)
+ throw error;
+ }
+ finally
+ {
+ isExecuting = false;
+ }
+ }
+
+ /**
+ * @private
+ * Take note of any execute request that occur when we are disabled.
+ */
+ private function registerDisabledExecute(o:Object):void
+ {
+ if (o != null)
+ {
+ disabledRequests = (disabledRequests != null) ? disabledRequests :
+ new Dictionary(true);
+
+ disabledRequests[o] = true;
+ }
+ }
+
+ /**
+ * @private
+ * Resynch with any watchers that may have updated while we were disabled.
+ */
+ private function processDisabledRequests():void
+ {
+ if (disabledRequests != null)
+ {
+ for (var key:Object in disabledRequests)
+ {
+ execute(key);
+ }
+
+ disabledRequests = null;
+ }
+ }
+
+
+ /**
+ * @private
+ * Note: use of this wrapper needs to be reexamined. Currently there's at least one situation where a
+ * wrapped function invokes another wrapped function, which is unnecessary (i.e., only the inner function
+ * will throw), and also risks future errors due to the 'wrappedFunctionSuccessful' member variable
+ * being stepped on. Leaving alone for now to minimize pre-GMC volatility, but should be revisited for
+ * an early dot release.
+ * Also note that the set of suppressed error codes below is repeated verbatim in Watcher.wrapUpdate.
+ * These need to be consolidated and the motivations for each need to be documented.
+ */
+ protected function wrapFunctionCall(thisArg:Object, wrappedFunction:Function, object:Object = null, ...args):Object
+ {
+ wrappedFunctionSuccessful = false;
+
+ try
+ {
+ var result:Object = wrappedFunction.apply(thisArg, args);
+ if(destFuncFailed == true) {
+ destFuncFailed = false;
+ return null;
+ }
+ wrappedFunctionSuccessful = true;
+ return result;
+ }
+ catch(error:Error)
+ {
+ if (error is ItemPendingError) {
+ (error as ItemPendingError).addResponder(new EvalBindingResponder(this, object));
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error = " + error);
+ }
+ } else if (error is RangeError) {
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error = " + error);
+ }
+ } else {
+ // Certain errors are normal when executing a srcFunc or destFunc,
+ // so we swallow them:
+ // Error #1006: Call attempted on an object that is not a function.
+ // Error #1009: null has no properties.
+ // Error #1010: undefined has no properties.
+ // Error #1055: - has no properties.
+ // Error #1069: Property - not found on - and there is no default value
+ // We allow any other errors to be thrown.
+ if ((error.errorID != 1006) &&
+ (error.errorID != 1009) &&
+ (error.errorID != 1010) &&
+ (error.errorID != 1055) &&
+ (error.errorID != 1069))
+ {
+ throw error;
+ }
+ else
+ {
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", error = " + error);
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @private
+ * true if XMLLists x and y contain the same node sequence.
+ */
+ private static function nodeSeqEqual(x:XMLList, y:XMLList):Boolean
+ {
+ var n:uint = x.length();
+ if (n == y.length())
+ {
+ for (var i:uint = 0; i < n && x[i] === y[i]; i++)
+ {
+ }
+ return i == n;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function innerExecute():void
+ {
+ destFuncFailed = false;
+ var value:Object = wrapFunctionCall(document, srcFunc);
+
+ if (BindingManager.debugDestinationStrings[destString])
+ {
+ trace("Binding: destString = " + destString + ", srcFunc result = " + value);
+ }
+
+ if (hasHadValue || wrappedFunctionSuccessful)
+ {
+ // Suppress binding assignments on non-simple XML: identical single nodes, or
+ // lists over identical node sequences.
+ // Note: outer tests are inline for efficiency
+ if (!(lastValue is XML && lastValue.hasComplexContent() && lastValue === value) &&
+ !(lastValue is XMLList && lastValue.hasComplexContent() && value is XMLList &&
+ nodeSeqEqual(lastValue as XMLList, value as XMLList)))
+ {
+ destFunc.call(document, value);
+
+ if(destFuncFailed == false) {
+ // Note: state is not updated if destFunc throws
+ lastValue = value;
+ hasHadValue = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * This function is called when one of this binding's watchers
+ * detects a property change.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function watcherFired(commitEvent:Boolean, cloneIndex:int):void
+ {
+ if (isHandlingEvent)
+ return;
+
+ try
+ {
+ isHandlingEvent = true;
+ execute(cloneIndex);
+ }
+ finally
+ {
+ isHandlingEvent = false;
+ }
+ }
+}
+
+}