more changes to remove compile errors
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fc11d5a3 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fc11d5a3 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fc11d5a3 Branch: refs/heads/spark Commit: fc11d5a3f716072dd391167459e63bc6fccce0a8 Parents: 958b112 Author: Alex Harui <[email protected]> Authored: Sat Mar 5 23:40:17 2016 -0800 Committer: Alex Harui <[email protected]> Committed: Sat Mar 5 23:40:17 2016 -0800 ---------------------------------------------------------------------- frameworks/projects/MX/build.xml | 174 +++++++++ .../flex/flex/display/DisplayObjectContainer.as | 3 +- .../MX/src/main/flex/flex/display/Graphics.as | 33 ++ .../main/flex/flex/display/InteractiveObject.as | 2 +- .../MX/src/main/flex/flex/display/ModuleInfo.as | 22 ++ .../MX/src/main/flex/flex/display/MovieClip.as | 10 +- .../MX/src/main/flex/flex/display/Sprite.as | 118 +++++- .../main/flex/flex/display/TopOfDisplayList.as | 16 +- .../MX/src/main/flex/flex/events/Event.as | 1 + .../src/main/flex/flex/events/ProgressEvent.as | 7 +- .../main/flex/flex/system/DefinitionManager.as | 31 +- .../MX/src/main/flex/flex/ui/Keyboard.as | 5 + .../MX/src/main/flex/mx/collections/IList.as | 2 +- .../main/flex/mx/core/IAssetLayoutFeatures.as | 13 +- .../MX/src/main/flex/mx/core/IChildList.as | 1 + .../MX/src/main/flex/mx/core/IContainer.as | 4 + .../mx/core/IDisplayObjectContainerInterface.as | 9 + .../flex/mx/core/IDisplayObjectInterface.as | 26 ++ .../src/main/flex/mx/core/IFlexDisplayObject.as | 9 +- .../MX/src/main/flex/mx/core/ILayoutElement.as | 11 +- .../src/main/flex/mx/core/ITextFieldFactory.as | 2 +- .../MX/src/main/flex/mx/core/IUITextField.as | 21 +- .../mx/core/LayoutElementUIComponentUtils.as | 29 +- .../src/main/flex/mx/effects/EffectManager.as | 18 +- .../src/main/flex/mx/effects/IAbstractEffect.as | 10 +- .../mx/events/ChildExistenceChangedEvent.as | 2 +- .../src/main/flex/mx/managers/IFocusManager.as | 9 +- .../flex/mx/managers/IFocusManagerContainer.as | 9 +- .../flex/mx/managers/ILayoutManagerClient.as | 2 +- .../src/main/flex/mx/managers/ISystemManager.as | 2 + .../main/flex/mx/managers/IToolTipManager.as | 9 +- .../src/main/flex/mx/managers/SystemManager.as | 377 ++++++++++++++----- .../flex/mx/preloaders/IPreloaderDisplay.as | 11 +- .../MX/src/main/flex/mx/preloaders/Preloader.as | 70 +++- .../MX/src/main/flex/mx/states/RemoveChild.as | 13 +- .../src/main/flex/mx/states/SetEventHandler.as | 2 +- .../MX/src/main/flex/mx/utils/GraphicsUtil.as | 9 +- .../MX/src/main/flex/mx/utils/NameUtil.as | 22 +- .../MX/src/main/flex/mx/utils/ObjectUtil.as | 120 +++--- .../flex/mx/utils/OnDemandEventDispatcher.as | 18 +- 40 files changed, 1030 insertions(+), 222 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/build.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/build.xml b/frameworks/projects/MX/build.xml new file mode 100644 index 0000000..16e92f3 --- /dev/null +++ b/frameworks/projects/MX/build.xml @@ -0,0 +1,174 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="MX" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../../.."/> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <property name="FALCON_HOME" value="${env.FALCON_HOME}"/> + <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/> + <property name="JS.SWC" value="${FALCONJX_HOME}/../externs/js/out/bin/js.swc" /> + <property name="GCL.SWC" value="${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc" /> + <property name="target.name" value="MX-${release.version}.swc" /> + <property name="target.name.no.version" value="MX.swc" /> + + <target name="main" depends="clean,compile-asjs,compile-extern-swc,copy-js,compile,test" description="Full build of MX.swc"> + </target> + + <target name="test" unless="is.jenkins"> + <ant dir="src/test/flex"/> + </target> + + <target name="test-js" unless="is.jenkins"> + <!-- no tests yet + <ant dir="js/tests" /> + --> + </target> + + <target name="clean"> + <delete failonerror="false"> + <fileset dir="${FLEXJS_HOME}/frameworks/libs"> + <include name="${target.name.no.version}"/> + </fileset> + </delete> + <delete failonerror="false"> + <fileset dir="${basedir}/target"> + <include name="**/**"/> + </fileset> + </delete> + </target> + + <path id="lib.path"> + <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/> + </path> + + <target name="compile" description="Compiles .as files into .swc"> + <echo message="Compiling target/${target.name}"/> + <echo message="FLEX_HOME: ${FLEX_HOME}"/> + <echo message="FALCON_HOME: ${FALCON_HOME}"/> + <!-- make JS output folder now so include-file doesn't error --> + <mkdir dir="${basedir}/target/generated-sources/flexjs"/> + + <!-- Load the <compc> task. We can't do this at the <project> level --> + <!-- because targets that run before flexTasks.jar gets built would fail. --> + <taskdef resource="flexTasks.tasks" classpathref="lib.path"/> + <!-- + Link in the classes (and their dependencies) for the MXML tags + listed in this project's manifest.xml. + Also link the additional classes (and their dependencies) + listed in CoreClasses.as, + because these aren't referenced by the manifest classes. + Keep the standard metadata when compiling. + Include the appropriate CSS files and assets in the SWC. + Don't include any resources in the SWC. + Write a bundle list of referenced resource bundles + into the file bundles.properties in this directory. + --> + <compc fork="true" + output="${basedir}/target/${target.name}"> + <jvmarg line="${compc.jvm.args}"/> + <load-config filename="${basedir}/src/main/resources/compile-config.xml" /> + <arg value="+playerglobal.version=${playerglobal.version}" /> + <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-define=COMPILE::AS3,true" /> + <arg value="-define=COMPILE::JS,false" /> + <arg value="-define=COMPILE::LATER,false" /> + </compc> + <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" /> + </target> + + <target name="compile-asjs"> + <echo message="Cross-compiling ${target.name}"/> + <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/> + <java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" > + <jvmarg value="-Xmx384m" /> + <jvmarg value="-Dsun.io.useCanonCaches=false" /> + <jvmarg value="-Dflexcompiler=${FALCONJX_HOME}/../compiler" /> + <jvmarg value="-Dflexlib=${FLEXJS_HOME}/frameworks" /> + <arg value="+flexlib=${FLEX_HOME}/frameworks" /> + <arg value="-js-output-type=FLEXJS" /> + <arg value="-keep-asdoc" /><!-- allows compiler to see @flexjsignorecoercion annotations --> + <arg value="-output=${basedir}/target/generated-sources/flexjs" /> + <arg value="-load-config=${basedir}/src/main/resources/compile-asjs-config.xml" /> + <arg value="+playerglobal.version=${playerglobal.version}" /> + <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" /> + <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-external-library-path+=${JS.SWC}" /> + <!-- this is not on external-library path otherwise goog.requires are not generated --> + <arg value="-library-path+=${GCL.SWC}" /> + <arg value="-define=COMPILE::AS3,false" /> + <arg value="-define=COMPILE::JS,true" /> + <arg value="-define=COMPILE::LATER,false" /> + </java> + </target> + + <target name="compile-extern-swc" description="Compiles .as files into .swc used for cross-compiling other projects"> + <echo message="Compiling target/externs/${target.name}"/> + <echo message="FLEX_HOME: ${FLEX_HOME}"/> + <echo message="FALCON_HOME: ${FALCON_HOME}"/> + <!-- make JS output folder now so include-file doesn't error --> + <mkdir dir="${FLEXJS_HOME}/frameworks/externs"/> + <mkdir dir="${basedir}/target/externs"/> + + <!-- Load the <compc> task. We can't do this at the <project> level --> + <!-- because targets that run before flexTasks.jar gets built would fail. --> + <taskdef resource="flexTasks.tasks" classpathref="lib.path"/> + <!-- + Link in the classes (and their dependencies) for the MXML tags + listed in this project's manifest.xml. + Also link the additional classes (and their dependencies) + listed in CoreClasses.as, + because these aren't referenced by the manifest classes. + Keep the standard metadata when compiling. + Include the appropriate CSS files and assets in the SWC. + Don't include any resources in the SWC. + Write a bundle list of referenced resource bundles + into the file bundles.properties in this directory. + --> + <compc fork="true" + output="${basedir}/target/externs/${target.name}"> + <jvmarg line="${compc.jvm.args}"/> + <load-config filename="src/main/resources/compile-asjs-config.xml" /> + <arg value="+playerglobal.version=${playerglobal.version}" /> + <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-external-library-path+=${JS.SWC}" /> + <!-- this is not on external-library path otherwise goog.requires are not generated --> + <arg value="-library-path+=${GCL.SWC}" /> + <arg value="-define=COMPILE::AS3,false" /> + <arg value="-define=COMPILE::JS,true" /> + <arg value="-define=COMPILE::LATER,false" /> + </compc> + <copy file="${basedir}/target/externs/${target.name}" tofile="${FLEXJS_HOME}/frameworks/externs/${target.name.no.version}" /> + </target> + + <target name="copy-js"> + <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs"> + <fileset dir="${basedir}/target/generated-sources/flexjs"> + <include name="**/**"/> + </fileset> + </copy> + </target> + + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index 926064a..a6b7053 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/DisplayObjectContainer.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/DisplayObjectContainer.as @@ -20,8 +20,9 @@ package flex.display { import org.apache.flex.core.IUIBase; + import org.apache.flex.geom.Point; - public interface DisplayObjectContainer extends DisplayObject, IUIBase + public interface DisplayObjectContainer extends InteractiveObject, IUIBase { include "../../mx/core/IDisplayObjectContainerInterface.as" } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as b/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as index e439e1e..fe6f0ec 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as @@ -43,6 +43,39 @@ package flex.display host.drawRect(x, y, width, height); } + public function clear():void + { + host.removeAllElements(); + } + + private var lastX:Number = 0; + private var lastY:Number = 0; + + public function moveTo(x:Number, y:Number):void + { + lastX = x; + lastY = y; + } + + public function lineTo(x:Number, y:Number):void + { + var path:String = "M " + lastX.toString() + " " + lastY.toString(); + path += "L " + x.toString() + " " + y.toString(); + host.drawPath(path); + lastX = x; + lastY = y; + } + + public function curveTo(mx:Number, my:Number, x:Number, y:Number):void + { + var path:String = "M " + lastX.toString() + " " + lastY.toString(); + path += "Q " + mx.toString() + " " + my.toString() + " " + + + x.toString() + " " + y.toString(); + host.drawPath(path); + lastX = x; + lastY = y; + } + public function endFill():void { // really, we should queue up the drawing commands and execute them here. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index 4384c36..435e6d2 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/InteractiveObject.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/InteractiveObject.as @@ -19,7 +19,7 @@ package flex.display { - public interface InteractiveObject extends DisplayObjectContainer + public interface InteractiveObject extends DisplayObject { } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index 39d4c72..4992aa1 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as @@ -27,6 +27,7 @@ package flex.display public class ModuleInfo { + COMPILE::AS3 private var loaderInfo:LoaderInfo; COMPILE::AS3 @@ -35,19 +36,40 @@ package flex.display this.loaderInfo = loaderInfo; } + COMPILE::AS3 public function get height():Number { return loaderInfo.height; } + COMPILE::AS3 public function get width():Number { return loaderInfo.width; } + COMPILE::AS3 public function get url():String { return loaderInfo.url; } + + COMPILE::JS + public function get height():Number + { + return document.height; + } + + COMPILE::JS + public function get width():Number + { + return document.width; + } + + COMPILE::JS + public function get url():String + { + return document.url; + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/flex/display/MovieClip.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/flex/display/MovieClip.as b/frameworks/projects/MX/src/main/flex/flex/display/MovieClip.as index 53e5eb1..6f1fca9 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/MovieClip.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/MovieClip.as @@ -19,9 +19,15 @@ package flex.display { - import org.apache.flex.core.UIBase; - public class MovieClip extends Sprite { + public function get totalFrames():int + { + return 1; + } + public function get framesLoaded():int + { + return 1; + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index e0ce060..99dd7c4 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as @@ -18,20 +18,134 @@ //////////////////////////////////////////////////////////////////////////////// package flex.display -{ +{ import org.apache.flex.core.graphics.GraphicsContainer; - public class Sprite extends GraphicsContainer implements InteractiveObject + public class Sprite extends GraphicsContainer implements DisplayObjectContainer { + COMPILE::JS private var _name:String; + COMPILE::JS public function get name():String { return _name; } + COMPILE::JS public function set name(value:String):void { _name = value; } + COMPILE::JS + public function get numChildren():int + { + return numElements; + } + + COMPILE::JS + public function getChildAt(index:int):DisplayObject + { + return getElementAt(index) as DisplayObject; + } + + COMPILE::JS + public function getChildByName(name:String):DisplayObject + { + for (var i:int = 0; i < numChildren; i++) + { + if (getChildAt(i).name == name) + return getChildAt(i); + } + return null; + } + + COMPILE::JS + public function getChildIndex(child:DisplayObject):int + { + return getElementIndex(child); + } + + COMPILE::JS + public function setChildIndex(child:DisplayObject, index:int):void + { + removeElement(child); + addElementAt(child, index); + } + + COMPILE::JS + public function addChild(child:DisplayObject):DisplayObject + { + addElement(child); + return child; + } + + COMPILE::JS + public function addChildAt(child:DisplayObject, index:int):DisplayObject + { + addElement(child, index); + return child; + } + + COMPILE::JS + public function removeChild(child:DisplayObject):DisplayObject + { + removeElement(child); + return child; + } + + COMPILE::JS + public function removeChildAt(index:int):DisplayObject + { + var child:DisplayObject = getChildAt(index); + removeElement(child); + return child; + } + + /** + * @flexjsignorecoercion flex.display.TopOfDisplayList + */ + public function get topOfDisplayList():TopOfDisplayList + { + return topMostEventDispatcher as TopOfDisplayList; + } + + COMPILE::JS + /** + * @flexjsignorecoercion flex.display.DisplayObject + */ + public function get root():DisplayObject + { + return topMostEventDispatcher as DisplayObject; + } + + COMPILE::JS + /** + * @flexjsignorecoercion flex.display.DisplayObject + */ + public function contains(child:DisplayObject):Boolean + { + while (child) + { + if (child.parent == this) + return true; + child = child.parent as DisplayObject; + } + return topMostEventDispatcher as DisplayObject; + } + + COMPILE::JS + private var _graphics:Graphics; + + COMPILE::JS + /** + * @flexjsignorecoercion flex.display.DisplayObject + */ + public function get graphics():Graphics + { + if (!_graphics) + _graphics = new Graphics(this); + return _graphics + } + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index 459331e..94dbf47 100644 --- a/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as +++ b/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as @@ -31,10 +31,24 @@ COMPILE::JS COMPILE::AS3 public class TopOfDisplayList extends Stage { - public function TopOfDisplayList() + public function TopOfDisplayList(stage:Stage) { super(); + _stage = stage; + } + + override public function get width():Number + { + return _stage.stageWidth; + } + + override public function get height():Number + { + return _stage.stageHeight; } + + private var _stage:Stage; + } COMPILE::JS http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index 7260f83..db77ff6 100644 --- a/frameworks/projects/MX/src/main/flex/flex/events/Event.as +++ b/frameworks/projects/MX/src/main/flex/flex/events/Event.as @@ -18,5 +18,6 @@ package flex.events public static const ENTER_FRAME:String = "enterFrame"; public static const REMOVED:String = "removed"; public static const REMOVED_FROM_STAGE:String = "removedFromStage"; + public static const RESIZE:String = "resize"; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/flex/events/ProgressEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/flex/events/ProgressEvent.as b/frameworks/projects/MX/src/main/flex/flex/events/ProgressEvent.as index 30e2289..8a4c804 100644 --- a/frameworks/projects/MX/src/main/flex/flex/events/ProgressEvent.as +++ b/frameworks/projects/MX/src/main/flex/flex/events/ProgressEvent.as @@ -2,11 +2,16 @@ package flex.events { public class ProgressEvent extends Event { - public function ProgressEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) + public function ProgressEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, + bytesLoaded:int = 0, bytesTotal:int = 0) { super(type, bubbles, cancelable); + this.bytesLoaded = bytesLoaded; + this.bytesTotal = bytesTotal; } + public var bytesLoaded; + public var bytesTotal; public static const PROGRESS:String = "progress"; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index c130488..1730181 100644 --- a/frameworks/projects/MX/src/main/flex/flex/system/DefinitionManager.as +++ b/frameworks/projects/MX/src/main/flex/flex/system/DefinitionManager.as @@ -19,7 +19,10 @@ package flex.system { - import flash.system.ApplicationDomain; +COMPILE::AS3 +{ + import flash.system.ApplicationDomain; +} public class DefinitionManager { @@ -41,13 +44,37 @@ package flex.system { return appdom.hasDefinition(name); } + COMPILE::JS + { + var parts:Array = name.split("."); + var obj:* = window; + for each (var part:String in parts) + { + obj = obj[part]; + if (obj === undefined) + return false; + } + return true; + } } public function getDefinition(name:String):Object { COMPILE::AS3 { - return appdom.hasDefinition(name); + return appdom.getDefinition(name); + } + COMPILE::JS + { + var parts:Array = name.split("."); + var obj:* = window; + for each (var part:String in parts) + { + obj = obj[part]; + if (obj === undefined) + throw new Error("definition not found"); + } + return obj; } } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/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 index f301fc3..8909af4 100644 --- a/frameworks/projects/MX/src/main/flex/flex/ui/Keyboard.as +++ b/frameworks/projects/MX/src/main/flex/flex/ui/Keyboard.as @@ -29,6 +29,11 @@ package flex.ui public static const UP = 0x26; public static const RIGHT = 0x27; public static const DOWN = 0x28; + public static const PAGE_UP = 0x21; + public static const PAGE_DOWN = 0x22; + public static const HOME = 0x24; + public static const END = 0x23; + public static const ENTER = 0x0D; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/collections/IList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/collections/IList.as b/frameworks/projects/MX/src/main/flex/mx/collections/IList.as index 4c40ad4..366990d 100644 --- a/frameworks/projects/MX/src/main/flex/mx/collections/IList.as +++ b/frameworks/projects/MX/src/main/flex/mx/collections/IList.as @@ -20,7 +20,7 @@ package mx.collections { -import flash.events.IEventDispatcher; +import org.apache.flex.events.IEventDispatcher; import mx.events.CollectionEvent; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IAssetLayoutFeatures.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IAssetLayoutFeatures.as b/frameworks/projects/MX/src/main/flex/mx/core/IAssetLayoutFeatures.as index 9b59813..2da68fb 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IAssetLayoutFeatures.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IAssetLayoutFeatures.as @@ -18,8 +18,11 @@ //////////////////////////////////////////////////////////////////////////////// package mx.core { -import flash.geom.Matrix; -import flash.geom.Matrix3D; +COMPILE::LATER +{ + import flash.geom.Matrix; + import flash.geom.Matrix3D; +} /** * The IAssetLayoutFeatures interface defines the minimum properties and methods @@ -252,11 +255,13 @@ public interface IAssetLayoutFeatures * @playerversion AIR 1.5 * @productversion Flex 4.1 */ + COMPILE::LATER function set layoutMatrix(value:Matrix):void; /** * @private */ + COMPILE::LATER function get layoutMatrix():Matrix; /** @@ -267,11 +272,13 @@ public interface IAssetLayoutFeatures * @playerversion AIR 1.5 * @productversion Flex 4.1 */ + COMPILE::LATER function set layoutMatrix3D(value:Matrix3D):void; /** * @private */ + COMPILE::LATER function get layoutMatrix3D():Matrix3D; /** @@ -359,6 +366,7 @@ public interface IAssetLayoutFeatures * @playerversion AIR 1.5 * @productversion Flex 4.1 */ + COMPILE::LATER function get computedMatrix():Matrix; /** @@ -369,6 +377,7 @@ public interface IAssetLayoutFeatures * @playerversion AIR 1.5 * @productversion Flex 4.1 */ + COMPILE::LATER function get computedMatrix3D():Matrix3D; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IChildList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IChildList.as b/frameworks/projects/MX/src/main/flex/mx/core/IChildList.as index feb5112..680fb31 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IChildList.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IChildList.as @@ -290,6 +290,7 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function getObjectsUnderPoint(point:Point):Array; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IContainer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IContainer.as b/frameworks/projects/MX/src/main/flex/mx/core/IContainer.as index 7dfa535..604b826 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IContainer.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IContainer.as @@ -39,14 +39,18 @@ public interface IContainer extends IUIComponent COMPILE::AS3 { import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; import flash.display.Sprite; + import flash.geom.Point; import flash.geom.Rectangle; import flash.display.Graphics; } COMPILE::JS { import flex.display.DisplayObject; + import flex.display.DisplayObjectContainer; import flex.display.Sprite; + import org.apache.flex.geom.Point; import org.apache.flex.geom.Rectangle; import flex.display.Graphics; } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectContainerInterface.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectContainerInterface.as b/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectContainerInterface.as index 5fb6229..e9d9652 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectContainerInterface.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectContainerInterface.as @@ -123,6 +123,7 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get textSnapshot():TextSnapshot; /** @@ -133,6 +134,7 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function getObjectsUnderPoint(point:Point):Array; /** @@ -143,6 +145,7 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function areInaccessibleObjectsUnderPoint(point:Point):Boolean; /** @@ -158,7 +161,9 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get tabChildren():Boolean; + COMPILE::LATER function set tabChildren(enable:Boolean):void; /** @@ -169,7 +174,9 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get mouseChildren():Boolean; + COMPILE::LATER function set mouseChildren(enable:Boolean):void; /** @@ -190,6 +197,7 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function swapChildrenAt(index1:int, index2:int):void; /** @@ -200,4 +208,5 @@ import flash.geom.Point; * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function swapChildren(child1:DisplayObject, child2:DisplayObject):void; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectInterface.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectInterface.as b/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectInterface.as index e0739e6..3d0dbc2 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectInterface.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectInterface.as @@ -78,7 +78,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get mask():DisplayObject; + COMPILE::LATER function set mask(value:DisplayObject):void; @@ -126,7 +128,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get scaleX():Number; + COMPILE::LATER function set scaleX(value:Number):void; @@ -138,7 +142,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get scaleY():Number; + COMPILE::LATER function set scaleY(value:Number):void; @@ -150,6 +156,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get mouseX():Number; // note: no setter @@ -161,6 +168,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get mouseY():Number; // note: no setter @@ -172,7 +180,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get rotation():Number; + COMPILE::LATER function set rotation(value:Number):void; @@ -219,7 +229,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get cacheAsBitmap():Boolean; + COMPILE::LATER function set cacheAsBitmap(value:Boolean):void; /** @@ -230,7 +242,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get opaqueBackground():Object; + COMPILE::LATER function set opaqueBackground(value:Object):void; @@ -242,7 +256,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get scrollRect():Rectangle; + COMPILE::LATER function set scrollRect(value:Rectangle):void; @@ -254,7 +270,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get filters():Array; + COMPILE::LATER function set filters(value:Array):void; /** @@ -265,7 +283,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get blendMode():String; + COMPILE::LATER function set blendMode(value:String):void; /** @@ -289,7 +309,9 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function get scale9Grid():Rectangle; + COMPILE::LATER function set scale9Grid(innerRectangle:Rectangle):void; /** @@ -322,6 +344,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function getBounds(targetCoordinateSpace:DisplayObject):Rectangle; /** @@ -332,6 +355,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function getRect(targetCoordinateSpace:DisplayObject):Rectangle; /** @@ -353,6 +377,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function hitTestObject(obj:DisplayObject):Boolean; /** @@ -363,6 +388,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function hitTestPoint(x:Number, y:Number, shapeFlag:Boolean=false):Boolean; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IFlexDisplayObject.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IFlexDisplayObject.as b/frameworks/projects/MX/src/main/flex/mx/core/IFlexDisplayObject.as index c09b9ef..f622766 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IFlexDisplayObject.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IFlexDisplayObject.as @@ -24,7 +24,7 @@ package mx.core COMPILE::AS3 { - import flash.display.DisplayObject; + import flash.display.DisplayObject; import flash.display.DisplayObjectContainer; import flash.geom.Rectangle; } @@ -34,6 +34,8 @@ COMPILE::JS import org.apache.flex.geom.Rectangle; } import org.apache.flex.events.IEventDispatcher; +import flex.display.TopOfDisplayList; +import flex.display.DisplayObject; /** * The IFlexDisplayObject interface defines the interface for skin elements. @@ -44,10 +46,9 @@ import org.apache.flex.events.IEventDispatcher; * @playerversion AIR 1.1 * @productversion Flex 3 */ -public interface IFlexDisplayObject extends /*IBitmapDrawable, */IEventDispatcher +public interface IFlexDisplayObject extends /*IBitmapDrawable, */IEventDispatcher, flex.display.DisplayObject { - include "IDisplayObjectInterface.as" - + //-------------------------------------------------------------------------- // // Properties http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/ILayoutElement.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ILayoutElement.as b/frameworks/projects/MX/src/main/flex/mx/core/ILayoutElement.as index 04056bf..005849f 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/ILayoutElement.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/ILayoutElement.as @@ -20,10 +20,13 @@ package mx.core { -import flash.events.IEventDispatcher; -import flash.geom.Matrix; -import flash.geom.Matrix3D; -import flash.geom.Vector3D; +import org.apache.flex.events.IEventDispatcher; +COMPILE::LATER +{ + import flash.geom.Matrix; + import flash.geom.Matrix3D; + import flash.geom.Vector3D; +} /** * The ILayoutElement interface is used primarily by the layout classes to query, http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/ITextFieldFactory.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ITextFieldFactory.as b/frameworks/projects/MX/src/main/flex/mx/core/ITextFieldFactory.as index 95c52eb..c14101b 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/ITextFieldFactory.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/ITextFieldFactory.as @@ -26,7 +26,7 @@ COMPILE::AS3 } COMPILE::JS { - import flash.text.TextField; + import flex.text.TextField; } [ExcludeClass] http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/IUITextField.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IUITextField.as b/frameworks/projects/MX/src/main/flex/mx/core/IUITextField.as index 4c9c1db..a009f81 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/IUITextField.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/IUITextField.as @@ -20,11 +20,22 @@ package mx.core { -import flash.display.DisplayObject; -import flash.geom.Rectangle; -import flash.text.StyleSheet; -import flash.text.TextFormat; -import flash.text.TextLineMetrics; +COMPILE::AS3 +{ + import flash.display.DisplayObject; + import flash.geom.Rectangle; + import flash.text.StyleSheet; + import flash.text.TextFormat; + import flash.text.TextLineMetrics; +} +COMPILE::JS +{ + import flex.display.DisplayObject; + import flex.geom.Rectangle; + import flex.text.StyleSheet; + import flex.text.TextFormat; + import flex.text.TextLineMetrics; +} import mx.managers.IToolTipManagerClient; import mx.styles.ISimpleStyleClient; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/core/LayoutElementUIComponentUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/core/LayoutElementUIComponentUtils.as b/frameworks/projects/MX/src/main/flex/mx/core/LayoutElementUIComponentUtils.as index bf97a0d..277332b 100644 --- a/frameworks/projects/MX/src/main/flex/mx/core/LayoutElementUIComponentUtils.as +++ b/frameworks/projects/MX/src/main/flex/mx/core/LayoutElementUIComponentUtils.as @@ -69,12 +69,15 @@ public class LayoutElementUIComponentUtils // explicit trumps measured. measuredWidth should already be // constraint between min & max during measure phase. var result:Number = obj.getExplicitOrMeasuredWidth(); + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height result = (obj.scaleX == 0) ? 0 : result / obj.scaleX; } + } return result; } @@ -93,12 +96,15 @@ public class LayoutElementUIComponentUtils // explicit trumps measured. measuredWidth should already be // constraint between min & max during measure phase. var result:Number = obj.getExplicitOrMeasuredHeight(); + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height result = (obj.scaleY == 0) ? 0 : result / obj.scaleY; } + } return result; } @@ -118,12 +124,15 @@ public class LayoutElementUIComponentUtils minWidth = Math.min(minWidth, obj.explicitMaxWidth); } + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height minWidth = (obj.scaleX == 0) ? 0 : minWidth / obj.scaleX; } + } return minWidth; } @@ -143,12 +152,15 @@ public class LayoutElementUIComponentUtils minHeight = Math.min(minHeight, obj.explicitMaxHeight); } + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height minHeight = (obj.scaleY == 0) ? 0 : minHeight / obj.scaleY; } + } return minHeight; } @@ -161,12 +173,15 @@ public class LayoutElementUIComponentUtils else maxWidth = DEFAULT_MAX_WIDTH; + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height maxWidth = (obj.scaleX == 0) ? 0 : maxWidth / obj.scaleX; } + } return maxWidth; } @@ -179,12 +194,15 @@ public class LayoutElementUIComponentUtils else maxHeight = DEFAULT_MAX_HEIGHT; + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height maxHeight = (obj.scaleY == 0) ? 0 : maxHeight / obj.scaleY; } + } return maxHeight; } @@ -377,13 +395,15 @@ public class LayoutElementUIComponentUtils public static function getLayoutBoundsWidth(obj:IUIComponent/*,transformMatrix:Matrix*/):Number { var width:Number = obj.width; + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height width = (obj.scaleX == 0) ? 0 : width / obj.scaleX; } - + } /* if (transformMatrix) { @@ -408,13 +428,15 @@ public class LayoutElementUIComponentUtils public static function getLayoutBoundsHeight(obj:IUIComponent/*,transformMatrix:Matrix*/):Number { var height:Number = obj.height; + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, // so adjust here since IUIComponent mixes it with width/height height = (obj.scaleY == 0) ? 0 : height / obj.scaleY; } - + } /* if (transformMatrix) { @@ -536,6 +558,8 @@ public class LayoutElementUIComponentUtils if (isNaN(height)) height = getPreferredUBoundsHeight(obj); + COMPILE::LATER + { if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0) { // We are already taking scale into account from the transform, @@ -543,6 +567,7 @@ public class LayoutElementUIComponentUtils width *= obj.scaleX; height *= obj.scaleY; } + } obj.setActualSize(width, height); return; //} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as b/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as index 519532c..e675265 100644 --- a/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as +++ b/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as @@ -25,6 +25,11 @@ COMPILE::AS3 import flash.display.DisplayObject; import flash.display.DisplayObjectContainer; } +COMPILE::JS +{ + import flex.display.DisplayObject; + import flex.display.DisplayObjectContainer; +} import org.apache.flex.core.UIBase; import org.apache.flex.events.Event; import org.apache.flex.events.EventDispatcher; @@ -311,11 +316,14 @@ public class EffectManager extends EventDispatcher var effectClass:Class; if (target is UIComponent && target.moduleFactory) { - // only UIComponents have moduleFactories - var appDomain:DefinitionManager = new DefinitionManager( - target.moduleFactory.info()["currentDomain"]); - if (appDomain.hasDefinition("mx.effects." + value)) - effectClass = Class(appDomain.getDefinition("mx.effects." + value)); + COMPILE::LATER + { + // only UIComponents have moduleFactories + var appDomain:DefinitionManager = new DefinitionManager( + target.moduleFactory.info()["currentDomain"]); + if (appDomain.hasDefinition("mx.effects." + value)) + effectClass = Class(appDomain.getDefinition("mx.effects." + value)); + } } if (!effectClass) effectClass = Class(target.systemManager.getDefinitionByName( http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/effects/IAbstractEffect.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/IAbstractEffect.as b/frameworks/projects/MX/src/main/flex/mx/effects/IAbstractEffect.as index b3cd714..4bae636 100644 --- a/frameworks/projects/MX/src/main/flex/mx/effects/IAbstractEffect.as +++ b/frameworks/projects/MX/src/main/flex/mx/effects/IAbstractEffect.as @@ -20,8 +20,14 @@ package mx.effects { -import flash.events.Event; -import flash.events.IEventDispatcher; +COMPILE::AS3 +{ + import flash.events.IEventDispatcher; +} +COMPILE::JS +{ + import org.apache.flex.events.IEventDispatcher; +} /** * The IAbstractEffect interface is used to denote http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/events/ChildExistenceChangedEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/events/ChildExistenceChangedEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/ChildExistenceChangedEvent.as index 27f7ab3..488cab4 100644 --- a/frameworks/projects/MX/src/main/flex/mx/events/ChildExistenceChangedEvent.as +++ b/frameworks/projects/MX/src/main/flex/mx/events/ChildExistenceChangedEvent.as @@ -28,7 +28,7 @@ COMPILE::JS { import flex.display.DisplayObject; } -import flex.events.Event; +import org.apache.flex.events.Event; /** * Represents events that are dispatched when a the child of a control http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as index 33dab83..a50a7b0 100644 --- a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as +++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as @@ -23,7 +23,14 @@ package mx.managers import org.apache.flex.core.IUIBase; import org.apache.flex.events.IEventDispatcher; //import flash.display.InteractiveObject; -import flash.display.Sprite; +COMPILE::AS3 +{ + import flash.display.Sprite; +} +COMPILE::JS +{ + import flex.display.Sprite; +} import mx.core.IButton; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as index 9d96121..8091645 100644 --- a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as +++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as @@ -20,7 +20,14 @@ package mx.managers { -import flex.display.DisplayObject; +COMPILE::AS3 +{ + import flash.display.DisplayObject; +} +COMPILE::JS +{ + import flex.display.DisplayObject; +} import org.apache.flex.events.IEventDispatcher; import mx.core.IFlexDisplayObject; import mx.managers.IFocusManager; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as index bf291b5..1eb5d42 100644 --- a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as +++ b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as @@ -20,7 +20,7 @@ package mx.managers { -import flash.events.IEventDispatcher; +import org.apache.flex.events.IEventDispatcher; import mx.core.mx_internal; use namespace mx_internal; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManager.as index f2352e3..43b5322 100644 --- a/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManager.as +++ b/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManager.as @@ -450,6 +450,7 @@ public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModul * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function getSandboxRoot():DisplayObject; /** @@ -469,6 +470,7 @@ public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModul * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER function getVisibleApplicationRect(bounds:Rectangle = null, skipToSandboxRoot:Boolean = false):Rectangle; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager.as index ad810f7..8f433d4 100644 --- a/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager.as +++ b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager.as @@ -20,7 +20,14 @@ package mx.managers { -import flash.display.DisplayObject; +COMPILE::AS3 +{ + import flash.display.DisplayObject; +} +COMPILE::JS +{ + import flex.display.DisplayObject; +} import mx.core.IToolTip; import mx.core.IUIComponent; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as index 649a9b5..c8a250d 100644 --- a/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as +++ b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as @@ -28,7 +28,23 @@ COMPILE::AS3 import flash.display.MovieClip; import flash.display.Sprite; import flash.display.LoaderInfo; - + import flash.display.Loader; + import flash.display.Stage; + import flash.display.StageAlign; + import flash.display.StageQuality; + import flash.display.StageScaleMode; + import flash.events.Event; + import flash.events.EventPhase; + import flash.events.FocusEvent; + import flash.events.KeyboardEvent; + import flash.events.MouseEvent; + import flash.events.TimerEvent; + import flash.ui.Keyboard; + import flash.geom.Point; + import flash.system.ApplicationDomain; + import flash.text.Font; + import flash.text.TextFormat; + import flash.utils.Dictionary; } COMPILE::JS { @@ -36,26 +52,15 @@ COMPILE::JS import flex.display.DisplayObjectContainer; import flex.display.Graphics; import flex.display.MovieClip; - import flex.display.Sprite; + import flex.display.Sprite; + import flex.events.Event; + import flex.events.EventPhase; + import flex.ui.Keyboard; + + import org.apache.flex.geom.Point; } -import flash.display.Loader; -import flash.display.Stage; -import flash.display.StageAlign; -import flash.display.StageQuality; -import flash.display.StageScaleMode; -import flash.events.Event; -import flash.events.EventPhase; -import flash.events.FocusEvent; -import flash.events.KeyboardEvent; -import flash.events.MouseEvent; -import flash.events.TimerEvent; -import flash.geom.Point; -import flash.system.ApplicationDomain; -import flash.text.Font; -import flash.text.TextFormat; -import flash.ui.Keyboard; -import flash.utils.Dictionary; import org.apache.flex.utils.Timer; +import flex.system.DefinitionManager; import org.apache.flex.reflection.getQualifiedClassName; import mx.core.IChildList; @@ -264,6 +269,8 @@ public class SystemManager extends MovieClip } } + COMPILE::AS3 + { // If we don't have a stage then we are not top-level, // unless there are no other top-level managers, in which // case we got loaded by a non-Flex shell or are sandboxed. @@ -272,7 +279,8 @@ public class SystemManager extends MovieClip if (!stage) isStageRoot = false; - + } + if (topLevel) SystemManagerGlobals.topLevelSystemManagers.push(this); @@ -355,6 +363,7 @@ public class SystemManager extends MovieClip /** * @private */ + COMPILE::AS3 private function deferredNextFrame():void { if (currentFrame + 1 > totalFrames) @@ -445,6 +454,7 @@ public class SystemManager extends MovieClip * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::AS3 private var _stage:Stage; /** @@ -593,6 +603,7 @@ public class SystemManager extends MovieClip * @private * get the main stage if we're loaded into another swf in the same sandbox */ + COMPILE::AS3 override public function get stage():Stage { if (_stage) @@ -830,9 +841,18 @@ public class SystemManager extends MovieClip if (!_cursorChildren) { + COMPILE::AS3 + { _cursorChildren = new SystemChildrenList(this, new QName(mx_internal, "toolTipIndex"), new QName(mx_internal, "cursorIndex")); + } + COMPILE::JS + { + _cursorChildren = new SystemChildrenList(this, + "toolTipIndex", + "cursorIndex"); + } } return _cursorChildren; @@ -1004,6 +1024,7 @@ public class SystemManager extends MovieClip * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::AS3 public function get explicitHeight():Number { return _explicitHeight; @@ -1012,6 +1033,7 @@ public class SystemManager extends MovieClip /** * @private */ + COMPILE::AS3 public function set explicitHeight(value:Number):void { _explicitHeight = value; @@ -1037,6 +1059,7 @@ public class SystemManager extends MovieClip * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::AS3 public function get explicitWidth():Number { return _explicitWidth; @@ -1045,6 +1068,7 @@ public class SystemManager extends MovieClip /** * @private */ + COMPILE::AS3 public function set explicitWidth(value:Number):void { _explicitWidth = value; @@ -1083,7 +1107,10 @@ public class SystemManager extends MovieClip value.x = 0; value.y = 0; + COMPILE::AS3 + { value.scrollRect = null; + } _focusPane = value; } @@ -1124,9 +1151,18 @@ public class SystemManager extends MovieClip */ public function get measuredHeight():Number { + COMPILE::AS3 + { return topLevelWindow ? topLevelWindow.getExplicitOrMeasuredHeight() : loaderInfo.height; + } + COMPILE::JS + { + return topLevelWindow ? + topLevelWindow.getExplicitOrMeasuredHeight() : + height; + } } //---------------------------------- @@ -1146,9 +1182,18 @@ public class SystemManager extends MovieClip */ public function get measuredWidth():Number { - return topLevelWindow ? - topLevelWindow.getExplicitOrMeasuredWidth() : - loaderInfo.width; + COMPILE::AS3 + { + return topLevelWindow ? + topLevelWindow.getExplicitOrMeasuredWidth() : + loaderInfo.width; + } + COMPILE::JS + { + return topLevelWindow ? + topLevelWindow.getExplicitOrMeasuredWidth() : + width; + } } //---------------------------------- @@ -1364,9 +1409,18 @@ public class SystemManager extends MovieClip if (!_popUpChildren) { + COMPILE::AS3 + { _popUpChildren = new SystemChildrenList(this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex")); + } + COMPILE::JS + { + _popUpChildren = new SystemChildrenList(this, + "noTopMostIndex", + "topMostIndex"); + } } return _popUpChildren; @@ -1421,6 +1475,8 @@ public class SystemManager extends MovieClip */ public function get screen():Rectangle { + COMPILE::AS3 + { if (!_screen) Stage_resizeHandler(); @@ -1428,6 +1484,7 @@ public class SystemManager extends MovieClip { Stage_resizeHandler(); } + } return _screen; } @@ -1456,9 +1513,18 @@ public class SystemManager extends MovieClip if (!_toolTipChildren) { + COMPILE::AS3 + { _toolTipChildren = new SystemChildrenList(this, new QName(mx_internal, "topMostIndex"), new QName(mx_internal, "toolTipIndex")); + } + COMPILE::JS + { + _toolTipChildren = new SystemChildrenList(this, + "topMostIndex", + "toolTipIndex"); + } } return _toolTipChildren; @@ -1615,6 +1681,7 @@ public class SystemManager extends MovieClip * @private * Only create idle events if someone is listening. */ + COMPILE::AS3 override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, @@ -1701,6 +1768,8 @@ public class SystemManager extends MovieClip return; } + COMPILE::LATER + { // When the first listener registers for 'idle' events, // create a Timer that will fire every IDLE_INTERVAL. if (type == FlexEvent.IDLE && !idleTimer) @@ -1715,6 +1784,8 @@ public class SystemManager extends MovieClip addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true); } + } + super.addEventListener(type, listener, useCapture, priority, useWeakReference); } @@ -1731,6 +1802,7 @@ public class SystemManager extends MovieClip /** * @private */ + COMPILE::AS3 override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void { @@ -2090,6 +2162,8 @@ public class SystemManager extends MovieClip if (runtimeDPIProviderClass) Singleton.registerClass("mx.core::RuntimeDPIProvider", runtimeDPIProviderClass); + COMPILE::AS3 + { if (isStageRoot) { // TODO: Finalize scaling behavior @@ -2101,15 +2175,19 @@ public class SystemManager extends MovieClip { _width = loaderInfo.width; _height = loaderInfo.height; - } + } + } // Create an instance of the preloader and add it to the stage preloader = new Preloader(); - // Listen for preloader events - // preloader notifes when it is ok to go to frame2 - preloader.addEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY, - preloader_preloaderDocFrameReadyHandler); + COMPILE::AS3 + { + // Listen for preloader events + // preloader notifes when it is ok to go to frame2 + preloader.addEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY, + preloader_preloaderDocFrameReadyHandler); + } // wait for a complete event. This gives the preloader // a chance to load resource modules before // everything really gets kicked off @@ -2128,8 +2206,16 @@ public class SystemManager extends MovieClip // we redirect public API to parent systemmanager if (!_popUpChildren) { - _popUpChildren = new SystemChildrenList( - this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex")); + COMPILE::AS3 + { + _popUpChildren = new SystemChildrenList( + this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex")); + } + COMPILE::JS + { + _popUpChildren = new SystemChildrenList( + this, "noTopMostIndex", "topMostIndex"); + } } _popUpChildren.addChild(preloader); @@ -2202,6 +2288,8 @@ public class SystemManager extends MovieClip Loader(parent).contentLoaderInfo.applicationDomain : info()["currentDomain"] as ApplicationDomain; + COMPILE::AS3 + { // Initialize the preloader. preloader.initialize( usePreloader, @@ -2218,7 +2306,10 @@ public class SystemManager extends MovieClip resourceModuleURLs, domain); } + } + COMPILE::JS + { // Initialize the preloader. preloader.initialize( usePreloader, @@ -2227,10 +2318,11 @@ public class SystemManager extends MovieClip preloaderBackgroundAlpha, preloaderBackgroundImage, preloaderBackgroundSize, - stage.stageWidth, - stage.stageHeight, + width, + height, null, null); + } } //-------------------------------------------------------------------------- @@ -2486,18 +2578,26 @@ public class SystemManager extends MovieClip */ public function getDefinitionByName(name:String):Object { + COMPILE::AS3 + { var domain:ApplicationDomain = !topLevel && parent is Loader ? Loader(parent).contentLoaderInfo.applicationDomain : info()["currentDomain"] as ApplicationDomain; - + var dm:DefinitionManager = new DefinitionManager(domain); + } + COMPILE::JS + { + var dm:DefinitionManager = new DefinitionManager(); + } + //trace("SysMgr.getDefinitionByName domain",domain,"currentDomain",info()["currentDomain"]); var definition:Object; - if (domain.hasDefinition(name)) + if (dm.hasDefinition(name)) { - definition = domain.getDefinition(name); + definition = dm.getDefinition(name); //trace("SysMgr.getDefinitionByName got definition",definition,"name",name); } @@ -2656,8 +2756,13 @@ public class SystemManager extends MovieClip g.drawRect(0, 0, s.width, s.height); g.endFill(); } - catch (e:SecurityError) + catch (e:Error) { + COMPILE::AS3 + { + if (!(e is SecurityError)) + throw e; + } // trace("resizeMouseCatcher: ignoring security error " + e); } } @@ -2684,36 +2789,41 @@ public class SystemManager extends MovieClip // parent and get a positive response to the query or // or there is not a listener for the new application event // that SWFLoader always adds. - if (!isStageRoot) - { - if (root.loaderInfo.parentAllowsChild) - { - try - { - if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)) || - // use string literal to avoid link dependency on SWFBridgeEvent.BRIDGE_NEW_APPLICATION - !root.loaderInfo.sharedEvents.hasEventListener("bridgeNewApplication")) - isBootstrapRoot = true; - } - catch (e:Error) - { - } - } - } - COMPILE::LATER { + if (!isStageRoot) + { + if (root.loaderInfo.parentAllowsChild) + { + try + { + if (!parent.dispatchEvent(new Event("mx.managers.SystemManager.isBootstrapRoot", false, true)) || + // use string literal to avoid link dependency on SWFBridgeEvent.BRIDGE_NEW_APPLICATION + !root.loaderInfo.sharedEvents.hasEventListener("bridgeNewApplication")) + isBootstrapRoot = true; + } + catch (e:Error) + { + } + } + } + allSystemManagers[this] = this.loaderInfo.url; } + COMPILE::AS3 + { root.loaderInfo.removeEventListener(Event.INIT, initHandler); + } if (!SystemManagerGlobals.info) SystemManagerGlobals.info = info(); + COMPILE::AS3 + { if (!SystemManagerGlobals.parameters) SystemManagerGlobals.parameters = loaderInfo.parameters; - var docFrame:int = (totalFrames == 1)? 0 : 1; addEventListener(Event.ENTER_FRAME, docFrameListener); + } /* addFrameScript(docFrame, docFrameHandler); @@ -2731,6 +2841,7 @@ public class SystemManager extends MovieClip } } + COMPILE::AS3 private function docFrameListener(event:Event):void { if (currentFrame == 2) @@ -2743,6 +2854,7 @@ public class SystemManager extends MovieClip } } + COMPILE::AS3 private function extraFrameListener(event:Event):void { if (lastFrame == currentFrame) @@ -2762,6 +2874,7 @@ public class SystemManager extends MovieClip * advance the playhead to the next frame. * This will cause the framescript to run, which runs frameEndHandler(). */ + COMPILE::AS3 private function preloader_preloaderDocFrameReadyHandler(event:Event):void { // Advance the next frame @@ -2793,19 +2906,21 @@ public class SystemManager extends MovieClip preloader = null; // Add the mouseCatcher as child 0. - mouseCatcher = new UIBase(); + mouseCatcher = new Sprite(); mouseCatcher.name = "mouseCatcher"; // Must use addChildAt because a creationComplete handler can create a // dialog and insert it at 0. noTopMostIndex = noTopMostIndex + 1; super.addChildAt(mouseCatcher, 0); resizeMouseCatcher(); + COMPILE::LATER + { if (!topLevel) { mouseCatcher.visible = false; mask = mouseCatcher; } - + } // Add the application as child 1. noTopMostIndex = noTopMostIndex + 1; super.addChildAt(DisplayObject(app), 1); @@ -2851,12 +2966,13 @@ public class SystemManager extends MovieClip * When this function is called, we know that the application * class has been defined and read in by the Player. */ - mx_internal function docFrameHandler(event:Event = null):void - { - - if (readyForKickOff) - kickOff(); - } + COMPILE::AS3 + mx_internal function docFrameHandler(event:Event = null):void + { + + if (readyForKickOff) + kickOff(); + } /** * @private @@ -2867,8 +2983,11 @@ public class SystemManager extends MovieClip preloader.removeEventListener(Event.COMPLETE, preloader_completeHandler); readyForKickOff = true; + COMPILE::AS3 + { if (currentFrame >= 2) kickOff(); + } } /** @@ -2887,11 +3006,14 @@ public class SystemManager extends MovieClip perfUtil.markTime("SystemManager.kickOff().start"); } + COMPILE::LATER + { if (!isTopLevel()) SystemManagerGlobals.topLevelSystemManagers[0]. // dispatch a FocusEvent so we can pass ourselves along dispatchEvent(new FocusEvent(FlexEvent.NEW_CHILD_APPLICATION, false, false, this)); - + } + // Generated code will bring in EmbeddedFontRegistry Singleton.registerClass("mx.core::IEmbeddedFontRegistry", Class(getDefinitionByName("mx.core::EmbeddedFontRegistry"))); @@ -2990,7 +3112,10 @@ public class SystemManager extends MovieClip initializeTopLevelWindow(null); - deferredNextFrame(); + COMPILE::AS3 + { + deferredNextFrame(); + } } /** @@ -3006,6 +3131,7 @@ public class SystemManager extends MovieClip * handled by both Scroller and by Spark classes like TextArea or * or List that include a Scroller in their skin. */ + COMPILE::AS3 private function keyDownHandler(e:KeyboardEvent):void { if (!e.cancelable) @@ -3039,6 +3165,7 @@ public class SystemManager extends MovieClip * this for a few mouse events and not all of them (MOUSE_WHEEL and * MOUSE_DOWN). */ + COMPILE::AS3 private function mouseEventHandler(e:MouseEvent):void { if (!e.cancelable && e.eventPhase != EventPhase.BUBBLING_PHASE) @@ -3067,6 +3194,7 @@ public class SystemManager extends MovieClip } } + COMPILE::AS3 private function extraFrameHandler(event:Event = null):void { var frameList:Object = info()["frames"]; @@ -3088,6 +3216,7 @@ public class SystemManager extends MovieClip * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::AS3 private function nextFrameTimerHandler(event:TimerEvent):void { if (currentFrame + 1 <= framesLoaded) @@ -3107,6 +3236,8 @@ public class SystemManager extends MovieClip */ private function initializeTopLevelWindow(event:Event):void { + COMPILE::LATER + { // This listener is intended to run before any other KeyboardEvent listeners // so that it can redispatch a cancelable=true copy of the event. if (getSandboxRoot() == this) @@ -3115,12 +3246,16 @@ public class SystemManager extends MovieClip addEventListener(MouseEvent.MOUSE_WHEEL, mouseEventHandler, true, 1000); addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, true, 1000); } + } + COMPILE::AS3 + { if (isTopLevelRoot() && stage) { stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, false, 1000); stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseEventHandler, false, 1000); stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 1000); } + } COMPILE::LATER { @@ -3163,16 +3298,21 @@ public class SystemManager extends MovieClip } } + COMPILE::AS3 + { if (isTopLevelRoot() && stage) stage.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true); else if (topLevel && stage) { + COMPILE::LATER + { // listen to resizes on the sandbox root var sandboxRoot:DisplayObject = getSandboxRoot(); if (sandboxRoot != this) sandboxRoot.addEventListener(Event.RESIZE, Stage_resizeHandler, false, 0, true); + } } - + var w:Number; var h:Number; @@ -3204,7 +3344,12 @@ public class SystemManager extends MovieClip w = loaderInfo.width; h = loaderInfo.height; } - + } + COMPILE::JS + { + var w:Number = this.width; + var h:Number = this.height; + } childManager.initializeTopLevelWindow(w, h); } @@ -3257,6 +3402,7 @@ public class SystemManager extends MovieClip * @private * Keep track of the size and position of the stage. */ + COMPILE::AS3 private function Stage_resizeHandler(event:Event = null):void { if (isDispatchingResizeEvent) @@ -3394,8 +3540,13 @@ public class SystemManager extends MovieClip { index = childList.getChildIndex(DisplayObject(f)); } - catch (e:ArgumentError) + catch (e:Error) { + COMPILE::AS3 + { + if (!(e is ArgumentError)) + throw e; + } // index has been preset to -1 so just continue. } @@ -3429,6 +3580,7 @@ public class SystemManager extends MovieClip * After IDLE_THRESHOLD goes by without any user activity, * we dispatch an 'idle' event. */ + COMPILE::LATER private function idleTimer_timerHandler(event:TimerEvent):void { idleCounter++; @@ -3447,6 +3599,7 @@ public class SystemManager extends MovieClip /** * @private */ + COMPILE::AS3 override public function get mouseX():Number { if (_mouseX === undefined) @@ -3457,6 +3610,7 @@ public class SystemManager extends MovieClip /** * @private */ + COMPILE::AS3 override public function get mouseY():Number { if (_mouseY === undefined) @@ -3473,8 +3627,11 @@ public class SystemManager extends MovieClip // If the parent isn't rooted yet, // Or the root is the stage (which is the case in a second AIR window) // use the global system manager instance. - if ((!localRoot || localRoot is Stage) && parent is IUIComponent) - localRoot = DisplayObjectContainer(IUIComponent(parent).systemManager); + COMPILE::AS3 + { + if ((!localRoot || localRoot is Stage) && parent is IUIComponent) + localRoot = DisplayObjectContainer(IUIComponent(parent).systemManager); + } if (localRoot is ISystemManager) { sm = ISystemManager(localRoot); @@ -3502,8 +3659,13 @@ public class SystemManager extends MovieClip { return super.parent; } - catch (e:SecurityError) + catch (e:Error) { + COMPILE::AS3 + { + if (!(e is SecurityError)) + throw e; + } // trace("parent: ignoring security error"); } @@ -3523,30 +3685,38 @@ public class SystemManager extends MovieClip * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 + * + * @flexjsignorecoercion flex.display.DisplayObject */ public function getTopLevelRoot():DisplayObject { - // work our say up the parent chain to the root. This way we - // don't have to rely on this object being added to the stage. - try - { - var sm:ISystemManager = this; - if (sm.topLevelSystemManager) - sm = sm.topLevelSystemManager; - var parent:DisplayObject = DisplayObject(sm).parent; - var lastParent:DisplayObject = DisplayObject(sm); - while (parent) - { - if (parent is Stage) - return lastParent; - lastParent = parent; - parent = parent.parent; - } - } - catch (error:SecurityError) - { - } - + COMPILE::AS3 + { + // work our say up the parent chain to the root. This way we + // don't have to rely on this object being added to the stage. + try + { + var sm:ISystemManager = this; + if (sm.topLevelSystemManager) + sm = sm.topLevelSystemManager; + var parent:DisplayObject = DisplayObject(sm).parent; + var lastParent:DisplayObject = DisplayObject(sm); + while (parent) + { + if (parent is Stage) + return lastParent; + lastParent = parent; + parent = parent.parent; + } + } + catch (error:SecurityError) + { + } + } + COMPILE::JS + { + return topOfDisplayList as DisplayObject; + } return null; } @@ -3561,6 +3731,7 @@ public class SystemManager extends MovieClip * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER public function getSandboxRoot():DisplayObject { // work our say up the parent chain to the root. This way we @@ -3665,6 +3836,7 @@ public class SystemManager extends MovieClip * @playerversion AIR 1.1 * @productversion Flex 3 */ + COMPILE::LATER public function getVisibleApplicationRect(bounds:Rectangle = null, skipToSandboxRoot:Boolean = false):Rectangle { if (hasEventListener("getVisibleApplicationRect")) @@ -3740,6 +3912,7 @@ public class SystemManager extends MovieClip * @private * dispatch certain stage events from sandbox root */ + COMPILE::AS3 private function stageEventHandler(event:Event):void { if (event.target is Stage && mouseCatcher) @@ -3774,13 +3947,31 @@ public class SystemManager extends MovieClip public function get moduleInfo():ModuleInfo { - return new ModuleInfo(loaderInfo); + COMPILE::AS3 + { + return new ModuleInfo(loaderInfo); + } + COMPILE::JS + { + return new ModuleInfo(); + } } + COMPILE::AS3 + private var _topOfDisplayList:TopOfDisplayList; + + /** + * @flexjsignorecoercion flex.display.TopOfDisplayList + */ + COMPILE::AS3 public function get topOfDisplayList():TopOfDisplayList { - return new TopOfDisplayList(); + if (!_topOfDisplayList) + _topOfDisplayList = new TopOfDisplayList(stage); + return _topOfDisplayList; } + + } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/preloaders/IPreloaderDisplay.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/preloaders/IPreloaderDisplay.as b/frameworks/projects/MX/src/main/flex/mx/preloaders/IPreloaderDisplay.as index 5b57ce4..d1a1edd 100644 --- a/frameworks/projects/MX/src/main/flex/mx/preloaders/IPreloaderDisplay.as +++ b/frameworks/projects/MX/src/main/flex/mx/preloaders/IPreloaderDisplay.as @@ -20,8 +20,15 @@ package mx.preloaders { -import flash.display.Sprite; -import flash.events.IEventDispatcher; +COMPILE::AS3 +{ + import flash.display.Sprite; +} +COMPILE::JS +{ + import flex.display.Sprite; +} +import org.apache.flex.events.IEventDispatcher; /** * Defines the interface that http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as b/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as index 4ad40b8..45a2fe7 100644 --- a/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as +++ b/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as @@ -20,18 +20,35 @@ package mx.preloaders { -import flash.display.DisplayObject; -import flash.display.LoaderInfo; -import flash.display.MovieClip; -import flash.display.Sprite; -import flash.events.ErrorEvent; -import flash.events.Event; -import flash.events.IEventDispatcher; -import flash.events.IOErrorEvent; -import flash.events.ProgressEvent; -import flash.events.TimerEvent; -import flash.system.ApplicationDomain; -import flash.utils.Timer; +COMPILE::AS3 +{ + import flash.display.DisplayObject; + import flash.display.LoaderInfo; + import flash.display.MovieClip; + import flash.display.Sprite; + import flash.events.ErrorEvent; + import flash.events.Event; + import flash.events.IEventDispatcher; + import flash.events.IOErrorEvent; + import flash.events.ProgressEvent; + import flash.events.TimerEvent; + import flash.utils.Timer; +} +COMPILE::JS +{ + import flex.display.DisplayObject; + import flex.display.MovieClip; + import flex.display.Sprite; + import flex.events.Event; + import flex.events.IEventDispatcher; + import flex.events.IOErrorEvent; + import flex.events.ProgressEvent; + import flex.events.TimerEvent; + + import org.apache.flex.utils.Timer; +} + +import flex.system.DefinitionManager; import mx.core.RSLItem; import mx.core.RSLListLoader; @@ -145,7 +162,7 @@ public class Preloader extends Sprite /** * @private */ - private var applicationDomain:ApplicationDomain = null; + private var applicationDomain:DefinitionManager = null; /** * @private @@ -171,7 +188,7 @@ public class Preloader extends Sprite sizes:Array = null, rslList:Array = null, resourceModuleURLs:Array = null, - applicationDomain:ApplicationDomain = null):void + applicationDomain:DefinitionManager = null):void { } @@ -238,7 +255,10 @@ public class Preloader extends Sprite this.applicationDomain = applicationDomain; - root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); + COMPILE::AS3 + { + root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); + } var n:int; var i:int; @@ -387,10 +407,17 @@ public class Preloader extends Sprite */ private function getByteValues():Object { - var li:LoaderInfo = root.loaderInfo; - var loaded:int = li.bytesLoaded; - var total:int = li.bytesTotal; - + COMPILE::AS3 + { + var li:LoaderInfo = root.loaderInfo; + var loaded:int = li.bytesLoaded; + var total:int = li.bytesTotal; + } + COMPILE::JS + { + var loaded:int = 100; + var total:int = 100; + } COMPILE::LATER { // Look up the rsl bytes and include those @@ -632,9 +659,12 @@ public class Preloader extends Sprite if (displayClass) displayClass.removeEventListener(Event.COMPLETE, displayClassCompleteHandler); + COMPILE::AS3 + { if (root) root.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); - + } + if (app) { app.removeEventListener("validatePropertiesComplete", appProgressHandler); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/states/RemoveChild.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/states/RemoveChild.as b/frameworks/projects/MX/src/main/flex/mx/states/RemoveChild.as index 6d3f6d0..c98b88a 100644 --- a/frameworks/projects/MX/src/main/flex/mx/states/RemoveChild.as +++ b/frameworks/projects/MX/src/main/flex/mx/states/RemoveChild.as @@ -19,9 +19,16 @@ package mx.states { - -import flash.display.DisplayObject; -import flash.display.DisplayObjectContainer; +COMPILE::AS3 +{ + import flash.display.DisplayObject; + import flash.display.DisplayObjectContainer; +} +COMPILE::JS +{ + import flex.display.DisplayObject; + import flex.display.DisplayObjectContainer; +} import mx.core.UIComponent; import mx.core.mx_internal; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/states/SetEventHandler.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/states/SetEventHandler.as b/frameworks/projects/MX/src/main/flex/mx/states/SetEventHandler.as index 53f5fde..5bf26fa 100644 --- a/frameworks/projects/MX/src/main/flex/mx/states/SetEventHandler.as +++ b/frameworks/projects/MX/src/main/flex/mx/states/SetEventHandler.as @@ -242,7 +242,7 @@ public class SetEventHandler extends OverrideBase COMPILE::JS override public function addEventListener( type:String, listener:Function, - useCapture:Boolean = false):void + useCapture:Boolean = false, handlerScope:Object = null):void { if (type == "handler") handlerFunction = listener; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fc11d5a3/frameworks/projects/MX/src/main/flex/mx/utils/GraphicsUtil.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/GraphicsUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/GraphicsUtil.as index fd7e58d..c366553 100644 --- a/frameworks/projects/MX/src/main/flex/mx/utils/GraphicsUtil.as +++ b/frameworks/projects/MX/src/main/flex/mx/utils/GraphicsUtil.as @@ -20,7 +20,14 @@ package mx.utils { -import flash.display.Graphics; +COMPILE::AS3 +{ + import flash.display.Graphics; +} +COMPILE::JS +{ + import flex.display.Graphics; +} /** * The Graphics class is an all-static class with utility methods
