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:08 UTC
[01/37] git commit: [flex-asjs] [refs/heads/spark] - first attempt at
reflection
Repository: flex-asjs
Updated Branches:
refs/heads/spark [created] 1f6418c46
first attempt at reflection
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/194943f3
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/194943f3
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/194943f3
Branch: refs/heads/spark
Commit: 194943f314b537c00a3c657b7cdcb0d1bf709417
Parents: 9d92d94
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jan 25 16:21:10 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jan 25 16:21:10 2016 -0800
----------------------------------------------------------------------
frameworks/build.xml | 6 +
.../apache/flex/reflection/DefinitionBase.as | 51 ++++
.../flex/reflection/DefinitionWithMetaData.as | 70 +++++
.../flex/reflection/FunctionDefinition.as | 37 +++
.../flex/reflection/MetaDataArgDefinition.as | 45 ++++
.../flex/reflection/MetaDataDefinition.as | 74 ++++++
.../apache/flex/reflection/MethodDefinition.as | 50 ++++
.../apache/flex/reflection/TypeDefinition.as | 260 +++++++++++++++++++
.../flex/reflection/VariableDefinition.as | 38 +++
.../org/apache/flex/reflection/describeType.as | 47 ++++
.../flex/reflection/getDefinitionByName.as | 51 ++++
.../flex/reflection/getQualifiedClassName.as | 51 ++++
.../reflection/getQualifiedSuperclassName.as | 49 ++++
frameworks/projects/Reflection/build.xml | 165 ++++++++++++
.../projects/Reflection/compile-asjs-config.xml | 77 ++++++
.../projects/Reflection/compile-config.xml | 73 ++++++
manualtests/ReflectionTest/build.xml | 70 +++++
.../ReflectionTest/src/MyInitialView.mxml | 64 +++++
manualtests/ReflectionTest/src/README.txt | 45 ++++
.../ReflectionTest/src/ReflectionTest.mxml | 40 +++
.../src/controllers/MyController.as | 52 ++++
.../ReflectionTest/src/models/MyModel.as | 125 +++++++++
22 files changed, 1540 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index 733ccab..eebb204 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -92,6 +92,7 @@
<antcall target="JQuery"/>
<antcall target="Mobile"/>
<antcall target="Network"/>
+ <antcall target="Reflection"/>
</target>
<target name="fonts">
@@ -134,6 +135,7 @@
<ant dir="${basedir}/projects/JQuery" target="clean"/>
<ant dir="${basedir}/projects/Mobile" target="clean"/>
<ant dir="${basedir}/projects/Network" target="clean"/>
+ <ant dir="${basedir}/projects/Reflection" target="clean"/>
<ant dir="${basedir}/fontsrc" target="clean"/>
<!-- delete the FlashBuilder executable directories -->
@@ -218,6 +220,10 @@
<ant dir="${basedir}/projects/Network"/>
</target>
+ <target name="Reflection" description="Clean build of Reflection.swc">
+ <ant dir="${basedir}/projects/Reflection"/>
+ </target>
+
<target name="flex-config" depends="playerglobal-setswfversion" description="Copy the flex config template to flex-config.xml and inject version numbers">
<copy file="${basedir}/flex-config-template.xml" tofile="${basedir}/flex-config.xml" overwrite="true">
<filterset>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as
new file mode 100755
index 0000000..f8bdd82
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DefinitionBase
+ {
+ public function DefinitionBase(name:String, rawData:Object = null)
+ {
+ _name = name;
+ _rawData = rawData;
+ }
+
+ private var _name:String;
+ public function get name():String
+ {
+ return _name;
+ }
+
+ protected var _rawData:Object;
+
+ protected function get rawData():Object
+ {
+ return _rawData;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as
new file mode 100755
index 0000000..f6555eb
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DefinitionWithMetaData extends DefinitionBase
+ {
+ public function DefinitionWithMetaData(name:String, rawData:Object = null)
+ {
+ super(name, rawData);
+ }
+
+ public function getMetaData():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.metadata;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var qname:String = item.@name;
+ results.push(new MetaDataDefinition(qname, item));
+ }
+ }
+ COMPILE::JS
+ {
+ var rdata:* = rawData;
+ if (rdata !== undefined)
+ {
+ var metadatas:Array = rdata.metadata();
+ if (metadatas)
+ {
+ var n:int = metadatas.length;
+ for each (var mdDef:Object in metadatas)
+ results.push(new MetaDataDefinition(mdDef.name, mdDef));
+ }
+ }
+ }
+ return results;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as
new file mode 100755
index 0000000..5f1f829
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class FunctionDefinition extends DefinitionBase
+ {
+ public function FunctionDefinition(rawData:Object, packageName:String, name:String)
+ {
+ super(packageName, name);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as
new file mode 100755
index 0000000..1f1366f
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class MetaDataArgDefinition extends DefinitionBase
+ {
+ public function MetaDataArgDefinition(name:String, value:String)
+ {
+ super(name);
+ _value = value;
+ }
+
+ private var _value:String;
+
+ public function get value():String
+ {
+ return _value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as
new file mode 100755
index 0000000..20d50cd
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as
@@ -0,0 +1,74 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class MetaDataDefinition extends DefinitionBase
+ {
+ public function MetaDataDefinition(name:String, rawData:Object)
+ {
+ super(name, rawData);
+ }
+
+ public function get args():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.args;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var key:String = item.@key;
+ var value:String = item.@value;
+ results.push(new MetaDataArgDefinition(key, value));
+ }
+ }
+ COMPILE::JS
+ {
+ var data:Object = rawData;
+ var name:String = data.names[0].qName;
+ var def:Object = getDefinitionByName(name);
+ var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO();
+ if (rdata !== undefined)
+ {
+ var args:Array = rdata.args();
+ if (args)
+ {
+ var n:int = args.length;
+ for each (var argDef:Object in args)
+ results.push(new MetaDataArgDefinition(argDef.key, argDef.value));
+ }
+ }
+ }
+ return results;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as
new file mode 100755
index 0000000..a16c649
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class MethodDefinition extends DefinitionWithMetaData
+ {
+ public function MethodDefinition(name:String, declaredBy:String, rawData:Object = null)
+ {
+ super(name, rawData);
+ _declaredBy = declaredBy;
+ }
+
+ private var _declaredBy:String;
+ private var declaredByDef:TypeDefinition;
+
+ public function get declaredBy():TypeDefinition
+ {
+ if (declaredByDef == null)
+ declaredByDef = new TypeDefinition(_declaredBy);
+
+ return declaredByDef;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as
new file mode 100755
index 0000000..6035bab
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as
@@ -0,0 +1,260 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TypeDefinition extends DefinitionWithMetaData
+ {
+ public function TypeDefinition(name:String, rawData:Object = null)
+ {
+ var c:int = name.indexOf("::");
+ if (c > -1)
+ {
+ _packageName = name.substring(0, c);
+ name = name.substring(c+2);
+ }
+ else
+ _packageName = "";
+ super(name, rawData);
+ }
+
+ private var _packageName:String;
+
+ public function get packageName():String
+ {
+ return _packageName;
+ }
+
+ override protected function get rawData():Object
+ {
+ if (_rawData == null)
+ {
+ var def:Object = getDefinitionByName(packageName + "::" + name);
+ COMPILE::AS3
+ {
+ _rawData = describeType(def);
+ }
+ COMPILE::JS
+ {
+ _rawData = def.prototype.FLEXJS_CLASS_INFO;
+ }
+ }
+ return _rawData;
+ }
+ /**
+ * @flexjsignorecoercion XML
+ */
+ public function get baseClasses():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.extendsClass;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var qname:String = item.@type;
+ results.push(new TypeDefinition(qname));
+ }
+ }
+ COMPILE::JS
+ {
+ var data:Object = rawData;
+ var name:String = data.names[0].qName;
+ var def:Object = getDefinitionByName(name);
+ var prototype:Object = def.prototype;
+ while (prototype.FLEXJS_CLASS_INFO !== undefined)
+ {
+ name = prototype.FLEXJS_CLASS_INFO.names[0].qName;
+ results.push(new TypeDefinition(name));
+ def = getDefinitionByName(name);
+ prototype = def.prototype;
+ }
+ }
+ return results;
+ }
+
+ public function get interfaces():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.implementsInterface;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var qname:String = item.@type;
+ results.push(new TypeDefinition(qname));
+ }
+ }
+ COMPILE::JS
+ {
+ var data:* = rawData;
+ var name:String = data.names[0].qName;
+ var def:Object = getDefinitionByName(name);
+ var prototype:Object = def.prototype;
+ while (data !== undefined)
+ {
+ var interfaces:Array = data.interfaces;
+ if (interfaces)
+ {
+ var n:int = interfaces.length;
+ for each (var s:String in interfaces)
+ results.push(new TypeDefinition(s));
+ }
+ name = data.names[0].qName;
+ results.push(new TypeDefinition(name));
+ def = getDefinitionByName(name);
+ prototype = def.prototype;
+ data = prototype.FLEXJS_CLASS_INFO;
+ }
+ }
+ return results;
+ }
+
+ public function get variables():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.variable;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var qname:String = item.@name;
+ results.push(new VariableDefinition(qname, item));
+ }
+ }
+ COMPILE::JS
+ {
+ var data:Object = rawData;
+ var name:String = data.names[0].qName;
+ var def:Object = getDefinitionByName(name);
+ var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO();
+ if (rdata !== undefined)
+ {
+ var variables:Object = rdata.variables();
+ if (variables)
+ {
+ for (var v:String in variables)
+ {
+ var varDef:Object = variables[v];
+ results.push(new VariableDefinition(v, varDef));
+ }
+ }
+ }
+ }
+ return results;
+ }
+
+ public function get accessors():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.accessor;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var qname:String = item.@name;
+ results.push(new MethodDefinition(qname, item.@declaredBy, item));
+ }
+ }
+ COMPILE::JS
+ {
+ var data:Object = rawData;
+ var name:String = data.names[0].qName;
+ var def:Object = getDefinitionByName(name);
+ var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO();
+ if (rdata !== undefined)
+ {
+ var accessors:Object = rdata.accessors();
+ if (accessors)
+ {
+ for (var prop:String in accessors)
+ {
+ var propDef:Object = accessors[prop];
+ results.push(new MethodDefinition(prop, propDef.declaredBy, propDef));
+ }
+ }
+ }
+ }
+ return results;
+ }
+
+ public function get methods():Array
+ {
+ var results:Array = [];
+
+ COMPILE::AS3
+ {
+ var xml:XML = rawData as XML;
+ var data:XMLList = xml.method;
+ var n:int = data.length();
+ for (var i:int = 0; i < n; i++)
+ {
+ var item:XML = data[i] as XML;
+ var qname:String = item.@name;
+ results.push(new MethodDefinition(qname, item.@declaredBy, item));
+ }
+ }
+ COMPILE::JS
+ {
+ var data:Object = rawData;
+ var name:String = data.names[0].qName;
+ var def:Object = getDefinitionByName(name);
+ var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO();
+ if (rdata !== undefined)
+ {
+ var methods:Object = rdata.methods();
+ if (methods)
+ {
+ for (var fn:String in methods)
+ {
+ var fnDef:Object = methods[fn];
+ results.push(new MethodDefinition(fn, fnDef.declaredBy, fnDef));
+ }
+ }
+ }
+ }
+ return results;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as
new file mode 100755
index 0000000..3e87566
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+
+ /**
+ * The description of a Class or Interface
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VariableDefinition extends DefinitionWithMetaData
+ {
+ public function VariableDefinition(name:String, rawData:Object = null)
+ {
+ super(rawData, name);
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as
new file mode 100755
index 0000000..1114a1e
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+COMPILE::AS3
+{
+ import flash.utils.describeType;
+}
+
+ /**
+ * The equivalent of flash.utils.describeType.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function describeType(value:Object):TypeDefinition
+ {
+ COMPILE::AS3
+ {
+ var xml:XML = flash.utils.describeType(value);
+ return new TypeDefinition(xml.@name, xml);
+ }
+ COMPILE::JS
+ {
+ var qname:String = getQualifiedClassName(value);
+ return new TypeDefinition(qname, value.FLEXJS_CLASS_INFO);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as
new file mode 100755
index 0000000..b18ab3c
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+COMPILE::AS3
+{
+ import flash.utils.getDefinitionByName;
+}
+
+ /**
+ * The equivalent of flash.utils.getQualifiedClassName.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function getDefinitionByName(name:String):Object
+ {
+ COMPILE::AS3
+ {
+ return flash.utils.getDefinitionByName(name);
+ }
+ COMPILE::JS
+ {
+ var parts:Array = name.split('.');
+ var n:int = parts.length;
+ var o:Object = window;
+ for (var i:int = 0; i < n; i++) {
+ o = o[parts[i]];
+ }
+ return o;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as
new file mode 100755
index 0000000..42eaa47
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.reflection
+{
+COMPILE::AS3
+{
+ import flash.utils.getQualifiedClassName;
+}
+
+ /**
+ * The equivalent of flash.utils.getQualifiedClassName.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function getQualifiedClassName(value:*):String
+ {
+ COMPILE::AS3
+ {
+ return flash.utils.getQualifiedClassName(value);
+ }
+ COMPILE::JS
+ {
+ if (value.FLEXJS_CLASS_INFO == null)
+ {
+ if (value.prototype.FLEXJS_CLASS_INFO == null)
+ return null;
+ value = value.prototype;
+ }
+ return value.FLEXJS_CLASS_INFO.names[0].qName;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as
new file mode 100755
index 0000000..95c75fa
--- /dev/null
+++ b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.reflection
+{
+COMPILE::AS3
+{
+ import flash.utils.getQualifiedSuperclassName;
+}
+
+ /**
+ * The equivalent of flash.utils.getQualifiedSuperclassName.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function getQualifiedSuperclassName(value:*):String
+ {
+ COMPILE::AS3
+ {
+ return flash.utils.getQualifiedSuperclassName(value);
+ }
+ COMPILE::JS
+ {
+ var constructorAsObject:Object = value["constructor"];
+ value = constructorAsObject.superClass_;
+ if (value == null || value.FLEXJS_CLASS_INFO == null)
+ return null;
+ return value.FLEXJS_CLASS_INFO.names[0].qName;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/build.xml b/frameworks/projects/Reflection/build.xml
new file mode 100644
index 0000000..b88f21d
--- /dev/null
+++ b/frameworks/projects/Reflection/build.xml
@@ -0,0 +1,165 @@
+<?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="Reflection" 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}"/>
+
+ <target name="main" depends="clean,compile-asjs,compile-extern-swc,copy-js,compile,test" description="Full build of Reflection.swc">
+ </target>
+
+ <target name="test" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="as/tests" />
+ -->
+ </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="Reflection.swc"/>
+ </fileset>
+ </delete>
+ <delete failonerror="false">
+ <fileset dir="${basedir}/js/out">
+ <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 libs/Reflection.swc"/>
+ <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}/js/out" />
+
+ <!-- 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 ReflectionClasses.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="${FLEXJS_HOME}/frameworks/libs/Reflection.swc">
+ <jvmarg line="${compc.jvm.args}"/>
+ <load-config filename="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" />
+ </compc>
+ </target>
+
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling Reflection/asjs"/>
+ <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}/js/out" />
+ <arg value="-load-config=${basedir}/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+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc" />
+ <!-- this is not on external-library path otherwise goog.requires are not generated -->
+ <arg value="-library-path+=${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc" />
+ <arg value="-define=COMPILE::AS3,false" />
+ <arg value="-define=COMPILE::JS,true" />
+ </java>
+ </target>
+
+ <target name="compile-extern-swc" description="Compiles .as files into .swc used for cross-compiling other projects">
+ <echo message="Compiling externs/Reflection.swc"/>
+ <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"/>
+
+ <!-- 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="${FLEXJS_HOME}/frameworks/externs/Reflection.swc">
+ <jvmarg line="${compc.jvm.args}"/>
+ <load-config filename="compile-asjs-config.xml" />
+ <arg value="+playerglobal.version=${playerglobal.version}" />
+ <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+ <arg value="-external-library-path+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc" />
+ <!-- this is not on external-library path otherwise goog.requires are not generated -->
+ <arg value="-library-path+=${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc" />
+ <arg value="-define=COMPILE::AS3,false" />
+ <arg value="-define=COMPILE::JS,true" />
+ </compc>
+ </target>
+
+ <target name="copy-js" >
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <fileset dir="${basedir}/js/out">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/compile-asjs-config.xml b/frameworks/projects/Reflection/compile-asjs-config.xml
new file mode 100644
index 0000000..92f5a0f
--- /dev/null
+++ b/frameworks/projects/Reflection/compile-asjs-config.xml
@@ -0,0 +1,77 @@
+<!--
+
+ 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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path>
+ <!-- asjscompc won't 'link' these classes in, but will list their requires
+ if these swcs are on the external-library-path then their requires
+ will not be listed -->
+ <path-element>../../externs/Core.swc</path-element>
+ </library-path>
+
+ <namespaces>
+ </namespaces>
+
+ <source-path>
+ <path-element>as/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ <path-element>as/src</path-element>
+ </include-sources>
+
+ <include-classes>
+ </include-classes>
+
+ <include-namespaces>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/frameworks/projects/Reflection/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/compile-config.xml b/frameworks/projects/Reflection/compile-config.xml
new file mode 100644
index 0000000..e02f6b2
--- /dev/null
+++ b/frameworks/projects/Reflection/compile-config.xml
@@ -0,0 +1,73 @@
+<!--
+
+ 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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
+ <path-element>../../libs/Core.swc</path-element>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path/>
+
+ <namespaces>
+ </namespaces>
+
+ <source-path>
+ <path-element>as/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ <name>js/out/*</name>
+ <path>js/out/*</path>
+ </include-file>
+
+ <include-sources>
+ <path-element>as/src</path-element>
+ </include-sources>
+
+ <include-namespaces>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/manualtests/ReflectionTest/build.xml
----------------------------------------------------------------------
diff --git a/manualtests/ReflectionTest/build.xml b/manualtests/ReflectionTest/build.xml
new file mode 100644
index 0000000..c705edf
--- /dev/null
+++ b/manualtests/ReflectionTest/build.xml
@@ -0,0 +1,70 @@
+<?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="reflectiontest" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../.."/>
+ <property name="example" value="ReflectionTest" />
+
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+ <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${env.FALCON_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar"
+ type="file"
+ property="FALCON_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/>
+
+ <available file="${env.FALCONJX_HOME}/lib/jsc.jar"
+ type="file"
+ property="FALCONJX_HOME"
+ value="${env.FALCONJX_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar"
+ type="file"
+ property="FALCONJX_HOME"
+ value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/>
+
+ <available file="${env.GOOG_HOME}/closure/goog/base.js"
+ type="file"
+ property="GOOG_HOME"
+ value="${env.GOOG_HOME}"/>
+
+ <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js"
+ type="file"
+ property="GOOG_HOME"
+ value="${FLEXJS_HOME}/js/lib/google/closure-library"/>
+
+ <include file="${basedir}/../build_example.xml" />
+
+ <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of FlexJSUI.swc">
+ </target>
+
+ <target name="clean">
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/manualtests/ReflectionTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/manualtests/ReflectionTest/src/MyInitialView.mxml b/manualtests/ReflectionTest/src/MyInitialView.mxml
new file mode 100644
index 0000000..7334c43
--- /dev/null
+++ b/manualtests/ReflectionTest/src/MyInitialView.mxml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ xmlns:local="*"
+ xmlns:models="models.*"
+ xmlns:acc="org.apache.flex.html.accessories.*">
+
+ <fx:Style>
+ .title {
+ font-size: 14pt;
+ font-weight: bold;
+ }
+
+ </fx:Style>
+
+ <fx:Script>
+ <![CDATA[
+ import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.UIUtils;
+
+ import org.apache.flex.reflection.describeType;
+ import org.apache.flex.reflection.MethodDefinition;
+ import org.apache.flex.reflection.TypeDefinition;
+
+ public function runTest():void
+ {
+ var td:TypeDefinition = describeType(this);
+ trace(td.name);
+ var methods:Array = td.methods;
+ var md:MethodDefinition = methods[0] as MethodDefinition;
+ trace(md.name);
+ }
+ ]]>
+ </fx:Script>
+
+ <js:Container width="600" height="700" x="50" y="50">
+ <js:beads>
+ <js:VerticalLayout />
+ </js:beads>
+
+ <js:Label text="Reflection Test" className="title" />
+ <js:TextButton text="Test" click="runTest()" />
+ </js:Container>
+
+</js:ViewBase>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/manualtests/ReflectionTest/src/README.txt
----------------------------------------------------------------------
diff --git a/manualtests/ReflectionTest/src/README.txt b/manualtests/ReflectionTest/src/README.txt
new file mode 100644
index 0000000..f38df7f
--- /dev/null
+++ b/manualtests/ReflectionTest/src/README.txt
@@ -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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+DESCRIPTION
+
+The FormExample application demonstrates several FlexJS components and how they
+can be aligned in a column, much like you would see in a form.
+
+This Flex application may be run as a Flash SWF or cross-compiled (using Falcon JX)
+into JavaScript and HTML and run without Flash.
+
+The components are placed into a Container with a VerticalColumnLayout bead. This bead
+examines each of the children in the Container and aligns them in two columns.
+
+COMPONENTS and BEADS
+
+- Container
+- DateField
+- Label
+- TextInput
+
+- NonVirtualVerticalLayout
+- NumericOnlyTextInputBead
+- VerticalColumnLayout
+
+NOTES
+
+The cross-compilation to JavaScript often results in non-fatal warnings. Some of these warnings
+should be addressed in future releases of the Falcon JX compiler.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/manualtests/ReflectionTest/src/ReflectionTest.mxml
----------------------------------------------------------------------
diff --git a/manualtests/ReflectionTest/src/ReflectionTest.mxml b/manualtests/ReflectionTest/src/ReflectionTest.mxml
new file mode 100644
index 0000000..27e97b5
--- /dev/null
+++ b/manualtests/ReflectionTest/src/ReflectionTest.mxml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!---
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:local="*"
+ xmlns:models="models.*"
+ xmlns:controllers="controllers.*"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ >
+
+ <js:valuesImpl>
+ <js:SimpleCSSValuesImpl />
+ </js:valuesImpl>
+ <js:controller>
+ <controllers:MyController />
+ </js:controller>
+ <js:model>
+ <models:MyModel />
+ </js:model>
+ <js:initialView>
+ <local:MyInitialView />
+ </js:initialView>
+</js:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/manualtests/ReflectionTest/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/manualtests/ReflectionTest/src/controllers/MyController.as b/manualtests/ReflectionTest/src/controllers/MyController.as
new file mode 100644
index 0000000..81eb963
--- /dev/null
+++ b/manualtests/ReflectionTest/src/controllers/MyController.as
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 controllers
+{
+ import org.apache.flex.events.Event;
+
+ import org.apache.flex.core.Application;
+ import org.apache.flex.core.IDocument;
+
+ import models.MyModel;
+
+ public class MyController implements IDocument
+ {
+ public function MyController(app:Application = null)
+ {
+ if (app)
+ {
+ this.app = app as ReflectionTest;
+ app.addEventListener("viewChanged", viewChangeHandler);
+ }
+ }
+
+ private var app:ReflectionTest;
+
+ private function viewChangeHandler(event:Event):void
+ {
+ }
+
+ public function setDocument(document:Object, id:String = null):void
+ {
+ this.app = document as ReflectionTest;
+ app.addEventListener("viewChanged", viewChangeHandler);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/194943f3/manualtests/ReflectionTest/src/models/MyModel.as
----------------------------------------------------------------------
diff --git a/manualtests/ReflectionTest/src/models/MyModel.as b/manualtests/ReflectionTest/src/models/MyModel.as
new file mode 100644
index 0000000..5a16d02
--- /dev/null
+++ b/manualtests/ReflectionTest/src/models/MyModel.as
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 models
+{
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ public class MyModel extends EventDispatcher
+ {
+ public function MyModel()
+ {
+ }
+
+ private var _requestedField:String = "Ask";
+
+ [Bindable("requestedFieldChanged")]
+ public function get requestedField():String
+ {
+ return _requestedField;
+ }
+
+ public function set requestedField(value:String):void
+ {
+ if (value != _requestedField)
+ {
+ _requestedField = value;
+ dispatchEvent(new Event("requestedFieldChanged"));
+ if (_responseData)
+ dispatchEvent(new Event("responseTextChanged"));
+ }
+ }
+
+ [Bindable("responseTextChanged")]
+ public function get responseText():String
+ {
+ if (_responseData == null)
+ return "";
+ if (_responseData == "No Data")
+ return _responseData as String;
+ var s:String = _responseData[_requestedField];
+ if (s == null)
+ {
+ if (_requestedField == "Ask")
+ s = _responseData["Bid"];
+ }
+ return s;
+ }
+
+ private var _responseData:Object;
+
+ [Bindable("responseDataChanged")]
+ public function get responseData():Object
+ {
+ return _responseData;
+ }
+
+ public function set responseData(value:Object):void
+ {
+ if (value != _responseData)
+ {
+ _responseData = value;
+ _allData = "";
+ dispatchEvent(new Event("responseDataChanged"));
+ dispatchEvent(new Event("responseTextChanged"));
+ }
+ }
+
+ private var _allData:String = "";
+
+ [Bindable("responseDataChanged")]
+ public function get allData():String
+ {
+ if (_allData == "" && _responseData != null)
+ {
+ for (var p:String in _responseData)
+ {
+ _allData += p + ": " + _responseData[p] + "\n";
+ }
+ }
+ return _allData;
+ }
+
+
+ private var _stockSymbol:String;
+
+ [Bindable("stockSymbolChanged")]
+ public function get stockSymbol():String
+ {
+ return _stockSymbol;
+ }
+
+ public function set stockSymbol(value:String):void
+ {
+ if (value != _stockSymbol)
+ {
+ _stockSymbol = value;
+ dispatchEvent(new Event("stockSymbolChanged"));
+ }
+ }
+
+ private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
+ [Bindable("__NoChangeEvent__")]
+ public function get strings():Array
+ {
+ return _strings;
+ }
+
+ }
+}
\ No newline at end of file
[08/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/UIDUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/UIDUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/UIDUtil.as
new file mode 100644
index 0000000..34369e1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/UIDUtil.as
@@ -0,0 +1,424 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.utils.ByteArray;
+import flash.utils.Dictionary;
+
+import mx.core.IPropertyChangeNotifier;
+import mx.core.IUIComponent;
+import mx.core.IUID;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ * The UIDUtil class is an all-static class
+ * with methods for working with UIDs (unique identifiers) within Flex.
+ * You do not create instances of UIDUtil;
+ * instead you simply call static methods such as the
+ * <code>UIDUtil.createUID()</code> method.
+ *
+ * <p><b>Note</b>: If you have a dynamic object that has no [Bindable] properties
+ * (which force the object to implement the IUID interface), Flex adds an
+ * <code>mx_internal_uid</code> property that contains a UID to the object.
+ * To avoid having this field
+ * in your dynamic object, make it [Bindable], implement the IUID interface
+ * in the object class, or set a <coded>uid</coded> property with a value.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class UIDUtil
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Char codes for 0123456789ABCDEF
+ */
+ private static const ALPHA_CHAR_CODES:Array = [48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 65, 66, 67, 68, 69, 70];
+
+ private static const DASH:int = 45; // dash ascii
+ private static const UIDBuffer:ByteArray = new ByteArray(); // static ByteArray used for UID generation to save memory allocation cost
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * This Dictionary records all generated uids for all existing items.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static var uidDictionary:Dictionary = new Dictionary(true);
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Generates a UID (unique identifier) based on ActionScript's
+ * pseudo-random number generator and the current time.
+ *
+ * <p>The UID has the form
+ * <code>"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"</code>
+ * where X is a hexadecimal digit (0-9, A-F).</p>
+ *
+ * <p>This UID will not be truly globally unique; but it is the best
+ * we can do without player support for UID generation.</p>
+ *
+ * @return The newly-generated UID.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function createUID():String
+ {
+ UIDBuffer.position = 0;
+
+ var i:int;
+ var j:int;
+
+ for (i = 0; i < 8; i++)
+ {
+ UIDBuffer.writeByte(ALPHA_CHAR_CODES[int(Math.random() * 16)]);
+ }
+
+ for (i = 0; i < 3; i++)
+ {
+ UIDBuffer.writeByte(DASH);
+ for (j = 0; j < 4; j++)
+ {
+ UIDBuffer.writeByte(ALPHA_CHAR_CODES[int(Math.random() * 16)]);
+ }
+ }
+
+ UIDBuffer.writeByte(DASH);
+
+ var time:uint = new Date().getTime(); // extract last 8 digits
+ var timeString:String = time.toString(16).toUpperCase();
+ // 0xFFFFFFFF milliseconds ~= 3 days, so timeString may have between 1 and 8 digits, hence we need to pad with 0s to 8 digits
+ for (i = 8; i > timeString.length; i--)
+ UIDBuffer.writeByte(48);
+ UIDBuffer.writeUTFBytes(timeString);
+
+ for (i = 0; i < 4; i++)
+ {
+ UIDBuffer.writeByte(ALPHA_CHAR_CODES[int(Math.random() * 16)]);
+ }
+
+ return UIDBuffer.toString();
+ }
+
+ /**
+ * Converts a 128-bit UID encoded as a ByteArray to a String representation.
+ * The format matches that generated by createUID. If a suitable ByteArray
+ * is not provided, null is returned.
+ *
+ * @param ba ByteArray 16 bytes in length representing a 128-bit UID.
+ *
+ * @return String representation of the UID, or null if an invalid
+ * ByteArray is provided.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function fromByteArray(ba:ByteArray):String
+ {
+ if (ba != null && ba.length >= 16 && ba.bytesAvailable >= 16)
+ {
+ UIDBuffer.position = 0;
+ var index:uint = 0;
+ for (var i:uint = 0; i < 16; i++)
+ {
+ if (i == 4 || i == 6 || i == 8 || i == 10)
+ UIDBuffer.writeByte(DASH); // Hyphen char code
+
+ var b:int = ba.readByte();
+ UIDBuffer.writeByte(ALPHA_CHAR_CODES[(b & 0xF0) >>> 4]);
+ UIDBuffer.writeByte(ALPHA_CHAR_CODES[(b & 0x0F)]);
+ }
+ return UIDBuffer.toString();
+ }
+
+ return null;
+ }
+
+ /**
+ * A utility method to check whether a String value represents a
+ * correctly formatted UID value. UID values are expected to be
+ * in the format generated by createUID(), implying that only
+ * capitalized A-F characters in addition to 0-9 digits are
+ * supported.
+ *
+ * @param uid The value to test whether it is formatted as a UID.
+ *
+ * @return Returns true if the value is formatted as a UID.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isUID(uid:String):Boolean
+ {
+ if (uid != null && uid.length == 36)
+ {
+ for (var i:uint = 0; i < 36; i++)
+ {
+ var c:Number = uid.charCodeAt(i);
+
+ // Check for correctly placed hyphens
+ if (i == 8 || i == 13 || i == 18 || i == 23)
+ {
+ if (c != DASH)
+ {
+ return false;
+ }
+ }
+ // We allow capital alpha-numeric hex digits only
+ else if (c < 48 || c > 70 || (c > 57 && c < 65))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Converts a UID formatted String to a ByteArray. The UID must be in the
+ * format generated by createUID, otherwise null is returned.
+ *
+ * @param String representing a 128-bit UID
+ *
+ * @return ByteArray 16 bytes in length representing the 128-bits of the
+ * UID or null if the uid could not be converted.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function toByteArray(uid:String):ByteArray
+ {
+ if (isUID(uid))
+ {
+ var result:ByteArray = new ByteArray();
+
+ for (var i:uint = 0; i < uid.length; i++)
+ {
+ var c:String = uid.charAt(i);
+ if (c == "-")
+ continue;
+ var h1:uint = getDigit(c);
+ i++;
+ var h2:uint = getDigit(uid.charAt(i));
+ result.writeByte(((h1 << 4) | h2) & 0xFF);
+ }
+ result.position = 0;
+ return result;
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns the UID (unique identifier) for the specified object.
+ * If the specified object doesn't have an UID
+ * then the method assigns one to it.
+ * If a map is specified this method will use the map
+ * to construct the UID.
+ * As a special case, if the item passed in is null,
+ * this method returns a null UID.
+ *
+ * @param item Object that we need to find the UID for.
+ *
+ * @return The UID that was either found or generated.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getUID(item:Object):String
+ {
+ var result:String = null;
+
+ if (item == null)
+ return result;
+
+ if (item is IUID)
+ {
+ result = IUID(item).uid;
+ if (result == null || result.length == 0)
+ {
+ result = createUID();
+ IUID(item).uid = result;
+ }
+ }
+ else if ((item is IPropertyChangeNotifier) &&
+ !(item is IUIComponent))
+ {
+ result = IPropertyChangeNotifier(item).uid;
+ if (result == null || result.length == 0)
+ {
+ result = createUID();
+ IPropertyChangeNotifier(item).uid = result;
+ }
+ }
+ else if (item is String)
+ {
+ return item as String;
+ }
+ else
+ {
+ try
+ {
+ // We don't create uids for XMLLists, but if
+ // there's only a single XML node, we'll extract it.
+ if (item is XMLList && item.length == 1)
+ item = item[0];
+
+ if (item is XML)
+ {
+ // XML nodes carry their UID on the
+ // function-that-is-a-hashtable they can carry around.
+ // To decorate an XML node with a UID,
+ // we need to first initialize it for notification.
+ // There is a potential performance issue here,
+ // since notification does have a cost,
+ // but most use cases for needing a UID on an XML node also
+ // require listening for change notifications on the node.
+ var xitem:XML = XML(item);
+ var nodeKind:String = xitem.nodeKind();
+ if (nodeKind == "text" || nodeKind == "attribute")
+ return xitem.toString();
+
+ COMPILE::AS3
+ {
+ var notificationFunction:Function = xitem.notification();
+ if (!(notificationFunction is Function))
+ {
+ // The xml node hasn't already been initialized
+ // for notification, so do so now.
+ notificationFunction =
+ XMLNotifier.initializeXMLForNotification();
+ xitem.setNotification(notificationFunction);
+ }
+ }
+
+ // Generate a new uid for the node if necessary.
+ if (notificationFunction["uid"] == undefined)
+ result = notificationFunction["uid"] = createUID();
+
+ result = notificationFunction["uid"];
+ }
+ else
+ {
+ if ("mx_internal_uid" in item)
+ return item.mx_internal_uid;
+
+ if ("uid" in item)
+ return item.uid;
+
+ result = uidDictionary[item];
+
+ if (!result)
+ {
+ result = createUID();
+ try
+ {
+ item.mx_internal_uid = result;
+ }
+ catch(e:Error)
+ {
+ uidDictionary[item] = result;
+ }
+ }
+ }
+ }
+ catch(e:Error)
+ {
+ result = item.toString();
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns the decimal representation of a hex digit.
+ * @private
+ */
+ private static function getDigit(hex:String):uint
+ {
+ switch (hex)
+ {
+ case "A":
+ case "a":
+ return 10;
+ case "B":
+ case "b":
+ return 11;
+ case "C":
+ case "c":
+ return 12;
+ case "D":
+ case "d":
+ return 13;
+ case "E":
+ case "e":
+ return 14;
+ case "F":
+ case "f":
+ return 15;
+ default:
+ return new uint(hex);
+ }
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/XMLNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/XMLNotifier.as b/frameworks/projects/MX/src/main/flex/mx/utils/XMLNotifier.as
new file mode 100644
index 0000000..2505a64
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/XMLNotifier.as
@@ -0,0 +1,264 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.utils.Dictionary;
+import mx.core.mx_internal;
+import mx.utils.IXMLNotifiable;
+
+use namespace mx_internal;
+
+/**
+ * Used for watching changes to XML and XMLList objects.
+ * Those objects are not EventDispatchers, so if multiple elements
+ * want to watch for changes they need to go through this mechanism.
+ * Call <code>watchXML()</code>, passing in the same notification
+ * function that you would pass to XML.notification.
+ * Use <code>unwatchXML()</code> to remove that notification.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class XMLNotifier
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * XMLNotifier is a singleton.
+ */
+ private static var instance:XMLNotifier;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Get the singleton instance of the XMLNotifier.
+ *
+ * @return The XMLNotifier object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getInstance():XMLNotifier
+ {
+ if (!instance)
+ instance = new XMLNotifier(new XMLNotifierSingleton());
+
+ return instance;
+ }
+
+ /**
+ * @private
+ * Decorates an XML node with a notification function
+ * that can fan out to multiple targets.
+ */
+ mx_internal static function initializeXMLForNotification():Function
+ {
+ var notificationFunction:Function = function(currentTarget:Object,
+ ty:String,
+ tar:Object,
+ value:Object,
+ detail:Object):void
+ {
+ var xmlWatchers:Dictionary = arguments.callee.watched;
+ if (xmlWatchers != null)
+ {
+ for (var notifiable:Object in xmlWatchers)
+ {
+ IXMLNotifiable(notifiable).xmlNotification(currentTarget, ty, tar, value, detail);
+ }
+ }
+ }
+
+ return notificationFunction;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * XMLNotifier is a singleton class, so you do not use
+ * the <code>new</code> operator to create multiple instances of it.
+ * Instead, call the static method <code>XMLNotifider.getInstance()</code>
+ * to get the sole instance of this class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function XMLNotifier(x:XMLNotifierSingleton)
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Given an XML or XMLList, add the notification function
+ * to watch for changes.
+ *
+ * @param xml XML/XMLList object to watch.
+ * @param notification Function that needs to be called.
+ * @param optional UID for object
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function watchXML(xml:Object, notifiable:IXMLNotifiable, uid:String = null):void
+ {
+ if ((xml is XMLList) && xml.length() > 1)
+ {
+ for each(var item:Object in xml)
+ {
+ watchXML(item, notifiable, uid);
+ }
+ }
+ else
+ {
+ // An XMLList object behaves like XML when it contains one
+ // XML object. Casting to an XML object is necessary to
+ // access the notification() function.
+ var xmlItem:XML = XML(xml);
+
+ // First make sure the xml node has a notification function.
+ var watcherFunction:Object = xmlItem.notification();
+
+ if (!(watcherFunction is Function))
+ {
+ watcherFunction = initializeXMLForNotification();
+ xmlItem.setNotification(watcherFunction as Function);
+ if (uid && watcherFunction["uid"] == null)
+ watcherFunction["uid"] = uid;
+ }
+
+ // Watch lists are maintained on the notification function.
+ var xmlWatchers:Dictionary;
+ if (watcherFunction["watched"] == undefined)
+ watcherFunction["watched"] = xmlWatchers = new Dictionary(true);
+ else
+ xmlWatchers = watcherFunction["watched"];
+
+ xmlWatchers[notifiable] = true;
+ }
+ }
+
+ /**
+ * Given an XML or XMLList, remove the specified notification function.
+ *
+ * @param xml XML/XMLList object to un-watch.
+ * @param notification Function notification function.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function unwatchXML(xml:Object, notifiable:IXMLNotifiable):void
+ {
+ if ((xml is XMLList) && xml.length() > 1)
+ {
+ for each(var item:Object in xml)
+ {
+ unwatchXML(item, notifiable);
+ }
+ }
+ else
+ {
+ // An XMLList object behaves like XML when it contains one
+ // XML object. Casting to an XML object is necessary to
+ // access the notification() function.
+ var xmlItem:XML = XML(xml);
+
+ var watcherFunction:Object = xmlItem.notification();
+
+ if (!(watcherFunction is Function))
+ return;
+
+ var xmlWatchers:Dictionary;
+
+ if (watcherFunction["watched"] != undefined)
+ {
+ xmlWatchers = watcherFunction["watched"];
+ delete xmlWatchers[notifiable];
+ }
+ }
+ }
+}
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: XMLNotifierSingleton
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+class XMLNotifierSingleton
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function XMLNotifierSingleton()
+ {
+ super();
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/object_proxy.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/object_proxy.as b/frameworks/projects/MX/src/main/flex/mx/utils/object_proxy.as
new file mode 100644
index 0000000..5aea911
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/object_proxy.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 mx.utils
+{
+
+/**
+ * Documentation is not currently available.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public namespace object_proxy =
+ "http://www.adobe.com/2006/actionscript/flash/objectproxy";
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/validators/IValidatorListener.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/validators/IValidatorListener.as b/frameworks/projects/MX/src/main/flex/mx/validators/IValidatorListener.as
new file mode 100644
index 0000000..aa19bc8
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/validators/IValidatorListener.as
@@ -0,0 +1,132 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.validators
+{
+
+import mx.events.ValidationResultEvent;
+
+/**
+ * The interface that components implement to support
+ * the Flex data validation mechanism.
+ * The UIComponent class implements this interface.
+ * Therefore, any subclass of UIComponent also implements it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IValidatorListener
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // errorString
+ //----------------------------------
+
+ /**
+ * The text that will be displayed by a component's error tip when a
+ * component is monitored by a Validator and validation fails.
+ *
+ * <p>You can use the <code>errorString</code> property to show a
+ * validation error for a component, without actually using
+ * a validator class.
+ * When you write a String value to the <code>errorString</code> property,
+ * Flex draws a red border around the component to indicate
+ * the validation error, and the String appears in a tooltip
+ * as the validation error message when you move the mouse over
+ * the component, just as if a validator detected a validation error.</p>
+ *
+ * <p>To clear the validation error, write an empty String, "",
+ * to the <code>errorString</code> property.</p>
+ *
+ * <p>Note that writing a value to the <code>errorString</code> property
+ * does not trigger the valid or invalid events; it only changes the
+ * border color and displays the validation error message.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get errorString():String;
+
+ /**
+ * @private
+ */
+ function set errorString(value:String):void;
+
+ //----------------------------------
+ // validationSubField
+ //----------------------------------
+
+ /**
+ * Used by a validator to assign a subfield.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get validationSubField():String;
+
+ /**
+ * @private
+ */
+ function set validationSubField(value:String):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Handles both the <code>valid</code> and <code>invalid</code> events
+ * from a validator assigned to this component.
+ *
+ * <p>You typically handle the <code>valid</code> and <code>invalid</code>
+ * events dispatched by a validator by assigning event listeners
+ * to the validators.
+ * If you want to handle validation events directly in the component
+ * that is being validated, you can override this method
+ * to handle the <code>valid</code> and <code>invalid</code> events.
+ * From within your implementation, you can use the
+ * <code>dispatchEvent()</code> method to dispatch the
+ * <code>valid</code> and <code>invalid</code> events
+ * in the case where a validator is also listening for them.</p>
+ *
+ * @param event The event object for the validation.
+ *
+ * @see mx.events.ValidationResultEvent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validationResultHandler(event:ValidationResultEvent):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/validators/ValidationResult.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/validators/ValidationResult.as b/frameworks/projects/MX/src/main/flex/mx/validators/ValidationResult.as
new file mode 100644
index 0000000..4845e73
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/validators/ValidationResult.as
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.validators
+{
+
+/**
+ * The ValidationResult class contains the results of a validation.
+ *
+ * <p>The ValidationResultEvent class defines the event object
+ * that is passed to event listeners for the <code>valid</code>
+ * and <code>invalid</code> validator events.
+ * The class also defines the <code>results</code> property,
+ * which contains an Array of ValidationResult objects,
+ * one for each field examined by the validator.
+ * This lets you access the ValidationResult objects
+ * from within an event listener.</p>
+ *
+ * @see mx.events.ValidationResultEvent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ValidationResult
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @param isError Pass <code>true</code> if there was a validation error.
+ *
+ * @param subField Name of the subfield of the validated Object.
+ *
+ * @param errorCode Validation error code.
+ *
+ * @param errorMessage Validation error message.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ValidationResult(isError:Boolean, subField:String = "",
+ errorCode:String = "",
+ errorMessage:String = "")
+ {
+ super();
+
+ this.isError = isError;
+ this.subField = subField;
+ this.errorMessage = errorMessage;
+ this.errorCode = errorCode;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // errorCode
+ //----------------------------------
+
+ /**
+ * The validation error code
+ * if the value of the <code>isError</code> property is <code>true</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var errorCode:String;
+
+ //----------------------------------
+ // errorMessage
+ //----------------------------------
+
+ /**
+ * The validation error message
+ * if the value of the <code>isError</code> property is <code>true</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var errorMessage:String;
+
+ //----------------------------------
+ // isError
+ //----------------------------------
+
+ /**
+ * Contains <code>true</code> if the field generated a validation failure.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var isError:Boolean;
+
+ //----------------------------------
+ // subField
+ //----------------------------------
+
+ /**
+ * The name of the subfield that the result is associated with.
+ * Some validators, such as CreditCardValidator and DateValidator,
+ * validate multiple subfields at the same time.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var subField:String;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/resources/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/resources/compile-asjs-config.xml b/frameworks/projects/MX/src/main/resources/compile-asjs-config.xml
new file mode 100644
index 0000000..57a36d3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/resources/compile-asjs-config.xml
@@ -0,0 +1,85 @@
+<!--
+
+ 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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path>
+ <!-- asjscompc won't 'link' these classes in, but will list their requires
+ if these swcs are on the external-library-path then their requires
+ will not be listed -->
+ <path-element>../../../../../externs/Binding.swc</path-element>
+ <path-element>../../../../../externs/Core.swc</path-element>
+ <path-element>../../../../../externs/Graphics.swc</path-element>
+ <path-element>../../../../../externs/Collections.swc</path-element>
+ </library-path>
+
+ <namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/mx</uri>
+ <manifest>mx-manifest.xml</manifest>
+ </namespace>
+ </namespaces>
+
+ <source-path>
+ <path-element>../flex</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ </include-sources>
+
+ <include-classes>
+ <class>MXClasses</class>
+ </include-classes>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/mx</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/resources/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/resources/compile-config.xml b/frameworks/projects/MX/src/main/resources/compile-config.xml
new file mode 100644
index 0000000..57a36d3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/resources/compile-config.xml
@@ -0,0 +1,85 @@
+<!--
+
+ 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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path>
+ <!-- asjscompc won't 'link' these classes in, but will list their requires
+ if these swcs are on the external-library-path then their requires
+ will not be listed -->
+ <path-element>../../../../../externs/Binding.swc</path-element>
+ <path-element>../../../../../externs/Core.swc</path-element>
+ <path-element>../../../../../externs/Graphics.swc</path-element>
+ <path-element>../../../../../externs/Collections.swc</path-element>
+ </library-path>
+
+ <namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/mx</uri>
+ <manifest>mx-manifest.xml</manifest>
+ </namespace>
+ </namespaces>
+
+ <source-path>
+ <path-element>../flex</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ </include-sources>
+
+ <include-classes>
+ <class>MXClasses</class>
+ </include-classes>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/mx</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/resources/mx-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/resources/mx-manifest.xml b/frameworks/projects/MX/src/main/resources/mx-manifest.xml
new file mode 100644
index 0000000..a1c9fd5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/resources/mx-manifest.xml
@@ -0,0 +1,26 @@
+<?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.
+
+-->
+
+
+<componentPackage>
+
+ <!--<component id="Button" class="org.apache.flex.html.Button"/>-->
+
+</componentPackage>
[18/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/AddItems.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/AddItems.as b/frameworks/projects/MX/src/main/flex/mx/states/AddItems.as
new file mode 100644
index 0000000..b840bca
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/AddItems.as
@@ -0,0 +1,1198 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+import flash.display.DisplayObject;
+import flash.events.Event;
+import flash.events.IEventDispatcher;
+
+import mx.binding.BindingManager;
+import mx.collections.IList;
+import mx.core.ContainerCreationPolicy;
+import mx.core.IChildList;
+import mx.core.IDeferredContentOwner;
+import mx.core.IMXMLObject;
+import mx.core.ITransientDeferredInstance;
+import mx.core.IUIComponent;
+import mx.core.IVisualElement;
+import mx.core.IVisualElementContainer;
+import mx.core.UIComponent;
+
+[DefaultProperty("itemsFactory")]
+
+/**
+ * Documentation is not currently available.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public class AddItems extends OverrideBase implements IMXMLObject
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class Constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Documentation is not currently available.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const FIRST:String = "first";
+
+ /**
+ * Documentation is not currently available.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const LAST:String = "last";
+
+ /**
+ * Documentation is not currently available.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const BEFORE:String = "before";
+
+ /**
+ * Documentation is not currently available.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const AFTER:String = "after";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function AddItems()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ private var document:Object;
+
+ /**
+ * @private
+ */
+ private var added:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var startIndex:int;
+
+ /**
+ * @private
+ */
+ private var numAdded:int;
+
+ /**
+ * @private
+ */
+ private var instanceCreated:Boolean = false;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //------------------------------------
+ // creationPolicy
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the creationPolicy property.
+ */
+ private var _creationPolicy:String = ContainerCreationPolicy.AUTO;
+
+ [Inspectable(category="General")]
+
+ /**
+ * The creation policy for the items.
+ * This property determines when the <code>itemsFactory</code> will create
+ * the instance of the items.
+ * Flex uses this property only if you specify an <code>itemsFactory</code> property.
+ * The following values are valid:
+ *
+ * <p></p>
+ * <table class="innertable">
+ * <tr><th>Value</th><th>Meaning</th></tr>
+ * <tr><td><code>auto</code></td><td>(default)Create the instance the
+ * first time it is needed.</td></tr>
+ * <tr><td><code>all</code></td><td>Create the instance when the
+ * application started up.</td></tr>
+ * <tr><td><code>none</code></td><td>Do not automatically create the instance.
+ * You must call the <code>createInstance()</code> method to create
+ * the instance.</td></tr>
+ * </table>
+ *
+ * @default "auto"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get creationPolicy():String
+ {
+ return _creationPolicy;
+ }
+
+ /**
+ * @private
+ */
+ public function set creationPolicy(value:String):void
+ {
+ _creationPolicy = value;
+
+ if (_creationPolicy == ContainerCreationPolicy.ALL)
+ createInstance();
+ }
+
+ //------------------------------------
+ // destructionPolicy
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the destructionPolicy property.
+ */
+ private var _destructionPolicy:String = "never";
+
+ [Inspectable(category="General")]
+
+ /**
+ * The destruction policy for the items.
+ * This property determines when the <code>itemsFactory</code> will destroy
+ * the deferred instances it manages. By default once instantiated, all
+ * instances are cached (destruction policy of 'never').
+ * Flex uses this property only if you specify an <code>itemsFactory</code> property.
+ * The following values are valid:
+ *
+ * <p></p>
+ * <table class="innertable">
+ * <tr><th>Value</th><th>Meaning</th></tr>
+ * <tr><td><code>never</code></td><td>(default)Once created never destroy
+ * the instance.</td></tr>
+ * <tr><td><code>auto</code></td><td>Destroy the instance when the override
+ * no longer applies.</td></tr>
+ * </table>
+ *
+ * @default "never"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get destructionPolicy():String
+ {
+ return _destructionPolicy;
+ }
+
+ /**
+ * @private
+ */
+ public function set destructionPolicy(value:String):void
+ {
+ _destructionPolicy = value;
+ }
+
+ //------------------------------------
+ // destination
+ //------------------------------------
+
+ /**
+ * The object relative to which the child is added. This property is used
+ * in conjunction with the <code>position</code> property.
+ * This property is optional; if
+ * you omit it, Flex uses the immediate parent of the <code>State</code>
+ * object, that is, the component that has the <code>states</code>
+ * property, or <code><mx:states></code>tag that specifies the State
+ * object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var destination:Object;
+
+ //------------------------------------
+ // items
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the items property
+ */
+ private var _items:*;
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The items to be added.
+ * If you set this property, the items are created at app startup.
+ * Setting this property is equivalent to setting a <code>itemsFactory</code>
+ * property with a <code>creationPolicy</code> of <code>"all"</code>.
+ *
+ * <p>Do not set this property if you set the <code>itemsFactory</code>
+ * property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get items():*
+ {
+ if (!_items && creationPolicy != ContainerCreationPolicy.NONE)
+ createInstance();
+
+ return _items;
+ }
+
+ /**
+ * @private
+ */
+ public function set items(value:*):void
+ {
+ _items = value;
+ }
+
+ //------------------------------------
+ // itemsDescriptor
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the itemsDescriptor property.
+ */
+ private var _itemsDescriptor:Array;
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The descriptor that describes the items.
+ *
+ * <p>If you set this property, the items are instantiated at the time
+ * determined by the <code>creationPolicy</code> property.</p>
+ *
+ * <p>Do not set this property if you set the <code>items</code>
+ * property.
+ * This propety is the <code>AddItems</code> class default property.
+ * Setting this property with a <code>creationPolicy</code> of "all"
+ * is equivalent to setting a <code>items</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get itemsDescriptor():Array
+ {
+ return _itemsDescriptor;
+ }
+
+ /**
+ * @private
+ */
+ public function set itemsDescriptor(value:Array):void
+ {
+ _itemsDescriptor = value;
+
+ if (creationPolicy == ContainerCreationPolicy.ALL)
+ createInstance();
+ }
+
+ //------------------------------------
+ // itemsFactory
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the itemsFactory property.
+ */
+ private var _itemsFactory:ITransientDeferredInstance;
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The factory that creates the items.
+ *
+ * <p>If you set this property, the items are instantiated at the time
+ * determined by the <code>creationPolicy</code> property.</p>
+ *
+ * <p>Do not set this property if you set the <code>items</code>
+ * property.
+ * This propety is the <code>AddItems</code> class default property.
+ * Setting this property with a <code>creationPolicy</code> of "all"
+ * is equivalent to setting a <code>items</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get itemsFactory():ITransientDeferredInstance
+ {
+ return _itemsFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set itemsFactory(value:ITransientDeferredInstance):void
+ {
+ _itemsFactory = value;
+
+ if (creationPolicy == ContainerCreationPolicy.ALL)
+ createInstance();
+ }
+
+ //------------------------------------
+ // position
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The position of the child in the display list, relative to the
+ * object specified by the <code>relativeTo</code> property.
+ *
+ * @default AddItems.LAST
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var position:String = AddItems.LAST;
+
+ //------------------------------------
+ // isStyle
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * Denotes whether or not the collection represented by the
+ * target property is a style.
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var isStyle:Boolean = false;
+
+ //------------------------------------
+ // isArray
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * Denotes whether or not the collection represented by the
+ * target property is to be treated as a single array instance
+ * instead of a collection of items (the default).
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var isArray:Boolean = false;
+
+ //------------------------------------
+ // vectorClass
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * When the collection represented by the target property is a
+ * Vector, vectorClass is the type of the target. It is used to
+ * initialize the target property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.5
+ */
+ public var vectorClass:Class;
+
+ //------------------------------------
+ // propertyName
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The name of the Array property that is being modified. If the <code>destination</code>
+ * property is a Group or Container, this property is optional. If not defined, the
+ * items will be added as children of the Group/Container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var propertyName:String;
+
+ //------------------------------------
+ // relativeTo
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The object relative to which the child is added. This property is only
+ * used when the <code>position</code> property is <code>AddItems.BEFORE</code>
+ * or <code>AddItems.AFTER</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var relativeTo:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates the items instance from the factory.
+ * You must use this method only if you specify a <code>targetItems</code>
+ * property and a <code>creationPolicy</code> value of <code>"none"</code>.
+ * Flex automatically calls this method if the <code>creationPolicy</code>
+ * property value is <code>"auto"</code> or <code>"all"</code>.
+ * If you call this method multiple times, the items instance is
+ * created only on the first call.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function createInstance():void
+ {
+ if (!instanceCreated && !_items && itemsFactory && !_itemsDescriptor)
+ {
+ instanceCreated = true;
+ items = itemsFactory.getInstance();
+ }
+ else if (!instanceCreated && !_items && !itemsFactory && _itemsDescriptor)
+ {
+ instanceCreated = true;
+ items = generateMXMLArray(document, itemsDescriptor, false);
+ }
+ }
+
+ protected function generateMXMLObject(document:Object, data:Array):Object
+ {
+ var i:int = 0;
+ var cls:Class = data[i++];
+ var comp:Object = new cls();
+
+ var m:int;
+ var j:int;
+ var name:String;
+ var simple:*;
+ var value:Object;
+ var id:String;
+
+ m = data[i++]; // num props
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ simple = data[i++];
+ value = data[i++];
+ if (simple === null)
+ value = generateMXMLArray(document, value as Array);
+ else if (simple === undefined)
+ value = generateMXMLVector(document, value as Array);
+ else if (simple == false)
+ value = generateMXMLObject(document, value as Array);
+ if (name == "id")
+ {
+ document[value] = comp;
+ id = value as String;
+ if (comp is IMXMLObject)
+ continue; // skip assigment to comp
+ if (!("id" in comp))
+ continue;
+ }
+ else if (name == "_id")
+ {
+ document[value] = comp;
+ id = value as String;
+ continue; // skip assignment to comp
+ }
+ comp[name] = value;
+ }
+ m = data[i++]; // num styles
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ simple = data[i++];
+ value = data[i++];
+ if (simple == null)
+ value = generateMXMLArray(document, value as Array);
+ else if (simple == false)
+ value = generateMXMLObject(document, value as Array);
+ comp.setStyle(name, value);
+ }
+
+ m = data[i++]; // num effects
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ simple = data[i++];
+ value = data[i++];
+ if (simple == null)
+ value = generateMXMLArray(document, value as Array);
+ else if (simple == false)
+ value = generateMXMLObject(document, value as Array);
+ comp.setStyle(name, value);
+ }
+
+ m = data[i++]; // num events
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ value = data[i++];
+ comp.addEventListener(name, value);
+ }
+
+ if (comp is IUIComponent)
+ {
+ if (comp.document == null)
+ comp.document = document;
+ }
+ var children:Array = data[i++];
+ if (children)
+ {
+ comp.generateMXMLInstances(document, children);
+ }
+
+ if (id)
+ {
+ document[id] = comp;
+ mx.binding.BindingManager.executeBindings(document, id, comp);
+ }
+ if (comp is IMXMLObject)
+ comp.initialized(document, id);
+ return comp;
+ }
+
+ public function generateMXMLVector(document:Object, data:Array, recursive:Boolean = true):*
+ {
+ var comps:Array;
+
+ var n:int = data.length;
+ var hint:* = data.shift();
+ var generatorFunction:Function = data.shift();
+ comps = generateMXMLArray(document, data, recursive);
+ return generatorFunction(comps);
+ }
+
+ public function generateMXMLArray(document:Object, data:Array, recursive:Boolean = true):Array
+ {
+ var comps:Array = [];
+
+ var n:int = data.length;
+ var i:int = 0;
+ while (i < n)
+ {
+ var cls:Class = data[i++];
+ var comp:Object = new cls();
+
+ var m:int;
+ var j:int;
+ var name:String;
+ var simple:*;
+ var value:Object;
+ var id:String = null;
+
+ m = data[i++]; // num props
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ simple = data[i++];
+ value = data[i++];
+ if (simple === null)
+ value = generateMXMLArray(document, value as Array, recursive);
+ else if (simple === undefined)
+ value = generateMXMLVector(document, value as Array, recursive);
+ else if (simple == false)
+ value = generateMXMLObject(document, value as Array);
+ if (name == "id")
+ {
+ document[value] = comp;
+ id = value as String;
+ if (comp is IMXMLObject)
+ continue; // skip assigment to comp
+ try {
+ if (!("id" in comp))
+ continue;
+ }
+ catch (e:Error)
+ {
+ continue; // proxy subclasses might throw here
+ }
+ }
+ if (name == "document" && !comp.document)
+ comp.document = document;
+ else if (name == "_id")
+ id = value as String; // and don't assign to comp
+ else
+ comp[name] = value;
+ }
+ m = data[i++]; // num styles
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ simple = data[i++];
+ value = data[i++];
+ if (simple == null)
+ value = generateMXMLArray(document, value as Array, recursive);
+ else if (simple == false)
+ value = generateMXMLObject(document, value as Array);
+ comp.setStyle(name, value);
+ }
+
+ m = data[i++]; // num effects
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ simple = data[i++];
+ value = data[i++];
+ if (simple == null)
+ value = generateMXMLArray(document, value as Array, recursive);
+ else if (simple == false)
+ value = generateMXMLObject(document, value as Array);
+ comp.setStyle(name, value);
+ }
+
+ m = data[i++]; // num events
+ for (j = 0; j < m; j++)
+ {
+ name = data[i++];
+ value = data[i++];
+ comp.addEventListener(name, value);
+ }
+
+ if (comp is IUIComponent)
+ {
+ if (comp.document == null)
+ comp.document = document;
+ }
+ var children:Array = data[i++];
+ if (children)
+ {
+ if (recursive)
+ comp.generateMXMLInstances(document, children, recursive);
+ else
+ comp.setMXMLDescriptor(children);
+ }
+
+ if (id)
+ {
+ document[id] = comp;
+ mx.binding.BindingManager.executeBindings(document, id, comp);
+ }
+ if (comp is IMXMLObject)
+ comp.initialized(document, id);
+ comps.push(comp);
+ }
+ return comps;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ override public function initialize():void
+ {
+ if (creationPolicy == ContainerCreationPolicy.AUTO)
+ createInstance();
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ override public function apply(parent:UIComponent):void
+ {
+ var dest:* = getOverrideContext(destination, parent);
+ var localItems:Array;
+
+ added = false;
+ parentContext = parent;
+
+ // Early exit if destination is null.
+ if (!dest)
+ {
+ if (destination != null && !applied)
+ {
+ // Our destination context is unavailable so we attempt to register
+ // a listener on our parent document to detect when/if it becomes
+ // valid.
+ addContextListener(destination);
+ }
+ applied = true;
+ return;
+ }
+
+ applied = true;
+ destination = dest;
+
+ // Coerce to array if not already an array, or we wish
+ // to treat the array as *the* item to add (isArray == true)
+ if (items is Array && !isArray)
+ localItems = items;
+ else
+ localItems = [items];
+
+ switch (position)
+ {
+ case FIRST:
+ startIndex = 0;
+ break;
+ case LAST:
+ startIndex = -1;
+ break;
+ case BEFORE:
+ startIndex = getRelatedIndex(parent, dest);
+ break;
+ case AFTER:
+ startIndex = getRelatedIndex(parent, dest) + 1;
+ break;
+ }
+
+ if ( (propertyName == null || propertyName == "mxmlContent") && (dest is IVisualElementContainer))
+ {
+ if (!addItemsToContentHolder(dest as IVisualElementContainer, localItems))
+ return;
+ }
+ else if (propertyName == null && dest is IChildList)
+ {
+ addItemsToContainer(dest as IChildList, localItems);
+ }
+ else if (propertyName != null && !isStyle && dest[propertyName] is IList)
+ {
+ addItemsToIList(dest[propertyName], localItems);
+ }
+ else if (vectorClass)
+ {
+ addItemsToVector(dest, propertyName, localItems);
+ }
+ else
+ {
+ addItemsToArray(dest, propertyName, localItems);
+ }
+
+ added = true;
+ numAdded = localItems.length;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ override public function remove(parent:UIComponent):void
+ {
+ var dest:* = getOverrideContext(destination, parent);
+ var localItems:Array;
+ var i:int;
+
+ if (!added)
+ {
+ if (dest == null)
+ {
+ // It seems our override is no longer active, but we were never
+ // able to successfully apply ourselves, so remove our context
+ // listener if applicable.
+ removeContextListener();
+ }
+ else if (_waitingForDeferredContent)
+ {
+ // Or we were waiting around for deferred content of our target
+ // to be created and it never happened, so we'll stop listening
+ // for now.
+ removeCreationCompleteListener();
+ }
+ applied = false;
+ parentContext = null;
+ return;
+ }
+
+ // Coerce to array if not already an array, or we wish
+ // to treat the array as *the* item to add (isArray == true)
+ if (items is Array && !isArray)
+ localItems = items;
+ else
+ localItems = [items];
+
+ if ((propertyName == null || propertyName == "mxmlContent") && (dest is IVisualElementContainer))
+ {
+ for (i = 0; i < numAdded; i++)
+ {
+ if (IVisualElementContainer(dest).numElements > startIndex)
+ IVisualElementContainer(dest).removeElementAt(startIndex);
+ }
+ }
+ else if (propertyName == null && dest is IChildList)
+ {
+ for (i = 0; i < numAdded; i++)
+ {
+ if (IChildList(dest).numChildren > startIndex)
+ IChildList(dest).removeChildAt(startIndex);
+ }
+ }
+ else if (propertyName != null && !isStyle && dest[propertyName] is IList)
+ {
+ removeItemsFromIList(dest[propertyName] as IList);
+ }
+ else if (vectorClass)
+ {
+ var tempVector:Object = isStyle ? dest.getStyle(propertyName) : dest[propertyName];
+
+ if (numAdded < tempVector.length)
+ {
+ tempVector.splice(startIndex, numAdded);
+ assign(dest, propertyName, tempVector);
+ }
+ else
+ {
+ // For destinations like ArrayCollection we don't want to
+ // affect the vector in-place in some cases, as ListCollectionView a
+ // attempts to compare the "before" and "after" state of the vector
+ assign(dest, propertyName, new vectorClass());
+ }
+ }
+ else
+ {
+ var tempArray:Array = isStyle ? dest.getStyle(propertyName) : dest[propertyName];
+
+ if (numAdded < tempArray.length)
+ {
+ tempArray.splice(startIndex, numAdded);
+ assign(dest, propertyName, tempArray);
+ }
+ else
+ {
+ // For destinations like ArrayCollection we don't want to
+ // affect the array in-place in some cases, as ListCollectionView a
+ // attempts to compare the "before" and "after" state of the array
+ assign(dest, propertyName, []);
+ }
+ }
+
+ if (destructionPolicy == "auto")
+ destroyInstance();
+
+ // Clear our flags and override context.
+ added = false;
+ applied = false;
+ parentContext = null;
+ }
+
+ /**
+ * @private
+ */
+ private function destroyInstance():void
+ {
+ if (_itemsFactory)
+ {
+ instanceCreated = false;
+ items = null;
+ _itemsFactory.reset();
+ }
+ }
+
+ /**
+ * @private
+ */
+ protected function getObjectIndex(object:Object, dest:Object):int
+ {
+ try
+ {
+ if ((propertyName == null || propertyName == "mxmlContent") && (dest is IVisualElementContainer))
+ return IVisualElementContainer(dest).getElementIndex(object as IVisualElement);
+
+ if (propertyName == null && dest is IChildList)
+ return IChildList(dest).getChildIndex(DisplayObject(object));
+
+ if (propertyName != null && !isStyle && dest[propertyName] is IList)
+ return IList(dest[propertyName].list).getItemIndex(object);
+
+ if (propertyName != null && isStyle)
+ return dest.getStyle(propertyName).indexOf(object);
+
+ return dest[propertyName].indexOf(object);
+ }
+ catch(e:Error) {}
+ return -1;
+ }
+
+ /**
+ * @private
+ * Find the index of the relative object. If relativeTo is an array,
+ * search for the first valid item's index. This is used for stateful
+ * documents where one or more relative siblings of the newly inserted
+ * item may not be realized within the current state.
+ */
+ protected function getRelatedIndex(parent:UIComponent, dest:Object):int
+ {
+ var index:int = -1;
+ if (relativeTo is Array)
+ {
+ for (var i:int = 0; ((i < relativeTo.length) && index < 0); i++)
+ {
+ var relativeObject:Object = getOverrideContext(relativeTo[i], parent);
+ index = getObjectIndex(relativeObject, dest);
+ }
+ }
+ else
+ {
+ relativeObject = getOverrideContext(relativeTo, parent);
+ index = getObjectIndex(relativeObject, dest);
+ }
+ return index;
+ }
+
+ private var _waitingForDeferredContent:Boolean = false;
+
+ /**
+ * @private
+ */
+ protected function addItemsToContentHolder(dest:IVisualElementContainer, items:Array):Boolean
+ {
+ // If we are being asked to add more children to a deferred content owner,
+ // but the deferred content has yet to be created, we will defer application
+ // until it is safe to do so.
+ if (dest is IDeferredContentOwner && dest is IEventDispatcher)
+ {
+ var dco:IDeferredContentOwner= dest as IDeferredContentOwner;
+ if (!dco.deferredContentCreated)
+ {
+ IEventDispatcher(dest).addEventListener("contentCreationComplete", onDestinationContentCreated);
+ _waitingForDeferredContent = true;
+ return false;
+ }
+ }
+
+ if (startIndex == -1)
+ startIndex = dest.numElements;
+
+ for (var i:int = 0; i < items.length; i++)
+ dest.addElementAt(items[i], startIndex + i);
+
+ return true;
+ }
+
+ /**
+ * @private
+ */
+ protected function addItemsToContainer(dest:IChildList, items:Array):void
+ {
+ if (startIndex == -1)
+ startIndex = dest.numChildren;
+
+ for (var i:int = 0; i < items.length; i++)
+ dest.addChildAt(items[i], startIndex + i);
+ }
+
+ /**
+ * @private
+ */
+ protected function addItemsToArray(dest:Object, propertyName:String, items:Array):void
+ {
+ var tempArray:Array = isStyle ? dest.getStyle(propertyName) : dest[propertyName];
+
+ if (!tempArray)
+ tempArray = [];
+
+ if (startIndex == -1)
+ startIndex = tempArray.length;
+
+ for (var i:int = 0; i < items.length; i++)
+ tempArray.splice(startIndex + i, 0, items[i]);
+
+ assign(dest, propertyName, tempArray);
+ }
+
+ /**
+ * @private
+ */
+ protected function addItemsToVector(dest:Object, propertyName:String, items:Array):void
+ {
+ var tempVector:Object = isStyle ? dest.getStyle(propertyName) : dest[propertyName];
+
+ if (!tempVector)
+ tempVector = new vectorClass();
+
+ if (startIndex == -1)
+ startIndex = tempVector.length;
+
+ for (var i:int = 0; i < items.length; i++)
+ tempVector.splice(startIndex + i, 0, items[i]);
+
+ assign(dest, propertyName, tempVector);
+ }
+
+ /**
+ * @private
+ */
+ protected function addItemsToIList(list:IList, items:Array):void
+ {
+ if (startIndex == -1)
+ startIndex = list.length;
+
+ for (var i:int = 0; i < items.length; i++)
+ list.addItemAt(items[i], startIndex + i);
+ }
+
+ /**
+ * @private
+ */
+ protected function removeItemsFromIList(list:IList):void
+ {
+ for (var i:int = 0; i < numAdded; i++)
+ list.removeItemAt(startIndex);
+
+ }
+
+ /**
+ * @private
+ */
+ protected function assign(dest:Object, propertyName:String, value:Object):void
+ {
+ if (isStyle)
+ {
+ dest.setStyle(propertyName, value);
+ dest.styleChanged(propertyName);
+ dest.notifyStyleChangeInChildren(propertyName, true);
+ }
+ else
+ {
+ dest[propertyName] = value;
+ }
+ }
+
+ /**
+ * @private
+ * We've detected that our IDeferredContentOwnder target has created its
+ * content, so it's safe to apply our override content now.
+ */
+ private function onDestinationContentCreated(e:Event):void
+ {
+ if (parentContext)
+ {
+ removeCreationCompleteListener();
+ apply(parentContext);
+ }
+ }
+
+ /**
+ * @private
+ * Remove our contentCreationComplete listener.
+ */
+ private function removeCreationCompleteListener():void
+ {
+ if (parentContext)
+ {
+ parentContext.removeEventListener("contentCreationComplete", onDestinationContentCreated);
+ _waitingForDeferredContent = false;
+ }
+ }
+
+ /**
+ * IMXMLObject support
+ */
+ public function initialized(document:Object, id:String):void
+ {
+ this.document = document;
+ }
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/IOverride.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/IOverride.as b/frameworks/projects/MX/src/main/flex/mx/states/IOverride.as
new file mode 100644
index 0000000..6a9b74a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/IOverride.as
@@ -0,0 +1,91 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.states
+{
+
+import mx.core.UIComponent;
+
+/**
+ * The IOverride interface is used for view state overrides.
+ * All entries in the State class <code>overrides</code>
+ * property array must implement this interface.
+ *
+ * @see mx.states.State
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IOverride
+{
+ /**
+ * Initializes the override.
+ * Flex calls this method before the first call to the
+ * <code>apply()</code> method, so you put one-time initialization
+ * code for the override in this method.
+ *
+ * <p>Flex calls this method automatically when the state is entered.
+ * It should not be called directly.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initialize():void
+
+ /**
+ * Applies the override. Flex retains the original value, so that it can
+ * restore the value later in the <code>remove()</code> method.
+ *
+ * <p>This method is called automatically when the state is entered.
+ * It should not be called directly.</p>
+ *
+ * @param parent The parent of the state object containing this override.
+ * The override should use this as its target if an explicit target was
+ * not specified.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function apply(parent:UIComponent):void;
+
+ /**
+ * Removes the override. The value remembered in the <code>apply()</code>
+ * method is restored.
+ *
+ * <p>This method is called automatically when the state is entered.
+ * It should not be called directly.</p>
+ *
+ * @param parent The parent of the state object containing this override.
+ * The override should use this as its target if an explicit target was
+ * not specified.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function remove(parent:UIComponent):void;
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/InterruptionBehavior.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/InterruptionBehavior.as b/frameworks/projects/MX/src/main/flex/mx/states/InterruptionBehavior.as
new file mode 100644
index 0000000..642f006
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/InterruptionBehavior.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+ /**
+ * The InterruptionBehavior class defines constants for use with the
+ * <code>interruptionBehavior</code> property of the mx.states.Transition class.
+ *
+ * @see Transition#interruptionBehavior
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public final class InterruptionBehavior
+ {
+ /**
+ * Specifies that a transition that interrupts another running
+ * transition ends that other transition before starting.
+ * The transition ends by calling the <code>end()</code> method
+ * on all effects in the transition.
+ * The <code>end()</code> method causes all effects
+ * to snap to their end state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const END:String = "end";
+
+ /**
+ * Specifies that a transition that interrupts another running
+ * transition stops that other transition in place before starting.
+ * The transition stops by calling the <code>stop()</code> method
+ * on all effects in the transition.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const STOP:String = "stop";
+ }
+}
\ 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/states/OverrideBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/OverrideBase.as b/frameworks/projects/MX/src/main/flex/mx/states/OverrideBase.as
new file mode 100644
index 0000000..b34ad52
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/OverrideBase.as
@@ -0,0 +1,222 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import mx.binding.BindingManager;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.events.PropertyChangeEvent;
+import mx.utils.OnDemandEventDispatcher;
+
+/**
+ * The OverrideBase class is the base class for the
+ * override classes used by view states.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class OverrideBase extends OnDemandEventDispatcher implements IOverride
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function OverrideBase() {}
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Flag which tracks if we're actively overriding a property.
+ */
+ protected var applied:Boolean = false;
+
+ /**
+ * @private
+ * Our most recent parent context.
+ */
+ protected var parentContext:UIComponent;
+
+ /**
+ * @private
+ */
+ private var targetProperty:String;
+
+ /**
+ * @private
+ * Specifies whether or not a property-centric
+ * state override's base value is data bound.
+ *
+ * This value is intended for use by the MXML
+ * compiler only.
+ */
+ public var isBaseValueDataBound:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * IOverride interface method; this class implements it as an empty method.
+ *
+ * @copy IOverride#initialize()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function initialize():void {}
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function apply(parent:UIComponent):void {}
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function remove(parent:UIComponent):void {}
+
+ /**
+ * @private
+ * Initialize this object from a descriptor.
+ */
+ public function initializeFromObject(properties:Object):Object
+ {
+ for (var p:String in properties)
+ {
+ this[p] = properties[p];
+ }
+
+ return Object(this);
+ }
+
+ /**
+ * @private
+ * @param parent The document level context for this override.
+ * @param target The component level context for this override.
+ */
+ protected function getOverrideContext(target:Object, parent:UIComponent):Object
+ {
+ if (target == null)
+ return parent;
+
+ if (target is String)
+ return parent[target];
+
+ return target;
+ }
+
+ /**
+ * @private
+ * If the target of our override is a String (representing a property),
+ * we register a PROPERTY_CHANGE listener to determine when/if our target
+ * context becomes available or changes.
+ */
+ protected function addContextListener(target:Object):void
+ {
+ if (target is String && parentContext != null)
+ {
+ targetProperty = target as String;
+ parentContext.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+ context_propertyChangeHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Unregister our PROPERTY_CHANGE listener.
+ */
+ protected function removeContextListener():void
+ {
+ if (parentContext != null)
+ {
+ parentContext.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+ context_propertyChangeHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Called when our target context is set. We re-apply our override
+ * if appropriate.
+ */
+ protected function context_propertyChangeHandler(event:PropertyChangeEvent):void
+ {
+ if (event.property == targetProperty && event.newValue != null)
+ {
+ apply(parentContext);
+ removeContextListener();
+ }
+ }
+
+ /**
+ * @private
+ * Disables or enables binding associated with a property override.
+ */
+ protected function enableBindings(target:Object, parent:UIComponent, property:String, enable:Boolean=true):void
+ {
+ if (isBaseValueDataBound && target && parent && property)
+ {
+ var document:Object = target.hasOwnProperty("document") ? target.document : null;
+ document = !document && parent.hasOwnProperty("document") ? parent.document : document;
+
+ var name:String = target.hasOwnProperty("id") ? target.id : null;
+ name = !name && target.hasOwnProperty("name") ? target.name : name;
+
+ if (document && name)
+ {
+ var root:String = (document == target) ? "this" : name;
+ BindingManager.enableBindings(document, root + "." + property, enable);
+ }
+ }
+ }
+}
+
+}
\ 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/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
new file mode 100644
index 0000000..6d3f6d0
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/RemoveChild.as
@@ -0,0 +1,211 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ *
+ * The RemoveChild class removes a child display object, such as a component,
+ * from a container as part of a view state.
+ * The child is only removed from the display list, it is not deleted.
+ * You use this class in the <code>overrides</code> property of the State class.
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:RemoveChild></code> tag
+ * has the following attributes:</p>
+ *
+ * <pre>
+ * <mx:RemoveChild
+ * <b>Properties</b>
+ * target="null"
+ * />
+ * </pre>
+ *
+ * @see mx.states.State
+ * @see mx.states.AddChild
+ * @see mx.states.Transition
+ * @see mx.effects.RemoveChildAction
+ *
+ * @includeExample examples/StatesExample.mxml
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class RemoveChild extends OverrideBase
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param target The child to remove from the view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function RemoveChild(target:DisplayObject = null)
+ {
+ super();
+
+ this.target = target;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Parent of the removed child.
+ */
+ private var oldParent:DisplayObjectContainer;
+
+ /**
+ * @private
+ * Index of the removed child.
+ */
+ private var oldIndex:int;
+
+ /**
+ * @private
+ */
+ private var removed:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The child to remove from the view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var target:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function apply(parent:UIComponent):void
+ {
+ parentContext = parent;
+ removed = false;
+
+ var obj:* = getOverrideContext(target, parent);
+ if ((obj is DisplayObject) && obj.parent)
+ {
+ oldParent = obj.parent;
+ oldIndex = oldParent.getChildIndex(obj);
+ oldParent.removeChild(obj);
+ removed = true;
+ }
+ else if (obj == null && !applied)
+ {
+ // Our target context is unavailable so we attempt to register
+ // a listener on our parent document to detect when/if it becomes
+ // valid.
+ addContextListener(target);
+ }
+
+ // Save state in case our value or target is changed while applied. This
+ // can occur when our value property is databound or when a target is
+ // deferred instantiated.
+ applied = true;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function remove(parent:UIComponent):void
+ {
+ var obj:* = getOverrideContext(target, parent);
+ if (removed && (obj is DisplayObject))
+ {
+ oldParent.addChildAt(obj, oldIndex);
+
+ // Make sure any changes made while the child was removed are reflected
+ // properly.
+ if (obj is UIComponent)
+ UIComponent(target).updateCallbacks();
+
+ removed = false;
+ }
+ else if (obj == null)
+ {
+ // It seems our override is no longer active, but we were never
+ // able to successfully apply ourselves, so remove our context
+ // listener if applicable.
+ removeContextListener();
+ }
+
+ // Clear our flags and override context.
+ applied = false;
+ parentContext = null;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..53f5fde
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/SetEventHandler.as
@@ -0,0 +1,398 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import org.apache.flex.events.EventDispatcher;
+import flash.utils.Dictionary;
+import mx.core.ComponentDescriptor;
+import mx.core.UIComponent;
+import mx.states.OverrideBase;
+import mx.core.IStateClient2;
+
+/**
+ * The event handler function to execute in response to the event that is
+ * specified by the <code>name</code> property.
+ *
+ * <p>Do not specify the <code>handler</code> property and the <code>handlerFunction</code>
+ * property in a single <code><mx:SetEventHandler></code> tag.</p>
+ *
+ * <p>Flex does <i>not</i> dispatch a <code>handler</code> event.
+ * You use the <code>handler</code> key word only as an MXML attribte.
+ * When you use the <code>handler</code> handler attribute, you can specify a
+ * method that takes multiple parameters, not just the Event object;
+ * also, you can specify the handler code in-line in the MXML tag.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="handler", type="Object")]
+
+/**
+ * The SetEventHandler class specifies an event handler that is active
+ * only during a particular view state.
+ * For example, you might define a Button control that uses one event handler
+ * in the base view state, but uses a different event handler when you change view state.
+ *
+ * <p> You use this class in the <code>overrides</code> property of the State class.</p>
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:SetEventHanlder></code> tag
+ * has the following attributes:</p>
+ *
+ * <pre>
+ * <mx:SetEventHandler
+ * <b>Properties</b>
+ * name="null"
+ * handlerFunction="null"
+ * target="null"
+ *
+ * <b>Events</b>
+ * handler=<i>No default</i>
+ * />
+ * </pre>
+ *
+ * @see mx.states.State
+ * @see mx.states.SetProperty
+ * @see mx.states.SetStyle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class SetEventHandler extends OverrideBase
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param target The object that dispatches the event to be handled.
+ * By default, Flex uses the immediate parent of the State object.
+ *
+ * @param event The event type for which to set the handler.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function SetEventHandler(
+ target:EventDispatcher = null,
+ name:String = null)
+ {
+ super();
+
+ this.target = target;
+ this.name = name;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Storage for the old event handler value.
+ */
+ private var oldHandlerFunction:Function;
+
+ /**
+ * @private
+ * Dictionary of installed event handlers.
+ */
+ private static var installedHandlers:Dictionary;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // name
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The name of the event whose handler is being set.
+ * You must set this property, either in
+ * the SetEventHandler constructor or by setting
+ * the property value directly.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var name:String;
+
+ /**
+ * The handler function for the event.
+ * This property is intended for developers who use ActionScript to
+ * create and access view states.
+ * In MXML, you can use the equivalent <code>handler</code>
+ * event attribute; do not use both in a single MXML tag.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var handlerFunction:Function;
+
+ /**
+ * The handler function to remove prior to applying our override.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4.5
+ */
+ public var originalHandlerFunction:Function;
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The component that dispatches the event.
+ * If the property value is <code>null</code>, Flex uses the
+ * immediate parent of the <code><mx:states></code> tag.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var target:Object;
+
+ /**
+ * The cached target for which we applied our override.
+ * We keep track of the applied target while applied since
+ * our target may be swapped out in the owning document and
+ * we want to make sure we roll back the correct (original)
+ * element.
+ *
+ * @private
+ */
+ private var appliedTarget:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: EventDispatcher
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ override public function addEventListener(
+ type:String, listener:Function,
+ useCapture:Boolean = false,
+ priority:int = 0,
+ useWeakReference:Boolean = false):void
+ {
+ if (type == "handler")
+ handlerFunction = listener;
+
+ super.addEventListener(type, listener, useCapture,
+ priority, useWeakReference);
+ }
+
+ COMPILE::JS
+ override public function addEventListener(
+ type:String, listener:Function,
+ useCapture:Boolean = false):void
+ {
+ if (type == "handler")
+ handlerFunction = listener;
+
+ super.addEventListener(type, listener, useCapture);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function apply(parent:UIComponent):void
+ {
+ parentContext = parent;
+ var obj:* = getOverrideContext(target, parent);
+ if (obj != null)
+ {
+ appliedTarget = obj;
+ var uiObj:UIComponent = obj as UIComponent;
+
+ if (!installedHandlers)
+ installedHandlers = new Dictionary(true);
+
+ // Remember the current handler so it can be restored
+ if (installedHandlers[obj] && installedHandlers[obj][name])
+ {
+ oldHandlerFunction = installedHandlers[obj][name];
+ obj.removeEventListener(name, oldHandlerFunction);
+ }
+ else if (originalHandlerFunction != null)
+ {
+ oldHandlerFunction = originalHandlerFunction;
+ obj.removeEventListener(name, oldHandlerFunction);
+ }
+ else if (uiObj && uiObj.descriptor)
+ {
+ var descriptor:ComponentDescriptor = uiObj.descriptor;
+
+ if (descriptor.events && descriptor.events[name])
+ {
+ oldHandlerFunction = uiObj.document[descriptor.events[name]];
+ obj.removeEventListener(name, oldHandlerFunction);
+ }
+ }
+
+ // Set new handler as weak reference
+ if (handlerFunction != null)
+ {
+ obj.addEventListener(name, handlerFunction, false, 0, true);
+
+ // Add this handler to our installedHandlers list so it can
+ // be removed if needed by a state based on this state. We
+ // only do so for legacy MXML documents that support hierarchical
+ // states.
+ if (!(parent.document is IStateClient2))
+ {
+ if (installedHandlers[obj] == undefined)
+ installedHandlers[obj] = {};
+
+ installedHandlers[obj][name] = handlerFunction;
+ }
+
+ // Disable bindings for the base event handler if appropriate. If the binding
+ // fires while our override is applied, the correct value will automatically
+ // be applied when the binding is later enabled.
+ enableBindings(obj, parent, name, false);
+ }
+ }
+ else if (!applied)
+ {
+ // Our target context is unavailable so we attempt to register
+ // a listener on our parent document to detect when/if it becomes
+ // valid.
+ addContextListener(target);
+ }
+
+ // Save state in case our value or target is changed while applied. This
+ // can occur when our value property is databound or when a target is
+ // deferred instantiated.
+ applied = true;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function remove(parent:UIComponent):void
+ {
+ var obj:* = getOverrideContext(appliedTarget, parent);
+ if (obj != null && appliedTarget)
+ {
+ if (handlerFunction != null)
+ obj.removeEventListener(name, handlerFunction);
+
+ // Restore the old value
+ if (oldHandlerFunction != null)
+ obj.addEventListener(name, oldHandlerFunction, false, 0, true);
+
+ if (installedHandlers[obj])
+ {
+ var deleteObj:Boolean = true;
+
+ // Remove this handler
+ delete installedHandlers[obj][name];
+
+ // If no other handlers are installed for this object, delete
+ // this object from the installedHandlers dictionary
+ for (var i:String in installedHandlers[obj])
+ {
+ // Found one - don't delete this object
+ deleteObj = false;
+ break;
+ }
+
+ if (deleteObj)
+ delete installedHandlers[obj];
+ }
+
+ // Re-enable bindings for the base event handler if appropriate. If the binding
+ // fired while our override was applied, the current value will automatically
+ // be applied once enabled.
+ enableBindings(obj, parent, name);
+ }
+ else
+ {
+ // It seems our override is no longer active, but we were never
+ // able to successfully apply ourselves, so remove our context
+ // listener if applicable.
+ removeContextListener();
+ }
+
+ // Clear our flags and override context.
+ applied = false;
+ parentContext = null;
+ appliedTarget = null;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/SetProperty.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/SetProperty.as b/frameworks/projects/MX/src/main/flex/mx/states/SetProperty.as
new file mode 100644
index 0000000..243c1bd
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/SetProperty.as
@@ -0,0 +1,492 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import mx.core.FlexVersion;
+import mx.core.IDeferredInstance;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.utils.ObjectUtil;
+
+use namespace mx_internal;
+
+/**
+ * The SetProperty class specifies a property value that is in effect only
+ * during the parent view state.
+ * You use this class in the <code>overrides</code> property of the State class.
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:SetProperty></code> tag
+ * has the following attributes:</p>
+ *
+ * <pre>
+ * <mx:SetProperty
+ * <b>Properties</b>
+ * name="null"
+ * target="null"
+ * value="undefined"
+ * />
+ * </pre>
+ *
+ * @see mx.states.State
+ * @see mx.states.SetEventHandler
+ * @see mx.states.SetStyle
+ * @see mx.effects.SetPropertyAction
+ *
+ * @includeExample examples/StatesExample.mxml
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class SetProperty extends OverrideBase
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This is a table of pseudonyms.
+ * Whenever the property being overridden is found in this table,
+ * the pseudonym is saved/restored instead.
+ */
+ private static const PSEUDONYMS:Object =
+ {
+ width: "explicitWidth",
+ height: "explicitHeight",
+ currentState: "currentStateDeferred"
+ };
+
+ /**
+ * @private
+ * This is a table of related properties.
+ * Whenever the property being overridden is found in this table,
+ * the related property is also saved and restored.
+ */
+ private static const RELATED_PROPERTIES:Object =
+ {
+ explicitWidth: [ "percentWidth" ],
+ explicitHeight: [ "percentHeight" ],
+ percentWidth: [ "explicitWidth" ],
+ percentHeight: [ "explicitHeight" ]
+ };
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param target The object whose property is being set.
+ * By default, Flex uses the immediate parent of the State object.
+ *
+ * @param name The property to set.
+ *
+ * @param value The value of the property in the view state.
+ *
+ * @param valueFactory An optional write-only property from which to obtain
+ * a shared value. This is primarily used when this override's value is
+ * shared by multiple states or state groups.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function SetProperty(
+ target:Object = null,
+ name:String = null,
+ value:* = undefined,
+ valueFactory:IDeferredInstance = null)
+ {
+ super();
+
+ this.target = target;
+ this.name = name;
+ this.value = value;
+ this.valueFactory = valueFactory;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Storage for the old property value.
+ */
+ private var oldValue:Object;
+
+ /**
+ * @private
+ * Storage for the old related property values, if used.
+ */
+ private var oldRelatedValues:Array;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // name
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The name of the property to change.
+ * You must set this property, either in
+ * the SetProperty constructor or by setting
+ * the property value directly.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var name:String;
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The object containing the property to be changed.
+ * If the property value is <code>null</code>, Flex uses the
+ * immediate parent of the State object.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var target:Object;
+
+ /**
+ * The cached target for which we applied our override.
+ * We keep track of the applied target while applied since
+ * our target may be swapped out in the owning document and
+ * we want to make sure we roll back the correct (original)
+ * element.
+ *
+ * @private
+ */
+ private var appliedTarget:Object;
+
+ //----------------------------------
+ // value
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * @private
+ * Storage for the value property.
+ */
+ public var _value:*;
+
+ /**
+ * The new value for the property.
+ *
+ * @default undefined
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get value():*
+ {
+ return _value;
+ }
+
+ /**
+ * @private
+ */
+ public function set value(val:*):void
+ {
+ _value = val;
+
+ // Reapply if necessary.
+ if (applied)
+ {
+ apply(parentContext);
+ }
+ }
+
+ //----------------------------------
+ // valueFactory
+ //----------------------------------
+
+ /**
+ * An optional write-only property from which to obtain a shared value. This
+ * is primarily used when this override's value is shared by multiple states
+ * or state groups.
+ *
+ * @default undefined
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ public function set valueFactory(factory:IDeferredInstance):void
+ {
+ // We instantiate immediately in order to retain the instantiation
+ // behavior of a typical (unshared) value. We may later enhance to
+ // allow for deferred instantiation.
+ if (factory)
+ value = factory.getInstance();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: IOverride
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Utility function to return the pseudonym of the property
+ * name if it exists on the object
+ */
+ private function getPseudonym(obj:*, name:String):String
+ {
+ var propName:String;
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ return (PSEUDONYMS[name] in obj) ?
+ PSEUDONYMS[name] :
+ name;
+ propName = PSEUDONYMS[name];
+ if (!(propName in obj))
+ {
+ if (ObjectUtil.isDynamicObject(obj))
+ {
+ // If this is a dynamic object we fall back immediately
+ // to our original property name.
+ propName = name;
+ }
+ else
+ {
+ // 'in' does not work for mx_internal properties
+ // like currentStateDeferred
+ try
+ {
+ // Check if we can access the property; if it doesn't
+ // exist, it'll throw a ReferenceError
+ var tmp:* = obj[propName];
+ }
+ catch (e:ReferenceError)
+ {
+ propName = name;
+ }
+ }
+ }
+ return propName;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function apply(parent:UIComponent):void
+ {
+ parentContext = parent;
+ var obj:* = getOverrideContext(target, parent);
+ if (obj != null)
+ {
+ appliedTarget = obj;
+ var propName:String = PSEUDONYMS[name] ? getPseudonym(obj, name) : name;
+
+ var relatedProps:Array = RELATED_PROPERTIES[propName] ?
+ RELATED_PROPERTIES[propName] :
+ null;
+
+ var newValue:* = value;
+
+ // Remember the original value so it can be restored later
+ // after we are asked to remove our override (and only if we
+ // aren't being asked to re-apply a value).
+ if (!applied)
+ {
+ oldValue = obj[propName];
+ }
+
+ if (relatedProps)
+ {
+ oldRelatedValues = [];
+
+ for (var i:int = 0; i < relatedProps.length; i++)
+ oldRelatedValues[i] = obj[relatedProps[i]];
+ }
+
+ // Special case for width and height. If they are percentage values,
+ // set the percentWidth/percentHeight instead.
+ if (name == "width" || name == "height")
+ {
+ if (newValue is String && newValue.indexOf("%") >= 0)
+ {
+ propName = name == "width" ? "percentWidth" : "percentHeight";
+ newValue = newValue.slice(0, newValue.indexOf("%"));
+ }
+ else
+ {
+ // Need to set width/height instead of explicitWidth/explicitHeight
+ // otherwise width/height are out of sync until the target is validated.
+ propName = name;
+ }
+ }
+
+ // Set new value
+ setPropertyValue(obj, propName, newValue, oldValue);
+
+ // Disable bindings for the base property if appropriate. If the binding
+ // fires while our override is applied, the correct value will automatically
+ // be applied when the binding is later enabled.
+ enableBindings(obj, parent, propName, false);
+ }
+ else if (!applied)
+ {
+ // Our target context is unavailable so we attempt to register
+ // a listener on our parent document to detect when/if it becomes
+ // valid.
+ addContextListener(target);
+ }
+
+ // Save state in case our value or target is changed while applied. This
+ // can occur when our value property is databound or when a target is
+ // deferred instantiated.
+ applied = true;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function remove(parent:UIComponent):void
+ {
+ var obj:* = getOverrideContext(appliedTarget, parent);
+ if (obj != null && appliedTarget)
+ {
+ var propName:String = PSEUDONYMS[name] ? getPseudonym(obj, name) : name;
+
+ var relatedProps:Array = RELATED_PROPERTIES[propName] ?
+ RELATED_PROPERTIES[propName] :
+ null;
+
+ // Special case for width and height. Restore the "width" and
+ // "height" properties instead of explicitWidth/explicitHeight
+ // so they can be kept in sync.
+ if ((name == "width" || name == "height") && !isNaN(Number(oldValue)))
+ {
+ propName = name;
+ }
+
+ // Restore the old value
+ setPropertyValue(obj, propName, oldValue, oldValue);
+
+ // Re-enable bindings for the base property if appropriate. If the binding
+ // fired while our override was applied, the current value will automatically
+ // be applied once enabled.
+ enableBindings(obj, parent, propName);
+
+ // Restore related value, if needed
+ if (relatedProps)
+ {
+ for (var i:int = 0; i < relatedProps.length; i++)
+ {
+ setPropertyValue(obj, relatedProps[i],
+ oldRelatedValues[i], oldRelatedValues[i]);
+ }
+ }
+ }
+ else
+ {
+ // It seems our override is no longer active, but we were never
+ // able to successfully apply ourselves, so remove our context
+ // listener if applicable.
+ removeContextListener();
+ }
+
+ // Clear our flags and override context.
+ applied = false;
+ parentContext = null;
+ appliedTarget = null;
+ }
+
+ /**
+ * @private
+ * Sets the property to a value, coercing if necessary.
+ */
+ private function setPropertyValue(obj:Object, name:String, value:*,
+ valueForType:Object):void
+ {
+ // special-case undefined and null: we don't want to cast it
+ // to some special type and lose that information
+ if (value === undefined || value === null)
+ obj[name] = value;
+ else if (valueForType is Number)
+ obj[name] = Number(value);
+ else if (valueForType is Boolean)
+ obj[name] = toBoolean(value);
+ else
+ obj[name] = value;
+ }
+
+ /**
+ * @private
+ * Converts a value to a Boolean true/false.
+ */
+ private function toBoolean(value:Object):Boolean
+ {
+ if (value is String)
+ return value.toLowerCase() == "true";
+
+ return value != false;
+ }
+}
+
+}
[07/37] git commit: [flex-asjs] [refs/heads/spark] - handle Flash
rectangles when on Flash
Posted by ah...@apache.org.
handle Flash rectangles when on Flash
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/190a653c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/190a653c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/190a653c
Branch: refs/heads/spark
Commit: 190a653cc0cc8aa815643fa61eb0d6656e9455d3
Parents: a99793c
Author: Alex Harui <ah...@apache.org>
Authored: Fri Feb 12 15:03:39 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Feb 12 15:03:39 2016 -0800
----------------------------------------------------------------------
.../flex/org/apache/flex/utils/PointUtils.as | 85 ++++++++++----------
1 file changed, 42 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/190a653c/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
index 09c88b4..d9e9c23 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
@@ -58,33 +58,32 @@ package org.apache.flex.utils
* @productversion FlexJS 0.0
* @flexjsignorecoercion HTMLElement
*/
- public static function globalToLocal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
+ COMPILE::AS3
+ public static function globalToLocal( pt:flash.geom.Point, local:Object ):org.apache.flex.geom.Point
{
- COMPILE::AS3
- {
- var fpt:flash.geom.Point = DisplayObject(local).globalToLocal(pt);
- return new org.apache.flex.geom.Point(fpt.x, fpt.y);
- }
- COMPILE::JS
- {
- var x:Number = pt.x;
- var y:Number = pt.y;
- var element:HTMLElement = local.element as HTMLElement;
-
- do {
- x -= element.offsetLeft;
- y -= element.offsetTop;
- if (local.hasOwnProperty('parent')) {
- local = local.parent;
- element = local.element as HTMLElement;
- } else {
- element = null;
- }
- }
- while (element);
- return new org.apache.flex.geom.Point(x, y);
+ var fpt:flash.geom.Point = DisplayObject(local).globalToLocal(pt);
+ return new org.apache.flex.geom.Point(fpt.x, fpt.y);
+ }
+ COMPILE::JS
+ public static function globalToLocal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
+ {
+ var x:Number = pt.x;
+ var y:Number = pt.y;
+ var element:HTMLElement = local.element as HTMLElement;
+
+ do {
+ x -= element.offsetLeft;
+ y -= element.offsetTop;
+ if (local.hasOwnProperty('parent')) {
+ local = local.parent;
+ element = local.element as HTMLElement;
+ } else {
+ element = null;
+ }
}
+ while (element);
+ return new org.apache.flex.geom.Point(x, y);
}
/**
@@ -99,27 +98,27 @@ package org.apache.flex.utils
* @productversion FlexJS 0.0
* @flexjsignorecoercion HTMLElement
*/
- public static function localToGlobal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
+ COMPILE::AS3
+ public static function localToGlobal( pt:flash.geom.Point, local:Object ):org.apache.flex.geom.Point
{
- COMPILE::AS3
- {
- var fpt:flash.geom.Point = DisplayObject(local).localToGlobal(pt);
- return new org.apache.flex.geom.Point(fpt.x, fpt.y);
- }
- COMPILE::JS
- {
- var x:Number = pt.x;
- var y:Number = pt.y;
- var element:HTMLElement = local.element as HTMLElement;
-
- do {
- x += element.offsetLeft;
- y += element.offsetTop;
- element = element.offsetParent as HTMLElement;
- }
- while (element);
- return new org.apache.flex.geom.Point(x, y);
+ var fpt:flash.geom.Point = DisplayObject(local).localToGlobal(pt);
+ return new org.apache.flex.geom.Point(fpt.x, fpt.y);
+ }
+
+ COMPILE::JS
+ public static function localToGlobal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
+ {
+ var x:Number = pt.x;
+ var y:Number = pt.y;
+ var element:HTMLElement = local.element as HTMLElement;
+
+ do {
+ x += element.offsetLeft;
+ y += element.offsetTop;
+ element = element.offsetParent as HTMLElement;
}
+ while (element);
+ return new org.apache.flex.geom.Point(x, y);
}
}
}
[19/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManagerImpl.as b/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManagerImpl.as
new file mode 100644
index 0000000..c36f918
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManagerImpl.as
@@ -0,0 +1,1430 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.resources
+{
+
+import mx.events.FocusEvent;
+
+import org.apache.flex.core.CallLaterBead;
+import org.apache.flex.events.Event;
+import org.apache.flex.events.EventDispatcher;
+import flex.system.DefinitionManager;
+import flex.system.I18NManager;
+COMPILE::AS3
+{
+ import flash.system.ApplicationDomain;
+}
+COMPILE::LATER
+{
+ import org.apache.flex.events.IEventDispatcher;
+ import flex.events.TimerEvent;
+ import flash.system.Capabilities;
+ import flash.system.SecurityDomain;
+ import flash.utils.Dictionary;
+}
+import org.apache.flex.utils.Timer;
+import mx.core.IFlexModuleFactory;
+import mx.core.mx_internal;
+import mx.core.Singleton;
+import mx.events.FlexEvent;
+import mx.events.ModuleEvent;
+import mx.events.ResourceEvent;
+import mx.managers.SystemManagerGlobals;
+import mx.modules.IModuleInfo;
+import mx.modules.ModuleManager;
+import mx.utils.StringUtil;
+import org.apache.flex.core.UIBase;
+
+use namespace mx_internal;
+
+/**
+ * @copy mx.resources.IResourceManager#change
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="change", type="flash.events.Event")]
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This class provides an implementation of the IResourceManager interface.
+ * The IResourceManager and IResourceBundle interfaces work together
+ * to provide internationalization support for Flex applications.
+ *
+ * <p>A single instance of this class manages all localized resources
+ * for a Flex application.</p>
+ *
+ * @see mx.resources.IResourceManager
+ * @see mx.resources.IResourceBundle
+ */
+public class ResourceManagerImpl extends EventDispatcher implements IResourceManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The sole instance of the ResourceManager.
+ */
+ private static var instance:IResourceManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the single instance of the ResourceManagerImpl class.
+ * This object manages all localized resources for a Flex application.
+ *
+ * @return An object implementing IResourceManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getInstance():IResourceManager
+ {
+ if (!instance)
+ instance = new ResourceManagerImpl();
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ResourceManagerImpl()
+ {
+ super();
+
+ if (SystemManagerGlobals.topLevelSystemManagers.length)
+ {
+ if (SystemManagerGlobals.topLevelSystemManagers[0].currentFrame == 1)
+ {
+ ignoreMissingBundles = true;
+ inFrame1 = true;
+ var topSM:UIBase = SystemManagerGlobals.topLevelSystemManagers[0] as UIBase;
+ if (topSM.getBeadByType(CallLaterBead) == null)
+ topSM.addBead(new CallLaterBead());
+ var clb:CallLaterBead = topSM.getBeadByType(CallLaterBead) as CallLaterBead;
+ clb.callLater(enterFrameHandler, null, this);
+ }
+ }
+
+ var info:Object = SystemManagerGlobals.info;
+ // Falcon injects this property and it is always false
+ // We ignore missing bundles because Falcon doesn't
+ // generate fallback bundles like MXMLC;
+ if (!inFrame1)
+ ignoreMissingBundles = info && info.hasOwnProperty("isMXMLC");
+
+ if (info)
+ processInfo(info, false);
+
+ ignoreMissingBundles = info && info.hasOwnProperty("isMXMLC");
+
+ if (SystemManagerGlobals.topLevelSystemManagers.length)
+ SystemManagerGlobals.topLevelSystemManagers[0].
+ addEventListener(FlexEvent.NEW_CHILD_APPLICATION, newChildApplicationHandler);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ *
+ * Whether or ignoreMissingBundles was set in frame 1
+ */
+ private var inFrame1:Boolean = false;
+
+ /**
+ * @private
+ *
+ * Whether or not to throw an error.
+ */
+ private var ignoreMissingBundles:Boolean = false;
+
+ /**
+ * @private
+ *
+ * The dictionary to hold all of the weak reference resource bundles.
+ */
+ COMPILE::LATER
+ private var bundleDictionary:Dictionary;
+
+ /**
+ * @private
+ * A map whose keys are locale strings like "en_US"
+ * and whose values are "bundle maps".
+ * A bundle map is a map whose keys are bundle names
+ * like "SharedResources" and whose values are ResourceBundle instances.
+ * You can get to an individual resource value like this:
+ * localeMap["en_US"]["SharedResources"].content["currencySymbol"]
+ */
+ private var localeMap:Object = {};
+
+ /**
+ * @private
+ * A map whose keys are URLs for resource modules that have been loaded
+ * and whose values are ResourceModuleInfo instances for those modules.
+ */
+ private var resourceModules:Object = {};
+
+ /**
+ * @private
+ */
+ private var initializedForNonFrameworkApp:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // localeChain
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the localeChain property.
+ */
+ private var _localeChain:Array /* of String */;
+
+ /**
+ * @copy mx.resources.IResourceManager#localeChain
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get localeChain():Array /* of String */
+ {
+ return _localeChain;
+ }
+
+ /**
+ * @private
+ */
+ public function set localeChain(value:Array /* of String */):void
+ {
+ _localeChain = value;
+
+ update();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This method is called by the SystemManager class of an Application
+ * when the application starts.
+ * It is also called by the FlexModuleFactory class of a code module
+ * when that module gets loaded.
+ *
+ * The MXML compiler autogenerated code which set the
+ * "compiledLocales" and "compiledResourceBundleNames" properties
+ * of the info() Object required by the IFlexModuleFactory
+ * interface that these classes implement.
+ * These two properties together indicate which resource bundle
+ * classes the MXML compiler autogenerated and linked into the
+ * application or module.
+ *
+ * The "compiledLocales" property has been set to the locales
+ * which were specified at compile time using the -locale option.
+ * For example, if you compile with -locale=en_US,ja_JP
+ * then the "compiledLocales" property is the array [ "en_US", "ja_JP" ].
+ *
+ * The "compiledResourceBundleNames" property has been set
+ * to the names of the resource bundles which are used by
+ * the application or module, as determined by the compiler
+ * from [ResourceBundle] metadata and ~~Resource() directives.
+ * For example, if the classes in the application or module
+ * declare that they use resource bundles named "core" and "MyApp",
+ * then the "compiledResourceBundleNames" property is the array
+ * [ "core", "MyApp" ].
+ *
+ * The compiler autogenerated a ResourceBundle subclass for each
+ * (locale, bundle name) pair.
+ * For example, with the above locales and bundle names,
+ * there would be four classes:
+ * en_US$core_properties
+ * en_US$MyApp_properties
+ * ja_JP$core_properties
+ * ja_JP$MyApp_properties
+ *
+ * This method creates one instance of each such class
+ * and installs it into the ResourceManager with addResourceBundle().
+ * If a bundle for a given locale and bundle name already exists
+ * in the ResourceManager already exists, it does not get replaced.
+ * This can happen when a code module gets loaded into an application.
+ *
+ * When sub-applications and modules install their resource bundles
+ * they set useWeakReference = true. Any new resource bundles they
+ * create will be weak referenced by the ResourceManager. The
+ * sub-application or module will then provide a hard reference
+ * to the returned Array of resource bundles to keep them from
+ * being garbage collected.
+ */
+ public function installCompiledResourceBundles(
+ applicationDomain:DefinitionManager,
+ locales:Array /* of String */,
+ bundleNames:Array /* of String */,
+ useWeakReference:Boolean = false):Array
+ {
+ //trace("locales", locales);
+ //trace("bundleNames", bundleNames);
+ var bundles:Array = [];
+ var bundleCount:uint = 0;
+ var n:int = locales ? locales.length : 0;
+ var m:int = bundleNames ? bundleNames.length : 0;
+
+ // Loop over the locales.
+ for (var i:int = 0; i < n; i++)
+ {
+ var locale:String = locales[i];
+
+ // Loop over the bundle names.
+ for (var j:int = 0; j < m; j++)
+ {
+ var bundleName:String = bundleNames[j];
+
+ var bundle:IResourceBundle = installCompiledResourceBundle(
+ applicationDomain, locale, bundleName,
+ useWeakReference);
+
+ if (bundle)
+ bundles[bundleCount++] = bundle;
+ }
+ }
+
+ return bundles;
+ }
+
+ /**
+ * @private
+ */
+ private function installCompiledResourceBundle(
+ applicationDomain:DefinitionManager,
+ locale:String, bundleName:String,
+ useWeakReference:Boolean = false):IResourceBundle
+ {
+ var packageName:String = null;
+ var localName:String = bundleName;
+ var colonIndex:int = bundleName.indexOf(":");
+ if (colonIndex != -1)
+ {
+ packageName = bundleName.substring(0, colonIndex);
+ localName = bundleName.substring(colonIndex + 1);
+ }
+
+ // If a bundle with that locale and bundle name already exists
+ // in the ResourceManager, don't replace it.
+ // If we want to install a weakReferenceDictionary then don't rely on
+ // a weak reference dictionary because it may go way when the
+ // application goes away.
+ var resourceBundle:IResourceBundle = getResourceBundleInternal(locale,
+ bundleName,
+ useWeakReference);
+ if (resourceBundle)
+ return resourceBundle;
+
+ // The autogenerated resource bundle classes produced by the
+ // mxmlc and compc compilers have names that incorporate
+ // the locale and bundle name, such as "en_US$core_properties".
+ var resourceBundleClassName:String =
+ locale + "$" + localName + "_properties";
+ if (packageName != null)
+ resourceBundleClassName = packageName + "." + resourceBundleClassName;
+
+ // Find the bundle class by its name.
+ // We do a hasDefinition() check before calling getDefinition()
+ // because getDefinition() will throw an RTE
+ // if the class doesn't exist.
+ var bundleClass:Class = null;
+ if (applicationDomain.hasDefinition(resourceBundleClassName))
+ {
+ bundleClass = Class(applicationDomain.getDefinition(
+ resourceBundleClassName));
+ }
+
+ if (!bundleClass)
+ {
+ resourceBundleClassName = bundleName;
+ if (applicationDomain.hasDefinition(resourceBundleClassName))
+ {
+ bundleClass = Class(applicationDomain.getDefinition(
+ resourceBundleClassName));
+ }
+ }
+
+ // In case we linked against a Flex 2 SWC, look for the old
+ // class name.
+ if (!bundleClass)
+ {
+ resourceBundleClassName = bundleName + "_properties";
+ if (applicationDomain.hasDefinition(resourceBundleClassName))
+ {
+ bundleClass = Class(applicationDomain.getDefinition(
+ resourceBundleClassName));
+ }
+ }
+
+ if (!bundleClass)
+ {
+ if (ignoreMissingBundles)
+ return null;
+
+ throw new Error(
+ "Could not find compiled resource bundle '" + bundleName +
+ "' for locale '" + locale + "'.");
+ }
+
+ // Create a proxy
+ var proxy:ResourceBundleProxy = new ResourceBundleProxy();
+
+ proxy.bundleClass = bundleClass;
+ proxy.useWeakReference = useWeakReference;
+
+ // In case we just created a ResourceBundle from a Flex 2 SWC,
+ // set its locale and bundleName, because the old constructor
+ // didn't used to do this.
+ proxy.locale = locale;
+ proxy.bundleName = bundleName;
+
+ // Add that resource bundle instance to the ResourceManager.
+ resourceBundle = proxy;
+ addResourceBundle(resourceBundle, useWeakReference);
+
+ return resourceBundle;
+ }
+
+ // FocusEvent is used just so we can add a relatedObject
+ private function newChildApplicationHandler(event:FocusEvent):void
+ {
+ var info:Object = event.relatedObject["info"]();
+ var weakReference:Boolean = false;
+ if ("_resourceBundles" in event.relatedObject)
+ weakReference = true;
+
+ // If the application has a "_resourceBundles" object for us to put
+ // the bundles into then we will. Otherwise have the ResourceManager
+ // create a hard reference to the resources.
+ var bundles:Array = processInfo(info, weakReference);
+ if (weakReference)
+ event.relatedObject["_resourceBundles"] = bundles;
+ }
+
+ private function processInfo(info:Object, useWeakReference:Boolean):Array
+ {
+ var compiledLocales:Array = info["compiledLocales"];
+
+ ResourceBundle.locale =
+ compiledLocales != null && compiledLocales.length > 0 ?
+ compiledLocales[0] :
+ "en_US";
+
+ var applicationDomain:DefinitionManager = new DefinitionManager(info["currentDomain"]);
+
+ var compiledResourceBundleNames:Array /* of String */ =
+ info["compiledResourceBundleNames"];
+
+ var bundles:Array = installCompiledResourceBundles(
+ applicationDomain, compiledLocales, compiledResourceBundleNames,
+ useWeakReference);
+
+ // If the localeChain wasn't specified in the FlashVars of the SWF's
+ // HTML wrapper, or in the query parameters of the SWF URL,
+ // then initialize it to the list of compiled locales,
+ // sorted according to the system's preferred locales as reported by
+ // Capabilities.languages or Capabilities.language.
+ // For example, if the applications was compiled with, say,
+ // -locale=en_US,ja_JP and Capabilities.languages reports [ "ja-JP" ],
+ // set the localeChain to [ "ja_JP" "en_US" ].
+ if (!localeChain)
+ initializeLocaleChain(compiledLocales);
+
+ return bundles;
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#initializeLocaleChain()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function initializeLocaleChain(compiledLocales:Array):void
+ {
+ localeChain = LocaleSorter.sortLocalesByPreference(
+ compiledLocales, getSystemPreferredLocales(), null, true);
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#loadResourceModule()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function loadResourceModule(url:String, updateFlag:Boolean = true,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):
+ IEventDispatcher
+ {
+ var moduleInfo:IModuleInfo = ModuleManager.getModule(url);
+
+ // Create the per-load IEventDispatcher that we'll return.
+ var resourceEventDispatcher:ResourceEventDispatcher =
+ new ResourceEventDispatcher(moduleInfo);
+
+ // Set up a handler for the "ready" event from the module.
+ // We use a local Function rather than a method
+ // so that it can access the 'update' argument.
+ var readyHandler:Function = function(event:ModuleEvent):void
+ {
+ //trace("readyHandler");
+
+ var resourceModule:* = // IResourceModule
+ event.module.factory.create();
+
+ //dumpResourceModule(resourceModule);
+
+ resourceModules[event.module.url].resourceModule = resourceModule;
+
+ if (updateFlag)
+ update();
+ }
+ moduleInfo.addEventListener(ModuleEvent.READY, readyHandler,
+ false, 0, true);
+
+ // Set up a handler for the "error" event from the module.
+ // We use a local Function rather than a method
+ // for symmetry with the readyHandler.
+ var errorHandler:Function = function(event:ModuleEvent):void
+ {
+ var message:String = "Unable to load resource module from " + url;
+
+ if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR))
+ {
+ var resourceEvent:ResourceEvent = new ResourceEvent(
+ ResourceEvent.ERROR, event.bubbles, event.cancelable);
+ resourceEvent.bytesLoaded = 0;
+ resourceEvent.bytesTotal = 0;
+ resourceEvent.errorText = message;
+ resourceEventDispatcher.dispatchEvent(resourceEvent);
+ }
+ else
+ {
+ throw new Error(message);
+ }
+ }
+ moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler,
+ false, 0, true);
+
+ resourceModules[url] =
+ new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
+
+ // This Timer gives the loadResourceModules() caller a chance
+ // to add event listeners to the return value, before the module
+ // is loaded.
+ // We use a local Function for the timerHandler rather than a method
+ // so that it can access the 'moduleInfo' local var.
+ var timer:Timer = new Timer(0);
+ var timerHandler:Function = function(event:TimerEvent):void
+ {
+ timer.removeEventListener(TimerEvent.TIMER, timerHandler);
+ timer.stop();
+
+ //trace("loading");
+
+ // Start loading the module.
+ moduleInfo.load(applicationDomain, securityDomain);
+ }
+ timer.addEventListener(TimerEvent.TIMER, timerHandler,
+ false, 0, true);
+ timer.start();
+
+ return resourceEventDispatcher;
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#unloadResourceModule()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function unloadResourceModule(url:String, update:Boolean = true):void
+ {
+ // Get the resource module info.
+ var rmi:ResourceModuleInfo = resourceModules[url];
+ if (!rmi)
+ return;
+
+ if (rmi.resourceModule)
+ {
+ // Get the bundles in this module.
+ var bundles:Array = rmi.resourceModule.resourceBundles;
+ if (bundles)
+ {
+ var n:int = bundles.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ // Remove each bundle.
+ var locale:String = bundles[i].locale;
+ var bundleName:String = bundles[i].bundleName;
+ removeResourceBundle(locale, bundleName);
+ }
+ }
+ }
+
+ // Remove all links to the module.
+ resourceModules[url] = null;
+ delete resourceModules[url];
+
+ // Unload the module.
+ rmi.moduleInfo.unload();
+
+ // Update if necessary.
+ if (update)
+ this.update();
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#addResourceBundle()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addResourceBundle(resourceBundle:IResourceBundle,
+ useWeakReference:Boolean = false):void
+ {
+ var locale:String = resourceBundle.locale;
+ var bundleName:String = resourceBundle.bundleName;
+
+ if (!localeMap[locale])
+ localeMap[locale] = {};
+
+ COMPILE::LATER
+ {
+ if (useWeakReference)
+ {
+ if (!bundleDictionary)
+ {
+ bundleDictionary = new Dictionary(true);
+ }
+
+ bundleDictionary[resourceBundle] = locale + bundleName;
+ localeMap[locale][bundleName] = bundleDictionary;
+ }
+ }
+ //else
+ //{
+ localeMap[locale][bundleName] = resourceBundle;
+ //}
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#getResourceBundle()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getResourceBundle(locale:String,
+ bundleName:String):IResourceBundle
+ {
+ return getResourceBundleInternal(locale, bundleName, false);
+ }
+
+ /**
+ * @private
+ *
+ * @param ignoreWeakReferenceBundles if true, do not search weak
+ * reference bundles.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function getResourceBundleInternal(locale:String,
+ bundleName:String,
+ ignoreWeakReferenceBundles:Boolean):IResourceBundle
+ {
+ var bundleMap:Object = localeMap[locale];
+ if (!bundleMap)
+ return null;
+
+ var bundle:IResourceBundle = null;
+ var bundleObject:Object = bundleMap[bundleName];
+ COMPILE::LATER
+ {
+ if (bundleObject is Dictionary)
+ {
+ if (ignoreWeakReferenceBundles)
+ return null;
+
+ var localeBundleNameString:String = locale + bundleName;
+ for (var obj:Object in bundleObject)
+ {
+ if (bundleObject[obj] == localeBundleNameString)
+ {
+ if (obj is ResourceBundleProxy)
+ bundle = loadResourceBundleProxy(ResourceBundleProxy(obj));
+ else
+ bundle = obj as IResourceBundle;
+ break;
+ }
+ }
+ }
+ }
+ /* else */if (bundleObject is ResourceBundleProxy)
+ {
+ bundle = loadResourceBundleProxy(ResourceBundleProxy(bundleObject));
+ }
+ else
+ {
+ bundle = bundleObject as IResourceBundle;
+ }
+
+ return bundle;
+ }
+
+ private function loadResourceBundleProxy(proxy:ResourceBundleProxy):ResourceBundle {
+ var proxyClass:Class = proxy.bundleClass;
+ var resourceBundle:ResourceBundle = ResourceBundle(new proxyClass());
+ resourceBundle._locale = proxy.locale;
+ resourceBundle._bundleName = proxy.bundleName;
+
+ addResourceBundle(resourceBundle, proxy.useWeakReference);
+
+ return resourceBundle;
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#removeResourceBundle()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeResourceBundle(locale:String, bundleName:String):void
+ {
+ // Remove the specified bundle.
+ delete localeMap[locale][bundleName];
+
+ // If that leaves a locale node with no bundles,
+ // delete the locale node.
+ if (getBundleNamesForLocale(locale).length == 0)
+ delete localeMap[locale];
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#removeResourceBundlesForLocale()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeResourceBundlesForLocale(locale:String):void
+ {
+ delete localeMap[locale];
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#update()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function update():void
+ {
+ dispatchEvent(new Event(Event.CHANGE));
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#getLocales()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getLocales():Array /* of String */
+ {
+ var locales:Array = [];
+ for (var p:String in localeMap)
+ {
+ locales.push(p);
+ }
+ return locales;
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#getPreferredLocaleChain()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getPreferredLocaleChain():Array /* of String */
+ {
+ return LocaleSorter.sortLocalesByPreference(
+ getLocales(), getSystemPreferredLocales(), null, true);
+ }
+
+ /**
+ * @copy mx.resources.IResourceManager#getBundleNamesForLocale()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getBundleNamesForLocale(locale:String):Array /* of String */
+ {
+ var bundleNames:Array = [];
+ for (var p:String in localeMap[locale])
+ {
+ bundleNames.push(p);
+ }
+ return bundleNames;
+ }
+
+ /**
+ * @copy mx.resources.findResourceBundleWithResource
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function findResourceBundleWithResource(
+ bundleName:String, resourceName:String):IResourceBundle
+ {
+ if (!_localeChain)
+ return null;
+
+ var n:int = _localeChain.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var locale:String = localeChain[i];
+
+ var bundleMap:Object = localeMap[locale];
+ if (!bundleMap)
+ continue;
+
+ var bundleObject:Object = bundleMap[bundleName];
+ if (!bundleObject)
+ continue;
+
+ var bundle:IResourceBundle = null;
+
+ COMPILE::LATER
+ {
+ if (bundleObject is Dictionary)
+ {
+ var localeBundleNameString:String = locale + bundleName;
+ for (var obj:Object in bundleObject)
+ {
+ if (bundleObject[obj] == localeBundleNameString)
+ {
+ if (obj is ResourceBundleProxy)
+ bundle = loadResourceBundleProxy(ResourceBundleProxy(obj));
+ else
+ bundle = obj as IResourceBundle;
+ break;
+ }
+ }
+ }
+ }
+ /* else*/ if (bundleObject is ResourceBundleProxy)
+ {
+ bundle = loadResourceBundleProxy(ResourceBundleProxy(bundleObject));
+ }
+ else
+ {
+ bundle = bundleObject as IResourceBundle;
+ }
+
+ if (bundle && resourceName in bundle.content)
+ return bundle;
+ }
+
+ return null;
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getObject()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getObject(bundleName:String, resourceName:String,
+ locale:String = null):*
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return undefined;
+
+ return resourceBundle.content[resourceName];
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getString()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getString(bundleName:String, resourceName:String,
+ parameters:Array = null,
+ locale:String = null):String
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return null;
+
+ if(!(resourceName in resourceBundle.content))
+ return null;
+
+ var value:String = String(resourceBundle.content[resourceName]);
+
+ if (parameters)
+ value = StringUtil.substitute(value, parameters);
+
+ return value;
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getStringArray()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getStringArray(bundleName:String,
+ resourceName:String,
+ locale:String = null):Array /* of String */
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return null;
+
+ var value:* = resourceBundle.content[resourceName];
+
+ var array:Array = String(value).split(",");
+
+ var n:int = array.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ array[i] = StringUtil.trim(array[i]);
+ }
+
+ return array;
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getNumber()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getNumber(bundleName:String, resourceName:String,
+ locale:String = null):Number
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return NaN;
+
+ var value:* = resourceBundle.content[resourceName];
+
+ return Number(value);
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getInt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getInt(bundleName:String, resourceName:String,
+ locale:String = null):int
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return 0;
+
+ var value:* = resourceBundle.content[resourceName];
+
+ return int(value);
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getUint()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getUint(bundleName:String, resourceName:String,
+ locale:String = null):uint
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return 0;
+
+ var value:* = resourceBundle.content[resourceName];
+
+ return uint(value);
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getBoolean()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getBoolean(bundleName:String, resourceName:String,
+ locale:String = null):Boolean
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return false;
+
+ var value:* = resourceBundle.content[resourceName];
+
+ return String(value).toLowerCase() == "true";
+ }
+
+ [Bindable("change")]
+
+ /**
+ * @copy mx.resources.IResourceManager#getClass()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getClass(bundleName:String, resourceName:String,
+ locale:String = null):Class
+ {
+ var resourceBundle:IResourceBundle =
+ findBundle(bundleName, resourceName, locale);
+ if (!resourceBundle)
+ return null;
+
+ var value:* = resourceBundle.content[resourceName];
+
+ return value as Class;
+ }
+
+ /**
+ * @private.
+ */
+ private function findBundle(bundleName:String, resourceName:String,
+ locale:String):IResourceBundle
+ {
+ supportNonFrameworkApps();
+
+ return locale != null ?
+ getResourceBundle(locale, bundleName) :
+ findResourceBundleWithResource(bundleName, resourceName);
+
+ }
+
+ /**
+ * @private.
+ */
+ private function supportNonFrameworkApps():void
+ {
+ if (initializedForNonFrameworkApp)
+ return;
+ initializedForNonFrameworkApp = true;
+
+ if (getLocales().length > 0)
+ return;
+
+ COMPILE::AS3
+ {
+ var applicationDomain:DefinitionManager =
+ new DefinitionManager(ApplicationDomain.currentDomain);
+ }
+
+ if (!applicationDomain.hasDefinition("_CompiledResourceBundleInfo"))
+ return;
+ var c:Class = Class(applicationDomain.getDefinition(
+ "_CompiledResourceBundleInfo"));
+
+ var locales:Array /* of String */ = c.compiledLocales;
+ var bundleNames:Array /* of String */ = c.compiledResourceBundleNames;
+
+ installCompiledResourceBundles(
+ applicationDomain, locales, bundleNames);
+
+ localeChain = locales;
+ }
+
+ /**
+ * @private
+ */
+ private function getSystemPreferredLocales():Array /* of String */
+ {
+ return I18NManager.languages;
+ }
+
+ /**
+ * @private.
+ */
+ private function dumpResourceModule(resourceModule:*):void
+ {
+ for each (var bundle:ResourceBundle in resourceModule.resourceBundles)
+ {
+ trace(bundle.locale, bundle.bundleName);
+ for (var p:String in bundle.content)
+ {
+ //trace(p, bundle.getObject(p));
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function enterFrameHandler():void
+ {
+ if (SystemManagerGlobals.topLevelSystemManagers.length)
+ {
+ if (SystemManagerGlobals.topLevelSystemManagers[0].currentFrame == 2)
+ {
+ inFrame1 = false;
+ }
+ else
+ {
+ var topSM:UIBase = SystemManagerGlobals.topLevelSystemManagers[0] as UIBase;
+ if (topSM.getBeadByType(CallLaterBead) == null)
+ topSM.addBead(new CallLaterBead());
+ var clb:CallLaterBead = topSM.getBeadByType(CallLaterBead) as CallLaterBead;
+ clb.callLater(enterFrameHandler, null, this);
+ return;
+ }
+ }
+
+ var info:Object = SystemManagerGlobals.info;
+ if (info)
+ processInfo(info, false);
+ }
+}
+
+}
+
+COMPILE::LATER
+{
+import flash.events.EventDispatcher;
+import mx.events.ModuleEvent;
+import mx.events.ResourceEvent;
+import mx.modules.IModuleInfo;
+import mx.resources.IResourceModule;
+}
+import mx.resources.IResourceBundle;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: ResourceModuleInfo
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+COMPILE::LATER
+class ResourceModuleInfo
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ResourceModuleInfo(moduleInfo:IModuleInfo,
+ readyHandler:Function,
+ errorHandler:Function)
+ {
+ super();
+
+ this.moduleInfo = moduleInfo;
+ this.readyHandler = readyHandler;
+ this.errorHandler = errorHandler;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // errorHandler
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var errorHandler:Function;
+
+ //----------------------------------
+ // moduleInfo
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var moduleInfo:IModuleInfo
+
+ //----------------------------------
+ // readyHandler
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var readyHandler:Function;
+
+ //----------------------------------
+ // resourceModule
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var resourceModule:IResourceModule;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: ResourceEventDispatcher
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+COMPILE::LATER
+class ResourceEventDispatcher extends EventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ResourceEventDispatcher(moduleInfo:IModuleInfo)
+ {
+ super();
+
+ moduleInfo.addEventListener(
+ ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
+
+ moduleInfo.addEventListener(
+ ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
+
+ moduleInfo.addEventListener(
+ ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private function moduleInfo_errorHandler(event:ModuleEvent):void
+ {
+ var resourceEvent:ResourceEvent = new ResourceEvent(
+ ResourceEvent.ERROR, event.bubbles, event.cancelable);
+ resourceEvent.bytesLoaded = event.bytesLoaded;
+ resourceEvent.bytesTotal = event.bytesTotal;
+ resourceEvent.errorText = event.errorText;
+ dispatchEvent(resourceEvent);
+ }
+
+ /**
+ * @private
+ */
+ private function moduleInfo_progressHandler(event:ModuleEvent):void
+ {
+ var resourceEvent:ResourceEvent = new ResourceEvent(
+ ResourceEvent.PROGRESS, event.bubbles, event.cancelable);
+ resourceEvent.bytesLoaded = event.bytesLoaded;
+ resourceEvent.bytesTotal = event.bytesTotal;
+ dispatchEvent(resourceEvent);
+ }
+
+ /**
+ * @private
+ */
+ private function moduleInfo_readyHandler(event:ModuleEvent):void
+ {
+ var resourceEvent:ResourceEvent =
+ new ResourceEvent(ResourceEvent.COMPLETE);
+ dispatchEvent(resourceEvent);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: ResourceBundleProxy
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+class ResourceBundleProxy implements IResourceBundle
+{
+ public var bundleClass:Class;
+ public var useWeakReference:Boolean;
+
+ private var _bundleName:String;
+ private var _locale:String;
+
+ public function ResourceBundleProxy()
+ {
+ }
+
+ public function get bundleName():String {
+ return _bundleName;
+ }
+
+ public function set bundleName(value:String):void {
+ _bundleName = value;
+ }
+
+ public function get content():Object {
+ return null;
+ }
+
+ public function get locale():String {
+ return _locale;
+ }
+
+ public function set locale(value:String):void {
+ _locale = value;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/rpc/IResponder.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/rpc/IResponder.as b/frameworks/projects/MX/src/main/flex/mx/rpc/IResponder.as
new file mode 100644
index 0000000..df8308a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/rpc/IResponder.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.rpc
+{
+
+/**
+ * This interface provides the contract for any service
+ * that needs to respond to remote or asynchronous calls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IResponder
+{
+ /**
+ * This method is called by a service when the return value
+ * has been received.
+ * While <code>data</code> is typed as Object, it is often
+ * (but not always) an mx.rpc.events.ResultEvent.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function result(data:Object):void;
+
+ /**
+ * This method is called by a service when an error has been received.
+ * While <code>info</code> is typed as Object it is often
+ * (but not always) an mx.rpc.events.FaultEvent.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function fault(info:Object):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/AddChild.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/AddChild.as b/frameworks/projects/MX/src/main/flex/mx/states/AddChild.as
new file mode 100644
index 0000000..68b17a6
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/AddChild.as
@@ -0,0 +1,536 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.DisplayObjectContainer;
+}
+import mx.core.ContainerCreationPolicy;
+import mx.core.IDeferredInstance;
+import mx.core.mx_internal;
+import mx.core.UIComponent;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+
+use namespace mx_internal;
+
+[DefaultProperty("targetFactory")]
+
+[ResourceBundle("states")]
+
+/**
+ * The AddChild class adds a child display object, such as a component,
+ * to a container as part of a view state.
+ * You use this class in the <code>overrides</code> property of the State class.
+ * Use the <code>creationPolicy</code> property to specify to create the child
+ * at application startup or when you change to a view state.
+ *
+ * <p>The child does not dispatch the <code>creationComplete</code> event until
+ * it is added to a container. For example, the following code adds a
+ * Button control as part of a view state change:</p>
+ *
+ * <pre>
+ * <mx:AddChild relativeTo="{v1}">
+ * <mx:Button id="b0" label="New Button"/>
+ * </mx:AddChild> </pre>
+ *
+ * <p>In the previous example, the Button control does not dispatch
+ * the <code>creationComplete</code> event until you change state and the
+ * Button control is added to a container.
+ * If the AddChild class defines both the Button and a container, such as a Canvas container,
+ * then the Button control dispatches the creationComplete event when it is created.
+ * For example, if the <code>creationPolicy</code> property is set to <code>all</code>,
+ * the Button control dispatches the event at application startup.
+ * If the <code>creationPolicy</code> property is set to <code>auto</code>,
+ * the Button control dispatches the event when you change to the view state. </p>
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:AddChild></code> tag
+ * has the following attributes:</p>
+ *
+ * <pre>
+ * <mx:AddChild
+ * <b>Properties</b>
+ * target="null"
+ * targetFactory="null"
+ * creationPolicy="auto"
+ * position="lastChild"
+ * relativeTo="<i>parent of the State object</i>"
+ * />
+ * </pre>
+ *
+ * @see mx.states.State
+ * @see mx.states.RemoveChild
+ * @see mx.states.Transition
+ * @see mx.effects.AddChildAction
+ *
+ * @includeExample examples/StatesExample.mxml
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public class AddChild extends OverrideBase
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param relativeTo The component relative to which child is added.
+ *
+ * @param target The child object.
+ * All Flex components are subclasses of the DisplayObject class.
+ *
+ * @param position the location in the display list of the <code>target</code>
+ * relative to the <code>relativeTo</code> component. Must be one of the following:
+ * "firstChild", "lastChild", "before" or "after".
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function AddChild(relativeTo:UIComponent = null,
+ target:DisplayObject = null,
+ position:String = "lastChild")
+ {
+ super();
+
+ this.relativeTo = relativeTo;
+ this.target = target;
+ this.position = position;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var added:Boolean = false;
+
+ /**
+ * @private
+ */
+ mx_internal var instanceCreated:Boolean = false;
+
+ /**
+ * @private
+ * Used for accessing localized Error messages.
+ */
+ private var resourceManager:IResourceManager =
+ ResourceManager.getInstance();
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //------------------------------------
+ // creationPolicy
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the creationPolicy property.
+ */
+ private var _creationPolicy:String = ContainerCreationPolicy.AUTO;
+
+ [Inspectable(category="General")]
+
+ /**
+ * The creation policy for this child.
+ * This property determines when the <code>targetFactory</code> will create
+ * the instance of the child.
+ * Flex uses this properthy only if you specify a <code>targetFactory</code> property.
+ * The following values are valid:
+ *
+ * <p></p>
+ * <table class="innertable">
+ * <tr><th>Value</th><th>Meaning</th></tr>
+ * <tr><td><code>auto</code></td><td>(default)Create the instance the
+ * first time it is needed.</td></tr>
+ * <tr><td><code>all</code></td><td>Create the instance when the
+ * application started up.</td></tr>
+ * <tr><td><code>none</code></td><td>Do not automatically create the instance.
+ * You must call the <code>createInstance()</code> method to create
+ * the instance.</td></tr>
+ * </table>
+ *
+ * @default "auto"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get creationPolicy():String
+ {
+ return _creationPolicy;
+ }
+
+ /**
+ * @private
+ */
+ public function set creationPolicy(value:String):void
+ {
+ _creationPolicy = value;
+
+ if (_creationPolicy == ContainerCreationPolicy.ALL)
+ createInstance();
+ }
+
+ //------------------------------------
+ // position
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The position of the child in the display list, relative to the
+ * object specified by the <code>relativeTo</code> property.
+ * Valid values are <code>"before"</code>, <code>"after"</code>,
+ * <code>"firstChild"</code>, and <code>"lastChild"</code>.
+ *
+ * @default "lastChild"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var position:String;
+
+ //------------------------------------
+ // relativeTo
+ //------------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The object relative to which the child is added. This property is used
+ * in conjunction with the <code>position</code> property.
+ * This property is optional; if
+ * you omit it, Flex uses the immediate parent of the <code>State</code>
+ * object, that is, the component that has the <code>states</code>
+ * property, or <code><mx:states></code>tag that specifies the State
+ * object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var relativeTo:Object;
+
+ //------------------------------------
+ // target
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the target property
+ */
+ private var _target:DisplayObject;
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The child to be added.
+ * If you set this property, the child instance is created at app startup.
+ * Setting this property is equivalent to setting a <code>targetFactory</code>
+ * property with a <code>creationPolicy</code> of <code>"all"</code>.
+ *
+ * <p>Do not set this property if you set the <code>targetFactory</code>
+ * property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get target():DisplayObject
+ {
+ if (!_target && creationPolicy != ContainerCreationPolicy.NONE)
+ createInstance();
+
+ return _target;
+ }
+
+ /**
+ * @private
+ */
+ public function set target(value:DisplayObject):void
+ {
+ _target = value;
+ }
+
+ //------------------------------------
+ // targetFactory
+ //------------------------------------
+
+ /**
+ * @private
+ * Storage for the targetFactory property.
+ */
+ private var _targetFactory:IDeferredInstance;
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The factory that creates the child. You can specify either of the following items:
+ * <ul>
+ * <li>A factory class that implements the IDeferredInstance
+ * interface and creates the child instance or instances.
+ * </li>
+ * <li>A Flex component, (that is, any class that is a subclass
+ * of the UIComponent class), such as the Button contol.
+ * If you use a Flex component, the Flex compiler automatically
+ * wraps the component in a factory class.
+ * </li>
+ * </ul>
+ *
+ * <p>If you set this property, the child is instantiated at the time
+ * determined by the <code>creationPolicy</code> property.</p>
+ *
+ * <p>Do not set this property if you set the <code>target</code>
+ * property.
+ * This propety is the <code>AddChild</code> class default property.
+ * Setting this property with a <code>creationPolicy</code> of "all"
+ * is equivalent to setting a <code>target</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get targetFactory():IDeferredInstance
+ {
+ return _targetFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set targetFactory(value:IDeferredInstance):void
+ {
+ _targetFactory = value;
+
+ if (creationPolicy == ContainerCreationPolicy.ALL)
+ createInstance();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates the child instance from the factory.
+ * You must use this method only if you specify a <code>targetFactory</code>
+ * property and a <code>creationPolicy</code> value of <code>"none"</code>.
+ * Flex automatically calls this method if the <code>creationPolicy</code>
+ * property value is <code>"auto"</code> or <code>"all"</code>.
+ * If you call this method multiple times, the child instance is
+ * created only on the first call.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function createInstance():void
+ {
+ if (!instanceCreated && !_target && targetFactory)
+ {
+ instanceCreated = true;
+ var instance:Object = targetFactory.getInstance();
+ if (instance is DisplayObject)
+ _target = DisplayObject(instance);
+ }
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function initialize():void
+ {
+ if (creationPolicy == ContainerCreationPolicy.AUTO)
+ createInstance();
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function apply(parent:UIComponent):void
+ {
+ var obj:* = getOverrideContext(relativeTo, parent);
+
+ parentContext = parent;
+ added = false;
+
+ // Early exit if child is null or not a valid container.
+ if (!target || !(obj is DisplayObjectContainer))
+ {
+ if (relativeTo != null && !applied)
+ {
+ // Our destination context is unavailable so we attempt to register
+ // a listener on our parent document to detect when/if it becomes
+ // valid.
+ addContextListener(relativeTo);
+ }
+ applied = true;
+ return;
+ }
+
+ applied = true;
+ relativeTo = obj;
+
+ // Can't reparent. Must remove before adding.
+ if (target.parent)
+ {
+ var message:String = resourceManager.getString(
+ "states", "alreadyParented");
+ throw new Error(message);
+ return;
+ }
+
+ switch (position)
+ {
+ case "before":
+ {
+ obj.parent.addChildAt(target,
+ obj.parent.getChildIndex(obj));
+ break;
+ }
+
+ case "after":
+ {
+ obj.parent.addChildAt(target,
+ obj.parent.getChildIndex(obj) + 1);
+ break;
+ }
+
+ case "firstChild":
+ {
+ obj.addChildAt(target, 0);
+ break;
+ }
+
+ case "lastChild":
+ default:
+ {
+ obj.addChild(target);
+ break;
+ }
+ }
+
+ added = true;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function remove(parent:UIComponent):void
+ {
+ var obj:* = getOverrideContext(relativeTo, parent);
+
+ if (!added || !(obj is DisplayObjectContainer))
+ {
+ if (obj == null)
+ {
+ // It seems our override is no longer active, but we were never
+ // able to successfully apply ourselves, so remove our context
+ // listener if applicable.
+ removeContextListener();
+ applied = false;
+ parentContext = null;
+ }
+ return;
+ }
+
+ switch (position)
+ {
+ case "before":
+ case "after":
+ {
+ obj.parent.removeChild(target);
+ break;
+ }
+
+ case "firstChild":
+ case "lastChild":
+ default:
+ {
+ if (obj == target.parent)
+ {
+ obj.removeChild(target);
+ }
+ break;
+ }
+ }
+
+ // Clear our flags and override context.
+ added = false;
+ applied = false;
+ parentContext = null;
+ }
+}
+
+}
[29/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/UIComponentCachePolicy.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponentCachePolicy.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentCachePolicy.as
new file mode 100644
index 0000000..342ddd5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentCachePolicy.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The ContainerCreationPolicy class defines the constant values
+ * for the <code>cachePolicy</code> property of the UIComponent class.
+ *
+ * @see mx.core.UIComponent#cachePolicy
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public final class UIComponentCachePolicy
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Specifies that the Flex framework should use heuristics
+ * to decide whether to cache the object as a bitmap.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const AUTO:String = "auto";
+
+ /**
+ * Specifies that the Flex framework should never attempt
+ * to cache the object as a bitmap.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const OFF:String = "off";
+
+ /**
+ * Specifies that the Flex framework should always cache
+ * the object as a bitmap.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ON:String = "on";
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/UIComponentDescriptor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponentDescriptor.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentDescriptor.as
new file mode 100644
index 0000000..45b5002
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentDescriptor.as
@@ -0,0 +1,208 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * A UIComponentDescriptor instance encapsulates the information that you
+ * specified in an MXML tag for an instance of a visual component.
+ *
+ * <p>Most of the tags in an MXML file describe a tree of UIComponent objects.
+ * For example, the <code><mx:Application></code> tag represents a
+ * UIComponent object, and its child containers and controls are all
+ * UIComponent objects.</p>
+ *
+ * <p>The MXML compiler compiles each of these MXML tags into a
+ * UIComponentDescriptor instance.
+ * To be precise, the MXML compiler autogenerates an ActionScript
+ * data structure which is a tree of UIComponentDescriptor objects.</p>
+ *
+ * <p>At runtime, the <code>createComponentsFromDescriptors()</code> method
+ * of the Container class uses the information in the UIComponentDescriptor
+ * objects in the container's <code>childDescriptors</code> array to create
+ * the actual UIComponent objects that are the container's children,
+ * plus deeper descendants as well.
+ * Depending on the value of the container's <code>creationPolicy</code>,
+ * property, the descendants might be created at application startup,
+ * when some part of the component is about to become visible,
+ * or when the application developer manually calls
+ * the <code>createComponentsFromDescriptors()</code> method.</p>
+ *
+ * <p>You do not typically create UIComponentDescriptor instances yourself;
+ * you can access the ones that the MXML compiler autogenerates via the
+ * <code>childDescriptors</code> array of the Container class.</p>
+ *
+ * @see mx.core.Container#childDescriptors
+ * @see mx.core.Container#creationPolicy
+ * @see mx.core.Container#createComponentsFromDescriptors()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class UIComponentDescriptor extends ComponentDescriptor
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param descriptorProperties An Object containing name/value pairs
+ * for the properties of the UIComponentDescriptor object, such as its
+ * <code>type</code>, <code>id</code>, <code>propertiesFactory</code>,
+ * <code>events</code>, <code>stylesFactory</code>,
+ * and <code>effects</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function UIComponentDescriptor(descriptorProperties:Object)
+ {
+ super(descriptorProperties);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // effects
+ //----------------------------------
+
+ /**
+ * An Array containing the effects for the component, as specified in MXML.
+ *
+ * <p>For example, if you write the following code:</p>
+ *
+ * <pre>
+ * <mx:TextInput showEffect="Fade" hideEffect="Fade"/></pre>
+ *
+ * <p>The descriptor's <code>effects</code> property is the Array
+ * <code>[ "showEffect", "hideEffect" ]</code>.</p>
+ *
+ * <p>The <code>effects</code>property is <code>null</code>
+ * if no MXML effects were specified for the component.</p>
+ *
+ * <p>Note that the values of the effect attributes are not specified
+ * in this property.
+ * Instead, effects are treated like styles and therefore are include
+ * in the <code>stylesFactory</code> property.
+ * The <code>effect</code> Array simply keeps track of which styles
+ * in the <code>stylesFactory</code> are actually effects.</p>
+ *
+ * <p>This property is used by the Container method
+ * <code>createComponentsFromDescriptors()</code>
+ * to register the effects with the EffectManager.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var effects:Array;
+
+ //----------------------------------
+ // instanceIndices
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var instanceIndices:Array /* of int */;
+
+ //----------------------------------
+ // repeaterIndices
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var repeaterIndices:Array /* of int */;
+
+ //----------------------------------
+ // repeaters
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var repeaters:Array /* of Repeater */;
+
+ //----------------------------------
+ // stylesFactory
+ //----------------------------------
+
+ /**
+ * A Function that constructs an Object containing name/value pairs
+ * for the instance styles for the component, as specified in MXML.
+ *
+ * <p>For example, if you write the following code:</p>
+ *
+ * <pre>
+ * <mx:TextInput borderColor="0x888888" color="0xDDDDDD"/></pre>
+ *
+ * <p>Then the descriptors' <code>stylesFactory</code> property
+ * is the Function:</p>
+ *
+ * <pre>
+ * function():void { this.borderColor = 0x888888; this.color = 0xDDDDDD };</pre>
+ *
+ * <p>The <code>stylesFactory</code> property is <code>null</code>
+ * if no MXML styles were specified for the component instance.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var stylesFactory:Function;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Returns the string "UIComponentDescriptor_" plus the value of the
+ * UIComponentDescriptor object's <code>id</code> property.
+ *
+ * @return The string "UIComponentDescriptor_" plus the value of the
+ * UIComponentDescriptor object's <code>id</code> property.
+ */
+ override public function toString():String
+ {
+ return "UIComponentDescriptor_" + id;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
new file mode 100644
index 0000000..45d62ed
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+COMPILE::AS3
+{
+ import flash.display.InteractiveObject;
+}
+COMPILE::JS
+{
+ import flex.display.InteractiveObject;
+}
+COMPILE::LATER
+{
+ import flash.geom.Matrix;
+}
+import mx.managers.ILayoutManager;
+
+use namespace mx_internal;
+
+/**
+* @private
+*/
+public class UIComponentGlobals
+{
+ /**
+ * @private
+ * A reference to the sole instance of the LayoutManager
+ * used by all components.
+ *
+ * <p>This property is set in the constructor of the Application class.
+ * If you need to override or replace LayoutManager,
+ * set UIComponent.layoutManager in your application's constructor
+ * after calling super().</p>
+ */
+ mx_internal static var layoutManager:ILayoutManager;
+
+ /**
+ * @private
+ * When this variable is non-zero, no methods queued
+ * by the <code>callLater()</code> method get invoked.
+ * This is used to allow short effects to play without interruption.
+ * This counter is incremented by suspendBackgroundProcessing(),
+ * decremented by resumeBackgroundProcessing(), and checked by
+ * callLaterDispatcher().
+ */
+ mx_internal static var callLaterSuspendCount:int = 0;
+
+ /**
+ * @private
+ * There is a bug (139390) where setting focus from within callLaterDispatcher
+ * screws up the ActiveX player. We defer focus until enterframe.
+ */
+ mx_internal static var callLaterDispatcherCount:int = 0;
+
+ /**
+ * @private
+ * There is a bug (139390) where setting focus from within callLaterDispatcher
+ * screws up the ActiveX player. We defer focus until enterframe.
+ */
+ mx_internal static var nextFocusObject:InteractiveObject;
+
+ /**
+ * @private
+ * This single Matrix is used to pass information from the
+ * horizontalGradientMatrix() or verticalGradientMatrix()
+ * utility methods to the drawRoundRect() method.
+ * Each call to horizontalGradientMatrix() or verticalGradientMatrix()
+ * simply calls createGradientBox() to stuff this Matrix with new values.
+ * We can keep restuffing the same Matrix object because these utility
+ * methods are only used inside a call to drawRoundRect()
+ * and the Matrix isn't needed after drawRoundRect() returns.
+ */
+ COMPILE::LATER
+ mx_internal static var tempMatrix:Matrix = new Matrix();
+
+ /**
+ * @private
+ * A global flag that can be read by any component to determine
+ * whether it is currently executing in the context of a design
+ * tool such as Flash Builder's design view. Most components will
+ * never need to check this flag, but if a component needs to
+ * have different behavior at design time than at runtime, then it
+ * can check this flag.
+ */
+ mx_internal static var designTime:Boolean = false;
+
+ /**
+ * A global flag that can be read by any component to determine
+ * whether it is currently executing in the context of a design
+ * tool such as Flash Builder's design view. Most components will
+ * never need to check this flag, but if a component needs to
+ * have different behavior at design time than at runtime, then it
+ * can check this flag.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get designMode():Boolean
+ {
+ return designTime;
+ }
+
+ /**
+ * @private
+ */
+ public static function set designMode(value:Boolean):void
+ {
+ designTime = value;
+ }
+
+ /**
+ * @private
+ */
+ private static var _catchCallLaterExceptions:Boolean = false;
+
+ /**
+ * A global flag that can is used to catch unhandled exceptions
+ * during execution of methods executed via callLater
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get catchCallLaterExceptions():Boolean
+ {
+ return _catchCallLaterExceptions;
+ }
+
+ /**
+ * @private
+ */
+ public static function set catchCallLaterExceptions(value:Boolean):void
+ {
+ _catchCallLaterExceptions = value;
+ }
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/Version.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/Version.as b/frameworks/projects/MX/src/main/flex/mx/core/Version.as
new file mode 100644
index 0000000..3077bda
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/Version.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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+import mx.core.mx_internal;
+
+/**
+ * @private
+ * Version string for this class.
+ */
+mx_internal static const VERSION:String = "4.16.0.0";
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/mx_internal.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/mx_internal.as b/frameworks/projects/MX/src/main/flex/mx/core/mx_internal.as
new file mode 100644
index 0000000..e70b0a5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/mx_internal.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * This namespace is used for undocumented APIs -- usually implementation
+ * details -- which can't be private because they need to visible
+ * to other classes.
+ * APIs in this namespace are completely unsupported and are likely to
+ * change in future versions of Flex.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public namespace mx_internal =
+ "http://www.adobe.com/2006/flex/mx/internal";
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..519532c
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as
@@ -0,0 +1,968 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+}
+import org.apache.flex.core.UIBase;
+import org.apache.flex.events.Event;
+import org.apache.flex.events.EventDispatcher;
+import mx.events.FocusEvent;
+import flex.system.DefinitionManager;
+COMPILE::LATER
+{
+ import flash.utils.Dictionary;
+}
+
+import mx.core.EventPriority;
+import mx.core.FlexGlobals;
+import mx.core.IDeferredInstantiationUIComponent;
+import mx.core.IFlexDisplayObject;
+import mx.core.IUIComponent;
+import mx.core.UIComponent;
+import mx.core.UIComponentCachePolicy;
+import mx.core.mx_internal;
+import mx.events.EffectEvent;
+import mx.events.FlexEvent;
+import mx.events.MoveEvent;
+import mx.events.ResizeEvent;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.core.IVisualElementContainer;
+import mx.core.IVisualElement;
+
+use namespace mx_internal;
+
+[ResourceBundle("effects")]
+
+/**
+ * The EffectManager class listens for events, such as the <code>show</code>
+ * and <code>move</code> events, dispatched by objects in a Flex application.
+ * For each event, corresponding to an event trigger, it determines if
+ * there is an effect assigned to the object.
+ * If an effect is defined, it plays the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class EffectManager extends EventDispatcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Keeps track of all the triggered effects that are currently playing.
+ */
+ mx_internal static var effectsPlaying:Array /* of EffectNode */ = [];
+
+ /**
+ * @private
+ * Map with event type as key and effectTrigger as value.
+ */
+ private static var effectTriggersForEvent:Object = {};
+
+ /**
+ * @private
+ * Map with effectTrigger as key and event type as value.
+ */
+ private static var eventsForEffectTriggers:Object = {};
+
+ /**
+ * @private
+ * Array containing miscellaneous info about effect targets.
+ * An element in the array is an Object with three fields:
+ * target - reference to the target
+ * bitmapEffectsCount - number of bitmap effects
+ * currently playing on the target
+ * vectorEffectsCount - number of vector effects
+ * currently playing on the target
+ */
+ private static var targetsInfo:Array /* of Object */ = [];
+
+ /**
+ * @private
+ * Remember when suspendEventHandling() has been called
+ * without a matching resumeEventHandling().
+ */
+ private static var eventHandlingSuspendCount:Number = 0;
+
+ /**
+ * @private
+ * Weak backing storage for the lastEffectCreated instance.
+ */
+ COMPILE::LATER
+ private static var weakKeys:Dictionary;
+
+ /**
+ * @private
+ * This internal property is currently only used by the ViewStack
+ * component in order to coordinate the hideEffect completion with
+ * ViewStack change logic. It would be best to find a better way
+ * to do this (localized to ViewStack) in the future however.
+ */
+ COMPILE::LATER
+ mx_internal static function set lastEffectCreated(effect:IEffect):void
+ {
+ // We just regenerate our dictionary instead of finding and deleting
+ // the previous key. Faster.
+ weakKeys = new Dictionary(true);
+ weakKeys[effect] = true;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ mx_internal static function get lastEffectCreated():IEffect
+ {
+ for (var item:* in weakKeys)
+ return item;
+
+ return null;
+ }
+
+ /**
+ * @private
+ * Storage for the resourceManager getter.
+ * This gets initialized on first access,
+ * not at static initialization time, in order to ensure
+ * that the Singleton registry has already been initialized.
+ */
+ private static var _resourceManager:IResourceManager;
+
+ /**
+ * @private
+ * A reference to the object which manages
+ * all of the application's localized resources.
+ * This is a singleton instance which implements
+ * the IResourceManager interface.
+ */
+ private static function get resourceManager():IResourceManager
+ {
+ if (!_resourceManager)
+ _resourceManager = ResourceManager.getInstance();
+
+ return _resourceManager;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * After this method is called, the EffectManager class ignores
+ * all events, and no effects are triggered, until a call to
+ * <code>resumeEventHandling()</code>.
+ * Used internally so that an effect that is updating the screen
+ * does not cause another effect to be triggered.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function suspendEventHandling():void
+ {
+ eventHandlingSuspendCount++;
+ }
+
+ /**
+ * Allows the EffectManager class to resume processing events
+ * after a call to the <code>suspendEventHandling()</code> method.
+ * Used internally in conjunction with the
+ * <code>suspendEventHandling()</code> method
+ * so that an effect that is updating the screen
+ * does not cause another effect to be triggered.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function resumeEventHandling():void
+ {
+ eventHandlingSuspendCount--;
+ }
+
+ /**
+ * Immediately ends any effects currently playing on a target.
+ *
+ * @param target The target component on which to end all effects.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function endEffectsForTarget(target:IUIComponent):void
+ {
+ // Iterate through the array backward, because calling end()
+ // may cause the element to be removed from the array.
+ var n:int = effectsPlaying.length;
+ for (var i:int = n - 1; i >= 0; i--)
+ {
+ var otherInst:IEffectInstance =
+ effectsPlaying[i].instance;
+ if (otherInst.target == target)
+ otherInst.end();
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ mx_internal static function setStyle(styleProp:String, target:*):void
+ {
+ // Anytime that any UIComponent's style is changed,
+ // check to see if the styleProp that's changing
+ // is an effect trigger (e.g., showEffect).
+
+ var eventName:String = eventsForEffectTriggers[styleProp];
+ if (eventName != null && eventName != "")
+ {
+ target.addEventListener(eventName,
+ EffectManager.eventHandler,
+ false, EventPriority.EFFECT);
+ }
+ }
+
+ /**
+ * @private
+ * Internal function used to instantiate an effect
+ */
+ mx_internal static function createEffectForType(target:Object,
+ type:String):IEffect
+ {
+ var trigger:String = effectTriggersForEvent[type];
+
+ if (trigger == "")
+ trigger = type + "Effect"; // For backwards compatibility
+
+ var value:Object = target.getStyle(trigger);
+
+ if (!value)
+ return null;
+
+ if (value is Class)
+ {
+ var cls:Class = Class(value);
+ return new cls(target);
+ }
+
+ // If we don't find the ID on the parent document, then just move on.
+ try
+ {
+ var effectObj:IEffect;
+ if (value is String)
+ {
+ var doc:Object = target.parentDocument;
+ // The main Application doesn't have a parentDocument.
+ if (!doc)
+ doc = FlexGlobals.topLevelApplication;
+ effectObj = doc[value];
+ }
+ else if (value is IEffect)
+ {
+ effectObj = IEffect(value);
+ }
+
+ if (effectObj)
+ {
+ effectObj.target = target;
+ return effectObj;
+ }
+ }
+ catch(e:Error)
+ {
+ }
+
+ 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));
+ }
+ if (!effectClass)
+ effectClass = Class(target.systemManager.getDefinitionByName(
+ "mx.effects." + value));
+
+ if (effectClass)
+ return new effectClass(target);
+
+ return null;
+ }
+
+ /**
+ * @private
+ * Internal function used while playing effects
+ */
+ private static function animateSameProperty(a:IEffect, b:IEffect,
+ c:IEffectInstance):Boolean
+ {
+ // This function returns true if "a" and "b" animate
+ // the same property of the same object.
+
+ if (a.target == c.target)
+ {
+ var aProps:Array = a.getAffectedProperties();
+ var bProps:Array = b.getAffectedProperties();
+
+ var n:int = aProps.length;
+ var m:int = bProps.length;
+
+ for (var i:int = 0; i < n; i++)
+ {
+ for (var j:int = 0; j < m; j++)
+ {
+ if (aProps[i] == bProps[j])
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @private
+ * Should be called by an effect instance before it starts playing,
+ * to suggest bitmap caching on the target.
+ * E.g. Fade calls this function in its play().
+ */
+ mx_internal static function startBitmapEffect(target:IUIComponent):void
+ {
+ cacheOrUncacheTargetAsBitmap(target, true, true);
+ }
+
+ /**
+ * @private
+ * Should be called by an effect instance after it has finished playing,
+ * to suggest that the cached bitmap for the target can be freed.
+ * E.g. Fade calls this function in its onTweenEnd().
+ */
+ mx_internal static function endBitmapEffect(target:IUIComponent):void
+ {
+ cacheOrUncacheTargetAsBitmap(target, false, true);
+ }
+
+ /**
+ * @private
+ * Should be called by an effect instance before it starts playing, to
+ * suggest that bitmap caching should be turned off on the target.
+ * E.g. Resize calls this function in its play().
+ */
+ mx_internal static function startVectorEffect(target:IUIComponent):void
+ {
+ cacheOrUncacheTargetAsBitmap(target, true, false);
+ }
+
+ /**
+ * @private
+ * Should be called by an effect instance after it has finished playing,
+ * to suggest that bitmap caching may be turned back on on the target.
+ * E.g. Resize calls this function in its onTweenEnd().
+ */
+ mx_internal static function endVectorEffect(target:IUIComponent):void
+ {
+ cacheOrUncacheTargetAsBitmap(target, false, false);
+ }
+
+ /**
+ * @private
+ * Cache or uncache the target as a bitmap depending on which effects are
+ * currently playing on the target.
+ *
+ * @param target The effect target.
+ *
+ * @param effectStart Whether this is the starting of the effect.
+ * false means it's the ending of the effect.
+ *
+ * @param bitmapEffect Whether this is a bitmap effect.
+ * false means it's a vector effect (like resize, zoom, etc.)
+ * that wants the target object to be uncached.
+ */
+ private static function cacheOrUncacheTargetAsBitmap(
+ target:IUIComponent,
+ effectStart:Boolean = true,
+ bitmapEffect:Boolean = true):void
+ {
+ var n:int;
+ var i:int;
+
+ // Object containing information about the target.
+ var info:Object = null;
+
+ n = targetsInfo.length;
+ for (i = 0; i < n; i++)
+ {
+ if (targetsInfo[i].target == target)
+ {
+ info = targetsInfo[i];
+ break;
+ }
+ }
+
+ // If no info object is available, create an object and push it
+ // into the array.
+ if (!info)
+ {
+ info =
+ {
+ target: target,
+ bitmapEffectsCount: 0,
+ vectorEffectsCount: 0
+ };
+
+ targetsInfo.push(info);
+ }
+
+ if (effectStart)
+ {
+ if (bitmapEffect)
+ {
+ info.bitmapEffectsCount++;
+
+ // If no vector effects are currently playing,
+ // cache the target.
+ if (info.vectorEffectsCount == 0 &&
+ target is IDeferredInstantiationUIComponent)
+ {
+ IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
+ }
+ }
+ else
+ {
+ // If a vector effect started playing, forcibly uncache
+ // the target regardless of anything else.
+ if (info.vectorEffectsCount++ == 0 &&
+ target is IDeferredInstantiationUIComponent &&
+ IDeferredInstantiationUIComponent(target).cachePolicy == UIComponentCachePolicy.AUTO)
+ {
+ target.cacheAsBitmap = false;
+ }
+ }
+ }
+ else // effect end
+ {
+ if (bitmapEffect)
+ {
+ if (info.bitmapEffectsCount != 0)
+ info.bitmapEffectsCount--;
+
+ if (target is IDeferredInstantiationUIComponent)
+ IDeferredInstantiationUIComponent(target).cacheHeuristic = false;
+ }
+ else
+ {
+ if (info.vectorEffectsCount != 0)
+ {
+ // If no more vector effects are playing but bitmap
+ // effects are still playing, cache the target.
+ if (--info.vectorEffectsCount == 0 &&
+ info.bitmapEffectsCount != 0)
+ {
+ // Crank up the counter.
+ n = info.bitmapEffectsCount;
+ for (i = 0; i < n; i++)
+ {
+ if (target is IDeferredInstantiationUIComponent)
+ IDeferredInstantiationUIComponent(target).cacheHeuristic = true;
+ }
+ }
+ }
+ }
+
+ if (info.bitmapEffectsCount == 0 && info.vectorEffectsCount == 0)
+ {
+ // No more effects are playing on this target, so discard the
+ // info object (should speed up lookups).
+ n = targetsInfo.length;
+ for (i = 0; i < n; i++)
+ {
+ if (targetsInfo[i].target == target)
+ {
+ targetsInfo.splice(i, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ * Called in code generated by MXML compiler.
+ */
+ mx_internal static function registerEffectTrigger(name:String,
+ event:String):void
+ {
+ if (name != "")
+ {
+ if (event == "")
+ {
+ // For backwards compatibility.
+ var strLen:Number = name.length;
+ if (strLen > 6 && name.substring(strLen - 6) == "Effect")
+ event = name.substring(0, strLen - 6);
+ }
+
+ if (event != "")
+ {
+ effectTriggersForEvent[event] = name;
+ eventsForEffectTriggers[name] = event;
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal static function getEventForEffectTrigger(effectTrigger:String):String
+ {
+ if (eventsForEffectTriggers)
+ {
+ try
+ {
+ return eventsForEffectTriggers[effectTrigger];
+ }
+ catch(e:Error) {}
+ }
+
+ return "";
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal static function eventHandler(eventObj:Event):void
+ {
+ // If this event fired because an effect is currently playing
+ // (in other words, if an effect was the source of this event),
+ // then don't listen to the effect.
+ if (!(eventObj.currentTarget is IFlexDisplayObject))
+ return;
+
+ if (eventHandlingSuspendCount > 0)
+ return;
+
+ if (eventObj is FocusEvent &&
+ (eventObj.type == FocusEvent.FOCUS_OUT ||
+ eventObj.type == FocusEvent.FOCUS_IN))
+ {
+ var focusEventObj:FocusEvent = FocusEvent(eventObj);
+ if (focusEventObj.relatedObject &&
+ (focusEventObj.currentTarget.contains(focusEventObj.relatedObject) ||
+ focusEventObj.currentTarget == focusEventObj.relatedObject))
+ {
+ return;
+ }
+ }
+
+ // Only trigger the event for added and removed if the current target is the same as the target.
+ if ((eventObj.type == UIBase.CHILD_ADDED || eventObj.type == UIBase.CHILD_REMOVED) && eventObj.target != eventObj.currentTarget)
+ return;
+
+ if (eventObj.type == UIBase.CHILD_REMOVED)
+ {
+ if (eventObj.target is UIComponent)
+ {
+ if (UIComponent(eventObj.target).initialized == false)
+ {
+ return;
+ }
+ else if (UIComponent(eventObj.target).isEffectStarted)
+ {
+ for (var i:int = 0; i < UIComponent(eventObj.target)._effectsStarted.length; i++)
+ {
+ // Don't allow removedEffect to trigger more than one effect at a time
+ if (UIComponent(eventObj.target)._effectsStarted[i].triggerEvent.type == UIBase.CHILD_REMOVED)
+ return;
+ }
+ }
+ }
+
+ var targ:DisplayObject = eventObj.target as DisplayObject;
+
+ if (targ != null)
+ {
+ var parent:DisplayObjectContainer = targ.parent as DisplayObjectContainer;
+
+ if (parent != null)
+ {
+ var index:int = parent.getChildIndex(targ);
+ if (index >= 0)
+ {
+ if (targ is UIComponent)
+ {
+ // Since we get the "removed" event before the child is actually removed,
+ // we need to delay adding back the child. We must exit the current
+ // script block must exit before the child can be removed.
+ UIComponent(targ).callLater(removedEffectHandler, [targ, parent, index, eventObj]);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ createAndPlayEffect(eventObj, eventObj.currentTarget);
+ }
+ }
+
+ /**
+ * @private
+ */
+ private static function createAndPlayEffect(eventObj:Event, target:Object):void
+ {
+
+ var effectInst:IEffect = createEffectForType(target, eventObj.type);
+ if (!effectInst)
+ return;
+
+ COMPILE::LATER
+ {
+ if (effectInst is Zoom && eventObj.type == MoveEvent.MOVE)
+ {
+ var message:String = resourceManager.getString(
+ "effects", "incorrectTrigger");
+ throw new Error(message);
+ }
+ }
+
+ // If this is a "move" or "resize" event that was caused by
+ // the layout manager doing an initial layout, then don't
+ // play any effects.
+ // Ditto for "show" or "hide" effects triggered by ViewStack.doLayout.
+ if (target.initialized == false)
+ {
+ var type:String = eventObj.type;
+ if (type == MoveEvent.MOVE ||
+ type == ResizeEvent.RESIZE ||
+ type == FlexEvent.SHOW ||
+ type == FlexEvent.HIDE ||
+ type == Event.CHANGE)
+ {
+ effectInst = null;
+ return;
+ }
+ }
+
+ var n:int;
+ var i:int;
+ var m:int;
+ var j:int;
+
+ // Some components contain built-in tweens, which are not managed by
+ // the EffectManager. If one of those tweens is currently playing,
+ // and if it's animating a conflicting property, then don't play this
+ // tween.
+ if (effectInst.target is IUIComponent)
+ {
+ var tweeningProperties:Array =
+ IUIComponent(effectInst.target).tweeningProperties;
+ if (tweeningProperties && tweeningProperties.length > 0)
+ {
+ var effectProperties:Array = effectInst.getAffectedProperties();
+
+ n = tweeningProperties.length;
+ m = effectProperties.length;
+
+ for (i = 0; i < n; i++)
+ {
+ for (j = 0; j < m; j++)
+ {
+ if (tweeningProperties[i] == effectProperties[j])
+ {
+ effectInst = null;
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ // At any given time, only one effect may be animating a given
+ // property of a given target object. If some other effect was
+ // previously animating the same properties of my target object,
+ // then finish the other effect before starting this new one.
+ //
+ if (effectInst.target is UIComponent &&
+ UIComponent(effectInst.target).isEffectStarted)
+ {
+ var affectedProps:Array = effectInst.getAffectedProperties();
+ for (i = 0; i < affectedProps.length; i++)
+ {
+ var runningInstances:Array =
+ effectInst.target.getEffectsForProperty(affectedProps[i]);
+ if (runningInstances.length > 0)
+ {
+ if (eventObj.type == ResizeEvent.RESIZE)
+ return;
+
+ for (j = 0; j < runningInstances.length; j++)
+ {
+ var otherInst:IEffectInstance = runningInstances[j];
+ if (eventObj.type == FlexEvent.SHOW && otherInst.hideOnEffectEnd)
+ {
+ otherInst.target.removeEventListener(
+ FlexEvent.SHOW, otherInst.eventHandler);
+ otherInst.hideOnEffectEnd = false;
+
+ }
+
+ /*
+ if (eventObj.type == MoveEvent.MOVE &&
+ ((affectedProps[i] == "width") ||
+ (affectedProps[i] == "height") ||
+ (affectedProps[i] == "x") ||
+ (affectedProps[i] == "y")) &&
+ effectInst.target.getStyle("moveEffect") != undefined)
+ {
+ trace("EM Got Move and ignoring");
+ return;
+ }
+
+ if (eventObj.type == ResizeEvent.RESIZE &&
+ ((affectedProps[i] == "width") ||
+ (affectedProps[i] == "height")) &&
+ effectInst.target.getStyle("resizeEffect") != undefined)
+ {
+ return;
+ }
+ */
+
+ otherInst.end();
+ }
+ }
+ }
+ }
+
+ // Pass in event data for effect initialization
+ effectInst.triggerEvent = eventObj;
+
+ // Tell the effectInst that I'm the listener, so that my "onEffectEnd"
+ // method is called when the effect finishes playing. The
+ // onEffectEnd handler will remove this effect from the effectsPlaying
+ // array.
+ effectInst.addEventListener(EffectEvent.EFFECT_END,
+ EffectManager.effectEndHandler);
+
+ COMPILE::LATER
+ {
+ lastEffectCreated = effectInst;
+ }
+
+ var instances:Array = effectInst.play();
+ n = instances.length;
+ for (i = 0; i < n; i++)
+ {
+ effectsPlaying.push(
+ new EffectNode(effectInst, instances[i]));
+ }
+
+ // Block all layout, responses from web services, and other background
+ // processing until the effect finishes executing.
+ if (effectInst.suspendBackgroundProcessing)
+ UIComponent.suspendBackgroundProcessing();
+ }
+
+ /**
+ * @private
+ * Delayed function call when effect is triggered by "removed" event
+ */
+ private static function removedEffectHandler(target:DisplayObject, parent:DisplayObjectContainer, index:int, eventObj:Event):void
+ {
+ suspendEventHandling();
+ // Add the child back to the parent so the effect can play upon it
+ if (parent is IVisualElementContainer && target is IVisualElement)
+ (IVisualElementContainer(parent).addElementAt(target as IVisualElement, index));
+ else
+ parent.addChildAt(target, index);
+ resumeEventHandling();
+ // Use target because the player assigns the Stage to the currentTarget when we leave the scope of the event handler function
+ createAndPlayEffect(eventObj, target);
+ }
+
+ /**
+ * @private
+ * Internal function used while playing effects
+ */
+ mx_internal static function effectEndHandler(event:EffectEvent):void
+ {
+ var effectInst:IEffectInstance = event.effectInstance;
+ // This function is called when an effect, which was started
+ // earlier by this effect manager, finishes playing. Remove
+ // this effect from the "effectPlaying" list
+ var n:int = effectsPlaying.length;
+ for (var i:int = n - 1; i >= 0; i--)
+ {
+ if (effectsPlaying[i].instance == effectInst)
+ {
+ effectsPlaying.splice(i, 1);
+ break;
+ }
+ }
+
+ // If the event that caused this effect was "hide", then the
+ // eventHandler() method set the object's visiblity to true.
+ // Now that the effect is finished playing, set visiblity to false.
+ if (Object(effectInst).hideOnEffectEnd == true)
+ {
+ effectInst.target.removeEventListener(
+ FlexEvent.SHOW, Object(effectInst).eventHandler);
+ effectInst.target.setVisible(false, true);
+ }
+
+ if (effectInst.triggerEvent && effectInst.triggerEvent.type == UIBase.CHILD_REMOVED)
+ {
+ var targ:DisplayObject = effectInst.target as DisplayObject;
+
+ if (targ != null)
+ {
+ var parent:DisplayObjectContainer = targ.parent as DisplayObjectContainer;
+
+ if (parent != null)
+ {
+ // Since we added the child back to the parent when the effect began,
+ // we need to remove it once the effect has finished.
+ suspendEventHandling();
+ if (parent is IVisualElementContainer && targ is IVisualElement)
+ (IVisualElementContainer(parent).removeElement(targ as IVisualElement));
+ else
+ parent.removeChild(targ);
+ resumeEventHandling();
+ }
+ }
+ }
+
+ // Resume the background processing that was suspended earlier
+ if (effectInst.suspendBackgroundProcessing)
+ UIComponent.resumeBackgroundProcessing();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Diagnostics
+ //
+ //--------------------------------------------------------------------------
+ COMPILE::LATER
+ private static var effects:Dictionary = new Dictionary(true);
+
+ COMPILE::LATER
+ mx_internal static function effectStarted(effect:IEffectInstance):void
+ {
+ effects[effect] = 1;
+ }
+
+ COMPILE::LATER
+ mx_internal static function effectFinished(effect:IEffectInstance):void
+ {
+ delete effects[effect];
+ }
+
+ COMPILE::LATER
+ mx_internal static function effectsInEffect():Boolean
+ {
+ for (var i:* in effects)
+ {
+ return true;
+ }
+ return false;
+ }
+}
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: EffectNode
+//
+////////////////////////////////////////////////////////////////////////////////
+
+import mx.effects.IEffect;
+import mx.effects.IEffectInstance;
+
+/**
+ * @private
+ */
+class EffectNode
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function EffectNode(factory:IEffect, instance:IEffectInstance)
+ {
+ super();
+
+ this.factory = factory;
+ this.instance = instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public var factory:IEffect;
+
+ /**
+ * @private
+ */
+ public var instance:IEffectInstance;
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/effects/EffectTargetFilter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/EffectTargetFilter.as b/frameworks/projects/MX/src/main/flex/mx/effects/EffectTargetFilter.as
new file mode 100644
index 0000000..c456611
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/EffectTargetFilter.as
@@ -0,0 +1,331 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects
+{
+
+import mx.effects.effectClasses.PropertyChanges;
+
+/**
+ * The EffectTargetFilter class defines a custom filter that is executed
+ * by each transition effect on each target of the effect.
+ *
+ * <p>The EffectTargetFilter class defines a
+ * <code>defaultFilterFunction()</code> method that uses the
+ * <code>filterProperties</code> and <code>filterStyles</code> properties
+ * to determine whether to play the effect on each effect target.</p>
+ *
+ * <p>You can also define a custom filter function
+ * to implement your own filtering logic.
+ * To do so, define your filter function, and then specify that function
+ * to an EffectTargetFilter object using the <code>filterFunction</code>
+ * property.</p>
+ *
+ * <p>To configure an effect to use a custom filter, you pass an
+ * EffectTargetFilter object to the <code>Effect.customFilter</code> property
+ * of the effect.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class EffectTargetFilter
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function EffectTargetFilter()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // filterFunction
+ //----------------------------------
+
+ /**
+ * A function that defines custom filter logic.
+ * Flex calls this method on every target of the effect.
+ * If the function returns <code>true</code>,
+ * the effect plays on the target;
+ * if it returns <code>false</code>, the target is skipped by the effect.
+ * A custom filter function gives you greater control over filtering
+ * than the <code>Effect.filter</code> property.
+ *
+ * <p>The filter function has the following signature:</p>
+ *
+ * <pre>
+ * filterFunc(propChanges:Array, instanceTarget:Object):Boolean
+ * {
+ * // Return true to play the effect on instanceTarget,
+ * // or false to not play the effect.
+ * }
+ * </pre>
+ *
+ * <p>where:</p>
+ *
+ * <p><code>propChanges</code> - An Array of PropertyChanges objects,
+ * one object per target component of the effect.
+ * If a property of a target is not modified by the transition,
+ * it is not included in this Array.</p>
+ *
+ * <p><code>instanceTarget</code> - The specific target component
+ * of the effect that you want to filter.
+ * Within the custom filter function, you first search the
+ * <code>propChanges</code> Array for the PropertyChanges object
+ * that matches the <code>instanceTarget</code> argument
+ * by comparing the <code>instanceTarget</code> argument
+ * to the <code>propChanges.target</code> property.</p>
+ *
+ * @see mx.effects.effectClasses.PropertyChanges
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var filterFunction:Function = defaultFilterFunctionEx;
+
+ //----------------------------------
+ // filterProperties
+ //----------------------------------
+
+ /**
+ * An Array of Strings specifying component properties.
+ * If any of the properties in the Array changed on the target component,
+ * play the effect on the target.
+ *
+ * <p>If you define a custom filter function, you can examine the
+ * <code>filterProperties</code> property from within your function.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var filterProperties:Array = [];
+
+ //----------------------------------
+ // filterStyles
+ //----------------------------------
+
+ /**
+ * An Array of Strings specifying style properties.
+ * If any of the style properties in the Array changed on the target component,
+ * play the effect on the target.
+ *
+ * <p>If you define a custom filter function, you can examine the
+ * <code>filterStyles</code> property from within your function.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var filterStyles:Array = [];
+
+ //----------------------------------
+ // requiredSemantics
+ //----------------------------------
+
+ /**
+ * A collection of properties and associated values which must be associated
+ * with a target for the effect to be played.
+ *
+ * <p>When working with data effects, you can use this property to filter effects.
+ * If you want to play a data effect on all targets of a list control
+ * that are not added by the effect, meaning targets that is removed, replaced, moved,
+ * or affected in any other way, you can write the effect definition as shown below: </p>
+ *
+ * <pre>
+ * <mx:Blur>
+ * <mx:customFilter>
+ * <mx:EffectTargetFilter requiredSemantics="{{'added':false}}"/>
+ * </mx:customFilter>
+ * </mx:Blur> </pre>
+ *
+ * <p>To play a data effect on all targets that are not added or not removed by the effect,
+ * you can write the effect definition as shown below:</p>
+ *
+ * <pre>
+ * <mx:Blur>
+ * <mx:customFilter>
+ * <mx:EffectTargetFilter requiredSemantics="{{'added':false}, {'removed':false}}"/>
+ * </mx:customFilter>
+ * </mx:Blur></pre>
+ *
+ * <p>The allowed list of properties that you can specify includes <code>added</code>,
+ * <code>removed</code>, <code>replaced</code>, and <code>replacement</code>.
+ * The allowed values for the properties are <code>true</code> and <code>false</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var requiredSemantics:Object = null;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether a target should be filtered, returning true if it should be
+ * included in an effect.
+ *
+ * The determination is made by calling filterFunction and semanticFilterFunction,
+ * returning true if and only if both functions return true. The default functions
+ * with the default values will always return true.
+ *
+ * Typically, an EffectTargetFilter will use one type of filter or the other, but
+ * not both.
+ *
+ * @param propChanges An Array of PropertyChanges objects. The target property of
+ * each PropertyChanges object is equal to the effect's target. If a property of
+ * a target is not modified by a transition, the corresponding PropertyChanges
+ * object is not included in this array.
+ *
+ * @param semanticsProvider The IEffectTargetHost used to evaluate the properties
+ * specified in requiredSemantics for the target, normally the effectTargetHost of
+ * the effect. For item change effects, when the targets of the effect are item
+ * renderers, this will be the List or TileList containing the item renderers.
+ *
+ * @param target The target of the EffectInstance that calls this function. If an
+ * effect has multiple targets, this function is called once per target.
+ *
+ * @return Returna <code>true</code>, if the target should be included in the effect;
+ * otherwise returns <code>false</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function filterInstance(propChanges:Array, semanticsProvider:IEffectTargetHost,
+ target:Object):Boolean
+ {
+ if (filterFunction.length == 2)
+ return filterFunction(propChanges, target);
+ else
+ return filterFunction(propChanges, semanticsProvider, target);
+ }
+
+ /**
+ * @private
+ */
+ protected function defaultFilterFunctionEx(propChanges:Array, semanticsProvider:IEffectTargetHost,
+ target:Object):Boolean
+ {
+ if (requiredSemantics)
+ {
+ for (var prop:String in requiredSemantics)
+ {
+ // seems dumb to check this every time
+ // if necessary, we could do something with setters and getters
+ if (!semanticsProvider)
+ return false;
+ if (semanticsProvider.getRendererSemanticValue(target,prop) != requiredSemantics[prop])
+ return false;
+ }
+
+ // not clear this is the right thing to do here
+ // the problem is that defaultFilterFunction returns false in
+ // some cases where we might expect it to return true
+ return true;
+ }
+ // if semantic filtering has passed, do property change filtering
+ return defaultFilterFunction(propChanges, target);
+ }
+
+ /**
+ * The default filter function for the EffectTargetFilter class.
+ * If the <code>instanceTarget</code> has different start and end values
+ * for any of the values specified by the <code>filterProperties</code>
+ * or <code>filterStyles</code> properties, play the effect on the target.
+ *
+ * @param propChanges An Array of PropertyChanges objects.
+ * The <code>target</code> property of each PropertyChanges object
+ * is equal to the effect's target.
+ * If a property of a target is not modified by a transition, the
+ * corresponding PropertyChanges
+ * object is not included in this array.
+ *
+ * @param instanceTarget The target of the EffectInstance
+ * that calls this function.
+ * If an effect has multiple targets,
+ * this function is called once per target.
+ *
+ * @return Returns <code>true</code> to allow the effect instance to play.
+ *
+ * @see mx.effects.effectClasses.PropertyChanges
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function defaultFilterFunction(propChanges:Array,
+ instanceTarget:Object):Boolean
+ {
+ var n:int = propChanges.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var props:PropertyChanges = propChanges[i];
+ if (props.target == instanceTarget)
+ {
+ var triggers:Array = filterProperties.concat(filterStyles);
+ var m:int = triggers.length;
+ for (var j:int = 0; j < m; j++)
+ {
+ if (props.start[triggers[j]] !== undefined &&
+ props.end[triggers[j]] != props.start[triggers[j]])
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..b3cd714
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/IAbstractEffect.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects
+{
+
+import flash.events.Event;
+import flash.events.IEventDispatcher;
+
+/**
+ * The IAbstractEffect interface is used to denote
+ * that a property or parameter must be of type Effect,
+ * but does not actually implement any of the APIs of the
+ * IEffect interface.
+ * The UIComponent class recognizes when property that
+ * implements the AbstractEffect interface changes, and passes it to
+ * the EffectManager class for processing.
+ *
+ * @see mx.effects.IEffect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IAbstractEffect extends IEventDispatcher
+{
+}
+
+}
\ No newline at end of file
[14/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/StyleManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/StyleManagerImpl.as b/frameworks/projects/MX/src/main/flex/mx/styles/StyleManagerImpl.as
new file mode 100644
index 0000000..652d853
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/StyleManagerImpl.as
@@ -0,0 +1,2046 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+}
+COMPILE::LATER
+{
+ import flash.display.LoaderInfo;
+ import flash.system.ApplicationDomain;
+ import flash.system.SecurityDomain;
+ import flash.events.TimerEvent;
+ import flash.utils.Timer;
+}
+import org.apache.flex.events.Event;
+import org.apache.flex.events.EventDispatcher;
+import org.apache.flex.events.IEventDispatcher;
+
+import mx.core.FlexVersion;
+import mx.core.IFlexModuleFactory;
+import mx.core.mx_internal;
+import mx.events.FlexChangeEvent;
+import mx.events.ModuleEvent;
+import mx.events.Request;
+import mx.events.StyleEvent;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManagerGlobals;
+import mx.modules.IModuleInfo;
+import mx.modules.ModuleManager;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.styles.IStyleManager2;
+import mx.styles.IStyleModule;
+import mx.utils.MediaQueryParser;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+[ResourceBundle("styles")]
+
+[Mixin]
+
+/**
+ * @private
+ */
+public class StyleManagerImpl extends EventDispatcher implements IStyleManager2
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+ /**
+ * @private
+ */
+ private static var instance:IStyleManager2;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public static function init(fbs:IFlexModuleFactory):void
+ {
+ var styleDataClassName:String = fbs.info()["styleDataClassName"];
+ if (styleDataClassName)
+ {
+ var sm:StyleManagerImpl = fbs.getImplementation("mx.styles::IStyleManager2") as StyleManagerImpl;
+ if (!sm)
+ sm = new StyleManagerImpl(fbs);
+
+ var styleDataClass:Class = fbs.info()["currentDomain"].getDefinition(styleDataClassName);
+ var styleNames:Array = styleDataClass["inheritingStyles"];
+ for each (var s:String in styleNames)
+ {
+ sm.registerInheritingStyle(s);
+ }
+ generateCSSStyleDeclarations(sm, styleDataClass["factoryFunctions"], styleDataClass["data"]);
+ sm.initProtoChainRoots();
+ }
+ }
+
+ public static function generateCSSStyleDeclarations(styleManager:StyleManagerImpl, factoryFunctions:Object, data:Array, newSelectors:Array = null, overrideMap:Object = null):void
+ {
+ var arr:Array = data;
+
+ var conditions:Array = null;
+ var condition:CSSCondition = null;
+ var selector:CSSSelector = null;
+ var style:CSSStyleDeclaration;
+ var declarationName:String = "";
+ var segmentName:String = "";
+ var effects:Array;
+
+ var mergedStyle:CSSStyleDeclaration;
+
+ var conditionCombiners:Object = {};
+ conditionCombiners[CSSConditionKind.CLASS] = ".";
+ conditionCombiners[CSSConditionKind.ID] = "#";
+ conditionCombiners[CSSConditionKind.PSEUDO] = ':';
+ var n:int = arr.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var className:int = arr[i];
+ if (className == CSSClass.CSSSelector)
+ {
+ var selectorName:String = arr[++i];
+ selector = new CSSSelector(selectorName, conditions, selector);
+ segmentName = selectorName + segmentName;
+ if (declarationName != "")
+ declarationName += " ";
+ declarationName += segmentName;
+ segmentName = "";
+ conditions = null;
+ }
+ else if (className == CSSClass.CSSCondition)
+ {
+ if (!conditions)
+ conditions = [];
+ var conditionType:String = arr[++i];
+ var conditionName:String = arr[++i];
+ condition = new CSSCondition(conditionType, conditionName);
+ conditions.push(condition);
+ segmentName = segmentName + conditionCombiners[conditionType] + conditionName;
+ }
+ else if (className == CSSClass.CSSStyleDeclaration)
+ {
+ var factoryName:int = arr[++i]; // defaultFactory or factory
+ var defaultFactory:Boolean = factoryName == CSSFactory.DefaultFactory;
+ if (defaultFactory)
+ {
+ mergedStyle = styleManager.getMergedStyleDeclaration(declarationName);
+ style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
+ }
+ else
+ {
+ style = styleManager.getStyleDeclaration(declarationName);
+ if (!style)
+ {
+ style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
+ if (factoryName == CSSFactory.Override)
+ newSelectors.push(style);
+ }
+ }
+ if (defaultFactory)
+ {
+ if (style.defaultFactory == null)
+ style.defaultFactory = factoryFunctions[declarationName];
+ }
+ else
+ {
+ if (factoryName == CSSFactory.Factory)
+ {
+ if (style.factory == null)
+ style.factory = factoryFunctions[declarationName];
+ }
+ else
+ {
+ // apply overrides from CSS StyleModule
+ var moduleStyles:Object = new factoryFunctions[declarationName];
+ for (var styleProp:String in moduleStyles)
+ {
+ style.setLocalStyle(styleProp, moduleStyles[styleProp]);
+ if (!overrideMap[declarationName])
+ overrideMap[declarationName] = [];
+ overrideMap[declarationName].push(styleProp);
+ }
+ }
+ }
+ if (defaultFactory && mergedStyle != null &&
+ (mergedStyle.defaultFactory == null ||
+ compareFactories(new style.defaultFactory(), new mergedStyle.defaultFactory())))
+ {
+ styleManager.setStyleDeclaration(style.mx_internal::selectorString, style, false);
+ }
+ selector = null;
+ conditions = null;
+ declarationName = "";
+ mergedStyle = null;
+ }
+ }
+ }
+
+ private static var propList1:Vector.<String> = new Vector.<String>();
+ private static var propList2:Vector.<String> = new Vector.<String>();
+
+ /**
+ * @private
+ */
+ private static function compareFactories(obj1:Object, obj2:Object):int
+ {
+ propList1.length = propList2.length = 0;
+ for (var p:String in obj1)
+ propList1.push(p);
+
+ for (p in obj2)
+ propList2.push(p);
+
+ if (propList1.length != propList2.length)
+ return 1;
+
+ for each (p in propList1)
+ {
+ if (obj1[p] !== obj2[p])
+ return 1;
+ }
+
+ return 0;
+ }
+
+ /**
+ * @private
+ */
+ public static function getInstance():IStyleManager2
+ {
+ if (!instance)
+ {
+ // In Flex 4 each application/module creates its own style manager.
+ // There will be no style manager if the application/module was compiled for
+ // Flex 3 compatibility. In that case create there will be no instance
+ // associated with the top-level application so create a new instance.
+ instance = IStyleManager2(IFlexModuleFactory(SystemManagerGlobals.topLevelSystemManagers[0]).
+ getImplementation("mx.styles::IStyleManager2"));
+
+ if (!instance)
+ instance = new StyleManagerImpl(SystemManagerGlobals.topLevelSystemManagers[0]);
+ }
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ *
+ * @param moduleFactory The module factory that is creating this instance. May not be null.
+ */
+ public function StyleManagerImpl(moduleFactory:IFlexModuleFactory = null)
+ {
+ super();
+
+ if (!moduleFactory) return;
+
+ this.moduleFactory = moduleFactory;
+ this.moduleFactory.registerImplementation("mx.styles::IStyleManager2", this);
+
+ // get our parent styleManager
+ if (moduleFactory is DisplayObject)
+ {
+ var request:Request = new Request(Request.GET_PARENT_FLEX_MODULE_FACTORY_REQUEST);
+ DisplayObject(moduleFactory).dispatchEvent(request);
+ var parentModuleFactory:IFlexModuleFactory = request.value as IFlexModuleFactory;
+ if (parentModuleFactory)
+ {
+ _parent = IStyleManager2(parentModuleFactory.
+ getImplementation("mx.styles::IStyleManager2"));
+ if (_parent is IEventDispatcher)
+ {
+ IEventDispatcher(_parent).addEventListener(FlexChangeEvent.STYLE_MANAGER_CHANGE, styleManagerChangeHandler, false, 0, true);
+ }
+ }
+
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Used to assign the selectorIndex in CSSStyleDeclaration so we can track
+ * the order they were added to the StyleManager.
+ * MatchStyleDeclarations has to return the declarations in the order
+ * they were declared
+ */
+ private var selectorIndex:int = 0;
+
+ /**
+ * @private
+ */
+ private var mqp:MediaQueryParser;
+
+ /**
+ * @private
+ * Set of inheriting non-color styles.
+ * This is not the complete set from CSS.
+ * Some of the omitted we don't support at all,
+ * others may be added later as needed.
+ * The <code>isInheritingTextFormatStyle()</code> method queries this set.
+ */
+ private var inheritingTextFormatStyles:Object =
+ {
+ align: true,
+ bold: true,
+ color: true,
+ font: true,
+ indent: true,
+ italic: true,
+ size: true
+ };
+
+ /**
+ * @private
+ * Set of styles for which setStyle() causes
+ * invalidateSize() to be called on the component.
+ * The method registerSizeInvalidatingStyle() adds to this set
+ * and isSizeInvalidatingStyle() queries this set.
+ */
+ private var sizeInvalidatingStyles:Object =
+ {
+ alignmentBaseline: true,
+ baselineShift: true,
+ blockProgression: true,
+ borderStyle: true,
+ borderThickness: true,
+ breakOpportunity : true,
+ cffHinting: true,
+ columnCount: true,
+ columnGap: true,
+ columnWidth: true,
+ digitCase: true,
+ digitWidth: true,
+ direction: true,
+ dominantBaseline: true,
+ firstBaselineOffset: true,
+ fontAntiAliasType: true,
+ fontFamily: true,
+ fontGridFitType: true,
+ fontLookup: true,
+ fontSharpness: true,
+ fontSize: true,
+ fontStyle: true,
+ fontThickness: true,
+ fontWeight: true,
+ headerHeight: true,
+ horizontalAlign: true,
+ horizontalGap: true,
+ justificationRule: true,
+ justificationStyle: true,
+ kerning: true,
+ leading: true,
+ leadingModel: true,
+ letterSpacing: true,
+ ligatureLevel: true,
+ lineBreak: true,
+ lineHeight: true,
+ lineThrough: true,
+ listAutoPadding: true,
+ listStylePosition: true,
+ listStyleType: true,
+ locale: true,
+ marginBottom: true,
+ marginLeft: true,
+ marginRight: true,
+ marginTop: true,
+ paddingBottom: true,
+ paddingLeft: true,
+ paddingRight: true,
+ paddingTop: true,
+ paragraphEndIndent: true,
+ paragraphStartIndent: true,
+ paragraphSpaceAfter: true,
+ paragraphSpaceBefore: true,
+ renderingMode: true,
+ strokeWidth: true,
+ tabHeight: true,
+ tabWidth: true,
+ tabStops: true,
+ textAlign: true,
+ textAlignLast: true,
+ textDecoration: true,
+ textIndent: true,
+ textJustify: true,
+ textRotation: true,
+ tracking: true,
+ trackingLeft: true,
+ trackingRight: true,
+ typographicCase: true,
+ verticalAlign: true,
+ verticalGap: true,
+ wordSpacing:true,
+ whitespaceCollapse: true
+ }
+
+ /**
+ * @private
+ * Set of styles for which setStyle() causes
+ * invalidateSize() to be called on the component's parent.
+ * The method registerParentSizeInvalidatingStyle() adds to this set
+ * and isParentSizeInvalidatingStyle() queries this set.
+ */
+ private var parentSizeInvalidatingStyles:Object =
+ {
+ baseline: true,
+ bottom: true,
+ horizontalCenter: true,
+ left: true,
+ right: true,
+ top: true,
+ verticalCenter: true
+ }
+
+ /**
+ * @private
+ * Set of styles for which setStyle() causes
+ * invalidateDisplayList() to be called on the component's parent.
+ * The method registerParentDisplayListInvalidatingStyle() adds to this set
+ * and isParentDisplayListInvalidatingStyle() queries this set.
+ */
+ private var parentDisplayListInvalidatingStyles:Object =
+ {
+ baseline: true,
+ bottom: true,
+ horizontalCenter: true,
+ left: true,
+ right: true,
+ top: true,
+ verticalCenter: true
+ }
+
+ /**
+ * @private
+ * Set of color names.
+ * The method registerColorName() adds to this set
+ * and isColorName() queries this set.
+ * All color names in this set are lowercase in order to support
+ * case-insensitive mapping in the StyleManager methods getColorName(),
+ * getColorNames(), registerColorName(), and isColorName().
+ * We handle color names at runtime in a case-insensitive way
+ * because the MXML compiler does this at compile time,
+ * in conformance with the CSS spec.
+ */
+ private var colorNames:Object =
+ {
+ transparent: "transparent",
+ black: 0x000000,
+ blue: 0x0000FF,
+ green: 0x008000,
+ gray: 0x808080,
+ silver: 0xC0C0C0,
+ lime: 0x00FF00,
+ olive: 0x808000,
+ white: 0xFFFFFF,
+ yellow: 0xFFFF00,
+ maroon: 0x800000,
+ navy: 0x000080,
+ red: 0xFF0000,
+ purple: 0x800080,
+ teal: 0x008080,
+ fuchsia: 0xFF00FF,
+ aqua: 0x00FFFF,
+ magenta: 0xFF00FF,
+ cyan: 0x00FFFF,
+
+ // IMPORTANT: Theme colors must also be updated
+ // in the Flex compiler's CSS parser
+ // (in \src\java\macromedia\css\Descriptor.java)
+ // and possibly other places as well. Grep for them!
+ halogreen: 0x80FF4D,
+ haloblue: 0x009DFF,
+ haloorange: 0xFFB600,
+ halosilver: 0xAECAD9
+ };
+
+ /**
+ * @private
+ * Whether any advanced selectors have been registered with this style
+ * manager.
+ */
+ private var _hasAdvancedSelectors:Boolean;
+
+ /**
+ * @private
+ * A map of CSS pseudo states. If a pseudo selector exists for a
+ * particular state name, it is likely that styles need to be recalculated.
+ */
+ private var _pseudoCSSStates:Object;
+
+ /**
+ * @private
+ * A map of CSS selectors -- such as "global", "Button", and ".bigRed" --
+ * to CSSStyleDeclarations.
+ * This collection is accessed via getStyleDeclaration(),
+ * setStyleDeclaration(), and clearStyleDeclaration().
+ */
+ private var _selectors:Object = {};
+
+ /**
+ * @private
+ */
+ private var styleModules:Object = {};
+
+ /**
+ * @private
+ * A map of selector "subjects" to an ordered map of selector Strings and
+ * their associated CSSStyleDeclarations.
+ * The subject is the right most simple type selector in a potential chain
+ * of selectors.
+ */
+ private var _subjects:Object = {};
+
+ /**
+ * @private
+ * Used for accessing localized Error messages.
+ */
+ private var resourceManager:IResourceManager =
+ ResourceManager.getInstance();
+
+ /**
+ * @private
+ * Cache merged styles between this and parent.
+ */
+ private var mergedInheritingStylesCache:Object;
+
+ /**
+ * @private
+ * This style manager's flex module factory.
+ */
+ private var moduleFactory:IFlexModuleFactory;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // parent
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _parent:IStyleManager2;
+
+ /**
+ * @private
+ *
+ * The style manager that is the parent of this StyleManager.
+ *
+ * @return the parent StyleManager or null if this is the top-level StyleManager.
+ */
+ public function get parent():IStyleManager2
+ {
+ return _parent;
+ }
+
+ //----------------------------------
+ // qualifiedTypeSelectors
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private static var _qualifiedTypeSelectors:Boolean = true;
+
+ public function get qualifiedTypeSelectors():Boolean
+ {
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ return false;
+
+ if (_qualifiedTypeSelectors)
+ return _qualifiedTypeSelectors;
+
+ if (parent)
+ return parent.qualifiedTypeSelectors;
+
+ return false;
+ }
+
+ public function set qualifiedTypeSelectors(value:Boolean):void
+ {
+ _qualifiedTypeSelectors = value;
+ }
+
+ //----------------------------------
+ // stylesRoot
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _stylesRoot:Object;
+
+ /**
+ * @private
+ * The root of all proto chains used for looking up styles.
+ * This object is initialized once by initProtoChainRoots() and
+ * then updated by calls to setStyle() on the global CSSStyleDeclaration.
+ * It is accessed by code that needs to construct proto chains,
+ * such as the initProtoChain() method of UIComponent.
+ */
+ public function get stylesRoot():Object
+ {
+ return _stylesRoot;
+ }
+ public function set stylesRoot(value:Object):void
+ {
+ _stylesRoot = value;
+ }
+
+ //----------------------------------
+ // inheritingStyles
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _inheritingStyles:Object = {};
+
+ /**
+ * @private
+ * Set of inheriting non-color styles.
+ * This is not the complete set from CSS.
+ * Some of the omitted we don't support at all,
+ * others may be added later as needed.
+ * The method registerInheritingStyle() adds to this set
+ * and isInheritingStyle() queries this set.
+ */
+ public function get inheritingStyles():Object
+ {
+ if (mergedInheritingStylesCache)
+ return mergedInheritingStylesCache;
+
+ var mergedStyles:Object = _inheritingStyles;
+
+ if (parent)
+ {
+ var otherStyles:Object = parent.inheritingStyles;
+
+ for (var obj:Object in otherStyles)
+ {
+ if (mergedStyles[obj] === undefined)
+ mergedStyles[obj] = otherStyles[obj];
+ }
+ }
+
+ mergedInheritingStylesCache = mergedStyles;
+
+ return mergedStyles;
+ }
+
+ public function set inheritingStyles(value:Object):void
+ {
+ _inheritingStyles = value;
+ mergedInheritingStylesCache = null;
+
+ if (hasEventListener(FlexChangeEvent.STYLE_MANAGER_CHANGE))
+ dispatchInheritingStylesChangeEvent();
+ }
+
+ //----------------------------------
+ // typeHierarchyCache
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _typeHierarchyCache:Object;
+
+ /**
+ * @private
+ */
+ public function get typeHierarchyCache():Object
+ {
+ if (_typeHierarchyCache == null)
+ _typeHierarchyCache = {};
+
+ return _typeHierarchyCache;
+ }
+
+ /**
+ * @private
+ */
+ public function set typeHierarchyCache(value:Object):void
+ {
+ _typeHierarchyCache = value;
+ }
+
+ //----------------------------------
+ // typeSelectorCache
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _typeSelectorCache:Object;
+
+ /**
+ * @private
+ */
+ public function get typeSelectorCache():Object
+ {
+ if (_typeSelectorCache == null)
+ _typeSelectorCache = {};
+
+ return _typeSelectorCache;
+ }
+
+ /**
+ * @private
+ */
+ public function set typeSelectorCache(value:Object):void
+ {
+ _typeSelectorCache = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This method is called by code autogenerated by the MXML compiler,
+ * after StyleManager.styles is popuplated with CSSStyleDeclarations.
+ */
+ public function initProtoChainRoots():void
+ {
+ if (!stylesRoot)
+ {
+ var style:CSSStyleDeclaration = getMergedStyleDeclaration("global");
+ if (style != null)
+ {
+ stylesRoot = style.addStyleToProtoChain({}, null);
+ }
+ }
+ }
+
+ /**
+ * Returns an array of strings of all CSS selectors registered with the StyleManager.
+ * Pass items in this array to the getStyleDeclaration function to get the corresponding CSSStyleDeclaration.
+ * Note that class selectors are prepended with a period.
+ *
+ * @return An array of all of the selectors
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get selectors():Array
+ {
+ var theSelectors:Array = [];
+ for (var i:String in _selectors)
+ theSelectors.push(i);
+
+ if (parent)
+ {
+ var otherSelectors:Array = parent.selectors;
+ for (i in otherSelectors)
+ theSelectors.push(i);
+ }
+
+ return theSelectors;
+ }
+
+ /**
+ * Determines whether any of the selectors registered with the style
+ * manager have been advanced selectors (descendant selector, id selector,
+ * non-global class selector, pseudo selector).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function hasAdvancedSelectors():Boolean
+ {
+ if (_hasAdvancedSelectors)
+ return true;
+
+ if (parent)
+ return parent.hasAdvancedSelectors();
+
+ return false;
+ }
+
+ /**
+ * @private
+ * Determines whether at least one pseudo-condition has been specified for
+ * the given state.
+ */
+ public function hasPseudoCondition(cssState:String):Boolean
+ {
+ if (_pseudoCSSStates != null && _pseudoCSSStates[cssState] != null)
+ return true;
+
+ if (parent)
+ return parent.hasPseudoCondition(cssState);
+
+ return false;
+ }
+
+ private static var propNames:Array = ["class", "id", "pseudo", "unconditional"];
+
+ /**
+ * Retrieve all style declarations applicable to this subject. The subject
+ * is the right most simple type selector in a selector chain. Returns a
+ * map of selectors with four properties: class for class selectors,
+ * id for id selectors, pseudo for pseudo selectors and unconditional
+ * for selectors without conditions
+ *
+ *
+ * @param subject The subject of the style declaration's selector.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function getStyleDeclarations(subject:String):Object
+ {
+ // For Flex 3 and earlier, if we were passed a subject with a package
+ // name, such as "mx.controls.Button", strip off the package name
+ // leaving just "Button" and look for that subject.
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ {
+ if (subject.charAt(0) != ".")
+ {
+ var index:int = subject.lastIndexOf(".");
+ if (index != -1)
+ subject = subject.substr(index + 1);
+ }
+ }
+
+ // NOTE: It's important the parent declarations come before this style
+ // manager's styles because the order here is the order they are added to the
+ // prototype chain.
+ var theSubjects:Object = null;
+
+ if (parent)
+ theSubjects = parent.getStyleDeclarations(subject);
+
+ var subjectsObject:Object = _subjects[subject];
+ if (!theSubjects)
+ {
+ if (subjectsObject)
+ theSubjects = subjectsObject;
+ }
+ else if (subjectsObject)
+ {
+ var mergedSubjects:Object = {};
+ for each (var prop:String in propNames)
+ {
+ mergedSubjects[prop] = subjectsObject[prop];
+ }
+ mergedSubjects.parent = theSubjects;
+ theSubjects = mergedSubjects;
+ }
+
+ return theSubjects;
+ }
+
+ private function isUnique(element:*, index:int, arr:Array):Boolean {
+ return (arr.indexOf(element) >= 0);
+ }
+
+ /**
+ * Gets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getStyleDeclaration(selector:String):CSSStyleDeclaration
+ {
+ // For Flex 3 and earlier, if we were passed a selector with a package
+ // name, such as "mx.controls.Button", strip off the package name
+ // leaving just "Button" and look for that type selector.
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ {
+ if (selector.charAt(0) != ".")
+ {
+ var index:int = selector.lastIndexOf(".");
+ if (index != -1)
+ selector = selector.substr(index + 1);
+ }
+ }
+
+ return _selectors[selector];
+ }
+
+ /**
+ * Gets a CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector. The CSSStyleDeclaration object is the created by merging
+ * the properties of the specified CSS selector of this style manager with all of the parent
+ * style managers.
+ *
+ * <p>
+ * If this style manager contains a style declaration for the given selector, its style properties
+ * will be updated with properties from the parent style manager's merged style declaration. If
+ * this style manager does not have a style declaration for a given selector, the parent's merged
+ * style declaration will be set into this style manager depending on the value of the <code>
+ * setSelector</code> parameter.
+ * </p>
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ * @param localOnly Controls whether the returned style declaration is the result of merging
+ * the properties of this and any parent style managers or if the style declaration is only
+ * from this style manager.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ public function getMergedStyleDeclaration(selector:String):CSSStyleDeclaration
+ {
+ var style:CSSStyleDeclaration = getStyleDeclaration(selector);
+ COMPILE::LATER
+ {
+ var parentStyle:CSSStyleDeclaration = null;
+
+ // If we have a parent, get its style and merge them with our style.
+ if (parent)
+ parentStyle = parent.getMergedStyleDeclaration(selector);
+
+ if (style || parentStyle)
+ {
+ style = new CSSMergedStyleDeclaration(style, parentStyle,
+ style ? style.selectorString : parentStyle.selectorString, this, false);
+ }
+ }
+ return style;
+ }
+
+ /**
+ * Sets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the specified selector is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the specified selector is a "type selector" and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * <p>Note that the provided selector will update the selector and subject
+ * of the styleDeclaration to keep them in sync.</p>
+ *
+ * @param selector The name of the CSS selector.
+ * @param styleDeclaration The new style declaration.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * The styles will be updated the next time this method or the <code>clearStyleDeclaration()</code> method
+ * is called with the <code>update</code> property set to <code>true</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setStyleDeclaration(selector:String,
+ styleDeclaration:CSSStyleDeclaration,
+ update:Boolean):void
+ {
+ // For Flex 3 and earlier, if we were passed a selector with a package
+ // name, such as "mx.controls.Button", strip off the package name
+ // leaving just "Button" and look for that type selector.
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ {
+ if (selector.charAt(0) != ".")
+ {
+ var index:int = selector.lastIndexOf(".");
+ if (index != -1)
+ selector = selector.substr(index + 1);
+ }
+ }
+
+ // Populate the selectors Array for this style declaration
+ styleDeclaration.selectorRefCount++;
+ styleDeclaration.selectorIndex = selectorIndex++;
+ _selectors[selector] = styleDeclaration;
+
+ // We also index by subject to help match advanced selectors
+ var subject:String = styleDeclaration.subject;
+ if (selector)
+ {
+ if (!styleDeclaration.subject)
+ {
+ // If the styleDeclaration does not yet have a subject we
+ // update its selector to keep it in sync with the provided
+ // selector.
+ styleDeclaration.selectorString = selector;
+ subject = styleDeclaration.subject;
+ }
+ else if (selector != styleDeclaration.selectorString)
+ {
+ // The styleDeclaration does not match the provided selector, so
+ // we ignore the subject on the styleDeclaration and try to
+ // determine the subject from the selector
+ var firstChar:String = selector.charAt(0);
+ if (firstChar == "." || firstChar == ":" || firstChar == "#")
+ {
+ subject = "*";
+ }
+ else
+ {
+ // TODO: Support parsing Advanced CSS selectors for a
+ // subject...
+ subject = selector;
+ }
+
+ // Finally, we update the styleDeclaration's selector to keep
+ // it in sync with the provided selector.
+ styleDeclaration.selectorString = selector;
+ }
+ }
+
+ if (subject != null)
+ {
+ // determine the kind of selector and add it to the appropriate
+ // bin of selectors for this subject
+ var kind:String = styleDeclaration.selector.conditions ?
+ styleDeclaration.selector.conditions[0].kind :
+ "unconditional";
+ var declarations:Object = _subjects[subject];
+ if (declarations == null)
+ {
+ declarations = {};
+ declarations[kind] = [styleDeclaration];
+ _subjects[subject] = declarations;
+ }
+ else
+ {
+ var declarationList:Array = declarations[kind] as Array;
+ if (declarationList == null)
+ declarations[kind] = [styleDeclaration];
+ else
+ declarationList.push(styleDeclaration);
+ }
+ }
+
+ // Also remember subjects that have pseudo-selectors to optimize
+ // styles during component state changes.
+ var pseudoCondition:String = styleDeclaration.getPseudoCondition();
+ if (pseudoCondition != null)
+ {
+ if (_pseudoCSSStates == null)
+ _pseudoCSSStates = {};
+
+ _pseudoCSSStates[pseudoCondition] = true;
+ }
+
+ // Record whether this is an advanced selector so that style declaration
+ // look up can be optimized for when no advanced selectors have been
+ // declared
+ if (styleDeclaration.isAdvanced())
+ _hasAdvancedSelectors = true;
+
+ // Flush cache and start over.
+ if (_typeSelectorCache)
+ _typeSelectorCache = {};
+
+ if (update)
+ styleDeclarationsChanged();
+ }
+
+ /**
+ * Clears the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the specified selector is a class selector (for example, ".bigMargins" or ".myStyle"),
+ * you must be sure to start the
+ * <code>selector</code> property with a period (.).</p>
+ *
+ * <p>If the specified selector is a type selector (for example, "Button"), do not start the
+ * <code>selector</code> property with a period.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector to clear.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * The styles will be updated the next time this method or the <code>setStyleDeclaration()</code> method is
+ * called with the <code>update</code> property set to <code>true</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function clearStyleDeclaration(selector:String,
+ update:Boolean):void
+ {
+ var styleDeclaration:CSSStyleDeclaration =
+ getStyleDeclaration(selector);
+
+ if (styleDeclaration && styleDeclaration.selectorRefCount > 0)
+ styleDeclaration.selectorRefCount--;
+
+ // Clear out legacy selectors map
+ delete _selectors[selector];
+
+ // Clear out matching decls from our selectors stored by subject
+ var decls:Array;
+ var i:int;
+ var decl:CSSStyleDeclaration;
+
+ if (styleDeclaration && styleDeclaration.subject)
+ {
+ decls = _subjects[styleDeclaration.subject] as Array;
+ if (decls)
+ {
+ // Work from the back of the array so we can remove elements
+ // as we go.
+ for (i = decls.length - 1; i >= 0; i--)
+ {
+ decl = decls[i];
+ if (decl && decl.selectorString == selector)
+ {
+ if (decls.length == 1)
+ delete _subjects[styleDeclaration.subject];
+ else
+ decls.splice(i, 1);
+ }
+ }
+ }
+ }
+ else
+ {
+ // Without a subject, we start searching all declarations for this
+ // selector, clear out matching selectors if found and then assume
+ // this we can limit our search to this subject and stop looking.
+ var matchingSubject:Boolean = false;
+ for each (decls in _subjects)
+ {
+ if (decls)
+ {
+ // Work from the back of the array so we can remove elements
+ // as we go.
+ for (i = decls.length - 1; i >= 0; i--)
+ {
+ decl = decls[i];
+ if (decl && decl.selectorString == selector)
+ {
+ matchingSubject = true;
+ if (decls.length == 1)
+ delete _subjects[decl.subject];
+ else
+ decls.splice(i, 1);
+ }
+ }
+
+ if (matchingSubject)
+ break;
+ }
+ }
+ }
+
+ if (update)
+ styleDeclarationsChanged();
+ }
+
+ /**
+ * @private
+ * After an entire selector is added, replaced, or removed,
+ * this method updates all the DisplayList trees.
+ */
+ public function styleDeclarationsChanged():void
+ {
+ var sms:Array /* of SystemManager */ =
+ SystemManagerGlobals.topLevelSystemManagers;
+ var n:int = sms.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ // Type as Object to avoid dependency on SystemManager or WindowedSystemManager
+ var sm:ISystemManager = sms[i];
+ var cm:Object = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ Object(cm).regenerateStyleCache(true);
+ Object(cm).notifyStyleChangeInChildren(null, true);
+ }
+ }
+
+ /**
+ * Adds to the list of styles that can inherit values
+ * from their parents.
+ *
+ * <p><b>Note:</b> Ensure that you avoid using duplicate style names, as name
+ * collisions can result in decreased performance if a style that is
+ * already used becomes inheriting.</p>
+ *
+ * @param styleName The name of the style that is added to the list of styles that can inherit values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerInheritingStyle(styleName:String):void
+ {
+ if (_inheritingStyles[styleName] != true)
+ {
+ _inheritingStyles[styleName] = true;
+ mergedInheritingStylesCache = null;
+
+ if (hasEventListener(FlexChangeEvent.STYLE_MANAGER_CHANGE))
+ dispatchInheritingStylesChangeEvent();
+ }
+ }
+
+ /**
+ * Tests to see if a style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified style is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isInheritingStyle(styleName:String):Boolean
+ {
+ if (mergedInheritingStylesCache)
+ return mergedInheritingStylesCache[styleName] == true;
+
+ if (_inheritingStyles[styleName] == true)
+ return true;
+
+ if (parent && parent.isInheritingStyle(styleName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Test to see if a TextFormat style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified TextFormat style
+ * is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isInheritingTextFormatStyle(styleName:String):Boolean
+ {
+ if (inheritingTextFormatStyles[styleName] == true)
+ return true;
+
+ if (parent && parent.isInheritingTextFormatStyle(styleName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.
+ *
+ * @param styleName The name of the style that you add to the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerSizeInvalidatingStyle(styleName:String):void
+ {
+ sizeInvalidatingStyles[styleName] = true;
+ }
+
+ /**
+ * Tests to see if a style changes the size of a component.
+ *
+ * <p>When one of these styles is set with the <code>setStyle()</code> method,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isSizeInvalidatingStyle(styleName:String):Boolean
+ {
+ if (sizeInvalidatingStyles[styleName] == true)
+ return true;
+
+ if (parent && parent.isSizeInvalidatingStyle(styleName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component's parent container.
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerParentSizeInvalidatingStyle(styleName:String):void
+ {
+ parentSizeInvalidatingStyles[styleName] = true;
+ }
+
+ /**
+ * Tests to see if the style changes the size of the component's parent container.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isParentSizeInvalidatingStyle(styleName:String):Boolean
+ {
+ if (parentSizeInvalidatingStyles[styleName] == true)
+ return true;
+
+ if (parent && parent.isParentSizeInvalidatingStyle(styleName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Adds to the list of styles which may affect the appearance
+ * or layout of the component's parent container.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerParentDisplayListInvalidatingStyle(
+ styleName:String):void
+ {
+ parentDisplayListInvalidatingStyles[styleName] = true;
+ }
+
+ /**
+ * Tests to see if this style affects the component's parent container in
+ * such a way as to require that the parent container redraws itself when this style changes.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the appearance or layout of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isParentDisplayListInvalidatingStyle(
+ styleName:String):Boolean
+ {
+ if (parentDisplayListInvalidatingStyles[styleName] == true)
+ return true;
+
+ if (parent && parent.isParentDisplayListInvalidatingStyle(styleName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Adds a color name to the list of aliases for colors.
+ *
+ * @param colorName The name of the color to add to the list; for example, "blue".
+ * If you later access this color name, the value is not case-sensitive.
+ *
+ * @param colorValue Color value, for example, 0x0000FF.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerColorName(colorName:String, colorValue:uint):void
+ {
+ colorNames[colorName.toLowerCase()] = colorValue;
+ }
+
+ /**
+ * Tests to see if the given String is an alias for a color value. For example,
+ * by default, the String "blue" is an alias for 0x0000FF.
+ *
+ * @param colorName The color name to test. This parameter is not case-sensitive.
+ *
+ * @return Returns <code>true</code> if <code>colorName</code> is an alias
+ * for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isColorName(colorName:String):Boolean
+ {
+ if (colorNames[colorName.toLowerCase()] !== undefined)
+ return true;
+
+ if (parent && parent.isColorName(colorName))
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Returns the numeric RGB color value that corresponds to the
+ * specified color string.
+ * The color string can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>.
+ *
+ * <p>This method returns a uint, such as 4521830, that represents a color. You can convert
+ * this uint to a hexadecimal value by passing the numeric base (in this case, 16), to
+ * the uint class's <code>toString()</code> method, as the following example shows:</p>
+ * <pre>
+ * import mx.styles.StyleManager;
+ * private function getNewColorName():void {
+ * StyleManager.registerColorName("soylentGreen",0x44FF66);
+ * trace(StyleManager.getColorName("soylentGreen").toString(16));
+ * }
+ * </pre>
+ *
+ * @param colorName The color name.
+ *
+ * @return Returns a uint that represents the color value or <code>NOT_A_COLOR</code>
+ * if the value of the <code>colorName</code> property is not an alias for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getColorName(colorName:Object):uint
+ {
+ var n:Number;
+
+ if (colorName is String)
+ {
+ if (colorName.charAt(0) == "#")
+ {
+ // Map "#77EE11" to 0x77EE11
+ n = Number("0x" + colorName.slice(1));
+ return isNaN(n) ? StyleManager.NOT_A_COLOR : uint(n);
+ }
+
+ if (colorName.charAt(1) == "x" && colorName.charAt(0) == '0')
+ {
+ // Map "#77EE11" to 0x77EE11
+ n = Number(colorName);
+ return isNaN(n) ? StyleManager.NOT_A_COLOR : uint(n);
+ }
+
+ // Map "red" or "Red" to 0xFF0000;
+ // Map "haloGreen" or "HaLoGrEeN" to 0x46FF00.
+ var c:* = colorNames[colorName.toLowerCase()];
+ if (c === undefined)
+ {
+ // If not found then try our parent
+ if (parent)
+ c = parent.getColorName(colorName);
+ }
+
+ if (c === undefined)
+ return StyleManager.NOT_A_COLOR;
+
+ return uint(c);
+ }
+
+ return uint(colorName);
+ }
+
+ /**
+ * Converts each element of the colors Array from a color name
+ * to a numeric RGB color value.
+ * Each color String can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>..
+ *
+ * @param colors An Array of color names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getColorNames(colors:Array /* of Number or String */):void
+ {
+ if (!colors)
+ return;
+
+ var n:int = colors.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if ((colors[i] != null) && isNaN(colors[i]))
+ {
+ var colorNumber:uint = getColorName(colors[i]);
+ if (colorNumber != StyleManager.NOT_A_COLOR)
+ colors[i] = colorNumber;
+ }
+ }
+ }
+
+ /**
+ * Determines if a specified parameter is a valid style property. For example:
+ *
+ * <pre>
+ * trace(StyleManager.isValidStyleValue(myButton.getStyle("color")).toString());
+ * </pre>
+ *
+ * <p>This can be useful because some styles can be set to values
+ * such as 0, <code>NaN</code>,
+ * the empty String (<code>""</code>), or <code>null</code>, which can
+ * cause an <code>if (value)</code> test to fail.</p>
+ *
+ * @param value The style property to test.
+ *
+ * @return If you pass the value returned by a <code>getStyle()</code> method call
+ * to this method, it returns <code>true</code> if the style
+ * was set and <code>false</code> if it was not set.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isValidStyleValue(value:*):Boolean
+ {
+ // By convention, we don't allow style values to be undefined,
+ // so we can check for this as the "not set" value.
+ if (value !== undefined)
+ return true;
+
+ if (parent)
+ return parent.isValidStyleValue(value);
+
+ return false;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ public function loadStyleDeclarations(
+ url:String, update:Boolean = true,
+ trustContent:Boolean = false,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):
+ IEventDispatcher
+ {
+ return loadStyleDeclarations2(url, update, applicationDomain, securityDomain);
+ }
+
+ /**
+ * Loads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ *
+ * @param update If true, all the DisplayList trees will be updated.
+ * The default is true.
+ *
+ * @return An IEventDispatcher implementation that supports
+ * StyleEvent.PROGRESS, StyleEvent.COMPLETE, and
+ * StyleEvent.ERROR.
+ *
+ * @see flash.system.SecurityDomain
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function loadStyleDeclarations2(
+ url:String, update:Boolean = true,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):
+ IEventDispatcher
+ {
+ var module:IModuleInfo = ModuleManager.getModule(url);
+ var thisStyleManager:IStyleManager2 = this;
+
+ var readyHandler:Function = function(moduleEvent:ModuleEvent):void
+ {
+ var styleModule:IStyleModule = IStyleModule(moduleEvent.module.factory.create());
+
+ // Register the style module to use this style manager.
+ moduleEvent.module.factory.registerImplementation("mx.styles::IStyleManager2", thisStyleManager);
+ styleModule.setStyleDeclarations(thisStyleManager);
+ styleModules[moduleEvent.module.url].styleModule = styleModule;
+ if (update)
+ styleDeclarationsChanged();
+ };
+
+ module.addEventListener(ModuleEvent.READY, readyHandler,
+ false, 0, true);
+
+ var styleEventDispatcher:StyleEventDispatcher =
+ new StyleEventDispatcher(module);
+
+ var errorHandler:Function = function(moduleEvent:ModuleEvent):void
+ {
+ var errorText:String = resourceManager.getString(
+ "styles", "unableToLoad", [ moduleEvent.errorText, url ]);
+
+ if (styleEventDispatcher.willTrigger(StyleEvent.ERROR))
+ {
+ var styleEvent:StyleEvent = new StyleEvent(
+ StyleEvent.ERROR, moduleEvent.bubbles, moduleEvent.cancelable);
+ styleEvent.bytesLoaded = 0;
+ styleEvent.bytesTotal = 0;
+ styleEvent.errorText = errorText;
+ styleEventDispatcher.dispatchEvent(styleEvent);
+ }
+ else
+ {
+ throw new Error(errorText);
+ }
+ };
+
+ module.addEventListener(ModuleEvent.ERROR, errorHandler,
+ false, 0, true);
+
+ styleModules[url] =
+ new StyleModuleInfo(module, readyHandler, errorHandler);
+
+ // This Timer gives the loadStyleDeclarations() caller a chance
+ // to add event listeners to the return value, before the module
+ // is loaded.
+ var timer:Timer = new Timer(0);
+ var timerHandler:Function = function(event:TimerEvent):void
+ {
+ timer.removeEventListener(TimerEvent.TIMER, timerHandler);
+ timer.stop();
+ module.load(applicationDomain, securityDomain, null, moduleFactory);
+ };
+
+ timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
+
+ timer.start();
+
+ return styleEventDispatcher;
+ }
+
+ /**
+ * Unloads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ *
+ * @param update If true, all the DisplayList trees will be updated.
+ * The default is true.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function unloadStyleDeclarations(
+ url:String, update:Boolean = true):void
+ {
+ var styleModuleInfo:StyleModuleInfo = styleModules[url];
+ if (styleModuleInfo)
+ {
+ styleModuleInfo.styleModule.unload();
+
+ var module:IModuleInfo = styleModuleInfo.module;
+ module.unload();
+
+ module.removeEventListener(ModuleEvent.READY,
+ styleModuleInfo.readyHandler);
+ module.removeEventListener(ModuleEvent.ERROR,
+ styleModuleInfo.errorHandler);
+
+ styleModules[url] = null;
+ }
+
+ if (update)
+ styleDeclarationsChanged();
+ }
+
+
+ /**
+ * @private
+ */
+ private function dispatchInheritingStylesChangeEvent():void
+ {
+ var event:Event = new FlexChangeEvent(FlexChangeEvent.STYLE_MANAGER_CHANGE,
+ false, false, {property: "inheritingStyles"});
+ dispatchEvent(event);
+ }
+
+ /**
+ * @private
+ */
+ public function acceptMediaList(value:String):Boolean
+ {
+ if (!mqp)
+ {
+ mqp = MediaQueryParser.instance;
+ if (!mqp)
+ {
+ mqp = new MediaQueryParser(moduleFactory);
+ MediaQueryParser.instance = mqp;
+ }
+ }
+ return mqp.parse(value);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ private function styleManagerChangeHandler(event:FlexChangeEvent):void
+ {
+ if (!event.data)
+ return; // invalid message
+
+ var property:String = event.data["property"];
+
+ if (property == "inheritingStyles")
+ {
+ mergedInheritingStylesCache = null;
+ }
+
+ if (hasEventListener(FlexChangeEvent.STYLE_MANAGER_CHANGE))
+ dispatchEvent(event);
+ }
+}
+
+}
+
+import org.apache.flex.events.EventDispatcher;
+import mx.events.ModuleEvent;
+import mx.events.StyleEvent;
+import mx.modules.IModuleInfo;
+import mx.styles.IStyleModule;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: StyleEventDispatcher
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+COMPILE::LATER
+class StyleEventDispatcher extends EventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function StyleEventDispatcher(moduleInfo:IModuleInfo)
+ {
+ super();
+
+ moduleInfo.addEventListener(
+ ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
+
+ moduleInfo.addEventListener(
+ ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private function moduleInfo_progressHandler(event:ModuleEvent):void
+ {
+ var styleEvent:StyleEvent = new StyleEvent(
+ StyleEvent.PROGRESS, event.bubbles, event.cancelable);
+ styleEvent.bytesLoaded = event.bytesLoaded;
+ styleEvent.bytesTotal = event.bytesTotal;
+ dispatchEvent(styleEvent);
+ }
+
+ /**
+ * @private
+ */
+ private function moduleInfo_readyHandler(event:ModuleEvent):void
+ {
+ var styleEvent:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
+ styleEvent.bytesLoaded = event.bytesLoaded;
+ styleEvent.bytesTotal = event.bytesTotal;
+ dispatchEvent(styleEvent);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: StyleModuleInfo
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+COMPILE::LATER
+class StyleModuleInfo
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function StyleModuleInfo(module:IModuleInfo,
+ readyHandler:Function,
+ errorHandler:Function)
+ {
+ super();
+
+ this.module = module;
+ this.readyHandler = readyHandler;
+ this.errorHandler = errorHandler;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // errorHandler
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var errorHandler:Function;
+
+ //----------------------------------
+ // readyHandler
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var readyHandler:Function;
+
+ //----------------------------------
+ // styleModule
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var styleModule:IStyleModule;
+
+ //----------------------------------
+ // module
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var module:IModuleInfo
+}
+
+class CSSClass
+{
+ public static const CSSSelector:int = 0;
+ public static const CSSCondition:int = 1;
+ public static const CSSStyleDeclaration:int = 2;
+}
+
+class CSSFactory
+{
+ public static const DefaultFactory:int = 0;
+ public static const Factory:int = 1;
+ public static const Override:int = 2;
+}
+
+class CSSDataType
+{
+ public static const Native:int = 0;
+ public static const Definition:int = 1;
+}
[33/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IEmbeddedFontRegistry.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IEmbeddedFontRegistry.as b/frameworks/projects/MX/src/main/flex/mx/core/IEmbeddedFontRegistry.as
new file mode 100644
index 0000000..bf4a655
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IEmbeddedFontRegistry.as
@@ -0,0 +1,150 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import mx.managers.ISystemManager;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * Interface to a registery of fonts embedded in SWF files.
+ */
+public interface IEmbeddedFontRegistry
+{
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Registers a font and associates it with a moduleFactory.
+ *
+ * @param font Describes attributes of the font to register.
+ *
+ * @param moduleFactory The moduleFactory where the font is embedded.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerFont(font:EmbeddedFont,
+ moduleFactory:IFlexModuleFactory):void;
+
+ /**
+ * Deregisters a font.
+ *
+ * <p>The <code>moduleFactory</code> is provided to resolve the case
+ * where multiple fonts are registered with the same attributes.</p>
+ *
+ * @param font Describes attributes of the font to register.
+ *
+ * @param moduleFactory moduleFactory where the font is embedded.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function deregisterFont(font:EmbeddedFont,
+ moduleFactory:IFlexModuleFactory):void;
+
+ /**
+ * Returns true if the embedded font with the given characteristics is
+ * in the <code>moduleFactory</code>, otherwise returns false.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function isFontRegistered(font:EmbeddedFont,
+ moduleFactory:IFlexModuleFactory):Boolean;
+
+ /**
+ * Finds the <code>moduleFactory</code> associated with a font.
+ *
+ * <p>The <code>moduleFactory</code> is used to resolve the case
+ * where multiple fonts are registered with the same attributes.</p>
+ *
+ * @param fontName FontFamily of the font
+ * @param bold true for bold fontWeight
+ * @param italic true for italic fontStyle
+ * @param object The Object using this font
+ *
+ * @param defaultModuleFactory Used to resolve conflicts in the case
+ * where the same font is registered for multiple module factories.
+ * If one of the module factories of a font is associated with
+ * defaultModuleFactory, then that moduleFactory is returned.
+ * Otherwise the most recently registered moduleFactory will be chosen.
+ *
+ * @param systemManager Optional ISystemManager instance to use to
+ * look for locally registered fonts that may not be present in our
+ * compile time registry.
+ *
+ * @param embeddedCff Optional flag to request that the resolved font
+ * be tested for compatibilility. If true, we ensure the font is
+ * of type EMBEDDED_CFF, if false we ensure it is EMBEDDED.
+ *
+ * @return moduleFactory that can be used to create an object
+ * in the context of the font.
+ * null if the font is not found in the registry.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getAssociatedModuleFactory(
+ fontName:String, bold:Boolean, italic:Boolean,
+ object:Object,
+ defaultModuleFactory:IFlexModuleFactory,
+ systemManager:ISystemManager,
+ embeddedCff:*=undefined):IFlexModuleFactory;
+
+ /**
+ * Gets an array of all the fonts that have been registered.
+ *
+ * <p>Each element in the array is of type EmbeddedFont.</p>
+ *
+ * @return Array of EmbeddedFont objects.
+ * Fonts that have been registered multiple times will appear
+ * multiple times in the array.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getFonts():Array;
+
+ /**
+ * Gets a string pattern based on the font attributes
+ *
+ * @return String describing font
+ */
+ function getFontStyle(bold:Boolean, italic:Boolean):String
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..c09b9ef
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IFlexDisplayObject.as
@@ -0,0 +1,153 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+//import flash.display.IBitmapDrawable;
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.geom.Rectangle;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import org.apache.flex.geom.Rectangle;
+}
+import org.apache.flex.events.IEventDispatcher;
+
+/**
+ * The IFlexDisplayObject interface defines the interface for skin elements.
+ * At a minimum, a skin must be a DisplayObject and implement this interface.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFlexDisplayObject extends /*IBitmapDrawable, */IEventDispatcher
+{
+ include "IDisplayObjectInterface.as"
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+
+ //----------------------------------
+ // measuredHeight
+ //----------------------------------
+
+ /**
+ * The measured height of this object.
+ *
+ * <p>This is typically hard-coded for graphical skins
+ * because this number is simply the number of pixels in the graphic.
+ * For code skins, it can also be hard-coded
+ * if you expect to be drawn at a certain size.
+ * If your size can change based on properties, you may want
+ * to also be an ILayoutManagerClient so a <code>measure()</code>
+ * method will be called at an appropriate time,
+ * giving you an opportunity to compute a <code>measuredHeight</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get measuredHeight():Number;
+
+ //----------------------------------
+ // measuredWidth
+ //----------------------------------
+
+ /**
+ * The measured width of this object.
+ *
+ * <p>This is typically hard-coded for graphical skins
+ * because this number is simply the number of pixels in the graphic.
+ * For code skins, it can also be hard-coded
+ * if you expect to be drawn at a certain size.
+ * If your size can change based on properties, you may want
+ * to also be an ILayoutManagerClient so a <code>measure()</code>
+ * method will be called at an appropriate time,
+ * giving you an opportunity to compute a <code>measuredHeight</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get measuredWidth():Number;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Moves this object to the specified x and y coordinates.
+ *
+ * @param x The new x-position for this object.
+ *
+ * @param y The new y-position for this object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function move(x:Number, y:Number):void;
+
+ /**
+ * Sets the actual size of this object.
+ *
+ * <p>This method is mainly for use in implementing the
+ * <code>updateDisplayList()</code> method, which is where
+ * you compute this object's actual size based on
+ * its explicit size, parent-relative (percent) size,
+ * and measured size.
+ * You then apply this actual size to the object
+ * by calling <code>setActualSize()</code>.</p>
+ *
+ * <p>In other situations, you should be setting properties
+ * such as <code>width</code>, <code>height</code>,
+ * <code>percentWidth</code>, or <code>percentHeight</code>
+ * rather than calling this method.</p>
+ *
+ * @param newWidth The new width for this object.
+ *
+ * @param newHeight The new height for this object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setActualSize(newWidth:Number, newHeight:Number):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IFlexModule.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IFlexModule.as b/frameworks/projects/MX/src/main/flex/mx/core/IFlexModule.as
new file mode 100644
index 0000000..a2afc00
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IFlexModule.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IFlexModule interface is used as an optional contract with IFlexModuleFactory.
+ * When an IFlexModule instance is created with the IFlexModuleFactory, the factory
+ * stores a reference to itself after creation.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFlexModule
+{
+ /**
+ * @private
+ */
+ function set moduleFactory(factory:IFlexModuleFactory):void;
+
+ /**
+ * @private
+ */
+ function get moduleFactory():IFlexModuleFactory;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IFlexModuleFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IFlexModuleFactory.as b/frameworks/projects/MX/src/main/flex/mx/core/IFlexModuleFactory.as
new file mode 100644
index 0000000..e50878f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IFlexModuleFactory.as
@@ -0,0 +1,276 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IFlexModuleFactory interface represents the contract expected
+ * for bootstrapping Flex applications and dynamically loaded
+ * modules.
+ *
+ * <p>Calling the <code>info()</code> method is legal immediately after
+ * the <code>complete</code> event is dispatched.</p>
+ *
+ * <p>A well-behaved module dispatches a <code>ready</code> event when
+ * it is safe to call the <code>create()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFlexModuleFactory
+{
+ //import flash.display.LoaderInfo;
+ //import flash.utils.Dictionary;
+
+ //import mx.core.RSLData;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Controls whether the domains allowed by calls to <code>allowDomain()</code>
+ * are also allowed by RSLs loaded after the call. Additional RSLs
+ * may be loaded into this module factory by sub-applications or modules.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ //function get allowDomainsInNewRSLs():Boolean;
+ //function set allowDomainsInNewRSLs(value:Boolean):void;
+
+ /**
+ * Controls whether the domains allowed by calls to <code>allowInsecureDomain()
+ * </code> are also allowed by RSLs loaded after the call. Additional RSLs
+ * may be added to this module factory by sub-applications or modules.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ //function get allowInsecureDomainsInNewRSLs():Boolean;
+ //function set allowInsecureDomainsInNewRSLs(value:Boolean):void;
+
+ /**
+ * The RSLs loaded by this SystemManager or FlexModuleFactory before the
+ * application starts. This dictionary may also include RSLs loaded into this
+ * module factory's application domain by other modules or
+ * sub-applications. When a new dictionary entry is added by a child module
+ * factory an <code>RSLEvent.RSL_ADD_PRELOADED</code> event is dispatched
+ * by module factory owning the dictionary.
+ *
+ * Information about preloadedRSLs is stored in a Dictionary. The key is
+ * the RSL's LoaderInfo. The value is the a Vector of RSLData where the
+ * first element is the primary RSL and the remaining elements are
+ * failover RSLs.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 3
+ */
+ //function get preloadedRSLs():Dictionary;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds an RSL to the preloadedRSLs list. This method is called by child
+ * module factories when they add load an RSL into this module factory's
+ * application domain.
+ *
+ * <p>You do not call this method directly. This method is called by child
+ * module factories when they add load an RSL into this module factory's
+ * application domain.</p>
+ *
+ * @param loaderInfo The loaderInfo of the loaded RSL.
+ * @param rsl The RSL's configuration information. A Vector of RSLData.
+ * The first element in the array is the primary RSL. The remaining
+ * elements are failover RSLs.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ //function addPreloadedRSL(loaderInfo:LoaderInfo, rsl:Vector.<RSLData>):void;
+
+ /**
+ * Calls the <code>Security.allowDomain()</code> method for the SWF
+ * associated with this IFlexModuleFactory plus all the SWFs associated
+ * with RSLs preloaded by this IFlexModuleFactory. RSLs loaded after this
+ * call will, by default, allow the same domains as have been allowed by
+ * previous calls to this method. This behavior is controlled by the <code>
+ * allowDomainsInNewRSLs</code> property.
+ *
+ * @param domains One or more strings or URLRequest objects that name
+ * the domains from which you want to allow access.
+ * You can specify the special domain "*" to allow access from all domains.
+ *
+ * @see flash.system.Security#allowDomain()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ function allowDomain(... domains):void;
+
+ /**
+ * Calls the <code>Security.allowInsecureDomain()</code> method for the
+ * SWF associated with this IFlexModuleFactory
+ * plus all the SWFs associated with RSLs preloaded by this
+ * IFlexModuleFactory. RSLs loaded after this call will, by default,
+ * allow the same domains as have been allowed by
+ * previous calls to this method. This behavior is controlled by the <code>
+ * allowInsecureDomainsInNewRSLs</code> property.
+ *
+ * @param domains One or more strings or URLRequest objects that name
+ * the domains from which you want to allow access.
+ * You can specify the special domain "*" to allow access from all domains.
+ *
+ * @see flash.system.Security#allowInsecureDomain()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ function allowInsecureDomain(... domains):void;
+
+ /**
+ * A way to call a method in this IFlexModuleFactory's context
+ *
+ * @param fn The function or method to call.
+ * @param thisArg The <code>this</code> pointer for the function.
+ * @param argArray The arguments for the function.
+ * @param returns If <code>true</code>, the function returns a value.
+ *
+ * @return Whatever the function returns, if anything.
+ *
+ * @see Function.apply
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 3
+ */
+ function callInContext(fn:Function, thisArg:Object,
+ argArray:Array, returns:Boolean = true):*;
+
+ /**
+ * A factory method that requests
+ * an instance of a definition known to the module.
+ *
+ * <p>You can provide an optional set of parameters to let
+ * building factories change what they create based
+ * on the input.
+ * Passing <code>null</code> indicates that the default
+ * definition is created, if possible.</p>
+ *
+ * @param parameters An optional list of arguments. You can pass any number
+ * of arguments, which are then stored in an Array called <code>parameters</code>.
+ *
+ * @return An instance of the module, or <code>null</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function create(... parameters):Object;
+
+ /**
+ * Get the implementation for an interface.
+ * Similar to <code>Singleton.getInstance()</code> method, but per-
+ * IFlexModuleFactory.
+ *
+ * @param interfaceName The interface.
+ *
+ * @return The implementation for the interface.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getImplementation(interfaceName:String):Object;
+
+ /**
+ * Returns a block of key/value pairs
+ * that hold static data known to the module.
+ * This method always succeeds, but can return an empty object.
+ *
+ * @return An object containing key/value pairs. Typically, this object
+ * contains information about the module or modules created by this
+ * factory; for example:
+ *
+ * <pre>
+ * return {"description": "This module returns 42."};
+ * </pre>
+ *
+ * Other common values in the returned object include the following:
+ * <ul>
+ * <li><code>fonts</code>: A list of embedded font faces.</li>
+ * <li><code>rsls</code>: A list of run-time shared libraries.</li>
+ * <li><code>mixins</code>: A list of classes initialized at startup.</li>
+ * </ul>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function info():Object;
+
+ /**
+ * Register an implementation for an interface.
+ * Similar to the <code>Singleton.registerClass()</code> method, but per-
+ * IFlexModuleFactory, and takes an instance not a class.
+ *
+ * @param interfaceName The interface.
+ *
+ * @param impl The implementation.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function registerImplementation(interfaceName:String,
+ impl:Object):void;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IFontContextComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IFontContextComponent.as b/frameworks/projects/MX/src/main/flex/mx/core/IFontContextComponent.as
new file mode 100644
index 0000000..2477e48
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IFontContextComponent.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * Allows a component to support a font context property.
+ * The property will be set on the component by the framework
+ * as the child is added to the display list.
+ *
+ * A font context is important for components that create flash.text.TextField
+ * objects with embedded fonts.
+ * If an embedded font is not registered using Font.registerFont(),
+ * TextField objects can only use embedded fonts if they are created
+ * in the context of the embedded font.
+ * This interface provides for tracking the font context of a component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFontContextComponent
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // fontContext
+ //----------------------------------
+
+ /**
+ * The module factory that provides the font context for this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get fontContext():IFlexModuleFactory;
+
+ /**
+ * @private
+ */
+ function set fontContext(moduleFactory:IFlexModuleFactory):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IInteractiveObjectInterface.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IInteractiveObjectInterface.as b/frameworks/projects/MX/src/main/flex/mx/core/IInteractiveObjectInterface.as
new file mode 100644
index 0000000..1ba9416
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IInteractiveObjectInterface.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ * The methods here would normally just be in IInteractiveObject,
+ * but for backward compatibility, their ancestor methods have to be included
+ * directly into IFlexDisplayObject, so these also have to be kept in
+ * this separate include file so it can be used in ITextField
+ */
+
+ /**
+ * @copy flash.display.InteractiveObject#tabEnabled
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get tabEnabled():Boolean;
+ function set tabEnabled(enabled:Boolean):void;
+
+ /**
+ * @copy flash.display.InteractiveObject#tabIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get tabIndex():int;
+ function set tabIndex(index:int):void;
+
+ /**
+ * @copy flash.display.InteractiveObject#focusRect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusRect():Object;
+ function set focusRect(focusRect:Object):void;
+
+ /**
+ * @copy flash.display.InteractiveObject#mouseEnabled
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mouseEnabled():Boolean;
+ function set mouseEnabled(enabled:Boolean):void;
+
+ /**
+ * @copy flash.display.InteractiveObject#doubleClickEnabled
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get doubleClickEnabled():Boolean;
+ function set doubleClickEnabled(enabled:Boolean):void;
+
+ /**
+ * @private
+ function get accessibilityImplementation() : AccessibilityImplementation;
+ function set accessibilityImplementation( value : AccessibilityImplementation ) : void;
+ */
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IInvalidating.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IInvalidating.as b/frameworks/projects/MX/src/main/flex/mx/core/IInvalidating.as
new file mode 100644
index 0000000..594601d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IInvalidating.as
@@ -0,0 +1,119 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IInvalidating interface defines the interface for components
+ * that use invalidation to do delayed -- rather than immediate --
+ * property commitment, measurement, drawing, and layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IInvalidating
+{
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Calling this method results in a call to the component's
+ * <code>validateProperties()</code> method
+ * before the display list is rendered.
+ *
+ * <p>For components that extend UIComponent, this implies
+ * that <code>commitProperties()</code> is called.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateProperties():void;
+
+ /**
+ * Calling this method results in a call to the component's
+ * <code>validateSize()</code> method
+ * before the display list is rendered.
+ *
+ * <p>For components that extend UIComponent, this implies
+ * that <code>measure()</code> is called, unless the component
+ * has both <code>explicitWidth</code> and <code>explicitHeight</code>
+ * set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateSize():void;
+
+ /**
+ * Calling this method results in a call to the component's
+ * <code>validateDisplayList()</code> method
+ * before the display list is rendered.
+ *
+ * <p>For components that extend UIComponent, this implies
+ * that <code>updateDisplayList()</code> is called.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateDisplayList():void;
+
+ /**
+ * Validates and updates the properties and layout of this object
+ * by immediately calling <code>validateProperties()</code>,
+ * <code>validateSize()</code>, and <code>validateDisplayList()</code>,
+ * if necessary.
+ *
+ * <p>When properties are changed, the new values do not usually have
+ * an immediate effect on the component.
+ * Usually, all of the application code that needs to be run
+ * at that time is executed. Then the LayoutManager starts
+ * calling the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, and <code>validateDisplayList()</code>
+ * methods on components, based on their need to be validated and their
+ * depth in the hierarchy of display list objects.</p>
+ *
+ * <p>For example, setting the <code>width</code> property is delayed, because
+ * it may require recalculating the widths of the object's children
+ * or its parent.
+ * Delaying the processing also prevents it from being repeated
+ * multiple times if the application code sets the <code>width</code> property
+ * more than once.
+ * This method lets you manually override this behavior.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateNow():void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/ILayoutDirectionElement.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ILayoutDirectionElement.as b/frameworks/projects/MX/src/main/flex/mx/core/ILayoutDirectionElement.as
new file mode 100644
index 0000000..12726ee
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ILayoutDirectionElement.as
@@ -0,0 +1,82 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+ /**
+ * The ILayoutDirectionElement interface defines the minimum properties and methods
+ * required for an Object to support the layoutDirection property.
+ *
+ * @see mx.core.LayoutDirection
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ public interface ILayoutDirectionElement
+ {
+
+ /**
+ * Specifies the desired layout direction for an element: one of LayoutDirection.LTR
+ * (left to right), LayoutDirection.RTL (right to left), or null (inherit).
+ *
+ * This property is typically backed by an inheriting style. If null,
+ * the layoutDirection style will be set to undefined.
+ *
+ * Classes like GraphicElement, which implement ILayoutDirectionElement but do not
+ * support styles, must additionally support a null value for this property
+ * which means the layoutDirection must be inherited from its parent.
+ *
+ * @see mx.core.LayoutDirection
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get layoutDirection():String;
+
+ /**
+ * @private
+ */
+ function set layoutDirection(value:String):void;
+
+ /**
+ * An element must call this method when its layoutDirection changes or
+ * when its parent's layoutDirection changes.
+ *
+ * If they differ, this method is responsible for mirroring the element’s contents
+ * and for updating the element’s post-layout transform so that descendants inherit
+ * a mirrored coordinate system. IVisualElements typically implement
+ * mirroring by using postLayoutTransformOffsets to scale the X axis by -1 and
+ * to translate the x coordinate of the origin by the element's width.
+ *
+ * The net effect of this "mirror" transform is to reverse the direction
+ * in which the X axis increases without changing the element's location
+ * relative to its parent's origin.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function invalidateLayoutDirection():void;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..04056bf
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ILayoutElement.as
@@ -0,0 +1,851 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import flash.events.IEventDispatcher;
+import flash.geom.Matrix;
+import flash.geom.Matrix3D;
+import flash.geom.Vector3D;
+
+/**
+ * The ILayoutElement interface is used primarily by the layout classes to query,
+ * size and position the elements of GroupBase containers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface ILayoutElement extends IEventDispatcher
+{
+/**
+ * The horizontal distance in pixels from the left edge of the component to the
+ * anchor target's left edge.
+ *
+ * <p>By default the anchor target is the container's content area. In layouts
+ * with advanced constraints, the target can be a constraint column.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format
+ * "anchorTargetName:value". For example, "col1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get left():Object;
+
+ /**
+ * @private
+ */
+ function set left(value:Object):void;
+
+ /**
+ * The horizontal distance in pixels from the right edge of the component to the
+ * anchor target's right edge.
+ *
+ * <p>By default the anchor target is the container's content area. In layouts
+ * with advanced constraints, the target can be a constraint column.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format
+ * "anchorTargetName:value". For example, "col1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get right():Object;
+
+ /**
+ * @private
+ */
+ function set right(value:Object):void;
+
+ /**
+ * The vertical distance in pixels from the top edge of the component to the
+ * anchor target's top edge.
+ *
+ * <p>By default the anchor target is the container's content area. In layouts
+ * with advanced constraints, the target can be a constraint row.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format
+ * "anchorTargetName:value". For example, "row1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get top():Object;
+
+ /**
+ * @private
+ */
+ function set top(value:Object):void;
+
+ /**
+ * The vertical distance in pixels from the bottom edge of the component to the
+ * anchor target's bottom edge.
+ *
+ * <p>By default the anchor target is the container's content area. In layouts
+ * with advanced constraints, the target can be a constraint row.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format:
+ * "anchorTargetName:value". For example, "row1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get bottom():Object;
+
+ /**
+ * @private
+ */
+ function set bottom(value:Object):void;
+
+ /**
+ * The horizontal distance in pixels from the center of the component to the
+ * center of the anchor target's content area.
+ *
+ * <p>The default anchor target is the container itself.</p>
+ *
+ * <p>In layouts with advanced constraints, the anchor target can be a constraint column.
+ * Then the content area is the space between the preceding column
+ * (or container side) and the target column.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format
+ * "constraintColumnId:value". For example, "col1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get horizontalCenter():Object;
+
+ /**
+ * @private
+ */
+ function set horizontalCenter(value:Object):void;
+
+ /**
+ * The vertical distance in pixels from the center of the component to the
+ * center of the anchor target's content area.
+ *
+ * <p>The default anchor target is the container itself.</p>
+ *
+ * <p>In layouts with advanced constraints, the anchor target can be a constraint row.
+ * Then the content area is the space between the preceding row
+ * (or container side) and the target row.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format
+ * "constraintColumnId:value". For example, "row1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get verticalCenter():Object;
+
+ /**
+ * @private
+ */
+ function set verticalCenter(value:Object):void;
+
+ /**
+ * The vertical distance in pixels from the anchor target to
+ * the control's baseline position.
+ *
+ * <p>By default the anchor target is the top edge of the container's
+ * content area. In layouts with advanced constraints, the target can be
+ * a constraint row.</p>
+ *
+ * <p>Setting the property to a number or to a numerical string like "10"
+ * specifies use of the default anchor target.</p>
+ *
+ * <p>To specify an anchor target, set the property value to a string in the format:
+ * "anchorTargetName:value". For example, "row1:10".</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get baseline():Object;
+
+ /**
+ * @private
+ */
+ function set baseline(value:Object):void;
+
+ /**
+ * The y-coordinate of the baseline
+ * of the first line of text of the component.
+ *
+ * <p>This property is used to implement
+ * the <code>baseline</code> constraint style.
+ * It is also used to align the label of a FormItem
+ * with the controls in the FormItem.</p>
+ *
+ * <p>Each component should override this property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get baselinePosition():Number;
+
+ /**
+ * Specifies the width of a component as a percentage
+ * of its parent's size. Allowed values are 0-100.
+ * Setting the <code>width</code> or <code>explicitWidth</code> properties
+ * resets this property to NaN.
+ *
+ * <p>This property returns a numeric value only if the property was
+ * previously set; it does not reflect the exact size of the component
+ * in percent.</p>
+ *
+ * @default NaN
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get percentWidth():Number;
+
+ /**
+ * @private
+ */
+ function set percentWidth(value:Number):void;
+
+ /**
+ * Specifies the height of a component as a percentage
+ * of its parent's size. Allowed values are 0-100.
+ * Setting the <code>height</code> or <code>explicitHeight</code> properties
+ * resets this property to NaN.
+ *
+ * <p>This property returns a numeric value only if the property was
+ * previously set; it does not reflect the exact size of the component
+ * in percent.</p>
+ *
+ * @default NaN
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get percentHeight():Number;
+
+ /**
+ * @private
+ */
+ function set percentHeight(value:Number):void;
+
+ /**
+ * @copy mx.core.UIComponent#includeInLayout
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get includeInLayout():Boolean;
+
+ /**
+ * @private
+ */
+ function set includeInLayout(value:Boolean):void;
+
+ /**
+ * Returns the element's preferred width.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is <code>true</code>,
+ * the method returns the element's bounding box width.
+ * The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's preferred size and
+ * layout transform matrix.
+ *
+ * @return Returns the element's preferred width. Preferred width is
+ * usually based on the default element size and any explicit overrides.
+ * For UIComponent this is the same value as returned by
+ * the <code>getExplicitOrMeasuredWidth()</code> method.
+ *
+ * @see #getPreferredBoundsHeight()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's preferred height.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is <code>true</code>,
+ * the method returns the element's bounding box height.
+ * The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's preferred size and
+ * layout transform matrix.
+ *
+ * @return Returns the element's preferred height. Preferred height is
+ * usually based on the default element size and any explicit overrides.
+ * For UIComponent this is the same value as returned by
+ * the <code>getExplicitOrMeasuredHeight()</code> method.
+ *
+ * @see #getPreferredBoundsWidth()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's minimum width.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is <code>true</code>,
+ * the method returns the element's bounding box width.
+ * The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's minimum size and
+ * layout transform matrix.
+ *
+ * @return The element's maximum width.
+ *
+ * @see #getMinBoundsHeight()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getMinBoundsWidth(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's minimum height.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is <code>true</code>,
+ * the method returns the element's bounding box height.
+ * The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's minimum size and
+ * layout transform matrix.
+ *
+ * @return The element's maximum height.
+ *
+ * @see #getMinBoundsWidth()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getMinBoundsHeight(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's maximum width.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * the element's bounding box width. The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's maximum size and
+ * layout transform matrix.
+ *
+ * @return The element's maximum width.
+ *
+ * @see #getMaxBoundsHeight()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getMaxBoundsWidth(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's maximum height.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * the element's bounding box height. The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's maximum size and
+ * layout transform matrix.
+ *
+ * @return The element's maximum height.
+ *
+ * @see #getMaxBoundsWidth()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getMaxBoundsHeight(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the x coordinate of the element's bounds at the specified element size.
+ *
+ * <p>This method is typically used by layouts during a call to the
+ * <code>measure()</code> method to predict what
+ * the element position will be, if the element is resized to particular dimensions.</p>
+ *
+ * @param width The element's bounds width, or NaN to use the preferred width.
+ * @param height The element's bounds height, or NaN to use the preferred height.
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * x coordinate of the element's bounding box top-left corner.
+ * The bounding box is in element's parent coordinate space and is calculated
+ * from the specified bounds size, layout position and layout transform matrix.
+ *
+ * @return The x coordinate of the element's bounds at the specified element size.
+ *
+ * @see #setLayoutBoundsSize()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getBoundsXAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the y coordinate of the element's bounds at the specified element size.
+ *
+ * This method is typically used by layouts during a call to
+ * the <code>measure()</code> to predict what
+ * the element position will be, if the element is resized to particular dimensions.
+ *
+ * @param width The element's bounds width, or NaN to use the preferred width.
+ * @param height The element's bounds height, or NaN to use the preferred height.
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * the y coordinate of the element's bounding box top-left corner.
+ * The bounding box is in element's parent coordinate space and is calculated
+ * from the specified bounds size, layout position and layout transform matrix.
+ *
+ * @return The y coordinate of the element's bounds at the specified element size.
+ *
+ * @see #setLayoutBoundsSize()
+ * @see #getLayoutBoundsY()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getBoundsYAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's layout width. This is the size that the element uses
+ * to draw on screen.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * the element's bounding box width. The bounding box is in element's parent
+ * coordinate space and is calculated from the element's layout size and
+ * layout transform matrix.
+ *
+ * @return The element's layout width.
+ *
+ * @see #getLayoutBoundsHeight()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getLayoutBoundsWidth(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the element's layout height. This is the size that the element uses
+ * to draw on screen.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * the element's bounding box width. The bounding box is in the element's parent
+ * coordinate space and is calculated from the element's layout size and
+ * layout transform matrix.
+ *
+ * @return The element's layout height.
+ *
+ * @see #getLayoutBoundsWidth()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getLayoutBoundsHeight(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the x coordinate that the element uses to draw on screen.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * x coordinate of the element's bounding box top-left corner.
+ * The bounding box is in the element's parent coordinate space and is calculated
+ * from the element's layout size, layout position and layout transform matrix.
+ *
+ * @return The x coordinate that the element uses to draw on screen.
+ *
+ * @see #getLayoutBoundsY()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getLayoutBoundsX(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Returns the y coordinate that the element uses to draw on screen.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the method returns
+ * y coordinate of the element's bounding box top-left corner.
+ * The bounding box is in the element's parent coordinate space and is calculated
+ * from the element's layout size, layout position, and layout transform matrix.
+ *
+ * @return The y coordinate that the element uses to draw on screen.
+ *
+ * @see #getLayoutBoundsX()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getLayoutBoundsY(postLayoutTransform:Boolean = true):Number;
+
+ /**
+ * Sets the coordinates that the element uses to draw on screen.
+ *
+ * <p>Note that calls to the <code>setLayoutBoundSize()</code> method can affect the layout position, so
+ * call <code>setLayoutBoundPosition()</code> after calling <code>setLayoutBoundSize()</code>.</p>
+ *
+ * @param x The x-coordinate of the top-left corner of the bounding box.
+ *
+ * @param y The y-coordinate of the top-left corner of the bounding box.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is <code>true</code>,
+ * the element is positioned in such a way that the top-left corner of its bounding box is (x, y).
+ * The bounding box is in the element's parent coordinate space and is calculated
+ * from the element's layout size, layout position and layout transform matrix.
+ *
+ * @see #setLayoutBoundsSize()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function setLayoutBoundsPosition(x:Number, y:Number, postLayoutTransform:Boolean = true):void;
+
+ /**
+ * Sets the layout size of the element.
+ * This is the size that the element uses to draw on screen.
+ *
+ * <p>If the <code>width</code> and/or <code>height</code> parameters are left unspecified (NaN),
+ * Flex sets the element's layout size to its preferred width and/or preferred height.</p>
+ *
+ * <p>Note that calls to the <code>setLayoutBoundSize()</code> method can affect the layout position, so
+ * call <code>setLayoutBoundPosition()</code> after calling <code>setLayoutBoundSize()</code>.</p>
+ *
+ * @param width The element's layout width.
+ *
+ * @param height The element's layout height.
+ *
+ * @param postLayoutTransform When <code>postLayoutTransform</code> is true, the specified sizes
+ * are those of the element's bounding box.
+ * The bounding box is in the element's parent coordinate space and is calculated
+ * from the element's layout size, layout position, and layout transform matrix.
+ *
+ * @see #setLayoutBoundsPosition()
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function setLayoutBoundsSize(width:Number,
+ height:Number,
+ postLayoutTransform:Boolean = true):void;
+
+ /**
+ * Returns the transform matrix that is used to calculate the component's
+ * layout relative to its siblings.
+ *
+ * <p>This matrix is typically defined by the
+ * component's 2D properties such as <code>x</code>, <code>y</code>,
+ * <code>rotation</code>, <code>scaleX</code>, <code>scaleY</code>,
+ * <code>transformX</code>, and <code>transformY</code>.
+ * Some components may have additional transform properties that
+ * are applied on top of the layout matrix to determine the final,
+ * computed matrix. For example <code>UIComponent</code>
+ * defines the <code>offsets</code> property.</p>
+ *
+ * @return The layout transform Matrix for this element.
+ * Do not directly modify the return value; call the <code>setLayoutMatrix()</code> method instead.
+ *
+ * @see #setLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ * @see #setLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function getLayoutMatrix():Matrix;
+
+ /**
+ * Sets the transform Matrix that is used to calculate the component's layout
+ * size and position relative to its siblings.
+ *
+ * <p>The matrix is typically defined by the
+ * component's 2D properties such as <code>x</code>, <code>y</code>,
+ * <code>rotation</code>, <code>scaleX</code>, <code>scaleY</code>,
+ * <code>transformX</code>, and <code>transformY</code>.
+ * Some components may have additional transform properties that
+ * are applied on top of the layout matrix to determine the final,
+ * computed matrix. For example <code>UIComponent</code>
+ * defines the <code>offsets</code>.</p>
+ *
+ * <p>Note that layout Matrix is factored in the <code>getPreferredSize()</code>,
+ * <code>getMinSize()</code>, <code>getMaxSize()</code>, <code>getLayoutSize()</code>
+ * methods when computed in parent coordinates
+ * as well as in <code>getLayoutPosition()</code> in both parent and child coordinates.
+ * Layouts that calculate the transform matrix explicitly typically call
+ * this method and work with sizes in child coordinates.
+ * Layouts calling this method pass <code>false</code>
+ * to the <code>invalidateLayout()</code> method so that a subsequent layout pass is not
+ * triggered.</p>
+ *
+ * @param Matrix The matrix.
+ *
+ * @param invalidateLayout <code>true</code> to cause the parent container
+ * to re-layout its children. You typically pass <code>true</code>
+ * to the <code>invalidateLayout()</code> method.
+ *
+ * @see #getLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ * @see #setLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function setLayoutMatrix(value:Matrix, invalidateLayout:Boolean):void;
+
+ /**
+ * Contains <code>true</code> if the element has 3D Matrix.
+ *
+ * <p>Use <code>hasLayoutMatrix3D</code> instead of calling and examining the
+ * return value of <code>getLayoutMatrix3D()</code> because that method returns a valid
+ * matrix even when the element is in 2D.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function get hasLayoutMatrix3D():Boolean;
+
+ /**
+ * Returns the layout transform Matrix3D for this element.
+ *
+ * <p>This matrix is typically defined by the
+ * component's transform properties such as <code>x</code>, <code>y</code>,
+ * <code>z</code>, <code>rotationX</code>, <code>rotationY</code>,
+ * <code>rotationZ</code>, <code>scaleX</code>, <code>scaleY</code>,
+ * <code>scaleZ</code>, <code>transformX</code>, and <code>transformY</code>.
+ * Some components may have additional transform properties that
+ * are applied on top of the layout matrix to determine the final,
+ * computed matrix. For example <code>UIComponent</code>
+ * defines the <code>offsets</code> property.</p>
+ *
+ * @return The layout transform Matrix3D for this element.
+ * Do not directly modify the return value but call the <code>setLayoutMatrix()</code> method instead.
+ *
+ * @see #getLayoutMatrix()
+ * @see #setLayoutMatrix()
+ * @see #setLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function getLayoutMatrix3D():Matrix3D;
+
+ /**
+ * Sets the transform Matrix3D that is used to calculate the component's layout
+ * size and position relative to its siblings.
+ *
+ * <p>This matrix is typically defined by the
+ * component's transform properties such as <code>x</code>, <code>y</code>,
+ * <code>z</code>, <code>rotationX</code>, <code>rotationY</code>,
+ * <code>rotationZ</code>, <code>scaleX</code>, <code>scaleY</code>,
+ * <code>scaleZ</code>, <code>transformX</code>, and <code>transformY</code>.
+ * Some components may have additional transform properties that
+ * are applied on top of the layout matrix to determine the final,
+ * computed matrix. For example <code>UIComponent</code>
+ * defines the <code>offsets</code> property.</p>
+ *
+ * <p>Note that layout Matrix3D is factored in the <code>getPreferredSize()</code>,
+ * <code>getMinSize()</code>, <code>getMaxSize()</code>, <code>getLayoutSize()</code>
+ * when computed in parent coordinates
+ * as well as in <code>getLayoutPosition()</code> in both parent and child coordinates.
+ * Layouts that calculate the transform matrix explicitly typically call
+ * this method and work with sizes in child coordinates.
+ * Layouts calling this method pass <code>false</code>
+ * to the <code>invalidateLayout()</code> method so that a subsequent layout pass is not
+ * triggered.</p>
+ *
+ * @param Matrix The matrix.
+ *
+ * @param invalidateLayout <code>true</code> to cause the parent container
+ * to re-layout its children. You typically pass <code>true</code>
+ * to the <code>invalidateLayout()</code> method.
+ *
+ * @see #getLayoutMatrix()
+ * @see #setLayoutMatrix()
+ * @see #getLayoutMatrix3D()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function setLayoutMatrix3D(value:Matrix3D, invalidateLayout:Boolean):void;
+
+ /**
+ * A utility method to update the rotation, scale, and translation of the
+ * transform while keeping a particular point, specified in the component's
+ * own coordinate space, fixed in the parent's coordinate space.
+ * This function will assign the rotation, scale, and translation values
+ * provided, then update the x/y/z properties as necessary to keep
+ * the transform center fixed.
+ *
+ * @param transformCenter The point, in the component's own coordinates,
+ * to keep fixed relative to its parent.
+ *
+ * @param scale The new values for the scale of the transform.
+ *
+ * @param rotation the new values for the rotation of the transform
+ *
+ * @param translation The new values for the translation of the transform.
+ *
+ * @param postLayoutScale The new values for the post-layout scale
+ * of the transform.
+ *
+ * @param postLayoutRotation The new values for the post-layout rotation
+ * of the transform.
+ *
+ * @param postLayoutTranslation The new values for the post-layout translation
+ * of the transform.
+ *
+ * @param invalidateLayout If <code>true</code>, the parent container size and display are
+ * invalidated. Layouts calling this method pass <code>false</code>
+ * so that a subsequent layout pass is not triggered.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function transformAround(transformCenter:Vector3D,
+ scale:Vector3D = null,
+ rotation:Vector3D = null,
+ translation:Vector3D = null,
+ postLayoutScale:Vector3D = null,
+ postLayoutRotation:Vector3D = null,
+ postLayoutTranslation:Vector3D = null,
+ invalidateLayout:Boolean = true):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IMXMLObject.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IMXMLObject.as b/frameworks/projects/MX/src/main/flex/mx/core/IMXMLObject.as
new file mode 100644
index 0000000..9b6ec90
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IMXMLObject.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+/**
+ * The IMXMLObject interface defines the APIs that a non-visual component
+ * must implement in order to work properly with the MXML compiler.
+ * Currently, the only supported method is the <code>initialized()</code>
+ * method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IMXMLObject
+{
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Called after the implementing object has been created and all
+ * component properties specified on the MXML tag have been initialized.
+ *
+ * @param document The MXML document that created this object.
+ *
+ * @param id The identifier used by <code>document</code> to refer
+ * to this object.
+ * If the object is a deep property on <code>document</code>,
+ * <code>id</code> is null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initialized(document:Object, id:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IProgrammaticSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IProgrammaticSkin.as b/frameworks/projects/MX/src/main/flex/mx/core/IProgrammaticSkin.as
new file mode 100644
index 0000000..d1902d0
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IProgrammaticSkin.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IProgrammaticSkin interface defines the interface that skin classes must implement
+ * if they use the <code>name</code> property skin interface.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IProgrammaticSkin
+{
+ /**
+ * @copy mx.skins.ProgrammaticSkin#validateNow()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateNow():void;
+
+ /**
+ * @copy mx.skins.ProgrammaticSkin#validateDisplayList()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateDisplayList():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/mx/core/IPropertyChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IPropertyChangeNotifier.as b/frameworks/projects/MX/src/main/flex/mx/core/IPropertyChangeNotifier.as
new file mode 100644
index 0000000..b0f49d7
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IPropertyChangeNotifier.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import org.apache.flex.events.IEventDispatcher;
+
+/**
+ * The <code>IPropertyChangeNotifier</code> interface defines a marker
+ * interface.
+ * Classes that support this interface declare support for event propagation
+ * in a specialized manner.
+ * Classes that implement this interface must dispatch events for each property
+ * of this class and any nested classes publicly exposed as properties.
+ * For those properties that are anonymous (complex and not strongly typed),
+ * implementing classes provide custom support or directly use the
+ * ObjectProxy class.
+ * Implementors of this interface should use the
+ * <code>PropertyChangeEvent.createUpdateEvent()</code> method to construct an
+ * appropriate update event for dispatch.
+ * @example
+ * <code><pre>
+ *
+ * function set myProperty(value:Object):void
+ * {
+ * var oldValue:IPropertyChangeNotifier = _myProperty;
+ * var newValue:IPropertyChangeNotifier = value;
+ *
+ * // Need to ensure to dispatch changes on the new property.
+ * // Listeners use the source property to determine which object
+ * // actually originated the event.
+ * // In their event handler code, they can tell if an event has been
+ * // propagated from deep within the object graph by comparing
+ * // event.target and event.source. If they are equal, then the property
+ * // change is at the surface of the object. If they are not equal, the
+ * // property change is somewhere deeper in the object graph.
+ * newValue.addEventListener(
+ * PropertyChangeEvent.PROPERTY_CHANGE,
+ * dispatchEvent);
+ *
+ * // need to stop listening for events from the old property
+ * oldValue.removeEventListener(
+ * PropertyChangeEvent.PROPERTY_CHANGE,
+ * dispatchEvent);
+ *
+ * _myProperty = newValue;
+ *
+ * // now notify anyone that is listening
+ * if (dispatcher.hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+ * {
+ * var event:PropertyChangeEvent =
+ * PropertyChangeEvent.createUpdateEvent(
+ * this,
+ * "myProperty",
+ * newValue,
+ * oldValue);
+ * dispatchEvent(event);
+ * }
+ * }
+ *
+ *
+ * </pre></code>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IPropertyChangeNotifier extends IEventDispatcher, IUID
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ // Inherits uid property from IUID
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IRawChildrenContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IRawChildrenContainer.as b/frameworks/projects/MX/src/main/flex/mx/core/IRawChildrenContainer.as
new file mode 100644
index 0000000..2423f51
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IRawChildrenContainer.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IRawChildrenContainer interface defines the APIs for containers that
+ * can return an IChildList that represents all their children.
+ * This interface should be implemented by any container that has overridden
+ * IChildList APIs such as <code>numChildren</code> and <code>addChild()</code>
+ * method to manage only a subset of its actual children.
+ * The mx.core.Container class, for example, has a set of content children
+ * separate from the non-content children, such as borders, title bars,
+ * and dividers.
+ *
+ * @see mx.core.Container
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IRawChildrenContainer
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // rawChildren
+ //----------------------------------
+
+ /**
+ * Returns an IChildList representing all children.
+ * This is used by FocusManager to find non-content children that may
+ * still receive focus (for example, components in ControlBars).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get rawChildren():IChildList;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IRectangularBorder.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IRectangularBorder.as b/frameworks/projects/MX/src/main/flex/mx/core/IRectangularBorder.as
new file mode 100644
index 0000000..a0d6c26
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IRectangularBorder.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import org.apache.flex.geom.Rectangle;
+
+/**
+ * The IRectangularBorder interface defines the interface that all classes
+ * used for rectangular border skins should implement.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IRectangularBorder extends IBorder
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // backgroundImageBounds
+ //----------------------------------
+
+ /**
+ * @copy mx.skins.RectangularBorder#backgroundImageBounds
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get backgroundImageBounds():Rectangle;
+ function set backgroundImageBounds(value:Rectangle):void;
+
+ //----------------------------------
+ // hasBackgroundImage
+ //----------------------------------
+
+ /**
+ * @copy mx.skins.RectangularBorder#hasBackgroundImage
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get hasBackgroundImage():Boolean;
+
+ //----------------------------------
+ // adjustBackgroundImage
+ //----------------------------------
+
+ /**
+ * @copy mx.skins.RectangularBorder#layoutBackgroundImage()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function layoutBackgroundImage():void;
+}
+
+}
[11/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/MatrixUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/MatrixUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/MatrixUtil.as
new file mode 100644
index 0000000..264986e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/MatrixUtil.as
@@ -0,0 +1,1751 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.display.DisplayObject;
+import flash.geom.Matrix;
+import flash.geom.Matrix3D;
+import flash.geom.PerspectiveProjection;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.geom.Utils3D;
+import flash.geom.Vector3D;
+import flash.system.ApplicationDomain;
+
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * The MatrixUtil class is for internal use only.
+ * Class for matrix and geometric related math routines.
+ */
+public final class MatrixUtil
+{
+ include "../core/Version.as";
+
+ private static const RADIANS_PER_DEGREES:Number = Math.PI / 180;
+ mx_internal static var SOLUTION_TOLERANCE:Number = 0.1;
+ mx_internal static var MIN_MAX_TOLERANCE:Number = 0.1;
+
+ private static var staticPoint:Point = new Point();
+
+ // For use in getConcatenatedMatrix function
+ private static var fakeDollarParent:QName;
+ private static var uiComponentClass:Class;
+ private static var uiMovieClipClass:Class;
+ private static var usesMarshalling:Object;
+ private static var lastModuleFactory:Object;
+ private static var computedMatrixProperty:QName;
+ private static var $transformProperty:QName;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns rotation value clamped between -180 and 180 degreeds.
+ * This mimicks the Flash player behavior.
+ */
+ public static function clampRotation(value:Number):Number
+ {
+ // Flash player doesn't handle values larger than 2^15 - 1 (FP-749).
+ if (value > 180 || value < -180)
+ {
+ value = value % 360;
+
+ if (value > 180)
+ value = value - 360;
+ else if (value < -180)
+ value = value + 360;
+ }
+ return value;
+ }
+
+ /**
+ * Returns a static Point object with the result.
+ * If matrix is null, point is untransformed.
+ */
+ public static function transformPoint(x:Number, y:Number, m:Matrix):Point
+ {
+ if (!m)
+ {
+ staticPoint.x = x;
+ staticPoint.y = y;
+ return staticPoint;
+ }
+
+ staticPoint.x = m.a * x + m.c * y + m.tx;
+ staticPoint.y = m.b * x + m.d * y + m.ty;
+ return staticPoint;
+ }
+
+ public static function composeMatrix(x:Number = 0,
+ y:Number = 0,
+ scaleX:Number = 1,
+ scaleY:Number = 1,
+ rotation:Number = 0,
+ transformX:Number = 0,
+ transformY:Number = 0):Matrix
+ {
+ var m:Matrix = new Matrix();
+ m.translate(-transformX, -transformY);
+ m.scale(scaleX, scaleY);
+ if (rotation != 0)
+ m.rotate(rotation / 180 * Math.PI);
+ m.translate(transformX + x, transformY + y);
+ return m;
+ }
+
+ /**
+ * Decompose a matrix into its component scale, rotation, and translation parts.
+ * The Vector of Numbers passed in the components parameter will be
+ * populated by this function with the component parts.
+ *
+ * @param components Vector which holds the component scale, rotation
+ * and translation values.
+ * x = components[0]
+ * y = components[1]
+ * rotation = components[2]
+ * scaleX = components[3]
+ * scaleY = components[4]
+ *
+ * @param matrix The matrix to decompose
+ * @param transformX The x value of the transform center
+ * @param transformY The y value of the transform center
+ */
+ public static function decomposeMatrix(components:Vector.<Number>,
+ matrix:Matrix,
+ transformX:Number = 0,
+ transformY:Number = 0):void
+ {
+ // else decompose matrix. Don't use MatrixDecompose(), it can return erronous values
+ // when negative scales (and therefore skews) are in use.
+ var Ux:Number;
+ var Uy:Number;
+ var Vx:Number;
+ var Vy:Number;
+
+ Ux = matrix.a;
+ Uy = matrix.b;
+ components[3] = Math.sqrt(Ux*Ux + Uy*Uy);
+
+ Vx = matrix.c;
+ Vy = matrix.d;
+ components[4] = Math.sqrt(Vx*Vx + Vy*Vy );
+
+ // sign of the matrix determinant will tell us if the space is inverted by a 180 degree skew or not.
+ var determinant:Number = Ux*Vy - Uy*Vx;
+ if (determinant < 0) // if so, choose y-axis scale as the skewed one. Unfortunately, its impossible to tell if it originally was the y or x axis that had the negative scale/skew.
+ {
+ components[4] = -(components[4]);
+ Vx = -Vx;
+ Vy = -Vy;
+ }
+
+ components[2] = Math.atan2( Uy, Ux ) / RADIANS_PER_DEGREES;
+
+ if (transformX != 0 || transformY != 0)
+ {
+ var postTransformCenter:Point = matrix.transformPoint(new Point(transformX,transformY));
+ components[0] = postTransformCenter.x - transformX;
+ components[1] = postTransformCenter.y - transformY;
+ }
+ else
+ {
+ components[0] = matrix.tx;
+ components[1] = matrix.ty;
+ }
+ }
+
+ /**
+ * @return Returns the union of <code>rect</code> and
+ * <code>Rectangle(left, top, right - left, bottom - top)</code>.
+ * Note that if rect is non-null, it will be updated to reflect the return value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function rectUnion(left:Number, top:Number, right:Number, bottom:Number,
+ rect:Rectangle):Rectangle
+ {
+ if (!rect)
+ return new Rectangle(left, top, right - left, bottom - top);
+
+ var minX:Number = Math.min(rect.left, left);
+ var minY:Number = Math.min(rect.top, top);
+ var maxX:Number = Math.max(rect.right, right);
+ var maxY:Number = Math.max(rect.bottom, bottom);
+
+ rect.x = minX;
+ rect.y = minY;
+ rect.width = maxX - minX;
+ rect.height = maxY - minY;
+ return rect;
+ }
+
+ /**
+ * Calculates the bounding box of a post-transformed ellipse.
+ *
+ * @param cx The x coordinate of the ellipse's center
+ * @param cy The y coordinate of the ellipse's center
+ * @param rx The horizontal radius of the ellipse
+ * @param ry The vertical radius of the ellipse
+ * @param matrix The transformation matrix.
+ * @param rect If non-null, rect will be updated to the union of rect and
+ * the segment bounding box.
+ * @return Returns the union of the passed in rect with the
+ * bounding box of the the post-transformed ellipse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getEllipseBoundingBox(cx:Number, cy:Number,
+ rx:Number, ry:Number,
+ matrix:Matrix,
+ rect:Rectangle = null):Rectangle
+ {
+ var a:Number = matrix.a;
+ var b:Number = matrix.b;
+ var c:Number = matrix.c;
+ var d:Number = matrix.d;
+
+ // Ellipse can be represented by the following parametric equations:
+ //
+ // (1) x = cx + rx * cos(t)
+ // (2) y = cy + ry * sin(t)
+ //
+ // After applying transformation with matrix m(a, c, b, d) we get:
+ //
+ // (3) x = a * cx + a * cos(t) * rx + c * cy + c * sin(t) * ry + m.tx
+ // (4) y = b * cx + b * cos(t) * rx + d * cy + d * sin(t) * ry + m.ty
+ //
+ // In (3) and (4) x and y are functions of a parameter t. To find the extremums we need
+ // to find where dx/dt and dy/dt reach zero:
+ //
+ // (5) dx/dt = - a * sin(t) * rx + c * cos(t) * ry
+ // (6) dy/dt = - b * sin(t) * rx + d * cos(t) * ry
+ // (7) dx/dt = 0 <=> sin(t) / cos(t) = (c * ry) / (a * rx);
+ // (8) dy/dt = 0 <=> sin(t) / cos(t) = (d * ry) / (b * rx);
+
+ if (rx == 0 && ry == 0)
+ {
+ var pt:Point = new Point(cx, cy);
+ pt = matrix.transformPoint(pt);
+ return rectUnion(pt.x, pt.y, pt.x, pt.y, rect);
+ }
+
+ var t:Number;
+ var t1:Number;
+
+ if (a * rx == 0)
+ t = Math.PI / 2;
+ else
+ t = Math.atan((c * ry) / (a * rx));
+
+ if (b * rx == 0)
+ t1 = Math.PI / 2;
+ else
+ t1 = Math.atan((d * ry) / (b * rx));
+
+ var x1:Number = a * Math.cos(t) * rx + c * Math.sin(t) * ry;
+ var x2:Number = -x1;
+ x1 += a * cx + c * cy + matrix.tx;
+ x2 += a * cx + c * cy + matrix.tx;
+
+ var y1:Number = b * Math.cos(t1) * rx + d * Math.sin(t1) * ry;
+ var y2:Number = -y1;
+ y1 += b * cx + d * cy + matrix.ty;
+ y2 += b * cx + d * cy + matrix.ty;
+
+ return rectUnion(Math.min(x1, x2), Math.min(y1, y2), Math.max(x1, x2), Math.max(y1, y2), rect);
+ }
+
+ /**
+ * @param x0 x coordinate of the first control point
+ * @param y0 y coordinate of the first control point
+ * @param x1 x coordinate of the second control point
+ * @param y1 y coordinate of the second control point
+ * @param x2 x coordinate of the third control point
+ * @param y2 y coordinate of the third control point
+ * @param sx The pre-transform scale factor for x coordinates.
+ * @param sy The pre-transform scale factor for y coordinates.
+ * @param matrix The transformation matrix. Can be null for identity transformation.
+ * @param rect If non-null, rect will be updated to the union of rect and
+ * the segment bounding box.
+ * @return Returns the union of the post-transformed quadratic
+ * bezier segment's axis aligned bounding box and the passed in rect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ static public function getQBezierSegmentBBox(x0:Number, y0:Number,
+ x1:Number, y1:Number,
+ x2:Number, y2:Number,
+ sx:Number, sy:Number,
+ matrix:Matrix,
+ rect:Rectangle):Rectangle
+ {
+ var pt:Point;
+ pt = MatrixUtil.transformPoint(x0 * sx, y0 * sy, matrix);
+ x0 = pt.x;
+ y0 = pt.y;
+
+ pt = MatrixUtil.transformPoint(x1 * sx, y1 * sy, matrix);
+ x1 = pt.x;
+ y1 = pt.y;
+
+ pt = MatrixUtil.transformPoint(x2 * sx, y2 * sy, matrix);
+ x2 = pt.x;
+ y2 = pt.y;
+
+ var minX:Number = Math.min(x0, x2);
+ var maxX:Number = Math.max(x0, x2);
+
+ var minY:Number = Math.min(y0, y2);
+ var maxY:Number = Math.max(y0, y2);
+
+ var txDiv:Number = x0 - 2 * x1 + x2;
+ if (txDiv != 0)
+ {
+ var tx:Number = (x0 - x1) / txDiv;
+ if (0 <= tx && tx <= 1)
+ {
+ var x:Number = (1 - tx) * (1 - tx) * x0 + 2 * tx * (1 - tx) * x1 + tx * tx * x2;
+ minX = Math.min(x, minX);
+ maxX = Math.max(x, maxX);
+ }
+ }
+
+ var tyDiv:Number = y0 - 2 * y1 + y2;
+ if (tyDiv != 0)
+ {
+ var ty:Number = (y0 - y1) / tyDiv;
+ if (0 <= ty && ty <= 1)
+ {
+ var y:Number = (1 - ty) * (1 - ty) * y0 + 2 * ty * (1 - ty) * y1 + ty * ty * y2;
+ minY = Math.min(y, minY);
+ maxY = Math.max(y, maxY);
+ }
+ }
+
+ return rectUnion(minX, minY, maxX, maxY, rect);
+ }
+
+ /**
+ * @param width The width of the bounds to be transformed.
+ * @param height The height of the bounds to be transformed.
+ * @param matrix The transfomration matrix.
+ *
+ * @param vec If vec is non-null it will be set to the vector from the
+ * transformed bounds top left to the untransformed bounds top left
+ * in the coordinate space defined by <code>matrix</code>.
+ * This is useful if you want to align the transformed bounds to x,y
+ * by modifying the object's position. Moving the object by
+ * <code>x + vec.x</code> and <code>y + vec.y</code> respectively
+ * will offset the transformed bounds top left corner by x,y.
+ *
+ * @return Returns the transformed bounds. Note that the Point object returned will be reused
+ * by other MatrixUtil methods.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function transformSize(width:Number, height:Number, matrix:Matrix):Point
+ {
+ const a:Number = matrix.a;
+ const b:Number = matrix.b;
+ const c:Number = matrix.c;
+ const d:Number = matrix.d;
+
+ // transform point (0,0)
+ var x1:Number = 0;
+ var y1:Number = 0;
+
+ // transform point (width, 0)
+ var x2:Number = width * a;
+ var y2:Number = width * b;
+
+ // transform point (0, height)
+ var x3:Number = height * c;
+ var y3:Number = height * d;
+
+ // transform point (width, height)
+ var x4:Number = x2 + x3;
+ var y4:Number = y2 + y3;
+
+ var minX:Number = Math.min(Math.min(x1, x2), Math.min(x3, x4));
+ var maxX:Number = Math.max(Math.max(x1, x2), Math.max(x3, x4));
+ var minY:Number = Math.min(Math.min(y1, y2), Math.min(y3, y4));
+ var maxY:Number = Math.max(Math.max(y1, y2), Math.max(y3, y4));
+
+ staticPoint.x = maxX - minX;
+ staticPoint.y = maxY - minY;
+ return staticPoint;
+ }
+
+ /**
+ * @param width The width of the bounds to be transformed.
+ * @param height The height of the bounds to be transformed.
+ * @param matrix The transfomration matrix.
+ *
+ * @param topleft If topLeft is non-null it will be used as the origin of the bounds
+ * rectangle to be transformed. On return, it will be set to the top left of the rectangle
+ * after transformation.
+ *
+ * @return Returns the transformed width and height. Note that the Point object returned will be reused
+ * by other MatrixUtil methods.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function transformBounds(width:Number, height:Number, matrix:Matrix, topLeft:Point = null):Point
+ {
+ const a:Number = matrix.a;
+ const b:Number = matrix.b;
+ const c:Number = matrix.c;
+ const d:Number = matrix.d;
+
+ // transform point (0,0)
+ var x1:Number = 0;
+ var y1:Number = 0;
+
+ // transform point (width, 0)
+ var x2:Number = width * a;
+ var y2:Number = width * b;
+
+ // transform point (0, height)
+ var x3:Number = height * c;
+ var y3:Number = height * d;
+
+ // transform point (width, height)
+ var x4:Number = x2 + x3;
+ var y4:Number = y2 + y3;
+
+ var minX:Number = Math.min(Math.min(x1, x2), Math.min(x3, x4));
+ var maxX:Number = Math.max(Math.max(x1, x2), Math.max(x3, x4));
+ var minY:Number = Math.min(Math.min(y1, y2), Math.min(y3, y4));
+ var maxY:Number = Math.max(Math.max(y1, y2), Math.max(y3, y4));
+
+ staticPoint.x = maxX - minX;
+ staticPoint.y = maxY - minY;
+
+ if (topLeft)
+ {
+ const tx:Number = matrix.tx;
+ const ty:Number = matrix.ty;
+ const x:Number = topLeft.x;
+ const y:Number = topLeft.y;
+
+ topLeft.x = minX + a * x + b * y + tx;
+ topLeft.y = minY + c * x + d * y + ty;
+ }
+ return staticPoint;
+ }
+
+ /**
+ * Returns the axis aligned bounding box <code>bounds</code> transformed
+ * with <code>matrix</code> and then projected with <code>projection</code>.
+ *
+ * @param bounds The bounds, in child coordinates, to be transformed and projected.
+ * @param matrix <p>The transformation matrix. Note that the method will clobber the
+ * original matrix values.</p>
+ * @param projection The projection.
+ * @return Returns the <code>bounds</code> parameter that has been updated with the
+ * transformed and projected bounds.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function projectBounds(bounds:Rectangle,
+ matrix:Matrix3D,
+ projection:PerspectiveProjection):Rectangle
+ {
+ // Setup the matrix
+ var centerX:Number = projection.projectionCenter.x;
+ var centerY:Number = projection.projectionCenter.y;
+ matrix.appendTranslation(-centerX, -centerY, projection.focalLength);
+ matrix.append(projection.toMatrix3D());
+
+ // Project the corner points
+ var pt1:Vector3D = new Vector3D(bounds.left, bounds.top, 0);
+ var pt2:Vector3D = new Vector3D(bounds.right, bounds.top, 0)
+ var pt3:Vector3D = new Vector3D(bounds.left, bounds.bottom, 0);
+ var pt4:Vector3D = new Vector3D(bounds.right, bounds.bottom, 0);
+ pt1 = Utils3D.projectVector(matrix, pt1);
+ pt2 = Utils3D.projectVector(matrix, pt2);
+ pt3 = Utils3D.projectVector(matrix, pt3);
+ pt4 = Utils3D.projectVector(matrix, pt4);
+
+ // Find the bounding box in 2D
+ var maxX:Number = Math.max(Math.max(pt1.x, pt2.x), Math.max(pt3.x, pt4.x));
+ var minX:Number = Math.min(Math.min(pt1.x, pt2.x), Math.min(pt3.x, pt4.x));
+ var maxY:Number = Math.max(Math.max(pt1.y, pt2.y), Math.max(pt3.y, pt4.y));
+ var minY:Number = Math.min(Math.min(pt1.y, pt2.y), Math.min(pt3.y, pt4.y));
+
+ // Add back the projection center
+ bounds.x = minX + centerX;
+ bounds.y = minY + centerY;
+ bounds.width = maxX - minX;
+ bounds.height = maxY - minY;
+ return bounds;
+ }
+
+ /**
+ * @param matrix
+ * @return Returns true when <code>pt == matrix.DeltaTransformPoint(pt)</code>
+ * for any <code>pt:Point</code> (<code>matrix</code> is identity matrix,
+ * when disregarding the translation part).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isDeltaIdentity(matrix:Matrix):Boolean
+ {
+ return (matrix.a == 1 && matrix.d == 1 &&
+ matrix.b == 0 && matrix.c == 0);
+ }
+
+ /**
+ * <code>fitBounds</code> Calculates a size (x,y) for a bounding box (0,0,x,y)
+ * such that the bounding box transformed with <code>matrix</code> will fit
+ * into (0,0,width,height).
+ *
+ * @param width This is the width of the bounding box that calculated size
+ * needs to fit in.
+ *
+ * @param height This is the height of the bounding box that the calculated
+ * size needs to fit in.
+ *
+ * @param matrix This defines the transformations that the function will take
+ * into account when calculating the size. The bounding box (0,0,x,y) of the
+ * calculated size (x,y) transformed with <code>matrix</code> will fit in the
+ * specified <code>width</code> and <code>height</code>.
+ *
+ * @param explicitWidth Explicit width for the calculated size. The function
+ * will first try to find a solution using this width.
+ *
+ * @param explicitHeight Preferred height for the calculated size. The function
+ * will first try to find a solution using this height.
+ *
+ * @param preferredWidth Preferred width for the calculated size. If possible
+ * the function will set the calculated size width to this value.
+ *
+ * @param preferredHeight Preferred height for the calculated size. If possible
+ * the function will set the calculated size height to this value.
+ *
+ * @param minWidth The minimum allowed value for the calculated size width.
+ *
+ * @param minHeight The minimum allowed value for the calculated size height.
+ *
+ * @param maxWidth The maximum allowed value for the calculated size width.
+ *
+ * @param maxHeight The maximum allowed value for the calculated size height.
+ *
+ * @return Returns the size (x,y) such that the bounding box (0,0,x,y) will
+ * fit into (0,0,width,height) after transformation with <code>matrix</code>.
+ * Returns null if there is no possible solution.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function fitBounds(width:Number, height:Number, matrix:Matrix,
+ explicitWidth:Number, explicitHeight:Number,
+ preferredWidth:Number, preferredHeight:Number,
+ minWidth:Number, minHeight:Number,
+ maxWidth:Number, maxHeight:Number):Point
+ {
+ if (isNaN(width) && isNaN(height))
+ return new Point(preferredWidth, preferredHeight);
+
+ // Allow for precision errors by including tolerance for certain values.
+ const newMinWidth:Number = (minWidth < MIN_MAX_TOLERANCE) ? 0 : minWidth - MIN_MAX_TOLERANCE;
+ const newMinHeight:Number = (minHeight < MIN_MAX_TOLERANCE) ? 0 : minHeight - MIN_MAX_TOLERANCE;
+ const newMaxWidth:Number = maxWidth + MIN_MAX_TOLERANCE;
+ const newMaxHeight:Number = maxHeight + MIN_MAX_TOLERANCE;
+
+ var actualSize:Point;
+
+ if (!isNaN(width) && !isNaN(height))
+ {
+ actualSize = calcUBoundsToFitTBounds(width, height, matrix,
+ newMinWidth, newMinHeight,
+ newMaxWidth, newMaxHeight);
+
+ // If we couldn't fit in both dimensions, try to fit only one and
+ // don't stick out of the other
+ if (!actualSize)
+ {
+ var actualSize1:Point;
+ actualSize1 = fitTBoundsWidth(width, matrix,
+ explicitWidth, explicitHeight,
+ preferredWidth, preferredHeight,
+ newMinWidth, newMinHeight,
+ newMaxWidth, newMaxHeight);
+
+ // If we fit the width, but not the height.
+ if (actualSize1)
+ {
+ var fitHeight:Number = transformSize(actualSize1.x, actualSize1.y, matrix).y;
+ if (fitHeight - SOLUTION_TOLERANCE > height)
+ actualSize1 = null;
+ }
+
+ var actualSize2:Point
+ actualSize2 = fitTBoundsHeight(height, matrix,
+ explicitWidth, explicitHeight,
+ preferredWidth, preferredHeight,
+ newMinWidth, newMinHeight,
+ newMaxWidth, newMaxHeight);
+
+ // If we fit the height, but not the width
+ if (actualSize2)
+ {
+ var fitWidth:Number = transformSize(actualSize2.x, actualSize2.y, matrix).x;
+ if (fitWidth - SOLUTION_TOLERANCE > width)
+ actualSize2 = null;
+ }
+
+ if (actualSize1 && actualSize2)
+ {
+ // Pick a solution
+ actualSize = ((actualSize1.x * actualSize1.y) > (actualSize2.x * actualSize2.y)) ? actualSize1 : actualSize2;
+ }
+ else if (actualSize1)
+ {
+ actualSize = actualSize1;
+ }
+ else
+ {
+ actualSize = actualSize2;
+ }
+ }
+ return actualSize;
+ }
+ else if (!isNaN(width))
+ {
+ return fitTBoundsWidth(width, matrix,
+ explicitWidth, explicitHeight,
+ preferredWidth, preferredHeight,
+ newMinWidth, newMinHeight,
+ newMaxWidth, newMaxHeight);
+ }
+ else
+ {
+ return fitTBoundsHeight(height, matrix,
+ explicitWidth, explicitHeight,
+ preferredWidth, preferredHeight,
+ newMinWidth, newMinHeight,
+ newMaxWidth, newMaxHeight);
+ }
+ }
+
+ /**
+ * @private
+ *
+ * <code>fitTBoundsWidth</code> Calculates a size (x,y) for a bounding box (0,0,x,y)
+ * such that the bounding box transformed with <code>matrix</code> will fit
+ * into the specified width.
+ *
+ * @param width This is the width of the bounding box that calculated size
+ * needs to fit in.
+ *
+ * @param matrix This defines the transformations that the function will take
+ * into account when calculating the size. The bounding box (0,0,x,y) of the
+ * calculated size (x,y) transformed with <code>matrix</code> will fit in the
+ * specified <code>width</code> and <code>height</code>.
+ *
+ * @param explicitWidth Explicit width for the calculated size. The function
+ * will first try to find a solution using this width.
+ *
+ * @param explicitHeight Preferred height for the calculated size. The function
+ * will first try to find a solution using this height.
+ *
+ * @param preferredWidth Preferred width for the calculated size. If possible
+ * the function will set the calculated size width to this value.
+ *
+ * @param preferredHeight Preferred height for the calculated size. If possible
+ * the function will set the calculated size height to this value.
+ *
+ * @param minWidth The minimum allowed value for the calculated size width.
+ *
+ * @param minHeight The minimum allowed value for the calculated size height.
+ *
+ * @param maxWidth The maximum allowed value for the calculated size width.
+ *
+ * @param maxHeight The maximum allowed value for the calculated size height.
+ *
+ * @return Returns the size (x,y) such that the bounding box (0,0,x,y) will
+ * fit into (0,0,width,height) after transformation with <code>matrix</code>.
+ * Returns null if there is no possible solution.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static function fitTBoundsWidth(width:Number, matrix:Matrix,
+ explicitWidth:Number, explicitHeight:Number,
+ preferredWidth:Number, preferredHeight:Number,
+ minWidth:Number, minHeight:Number,
+ maxWidth:Number, maxHeight:Number):Point
+ {
+ var actualSize:Point;
+
+ // cases 1 and 2: only explicit width or explicit height is specified,
+ // so we try to find a solution with that hard constraint.
+ if (!isNaN(explicitWidth) && isNaN(explicitHeight))
+ {
+ actualSize = calcUBoundsToFitTBoundsWidth(width, matrix,
+ explicitWidth, preferredHeight,
+ explicitWidth, minHeight,
+ explicitWidth, maxHeight);
+
+ if (actualSize)
+ return actualSize;
+ }
+ else if (isNaN(explicitWidth) && !isNaN(explicitHeight))
+ {
+ actualSize = calcUBoundsToFitTBoundsWidth(width, matrix,
+ preferredWidth, explicitHeight,
+ minWidth, explicitHeight,
+ maxWidth, explicitHeight);
+ if (actualSize)
+ return actualSize;
+ }
+
+ // case 3: default case. When explicitWidth, explicitHeight are both set
+ // or not set, we use the preferred size since calcUBoundsToFitTBoundsWidth
+ // will just pick one.
+ actualSize = calcUBoundsToFitTBoundsWidth(width, matrix,
+ preferredWidth, preferredHeight,
+ minWidth, minHeight,
+ maxWidth, maxHeight);
+
+ return actualSize;
+ }
+
+ /**
+ * @private
+ *
+ * <code>fitTBoundsWidth</code> Calculates a size (x,y) for a bounding box (0,0,x,y)
+ * such that the bounding box transformed with <code>matrix</code> will fit
+ * into the specified height.
+ *
+ * @param height This is the height of the bounding box that the calculated
+ * size needs to fit in.
+ *
+ * @param matrix This defines the transformations that the function will take
+ * into account when calculating the size. The bounding box (0,0,x,y) of the
+ * calculated size (x,y) transformed with <code>matrix</code> will fit in the
+ * specified <code>width</code> and <code>height</code>.
+ *
+ * @param explicitWidth Explicit width for the calculated size. The function
+ * will first try to find a solution using this width.
+ *
+ * @param explicitHeight Preferred height for the calculated size. The function
+ * will first try to find a solution using this height.
+ *
+ * @param preferredWidth Preferred width for the calculated size. If possible
+ * the function will set the calculated size width to this value.
+ *
+ * @param preferredHeight Preferred height for the calculated size. If possible
+ * the function will set the calculated size height to this value.
+ *
+ * @param minWidth The minimum allowed value for the calculated size width.
+ *
+ * @param minHeight The minimum allowed value for the calculated size height.
+ *
+ * @param maxWidth The maximum allowed value for the calculated size width.
+ *
+ * @param maxHeight The maximum allowed value for the calculated size height.
+ *
+ * @return Returns the size (x,y) such that the bounding box (0,0,x,y) will
+ * fit into (0,0,width,height) after transformation with <code>matrix</code>.
+ * Returns null if there is no possible solution.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static function fitTBoundsHeight(height:Number, matrix:Matrix,
+ explicitWidth:Number, explicitHeight:Number,
+ preferredWidth:Number, preferredHeight:Number,
+ minWidth:Number, minHeight:Number,
+ maxWidth:Number, maxHeight:Number):Point
+ {
+ var actualSize:Point;
+
+ // cases 1 and 2: only explicit width or explicit height is specified,
+ // so we try to find a solution with that hard constraint.
+ if (!isNaN(explicitWidth) && isNaN(explicitHeight))
+ {
+ actualSize = calcUBoundsToFitTBoundsHeight(height, matrix,
+ explicitWidth, preferredHeight,
+ explicitWidth, minHeight,
+ explicitWidth, maxHeight);
+
+ if (actualSize)
+ return actualSize;
+ }
+ else if (isNaN(explicitWidth) && !isNaN(explicitHeight))
+ {
+ actualSize = calcUBoundsToFitTBoundsHeight(height, matrix,
+ preferredWidth, explicitHeight,
+ minWidth, explicitHeight,
+ maxWidth, explicitHeight);
+ if (actualSize)
+ return actualSize;
+ }
+
+ // case 3: default case. When explicitWidth, explicitHeight are both set
+ // or not set, we use the preferred size since calcUBoundsToFitTBoundsWidth
+ // will just pick one.
+ actualSize = calcUBoundsToFitTBoundsHeight(height, matrix,
+ preferredWidth, preferredHeight,
+ minWidth, minHeight,
+ maxWidth, maxHeight);
+
+ return actualSize;
+ }
+
+ /**
+ * Calculates (x,y) such that the bounding box (0,0,x,y) transformed
+ * with <code>matrix</code> will have bounding box with
+ * height equal to <code>h</code>.
+ * x and y are restricted by <code>minX</code>, <code>maxX</code> and
+ * <code>minY</code>, <code>maxY</code>.
+ *
+ * If possible x will be set to <code>preferredX</code> or
+ * y will be set to <code>preferredY</code>.
+ *
+ * When there are multiple solutions, the function picks the one that
+ * minimizes the bounding box area of transformed (0,0,x,y).
+ *
+ * The functon assumes <code>minX >= 0</code> and <code>minY >= 0</code>
+ * (solution components x and y are non-negative).
+ *
+ * @return Returns Point(x,y) or null if no solution exists.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ static public function calcUBoundsToFitTBoundsHeight(h:Number,
+ matrix:Matrix,
+ preferredX:Number,
+ preferredY:Number,
+ minX:Number,
+ minY:Number,
+ maxX:Number,
+ maxY:Number):Point
+ {
+ // Untransformed bounds size is (x,y). The corners of the untransformed
+ // bounding box are p1(0,0) p2(x,0) p3(0,y) p4(x,y).
+ // Matrix is | a c tx |
+ // | b d ty |
+ //
+ // After transfomation with the matrix those four points are:
+ // t1 = (0, 0) = matrix.deltaTransformPoint(p1)
+ // t2 = (ax, bx) = matrix.deltaTransformPoint(p2)
+ // t3 = (cy, dy) = matrix.deltaTransformPoint(p3)
+ // t4 = (ax + cy, cx + dy) = matrix.deltaTransformPoint(p4)
+ //
+ // The transformed bounds bounding box dimensions are (w,h):
+ // (1) w = max( t1.x, t2.x, t3.x, t4.x ) - min( t1.x, t2.x, t3.x, t4.x)
+ // (2) h = max( t1.y, t2.y, t3.y, t4.y ) - min( t1.y, t2.y, t3.y, t4.y)
+ //
+ // Looking at all the possible cases for min and max functions above,
+ // we can construct and solve simple linear systems for x and y.
+ // For example in the case of
+ // t1.x <= t2.x <= t3.x <= t4.x
+ // our first equation is
+ // (1) w = t4.x - t1.x <==> w = ax + cy
+ //
+ // To minimize the cases we're looking at we can take advantage of
+ // the limits we have: x >= 0, y >= 0;
+ // Taking into account these limits we deduce that:
+ // a*c >= 0 gives us (1) w = abs( t4.x - t1.x ) = abs( ax + cy )
+ // a*c < 0 gives us (1) w = abs( t2.x - t3.x ) = abs( ax - cy )
+ // b*d >= 0 gives us (2) h = abs( t4.y - t1.y ) = abs( bx + dy )
+ // b*d < 0 gives us (2) h = abs( t2.y - t3.y ) = abs( bx - dy )
+ //
+ // If we do a substitution such that
+ // c1 = a*c >= 0 ? c : -c
+ // d1 = b*d >= 0 ? d : -d
+ // we get the following linear system:
+ // (1) w = abs( ax + c1y )
+ // (2) h = abs( bx + d1y )
+ //
+ // Since we're matching height we only care about (2)
+
+ var b:Number = matrix.b;
+ var d:Number = matrix.d;
+
+ // If components are very close to zero, zero them out to handle the special cases
+ if (-1.0e-9 < b && b < +1.0e-9)
+ b = 0;
+ if (-1.0e-9 < d && d < +1.0e-9)
+ d = 0;
+
+ if (b == 0 && d == 0)
+ return null; // No solution
+
+ // Handle special cases first
+ if (b == 0 && d == 0)
+ return null; // No solution
+
+ if (b == 0)
+ return new Point( preferredX, h / Math.abs(d) );
+ else if (d == 0)
+ return new Point( h / Math.abs(b), preferredY );
+
+ const d1:Number = (b*d >= 0) ? d : -d;
+ // Now we have the following linear sytesm:
+ // (1) x = preferredX or y = preferredY
+ // (2) h = abs( bx + d1y )
+
+ var s:Point;
+ var x:Number;
+ var y:Number;
+
+ if (d1 != 0 && preferredX > 0)
+ {
+ const invD1:Number = 1 / d1;
+ preferredX = Math.max(minX, Math.min(maxX, preferredX));
+ x = preferredX;
+
+ // Case1:
+ // bx + d1y >= 0
+ // x = preferredX
+ y = (h - b * x) * invD1;
+ if (minY <= y && y <= maxY &&
+ b * x + d1 * y >= 0 ) // Satisfy Case1
+ {
+ s = new Point(x, y);
+ }
+
+ // Case2:
+ // bx + d1y < 0
+ // x = preferredX
+ y = (-h - b * x) * invD1;
+ if (minY <= y && y <= maxY &&
+ b * x + d1 * y < 0 ) // Satisfy Case2
+ {
+ // If there is no solution, or the new solution yields smaller value, pick the new solution.
+ if (!s || transformSize(s.x, s.y, matrix).x > transformSize(x, y, matrix).x)
+ s = new Point(x, y);
+ }
+ }
+
+ if (b != 0 && preferredY > 0)
+ {
+ const invB:Number = 1 / b;
+ preferredY = Math.max(minY, Math.min(maxY, preferredY));
+ y = preferredY;
+
+ // Case3:
+ // bx + d1y >= 0
+ // y = preferredY
+ x = ( h - d1 * y ) * invB;
+ if (minX <= x && x <= maxX &&
+ b * x + d1 * y >= 0) // Satisfy Case3
+ {
+ // If there is no solution, or the new solution yields smaller value, pick the new solution.
+ if (!s || transformSize(s.x, s.y, matrix).x > transformSize(x, y, matrix).x)
+ s = new Point(x, y);
+ }
+
+ // Case4:
+ // bx + d1y < 0
+ // y = preferredY
+ x = ( -h - d1 * y ) * invB;
+ if (minX <= x && x <= maxX &&
+ b * x + d1 * y < 0) // Satisfy Case4
+ {
+ // If there is no solution, or the new solution yields smaller value, pick the new solution.
+ if (!s || transformSize(s.x, s.y, matrix).x > transformSize(x, y, matrix).x)
+ s = new Point(x, y);
+ }
+ }
+
+ // If there's already a solution that matches preferred dimention, return
+ if (s)
+ return s;
+
+ // Find a solution that matches the width and minimizes the height:
+ const a:Number = matrix.a;
+ const c:Number = matrix.c;
+ const c1:Number = ( a*c >= 0 ) ? c : -c;
+ return solveEquation(b, d1, h, minX, minY, maxX, maxY, a, c1);
+ }
+
+ /**
+ * Calculates (x,y) such that the bounding box (0,0,x,y) transformed
+ * with <code>matrix</code> will have bounding box with
+ * width equal to <code>w</code>.
+ * x and y are restricted by <code>minX</code>, <code>maxX</code> and
+ * <code>minY</code>, <code>maxY</code>.
+ *
+ * If possible x will be set to <code>preferredX</code> or
+ * y will be set to <code>preferredY</code>.
+ *
+ * When there are multiple solutions, the function picks the one that
+ * minimizes the bounding box area of transformed (0,0,x,y).
+ *
+ * The functon assumes <code>minX >= 0</code> and <code>minY >= 0</code>
+ * (solution components x and y are non-negative).
+ *
+ * @return Returns Point(x,y) or null if no solution exists.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ static public function calcUBoundsToFitTBoundsWidth(w:Number,
+ matrix:Matrix,
+ preferredX:Number,
+ preferredY:Number,
+ minX:Number,
+ minY:Number,
+ maxX:Number,
+ maxY:Number):Point
+ {
+ // Untransformed bounds size is (x,y). The corners of the untransformed
+ // bounding box are p1(0,0) p2(x,0) p3(0,y) p4(x,y).
+ // Matrix is | a c tx |
+ // | b d ty |
+ //
+ // After transfomation with the matrix those four points are:
+ // t1 = (0, 0) = matrix.deltaTransformPoint(p1)
+ // t2 = (ax, bx) = matrix.deltaTransformPoint(p2)
+ // t3 = (cy, dy) = matrix.deltaTransformPoint(p3)
+ // t4 = (ax + cy, cx + dy) = matrix.deltaTransformPoint(p4)
+ //
+ // The transformed bounds bounding box dimensions are (w,h):
+ // (1) w = max( t1.x, t2.x, t3.x, t4.x ) - min( t1.x, t2.x, t3.x, t4.x)
+ // (2) h = max( t1.y, t2.y, t3.y, t4.y ) - min( t1.y, t2.y, t3.y, t4.y)
+ //
+ // Looking at all the possible cases for min and max functions above,
+ // we can construct and solve simple linear systems for x and y.
+ // For example in the case of
+ // t1.x <= t2.x <= t3.x <= t4.x
+ // our first equation is
+ // (1) w = t4.x - t1.x <==> w = ax + cy
+ //
+ // To minimize the cases we're looking at we can take advantage of
+ // the limits we have: x >= 0, y >= 0;
+ // Taking into account these limits we deduce that:
+ // a*c >= 0 gives us (1) w = abs( t4.x - t1.x ) = abs( ax + cy )
+ // a*c < 0 gives us (1) w = abs( t2.x - t3.x ) = abs( ax - cy )
+ // b*d >= 0 gives us (2) h = abs( t4.y - t1.y ) = abs( bx + dy )
+ // b*d < 0 gives us (2) h = abs( t2.y - t3.y ) = abs( bx - dy )
+ //
+ // If we do a substitution such that
+ // c1 = a*c >= 0 ? c : -c
+ // d1 = b*d >= 0 ? d : -d
+ // we get the following linear system:
+ // (1) w = abs( ax + c1y )
+ // (2) h = abs( bx + d1y )
+ //
+ // Since we're matching width we only care about (1)
+
+ var a:Number = matrix.a;
+ var c:Number = matrix.c;
+
+ // If components are very close to zero, zero them out to handle the special cases
+ if (-1.0e-9 < a && a < +1.0e-9)
+ a = 0;
+ if (-1.0e-9 < c && c < +1.0e-9)
+ c = 0;
+
+ // Handle special cases first
+ if (a == 0 && c == 0)
+ return null; // No solution
+
+ if (a == 0)
+ return new Point( preferredX, w / Math.abs(c) );
+ else if (c == 0)
+ return new Point( w / Math.abs(a), preferredY );
+
+ const c1:Number = ( a*c >= 0 ) ? c : -c;
+ // Now we have the following linear sytesm:
+ // (1) w = abs( ax + c1y )
+ // (2) x = preferredX or y = preferredY
+
+ var s:Point;
+ var x:Number;
+ var y:Number;
+
+ if (c1 != 0 && preferredX > 0)
+ {
+ const invC1:Number = 1 / c1;
+ preferredX = Math.max(minX, Math.min(maxX, preferredX));
+ x = preferredX;
+
+ // Case1:
+ // a * x + c1 * y >= 0
+ // x = preferredX
+ y = (w - a * x) * invC1;
+ if (minY <= y && y <= maxY &&
+ a * x + c1 * y >= 0 ) // Satisfy Case1
+ {
+ s = new Point(x, y);
+ }
+
+ // Case2:
+ // a * x + c1 * y < 0
+ // x = preferredX
+ y = (-w - a * x) * invC1;
+ if (minY <= y && y <= maxY &&
+ a * x + c1 * y < 0 ) // Satisfy Case2
+ {
+ // If there is no solution, or the new solution yields smaller value, pick the new solution.
+ if (!s || transformSize(s.x, s.y, matrix).y > transformSize(x, y, matrix).y)
+ s = new Point(x, y);
+ }
+ }
+
+ if (a != 0 && preferredY > 0)
+ {
+ const invA:Number = 1 / a;
+ preferredY = Math.max(minY, Math.min(maxY, preferredY));
+ y = preferredY;
+
+ // Case3:
+ // a * x + c1 * y >= 0
+ // y = preferredY
+ x = (w - c1 * y ) * invA;
+ if (minX <= x && x <= maxX &&
+ a * x + c1 * y >= 0) // Satisfy Case3
+ {
+ // If there is no solution, or the new solution yields smaller value, pick the new solution.
+ if (!s || transformSize(s.x, s.y, matrix).y > transformSize(x, y, matrix).y)
+ s = new Point(x, y);
+ }
+
+ // Case4:
+ // a * x + c1 * y < 0
+ // y = preferredY
+ x = (-w - c1 * y ) * invA;
+ if (minX <= x && x <= maxX &&
+ a * x + c1 * y < 0) // Satisfy Case4
+ {
+ // If there is no solution, or the new solution yields smaller value, pick the new solution.
+ if (!s || transformSize(s.x, s.y, matrix).y > transformSize(x, y, matrix).y)
+ s = new Point(x, y);
+ }
+ }
+
+ // If there's already a solution that matches preferred dimention, return
+ if (s)
+ return s;
+
+ // Find a solution that matches the width and minimizes the height:
+ const b:Number = matrix.b;
+ const d:Number = matrix.d;
+ const d1:Number = (b*d >= 0) ? d : -d;
+ return solveEquation(a, c1, w, minX, minY, maxX, maxY, b, d1);
+ }
+
+ /**
+ * Finds a solution (x,y) for the equation abs(a*x + c*y) = w such that
+ * abs(b*x +d*y) is minimized.
+ * If there is infinite number of solutions, x and y are picked to be
+ * as close as possible.
+ *
+ * Doesn't handle cases where <code>a</code> or <code>c</code> are zero.
+ *
+ * @return Returns Point(x,y)
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ static private function solveEquation(a:Number,
+ c:Number,
+ w:Number,
+ minX:Number,
+ minY:Number,
+ maxX:Number,
+ maxY:Number,
+ b:Number,
+ d:Number):Point
+ {
+ if (a == 0 || c == 0)
+ return null; // x and y are not co-dependent
+
+ // (1) w = abs( ax + cy )
+ // Find the range of solutsion for y and pick:
+ var x:Number;
+ var y:Number;
+ var s:Point;
+
+ // Case1: ax + cy >= 0, from (1) above we get:
+ // (1) x = (w - cy) / a
+ //
+ // Lets find the possible range of values for y:
+ // We know that
+ // (3) minX <= x <= maxX
+ //
+ // Substitute x with (w - cy)/a in (3):
+ // (3) minX - w/a <= -cy/a <= maxX - w/a
+ // (3) min( A, B ) <= y <= max( A, B ), where
+ // A = (minX - w/a) * (-a/c)
+ // B = (maxX - w/a) * (-a/c)
+
+ var A:Number = (w - minX * a) / c;
+ var B:Number = (w - maxX * a) / c;
+ var rangeMinY:Number = Math.max(minY, Math.min(A, B));
+ var rangeMaxY:Number = Math.min(maxY, Math.max(A, B));
+ const det:Number = (b * c - a * d);
+
+ // We have a possible solution for Case1 if the range for y is valid
+ if (rangeMinY <= rangeMaxY)
+ {
+ // Now that we have a valid range for y, we need to pick a value within
+ // that range.
+ //
+ // We calculate the value based on a custom condition.
+ //
+ // The custom condition that we use could be anything that defines
+ // another equation for x and y. Some examples are:
+ // "make x and y as close as possible": y = w / ( a + c );
+ // "minimize abs(bx + dy)": y = b * w / det
+ // "preserve aspect ratio": y = w / ( a * preferredX / preferredY + c );
+ if (Math.abs(det) < 1.0e-9)
+ {
+ // There is infinite number of solutions, lets pick x == y
+ y = w / ( a + c );
+ }
+ else
+ {
+ // Minimize abs(bx + dy) - we need to solve:
+ // abs( b * ( w - c * y ) / a + d * y ) = 0
+ // which gives us:
+ y = b * w / det;
+ }
+
+ // Now that we have the y value calculated from the custom condition,
+ // we clamp with the range. This gives us a solution with
+ // values as close as possible to satisfy our custom condition when
+ // the condition is a linear function of x and y (in our case it is).
+ y = Math.max(rangeMinY, Math.min(y, rangeMaxY));
+
+ x = (w - c * y) / a;
+ return new Point(x, y);
+ }
+
+ // Case2: ax + cy < 0, from (1) above we get:
+ // (1) x = (-w - cy) / a
+ //
+ // Lets find the possible range of values for y:
+ // We know that
+ // (3) minX <= x <= maxX
+ //
+ // Substitute x with (-w - cy)/a in (3):
+ // (3) minX + w/a <= -cy/a <= maxX + w/a
+ // (3) min( A, B ) <= y <= max( A, B ), where
+ // A = (minX + w/a) * (-a/c)
+ // B = (maxX + w/a) * (-a/c)
+
+ A = -(minX * a + w) / c;
+ B = -(maxX * a + w) / c;
+ rangeMinY = Math.max(minY, Math.min(A, B));
+ rangeMaxY = Math.min(maxY, Math.max(A, B));
+
+ // We have a possible solution for Case2 if the range for y is valid
+ if (rangeMinY <= rangeMaxY)
+ {
+ // Now that we have a valid range for y, we need to pick a value within
+ // that range.
+ //
+ // We calculate the value based on a custom condition.
+ //
+ // The custom condition that we use could be anything that defines
+ // another equation for x and y. Some examples are:
+ // "make x and y as close as possible": y = -w / ( a + c );
+ // "minimize abs(bx + dy)": y = -b * w / det
+ // "preserve aspect ratio": y = w / ( a * preferredX / preferredY + c );
+ if (Math.abs(det) < 1.0e-9)
+ {
+ // There is infinite number of solutions, lets pick x == y
+ y = -w / ( a + c );
+ }
+ else
+ {
+ // Minimize abs(bx + dy) - we need to solve:
+ // abs( b * ( -w - c * y ) / a + d * y ) = 0
+ // which gives us:
+ y = -b * w / det;
+ }
+
+ // Now that we have the y value calculated from the custom condition,
+ // we clamp with the range. This gives us a solution with
+ // values as close as possible to satisfy our custom condition when
+ // the condition is a linear function of x and y (in our case it is).
+ y = Math.max(rangeMinY, Math.min(y, rangeMaxY));
+ x = (-w - c * y) / a;
+ return new Point(x, y);
+
+ }
+ return null; // No solution
+ }
+
+ /**
+ * Calculates (x,y) such that the bounding box (0,0,x,y) transformed
+ * with <code>matrix</code> will have bounding box (0,0,w,h).
+ * x and y are restricted by <code>minX</code>, <code>maxX</code> and
+ * <code>minY</code>, <code>maxY</code>.
+ *
+ * When there is infinite number of solutions, the function will
+ * calculate x and y to be as close as possible.
+ *
+ * The functon assumes <code>minX >= 0</code> and <code>minY >= 0</code>
+ * (solution components x and y are non-negative).
+ *
+ * @return Point(x,y) or null if no solution exists.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ static public function calcUBoundsToFitTBounds(w:Number,
+ h:Number,
+ matrix:Matrix,
+ minX:Number,
+ minY:Number,
+ maxX:Number,
+ maxY:Number):Point
+ {
+ // Untransformed bounds size is (x,y). The corners of the untransformed
+ // bounding box are p1(0,0) p2(x,0) p3(0,y) p4(x,y).
+ // Matrix is | a c tx |
+ // | b d ty |
+ //
+ // After transfomation with the matrix those four points are:
+ // t1 = (0, 0) = matrix.deltaTransformPoint(p1)
+ // t2 = (ax, bx) = matrix.deltaTransformPoint(p2)
+ // t3 = (cy, dy) = matrix.deltaTransformPoint(p3)
+ // t4 = (ax + cy, cx + dy) = matrix.deltaTransformPoint(p4)
+ //
+ // The transformed bounds bounding box dimensions are (w,h):
+ // (1) w = max( t1.x, t2.x, t3.x, t4.x ) - min( t1.x, t2.x, t3.x, t4.x)
+ // (2) h = max( t1.y, t2.y, t3.y, t4.y ) - min( t1.y, t2.y, t3.y, t4.y)
+ //
+ // Looking at all the possible cases for min and max functions above,
+ // we can construct and solve simple linear systems for x and y.
+ // For example in the case of
+ // t1.x <= t2.x <= t3.x <= t4.x
+ // our first equation is
+ // (1) w = t4.x - t1.x <==> w = ax + cy
+ //
+ // To minimize the cases we're looking at we can take advantage of
+ // the limits we have: x >= 0, y >= 0;
+ // Taking into account these limits we deduce that:
+ // a*c >= 0 gives us (1) w = abs( t4.x - t1.x ) = abs( ax + cy )
+ // a*c < 0 gives us (1) w = abs( t2.x - t3.x ) = abs( ax - cy )
+ // b*d >= 0 gives us (2) h = abs( t4.y - t1.y ) = abs( bx + dy )
+ // b*d < 0 gives us (2) h = abs( t2.y - t3.y ) = abs( bx - dy )
+ //
+ // If we do a substitution such that
+ // c1 = a*c >= 0 ? c : -c
+ // d1 = b*d >= 0 ? d : -d
+ // we get the following linear system:
+ // (1) w = abs( ax + c1y )
+ // (2) h = abs( bx + d1y )
+ //
+
+ var a:Number = matrix.a;
+ var b:Number = matrix.b;
+ var c:Number = matrix.c;
+ var d:Number = matrix.d;
+
+ // If components are very close to zero, zero them out to handle the special cases
+ if (-1.0e-9 < a && a < +1.0e-9)
+ a = 0;
+ if (-1.0e-9 < b && b < +1.0e-9)
+ b = 0;
+ if (-1.0e-9 < c && c < +1.0e-9)
+ c = 0;
+ if (-1.0e-9 < d && d < +1.0e-9)
+ d = 0;
+
+ // Handle special cases.
+ if (b == 0 && c == 0)
+ {
+ // No solution in the following cases since the matrix collapses
+ // all points into a line.
+ if (a == 0 || d == 0)
+ return null;
+
+ // (1) w = abs( ax + cy ) <=> w = abs( ax ) <=> w = abs(a)x
+ // (2) h = abs( bx + dy ) <=> h = abs( dy ) <=> h = abs(d)y
+ return new Point(w / Math.abs(a), h / Math.abs(d));
+ }
+
+ if (a == 0 && d == 0)
+ {
+ // No solution in the following cases since the matrix collapses
+ // all points into a line.
+ if (b == 0 || c == 0)
+ return null;
+
+ // (1) w = abs( ax + cy ) <=> w = abs( cy ) <=> w = abs(c)y
+ // (2) h = abs( bx + dy ) <=> h = abs( bx ) <=> h = abs(b)x
+ return new Point(h / Math.abs(b), w / Math.abs(c));
+ }
+
+ // Handle general cases.
+ const c1:Number = ( a*c >= 0 ) ? c : -c;
+ const d1:Number = ( b*d >= 0 ) ? d : -d;
+ // we get the following linear system:
+ // (1) w = abs( ax + c1y )
+ // (2) h = abs( bx + d1y )
+
+ // Calculate the determinant of the system
+ const det:Number = a * d1 - b * c1;
+ if (Math.abs(det) < 1.0e-9)
+ {
+ // No solution in these cases since the matrix
+ // collapses all points into a line.
+ if (c1 == 0 || a == 0 || a == -c1)
+ return null;
+
+ if (Math.abs(a * h - b * w) > 1.0e-9)
+ return null; // No solution in this case
+
+ // Determinant is zero, the equations (1) & (2) are equivalent and
+ // we have only one equation:
+ // (1) w = abs( ax + c1y )
+ //
+ // Solve it finding x and y as close as possible:
+ return solveEquation(a, c1, w, minX, minX, maxX, maxY, b, d1);
+ }
+
+ // Pre-multiply w & h by the inverse dteterminant
+ const invDet:Number = 1 / det;
+ w *= invDet;
+ h *= invDet;
+
+ // Case 1:
+ // a * x + c1 * y >= 0
+ // b * x + d1 * y >= 0
+ var s:Point;
+ s = solveSystem(a, c1, b, d1, w, h);
+ if (s &&
+ minX <= s.x && s.x <= maxX && minY <= s.y && s.y <= maxY &&
+ a * s.x + c1 * s.x >= 0 &&
+ b * s.x + d1 * s.y >= 0)
+ return s;
+
+ // Case 2:
+ // a * x + c1 * y >= 0
+ // b * x + d1 * y < 0
+ s = solveSystem( a, c1, b, d1, w, -h);
+ if (s &&
+ minX <= s.x && s.x <= maxX && minY <= s.y && s.y <= maxY &&
+ a * s.x + c1 * s.x >= 0 &&
+ b * s.x + d1 * s.y < 0)
+ return s;
+
+ // Case 3:
+ // a * x + c1 * y < 0
+ // b * x + d1 * y >= 0
+ s = solveSystem( a, c1, b, d1, -w, h);
+ if (s &&
+ minX <= s.x && s.x <= maxX && minY <= s.y && s.y <= maxY &&
+ a * s.x + c1 * s.x < 0 &&
+ b * s.x + d1 * s.y >= 0)
+ return s;
+
+ // Case 4:
+ // a * x + c1 * y < 0
+ // b * x + d1 * y < 0
+ s = solveSystem( a, c1, b, d1, -w, -h);
+ if (s &&
+ minX <= s.x && s.x <= maxX && minY <= s.y && s.y <= maxY &&
+ a * s.x + c1 * s.x < 0 &&
+ b * s.x + d1 * s.y < 0)
+ return s;
+
+ return null; // No solution.
+ }
+
+ /**
+ * Determine if two Matrix instances are equal.
+ *
+ * @return true if the matrices are equal.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isEqual(m1:Matrix, m2:Matrix):Boolean
+ {
+ return ((m1 && m2 &&
+ m1.a == m2.a &&
+ m1.b == m2.b &&
+ m1.c == m2.c &&
+ m1.d == m2.d &&
+ m1.tx == m2.tx &&
+ m1.ty == m2.ty) ||
+ (!m1 && !m2));
+ }
+
+ /**
+ * Determine if two Matrix3D instances are equal.
+ *
+ * @return true if the matrices are equal.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isEqual3D(m1:Matrix3D, m2:Matrix3D):Boolean
+ {
+ if (m1 && m2 && m1.rawData.length == m2.rawData.length)
+ {
+ var r1:Vector.<Number> = m1.rawData;
+ var r2:Vector.<Number> = m2.rawData;
+
+ return (r1[0] == r2[0] &&
+ r1[1] == r2[1] &&
+ r1[2] == r2[2] &&
+ r1[3] == r2[3] &&
+ r1[4] == r2[4] &&
+ r1[5] == r2[5] &&
+ r1[6] == r2[6] &&
+ r1[7] == r2[7] &&
+ r1[8] == r2[8] &&
+ r1[9] == r2[9] &&
+ r1[10] == r2[10] &&
+ r1[11] == r2[11] &&
+ r1[12] == r2[12] &&
+ r1[13] == r2[13] &&
+ r1[14] == r2[14] &&
+ r1[15] == r2[15]);
+ }
+
+ return (!m1 && !m2);
+ }
+
+ /**
+ * Calculates (x,y) such as to satisfy the linear system:
+ * | a * x + c * y = m
+ * | b * x + d * y = n
+ *
+ * @param mOverDet <code>mOverDet must be equal to m / (a*d - b*c)</code>
+ * @param nOverDet <code>mOverDet must be equal to n / (a*d - b*c)</code>
+ *
+ * @return returns Point(x,y)
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ static private function solveSystem(a:Number,
+ c:Number,
+ b:Number,
+ d:Number,
+ mOverDet:Number,
+ nOverDet:Number):Point
+ {
+ return new Point(d * mOverDet - c * nOverDet,
+ a * nOverDet - b * mOverDet);
+ }
+
+ /**
+ * Workaround for player's concatenatedMatrix being wrong in some situations, such
+ * as when there is a filter or a scrollRect somewhere in the object's container
+ * hierarchy. Walk the parent tree manually, calculating the matrix manually.
+ *
+ * @param displayObject Calculate the concatenatedMatrix for this displayObject
+ *
+ * @param topParent <p>When specified, the matrix is computed up to the topParent,
+ * excluding topParent's concatenated matrix. This is useful when computing a transform
+ * in order to move an object to a different parent but the object's transform needs
+ * to be adjusted in order to keep its original position on screen.</p>
+ *
+ * @return The concatenatedMatrix for the displayObject
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static function getConcatenatedMatrix(displayObject:DisplayObject, topParent:DisplayObject):Matrix
+ {
+ return getConcatenatedMatrixHelper(displayObject, false, topParent);
+ }
+
+ /**
+ * Workaround for player's concatenatedMatrix being wrong in some situations, such
+ * as when there is a filter or a scrollRect somewhere in the object's container
+ * hierarchy. Walk the parent tree manually, calculating the matrix manually.
+ *
+ * This function differs from getConcatenatedMatrix in that it combines the
+ * computedMatrix of each ancestor. The computedMatrix includes transform offsets.
+ *
+ * @param displayObject Calculate the concatenatedMatrix for this displayObject
+ *
+ * @param topParent <p>When specified, the matrix is computed up to the topParent,
+ * excluding topParent's concatenated matrix. This is useful when computing a transform
+ * in order to move an object to a different parent but the object's transform needs
+ * to be adjusted in order to keep its original position on screen.</p>
+ *
+ * @return The concatenatedMatrix for the displayObject
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static function getConcatenatedComputedMatrix(displayObject:DisplayObject, topParent:DisplayObject):Matrix
+ {
+ return getConcatenatedMatrixHelper(displayObject, true, topParent);
+ }
+
+ /**
+ * @private
+ */
+ private static function getConcatenatedMatrixHelper(displayObject:DisplayObject, useComputedMatrix:Boolean, topParent:DisplayObject):Matrix
+ {
+ var m:Matrix = new Matrix();
+
+ // This check should be made once per top-level ApplicationDomain
+ if (usesMarshalling == null)
+ {
+ // Check if marshalling support has been turned on
+ usesMarshalling = ApplicationDomain.currentDomain.hasDefinition("mx.managers.systemClasses.MarshallingSupport");
+
+ // If we aren't using marshalling, then we only have one ApplicationDomain and thus one class
+ // definition for UIComponent
+ if (!usesMarshalling && ApplicationDomain.currentDomain.hasDefinition("mx.core.UIComponent"))
+ uiComponentClass = Class(ApplicationDomain.currentDomain.getDefinition("mx.core.UIComponent"));
+ // same thing for UIMovieClip
+ if (!usesMarshalling && ApplicationDomain.currentDomain.hasDefinition("mx.flash.UIMovieClip"))
+ uiMovieClipClass = Class(ApplicationDomain.currentDomain.getDefinition("mx.flash.UIMovieClip"));
+ }
+
+ // Note, root will be "null" if the displayObject is off the display list. In particular,
+ // during start-up, before applicationComplete is dispatched, root will be null.
+ // Note that getConcatenatedMatrixHelper() with topParent == sandboxRoot will still work
+ // correctly in those cases as we use ".$parent" to walk up the parent chain and during start-up
+ // $parent will be null for the application before applicationComplete has been dispatched.
+
+ if (fakeDollarParent == null)
+ fakeDollarParent = new QName(mx_internal, "$parent");
+
+ if (useComputedMatrix && computedMatrixProperty == null)
+ computedMatrixProperty = new QName(mx_internal, "computedMatrix");
+
+ if ($transformProperty == null)
+ $transformProperty = new QName(mx_internal, "$transform");
+
+
+ var displayObjectMatrix:Matrix = displayObject ? displayObject.transform.matrix : null ;
+ var notTopAndHasMatrix:Boolean = displayObjectMatrix!=null && displayObject != topParent;
+ while (notTopAndHasMatrix)
+ {
+ var scrollRect:Rectangle = displayObject.scrollRect;
+ if (scrollRect != null)
+ m.translate(-scrollRect.x, -scrollRect.y);
+
+ // If we are using marshalling, we can have multiple class definitions of UIComponent
+ if (usesMarshalling && "moduleFactory" in displayObject)
+ {
+ var moduleFactory:Object = displayObject["moduleFactory"];
+ // If the module factory has changed, then we are in a different ApplicationDomain
+ if (moduleFactory && moduleFactory !== lastModuleFactory && "info" in moduleFactory)
+ {
+ var appDomain:ApplicationDomain;
+
+ appDomain = moduleFactory["info"]()["currentDomain"];
+ // Get the class definition for UIComponent in the current ApplicationDomain
+ if (appDomain && appDomain.hasDefinition("mx.core.UIComponent"))
+ uiComponentClass = Class(appDomain.getDefinition("mx.core.UIComponent"));
+ // same thing for UIMovieClip
+ if (appDomain && appDomain.hasDefinition("mx.flash.UIMovieClip"))
+ uiMovieClipClass = Class(appDomain.getDefinition("mx.flash.UIMovieClip"));
+
+ lastModuleFactory = moduleFactory;
+ }
+ }
+
+ var isUIComponent:Boolean = uiComponentClass && displayObject is uiComponentClass;
+ var isUIMovieClip:Boolean = uiMovieClipClass && displayObject is uiMovieClipClass;
+
+ if (useComputedMatrix && isUIComponent)
+ m.concat(displayObject[computedMatrixProperty]);
+ else if (isUIMovieClip)
+ m.concat(displayObject[$transformProperty].matrix);
+ else
+ m.concat(displayObjectMatrix);
+
+ // Try to access $parent, which is the true display list parent
+ if (isUIComponent)
+ displayObject = displayObject[fakeDollarParent] as DisplayObject;
+ else
+ displayObject = displayObject.parent as DisplayObject;
+
+ displayObjectMatrix = displayObject ? displayObject.transform.matrix : null;
+ notTopAndHasMatrix = displayObjectMatrix!=null && displayObject != topParent;
+ }
+ return m;
+ }
+
+}
+
+}
[22/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/SystemManagerGlobals.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/SystemManagerGlobals.as b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManagerGlobals.as
new file mode 100644
index 0000000..4b19eeb
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManagerGlobals.as
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class SystemManagerGlobals
+{
+ public static var topLevelSystemManagers:Array
+ /* of SystemManager */ = [];
+ public static var bootstrapLoaderInfoURL:String;
+
+ public static var showMouseCursor:Boolean;
+
+ public static var changingListenersInOtherSystemManagers:Boolean;
+
+ public static var dispatchingEventToOtherSystemManagers:Boolean;
+
+ /**
+ * @private
+ * reference to the info() object from the first systemManager
+ * in the application..
+ */
+ public static var info:Object;
+
+ /**
+ * @private
+ * reference to the loaderInfo.parameters object from the first systemManager
+ * in the application..
+ */
+ public static var parameters:Object;
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/SystemRawChildrenList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/SystemRawChildrenList.as b/frameworks/projects/MX/src/main/flex/mx/managers/SystemRawChildrenList.as
new file mode 100644
index 0000000..e810815
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/SystemRawChildrenList.as
@@ -0,0 +1,240 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.geom.Point;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import org.apache.flex.geom.Point;
+}
+import mx.core.IChildList;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * A SystemManager has various types of children,
+ * such as the Application, popups,
+ * tooltips, and custom cursors.
+ * You can access the just the custom cursors through
+ * the <code>cursors</code> property,
+ * the tooltips via <code>toolTips</code>, and
+ * the popups via <code>popUpChildren</code>. Each one returns
+ * a SystemChildrenList which implements IChildList. The SystemManager's
+ * IChildList methods return the set of children that aren't popups, tooltips
+ * or cursors. To get the list of all children regardless of type, you
+ * use the rawChildrenList property which returns this SystemRawChildrenList.
+ */
+public class SystemRawChildrenList implements IChildList
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function SystemRawChildrenList(owner:SystemManager)
+ {
+ super();
+
+ this.owner = owner;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var owner:SystemManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @copy mx.core.IChildList#numChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get numChildren():int
+ {
+ return owner.$numChildren;
+ }
+
+ /**
+ * @copy mx.core.IChildList#getChildAt
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChildAt(index:int):DisplayObject
+ {
+ return owner.rawChildren_getChildAt(index);
+ }
+
+ /**
+ * @copy mx.core.IChildList#addChild
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addChild(child:DisplayObject):DisplayObject
+ {
+ return owner.rawChildren_addChild(child);
+ }
+
+ /**
+ * @copy mx.core.IChildList#addChildAt
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ return owner.rawChildren_addChildAt(child,index);
+ }
+
+ /**
+ * @copy mx.core.IChildList#removeChild
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeChild(child:DisplayObject):DisplayObject
+ {
+ return owner.rawChildren_removeChild(child);
+ }
+
+ /**
+ * @copy mx.core.IChildList#removeChildAt
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeChildAt(index:int):DisplayObject
+ {
+ return owner.rawChildren_removeChildAt(index);
+ }
+
+ /**
+ * @copy mx.core.IChildList#getChildByName
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChildByName(name:String):DisplayObject
+ {
+ return owner.rawChildren_getChildByName(name);
+ }
+
+ /**
+ * @copy mx.core.IChildList#getChildIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChildIndex(child:DisplayObject):int
+ {
+ return owner.rawChildren_getChildIndex(child);
+ }
+
+ /**
+ * @copy mx.core.IChildList#setChildIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setChildIndex(child:DisplayObject, newIndex:int):void
+ {
+ owner.rawChildren_setChildIndex(child, newIndex);
+ }
+
+ /**
+ * @copy mx.core.IChildList#getObjectsUnderPoint
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getObjectsUnderPoint(point:Point):Array
+ {
+ return owner.rawChildren_getObjectsUnderPoint(point);
+ }
+
+ /**
+ * @copy mx.core.IChildList#contains
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function contains(child:DisplayObject):Boolean
+ {
+ return owner.rawChildren_contains(child);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManager.as
new file mode 100644
index 0000000..95a55ff
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManager.as
@@ -0,0 +1,526 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+}
+import org.apache.flex.events.EventDispatcher;
+import mx.core.IToolTip;
+import mx.core.IUIComponent;
+import mx.core.Singleton;
+import mx.core.mx_internal;
+import mx.effects.IAbstractEffect;
+
+/**
+ * The ToolTipManager lets you set basic ToolTip and error tip functionality,
+ * such as display delay and the disabling of ToolTips.
+ *
+ * @see mx.controls.ToolTip
+ * @see mx.validators.Validator
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ToolTipManager extends EventDispatcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Linker dependency on implementation class.
+ */
+ private static var implClassDependency:ToolTipManagerImpl;
+
+ /**
+ * @private
+ * Storage for the impl getter.
+ * This gets initialized on first access,
+ * not at static initialization time, in order to ensure
+ * that the Singleton registry has already been initialized.
+ */
+ private static var _impl:IToolTipManager2;
+
+ /**
+ * @private
+ * The singleton instance of ToolTipManagerImpl which was
+ * registered as implementing the IToolTipManager2 interface.
+ */
+ private static function get impl():IToolTipManager2
+ {
+ if (!_impl)
+ {
+ _impl = IToolTipManager2(
+ Singleton.getInstance("mx.managers::IToolTipManager2"));
+ }
+
+ return _impl;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentTarget
+ //----------------------------------
+
+ /**
+ * The UIComponent that is currently displaying a ToolTip,
+ * or <code>null</code> if none is.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get currentTarget():DisplayObject
+ {
+ return impl.currentTarget;
+ }
+
+ /**
+ * @private
+ */
+ public static function set currentTarget(value:DisplayObject):void
+ {
+ impl.currentTarget = value;
+ }
+
+ //----------------------------------
+ // currentToolTip
+ //----------------------------------
+
+ /**
+ * The ToolTip object that is currently visible,
+ * or <code>null</code> if none is shown.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get currentToolTip():IToolTip
+ {
+ return impl.currentToolTip;
+ }
+
+ /**
+ * @private
+ */
+ public static function set currentToolTip(value:IToolTip):void
+ {
+ impl.currentToolTip = value;
+ }
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * If <code>true</code>, the ToolTipManager will automatically show
+ * ToolTips when the user moves the mouse pointer over components.
+ * If <code>false</code>, no ToolTips will be shown.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get enabled():Boolean
+ {
+ return impl.enabled;
+ }
+
+ /**
+ * @private
+ */
+ public static function set enabled(value:Boolean):void
+ {
+ impl.enabled = value;
+ }
+
+ //----------------------------------
+ // hideDelay
+ //----------------------------------
+
+ /**
+ * The amount of time, in milliseconds, that Flex waits
+ * to hide the ToolTip after it appears.
+ * Once Flex hides a ToolTip, the user must move the mouse
+ * off the component and then back onto it to see the ToolTip again.
+ * If you set <code>hideDelay</code> to <code>Infinity</code>,
+ * Flex does not hide the ToolTip until the user triggers an event,
+ * such as moving the mouse off of the component.
+ *
+ * @default 10000
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get hideDelay():Number
+ {
+ return impl.hideDelay;
+ }
+
+ /**
+ * @private
+ */
+ public static function set hideDelay(value:Number):void
+ {
+ impl.hideDelay = value;
+ }
+
+ //----------------------------------
+ // hideEffect
+ //----------------------------------
+
+ /**
+ * The effect that plays when a ToolTip is hidden,
+ * or <code>null</code> if the ToolTip should disappear with no effect.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get hideEffect():IAbstractEffect
+ {
+ return impl.hideEffect;
+ }
+
+ /**
+ * @private
+ */
+ public static function set hideEffect(value:IAbstractEffect):void
+ {
+ impl.hideEffect = value;
+ }
+
+ //----------------------------------
+ // scrubDelay
+ //----------------------------------
+
+ /**
+ * The amount of time, in milliseconds, that a user can take
+ * when moving the mouse between controls before Flex again waits
+ * for the duration of <code>showDelay</code> to display a ToolTip.
+ *
+ * <p>This setting is useful if the user moves quickly from one control
+ * to another; after displaying the first ToolTip, Flex will display
+ * the others immediately rather than waiting.
+ * The shorter the setting for <code>scrubDelay</code>, the more
+ * likely that the user must wait for an amount of time specified
+ * by <code>showDelay</code> in order to see the next ToolTip.
+ * A good use of this property is if you have several buttons on a
+ * toolbar, and the user will quickly scan across them to see brief
+ * descriptions of their functionality.</p>
+ *
+ * @default 100
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get scrubDelay():Number
+ {
+ return impl.scrubDelay;
+ }
+
+ /**
+ * @private
+ */
+ public static function set scrubDelay(value:Number):void
+ {
+ impl.scrubDelay = value;
+ }
+
+ //----------------------------------
+ // showDelay
+ //----------------------------------
+
+ /**
+ * The amount of time, in milliseconds, that Flex waits
+ * before displaying the ToolTip box once a user
+ * moves the mouse over a component that has a ToolTip.
+ * To make the ToolTip appear instantly, set <code>showDelay</code> to 0.
+ *
+ * @default 500
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get showDelay():Number
+ {
+ return impl.showDelay;
+ }
+
+ /**
+ * @private
+ */
+ public static function set showDelay(value:Number):void
+ {
+ impl.showDelay = value;
+ }
+
+ //----------------------------------
+ // showEffect
+ //----------------------------------
+
+ /**
+ * The effect that plays when a ToolTip is shown,
+ * or <code>null</code> if the ToolTip should appear with no effect.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get showEffect():IAbstractEffect
+ {
+ return impl.showEffect;
+ }
+
+ /**
+ * @private
+ */
+ public static function set showEffect(value:IAbstractEffect):void
+ {
+ impl.showEffect = value;
+ }
+
+ //----------------------------------
+ // toolTipClass
+ //----------------------------------
+
+ /**
+ * The class to use for creating ToolTips.
+ *
+ * @default mx.controls.ToolTip
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get toolTipClass():Class
+ {
+ return impl.toolTipClass;
+ }
+
+ /**
+ * @private
+ */
+ public static function set toolTipClass(value:Class):void
+ {
+ impl.toolTipClass = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Registers a target UIComponent or UITextField, and the text
+ * for its ToolTip, with the ToolTipManager.
+ * This causes the ToolTipManager to display a ToolTip
+ * when the mouse hovers over the target.
+ *
+ * <p>This method is called by the setter
+ * for the toolTip property in UIComponent and UITextField.</p>
+ *
+ * @param target The UIComponent or UITextField that owns the ToolTip.
+ *
+ * @param toolTip The text to display in the ToolTip.
+ * If null, no ToolTip will be displayed when the mouse hovers
+ * over the target.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal static function registerToolTip(target:DisplayObject,
+ oldToolTip:String,
+ newToolTip:String):void
+ {
+ impl.registerToolTip(target, oldToolTip, newToolTip);
+ }
+
+ /**
+ * Registers a target UIComponent, and the text
+ * for its error tip, with the ToolTipManager.
+ * This causes the ToolTipManager to display an error tip
+ * when the mouse hovers over the target.
+ *
+ * <p>This method is called by the setter
+ * for the errorString property in UIComponent.</p>
+ *
+ * @param target The UIComponent or UITextField that owns the ToolTip.
+ *
+ * @param toolTip The text to display in the ToolTip.
+ * If null, no ToolTip will be displayed when the mouse hovers
+ * over the target.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal static function registerErrorString(target:DisplayObject,
+ oldErrorString:String,
+ newErrorString:String):void
+ {
+ impl.registerErrorString(target, oldErrorString, newErrorString);
+ }
+
+ /**
+ * @private
+ * Objects added to the SystemManager's ToolTip layer don't get
+ * automatically measured or sized, so ToolTipManager has to
+ * measure it and set its size.
+ */
+ mx_internal static function sizeTip(toolTip:IToolTip):void
+ {
+ impl.sizeTip(toolTip);
+ }
+
+ /**
+ * Creates an instance of the ToolTip class with the specified text
+ * and displays it at the specified location in stage coordinates.
+ *
+ * <p>ToolTips appear in their own layer, on top of everything
+ * except cursors.</p>
+ *
+ * <p>The standard way of using ToolTips is to let the ToolTipManager
+ * automatically show and hide them as the user moves the mouse over
+ * the objects that have the <code>toolTip</code> property set.
+ * You can turn off this automatic ToolTip management by setting
+ * the ToolTipManager's <code>enabled</code> property to
+ * <code>false</code>.</p>
+ *
+ * <p>By contrast, this method—along with <code>destroyToolTip()</code>—gives
+ * you programmatic control over ToolTips.
+ * You can show them when and where you choose,
+ * and you can even show more than one at once if you need to.
+ * (The ToolTipManager never does this, because it is generally
+ * confusing to the user).</p>
+ *
+ * <p>This method first creates a new instance of ToolTip and calls the
+ * <code>addChild()</code> method to put it into the SystemManager's
+ * toolTips layer.
+ * If you are showing an error tip, it sets the appropriate styles.
+ * Then it sets the text for the ToolTip, sizes the ToolTip based on
+ * its text, and positions it where you specified.</p>
+ *
+ * <p>You must save the reference to the ToolTip that this method
+ * returns so that you can pass it to the <code>destroyToolTip()</code> method.</p>
+ *
+ * @param text The text to display in the ToolTip instance.
+ *
+ * @param x The horizontal coordinate of the ToolTip in stage coordinates.
+ * In case of multiple stages, the relevant stage is determined
+ * from the <code>context</code> argument.
+ *
+ * @param y The vertical coordinate of the ToolTip in stage coordinates.
+ * In case of multiple stages, the relevant stage is determined
+ * from the <code>context</code> argument.
+ *
+ * @param errorTipBorderStyle The border style of an error tip. This method
+ * argument can be null, "errorTipRight", "errorTipAbove", or "errorTipBelow".
+ * If it is null, then the <code>createToolTip()</code> method creates a normal ToolTip. If it is
+ * "errorTipRight", "errorTipAbove", or "errorTipBelow", then the <code>createToolTip()</code>
+ * method creates an error tip, and this parameter determines where the arrow
+ * of the error tip points to (the error's target). For example, if you pass "errorTipRight", Flex
+ * positions the error tip (via the x and y arguments) to the
+ * right of the error target; the arrow is on the left edge of the error tip.
+ *
+ * @param context Determines which StyleManager is used. Typically, you pass the object on
+ * which the ToolTip appears, so that the ToolTip's StyleManager is the same one that is used by that object.
+ *
+ * @return The newly created ToolTip.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function createToolTip(text:String, x:Number, y:Number,
+ errorTipBorderStyle:String = null,
+ context:IUIComponent = null):IToolTip
+ {
+ return impl.createToolTip(text, x, y, errorTipBorderStyle, context);
+ }
+
+ /**
+ * Destroys a specified ToolTip that was created by the <code>createToolTip()</code> method.
+ *
+ * <p>This method calls the <code>removeChild()</code> method to remove the specified
+ * ToolTip from the SystemManager's ToolTips layer.
+ * It will then be garbage-collected unless you keep a
+ * reference to it.</p>
+ *
+ * <p>You should not call this method on the ToolTipManager's
+ * <code>currentToolTip</code>.</p>
+ *
+ * @param toolTip The ToolTip instance to destroy.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function destroyToolTip(toolTip:IToolTip):void
+ {
+ return impl.destroyToolTip(toolTip);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManagerImpl.as b/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManagerImpl.as
new file mode 100644
index 0000000..8a341fe
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ToolTipManagerImpl.as
@@ -0,0 +1,1717 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+ import flash.events.MouseEvent;
+ import flash.events.TimerEvent;
+ import flash.geom.Point;
+ import flash.geom.Rectangle;
+ import flash.utils.Timer;
+
+ import mx.controls.ToolTip;
+ import mx.core.FlexGlobals;
+ import mx.core.FlexVersion;
+ import mx.core.IFlexDisplayObject;
+ import mx.core.IFlexModule;
+ import mx.core.IInvalidating;
+ import mx.core.ILayoutDirectionElement;
+ import mx.core.IToolTip;
+ import mx.core.IUIComponent;
+ import mx.core.IVisualElement;
+ import mx.core.LayoutDirection;
+ import mx.core.mx_internal;
+ import mx.effects.EffectManager;
+ import mx.effects.IAbstractEffect;
+ import mx.events.DynamicEvent;
+ import mx.events.EffectEvent;
+ import mx.events.ToolTipEvent;
+ import mx.styles.IStyleClient;
+ import mx.validators.IValidatorListener;
+
+ use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * The ToolTipManager lets you set basic ToolTip and error tip functionality,
+ * such as display delay and the disabling of ToolTips.
+ *
+ * @see mx.controls.ToolTip
+ * @see mx.validators.Validator
+ */
+public class ToolTipManagerImpl extends EventDispatcher
+ implements IToolTipManager2
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static var instance:IToolTipManager2;
+
+ /**
+ * @private
+ *
+ * Place to hook in additional classes
+ */
+ public static var mixins:Array;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public static function getInstance():IToolTipManager2
+ {
+ if (!instance)
+ instance = new ToolTipManagerImpl();
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function ToolTipManagerImpl()
+ {
+ super();
+
+ if (instance)
+ throw new Error("Instance already exists.");
+
+ if (mixins)
+ {
+ var n:int = mixins.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ new mixins[i](this);
+ }
+ }
+
+ if (hasEventListener("initialize"))
+ dispatchEvent(new Event("initialize"));
+
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * A flag that keeps track of whether this class's initialize()
+ * method has been executed.
+ */
+ mx_internal var initialized:Boolean = false;
+
+ /**
+ * @private
+ * This timer is used to delay the appearance of a normal ToolTip
+ * after the mouse moves over a target; an error tip has no such delay.
+ *
+ * <p>This timer, which is lazily created, is started when the mouse
+ * moves over an object with a ToolTip, with a duration specified
+ * by showDelay.
+ * If the mouse moves out of this object before the timer fires,
+ * the ToolTip is never created.
+ * If the mouse stays over the object until the timer fires,
+ * the ToolTip is created and its showEffect is started.
+ */
+ mx_internal var showTimer:Timer;
+
+ /**
+ * @private
+ * This timer is used to make the tooltip "time out" and hide itself
+ * if the mouse stays over a target.
+ *
+ * <p>This timer, which is lazily created, is started
+ * when the showEffect ends.
+ * When it fires, the hideEffect is started.</p>
+ */
+ mx_internal var hideTimer:Timer;
+
+ /**
+ * @private
+ * This timer is used to implement mousing quickly over multiple targets
+ * with ToolTip...
+ *
+ * <p>This timer, which is lazily created, is started
+ * when ...</p>
+ */
+ mx_internal var scrubTimer:Timer;
+
+ /**
+ * @private
+ */
+ mx_internal var currentText:String;
+
+ /**
+ * @private
+ */
+ mx_internal var isError:Boolean;
+
+ /**
+ * The UIComponent with the ToolTip assigned to it
+ * that was most recently under the mouse.
+ * During much of the tool tip life cycle this property
+ * has the same value as the <code>currentTarget</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var previousTarget:DisplayObject;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentTarget
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _currentTarget:DisplayObject;
+
+ /**
+ * The UIComponent that is currently displaying a ToolTip,
+ * or <code>null</code> if none is.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentTarget():DisplayObject
+ {
+ return _currentTarget;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentTarget(value:DisplayObject):void
+ {
+ _currentTarget = value;
+ }
+
+ //----------------------------------
+ // currentToolTip
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentToolTip:DisplayObject;
+
+ /**
+ * The ToolTip object that is currently visible,
+ * or <code>null</code> if none is shown.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentToolTip():IToolTip
+ {
+ return _currentToolTip as IToolTip;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentToolTip(value:IToolTip):void
+ {
+ _currentToolTip = value as DisplayObject;
+
+ if (hasEventListener("currentToolTip"))
+ dispatchEvent(new Event("currentToolTip"));
+ }
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _enabled:Boolean = true;
+
+ /**
+ * If <code>true</code>, the ToolTipManager will automatically show
+ * ToolTips when the user moves the mouse pointer over components.
+ * If <code>false</code>, no ToolTips will be shown.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get enabled():Boolean
+ {
+ return _enabled;
+ }
+
+ /**
+ * @private
+ */
+ public function set enabled(value:Boolean):void
+ {
+ _enabled = value;
+ }
+
+ //----------------------------------
+ // hideDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _hideDelay:Number = 10000; // milliseconds
+
+ /**
+ * The amount of time, in milliseconds, that Flex waits
+ * to hide the ToolTip after it appears.
+ * Once Flex hides a ToolTip, the user must move the mouse
+ * off the component and then back onto it to see the ToolTip again.
+ * If you set <code>hideDelay</code> to <code>Infinity</code>,
+ * Flex does not hide the ToolTip until the user triggers an event,
+ * such as moving the mouse off of the component.
+ *
+ * @default 10000
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get hideDelay():Number
+ {
+ return _hideDelay;
+ }
+
+ /**
+ * @private
+ */
+ public function set hideDelay(value:Number):void
+ {
+ _hideDelay = value;
+ }
+
+ //----------------------------------
+ // hideEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _hideEffect:IAbstractEffect;
+
+ /**
+ * The effect that plays when a ToolTip is hidden,
+ * or <code>null</code> if the ToolTip should disappear with no effect.
+ *
+ * <p>Effects are not marshaled across applicationDomains in a sandbox
+ * as they may not be supportable in different versions</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get hideEffect():IAbstractEffect
+ {
+ return _hideEffect;
+ }
+
+ /**
+ * @private
+ */
+ public function set hideEffect(value:IAbstractEffect):void
+ {
+ _hideEffect = value as IAbstractEffect;
+ }
+
+ //----------------------------------
+ // scrubDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _scrubDelay:Number = 100; // milliseconds
+
+ /**
+ * The amount of time, in milliseconds, that a user can take
+ * when moving the mouse between controls before Flex again waits
+ * for the duration of <code>showDelay</code> to display a ToolTip.
+ *
+ * <p>This setting is useful if the user moves quickly from one control
+ * to another; after displaying the first ToolTip, Flex will display
+ * the others immediately rather than waiting.
+ * The shorter the setting for <code>scrubDelay</code>, the more
+ * likely that the user must wait for an amount of time specified
+ * by <code>showDelay</code> in order to see the next ToolTip.
+ * A good use of this property is if you have several buttons on a
+ * toolbar, and the user will quickly scan across them to see brief
+ * descriptions of their functionality.</p>
+ *
+ * @default 100
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get scrubDelay():Number
+ {
+ return _scrubDelay;
+ }
+
+ /**
+ * @private
+ */
+ public function set scrubDelay(value:Number):void
+ {
+ _scrubDelay = value;
+ }
+
+ //----------------------------------
+ // showDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _showDelay:Number = 500; // milliseconds
+
+ /**
+ * The amount of time, in milliseconds, that Flex waits
+ * before displaying the ToolTip box once a user
+ * moves the mouse over a component that has a ToolTip.
+ * To make the ToolTip appear instantly, set <code>showDelay</code> to 0.
+ *
+ * @default 500
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get showDelay():Number
+ {
+ return _showDelay;
+ }
+
+ /**
+ * @private
+ */
+ public function set showDelay(value:Number):void
+ {
+ _showDelay = value;
+ }
+
+ //----------------------------------
+ // showEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _showEffect:IAbstractEffect;
+
+ /**
+ * The effect that plays when a ToolTip is shown,
+ * or <code>null</code> if the ToolTip should appear with no effect.
+ *
+ * <p>Effects are not marshaled across applicationDomains in a sandbox
+ * as they may not be supportable in different versions</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get showEffect():IAbstractEffect
+ {
+ return _showEffect;
+ }
+
+ /**
+ * @private
+ */
+ public function set showEffect(value:IAbstractEffect):void
+ {
+ _showEffect = value as IAbstractEffect;
+ }
+
+ //----------------------------------
+ // toolTipClass
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _toolTipClass:Class = ToolTip;
+
+ /**
+ * The class to use for creating ToolTips.
+ *
+ * <p>The ToolTipClass is not marshaled across applicationDomains in a sandbox
+ * as they may not be supportable in different versions. Child
+ * applications should only be interested in setting the tooltip
+ * for objects within themselves</p>
+ *
+ * @default mx.controls.ToolTip
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get toolTipClass():Class
+ {
+ return _toolTipClass;
+ }
+
+ /**
+ * @private
+ */
+ public function set toolTipClass(value:Class):void
+ {
+ _toolTipClass = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Initializes the class.
+ *
+ * <p>This method sets up three Timer objects that ToolTipManager
+ * starts and stops while tracking the mouse.
+ * The repeatCount is set to 1 so that they fire only once.
+ * Their duration is set later, just before they are started.
+ * The timers are never destroyed once they are created here.</p>
+ *
+ * <p>This method is called by targetChanged(); Flex waits to initialize
+ * the class until mouse-tracking happens in order to optimize
+ * startup time.</p>
+ */
+ mx_internal function initialize():void
+ {
+ if (!showTimer)
+ {
+ showTimer = new Timer(0, 1);
+ showTimer.addEventListener(TimerEvent.TIMER,
+ showTimer_timerHandler);
+ }
+
+ if (!hideTimer)
+ {
+ hideTimer = new Timer(0, 1);
+ hideTimer.addEventListener(TimerEvent.TIMER,
+ hideTimer_timerHandler);
+ }
+
+ if (!scrubTimer)
+ scrubTimer = new Timer(0, 1);
+
+ initialized = true;
+ }
+
+ /**
+ * Registers a target UIComponent or UITextField, and the text
+ * for its ToolTip, with the ToolTipManager.
+ * This causes the ToolTipManager to display a ToolTip
+ * when the mouse hovers over the target.
+ *
+ * <p>This method is called by the setter
+ * for the toolTip property in UIComponent and UITextField.</p>
+ *
+ * @param target The UIComponent or UITextField that owns the ToolTip.
+ *
+ * @param oldToolTip The old text that was displayed
+ * in the ToolTip.
+ *
+ * @param newToolTip The new text to display in the ToolTip.
+ * If null, no ToolTip will be displayed when the mouse hovers
+ * over the target.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerToolTip(target:DisplayObject,
+ oldToolTip:String,
+ newToolTip:String):void
+ {
+ if (!oldToolTip && newToolTip)
+ {
+ target.addEventListener(MouseEvent.MOUSE_OVER,
+ toolTipMouseOverHandler);
+ target.addEventListener(MouseEvent.MOUSE_OUT,
+ toolTipMouseOutHandler);
+
+ // If the mouse is already over the object
+ // that's getting a toolTip, show the tip.
+ if (mouseIsOver(target))
+ showImmediately(target);
+ }
+ else if (oldToolTip && !newToolTip)
+ {
+ target.removeEventListener(MouseEvent.MOUSE_OVER,
+ toolTipMouseOverHandler);
+ target.removeEventListener(MouseEvent.MOUSE_OUT,
+ toolTipMouseOutHandler);
+
+ // If the mouse is over the object whose toolTip
+ // is being removed, hide the tip.
+ if (mouseIsOver(target))
+ hideImmediately();
+ }
+ }
+
+ /**
+ * Registers a target UIComponent, and the text
+ * for its error tip, with the ToolTipManager.
+ * This causes the ToolTipManager to display an error tip
+ * when the mouse hovers over the target.
+ *
+ * <p>This method is called by the setter
+ * for the errorString property in UIComponent.</p>
+ *
+ * @param target The UIComponent or UITextField that owns the ToolTip.
+ *
+ * @param oldErrorString The old text that was displayed
+ * in the error tip.
+ *
+ * @param newErrorString The new text to display in the error tip.
+ * If null, no error tip will be displayed when the mouse hovers
+ * over the target.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerErrorString(target:DisplayObject,
+ oldErrorString:String,
+ newErrorString:String):void
+ {
+ if (!oldErrorString && newErrorString)
+ {
+ target.addEventListener(MouseEvent.MOUSE_OVER,
+ errorTipMouseOverHandler);
+ target.addEventListener(MouseEvent.MOUSE_OUT,
+ errorTipMouseOutHandler);
+
+ // If the mouse is already over the object
+ // that's getting an errorTip, show the tip.
+ if (mouseIsOver(target))
+ showImmediately(target);
+ }
+ else if (oldErrorString && !newErrorString)
+ {
+ target.removeEventListener(MouseEvent.MOUSE_OVER,
+ errorTipMouseOverHandler);
+ target.removeEventListener(MouseEvent.MOUSE_OUT,
+ errorTipMouseOutHandler);
+
+ // If the mouse is over the object whose toolTip
+ // is being removed, hide the tip.
+ if (mouseIsOver(target))
+ hideImmediately();
+ }
+ }
+
+ /**
+ * @private
+ * Returns true if the mouse is over the specified target.
+ */
+ private static function mouseIsOver(target:DisplayObject):Boolean
+ {
+ if (!target || !target.stage)
+ return false;
+
+ //SDK:13465 - If we pass through the above if block, then
+ //we have a target component and its been added to the
+ //display list. If the mouse coordinates are (0,0), there
+ //is a chance the component has not been positioned yet
+ //and we'll end up mistakenly showing tooltips since the
+ //target hitTest will return true.
+ if ((target.stage.mouseX == 0) && (target.stage.mouseY == 0))
+ return false;
+
+ if (target is ILayoutManagerClient && !ILayoutManagerClient(target).initialized)
+ return false;
+
+ if (target is IVisualElement && !IVisualElement(target).visible)
+ return false;
+
+ if (target is IFlexDisplayObject && !IFlexDisplayObject(target).visible)
+ return false;
+
+ if (!isVisibleParentsIncluded(target))
+ return false;
+
+ return target.hitTestPoint(target.stage.mouseX,
+ target.stage.mouseY, true);
+ }
+
+ /**
+ * @private
+ * <p>Determines if the UIComponent and the parents in the hierarchy
+ * are visible, if yes return true, otherwise returns false.</p>
+ *
+ * @param target DisplayObject
+ * @return Boolean true is all parents are visible, false if one of them is invisible
+ */
+ private static function isVisibleParentsIncluded(target:DisplayObject):Boolean
+ {
+ if (target == null) return false;
+ return isTopLevelApplication(target) ? target.visible :
+ target.visible && isVisibleParentsIncluded(target.parent);
+ }
+
+ /**
+ * @private
+ *
+ * <p>Determines if the target is topLevelApplication and
+ * returns true if yes, otherwise false
+ *
+ * @param target UIComponent
+ * @return Boolean true is is topLevelApplication, otherwise false
+ */
+ private static function isTopLevelApplication(target:DisplayObject):Boolean
+ {
+ return target == FlexGlobals.topLevelApplication;
+ }
+
+ /**
+ * @private
+ * Shows the tip immediately when the toolTip or errorTip property
+ * becomes non-null and the mouse is over the target.
+ */
+ private function showImmediately(target:DisplayObject):void
+ {
+ var oldShowDelay:Number = ToolTipManager.showDelay;
+ ToolTipManager.showDelay = 0;
+ checkIfTargetChanged(target);
+ ToolTipManager.showDelay = oldShowDelay;
+ }
+
+ /**
+ * @private
+ * Hides the tip immediately when the toolTip or errorTip property
+ * becomes null and the mouse is over the target.
+ */
+ private function hideImmediately():void
+ {
+ checkIfTargetChanged(null);
+ }
+
+ /**
+ * Replaces the ToolTip, if necessary.
+ *
+ * <p>Determines whether the UIComponent or UITextField object
+ * with the ToolTip assigned to it that is currently under the mouse
+ * pointer is the most recent such object.
+ * If not, it removes the old ToolTip and displays the new one.</p>
+ *
+ * @param displayObject The UIComponent or UITextField that is currently under the mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function checkIfTargetChanged(displayObject:DisplayObject):void
+ {
+ if (!enabled)
+ return;
+
+ findTarget(displayObject);
+
+ if (currentTarget != previousTarget)
+ {
+ targetChanged();
+ previousTarget = currentTarget;
+ }
+ }
+
+ /**
+ * Searches from the <code>displayObject</code> object up the chain
+ * of parent objects until it finds a UIComponent or UITextField object
+ * with a <code>toolTip</code> or <code>errorString</code> property.
+ * Treats an empty string as a valid <code>toolTip</code> property.
+ * Sets the <code>currentTarget</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function findTarget(displayObject:DisplayObject):void
+ {
+ // Walk up the DisplayObject parent chain looking for a UIComponent
+ // with a toolTip or errorString property. Note that we stop
+ // even if we find a tooltip which is an empty string. Although
+ // we don't display empty tooltips, we have to track when we
+ // are over a movieclip with an empty tooltip so that we can
+ // hide any previous tooltip. This allows a child to set
+ // toolTip="" to "cancel" its parent's toolTip.
+ while (displayObject)
+ {
+ if (displayObject is IValidatorListener)
+ {
+ currentText = IValidatorListener(displayObject).errorString;
+ var showErrorTip:Boolean;
+ if (displayObject is IStyleClient)
+ showErrorTip = FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0 ||
+ IStyleClient(displayObject).getStyle("showErrorTip");
+ if (currentText != null && currentText != "" && showErrorTip)
+ {
+ currentTarget = displayObject;
+ isError = true;
+ return;
+ }
+ }
+
+ if (displayObject is IToolTipManagerClient)
+ {
+ currentText = IToolTipManagerClient(displayObject).toolTip;
+ if (currentText != null)
+ {
+ currentTarget = displayObject;
+ isError = false;
+ return;
+ }
+ }
+
+ displayObject = displayObject.parent;
+ }
+
+ currentText = null;
+ currentTarget = null;
+ }
+
+ /**
+ * Removes any ToolTip that is currently displayed and displays
+ * the ToolTip for the UIComponent that is currently under the mouse
+ * pointer, as determined by the <code>currentTarget</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function targetChanged():void
+ {
+ // Do lazy creation of the Timer objects this class uses.
+ if (!initialized)
+ initialize();
+
+ var event:ToolTipEvent;
+
+ if (previousTarget && currentToolTip)
+ {
+ if (currentToolTip is IToolTip)
+ {
+ event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
+ event.toolTip = currentToolTip;
+ previousTarget.dispatchEvent(event);
+ }
+ else
+ {
+ if (hasEventListener(ToolTipEvent.TOOL_TIP_HIDE))
+ dispatchEvent(new Event(ToolTipEvent.TOOL_TIP_HIDE));
+ }
+ }
+
+ reset();
+
+ if (currentTarget)
+ {
+ // Don't display empty tooltips.
+ if (currentText == "")
+ return;
+
+ // Dispatch a "startToolTip" event
+ // from the object displaying the tooltip.
+ event = new ToolTipEvent(ToolTipEvent.TOOL_TIP_START);
+ currentTarget.dispatchEvent(event);
+
+ if (showDelay == 0 || scrubTimer.running)
+ {
+ // Create the tooltip and start its showEffect.
+ createTip();
+ initializeTip();
+ positionTip();
+ showTip();
+ }
+ else
+ {
+ showTimer.delay = showDelay;
+ showTimer.start();
+ // After the delay, showTimer_timerHandler()
+ // will create the tooltip and start its showEffect.
+ }
+ }
+ }
+
+ /**
+ * Creates an invisible new ToolTip.
+ *
+ * <p>If the ToolTipManager's <code>enabled</code> property is
+ * <code>true</code> this method is automatically called
+ * when the user moves the mouse over an object that has
+ * the <code>toolTip</code> property set,
+ * The ToolTipManager makes subsequent calls to
+ * <code>initializeTip()</code>, <code>positionTip()</code>,
+ * and <code>showTip()</code> to complete the display
+ * of the ToolTip.</p>
+ *
+ * <p>The type of ToolTip that is created is determined by the
+ * <code>toolTipClass</code> property.
+ * By default, this is the ToolTip class.
+ * This class can be styled to appear as either a normal ToolTip
+ * (which has a yellow background by default) or as an error tip
+ * for validation errors (which is red by default).</p>
+ *
+ * <p>After creating the ToolTip with the <code>new</code>
+ * operator, this method stores a reference to it in the
+ * <code>currentToolTip</code> property.
+ * It then uses addChild() to add this ToolTip to the
+ * SystemManager's toolTips layer.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function createTip():void
+ {
+ // Dispatch a "createToolTip" event
+ // from the object displaying the tooltip.
+ var event:ToolTipEvent =
+ new ToolTipEvent(ToolTipEvent.TOOL_TIP_CREATE);
+ currentTarget.dispatchEvent(event);
+
+ if (event.toolTip)
+ currentToolTip = event.toolTip;
+ else
+ currentToolTip = new toolTipClass();
+
+ currentToolTip.visible = false;
+
+ // Set the tooltip to be in the same module factory as the target to the
+ // correct style manager is used. Don't overwrite an existing module factory.
+ if (currentToolTip is IFlexModule && IFlexModule(currentToolTip).moduleFactory == null &&
+ currentTarget is IFlexModule)
+ IFlexModule(currentToolTip).moduleFactory = IFlexModule(currentTarget).moduleFactory;
+
+ if (hasEventListener("createTip"))
+ if (!dispatchEvent(new Event("createTip", false, true)))
+ return;
+
+ var sm:ISystemManager = getSystemManager(currentTarget) as ISystemManager;
+ sm.topLevelSystemManager.toolTipChildren.addChild(currentToolTip as DisplayObject);
+ }
+
+ /**
+ * Initializes a newly created ToolTip with the appropriate text,
+ * based on the object under the mouse.
+ *
+ * <p>If the ToolTipManager's <code>enabled</code> property is
+ * <code>true</code> this method is automatically called
+ * when the user moves the mouse over an object that has
+ * the <code>toolTip</code> property set.
+ * The ToolTipManager calls <code>createTip()</code> before
+ * this method, and <code>positionTip()</code> and
+ * <code>showTip()</code> after.</p>
+ *
+ * <p>If a normal ToolTip is being displayed, this method
+ * sets its text as specified by the <code>toolTip</code>
+ * property of the object under the mouse.
+ * If an error tip is being displayed, the text is as
+ * specified by the <code>errorString</code> property
+ * of the object under the mouse.</p>
+ *
+ * <p>This method also makes the ToolTip the appropriate
+ * size for the text that it needs to display.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function initializeTip():void
+ {
+ // Set the text of the tooltip.
+ if (currentToolTip is IToolTip)
+ IToolTip(currentToolTip).text = currentText;
+
+ if (isError && currentToolTip is IStyleClient)
+ IStyleClient(currentToolTip).setStyle("styleName", "errorTip");
+
+ sizeTip(currentToolTip);
+
+ if (currentToolTip is IStyleClient)
+ {
+ // Set up its "show" and "hide" effects.
+ if (showEffect)
+ IStyleClient(currentToolTip).setStyle("showEffect", showEffect);
+ if (hideEffect)
+ IStyleClient(currentToolTip).setStyle("hideEffect", hideEffect);
+ }
+
+ if (showEffect || hideEffect)
+ {
+ currentToolTip.addEventListener(EffectEvent.EFFECT_END,
+ effectEndHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Objects added to the SystemManager's ToolTip layer don't get
+ * automatically measured or sized, so ToolTipManager has to
+ * measure it and set its size.
+ */
+ public function sizeTip(toolTip:IToolTip):void
+ {
+ // Force measure() to be called on the tooltip.
+ // Otherwise, its measured size will be 0.
+ if (toolTip is IInvalidating)
+ IInvalidating(toolTip).validateNow();
+
+ toolTip.setActualSize(
+ toolTip.getExplicitOrMeasuredWidth(),
+ toolTip.getExplicitOrMeasuredHeight());
+ }
+
+ /**
+ * Positions a newly created and initialized ToolTip on the stage.
+ *
+ * <p>If the ToolTipManager's <code>enabled</code> property is
+ * <code>true</code> this method is automatically called
+ * when the user moves the mouse over an object that has
+ * the <code>toolTip</code> property set.
+ * The ToolTipManager calls <code>createTip()</code> and
+ * <code>initializeTip()</code> before this method,
+ * and <code>showTip()</code> after.</p>
+ *
+ * <p>If a normal ToolTip is being displayed, this method positions
+ * its upper-left (upper-right) corner near the lower-right (lower-left)
+ * of the arrow cursor. This method ensures that the ToolTip is
+ * completely in view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function positionTip():void
+ {
+ // Determine layoutDirection of the target component.
+ var layoutDirection:String;
+ if (currentTarget is ILayoutDirectionElement)
+ layoutDirection = ILayoutDirectionElement(currentTarget).layoutDirection;
+ else
+ layoutDirection = LayoutDirection.LTR;
+
+ const mirror:Boolean = (layoutDirection == LayoutDirection.RTL);
+
+ var x:Number;
+ var y:Number;
+
+ var screenWidth:Number = currentToolTip.screen.width;
+ var screenHeight:Number = currentToolTip.screen.height;
+
+ if (isError)
+ {
+ // Tooltips are laid out in the same direction as the target
+ // component.
+ var tipElt:ILayoutDirectionElement =
+ currentToolTip as ILayoutDirectionElement;
+
+ if (tipElt &&
+ tipElt.layoutDirection != layoutDirection)
+ {
+ tipElt.layoutDirection = layoutDirection;
+ // sizeTip below will call validateNow()
+ tipElt.invalidateLayoutDirection();
+ }
+
+ var targetGlobalBounds:Rectangle =
+ getGlobalBounds(currentTarget, currentToolTip.root, mirror);
+
+ x = mirror ?
+ targetGlobalBounds.left - 4 :
+ targetGlobalBounds.right + 4;
+ y = targetGlobalBounds.top - 1;
+
+ // If there's no room to the right (left) of the control, put it
+ // above or below, with the left (right) edge of the error tip
+ // aligned with the left (right) edge of the target.
+ var noRoom:Boolean = mirror ?
+ x < currentToolTip.width :
+ x + currentToolTip.width > screenWidth;
+ if (noRoom)
+ {
+ var newWidth:Number = NaN;
+ var oldWidth:Number = NaN;
+
+ x = mirror ?
+ targetGlobalBounds.right + 2 - currentToolTip.width :
+ targetGlobalBounds.left - 2;
+
+ // If the error tip would be too wide for the stage,
+ // reduce the maximum width to fit onstage. Note that
+ // we have to reassign the text in order to get the tip
+ // to relayout after changing the border style and maxWidth.
+ if (mirror)
+ {
+ if (x < currentToolTip.width + 4)
+ {
+ // -4 on the left, +2 on the right = -2
+ x = 4;
+ newWidth = targetGlobalBounds.right - 2;
+ }
+ }
+ else
+ {
+ if (x + currentToolTip.width + 4 > screenWidth)
+ newWidth = screenWidth - x - 4;
+ }
+
+ if (!isNaN(newWidth))
+ {
+ oldWidth = Object(toolTipClass).maxWidth;
+ Object(toolTipClass).maxWidth = newWidth;
+ if (currentToolTip is IStyleClient)
+ IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
+ currentToolTip["text"] = currentToolTip["text"];
+ }
+
+ // Even if the error tip will fit onstage, we still need to
+ // change the border style and get the error tip to relayout.
+ else
+ {
+ if (currentToolTip is IStyleClient)
+ IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipAbove");
+ currentToolTip["text"] = currentToolTip["text"];
+ }
+
+ if (currentToolTip.height + 2 < targetGlobalBounds.top)
+ {
+ // There's room to put it above the control.
+ y = targetGlobalBounds.top - (currentToolTip.height + 2);
+ }
+ else
+ {
+ // No room above, put it below the control.
+ y = targetGlobalBounds.bottom + 2;
+
+ if (!isNaN(newWidth))
+ Object(toolTipClass).maxWidth = newWidth;
+ if (currentToolTip is IStyleClient)
+ IStyleClient(currentToolTip).setStyle("borderStyle", "errorTipBelow");
+ currentToolTip["text"] = currentToolTip["text"];
+ }
+ }
+
+ // Since the border style of the error tip may have changed,
+ // we have to force a remeasurement and change its size.
+ // This is because objects in the toolTips layer
+ // don't undergo normal measurement and layout.
+ sizeTip(currentToolTip);
+
+ // If we changed the tooltip max size, we change it back.
+ // Otherwise, if RTL, and x wasn't set for maxWidth, reposition
+ // because the width may have changed during the remeasure.
+ if (!isNaN(oldWidth))
+ Object(toolTipClass).maxWidth = oldWidth;
+ else if (mirror)
+ x = targetGlobalBounds.right + 2 - currentToolTip.width;
+ }
+ else
+ {
+ var sm:ISystemManager = getSystemManager(currentTarget);
+ // Position the upper-left (upper-right) of the tooltip
+ // at the lower-right (lower-left) of the arrow cursor.
+ x = DisplayObject(sm).mouseX + 11;
+ if (mirror)
+ x -= currentToolTip.width;
+ y = DisplayObject(sm).mouseY + 22;
+
+ // If the tooltip is too wide to fit onstage, move it left (right).
+ var toolTipWidth:Number = currentToolTip.width;
+ if (mirror)
+ {
+ if (x < 2)
+ x = 2;
+ }
+ else if (x + toolTipWidth > screenWidth)
+ {
+ x = screenWidth - toolTipWidth;
+ }
+
+ // If the tooltip is too tall to fit onstage, move it up.
+ var toolTipHeight:Number = currentToolTip.height;
+ if (y + toolTipHeight > screenHeight)
+ y = screenHeight - toolTipHeight;
+
+ var pos:Point = new Point(x, y);
+ pos = DisplayObject(sm).localToGlobal(pos);
+ pos = DisplayObject(sm.getSandboxRoot()).globalToLocal(pos);
+ x = pos.x;
+ y = pos.y;
+ }
+
+ currentToolTip.move(x, y);
+ }
+
+ /**
+ * Shows a newly created, initialized, and positioned ToolTip.
+ *
+ * <p>If the ToolTipManager's <code>enabled</code> property is
+ * <code>true</code> this method is automatically called
+ * when the user moves the mouse over an object that has
+ * the <code>toolTip</code> property set.
+ * The ToolTipManager calls <code>createTip()</code>,
+ * <code>initializeTip()</code>, and <code>positionTip()</code>
+ * before this method.</p>
+ *
+ * <p>This method first dispatches a <code>"showToolTip"</code>
+ * event from the object under the mouse.
+ * This gives you a chance to do special processing on a
+ * particular object's ToolTip just before it becomes visible.
+ * It then makes the ToolTip visible, which triggers
+ * the ToolTipManager's <code>showEffect</code> if one is specified.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function showTip():void
+ {
+ // Dispatch a "showToolTip" event
+ // from the object displaying the tooltip.
+ var event:ToolTipEvent =
+ new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOW);
+ event.toolTip = currentToolTip;
+ currentTarget.dispatchEvent(event);
+
+ if (isError)
+ {
+ // Listen for a change event so we know when to hide the tip
+ currentTarget.addEventListener(Event.CHANGE, changeHandler);
+ }
+ else
+ {
+ var sm:ISystemManager = getSystemManager(currentTarget);
+ sm.addEventListener(MouseEvent.MOUSE_DOWN,
+ systemManager_mouseDownHandler);
+ }
+
+ // Make the tooltip visible.
+ // If showEffect exists, this effect will play.
+ // When the effect ends, effectEndHandler()
+ // will start the hideTimer.
+ currentToolTip.visible = true;
+
+ if (!showEffect)
+ showEffectEnded();
+ }
+
+ /**
+ * Hides the current ToolTip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function hideTip():void
+ {
+ // Dispatch a "hideToolTip" event
+ // from the object that was displaying the tooltip.
+ if (previousTarget)
+ {
+ var event:ToolTipEvent =
+ new ToolTipEvent(ToolTipEvent.TOOL_TIP_HIDE);
+ event.toolTip = currentToolTip;
+ previousTarget.dispatchEvent(event);
+ }
+
+ // Make the tooltip invisible.
+ // If hideEffect exists, this effect will play.
+ // When the effect ends, effectEndHandler()
+ // will reset the ToolTipManager to a no-tip state.
+ if (currentToolTip)
+ currentToolTip.visible = false;
+
+ // When to do this?
+ if (isError)
+ {
+ if (currentTarget)
+ currentTarget.removeEventListener(Event.CHANGE, changeHandler);
+ }
+ else
+ {
+ if (previousTarget)
+ {
+ var sm:ISystemManager = getSystemManager(previousTarget);
+ sm.removeEventListener(MouseEvent.MOUSE_DOWN,
+ systemManager_mouseDownHandler);
+ }
+ }
+
+ if (!hideEffect)
+ hideEffectEnded();
+ }
+
+ /**
+ * Removes any currently visible ToolTip.
+ * If the ToolTip is starting to show or hide, this method
+ * removes the ToolTip immediately without completing the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal function reset():void
+ {
+ // Reset the three timers, in case any are running.
+ showTimer.reset();
+ hideTimer.reset();
+
+ // If there is a current tooltip...
+ if (currentToolTip)
+ {
+ // Remove the event handlers for the effectEnd of the showEffect
+ // and hideEffect, so that calling endEffectsForTarget() doesn't
+ // trigger effectEndHandler().
+ if (showEffect || hideEffect)
+ {
+ currentToolTip.removeEventListener(EffectEvent.EFFECT_END,
+ effectEndHandler);
+ }
+
+ // End any show or hide effects that might be playing on it.
+ EffectManager.endEffectsForTarget(currentToolTip);
+
+ var e:DynamicEvent;
+ if (hasEventListener("removeChild"))
+ {
+ e = new DynamicEvent("removeChild", false, true);
+ e.sm = currentToolTip.systemManager;
+ e.toolTip = currentToolTip;
+ }
+ if (!e || dispatchEvent(e))
+ {
+ // Remove it.
+ var sm:ISystemManager = currentToolTip.systemManager as ISystemManager;
+ sm.topLevelSystemManager.toolTipChildren.removeChild(currentToolTip as DisplayObject);
+ }
+ currentToolTip = null;
+
+ scrubTimer.delay = scrubDelay;
+ scrubTimer.reset();
+ if (scrubDelay > 0)
+ {
+ scrubTimer.delay = scrubDelay;
+ scrubTimer.start();
+ }
+ }
+ }
+
+ /**
+ * Creates an instance of the ToolTip class with the specified text
+ * and displays it at the specified location in stage coordinates.
+ *
+ * <p>ToolTips appear in their own layer, on top of everything
+ * except cursors.</p>
+ *
+ * <p>The standard way of using ToolTips is to let the ToolTipManager
+ * automatically show and hide them as the user moves the mouse over
+ * the objects that have the <code>toolTip</code> property set.
+ * You can turn off this automatic ToolTip management by setting
+ * the ToolTipManager's <code>enabled</code> property to
+ * <code>false</code>.</p>
+ *
+ * <p>By contrast, this method—along with <code>hideToolTip()</code>—gives
+ * you programmatic control over ToolTips.
+ * You can show them when and where you choose,
+ * and you can even show more than one at once if you need to.
+ * (The ToolTipManager never does this, because it is generally
+ * confusing to the user).</p>
+ *
+ * <p>This method first creates a new instance of ToolTip and calls the
+ * <code>addChild()</code> method to put it into the SystemManager's
+ * toolTips layer.
+ * If you are showing an error tip, it sets the appropriate styles.
+ * Then it sets the text for the ToolTip, sizes the ToolTip based on
+ * its text, and positions it where you specified.</p>
+ *
+ * <p>You must save the reference to the ToolTip that this method
+ * returns so that you can pass it to the <code>hideToolTip()</code> method.</p>
+ *
+ * @param text The text to display in the ToolTip instance.
+ *
+ * @param x The horizontal coordinate of the ToolTip in stage coordinates.
+ * In case of multiple stages, the relevant stage is determined
+ * from the <code>context</code> argument.
+ *
+ * @param y The vertical coordinate of the ToolTip in stage coordinates.
+ * In case of multiple stages, the relevant stage is determined
+ * from the <code>context</code> argument.
+ *
+ * @param errorTipBorderStyle The border style of an error tip. This method
+ * argument can be null, "errorTipRight", "errorTipAbove", or "errorTipBelow".
+ * If it is null, then the <code>createToolTip()</code> method creates a normal ToolTip. If it is
+ * "errorTipRight", "errorTipAbove", or "errorTipBelow", then the <code>createToolTip()</code>
+ * method creates an error tip, and this parameter determines where the arrow
+ * of the error tip points to (the error's target). For example, if you pass "errorTipRight", Flex
+ * positions the error tip (via the x and y arguments) to the
+ * right of the error target; the arrow is on the left edge of the error tip.
+ *
+ * @param context This property is not currently used.
+ *
+ * @return The newly created ToolTip.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function createToolTip(text:String, x:Number, y:Number,
+ errorTipBorderStyle:String = null,
+ context:IUIComponent = null):IToolTip
+ {
+ var toolTip:ToolTip = new ToolTip();
+
+ var sm:ISystemManager = context ?
+ context.systemManager as ISystemManager:
+ FlexGlobals.topLevelApplication.systemManager as ISystemManager;
+
+ if (context is IFlexModule)
+ toolTip.moduleFactory = IFlexModule(context).moduleFactory;
+ else
+ toolTip.moduleFactory = sm;
+
+ var e:DynamicEvent;
+ if (hasEventListener("addChild"))
+ {
+ e = new DynamicEvent("addChild", false, true);
+ e.sm = sm;
+ e.toolTip = toolTip;
+ }
+ if (!e || dispatchEvent(e))
+ {
+ sm.topLevelSystemManager.toolTipChildren.addChild(toolTip as DisplayObject);
+ }
+
+ if (errorTipBorderStyle)
+ {
+ toolTip.setStyle("styleName", "errorTip");
+ toolTip.setStyle("borderStyle", errorTipBorderStyle);
+ }
+
+ toolTip.text = text;
+
+ sizeTip(toolTip);
+
+ toolTip.move(x, y);
+ // Ensure that tip is on screen?
+ // Should x and y for error tip be tip of pointy border?
+
+ // show effect?
+
+ return toolTip as IToolTip;
+ }
+
+ /**
+ * Destroys a specified ToolTip that was created by the <code>createToolTip()</code> method.
+ *
+ * <p>This method calls the <code>removeChild()</code> method to remove the specified
+ * ToolTip from the SystemManager's ToolTips layer.
+ * It will then be garbage-collected unless you keep a
+ * reference to it.</p>
+ *
+ * <p>You should not call this method on the ToolTipManager's
+ * <code>currentToolTip</code>.</p>
+ *
+ * @param toolTip The ToolTip instance to destroy.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function destroyToolTip(toolTip:IToolTip):void
+ {
+ var e:DynamicEvent;
+ if (hasEventListener("removeChild"))
+ {
+ e = new DynamicEvent("removeChild", false, true);
+ e.sm = toolTip.systemManager;
+ e.toolTip = toolTip;
+ }
+ if (!e || dispatchEvent(e))
+ {
+ // Remove it.
+ var sm:ISystemManager = toolTip.systemManager as ISystemManager;
+ sm.topLevelSystemManager.toolTipChildren.removeChild(toolTip as DisplayObject);
+ }
+
+ // hide effect?
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function showEffectEnded():void
+ {
+ if (hideDelay == 0)
+ {
+ hideTip();
+ }
+ else if (hideDelay < Infinity)
+ {
+ hideTimer.delay = hideDelay;
+ hideTimer.start();
+ }
+ if (currentTarget)
+ {
+ // Dispatch a "toolTipShown" event
+ // from the object displaying the tooltip.
+ var event:ToolTipEvent =
+ new ToolTipEvent(ToolTipEvent.TOOL_TIP_SHOWN);
+ event.toolTip = currentToolTip;
+ currentTarget.dispatchEvent(event);
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function hideEffectEnded():void
+ {
+ reset();
+ // Dispatch a "toolTipEnd" event
+ // from the object that was displaying the tooltip.
+ if (previousTarget)
+ {
+ var event:ToolTipEvent =
+ new ToolTipEvent(ToolTipEvent.TOOL_TIP_END);
+ event.toolTip = currentToolTip;
+ previousTarget.dispatchEvent(event);
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function getSystemManager(
+ target:DisplayObject):ISystemManager
+ {
+ return target is IUIComponent ?
+ IUIComponent(target).systemManager :
+ null;
+ }
+
+ /**
+ * @private
+ */
+ private static function getGlobalBounds(obj:DisplayObject,
+ parent:DisplayObject,
+ mirror:Boolean):Rectangle
+ {
+ var upperLeft:Point = new Point(0, 0);
+
+ upperLeft = obj.localToGlobal(upperLeft);
+
+ // If the layout has been mirrored, then the 0,0 is the uppper
+ // right corner; compensate here.
+ if (mirror)
+ upperLeft.x -= obj.width;
+
+ upperLeft = parent.globalToLocal(upperLeft);
+
+ return new Rectangle(upperLeft.x, upperLeft.y, obj.width, obj.height);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This handler is called when the mouse moves over an object
+ * with a toolTip.
+ */
+ mx_internal function toolTipMouseOverHandler(event:MouseEvent):void
+ {
+ checkIfTargetChanged(DisplayObject(event.target));
+ }
+
+ /**
+ * @private
+ * This handler is called when the mouse moves out of an object
+ * with a toolTip.
+ */
+ mx_internal function toolTipMouseOutHandler(event:MouseEvent):void
+ {
+ checkIfTargetChanged(event.relatedObject);
+ }
+
+ /**
+ * @private
+ * This handler is called when the mouse moves over an object
+ * with an errorString.
+ */
+ mx_internal function errorTipMouseOverHandler(event:MouseEvent):void
+ {
+ checkIfTargetChanged(DisplayObject(event.target));
+ }
+
+ /**
+ * @private
+ * This handler is called when the mouse moves out of an object
+ * with an errorString.
+ */
+ mx_internal function errorTipMouseOutHandler(event:MouseEvent):void
+ {
+ checkIfTargetChanged(event.relatedObject);
+ }
+
+ /**
+ * @private
+ * This handler is called when the showTimer fires.
+ * It creates the tooltip and starts its showEffect.
+ */
+ mx_internal function showTimer_timerHandler(event:TimerEvent):void
+ {
+ // Make sure we still have a currentTarget when the timer fires.
+ if (currentTarget)
+ {
+ createTip();
+ initializeTip();
+ positionTip();
+ showTip();
+ }
+ }
+
+ /**
+ * @private
+ * This handler is called when the hideTimer fires.
+ * It starts the hideEffect.
+ */
+ mx_internal function hideTimer_timerHandler(event:TimerEvent):void
+ {
+ hideTip();
+ }
+
+ /**
+ * @private
+ * This handler is called when the showEffect or hideEffect ends.
+ * When the showEffect ends, it starts the hideTimer,
+ * which will automatically start hiding the tooltip when it fires,
+ * even if the mouse is still over the target.
+ * When the hideEffect ends, the tooltip is removed.
+ */
+ mx_internal function effectEndHandler(event:EffectEvent):void
+ {
+ if (event.effectInstance.effect == showEffect)
+ showEffectEnded();
+ else if (event.effectInstance.effect == hideEffect)
+ hideEffectEnded();
+ }
+
+ /**
+ * @private
+ * This handler is called when the user clicks the mouse
+ * while a normal tooltip is displayed.
+ * It immediately hides the tooltip.
+ */
+ mx_internal function systemManager_mouseDownHandler(event:MouseEvent):void
+ {
+ reset();
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function changeHandler(event:Event):void
+ {
+ reset();
+ }
+
+}
+
+}
[27/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/FlexEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/FlexEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/FlexEvent.as
new file mode 100644
index 0000000..5b282f4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/FlexEvent.as
@@ -0,0 +1,1474 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+import org.apache.flex.events.Event;
+
+/**
+ * The FlexEvent class represents the event object passed to
+ * the event listener for many Flex events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class FlexEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>FlexEvent.ADD</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>add</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType add
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ADD:String = "add";
+
+ /**
+ * The <code>FlexEvent.ADD_FOCUS_MANAGER</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>addFocusManager</code> event.
+ * This event is dispatched from an IFocusManagerContainer when its focusManager
+ * is assigned.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType addFocusManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const ADD_FOCUS_MANAGER:String = "addFocusManager";
+
+ /**
+ * The <code>FlexEvent.APPLICATION_COMPLETE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>applicationComplete</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType applicationComplete
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const APPLICATION_COMPLETE:String = "applicationComplete";
+
+ /**
+ * The <code>FlexEvent.BUTTON_DOWN</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>buttonDown</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType buttonDown
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const BUTTON_DOWN:String = "buttonDown";
+
+ /**
+ * The <code>FlexEvent.BACK_KEY_PRESSED</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>backKeyPressed</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>true</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType backKeyPressed
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const BACK_KEY_PRESSED:String = "backKeyPressed";
+
+ /**
+ * The <code>FlexEvent.CHANGE_END</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>changeEnd</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType changeEnd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const CHANGE_END:String = "changeEnd";
+
+ /**
+ * The <code>FlexEvent.CHANGE_START</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>changeStart</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType changeStart
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const CHANGE_START:String = "changeStart";
+
+ /**
+ * The <code>FlexEvent.CHANGING</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>changing</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType changing
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const CHANGING:String = "changing";
+
+ /**
+ * The <code>FlexEvent.CREATION_COMPLETE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>creationComplete</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType creationComplete
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CREATION_COMPLETE:String = "creationComplete";
+
+ /**
+ * The <code>FlexEvent.CONTENT_CREATION_COMPLETE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>contentCreationComplete</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType contentCreationComplete
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ public static const CONTENT_CREATION_COMPLETE:String = "contentCreationComplete";
+
+
+ /**
+ * The <code>FlexEvent.CURSOR_UPDATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>cursorUpdate</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType cursorUpdate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CURSOR_UPDATE:String = "cursorUpdate";
+
+ /**
+ * The <code>FlexEvent.DATA_CHANGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>dataChange</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType dataChange
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DATA_CHANGE:String = "dataChange";
+
+ /**
+ * The <code>FlexEvent.ENTER</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>enter</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType enter
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ENTER:String = "enter";
+
+ /**
+ * The <code>FlexEvent.ENTER_FRAME</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>Event.ENTER_FRAMER</code> event.
+ *
+ * Adding a listener to ENTER_FRAME on the <code>SystemManager</code> will add a listener for
+ * the Event.ENTER_FRAME event on the <code>stage</code>, if access if allowed,
+ * or the <code>SystemManager</code> if access the the <code>stage</code> is not allowed.
+ * The listener should expect to receive Event.ENTER_FRAME events.
+ *
+ * @eventType flexEventEnterFrame
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ENTER_FRAME:String = "flexEventEnterFrame";
+
+ /**
+ * The <code>FlexEvent.ENTER_STATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>enterState</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType enterState
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ENTER_STATE:String = "enterState";
+
+ /**
+ * The <code>FlexEvent.EXIT_STATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>exitState</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType exitState
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EXIT_STATE:String = "exitState";
+
+ /**
+ * The <code>FlexEvent.FLEX_WINDOW_ACTIVATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>flexWindowActivate</code>
+ * event.
+ *
+ * Similar to the flash.events.AIREvent.WINDOW_ACTIVATE except it is dispatched
+ * in both Flash and AIR when a Flex window or popup is activated. This event is
+ * dispatched from the focusManager managing
+ * focus in that container.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType flexWindowActivate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const FLEX_WINDOW_ACTIVATE:String = "flexWindowActivate";
+
+ /**
+ * The <code>FlexEvent.FLEX_WINDOW_DEACTIVATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>flexWindowDeactivate</code>
+ * event.
+ *
+ * Similar to the flash.events.AIREvent.FLEX_WINDOW_DEACTIVATE except it is dispatched
+ * in both Flash and AIR when a Flex Window or popup is deactivated. This event is
+ * dispatched from the focusManager managing
+ * focus in that container.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType flexWindowDeactivate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const FLEX_WINDOW_DEACTIVATE:String = "flexWindowDeactivate";
+
+ /**
+ * The <code>FlexEvent.HIDE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>hide</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType hide
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const HIDE:String = "hide";
+
+ /**
+ * The <code>FlexEvent.IDLE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>idle</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType idle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const IDLE:String = "idle";
+
+ /**
+ * Dispatched when a Flex application finishes initialization.
+ * You use this event when creating a custom download progress bar.
+ *
+ * <p>This event is always dispatched once by the Preloader class,
+ * and is the last event that the Preloader dispatches.
+ * When this event is dispatched, the event listener should
+ * dispatch an Event.COMPLETE event.</p>
+ *
+ * <p>A download progress bar must dispatch a <code>complete</code>
+ * event after it has received an <code>init_complete</code> event.
+ * The <code>complete</code> event informs the Preloader that the
+ * download progress bar has completed all operations and can be dismissed.</p>
+ *
+ * <p>A download progress bar can perform additional tasks,
+ * such as playing an animation, after receiving
+ * an <code>init_complete</code> event, and before dispatching
+ * the <code>complete</code> event. Dispatching the <code>complete</code>
+ * event should be the last action of the download progress bar.</p>
+ *
+ * <p>The FlexEvent.INIT_COMPLETE constant defines the value of the
+ * <code>type</code> property of the event object for a <code>initComplete</code> event.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.preloaders.DownloadProgressBar
+ * @eventType initComplete
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const INIT_COMPLETE:String = "initComplete";
+
+ /**
+ * Dispatched when the Flex application completes an initialization phase,
+ * as defined by calls to the <code>measure()</code>, <code>commitProperties()</code>,
+ * or <code>updateDisplayList()</code> methods.
+ * This event describes the progress of the application in the initialization phase.
+ * You use this event when creating a custom download progress bar.
+ *
+ * <p>The FlexEvent.INIT_PROGRESS constant defines the value of the
+ * <code>type</code> property of the event object for a <code>initProgress</code> event.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.preloaders.DownloadProgressBar
+ * @eventType initProgress
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const INIT_PROGRESS:String = "initProgress";
+
+ /**
+ * The <code>FlexEvent.INITIALIZE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>initialize</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType initialize
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const INITIALIZE:String = "initialize";
+
+ /**
+ * The <code>FlexEvent.INVALID</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>invalid</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType invalid
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const INVALID:String = "invalid";
+
+ /**
+ * The <code>FlexEvent.LOADING</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>loading</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType loading
+ * @see mx.modules.ModuleLoader
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const LOADING:String = "loading";
+
+ /**
+ * The <code>FlexEvent.MENU_KEY_PRESSED</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>menuKeyPressed</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>true</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType menuKeyPressed
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.1
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const MENU_KEY_PRESSED:String = "menuKeyPressed";
+
+ /**
+ * The <code>FlexEvent.MUTED_CHANGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>mutedChange</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType mutedChange
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const MUTED_CHANGE:String = "mutedChange";
+
+ /**
+ * The <code>FlexEvent.NAVIGATOR_STATE_LOADING</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>navigatorStateLoading</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>true</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType applicationRestoring
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.1
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const NAVIGATOR_STATE_LOADING:String = "navigatorStateLoading";
+
+ /**
+ * The <code>FlexEvent.NAVIGATOR_STATE_SAVING</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>navigatorStateSaving</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>true</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType navigatorStateSaving
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.1
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const NAVIGATOR_STATE_SAVING:String = "navigatorStateSaving";
+
+ /**
+ * @private
+ */
+ public static const NEW_CHILD_APPLICATION:String = "newChildApplication";
+
+ /**
+ * The <code>FlexEvent.PREINITIALIZE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>preinitialize</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType preinitialize
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const PREINITIALIZE:String = "preinitialize";
+
+ /**
+ * @private
+ */
+ public static const PRELOADER_DONE:String = "preloaderDone";
+
+ /**
+ * @private
+ */
+ public static const PRELOADER_DOC_FRAME_READY:String = "preloaderDocFrameReady";
+
+ /**
+ * The <code>FlexEvent.READY</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>ready</code>
+ * event. This event is dispatched by the BitmapImage and spark Image
+ * classes to denote that the assigned image source has fully loaded.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ *
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>returnValue</code></td><td>null</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myImage.addEventListener()</code> to register an event listener,
+ * myImage is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>Type</code></td><td>FlexEvent.READY</td></tr>
+ * </table>
+ *
+ * @eventType ready
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.1
+ * @productversion Flex 4.5
+ */
+ public static const READY:String = "ready";
+
+ /**
+ * The <code>FlexEvent.RENDER</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>Event.RENDER</code> event.
+ *
+ * Adding a listener on the <code>SystemManager</code> will add a listener for FlexEvent.RENDER
+ * events on the <code>stage</code> or the <code>SystemManager</code> if the application does not have
+ * access to the <code>stage</code>. The listener will also generate an Event.RENDER event. The
+ * listener function should expect to receive Event.RENDER events.
+ *
+ * @eventType flexEventRender
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const RENDER:String = "flexEventRender";
+
+ /**
+ * The <code>FlexEvent.REMOVE</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>remove</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType remove
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const REMOVE:String = "remove";
+
+ /**
+ * The <code>FlexEvent.REPEAT</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>repeat</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType repeat
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const REPEAT:String = "repeat";
+
+ /**
+ * The <code>FlexEvent.REPEAT_END</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>repeatEnd</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType repeatEnd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const REPEAT_END:String = "repeatEnd";
+
+ /**
+ * The <code>FlexEvent.REPEAT_START</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>repeatStart</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType repeatStart
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const REPEAT_START:String = "repeatStart";
+
+ /**
+ * The <code>FlexEvent.SELECTION_CHANGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>selectionChange</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType deferredContentCreate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const SELECTION_CHANGE:String = "selectionChange";
+
+ /**
+ * The <code>FlexEvent.SHOW</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>show</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType show
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const SHOW:String = "show";
+
+ /**
+ * The <code>FlexEvent.STATE_CHANGE_COMPLETE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>stateChangeComplete</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType stateChangeComplete
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const STATE_CHANGE_COMPLETE:String = "stateChangeComplete";
+
+ /**
+ * The <code>FlexEvent.STATE_CHANGE_INTERRUPTED</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>stateChangeInterrupted</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType stateChangeInterrupted
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const STATE_CHANGE_INTERRUPTED:String = "stateChangeInterrupted";
+
+ /**
+ * The <code>FlexEvent.TRANSFORM_CHANGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>transformChange</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType transformChange
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TRANSFORM_CHANGE:String = "transformChange";
+
+ /**
+ * The <code>FlexEvent.TRANSITION_START</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>transitionStart</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType transitionStart
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const TRANSITION_START:String = "transitionStart";
+
+ /**
+ * The <code>FlexEvent.TRANSITION_END</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>transitionEnd</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType transitionEnd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const TRANSITION_END:String = "transitionEnd";
+
+ /**
+ * The <code>FlexEvent.UPDATE_COMPLETE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>updateComplete</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType updateComplete
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const UPDATE_COMPLETE:String = "updateComplete";
+
+ /**
+ * The <code>FlexEvent.URL_CHANGED</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>urlChanged</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType urlChanged
+ * @see mx.modules.ModuleLoader
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const URL_CHANGED:String = "urlChanged";
+
+ /**
+ * The <code>FlexEvent.VALID</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>valid</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType valid
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VALID:String = "valid";
+
+ /**
+ * The <code>FlexEvent.VALUE_COMMIT</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>valueCommit</code>
+ * event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType valueCommit
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VALUE_COMMIT:String = "valueCommit";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up
+ * the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function FlexEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new FlexEvent(type, bubbles, cancelable);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/FocusEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/FocusEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/FocusEvent.as
new file mode 100644
index 0000000..11aaa61
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/FocusEvent.as
@@ -0,0 +1,159 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+COMPILE::AS3
+{
+ import flash.display.InteractiveObject;
+}
+COMPILE::JS
+{
+ import flex.display.InteractiveObject;
+}
+import org.apache.flex.events.Event;
+
+/**
+ * The FlexEvent class represents the event object passed to
+ * the event listener for many Flex events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class FocusEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>FocusEvent.FOCUS_IN</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>focusIn</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType focusIn
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const FOCUS_IN:String = "focusIn";
+
+ /**
+ * The <code>FlexEvent.FOCUS_OUT</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>focusOut</code> event.
+ * This event is dispatched from an IFocusManagerContainer when its focusManager
+ * is assigned.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType focusOut
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const FOCUS_OUT:String = "focusOut";
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up
+ * the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function FocusEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ public var relatedObject:InteractiveObject;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new FocusEvent(type, bubbles, cancelable);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/KeyboardEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/KeyboardEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/KeyboardEvent.as
new file mode 100644
index 0000000..5f3d915
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/KeyboardEvent.as
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+import org.apache.flex.events.Event;
+
+/**
+ * The FlexEvent class represents the event object passed to
+ * the event listener for many Flex events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class KeyboardEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>KeyboardEvent.KEY_UP</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>keyUp</code> event.
+ *
+ * <p>This event will only be dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType keyUp
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const KEY_UP:String = "keyUp";
+
+ /**
+ * The <code>KeyboardEvent.KEY_DOWN</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>keyDown</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType keyDown
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const KEY_DOWN:String = "keyDown";
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up
+ * the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function KeyboardEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ public var keyCode:int;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new KeyboardEvent(type, bubbles, cancelable);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/MoveEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/MoveEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/MoveEvent.as
new file mode 100644
index 0000000..fdabeae
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/MoveEvent.as
@@ -0,0 +1,160 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * Represents event objects that are dispatched when a Flex component moves.
+ *
+ * @see mx.core.UIComponent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class MoveEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>MoveEvent.MOVE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>move</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>oldX</code></td><td>The previous x coordinate of the object, in pixels.</td></tr>
+ * <tr><td><code>oldY</code></td><td>The previous y coordinate of the object, in pixels.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType move
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const MOVE:String = "move";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble
+ * up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @param oldX The previous x coordinate of the object, in pixels.
+ *
+ * @param oldY The previous y coordinate of the object, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function MoveEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ oldX:Number = NaN, oldY:Number = NaN)
+ {
+ super(type, bubbles, cancelable);
+
+ this.oldX = oldX;
+ this.oldY = oldY;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // oldX
+ //----------------------------------
+
+ /**
+ * The previous <code>x</code> coordinate of the object, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var oldX:Number;
+
+ //----------------------------------
+ // oldY
+ //----------------------------------
+
+ /**
+ * The previous <code>y</code> coordinate of the object, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var oldY:Number;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new MoveEvent(type, bubbles, cancelable, oldX, oldY);
+ }
+}
+
+}
[16/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
new file mode 100644
index 0000000..9095628
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
@@ -0,0 +1,1173 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+}
+import org.apache.flex.events.EventDispatcher;
+
+import mx.core.Singleton;
+import mx.core.mx_internal;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManagerGlobals;
+import mx.utils.ObjectUtil;
+
+use namespace mx_internal;
+
+/**
+ * The CSSStyleDeclaration class represents a set of CSS style rules.
+ * The MXML compiler automatically generates one CSSStyleDeclaration object
+ * for each selector in the CSS files associated with a Flex application.
+ *
+ * <p>A CSS rule such as
+ * <pre>
+ * Button { color: #FF0000 }
+ * </pre>
+ * affects every instance of the Button class;
+ * a selector like <code>Button</code> is called a type selector
+ * and must not start with a dot.</p>
+ *
+ * <p>A CSS rule such as
+ * <pre>
+ * .redButton { color: #FF0000 }
+ * </pre>
+ * affects only components whose <code>styleName</code> property
+ * is set to <code>"redButton"</code>;
+ * a selector like <code>.redButton</code> is called a class selector
+ * and must start with a dot.</p>
+ *
+ * <p>You can access the autogenerated CSSStyleDeclaration objects
+ * using the <code>StyleManager.getStyleDeclaration()</code> method,
+ * passing it either a type selector
+ * <pre>
+ * var buttonDeclaration:CSSStyleDeclaration =
+ * StyleManager.getStyleDeclaration("Button");
+ * </pre>
+ * or a class selector
+ * <pre>
+ * var redButtonStyleDeclaration:CSSStyleDeclaration =
+ * StyleManager.getStyleDeclaration(".redButton");
+ * </pre>
+ * </p>
+ *
+ * <p>You can use the <code>getStyle()</code>, <code>setStyle()</code>,
+ * and <code>clearStyle()</code> methods to get, set, and clear
+ * style properties on a CSSStyleDeclaration.</p>
+ *
+ * <p>You can also create and install a CSSStyleDeclaration at run time
+ * using the <code>StyleManager.setStyleDeclaration()</code> method:
+ * <pre>
+ * var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration(".bigMargins");
+ * newStyleDeclaration.defaultFactory = function():void
+ * {
+ * leftMargin = 50;
+ * rightMargin = 50;
+ * }
+ * StyleManager.setStyleDeclaration(".bigMargins", newStyleDeclaration, true);
+ * </pre>
+ * </p>
+ *
+ * @see mx.core.UIComponent
+ * @see mx.styles.StyleManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class CSSStyleDeclaration extends EventDispatcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static const NOT_A_COLOR:uint = 0xFFFFFFFF;
+
+ /**
+ * @private
+ */
+ private static const FILTERMAP_PROP:String = "__reserved__filterMap";
+
+ /**
+ * @private
+ */
+ private static var emptyObjectFactory:Function = function():void {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param selector - If the selector is a CSSSelector then advanced
+ * CSS selectors are supported. If a String is used for the selector then
+ * only simple CSS selectors are supported. If the String starts with a
+ * dot it is interpreted as a universal class selector, otherwise it must
+ * represent a simple type selector. If not null, this CSSStyleDeclaration
+ * will be registered with StyleManager.
+ *
+ * @param styleManager - The style manager to set this declaration into. If the
+ * styleManager is null the top-level style manager will be used.
+ *
+ * @param autoRegisterWithStyleManager - If true set the selector in the styleManager. The selector
+ * will only be set if both <code>selector</code> and <code>styleManager</code> are
+ * both non-null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function CSSStyleDeclaration(selector:Object=null, styleManager:IStyleManager2=null, autoRegisterWithStyleManager:Boolean = true)
+ {
+ super();
+
+ // Do not reference StyleManager directly because this is a bootstrap class
+ if (!styleManager)
+ styleManager = Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2;
+
+ this.styleManager = styleManager;
+
+ if (selector)
+ {
+ if (selector is CSSSelector)
+ {
+ this.selector = selector as CSSSelector;
+ }
+ else
+ {
+ // Otherwise, a legacy Flex 3 String selector was provided
+ selectorString = selector.toString();
+ }
+
+ if (autoRegisterWithStyleManager)
+ styleManager.setStyleDeclaration(selectorString, this, false);
+ }
+
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This Dictionary keeps track of all the style name/value objects
+ * produced from this CSSStyleDeclaration and already inserted into
+ * prototype chains. Whenever this CSSStyleDeclaration's overrides object
+ * is updated by setStyle(), these clone objects must also be updated.
+ */
+ private var clones:CloneManager = new CloneManager();
+
+ /**
+ * @private
+ * The number of CSS selectors pointing to this CSSStyleDeclaration.
+ * It will be greater than 0 if this CSSStyleDeclaration has been
+ * installed in the StyleManager.styles table by
+ * StyleManager.setStyleDeclaration().
+ */
+ mx_internal var selectorRefCount:int = 0;
+
+ /**
+ * The order this CSSStyleDeclaration was added to its StyleManager.
+ * MatchStyleDeclarations has to return the declarations in the order
+ * they were declared
+ */
+ public var selectorIndex:int = 0;
+
+ /**
+ * @private
+ * Array that specifies the names of the events declared
+ * by this CSS style declaration.
+ * This Array is used by the <code>StyleProtoChain.initObject()</code>
+ * method to register the effect events with the Effect manager.
+ */
+ mx_internal var effects:Array;
+
+ /**
+ * @private
+ * reference to StyleManager
+ */
+ private var styleManager:IStyleManager2;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // defaultFactory
+ //----------------------------------
+
+ private var _defaultFactory:Function;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * This function, if it isn't <code>null</code>,
+ * is usually autogenerated by the MXML compiler.
+ * It produce copies of a plain Object, such as
+ * <code>{ leftMargin: 10, rightMargin: 10 }</code>,
+ * containing name/value pairs for style properties; the object is used
+ * to build a node of the prototype chain for looking up style properties.
+ *
+ * <p>If this CSSStyleDeclaration is owned by a UIComponent
+ * written in MXML, this function encodes the style attributes
+ * that were specified on the root tag of the component definition.</p>
+ *
+ * <p>If the UIComponent was written in ActionScript,
+ * this property is <code>null</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get defaultFactory():Function
+ {
+ return _defaultFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set defaultFactory(f:Function):void
+ {
+ _defaultFactory = f;
+ }
+
+ //----------------------------------
+ // factory
+ //----------------------------------
+
+ private var _factory:Function;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * This function, if it isn't <code>null</code>,
+ * is usually autogenerated by the MXML compiler.
+ * It produce copies of a plain Object, such as
+ * <code>{ leftMargin: 10, rightMargin: 10 }</code>,
+ * containing name/value pairs for style properties; the object is used
+ * to build a node of the prototype chain for looking up style properties.
+ *
+ * <p>If this CSSStyleDeclaration is owned by a UIComponent,
+ * this function encodes the style attributes that were specified in MXML
+ * for an instance of that component.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get factory():Function
+ {
+ return _factory;
+ }
+
+ /**
+ * @private
+ */
+ public function set factory(f:Function):void
+ {
+ _factory = f;
+ }
+
+ //----------------------------------
+ // overrides
+ //----------------------------------
+
+ private var _overrides:Object;
+
+ /**
+ * If the <code>setStyle()</code> method is called on a UIComponent or CSSStyleDeclaration
+ * at run time, this object stores the name/value pairs that were set;
+ * they override the name/value pairs in the objects produced by
+ * the methods specified by the <code>defaultFactory</code> and
+ * <code>factory</code> properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get overrides():Object
+ {
+ return _overrides;
+ }
+
+ /**
+ * @private
+ */
+ public function set overrides(o:Object):void
+ {
+ _overrides = o;
+ }
+
+ //----------------------------------
+ // selector
+ //----------------------------------
+
+ private var _selector:CSSSelector;
+
+ /**
+ * This property is the base selector of a potential chain of selectors
+ * and conditions that are used to match CSS style declarations to
+ * components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get selector():CSSSelector
+ {
+ return _selector;
+ }
+
+ public function set selector(value:CSSSelector):void
+ {
+ _selector = value;
+ _selectorString = null;
+ }
+
+ //----------------------------------
+ // selectorString
+ //----------------------------------
+
+ private var _selectorString:String;
+
+ /**
+ * Legacy support for setting a Flex 3 styled selector string after
+ * the construction of a style declaration. Only universal class selectors
+ * or simple type selectors are supported. Note that this style declaration
+ * is not automatically registered with the StyleManager when using this
+ * API.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ mx_internal function get selectorString():String
+ {
+ if (_selectorString == null && _selector != null)
+ _selectorString = _selector.toString();
+
+ return _selectorString;
+ }
+
+ mx_internal function set selectorString(value:String):void
+ {
+ // For the legacy API, the first argument is either a simple
+ // type selector or a universal class selector
+ if (value.charAt(0) == ".")
+ {
+ var condition:CSSCondition = new CSSCondition(CSSConditionKind.CLASS, value.substr(1));
+ _selector = new CSSSelector("", [condition]);
+ }
+ else
+ {
+ _selector = new CSSSelector(value);
+ }
+
+ _selectorString = value;
+ }
+
+ //----------------------------------
+ // specificity
+ //----------------------------------
+
+ /**
+ * Determines the order of precedence when applying multiple style
+ * declarations to a component. If style declarations are of equal
+ * precedence, the last one wins.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get specificity():int
+ {
+ return _selector ? _selector.specificity : 0;
+ }
+
+ //----------------------------------
+ // subject
+ //----------------------------------
+
+ /**
+ * The subject describes the name of a component that may be a potential
+ * match for this style declaration. The subject is determined as right
+ * most simple type selector in a potential chain of selectors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get subject():String
+ {
+ if (_selector != null)
+ {
+ // Check for an implicit universal selector which omits *
+ // for the subject but includes conditions.
+ if (_selector.subject == "" && _selector.conditions)
+ return "*";
+ else
+ return _selector.subject;
+ }
+
+ return null;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Determines whether the selector chain for this style declaration makes
+ * use of a pseudo condition.
+ */
+ mx_internal function getPseudoCondition():String
+ {
+ return (selector != null) ? selector.getPseudoCondition() : null;
+ }
+
+ /**
+ * @private
+ * Determines whether this style declaration has an advanced selector.
+ */
+ mx_internal function isAdvanced():Boolean
+ {
+ if (selector != null)
+ {
+ if (selector.ancestor)
+ {
+ return true;
+ }
+ else if (selector.conditions)
+ {
+ if (subject != "*" && subject != "global")
+ {
+ return true;
+ }
+
+ for each (var condition:CSSCondition in selector.conditions)
+ {
+ if (condition.kind != CSSConditionKind.CLASS)
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determines whether this style declaration applies to the given component
+ * based on a match of the selector chain.
+ *
+ * @param object The component to match the style declaration against.
+ *
+ * @return true if this style declaration applies to the component,
+ * otherwise false.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function matchesStyleClient(object:IAdvancedStyleClient):Boolean
+ {
+ return (selector != null) ? selector.matchesStyleClient(object) : false;
+ }
+
+ /**
+ * Determine if the properties of this style declaration are the same as the the properties of a specified
+ * style declaration.
+ *
+ * @param styleDeclaration the style declaration to compare.
+ *
+ * @return true if the styleDeclaration is considered equal to this declaration.
+ */
+ mx_internal function equals(styleDeclaration:CSSStyleDeclaration):Boolean
+ {
+ if (styleDeclaration == null)
+ return false;
+
+ // test in order of most likey to be different.
+
+ var obj:Object; // loop variable
+
+ // overrides
+ if (ObjectUtil.compare(overrides, styleDeclaration.overrides) != 0)
+ return false;
+
+ // factory
+ if ((factory == null && styleDeclaration.factory != null) ||
+ (factory != null && styleDeclaration.factory == null))
+ return false;
+
+ if (factory != null)
+ {
+ if (ObjectUtil.compare(new factory(), new styleDeclaration.factory()) != 0)
+ return false;
+ }
+
+ // defaultFactory
+ if ((defaultFactory == null && styleDeclaration.defaultFactory != null) ||
+ (defaultFactory != null && styleDeclaration.defaultFactory == null))
+ return false;
+
+ if (defaultFactory != null)
+ {
+ if (ObjectUtil.compare(new defaultFactory(),
+ new styleDeclaration.defaultFactory()) != 0)
+ return false;
+ }
+
+ // effects
+ if (ObjectUtil.compare(effects, styleDeclaration.mx_internal::effects))
+ return false;
+
+ return true;
+ }
+
+
+ /**
+ * Gets the value for a specified style property,
+ * as determined solely by this CSSStyleDeclaration.
+ *
+ * <p>The returned value may be of any type.</p>
+ *
+ * <p>The values <code>null</code>, <code>""</code>, <code>false</code>,
+ * <code>NaN</code>, and <code>0</code> are all valid style values,
+ * but the value <code>undefined</code> is not; it indicates that
+ * the specified style is not set on this CSSStyleDeclaration.
+ * You can use the method <code>StyleManager.isValidStyleValue()</code>
+ * to test the value that is returned.</p>
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @return The value of the specified style property if set,
+ * or <code>undefined</code> if not.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getStyle(styleProp:String):*
+ {
+ var o:*;
+ var v:*;
+
+ // First look in the overrides, in case setStyle()
+ // has been called on this CSSStyleDeclaration.
+ if (overrides)
+ {
+ // If the property exists in our overrides, but
+ // has 'undefined' as its value, it has been
+ // cleared from this stylesheet so return
+ // undefined.
+ if (styleProp in overrides &&
+ overrides[styleProp] === undefined)
+ return undefined;
+
+ v = overrides[styleProp];
+ if (v !== undefined) // must use !==
+ return v;
+ }
+
+ // Next look in the style object that this CSSStyleDeclaration's
+ // factory function produces; it contains styles that
+ // were specified in an instance tag of an MXML component
+ // (if this CSSStyleDeclaration is attached to a UIComponent).
+ if (factory != null)
+ {
+ factory.prototype = {};
+ o = new factory();
+ v = o[styleProp];
+ if (v !== undefined) // must use !==
+ return v;
+ }
+
+ // Next look in the style object that this CSSStyleDeclaration's
+ // defaultFactory function produces; it contains styles that
+ // were specified on the root tag of an MXML component.
+ if (defaultFactory != null)
+ {
+ defaultFactory.prototype = {};
+ o = new defaultFactory();
+ v = o[styleProp];
+ if (v !== undefined) // must use !==
+ return v;
+ }
+
+ // Return undefined if the style isn't specified
+ // in any of these three places.
+ return undefined;
+ }
+
+ /**
+ * Sets a style property on this CSSStyleDeclaration.
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @param newValue The value of the style property.
+ * The value may be of any type.
+ * The values <code>null</code>, <code>""</code>, <code>false</code>,
+ * <code>NaN</code>, and <code>0</code> are all valid style values,
+ * but the value <code>undefined</code> is not.
+ * Setting a style property to the value <code>undefined</code>
+ * is the same as calling the <code>clearStyle()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setStyle(styleProp:String, newValue:*):void
+ {
+ var oldValue:Object = getStyle(styleProp);
+ var regenerate:Boolean = false;
+
+ // If this CSSStyleDeclaration didn't previously have a factory,
+ // defaultFactory, or overrides object, then this CSSStyleDeclaration
+ // hasn't been added to anyone's proto chain. In that case, we
+ // need to regenerate everyone's proto chain.
+ if (selectorRefCount > 0 &&
+ factory == null &&
+ defaultFactory == null &&
+ !overrides &&
+ (oldValue !== newValue)) // must be !==
+ {
+ regenerate = true;
+ }
+
+ if (newValue !== undefined) // must be !==
+ {
+ setLocalStyle(styleProp, newValue);
+ }
+ else
+ {
+ if (newValue == oldValue)
+ return;
+ setLocalStyle(styleProp, newValue);
+ }
+
+ var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
+ var n:int = sms.length;
+ var i:int;
+
+ // Type as Object to avoid dependency on SystemManager.
+ var sm:ISystemManager;
+ var cm:Object;
+
+ if (regenerate)
+ {
+ // Regenerate all the proto chains
+ // for all objects in the application.
+ for (i = 0; i < n; i++)
+ {
+ sm = sms[i];
+ cm = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ cm.regenerateStyleCache(true);
+ }
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ sm = sms[i];
+ cm = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ cm.notifyStyleChangeInChildren(styleProp, true);
+ }
+ }
+
+ /**
+ * @private
+ * Sets a style property on this CSSStyleDeclaration.
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @param newValue The value of the style property.
+ * The value may be of any type.
+ * The values <code>null</code>, <code>""</code>, <code>false</code>,
+ * <code>NaN</code>, and <code>0</code> are all valid style values,
+ * but the value <code>undefined</code> is not.
+ * Setting a style property to the value <code>undefined</code>
+ * is the same as calling <code>clearStyle()</code>.
+ */
+ mx_internal function setLocalStyle(styleProp:String, value:*):void
+ {
+ var oldValue:Object = getStyle(styleProp);
+
+ // If setting to undefined, clear the style attribute.
+ if (value === undefined) // must use ===
+ {
+ clearStyleAttr(styleProp);
+ return;
+ }
+
+ var o:Object;
+
+ // If the value is a String of the form "#FFFFFF" or "red",
+ // then convert it to a RGB color uint (e.g.: 0xFFFFFF).
+ if (value is String)
+ {
+ if (!styleManager)
+ styleManager = Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2;
+ var colorNumber:Number = styleManager.getColorName(value);
+ if (colorNumber != NOT_A_COLOR)
+ value = colorNumber;
+ }
+
+ // If the new value for styleProp is different from the one returned
+ // from the defaultFactory function, then store the new value on the
+ // overrides object. That way, future clones will get the new value.
+ if (defaultFactory != null)
+ {
+ o = new defaultFactory();
+ if (o[styleProp] !== value) // must use !==
+ {
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = value;
+ }
+ else if (overrides)
+ {
+ delete overrides[styleProp];
+ }
+ }
+
+ // If the new value for styleProp is different from the one returned
+ // from the factory function, then store the new value on the
+ // overrides object. That way, future clones will get the new value.
+ if (factory != null)
+ {
+ o = new factory();
+ if (o[styleProp] !== value) // must use !==
+ {
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = value;
+ }
+ else if (overrides)
+ {
+ delete overrides[styleProp];
+ }
+ }
+
+ if (defaultFactory == null && factory == null)
+ {
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = value;
+ }
+
+ // Update all clones of this style sheet.
+ updateClones(styleProp, value);
+
+ }
+
+ /**
+ * Clears a style property on this CSSStyleDeclaration.
+ *
+ * This is the same as setting the style value to <code>undefined</code>.
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function clearStyle(styleProp:String):void
+ {
+ public::setStyle(styleProp, undefined);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function createProtoChainRoot():Object
+ {
+ var root:Object = {};
+
+ // If there's a defaultFactory for this style sheet,
+ // then add the object it produces to the root.
+ if (defaultFactory != null)
+ {
+ defaultFactory.prototype = root;
+ root = new defaultFactory();
+ }
+
+ // If there's a factory for this style sheet,
+ // then add the object it produces to the root.
+ if (factory != null)
+ {
+ factory.prototype = root;
+ root = new factory();
+ }
+
+ clones.put(root);
+
+ return root;
+ }
+
+ /**
+ * @private
+ *
+ * The order of nodes in the prototype chain:
+ *
+ * 1. parent style default factories
+ * 2. this default factory
+ * 3. parent style factories
+ * 4. parent style overrides
+ * 5. this factory
+ * 6. this overrides
+ *
+ * Where a parent style is a style with the same selector as this
+ * style but in a parent style manager.
+ *
+ */
+ mx_internal function addStyleToProtoChain(chain:Object,
+ target:DisplayObject,
+ filterMap:Object = null):Object
+ {
+ var nodeAddedToChain:Boolean = false;
+ var originalChain:Object = chain;
+
+ // Get a list of parent style declarations for this selector.
+ var parentStyleDeclarations:Vector.<CSSStyleDeclaration> = new Vector.<CSSStyleDeclaration>();
+ var styleParent:IStyleManager2 = styleManager.parent;
+ while (styleParent)
+ {
+ var parentStyle:CSSStyleDeclaration = styleParent.getStyleDeclaration(selectorString);
+ if (parentStyle)
+ parentStyleDeclarations.unshift(parentStyle);
+
+ styleParent = styleParent.parent;
+ }
+
+ // #1. Add parent's default styles. Topmost parent is added to the chain first.
+ for each (var style:CSSStyleDeclaration in parentStyleDeclarations)
+ {
+ // If there's a defaultFactory for this style sheet,
+ // then add the object it produces to the chain.
+ if (style.defaultFactory != null)
+ chain = style.addDefaultStyleToProtoChain(chain, target, filterMap);
+ }
+
+ // #2. Add this style's defaultFactory to the proto chain.
+ if (defaultFactory != null)
+ chain = addDefaultStyleToProtoChain(chain, target, filterMap);
+
+ // #3 and #4. Add parent's factory styles and overrides.
+ var addedParentStyleToProtoChain:Boolean = false;
+ for each (style in parentStyleDeclarations)
+ {
+ if (style.factory != null || style.overrides != null)
+ {
+ chain = style.addFactoryAndOverrideStylesToProtoChain(chain, target, filterMap);
+ addedParentStyleToProtoChain = true;
+ }
+ }
+
+ // #5 and #6. Add this factory style and overrides.
+ var inChain:Object = chain;
+ if (factory != null || overrides != null)
+ {
+ chain = addFactoryAndOverrideStylesToProtoChain(chain, target, filterMap);
+ if (inChain != chain)
+ nodeAddedToChain = true;
+ }
+
+ // Here we check if we need to add an empty node to the chain for clone
+ // purposes. If there are parent nodes between this defaultFactory and
+ // this factory, then we can't use the defaultFactory node as the clone
+ // since overrides could get blocked by parent styles.
+ // First we check if we have a defaultFactory and we didn't add a factory
+ // or override node to the chain. If we have a factory or override node
+ // then we will just use that.
+ if (defaultFactory != null && !nodeAddedToChain)
+ {
+ // Now we know we have a default factory node and no factory or override
+ // nodes. We can use the default factory as a clone on the chain if there
+ // are no parent styles below it on the proto chain.
+ // Otherwise create an empty node so overrides and be added later.
+ if (addedParentStyleToProtoChain)
+ {
+ // There are parent styles so create an empty node.
+ emptyObjectFactory.prototype = chain;
+ chain = new emptyObjectFactory();
+ emptyObjectFactory.prototype = null;
+ }
+
+ nodeAddedToChain = true;
+ }
+
+ if (nodeAddedToChain)
+ clones.put(chain);
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function addDefaultStyleToProtoChain(chain:Object,
+ target:DisplayObject,
+ filterMap:Object = null):Object
+ {
+ // If there's a defaultFactory for this style sheet,
+ // then add the object it produces to the chain.
+ if (defaultFactory != null)
+ {
+ var originalChain:Object = chain;
+ if (filterMap)
+ {
+ chain = {};
+ }
+
+ defaultFactory.prototype = chain;
+ chain = new defaultFactory();
+ defaultFactory.prototype = null;
+
+ if (filterMap)
+ chain = applyFilter(originalChain, chain, filterMap);
+ }
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function addFactoryAndOverrideStylesToProtoChain(chain:Object,
+ target:DisplayObject,
+ filterMap:Object = null):Object
+ {
+ var originalChain:Object = chain;
+ if (filterMap)
+ {
+ chain = {};
+ }
+
+ // If there's a factory for this style sheet,
+ // then add the object it produces to the chain.
+ if (factory != null)
+ {
+ factory.prototype = chain;
+ chain = new factory();
+ factory.prototype = null;
+ }
+
+ // If someone has called setStyle() on this CSSStyleDeclaration,
+ // then some of the values returned from the factory are
+ // out-of-date. Overwrite them with the up-to-date values.
+ if (overrides)
+ {
+ // Before we add our overrides to the object at the head of
+ // the chain, make sure that we added an object at the head
+ // of the chain.
+ if (factory == null)
+ {
+ emptyObjectFactory.prototype = chain;
+ chain = new emptyObjectFactory();
+ emptyObjectFactory.prototype = null;
+ }
+
+ for (var p:String in overrides)
+ {
+ if (overrides[p] === undefined)
+ delete chain[p];
+ else
+ chain[p] = overrides[p];
+ }
+ }
+
+ if (filterMap)
+ {
+ if (factory != null || overrides)
+ chain = applyFilter(originalChain, chain, filterMap);
+ else
+ chain = originalChain;
+ }
+
+ if (factory != null || overrides)
+ clones.put(chain);
+
+ return chain;
+ }
+
+
+ /**
+ * @private
+ */
+ mx_internal function applyFilter(originalChain:Object, chain:Object, filterMap:Object):Object
+ {
+ var filteredChain:Object = {};
+ // Create an object on the head of the chain using the original chain
+ emptyObjectFactory.prototype = originalChain;
+ filteredChain = new emptyObjectFactory();
+ emptyObjectFactory.prototype = null;
+
+ for (var i:String in chain)
+ {
+ if (filterMap[i] != null)
+ {
+ filteredChain[filterMap[i]] = chain[i];
+ }
+ }
+
+ chain = filteredChain;
+ chain[FILTERMAP_PROP] = filterMap;
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function clearOverride(styleProp:String):void
+ {
+ if (overrides && overrides[styleProp] !== undefined)
+ delete overrides[styleProp];
+ }
+
+ /**
+ * @private
+ */
+ private function clearStyleAttr(styleProp:String):void
+ {
+ // Put "undefined" into our overrides Array
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = undefined;
+
+ // Remove the property from all our clones
+ for (var clone:* in clones.iterator)
+ {
+ delete clone[styleProp];
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function updateClones(styleProp:String, value:*):void
+ {
+ // Update all clones of this style sheet.
+ for (var clone:* in clones.iterator)
+ {
+ var cloneFilter:Object = clone[FILTERMAP_PROP];
+ if (cloneFilter)
+ {
+ if (cloneFilter[styleProp] != null)
+ {
+ clone[cloneFilter[styleProp]] = value;
+ }
+ }
+ else
+ {
+ clone[styleProp] = value;
+ }
+ }
+ }
+
+}
+
+}
+import flash.utils.Dictionary;
+
+COMPILE::AS3
+{
+ import flash.utils.Dictionary;
+}
+
+class CloneManager
+{
+ COMPILE::AS3
+ private var clones:Dictionary = new Dictionary(true);
+
+ COMPILE::JS
+ private var array:Array = [];
+
+ public function CloneManager()
+ {
+
+ }
+
+ public function put(o:Object):void
+ {
+ COMPILE::AS3
+ {
+ clones[o] = 1;
+ }
+ COMPILE::JS
+ {
+ // leaks memory.
+ // Need to track references
+ // so we can clean up
+ array.push(o);
+ }
+ }
+
+ public function get iterator():Object
+ {
+ COMPILE::AS3
+ {
+ return clones;
+ }
+ COMPILE::JS
+ {
+ return array;
+ }
+ }
+}
\ 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/styles/IAdvancedStyleClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as b/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as
new file mode 100644
index 0000000..2b4ae88
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+/**
+ * This interface describes the advanced properties that a component must
+ * implement to fully participate in the advanced style subsystem.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface IAdvancedStyleClient extends IStyleClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * The identity of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get id():String;
+
+ //----------------------------------
+ // styleParent
+ //----------------------------------
+
+ /**
+ * The parent of this <code>IAdvancedStyleClient</code>..
+ *
+ * Typically, you do not assign this property directly.
+ * It is set by the <code>addChild, addChildAt, removeChild, and
+ * removeChildAt</code> methods of the
+ * <code>flash.display.DisplayObjectContainer</code> and the
+ * <code>mx.core.UIComponent.addStyleClient()</code> and
+ * the <code>mx.core.UIComponent.removeStyleClient()</code> methods.
+ *
+ * If it is assigned a value directly, without calling one of the
+ * above mentioned methods the instance of the class that implements this
+ * interface will not inherit styles from the UIComponent or DisplayObject.
+ * Also if assigned a value directly without, first removing the
+ * object from the current parent with the remove methods listed above,
+ * a memory leak could occur.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get styleParent():IAdvancedStyleClient;
+ function set styleParent(parent:IAdvancedStyleClient):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Flex calls the <code>stylesInitialized()</code> method when
+ * the styles for a component are first initialized.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function stylesInitialized():void
+
+ /**
+ * Returns <code>true</code> if <code>cssState</code> matches <code>currentCSSState</code>.
+ * Typically, you do not call this method directly.
+ * It is called by the <code>mx.styles.CSSCondition.matchesStyleClient()</code> method.
+ *
+ * <p>Note Spark components use their skin state as the pseudo state.
+ * Halo components use the <code>currentState</code> property.</p>
+ *
+ * @param cssState A possible value of <code>CSSCondition.value</code>.
+ * It represents the current state of this component used to match CSS pseudo-selectors.
+ *
+ * @return <code>true</code> if <code>cssState</code> matches <code>currentCSSState</code>.
+ * By default, <code>currentCSSState</code> is the same as <code>currentState</code>.
+ * If no state exists, return null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function matchesCSSState(cssState:String):Boolean;
+
+ /**
+ * Determines whether this instance is the same as, or is a subclass of,
+ * the given type.
+ * Typically, you do not call this method directly.
+ * It is called by the <code>mx.styles.CSSCondition.matchesStyleClient()</code> method.
+ *
+ * @param cssType A CSSSelector object.
+ *
+ * @return <code>true</code> if <code>cssType</code> is in the hierarchy of qualified type selectors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function matchesCSSType(cssType:String):Boolean;
+
+
+ /**
+ * Returns <code>true</code> if <code>currentCSSState</code> is not <code>null</code>.
+ * Typically, you do not call this method directly.
+ * It is called by the <code>mx.styles.CSSCondition.matchesStyleClient()</code> method.
+ *
+ * <p>Note Spark components use their skin state as the pseudo state.
+ * Halo components use the <code>currentState</code> property.</p>
+ *
+ * @return <code>true</code> if <code>currentCSSState</code> is not <code>null</code>.
+ * By default, <code>currentCSSState</code> is the same as <code>currentState</code>.
+ * If no state exists, return false.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.6
+ */
+ function hasCSSState():Boolean;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as b/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as
new file mode 100644
index 0000000..ed61e82
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+/**
+ * This interface describes the properties and methods that an object
+ * must implement so that it can participate in the style subsystem.
+ * This interface is intended to be used by classes that obtain their
+ * style values from other objects rather than through locally set values
+ * and type selectors.
+ * This interface is implemented by ProgrammaticSkin.
+ *
+ * @see mx.styles.IStyleClient
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ISimpleStyleClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // styleName
+ //----------------------------------
+
+ /**
+ * The source of this object's style values.
+ * The value of the <code>styleName</code> property can be one of three possible types:
+ *
+ * <ul>
+ * <li>String, such as "headerStyle". The String names a class selector that is defined in a CSS style sheet.</li>
+ *
+ * <li>CSSStyleDeclaration, such as <code>StyleManager.getStyleDeclaration(".headerStyle")</code>.</li>
+ *
+ * <li>UIComponent. The object that implements this interface inherits all the style values from the referenced UIComponent.</li>
+ * </ul>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get styleName():Object
+
+ /**
+ * @private
+ */
+ function set styleName(value:Object):void
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Called when the value of a style property is changed.
+ *
+ * @param styleProp The name of the style property that changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function styleChanged(styleProp:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as
new file mode 100644
index 0000000..91e859e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as
@@ -0,0 +1,268 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+
+/**
+ * This interface describes the properties and methods that an object
+ * must implement so that it can fully participate in the style subsystem.
+ * This interface is implemented by UIComponent.
+ *
+ * <p>If the object does not need to store style values locally, it can
+ * implement the <code>ISimpleStyleClient</code> interface instead.</p>
+ *
+ * @see mx.styles.ISimpleStyleClient
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IStyleClient extends ISimpleStyleClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // className
+ //----------------------------------
+
+ /**
+ * The name of the component class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get className():String;
+
+ //----------------------------------
+ // inheritingStyles
+ //----------------------------------
+
+ /**
+ * An object containing the inheritable styles for this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get inheritingStyles():Object;
+
+ /**
+ * @private
+ */
+ function set inheritingStyles(value:Object):void;
+
+ //----------------------------------
+ // nonInheritingStyles
+ //----------------------------------
+
+ /**
+ * An object containing the noninheritable styles for this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get nonInheritingStyles():Object;
+
+ /**
+ * @private
+ */
+ function set nonInheritingStyles(value:Object):void;
+
+ //----------------------------------
+ // styleDeclaration
+ //----------------------------------
+
+ /**
+ * The style declaration that holds the inline styles declared by this
+ * object.
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get styleDeclaration():CSSStyleDeclaration;
+
+ /**
+ * @private
+ */
+ function set styleDeclaration(value:CSSStyleDeclaration):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets a style property that has been set anywhere in this
+ * component's style lookup chain.
+ *
+ * <p>This same method is used to get any kind of style property,
+ * so the value returned may be a Boolean, String, Number, int,
+ * uint (for an RGB color), Class (for a skin), or any kind of object.
+ * Therefore the return type is specified as ~~.</p>
+ *
+ * <p>If you are getting a particular style property, you will
+ * know its type and will often want to store the result in a
+ * variable of that type. You can use either the <code>as</code>
+ * operator or coercion to do this. For example:</p>
+ *
+ * <pre>
+ * var backgroundColor:uint = getStyle("backgroundColor") as int;
+ *
+ * or
+ *
+ * var backgroundColor:uint = int(getStyle("backgroundColor"));
+ * </pre>
+ *
+ * <p>If the style property has not been set anywhere in the
+ * style lookup chain, the value returned by the <code>getStyle()</code> method
+ * is <code>undefined</code>.
+ * Note that <code>undefined</code> is a special value that is
+ * not the same as <code>false</code>, the empty String (<code>""</code>),
+ * <code>NaN</code>, 0, or <code>null</code>.
+ * No valid style value is ever <code>undefined</code>.
+ * You can use the static method
+ * <code>StyleManager.isValidStyleValue()</code>
+ * to test whether the value was set.</p>
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @return Style value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getStyle(styleProp:String):*;
+
+ /**
+ * Sets a style property on this component instance.
+ *
+ * <p>This may override a style that was set globally.</p>
+ *
+ * <p>Calling the <code>setStyle()</code> method can result in decreased performance.
+ * Use it only when necessary.</p>
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @param newValue New value for the style.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setStyle(styleProp:String, newValue:*):void
+
+ /**
+ * Deletes a style property from this component instance.
+ *
+ * <p>This does not necessarily cause the <code>getStyle()</code> method to return
+ * <code>undefined</code>.</p>
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function clearStyle(styleProp:String):void;
+
+ /**
+ * Returns an Array of CSSStyleDeclaration objects for the type selector
+ * that applies to this component, or <code>null</code> if none exist.
+ *
+ * <p>For example, suppose that component MyButton extends Button.
+ * This method first looks for a MyButton selector; then, it looks for a Button type selector;
+ * finally, it looks for a UIComponent type selector.</p>
+ *
+ * @return Array of CSSStyleDeclaration objects.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getClassStyleDeclarations():Array; // of CSSStyleDeclaration;
+
+ /**
+ * Propagates style changes to the children of this component.
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @param recursive Whether to propagate the style changes to the children's children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function notifyStyleChangeInChildren(styleProp:String,
+ recursive:Boolean):void;
+
+ /**
+ * Sets up the internal style cache values so that the <code>getStyle()</code>
+ * method functions.
+ * If this object already has children, then reinitialize the children's
+ * style caches.
+ *
+ * @param recursive Regenerate the proto chains of the children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function regenerateStyleCache(recursive:Boolean):void;
+
+ /**
+ * Registers the EffectManager as one of the event listeners for each effect event.
+ *
+ * @param effects An Array of Strings of effect names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerEffects(effects:Array /* of String */):void
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as
new file mode 100644
index 0000000..44690f4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as
@@ -0,0 +1,572 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+COMPILE::LATER
+{
+ import flash.events.IEventDispatcher;
+ import flash.system.ApplicationDomain;
+ import flash.system.SecurityDomain;
+}
+
+/**
+ * The IStyleManager class manages the following:
+ * <ul>
+ * <li>Which CSS style properties the class inherits</li>
+ * <li>Which style properties are colors, and therefore get special handling</li>
+ * <li>A list of strings that are aliases for color values</li>
+ * </ul>
+ *
+ * This interface was used by Flex 2.0.1.
+ * Flex 3 now uses IStyleManager2 instead.
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 2.0.1
+ *
+ */
+public interface IStyleManager
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // inheritingStyles
+ //----------------------------------
+
+ /**
+ * @private
+ * Set of inheriting non-color styles.
+ * This is not the complete set from CSS.
+ * Some of the omitted we don't support at all,
+ * others may be added later as needed.
+ * The method registerInheritingStyle() adds to this set
+ * and isInheritingStyle() queries this set.
+ */
+ function get inheritingStyles():Object;
+
+ /**
+ * @private
+ */
+ function set inheritingStyles(value:Object):void;
+
+ //----------------------------------
+ // stylesRoot
+ //----------------------------------
+
+ /**
+ * @private
+ * The root of all proto chains used for looking up styles.
+ * This object is initialized once by initProtoChainRoots() and
+ * then updated by calls to setStyle() on the global CSSStyleDeclaration.
+ * It is accessed by code that needs to construct proto chains,
+ * such as the initProtoChain() method of UIComponent.
+ */
+ function get stylesRoot():Object;
+
+ /**
+ * @private
+ */
+ function set stylesRoot(value:Object):void;
+
+ //----------------------------------
+ // typeSelectorCache
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get typeSelectorCache():Object;
+
+ /**
+ * @private
+ */
+ function set typeSelectorCache(value:Object):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getStyleDeclaration(selector:String):CSSStyleDeclaration;
+
+ /**
+ * Sets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the specified selector is a "class selector" and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the specified selector is a "type selector" and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ * @param styleDeclaration The new style declaration.
+ * @param update Set to <code>true</code> to force an immediate update of the styles; internally, Flex
+ * calls the <code>styleChanged()</code> method of UIComponent.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ *
+ * <p>The styles will be updated the next time one of the following methods is called with
+ * the <code>update</code> property set to <code>true</code>:
+ * <ul>
+ * <li><code>clearStyleDeclaration()</code></li>
+ * <li><code>loadStyleDeclarations()</code></li>
+ * <li><code>setStyleDeclaration()</code></li>
+ * <li><code>unloadStyleDeclarations()</code></li>
+ * </ul>
+ * </p>
+ *
+ * <p>Typically, if you call the one of these methods multiple times,
+ * you set this property to <code>true</code> only on the last call,
+ * so that Flex does not call the <code>styleChanged()</code> method multiple times.</p>
+ *
+ * <p>If you call the <code>getStyle()</code> method, Flex returns the style value
+ * that was last applied to the UIComponent through a call to the <code>styleChanged()</code> method.
+ * The component's appearance might not reflect the value returned by the <code>getStyle()</code> method. This occurs
+ * because one of these style declaration methods might not yet have been called with the
+ * <code>update</code> property set to <code>true</code>.</p>
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setStyleDeclaration(selector:String,
+ styleDeclaration:CSSStyleDeclaration,
+ update:Boolean):void;
+
+ /**
+ * Clears the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the specified selector is a class selector (for example, ".bigMargins" or ".myStyle"),
+ * you must be sure to start the
+ * <code>selector</code> property with a period (.).</p>
+ *
+ * <p>If the specified selector is a type selector (for example, "Button"), do not start the
+ * <code>selector</code> property with a period.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector to clear.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * For more information about this method, see the description in the <code>setStyleDeclaration()</code>
+ * method.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function clearStyleDeclaration(selector:String, update:Boolean):void;
+
+ /**
+ * Adds to the list of styles that can inherit values
+ * from their parents.
+ *
+ * <p><b>Note:</b> Ensure that you avoid using duplicate style names, as name
+ * collisions can result in decreased performance if a style that is
+ * already used becomes inheriting.</p>
+ *
+ * @param styleName The name of the style that is added to the list of styles that can inherit values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerInheritingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if a style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified style is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isInheritingStyle(styleName:String):Boolean;
+
+ /**
+ * Test to see if a TextFormat style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified TextFormat style
+ * is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isInheritingTextFormatStyle(styleName:String):Boolean;
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.
+ *
+ * @param styleName The name of the style that you add to the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerSizeInvalidatingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if a style changes the size of a component.
+ *
+ * <p>When one of these styles is set with the <code>setStyle()</code> method,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isSizeInvalidatingStyle(styleName:String):Boolean;
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component's parent container.
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerParentSizeInvalidatingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if the style changes the size of the component's parent container.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isParentSizeInvalidatingStyle(styleName:String):Boolean;
+
+ /**
+ * Adds to the list of styles which may affect the appearance
+ * or layout of the component's parent container.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerParentDisplayListInvalidatingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if this style affects the component's parent container in
+ * such a way as to require that the parent container redraws itself when this style changes.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the appearance or layout of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isParentDisplayListInvalidatingStyle(styleName:String):Boolean;
+
+ /**
+ * Adds a color name to the list of aliases for colors.
+ *
+ * @param colorName The name of the color to add to the list; for example, "blue".
+ * If you later access this color name, the value is not case-sensitive.
+ *
+ * @param colorValue Color value, for example, 0x0000FF.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerColorName(colorName:String, colorValue:uint):void;
+
+ /**
+ * Tests to see if the given String is an alias for a color value. For example,
+ * by default, the String "blue" is an alias for 0x0000FF.
+ *
+ * @param colorName The color name to test. This parameter is not case-sensitive.
+ *
+ * @return Returns <code>true</code> if <code>colorName</code> is an alias
+ * for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isColorName(colorName:String):Boolean;
+
+ /**
+ * Returns the numeric RGB color value that corresponds to the
+ * specified color string.
+ * The color string can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>.
+ *
+ * <p>This method returns a uint, such as 4521830, that represents a color. You can convert
+ * this uint to a hexadecimal value by passing the numeric base (in this case, 16), to
+ * the uint class's <code>toString()</code> method, as the following example shows:</p>
+ * <pre>
+ * import mx.styles.StyleManager;
+ * private function getNewColorName():void {
+ * StyleManager.registerColorName("soylentGreen",0x44FF66);
+ * trace(StyleManager.getColorName("soylentGreen").toString(16));
+ * }
+ * </pre>
+ *
+ * @param colorName The color name.
+ *
+ * @return Returns a uint that represents the color value or <code>NOT_A_COLOR</code>
+ * if the value of the <code>colorName</code> property is not an alias for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getColorName(colorName:Object):uint;
+
+ /**
+ * Converts each element of the colors Array from a color name
+ * to a numeric RGB color value.
+ * Each color String can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>..
+ *
+ * @param colors An Array of color names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getColorNames(colors:Array /* of Number or String */):void;
+
+ /**
+ * Determines if a specified parameter is a valid style property. For example:
+ *
+ * <pre>
+ * trace(StyleManager.isValidStyleValue(myButton.getStyle("color")).toString());
+ * </pre>
+ *
+ * <p>This can be useful because some styles can be set to values
+ * such as 0, <code>NaN</code>,
+ * the empty String (<code>""</code>), or <code>null</code>, which can
+ * cause an <code>if (value)</code> test to fail.</p>
+ *
+ * @param value The style property to test.
+ *
+ * @return If you pass the value returned by a <code>getStyle()</code> method call
+ * to this method, it returns <code>true</code> if the style
+ * was set and <code>false</code> if it was not set.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isValidStyleValue(value:*):Boolean;
+
+ /**
+ * Loads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ *
+ * @param update Set to <code>true</code> to force
+ * an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update
+ * of the styles in the application.
+ * This parameter is optional and defaults to <code>true</code>
+ * For more information about this parameter, see the description
+ * in the <code>setStyleDeclaration()</code> method.
+ *
+ * @param trustContent Obsolete, no longer used.
+ * This parameter is optional and defaults to <code>false</code>.
+ *
+ * @param applicationDomain The ApplicationDomain passed to the
+ * <code>load()</code> method of the IModuleInfo that loads the style SWF.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @param securityDomain The SecurityDomain passed to the
+ * <code>load()</code> method of the IModuleInfo that loads the style SWF.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @return An IEventDispatcher implementation that supports
+ * StyleEvent.PROGRESS, StyleEvent.COMPLETE, and
+ * StyleEvent.ERROR.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function loadStyleDeclarations(
+ url:String, update:Boolean = true,
+ trustContent:Boolean = false,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):IEventDispatcher;
+
+ /**
+ * Unloads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * For more information about this method, see the description in the <code>setStyleDeclaration()</code>
+ * method.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function unloadStyleDeclarations(
+ url:String, update:Boolean = true):void;
+
+ /**
+ * @private
+ * This method is called by code autogenerated by the MXML compiler,
+ * after StyleManager.styles is popuplated with CSSStyleDeclarations.
+ */
+ function initProtoChainRoots():void;
+
+ /**
+ * @private
+ * After an entire selector is added, replaced, or removed,
+ * this method updates all the DisplayList trees.
+ */
+ function styleDeclarationsChanged():void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as
new file mode 100644
index 0000000..6a59470
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as
@@ -0,0 +1,220 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+COMPILE::LATER
+{
+ import flash.events.IEventDispatcher;
+ import flash.system.ApplicationDomain;
+ import flash.system.SecurityDomain;
+}
+
+/**
+ * The IStyleManager2 class manages the following:
+ * <ul>
+ * <li>Which CSS style properties the class inherits</li>
+ * <li>Which style properties are colors, and therefore get special handling</li>
+ * <li>A list of strings that are aliases for color values</li>
+ * </ul>
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ *
+ */
+public interface IStyleManager2 extends IStyleManager
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The style manager that is the parent of this StyleManager.
+ *
+ * @return the parent StyleManager or null if this is the top-level StyleManager.
+ */
+ function get parent():IStyleManager2;
+
+ //----------------------------------
+ // qualifiedTypeSelectors
+ //----------------------------------
+
+ /**
+ * @private
+ * Qualified type selectors were added in Flex 4 to support styling
+ * components with the same local name, e.g. 'spark.components.Button'.
+ * Prior to this type selectors were always unqualified class names e.g.
+ * 'Button'. To ease migration of Flex 3 application, this property can
+ * control whether CSS type selectors must be fully qualified class names
+ * when the compatibility version is 4 or later.
+ */
+ function get qualifiedTypeSelectors():Boolean;
+
+ /**
+ * @private
+ */
+ function set qualifiedTypeSelectors(value:Boolean):void;
+
+ //----------------------------------
+ // selectors
+ //----------------------------------
+
+ /**
+ * Returns an Array of all the CSS selectors that are registered with the StyleManager.
+ * You can pass items in this Array to the <code>getStyleDeclaration()</code> method to get the corresponding CSSStyleDeclaration object.
+ * Class selectors are prepended with a period.
+ *
+ * @return An Array of all of the selectors
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get selectors():Array;
+
+ //----------------------------------
+ // typeHierarchyCache
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get typeHierarchyCache():Object;
+
+ /**
+ * @private
+ */
+ function set typeHierarchyCache(value:Object):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Gets the list of style declarations for the given subject. The subject
+ * is the right most simple type selector in a potential selector chain.
+ *
+ * @param subject The style subject.
+ * @return Object map of StyleDeclarations for this subject. The object
+ * has four properties: class for class selectors,
+ * id for id selectors, pseudo for pseudo selectors and unconditional
+ * for selectors without conditions
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.6
+ */
+ function getStyleDeclarations(subject:String):Object;
+
+ /**
+ * Gets a CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector. The CSSStyleDeclaration object is
+ * created by merging the properties of the specified CSS selector in
+ * this style manager with the properties of any parent style managers.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getMergedStyleDeclaration(selector:String):CSSStyleDeclaration;
+
+ /**
+ * @private
+ * Determines whether any of the selectors declared a pseudo selector
+ * for the given state. This is used to avoid unnecessary style
+ * regeneration between state changes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function hasPseudoCondition(value:String):Boolean;
+
+ /**
+ * @private
+ * Determines whether any of the selectors registered with the style
+ * manager have been advanced selectors (descendant selector, id selector,
+ * non-global class selector, or pseudo selector).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function hasAdvancedSelectors():Boolean;
+
+ /**
+ * @private
+ * In Flex 2, the static method StyleManager.loadStyleDeclarations()
+ * had three parameters and called loadStyleDeclarations()
+ * on IStyleManager.
+ * In Flex 3, the static method has four parameters and calls
+ * this method.
+ */
+ COMPILE::LATER
+ function loadStyleDeclarations2(
+ url:String, update:Boolean = true,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):IEventDispatcher;
+
+ /**
+ * @private
+ * Used in media query handling.
+ * @param value normalized media query string
+ * @returns true if valid media
+ */
+ function acceptMediaList(value:String):Boolean;
+}
+
+}
[23/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..1a6d60a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as
@@ -0,0 +1,3758 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.Graphics;
+import flash.display.Loader;
+import flash.display.LoaderInfo;
+import flash.display.MovieClip;
+import flash.display.Sprite;
+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 flash.utils.Timer;
+import flash.utils.getQualifiedClassName;
+
+import mx.core.IChildList;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModuleFactory;
+import mx.core.IInvalidating;
+import mx.core.IRawChildrenContainer;
+import mx.core.IUIComponent;
+import mx.core.RSLData;
+import mx.core.RSLItem;
+import mx.core.Singleton;
+import mx.core.mx_internal;
+import mx.events.DynamicEvent;
+import mx.events.FlexEvent;
+import mx.events.RSLEvent;
+import mx.events.Request;
+import mx.events.SandboxMouseEvent;
+import mx.preloaders.Preloader;
+import mx.utils.DensityUtil;
+import mx.utils.LoaderUtil;
+
+import flex.display.ModuleInfo;
+import flex.display.TopOfDisplayList;
+
+import org.apache.flex.core.UIBase;
+import org.apache.flex.events.EventDispatcher;
+import org.apache.flex.events.IEventDispatcher;
+import org.apache.flex.geom.Rectangle;
+
+// NOTE: Minimize the non-Flash classes you import here.
+// Any dependencies of SystemManager have to load in frame 1,
+// before the preloader, or anything else, can be displayed.
+
+use namespace mx_internal;
+
+//--------------------------------------
+// Events
+//--------------------------------------
+
+/**
+ * Dispatched when the application has finished initializing
+ *
+ * @eventType mx.events.FlexEvent.APPLICATION_COMPLETE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="applicationComplete", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched every 100 milliseconds when there has been no keyboard
+ * or mouse activity for 1 second.
+ *
+ * @eventType mx.events.FlexEvent.IDLE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="idle", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when the Stage is resized.
+ *
+ * @eventType flash.events.Event.RESIZE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="resize", type="flash.events.Event")]
+
+/**
+ * The SystemManager class manages an application window.
+ * Every application that runs on the desktop or in a browser
+ * has an area where the visuals of the application are
+ * displayed.
+ * It may be a window in the operating system
+ * or an area within the browser. That area is an application window
+ * and different from an instance of <code>mx.core.Application</code>, which
+ * is the main, or top-level, window within an application.
+ *
+ * <p>Every application has a SystemManager.
+ * The SystemManager sends an event if
+ * the size of the application window changes (you cannot change it from
+ * within the application, but only through interaction with the operating
+ * system window or browser). It parents all displayable things within the
+ * application like the main mx.core.Application instance and all popups,
+ * tooltips, cursors, and so on. Any object parented by the SystemManager is
+ * considered to be a top-level window, even tooltips and cursors.</p>
+ *
+ * <p>The SystemManager also switches focus between top-level windows if there
+ * are more than one IFocusManagerContainer displayed and users are interacting
+ * with components within the IFocusManagerContainers. </p>
+ *
+ * <p>All keyboard and mouse activity that is not expressly trapped is seen by
+ * the SystemManager, making it a good place to monitor activity should you need
+ * to do so.</p>
+ *
+ * <p>If an application is loaded into another application, a SystemManager
+ * will still be created, but will not manage an application window,
+ * depending on security and domain rules.
+ * Instead, it will be the <code>content</code> of the <code>Loader</code>
+ * that loaded it and simply serve as the parent of the sub-application</p>
+ *
+ * <p>The SystemManager maintains multiple lists of children, one each for tooltips, cursors,
+ * popup windows. This is how it ensures that popup windows "float" above the main
+ * application windows and that tooltips "float" above that and cursors above that.
+ * If you simply examine the <code>numChildren</code> property or
+ * call the <code>getChildAt()</code> method on the SystemManager, you are accessing
+ * the main application window and any other windows that aren't popped up. To get the list
+ * of all windows, including popups, tooltips and cursors, use
+ * the <code>rawChildren</code> property.</p>
+ *
+ * <p>The SystemManager is the first display class created within an application.
+ * It is responsible for creating an <code>mx.preloaders.Preloader</code> that displays and
+ * <code>mx.preloaders.SparkDownloadProgressBar</code> while the application finishes loading,
+ * then creates the <code>mx.core.Application</code> instance.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class SystemManager extends MovieClip
+ implements IChildList, IFlexDisplayObject,
+ IFlexModuleFactory, ISystemManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The number of milliseconds that must pass without any user activity
+ * before SystemManager starts dispatching 'idle' events.
+ */
+ private static const IDLE_THRESHOLD:Number = 1000;
+
+ /**
+ * @private
+ * The number of milliseconds between each 'idle' event.
+ */
+ private static const IDLE_INTERVAL:Number = 100;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * An array of SystemManager instances loaded as child app domains
+ */
+ COMPILE::LATER
+ mx_internal static var allSystemManagers:Dictionary = new Dictionary(true);
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * <p>This is the starting point for all Flex applications.
+ * This class is set to be the root class of a Flex SWF file.
+ * Flash Player instantiates an instance of this class,
+ * causing this constructor to be called.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function SystemManager()
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.startSampling("Application Startup", true /*absoluteTime*/);
+ perfUtil.markTime("SystemManager c-tor");
+ }
+
+ super();
+
+ // Loaded SWFs don't get a stage right away
+ // and shouldn't override the main SWF's setting anyway.
+ if (stage)
+ {
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ stage.align = StageAlign.TOP_LEFT;
+ stage.quality = StageQuality.HIGH;
+ }
+
+ // 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.
+ if (SystemManagerGlobals.topLevelSystemManagers.length > 0 && !stage)
+ topLevel = false;
+
+ if (!stage)
+ isStageRoot = false;
+
+ if (topLevel)
+ SystemManagerGlobals.topLevelSystemManagers.push(this);
+
+ // Make sure to stop the playhead on the current frame.
+ stop();
+
+ // Listen for the last frame (param is 0-indexed) to be executed.
+ //addFrameScript(totalFrames - 1, frameEndHandler);
+
+ if (root && root.loaderInfo)
+ root.loaderInfo.addEventListener(Event.INIT, initHandler);
+
+ }
+
+ //----------------------------------
+ // bindingEventDispatcher
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the binding event dispatcher.
+ */
+ private var _bindingEventDispatcher:EventDispatcher;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * Events get dispatched here first
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get bindingEventDispatcher():IEventDispatcher
+ {
+ if (_bindingEventDispatcher == null)
+ _bindingEventDispatcher = new EventDispatcher();
+ return _bindingEventDispatcher;
+ }
+
+ //----------------------------------
+ // effectEventDispatcher
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the effect event dispatcher.
+ */
+ private var _effectEventDispatcher:EventDispatcher;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * Events get dispatched here last
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get effectEventDispatcher():IEventDispatcher
+ {
+ if (_effectEventDispatcher == null)
+ _effectEventDispatcher = new EventDispatcher();
+ return _effectEventDispatcher;
+ }
+
+
+ /**
+ * @private
+ */
+ private function deferredNextFrame():void
+ {
+ if (currentFrame + 1 > totalFrames)
+ return;
+
+ if (currentFrame + 1 <= framesLoaded)
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.markTime("SystemManager.nextFrame().start");
+ }
+
+ nextFrame();
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("SystemManager.nextFrame().end");
+ }
+ }
+ else
+ {
+ // Next frame isn't baked yet, so we'll check back...
+ nextFrameTimer = new Timer(100);
+ nextFrameTimer.addEventListener(TimerEvent.TIMER,
+ nextFrameTimerHandler);
+ nextFrameTimer.start();
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Whether we are in the top-level list or not;
+ * top-level means we are the highest level SystemManager
+ * for this stage.
+ */
+ mx_internal var topLevel:Boolean = true;
+
+ /**
+ * @private
+ *
+ * true if redipatching a resize event.
+ */
+ private var isDispatchingResizeEvent:Boolean;
+
+ /**
+ * @private
+ * Whether we are the stage root or not.
+ * We are only the stage root if we were the root
+ * of the first SWF that got loaded by the player.
+ * Otherwise we could be top level but not stage root
+ * if we are loaded by some other non-Flex shell
+ * or are sandboxed.
+ */
+ mx_internal var isStageRoot:Boolean = true;
+
+ /**
+ * @private
+ * Whether we are the first SWF loaded into a bootstrap
+ * and therefore, the topLevelRoot
+ */
+ mx_internal var isBootstrapRoot:Boolean = false;
+
+ /**
+ * @private
+ * If we're not top level, then we delegate many things
+ * to the top level SystemManager.
+ */
+ private var _topLevelSystemManager:ISystemManager;
+
+ /**
+ * @private
+ * The childAdded/removed code
+ */
+ mx_internal var childManager:ISystemManagerChildManager;
+
+ /**
+ * cached value of the stage.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var _stage:Stage;
+
+ /**
+ * Depth of this object in the containment hierarchy.
+ * This number is used by the measurement and layout code.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var nestLevel:int = 0;
+
+ /**
+ * @private
+ * A reference to the preloader.
+ */
+ mx_internal var preloader:Preloader;
+
+ /**
+ * @private
+ * The mouseCatcher is the 0th child of the SystemManager,
+ * behind the application, which is child 1.
+ * It is the same size as the stage and is filled with
+ * transparent pixels; i.e., they've been drawn, but with alpha 0.
+ *
+ * Its purpose is to make every part of the stage
+ * able to detect the mouse.
+ * For example, a Button puts a mouseUp handler on the SystemManager
+ * in order to capture mouseUp events that occur outside the Button.
+ * But if the children of the SystemManager don't have "drawn-on"
+ * pixels everywhere, the player won't dispatch the mouseUp.
+ * We can't simply fill the SystemManager itself with
+ * transparent pixels, because the player's pixel detection
+ * logic doesn't look at pixels drawn into the root DisplayObject.
+ *
+ * Here is an example of what would happen without the mouseCatcher:
+ * Run a fixed-size Application (e.g. width="600" height="600")
+ * in the standalone player. Make the player window larger
+ * to reveal part of the stage. Press a Button, drag off it
+ * into the stage area, and release the mouse button.
+ * Without the mouseCatcher, the Button wouldn't return to its "up" state.
+ */
+ private var mouseCatcher:Sprite;
+
+ /**
+ * @private
+ * The top level window.
+ */
+ mx_internal var topLevelWindow:IUIComponent;
+
+ /**
+ * @private
+ * Number of frames since the last mouse or key activity.
+ */
+ mx_internal var idleCounter:int = 0;
+
+ /**
+ * @private
+ * The Timer used to determine when to dispatch idle events.
+ */
+ private var idleTimer:Timer;
+
+ /**
+ * @private
+ * A timer used when it is necessary to wait before incrementing the frame
+ */
+ private var nextFrameTimer:Timer = null;
+
+ /**
+ * @private
+ * Track which frame was last processed
+ */
+ private var lastFrame:int;
+
+ /**
+ * @private
+ * A boolean as to whether we've seen COMPLETE event from preloader
+ */
+ private var readyForKickOff:Boolean;
+
+ /**
+ * @private
+ *
+ * This variable exists only to provide a reference to this
+ * app's resource bundles. This application is opting
+ * into referencing its own resource bundles so the
+ * ResourceManager does not need to do it. This
+ * arrangement keeps the ResourceManager from pinning
+ * the application in memory.
+ *
+ * If this is the main app, then this variable will be null.
+ * If this is a sub-app then ResourceManagerImpl set
+ * this variable to the apps resource bundles. This variable
+ * is public so it is visible to ResourceManagerImpl but starts
+ * with an underscore to hint that it is an implementation detail
+ * and should not be relied on.
+ */
+ public var _resourceBundles:Array;
+
+ /**
+ * @private
+ * Array of RSLData objects that represent the list of RSLs this
+ * module factory is loading. Each element of the Array is an
+ * Array of RSLData.
+ */
+ COMPILE::LATER
+ private var rslDataList:Array
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties: DisplayObject
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // height
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _height:Number;
+
+ /**
+ * The height of this object. For the SystemManager
+ * this should always be the width of the stage unless the application was loaded
+ * into another application. If the application was not loaded
+ * into another application, setting this value has no effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function get height():Number
+ {
+ return _height;
+ }
+
+ //----------------------------------
+ // stage
+ //----------------------------------
+
+ /**
+ * @private
+ * get the main stage if we're loaded into another swf in the same sandbox
+ */
+ override public function get stage():Stage
+ {
+ if (_stage)
+ return _stage;
+
+ var s:Stage = super.stage;
+ if (s)
+ {
+ _stage = s;
+ return s;
+ }
+
+ COMPILE::LATER
+ {
+ if (!topLevel && _topLevelSystemManager)
+ {
+ _stage = _topLevelSystemManager.stage;
+ return _stage;
+ }
+ }
+
+ // Case for version skew, we are a top level system manager, but
+ // a child of the top level root system manager and we have access
+ // to the stage.
+ if (!isStageRoot && topLevel)
+ {
+ var root:DisplayObject = getTopLevelRoot();
+ if (root)
+ {
+ _stage = root.stage;
+ return _stage;
+ }
+ }
+
+ return null;
+ }
+
+ //----------------------------------
+ // width
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _width:Number;
+
+ /**
+ * The width of this object. For the SystemManager
+ * this should always be the width of the stage unless the application was loaded
+ * into another application. If the application was not loaded
+ * into another application, setting this value will have no effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function get width():Number
+ {
+ return _width;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties: DisplayObjectContainer
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // numChildren
+ //----------------------------------
+
+ /**
+ * The number of non-floating windows. This is the main application window
+ * plus any other windows added to the SystemManager that are not popups,
+ * tooltips or cursors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function get numChildren():int
+ {
+ return noTopMostIndex - applicationIndex;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // allowDomainsInNewRSLs
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private var _allowDomainsInNewRSLs:Boolean = true;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ COMPILE::LATER
+ public function get allowDomainsInNewRSLs():Boolean
+ {
+ return _allowDomainsInNewRSLs;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ public function set allowDomainsInNewRSLs(value:Boolean):void
+ {
+ _allowDomainsInNewRSLs = value;
+ }
+
+ //----------------------------------
+ // allowInsecureDomainsInNewRSLs
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private var _allowInsecureDomainsInNewRSLs:Boolean = true;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ COMPILE::LATER
+ public function get allowInsecureDomainsInNewRSLs():Boolean
+ {
+ return _allowInsecureDomainsInNewRSLs;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ public function set allowInsecureDomainsInNewRSLs(value:Boolean):void
+ {
+ _allowInsecureDomainsInNewRSLs = value;
+ }
+
+ //----------------------------------
+ // application
+ //----------------------------------
+
+ /**
+ * The application parented by this SystemManager.
+ * SystemManagers create an instance of an Application
+ * even if they are loaded into another Application.
+ * Thus, this may not match mx.core.Application.application
+ * if the SWF has been loaded into another application.
+ * <p>Note that this property is not typed as mx.core.Application
+ * because of load-time performance considerations
+ * but can be coerced into an mx.core.Application.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get application():IUIComponent
+ {
+ return IUIComponent(_document);
+ }
+
+ //----------------------------------
+ // applicationIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the applicationIndex property.
+ */
+ private var _applicationIndex:int = 1;
+
+ /**
+ * @private
+ * The index of the main mx.core.Application window, which is
+ * effectively its z-order.
+ */
+ mx_internal function get applicationIndex():int
+ {
+ return _applicationIndex;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function set applicationIndex(value:int):void
+ {
+ _applicationIndex = value;
+ }
+
+
+ //----------------------------------
+ // cursorChildren
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the cursorChildren property.
+ */
+ private var _cursorChildren:SystemChildrenList;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get cursorChildren():IChildList
+ {
+ if (!topLevel)
+ return _topLevelSystemManager.cursorChildren;
+
+ if (!_cursorChildren)
+ {
+ _cursorChildren = new SystemChildrenList(this,
+ new QName(mx_internal, "toolTipIndex"),
+ new QName(mx_internal, "cursorIndex"));
+ }
+
+ return _cursorChildren;
+ }
+
+ //----------------------------------
+ // cursorIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the toolTipIndex property.
+ */
+ private var _cursorIndex:int = 0;
+
+ /**
+ * @private
+ * The index of the highest child that is a cursor.
+ */
+ mx_internal function get cursorIndex():int
+ {
+ return _cursorIndex;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function set cursorIndex(value:int):void
+ {
+ var delta:int = value - _cursorIndex;
+ _cursorIndex = value;
+ }
+
+ //----------------------------------
+ // densityScale
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the densityScale property
+ */
+ private var _densityScale:Number = NaN;
+
+ /**
+ * The density scale factor of the application.
+ *
+ * When density scaling is enabled, Flex applies a scale factor based on
+ * the application author density and the density of the current device
+ * that Flex is running on.
+ *
+ * Returns 1.0 when there is no scaling.
+ *
+ * @see spark.components.Application#applicationDPI
+ * @see mx.core.DensityUtil
+ *
+ * @private
+ */
+ mx_internal function get densityScale():Number
+ {
+ if (isNaN(_densityScale))
+ {
+ var applicationDPI:Number = info()["applicationDPI"];
+ var runtimeDPI:Number = DensityUtil.getRuntimeDPI();
+ _densityScale = DensityUtil.getDPIScale(applicationDPI, runtimeDPI);
+ if (isNaN(_densityScale))
+ _densityScale = 1;
+ }
+
+ return _densityScale;
+ }
+
+ //----------------------------------
+ // document
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the document property.
+ */
+ private var _document:Object;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get document():Object
+ {
+ return _document;
+ }
+
+ /**
+ * @private
+ */
+ public function set document(value:Object):void
+ {
+ _document = value;
+ }
+
+ //----------------------------------
+ // embeddedFontList
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the fontList property.
+ */
+ private var _fontList:Object = null;
+
+ /**
+ * A table of embedded fonts in this application. The
+ * object is a table indexed by the font name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get embeddedFontList():Object
+ {
+ if (_fontList == null)
+ {
+ _fontList = {};
+
+ var o:Object = info()["fonts"];
+
+ var p:String;
+
+ for (p in o)
+ {
+ _fontList[p] = o[p];
+ }
+
+ // Top level systemManager may not be defined if SWF is loaded
+ // as a background image in download progress bar.
+ if (!topLevel && _topLevelSystemManager)
+ {
+ var fl:Object = _topLevelSystemManager.embeddedFontList;
+ for (p in fl)
+ {
+ _fontList[p] = fl[p];
+ }
+ }
+ }
+
+ return _fontList;
+ }
+
+ //----------------------------------
+ // explicitHeight
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _explicitHeight:Number;
+
+ /**
+ * The explicit width of this object. For the SystemManager
+ * this should always be NaN unless the application was loaded
+ * into another application. If the application was not loaded
+ * into another application, setting this value has no effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get explicitHeight():Number
+ {
+ return _explicitHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitHeight(value:Number):void
+ {
+ _explicitHeight = value;
+ }
+
+ //----------------------------------
+ // explicitWidth
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _explicitWidth:Number;
+
+ /**
+ * The explicit width of this object. For the SystemManager
+ * this should always be NaN unless the application was loaded
+ * into another application. If the application was not loaded
+ * into another application, setting this value has no effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get explicitWidth():Number
+ {
+ return _explicitWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitWidth(value:Number):void
+ {
+ _explicitWidth = value;
+ }
+
+ //----------------------------------
+ // focusPane
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _focusPane:Sprite;
+
+ /**
+ * @copy mx.core.UIComponent#focusPane
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get focusPane():Sprite
+ {
+ return _focusPane;
+ }
+
+ /**
+ * @private
+ */
+ public function set focusPane(value:Sprite):void
+ {
+ if (value)
+ {
+ addChild(value);
+
+ value.x = 0;
+ value.y = 0;
+ value.scrollRect = null;
+
+ _focusPane = value;
+ }
+ else
+ {
+ removeChild(_focusPane);
+
+ _focusPane = null;
+ }
+ }
+
+ //----------------------------------
+ // isProxy
+ //----------------------------------
+
+ /**
+ * True if SystemManager is a proxy and not a root class
+ */
+ public function get isProxy():Boolean
+ {
+ return false;
+ }
+
+ //----------------------------------
+ // measuredHeight
+ //----------------------------------
+
+ /**
+ * The measuredHeight is the explicit or measuredHeight of
+ * the main mx.core.Application window
+ * or the starting height of the SWF if the main window
+ * has not yet been created or does not exist.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get measuredHeight():Number
+ {
+ return topLevelWindow ?
+ topLevelWindow.getExplicitOrMeasuredHeight() :
+ loaderInfo.height;
+ }
+
+ //----------------------------------
+ // measuredWidth
+ //----------------------------------
+
+ /**
+ * The measuredWidth is the explicit or measuredWidth of
+ * the main mx.core.Application window,
+ * or the starting width of the SWF if the main window
+ * has not yet been created or does not exist.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get measuredWidth():Number
+ {
+ return topLevelWindow ?
+ topLevelWindow.getExplicitOrMeasuredWidth() :
+ loaderInfo.width;
+ }
+
+ //----------------------------------
+ // noTopMostIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the noTopMostIndex property.
+ */
+ private var _noTopMostIndex:int = 0;
+
+ /**
+ * @private
+ * The index of the highest child that isn't a topmost/popup window
+ */
+ mx_internal function get noTopMostIndex():int
+ {
+ return _noTopMostIndex;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function set noTopMostIndex(value:int):void
+ {
+ var delta:int = value - _noTopMostIndex;
+ _noTopMostIndex = value;
+ topMostIndex += delta;
+ }
+
+ //----------------------------------
+ // $numChildren
+ //----------------------------------
+
+ /**
+ * @private
+ * This property allows access to the Player's native implementation
+ * of the numChildren property, which can be useful since components
+ * can override numChildren and thereby hide the native implementation.
+ * Note that this "base property" is final and cannot be overridden,
+ * so you can count on it to reflect what is happening at the player level.
+ */
+ mx_internal final function get $numChildren():int
+ {
+ return super.numChildren;
+ }
+
+ //----------------------------------
+ // numModalWindows
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the numModalWindows property.
+ */
+ private var _numModalWindows:int = 0;
+
+ /**
+ * The number of modal windows. Modal windows don't allow
+ * clicking in another windows which would normally
+ * activate the FocusManager in that window. The PopUpManager
+ * modifies this count as it creates and destroys modal windows.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get numModalWindows():int
+ {
+ return _numModalWindows;
+ }
+
+ /**
+ * @private
+ */
+ public function set numModalWindows(value:int):void
+ {
+ _numModalWindows = value;
+ }
+
+ //----------------------------------
+ // preloadedRSLs
+ //----------------------------------
+
+ /**
+ * @inheritDoc
+ *
+ */
+ COMPILE::LATER
+ public function get preloadedRSLs():Dictionary
+ {
+ // Overridden by compiler generate code.
+ return null;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4.5
+ */
+ COMPILE::LATER
+ public function addPreloadedRSL(loaderInfo:LoaderInfo, rsl:Vector.<RSLData>):void
+ {
+ preloadedRSLs[loaderInfo] = rsl;
+ if (hasEventListener(RSLEvent.RSL_ADD_PRELOADED))
+ {
+ var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_ADD_PRELOADED);
+ rslEvent.loaderInfo = loaderInfo;
+ dispatchEvent(rslEvent);
+ }
+
+ }
+
+ //----------------------------------
+ // preloaderBackgroundAlpha
+ //----------------------------------
+
+ /**
+ * The background alpha used by the child of the preloader.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get preloaderBackgroundAlpha():Number
+ {
+ return info()["backgroundAlpha"];
+ }
+
+ //----------------------------------
+ // preloaderBackgroundColor
+ //----------------------------------
+
+ /**
+ * The background color used by the child of the preloader.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get preloaderBackgroundColor():uint
+ {
+ var value:* = info()["backgroundColor"];
+ if (value == undefined)
+ return 0xFFFFFFFF;
+ else
+ return value;
+ }
+
+ //----------------------------------
+ // preloaderBackgroundImage
+ //----------------------------------
+
+ /**
+ * The background color used by the child of the preloader.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get preloaderBackgroundImage():Object
+ {
+ return info()["backgroundImage"];
+ }
+
+ //----------------------------------
+ // preloaderBackgroundSize
+ //----------------------------------
+
+ /**
+ * The background size used by the child of the preloader.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get preloaderBackgroundSize():String
+ {
+ return info()["backgroundSize"];
+ }
+
+ //----------------------------------
+ // popUpChildren
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the popUpChildren property.
+ */
+ private var _popUpChildren:SystemChildrenList;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get popUpChildren():IChildList
+ {
+ if (!topLevel)
+ return _topLevelSystemManager.popUpChildren;
+
+ if (!_popUpChildren)
+ {
+ _popUpChildren = new SystemChildrenList(this,
+ new QName(mx_internal, "noTopMostIndex"),
+ new QName(mx_internal, "topMostIndex"));
+ }
+
+ return _popUpChildren;
+ }
+
+ //----------------------------------
+ // rawChildren
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the rawChildren property.
+ */
+ private var _rawChildren:SystemRawChildrenList;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get rawChildren():IChildList
+ {
+ //if (!topLevel)
+ // return _topLevelSystemManager.rawChildren;
+
+ if (!_rawChildren)
+ _rawChildren = new SystemRawChildrenList(this);
+
+ return _rawChildren;
+ }
+
+ //--------------------------------------------------------------------------
+ // screen
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Storage for the screen property.
+ */
+ mx_internal var _screen:Rectangle;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get screen():Rectangle
+ {
+ if (!_screen)
+ Stage_resizeHandler();
+
+ if (!isStageRoot)
+ {
+ Stage_resizeHandler();
+ }
+ return _screen;
+ }
+
+ //----------------------------------
+ // toolTipChildren
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the toolTipChildren property.
+ */
+ private var _toolTipChildren:SystemChildrenList;
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get toolTipChildren():IChildList
+ {
+ if (!topLevel)
+ return _topLevelSystemManager.toolTipChildren;
+
+ if (!_toolTipChildren)
+ {
+ _toolTipChildren = new SystemChildrenList(this,
+ new QName(mx_internal, "topMostIndex"),
+ new QName(mx_internal, "toolTipIndex"));
+ }
+
+ return _toolTipChildren;
+ }
+
+ //----------------------------------
+ // toolTipIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the toolTipIndex property.
+ */
+ private var _toolTipIndex:int = 0;
+
+ /**
+ * @private
+ * The index of the highest child that is a tooltip
+ */
+ mx_internal function get toolTipIndex():int
+ {
+ return _toolTipIndex;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function set toolTipIndex(value:int):void
+ {
+ var delta:int = value - _toolTipIndex;
+ _toolTipIndex = value;
+ cursorIndex += delta;
+ }
+
+ //----------------------------------
+ // topLevelSystemManager
+ //----------------------------------
+
+ /**
+ * Returns the SystemManager responsible for the application window. This will be
+ * the same SystemManager unless this application has been loaded into another
+ * application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get topLevelSystemManager():ISystemManager
+ {
+ if (topLevel)
+ return this;
+
+ return _topLevelSystemManager;
+ }
+
+ //----------------------------------
+ // topMostIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the topMostIndex property.
+ */
+ private var _topMostIndex:int = 0;
+
+ /**
+ * @private
+ * The index of the highest child that is a topmost/popup window
+ */
+ mx_internal function get topMostIndex():int
+ {
+ return _topMostIndex;
+ }
+
+ mx_internal function set topMostIndex(value:int):void
+ {
+ var delta:int = value - _topMostIndex;
+ _topMostIndex = value;
+ toolTipIndex += delta;
+ }
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: EventDispatcher
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * allows marshal implementation to add events
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal final function $addEventListener(type:String, listener:Function,
+ useCapture:Boolean = false,
+ priority:int = 0,
+ useWeakReference:Boolean = false):void
+ {
+ super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get childAllowsParent():Boolean
+ {
+ try
+ {
+ return loaderInfo.childAllowsParent;
+ }
+ catch (error:Error)
+ {
+ //Error #2099: The loading object is not sufficiently loaded to provide this information.
+ }
+
+ return false; // assume the worst
+ }
+
+ /**
+ * @copy mx.core.ISWFBridgeProvider#parentAllowsChild
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get parentAllowsChild():Boolean
+ {
+ try
+ {
+ return loaderInfo.parentAllowsChild;
+ }
+ catch (error:Error)
+ {
+ //Error #2099: The loading object is not sufficiently loaded to provide this information.
+ }
+
+ return false; // assume the worst
+ }
+
+ /**
+ * @private
+ * Only create idle events if someone is listening.
+ */
+ override public function addEventListener(type:String, listener:Function,
+ useCapture:Boolean = false,
+ priority:int = 0,
+ useWeakReference:Boolean = false):void
+ {
+ if (type == MouseEvent.MOUSE_MOVE || type == MouseEvent.MOUSE_UP || type == MouseEvent.MOUSE_DOWN
+ || type == Event.ACTIVATE || type == Event.DEACTIVATE)
+ {
+ // also listen to stage if allowed
+ try
+ {
+ if (stage)
+ {
+ // Use weak listener because we don't always know when we
+ // no longer need this listener
+ stage.addEventListener(type, stageEventHandler, false, 0, true);
+ }
+ }
+ catch (error:SecurityError)
+ {
+ }
+ }
+
+ if (hasEventListener("addEventListener"))
+ {
+ var request:DynamicEvent = new DynamicEvent("addEventListener", false, true);
+ request.eventType = type;
+ request.listener = listener;
+ request.useCapture = useCapture;
+ request.priority = priority;
+ request.useWeakReference = useWeakReference;
+ if (!dispatchEvent(request))
+ return;
+ }
+
+ COMPILE::LATER
+ {
+ if (type == SandboxMouseEvent.MOUSE_UP_SOMEWHERE)
+ {
+ // If someone wants this event, also listen for mouseLeave.
+ // Use weak listener because we don't always know when we
+ // no longer need this listener
+ try
+ {
+ if (stage)
+ {
+ stage.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+ }
+ else
+ {
+ super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+ }
+ }
+ catch (error:SecurityError)
+ {
+ super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+ }
+ }
+ }
+
+ // These two events will dispatched to applications in sandboxes.
+ if (type == FlexEvent.RENDER || type == FlexEvent.ENTER_FRAME)
+ {
+ if (type == FlexEvent.RENDER)
+ type = Event.RENDER;
+ else
+ type = Event.ENTER_FRAME;
+
+ try
+ {
+ if (stage)
+ stage.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ else
+ super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ }
+ catch (error:SecurityError)
+ {
+ super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ }
+
+ if (stage && type == Event.RENDER)
+ stage.invalidate();
+
+ return;
+ }
+
+ // When the first listener registers for 'idle' events,
+ // create a Timer that will fire every IDLE_INTERVAL.
+ if (type == FlexEvent.IDLE && !idleTimer)
+ {
+ idleTimer = new Timer(IDLE_INTERVAL);
+ idleTimer.addEventListener(TimerEvent.TIMER,
+ idleTimer_timerHandler);
+ idleTimer.start();
+
+ // Make sure we get all activity
+ // in case someone calls stopPropagation().
+ addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler, true);
+ addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler, true);
+ }
+
+ super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal final function $removeEventListener(type:String, listener:Function,
+ useCapture:Boolean = false):void
+ {
+ super.removeEventListener(type, listener, useCapture);
+ }
+
+ /**
+ * @private
+ */
+ override public function removeEventListener(type:String, listener:Function,
+ useCapture:Boolean = false):void
+ {
+ if (hasEventListener("removeEventListener"))
+ {
+ var request:DynamicEvent = new DynamicEvent("removeEventListener", false, true);
+ request.eventType = type;
+ request.listener = listener;
+ request.useCapture = useCapture;
+ if (!dispatchEvent(request))
+ return;
+ }
+
+ // These two events will dispatched to applications in sandboxes.
+ if (type == FlexEvent.RENDER || type == FlexEvent.ENTER_FRAME)
+ {
+ if (type == FlexEvent.RENDER)
+ type = Event.RENDER;
+ else
+ type = Event.ENTER_FRAME;
+
+ try
+ {
+ if (stage)
+ stage.removeEventListener(type, listener, useCapture);
+ }
+ catch (error:SecurityError)
+ {
+ }
+ // Remove both listeners in case the system manager was added
+ // or removed from the stage after the listener was added.
+ super.removeEventListener(type, listener, useCapture);
+
+ return;
+ }
+
+ // When the last listener unregisters for 'idle' events,
+ // stop and release the Timer.
+ if (type == FlexEvent.IDLE)
+ {
+ super.removeEventListener(type, listener, useCapture);
+
+ if (!hasEventListener(FlexEvent.IDLE) && idleTimer)
+ {
+ idleTimer.stop();
+ idleTimer = null;
+
+ removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
+ removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+ }
+ }
+ else
+ {
+ super.removeEventListener(type, listener, useCapture);
+ }
+
+ if (type == MouseEvent.MOUSE_MOVE || type == MouseEvent.MOUSE_UP || type == MouseEvent.MOUSE_DOWN
+ || type == Event.ACTIVATE || type == Event.DEACTIVATE)
+ {
+ if (!hasEventListener(type))
+ {
+ // also listen to stage if allowed
+ try
+ {
+ if (stage)
+ {
+ stage.removeEventListener(type, stageEventHandler, false);
+ }
+ }
+ catch (error:SecurityError)
+ {
+ }
+ }
+ }
+
+ COMPILE::LATER
+ {
+ if (type == SandboxMouseEvent.MOUSE_UP_SOMEWHERE)
+ {
+ if (!hasEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE))
+ {
+ // nobody wants this event any more for now
+ try
+ {
+ if (stage)
+ {
+ stage.removeEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
+ }
+ }
+ catch (error:SecurityError)
+ {
+ }
+ // Remove both listeners in case the system manager was added
+ // or removed from the stage after the listener was added.
+ super.removeEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
+ }
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: DisplayObjectContainer
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function addChild(child:DisplayObject):DisplayObject
+ {
+ var addIndex:int = numChildren;
+ if (child.parent == this)
+ addIndex--;
+
+ return addChildAt(child, addIndex);
+ }
+
+ /**
+ * @private
+ */
+ override public function addChildAt(child:DisplayObject,
+ index:int):DisplayObject
+ {
+ // Adjust the partition indexes before the
+ // "added" event is dispatched.
+ noTopMostIndex = noTopMostIndex + 1;
+
+ var oldParent:DisplayObjectContainer = child.parent;
+ if (oldParent)
+ oldParent.removeChild(child);
+
+ return rawChildren_addChildAt(child, applicationIndex + index);
+ }
+
+ /**
+ * @private
+ *
+ * Used by SystemManagerProxy to add a mouse catcher as a child.
+ */
+ mx_internal final function $addChildAt(child:DisplayObject,
+ index:int):DisplayObject
+ {
+ return super.addChildAt(child, index);
+ }
+
+ /**
+ * @private
+ *
+ * Companion to $addChildAt.
+ */
+ mx_internal final function $removeChildAt(index:int):DisplayObject
+ {
+ return super.removeChildAt(index);
+ }
+
+
+ /**
+ * @private
+ */
+ override public function removeChild(child:DisplayObject):DisplayObject
+ {
+ // Adjust the partition indexes
+ // before the "removed" event is dispatched.
+ noTopMostIndex = noTopMostIndex - 1;
+
+ return rawChildren_removeChild(child);
+ }
+
+ /**
+ * @private
+ */
+ override public function removeChildAt(index:int):DisplayObject
+ {
+ // Adjust the partition indexes
+ // before the "removed" event is dispatched.
+ noTopMostIndex = noTopMostIndex - 1;
+
+ return rawChildren_removeChildAt(applicationIndex + index);
+ }
+
+ /**
+ * @private
+ */
+ override public function getChildAt(index:int):DisplayObject
+ {
+ return super.getChildAt(applicationIndex + index)
+ }
+
+ /**
+ * @private
+ */
+ override public function getChildByName(name:String):DisplayObject
+ {
+ return super.getChildByName(name);
+ }
+
+ /**
+ * @private
+ */
+ override public function getChildIndex(child:DisplayObject):int
+ {
+ return super.getChildIndex(child) - applicationIndex;
+ }
+
+ /**
+ * @private
+ */
+ override public function setChildIndex(child:DisplayObject, newIndex:int):void
+ {
+ super.setChildIndex(child, applicationIndex + newIndex)
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ override public function getObjectsUnderPoint(point:Point):Array
+ {
+ var children:Array = [];
+
+ // Get all the children that aren't tooltips and cursors.
+ var n:int = topMostIndex;
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:DisplayObject = super.getChildAt(i);
+ if (child is DisplayObjectContainer)
+ {
+ var temp:Array =
+ DisplayObjectContainer(child).getObjectsUnderPoint(point);
+
+ if (temp)
+ children = children.concat(temp);
+ }
+ }
+
+ return children;
+ }
+
+ /**
+ * @private
+ */
+ override public function contains(child:DisplayObject):Boolean
+ {
+ if (super.contains(child))
+ {
+ if (child.parent == this)
+ {
+ var childIndex:int = super.getChildIndex(child);
+ if (childIndex < noTopMostIndex)
+ return true;
+ }
+ else
+ {
+ for (var i:int = 0; i < noTopMostIndex; i++)
+ {
+ var myChild:DisplayObject = super.getChildAt(i);
+ if (myChild is IRawChildrenContainer)
+ {
+ if (IRawChildrenContainer(myChild).rawChildren.contains(child))
+ return true;
+ }
+ if (myChild is DisplayObjectContainer)
+ {
+ if (DisplayObjectContainer(myChild).contains(child))
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: IFlexModuleFactory
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This method is overridden in the autogenerated subclass.
+ * It is part of TLF's ISWFContext interface.
+ * Although this class does not declare that it implements this interface,
+ * the autogenerated subclass does.
+ */
+ public function callInContext(fn:Function, thisArg:Object,
+ argArray:Array, returns:Boolean = true):*
+ {
+ return undefined;
+ }
+
+ /**
+ * A factory method that requests an instance of a
+ * definition known to the module.
+ *
+ * You can provide an optional set of parameters to let building
+ * factories change what they create based on the
+ * input. Passing null indicates that the default definition
+ * is created, if possible.
+ *
+ * This method is overridden in the autogenerated subclass.
+ *
+ * @param params An optional list of arguments. You can pass
+ * any number of arguments, which are then stored in an Array
+ * called <code>parameters</code>.
+ *
+ * @return An instance of the module, or <code>null</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function create(... params):Object
+ {
+ var mainClassName:String = info()["mainClassName"];
+
+ if (mainClassName == null)
+ {
+ var url:String = loaderInfo.loaderURL;
+ var dot:int = url.lastIndexOf(".");
+ var slash:int = url.lastIndexOf("/");
+ mainClassName = url.substring(slash + 1, dot);
+ }
+
+ var mainClass:Class = Class(getDefinitionByName(mainClassName));
+
+ return mainClass ? new mainClass() : null;
+ }
+
+ /**
+ * @private
+ */
+ public function info():Object
+ {
+ return {};
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Creates an instance of the preloader, adds it as a child, and runs it.
+ * This is needed by Flash Builder. Do not modify this function.
+ */
+ mx_internal function initialize():void
+ {
+ var runtimeDPIProviderClass:Class = info()["runtimeDPIProvider"] as Class;
+ if (runtimeDPIProviderClass)
+ Singleton.registerClass("mx.core::RuntimeDPIProvider", runtimeDPIProviderClass);
+
+ if (isStageRoot)
+ {
+ // TODO: Finalize scaling behavior
+ Stage_resizeHandler();
+ // _width = stage.stageWidth;
+ // _height = stage.stageHeight;
+ }
+ else
+ {
+ _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);
+ // wait for a complete event. This gives the preloader
+ // a chance to load resource modules before
+ // everything really gets kicked off
+ preloader.addEventListener(Event.COMPLETE,
+ preloader_completeHandler);
+ // when the app is fully backed remove the preloader and show the app
+ preloader.addEventListener(FlexEvent.PRELOADER_DONE,
+ preloader_preloaderDoneHandler);
+ COMPILE::LATER
+ {
+ preloader.addEventListener(RSLEvent.RSL_COMPLETE,
+ preloader_rslCompleteHandler);
+ }
+
+ // Add the preloader as a child. Use backing variable because when loaded
+ // we redirect public API to parent systemmanager
+ if (!_popUpChildren)
+ {
+ _popUpChildren = new SystemChildrenList(
+ this, new QName(mx_internal, "noTopMostIndex"), new QName(mx_internal, "topMostIndex"));
+ }
+ _popUpChildren.addChild(preloader);
+
+ var rsls:Array = info()["rsls"];
+ var cdRsls:Array = info()["cdRsls"];
+ var usePreloader:Boolean = true;
+ if (info()["usePreloader"] != undefined)
+ usePreloader = info()["usePreloader"];
+
+ var preloaderDisplayClass:Class = info()["preloader"] as Class;
+
+ COMPILE::LATER
+ {
+ // Put cross-domain RSL information in the RSL list.
+ var rslItemList:Array = [];
+ var n:int;
+ var i:int;
+ if (cdRsls && cdRsls.length > 0)
+ {
+ if (isTopLevel())
+ rslDataList = cdRsls;
+ else
+ rslDataList = LoaderUtil.processRequiredRSLs(this, cdRsls);
+
+ var normalizedURL:String = LoaderUtil.normalizeURL(this.loaderInfo);
+ var crossDomainRSLItem:Class = Class(getDefinitionByName("mx.core::CrossDomainRSLItem"));
+ n = rslDataList.length;
+ for (i = 0; i < n; i++)
+ {
+ var rslWithFailovers:Array = rslDataList[i];
+
+ // If crossDomainRSLItem is null, then this is a compiler error. It should not be null.
+ var cdNode:Object = new crossDomainRSLItem(rslWithFailovers,
+ normalizedURL,
+ this);
+ rslItemList.push(cdNode);
+ }
+ }
+
+ // Append RSL information in the RSL list.
+ if (rsls != null && rsls.length > 0)
+ {
+ if (rslDataList == null)
+ rslDataList = [];
+
+ if (normalizedURL == null)
+ normalizedURL = LoaderUtil.normalizeURL(this.loaderInfo);
+
+ n = rsls.length;
+ for (i = 0; i < n; i++)
+ {
+ var node:RSLItem = new RSLItem(rsls[i].url,
+ normalizedURL,
+ this);
+ rslItemList.push(node);
+ rslDataList.push([new RSLData(rsls[i].url, null, null, null,
+ false, false, "current")]);
+ }
+ }
+
+ // They can also specify a comma-separated list of URLs
+ // for resource modules to be preloaded during frame 1.
+ var resourceModuleURLList:String =
+ loaderInfo.parameters["resourceModuleURLs"];
+ var resourceModuleURLs:Array =
+ resourceModuleURLList ? resourceModuleURLList.split(",") : null;
+
+ var domain:ApplicationDomain =
+ !topLevel && parent is Loader ?
+ Loader(parent).contentLoaderInfo.applicationDomain :
+ info()["currentDomain"] as ApplicationDomain;
+
+ // Initialize the preloader.
+ preloader.initialize(
+ usePreloader,
+ preloaderDisplayClass,
+ preloaderBackgroundColor,
+ preloaderBackgroundAlpha,
+ preloaderBackgroundImage,
+ preloaderBackgroundSize,
+ isStageRoot ? stage.stageWidth : loaderInfo.width,
+ isStageRoot ? stage.stageHeight : loaderInfo.height,
+ null,
+ null,
+ rslItemList,
+ resourceModuleURLs,
+ domain);
+ }
+
+ // Initialize the preloader.
+ preloader.initialize(
+ usePreloader,
+ preloaderDisplayClass,
+ preloaderBackgroundColor,
+ preloaderBackgroundAlpha,
+ preloaderBackgroundImage,
+ preloaderBackgroundSize,
+ stage.stageWidth,
+ stage.stageHeight,
+ null,
+ null);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Support for rawChildren access
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_addChild(child:DisplayObject):DisplayObject
+ {
+ childManager.addingChild(child);
+
+ super.addChild(child);
+
+ childManager.childAdded(child); // calls child.createChildren()
+
+ return child;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_addChildAt(child:DisplayObject,
+ index:int):DisplayObject
+ {
+ // preloader goes through here before childManager is set up
+ if (childManager)
+ childManager.addingChild(child);
+
+ super.addChildAt(child, index);
+
+ if (childManager)
+ childManager.childAdded(child); // calls child.createChildren()
+
+ return child;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_removeChild(child:DisplayObject):DisplayObject
+ {
+ childManager.removingChild(child);
+ super.removeChild(child);
+ childManager.childRemoved(child);
+
+ return child;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_removeChildAt(index:int):DisplayObject
+ {
+ var child:DisplayObject = super.getChildAt(index);
+
+ childManager.removingChild(child);
+
+ super.removeChildAt(index);
+
+ childManager.childRemoved(child);
+
+ return child;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_getChildAt(index:int):DisplayObject
+ {
+ return super.getChildAt(index);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_getChildByName(name:String):DisplayObject
+ {
+ return super.getChildByName(name);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_getChildIndex(child:DisplayObject):int
+ {
+ return super.getChildIndex(child);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_setChildIndex(child:DisplayObject, newIndex:int):void
+ {
+ super.setChildIndex(child, newIndex);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_getObjectsUnderPoint(pt:Point):Array
+ {
+ return super.getObjectsUnderPoint(pt);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function rawChildren_contains(child:DisplayObject):Boolean
+ {
+ return super.contains(child);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Security
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Calls Security.allowDomain() for the SWF associated with this SystemManager
+ * plus all the SWFs assocatiated with RSLs preloaded by this SystemManager.
+ *
+ */
+ public function allowDomain(... domains):void
+ {
+ // Overridden by compiler generated code.
+ }
+
+ /**
+ * Calls Security.allowInsecureDomain() for the SWF associated with this SystemManager
+ * plus all the SWFs assocatiated with RSLs preloaded by this SystemManager.
+ *
+ */
+ public function allowInsecureDomain(... domains):void
+ {
+ // Overridden by compiler generated code.
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Measurement and Layout
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * A convenience method for determining whether to use the
+ * explicit or measured width.
+ *
+ * @return A Number that is the <code>explicitWidth</code> if defined,
+ * or the <code>measuredWidth</code> property if not.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getExplicitOrMeasuredWidth():Number
+ {
+ return !isNaN(explicitWidth) ? explicitWidth : measuredWidth;
+ }
+
+ /**
+ * A convenience method for determining whether to use the
+ * explicit or measured height.
+ *
+ * @return A Number that is the <code>explicitHeight</code> if defined,
+ * or the <code>measuredHeight</code> property if not.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getExplicitOrMeasuredHeight():Number
+ {
+ return !isNaN(explicitHeight) ? explicitHeight : measuredHeight;
+ }
+
+ /**
+ * Calling the <code>move()</code> method
+ * has no effect as it is directly mapped
+ * to the application window or the loader.
+ *
+ * @param x The new x coordinate.
+ *
+ * @param y The new y coordinate.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function move(x:Number, y:Number):void
+ {
+ }
+
+ /**
+ * Calling the <code>setActualSize()</code> method
+ * has no effect if it is directly mapped
+ * to the application window and if it is the top-level window.
+ * Otherwise attempts to resize itself, clipping children if needed.
+ *
+ * @param newWidth The new width.
+ *
+ * @param newHeight The new height.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setActualSize(newWidth:Number, newHeight:Number):void
+ {
+ if (isStageRoot) return;
+
+ // mouseCatcher is a mask if not stage root
+ // sometimes it is not in sync so we always
+ // sync it up
+ if (mouseCatcher)
+ {
+ mouseCatcher.width = newWidth;
+ mouseCatcher.height = newHeight;
+ }
+
+ if (_width != newWidth || _height != newHeight)
+ {
+ _width = newWidth;
+ _height = newHeight;
+
+ dispatchEvent(new Event(Event.RESIZE));
+ }
+ }
+
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Other
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getDefinitionByName(name:String):Object
+ {
+ var domain:ApplicationDomain =
+ !topLevel && parent is Loader ?
+ Loader(parent).contentLoaderInfo.applicationDomain :
+ info()["currentDomain"] as ApplicationDomain;
+
+ //trace("SysMgr.getDefinitionByName domain",domain,"currentDomain",info()["currentDomain"]);
+
+ var definition:Object;
+
+ if (domain.hasDefinition(name))
+ {
+ definition = domain.getDefinition(name);
+ //trace("SysMgr.getDefinitionByName got definition",definition,"name",name);
+ }
+
+ return definition;
+ }
+
+ /**
+ * Returns the root DisplayObject of the SWF that contains the code
+ * for the given object.
+ *
+ * @param object Any Object.
+ *
+ * @return The root DisplayObject
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getSWFRoot(object:Object):DisplayObject
+ {
+ var className:String = getQualifiedClassName(object);
+
+ COMPILE::LATER
+ {
+ for (var p:* in allSystemManagers)
+ {
+ var sm:ISystemManager = p as ISystemManager;
+ var domain:ApplicationDomain = sm.loaderInfo.applicationDomain;
+ try
+ {
+ var cls:Class = Class(domain.getDefinition(className));
+ if (object is cls)
+ return sm as DisplayObject;
+ }
+ catch(e:Error)
+ {
+ }
+ }
+ return null;
+ }
+ return SystemManagerGlobals.topLevelSystemManagers[0] as DisplayObject;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isTopLevel():Boolean
+ {
+ return topLevel;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isTopLevelRoot():Boolean
+ {
+ return isStageRoot || isBootstrapRoot;
+ }
+
+ /**
+ * Determines if the given DisplayObject is the
+ * top-level window.
+ *
+ * @param object The DisplayObject to test.
+ *
+ * @return <code>true</code> if the given DisplayObject is the
+ * top-level window.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isTopLevelWindow(object:DisplayObject):Boolean
+ {
+ return object is IUIComponent &&
+ IUIComponent(object) == topLevelWindow;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function isFontFaceEmbedded(textFormat:TextFormat):Boolean
+ {
+ var fontName:String = textFormat.font;
+ var bold:Boolean = textFormat.bold;
+ var italic:Boolean = textFormat.italic;
+
+ var fontList:Array = Font.enumerateFonts();
+
+ var n:int = fontList.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var font:Font = Font(fontList[i]);
+ if (font.fontName == fontName)
+ {
+ var style:String = "regular";
+ if (bold && italic)
+ style = "boldItalic";
+ else if (bold)
+ style = "bold";
+ else if (italic)
+ style = "italic";
+
+ if (font.fontStyle == style)
+ return true;
+ }
+ }
+
+ if (!fontName ||
+ !embeddedFontList ||
+ !embeddedFontList[fontName])
+ {
+ return false;
+ }
+
+ var info:Object = embeddedFontList[fontName];
+
+ return !((bold && !info.bold) ||
+ (italic && !info.italic) ||
+ (!bold && !italic && !info.regular));
+ }
+
+ /**
+ * @private
+ * Makes the mouseCatcher the same size as the stage,
+ * filling it with transparent pixels.
+ */
+ private function resizeMouseCatcher():void
+ {
+ if (mouseCatcher)
+ {
+ try
+ {
+ var g:Graphics = mouseCatcher.graphics;
+ var s:Rectangle = screen;
+ g.clear();
+ g.beginFill(0x000000, 0);
+ g.drawRect(0, 0, s.width, s.height);
+ g.endFill();
+ }
+ catch (e:SecurityError)
+ {
+ // trace("resizeMouseCatcher: ignoring security error " + e);
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private function initHandler(event:Event):void
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.markTime("SystemManager.initHandler().start");
+ }
+
+ // we can still be the top level root if we can access our
+ // 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
+ {
+ allSystemManagers[this] = this.loaderInfo.url;
+ }
+ root.loaderInfo.removeEventListener(Event.INIT, initHandler);
+
+ if (!SystemManagerGlobals.info)
+ SystemManagerGlobals.info = info();
+ if (!SystemManagerGlobals.parameters)
+ SystemManagerGlobals.parameters = loaderInfo.parameters;
+
+ var docFrame:int = (totalFrames == 1)? 0 : 1;
+ addEventListener(Event.ENTER_FRAME, docFrameListener);
+
+ /*
+ addFrameScript(docFrame, docFrameHandler);
+ for (var f:int = docFrame + 1; f < totalFrames; ++f)
+ {
+ addFrameScript(f, extraFrameHandler);
+ }
+ */
+
+ initialize();
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("SystemManager.initHandler().end");
+ }
+ }
+
+ private function docFrameListener(event:Event):void
+ {
+ if (currentFrame == 2)
+ {
+ removeEventListener(Event.ENTER_FRAME, docFrameListener);
+ if (totalFrames > 2)
+ addEventListener(Event.ENTER_FRAME, extraFrameListener);
+
+ docFrameHandler();
+ }
+ }
+
+ private function extraFrameListener(event:Event):void
+ {
+ if (lastFrame == currentFrame)
+ return;
+
+ lastFrame = currentFrame;
+
+ if (currentFrame + 1 > totalFrames)
+ removeEventListener(Event.ENTER_FRAME, extraFrameListener);
+
+ extraFrameHandler();
+ }
+
+ /**
+ * @private
+ * Once the swf has been fully downloaded,
+ * advance the playhead to the next frame.
+ * This will cause the framescript to run, which runs frameEndHandler().
+ */
+ private function preloader_preloaderDocFrameReadyHandler(event:Event):void
+ {
+ // Advance the next frame
+ preloader.removeEventListener(FlexEvent.PRELOADER_DOC_FRAME_READY,
+ preloader_preloaderDocFrameReadyHandler);
+
+ deferredNextFrame();
+ }
+
+ /**
+ * @private
+ * Remove the preloader and add the application as a child.
+ */
+ private function preloader_preloaderDoneHandler(event:Event):void
+ {
+ var app:IUIComponent = topLevelWindow;
+
+ // Once the preloader dispatches the PRELOADER_DONE event, remove the preloader
+ // and add the application as the child
+ preloader.removeEventListener(FlexEvent.PRELOADER_DONE,
+ preloader_preloaderDoneHandler);
+ COMPILE::LATER
+ {
+ preloader.removeEventListener(RSLEvent.RSL_COMPLETE,
+ preloader_rslCompleteHandler);
+ }
+
+ _popUpChildren.removeChild(preloader);
+ preloader = null;
+
+ // Add the mouseCatcher as child 0.
+ mouseCatcher = new UIBase();
+ 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();
+ if (!topLevel)
+ {
+ mouseCatcher.visible = false;
+ mask = mouseCatcher;
+ }
+
+ // Add the application as child 1.
+ noTopMostIndex = noTopMostIndex + 1;
+ super.addChildAt(DisplayObject(app), 1);
+
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.markTime("APPLICATION_COMPLETE");
+ perfUtil.finishSampling("Application Startup");
+ }
+
+ // Dispatch the applicationComplete event from the Application
+ // and then agaom from the SystemManager
+ // (so that loading apps know we're done).
+ app.dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
+ dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_COMPLETE));
+ }
+
+ /**
+ * @private
+ * The preloader has completed loading an RSL.
+ */
+ COMPILE::LATER
+ private function preloader_rslCompleteHandler(event:RSLEvent):void
+ {
+ if (!event.isResourceModule && event.loaderInfo)
+ {
+ var rsl:Vector.<RSLData> = Vector.<RSLData>(rslDataList[event.rslIndex]);
+ var moduleFactory:IFlexModuleFactory = this;
+ if (rsl && rsl[0].moduleFactory)
+ moduleFactory = rsl[0].moduleFactory;
+
+ if (moduleFactory == this)
+ preloadedRSLs[event.loaderInfo] = rsl;
+ else
+ moduleFactory.addPreloadedRSL(event.loaderInfo, rsl);
+ }
+ }
+
+ /**
+ * @private
+ * This is attached as the framescript at the end of frame 2.
+ * 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();
+ }
+
+ /**
+ * @private
+ * kick off if we're ready
+ */
+ mx_internal function preloader_completeHandler(event:Event):void
+ {
+ preloader.removeEventListener(Event.COMPLETE,
+ preloader_completeHandler);
+ readyForKickOff = true;
+ if (currentFrame >= 2)
+ kickOff();
+ }
+
+ /**
+ * @private
+ * kick off
+ */
+ mx_internal function kickOff():void
+ {
+ // already been here
+ if (document)
+ return;
+
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.markTime("SystemManager.kickOff().start");
+ }
+
+ 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")));
+
+ Singleton.registerClass("mx.styles::IStyleManager",
+ Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
+
+ Singleton.registerClass("mx.styles::IStyleManager2",
+ Class(getDefinitionByName("mx.styles::StyleManagerImpl")));
+
+ // Register other singleton classes.
+ // Note: getDefinitionByName() will return null
+ // if the class can't be found.
+
+ Singleton.registerClass("mx.managers::IBrowserManager",
+ Class(getDefinitionByName("mx.managers::BrowserManagerImpl")));
+
+ Singleton.registerClass("mx.managers::ICursorManager",
+ Class(getDefinitionByName("mx.managers::CursorManagerImpl")));
+
+ Singleton.registerClass("mx.managers::IHistoryManager",
+ Class(getDefinitionByName("mx.managers::HistoryManagerImpl")));
+
+ Singleton.registerClass("mx.managers::ILayoutManager",
+ Class(getDefinitionByName("mx.managers::LayoutManager")));
+
+ Singleton.registerClass("mx.managers::IPopUpManager",
+ Class(getDefinitionByName("mx.managers::PopUpManagerImpl")));
+
+ Singleton.registerClass("mx.managers::IToolTipManager2",
+ Class(getDefinitionByName("mx.managers::ToolTipManagerImpl")));
+
+ var dragManagerClass:Class = null;
+
+ // Make this call to create a new instance of the DragManager singleton.
+ // Try to link in the NativeDragManager first. This will allow the
+ // application to receive NativeDragEvents that originate from the
+ // desktop. If it can't be found, then we're
+ // not in AIR, and it can't be linked in, so we should just work off of
+ // the regular Flex DragManager.
+ var dmInfo:Object = info()["useNativeDragManager"];
+
+ var useNative:Boolean = dmInfo == null ? true : String(dmInfo) == "true";
+
+ if (useNative)
+ dragManagerClass = Class(getDefinitionByName("mx.managers::NativeDragManagerImpl"));
+
+ if (dragManagerClass == null)
+ dragManagerClass = Class(getDefinitionByName("mx.managers::DragManagerImpl"));
+
+ Singleton.registerClass("mx.managers::IDragManager", dragManagerClass);
+
+ Singleton.registerClass("mx.core::ITextFieldFactory",
+ Class(getDefinitionByName("mx.core::TextFieldFactory")));
+
+ var mixinList:Array = info()["mixins"];
+ if (mixinList && mixinList.length > 0)
+ {
+ var n:int = mixinList.length;
+ for (var i:int = 0; i < n; ++i)
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var token:int = perfUtil.markStart();
+ }
+
+ // trace("initializing mixin " + mixinList[i]);
+ var c:Class = Class(getDefinitionByName(mixinList[i]));
+ c["init"](this);
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markEnd(mixinList[i], token);
+ }
+ }
+ }
+
+ c = Singleton.getClass("mx.managers::IActiveWindowManager");
+ if (c)
+ {
+ registerImplementation("mx.managers::IActiveWindowManager", new c(this));
+
<TRUNCATED>
[04/37] git commit: [flex-asjs] [refs/heads/spark] - add some event
constants
Posted by ah...@apache.org.
add some event constants
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/bd3bcce2
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/bd3bcce2
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/bd3bcce2
Branch: refs/heads/spark
Commit: bd3bcce273029261077dd49912748c8c774f3f8b
Parents: 9b3809c
Author: Alex Harui <ah...@apache.org>
Authored: Fri Feb 12 15:00:58 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Feb 12 15:00:58 2016 -0800
----------------------------------------------------------------------
.../main/flex/org/apache/flex/core/UIBase.as | 30 ++++++++++++++++++++
1 file changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bd3bcce2/frameworks/projects/Core/src/main/flex/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/UIBase.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/UIBase.as
index 0cd6a7c..2465a40 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/UIBase.as
@@ -140,6 +140,36 @@ package org.apache.flex.core
*/
public class UIBase extends HTMLElementWrapper implements IStrandWithModel, IEventDispatcher, IParentIUIBase, IStyleableObject, ILayoutChild, IFlexJSElement
{
+ /**
+ * Constant for the childAdded event
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const CHILD_ADDED:String = "childAdded";
+
+ /**
+ * Constant for the childRemoved event
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const CHILD_REMOVED:String = "childRemoved";
+
+ /**
+ * Constant for the sizeChanged event
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const SIZE_CHANGED = "sizeChanged";
+
/**
* Constructor.
*
[10/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/MediaQueryParser.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/MediaQueryParser.as b/frameworks/projects/MX/src/main/flex/mx/utils/MediaQueryParser.as
new file mode 100644
index 0000000..6bc5801
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/MediaQueryParser.as
@@ -0,0 +1,642 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+import org.apache.flex.events.Event;
+import org.apache.flex.events.EventDispatcher;
+import org.apache.flex.core.UIBase;
+import flash.system.Capabilities;
+import mx.core.IFlexModuleFactory;
+import mx.core.mx_internal;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManagerGlobals;
+import mx.styles.CSSDimension;
+import mx.styles.CSSOSVersion;
+import mx.styles.IStyleManager2;
+import mx.styles.StyleManager;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * Parser for CSS Media Query syntax. Not a full-fledged parser.
+ * Doesn't report syntax errors, assumes you have your attributes
+ * and identifiers spelled correctly, etc.
+ * Media query parser now supports os-version selectors such as X, X.Y or X.Y.Z
+ * Note that version with 2 or 3 parts must be quoted
+Examples:
+ (os-platform: "ios") AND (min-os-version: 7)
+ (os-platform: "android") AND (min-os-version: "4.1.2")
+
+ non standard selectors:
+ -flex-device-diagonal
+ -flex-min-device-diagonal
+
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+public class MediaQueryParser extends EventDispatcher
+{
+ /**
+ * @private
+ * Table of known media types
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ public static var platformMap:Object =
+ {
+ AND: "android",
+ IOS: "ios",
+ MAC: "macintosh",
+ WIN: "windows",
+ LNX: "linux",
+ QNX: "qnx"
+ }
+
+ /**
+ * @private
+ */
+ private static var _instance:MediaQueryParser;
+
+ /**
+ * Single shared instance of the parser
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ public static function get instance():MediaQueryParser
+ {
+ return _instance;
+ }
+
+ /**
+ * @private
+ */
+ public static function set instance(value:MediaQueryParser):void
+ {
+ if (!_instance)
+ _instance = value;
+ }
+
+ /**
+ * @private
+ * Constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ public function MediaQueryParser(moduleFactory:IFlexModuleFactory = null)
+ {
+ applicationDpi = DensityUtil.getRuntimeDPI();
+ if (moduleFactory)
+ {
+ if (moduleFactory.info()["applicationDPI"] != null)
+ applicationDpi = moduleFactory.info()["applicationDPI"];
+ if (moduleFactory is ISystemManager){
+ sm = ISystemManager(moduleFactory);
+ if (sm.topOfDisplayList)
+ sm.topOfDisplayList.addEventListener(UIBase.SIZE_CHANGED, stage_resizeHandler, false);
+ }
+ }
+ osPlatform = getPlatform();
+ osVersion = getOSVersion();
+ // compute device DPI
+ deviceDPI = Capabilities.screenDPI;
+ // compute width, height and diagonal
+ computeDeviceDimensions( );
+
+ }
+
+ /**
+ * Queries that were true
+ */
+ mx_internal var goodQueries:Object = {};
+
+ /**
+ * Queries that were false
+ */
+ mx_internal var badQueries:Object = {};
+
+ /**
+ * system manager for the MQP to compute device dimensions
+ */
+ private var sm: ISystemManager;
+
+ /** flags are set if device-width / device height are used in any media query.
+ * This is an optimization, so that we know when it's necessary to regenerate styles
+ * */
+ private var usesDeviceWidth: Boolean = false ;
+ private var usesDeviceHeight: Boolean =false;
+ private var usesDeviceDiagonal: Boolean = false;
+
+ /**
+ * @private
+ * Main entry point.
+ *
+ * @param expression A syntactically correct CSS Media Query
+ * @returns true if valid for this media, false otherwise
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Flex 4.5
+ */
+ public function parse(expression:String):Boolean
+ {
+ // remove whitespace
+ expression = StringUtil.trim(expression);
+
+ // degenerate expressions
+ if (expression == "") return true;
+
+ // known queries
+ if (goodQueries[expression]) return true;
+ if (badQueries[expression]) return false;
+
+ // force to lower case cuz case-insensitive
+ var originalExpression:String = expression;
+ expression = expression.toLowerCase();
+
+ //TODO : be smart and do not do a lowercase to do this test
+ if (expression == "all") return true;
+
+ // get a list of queries. If any pass then
+ // we're good
+ var mediaQueries:Array = expression.split(", ");
+ var n:int = mediaQueries.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var result:Boolean;
+ var mediaQuery:String = mediaQueries[i];
+ var notFlag:Boolean = false;
+ // eat only
+ if (mediaQuery.indexOf("only ") == 0)
+ mediaQuery = mediaQuery.substr(5);
+ // remember if this is a "not" expression
+ if (mediaQuery.indexOf("not ") == 0)
+ {
+ notFlag = true;
+ mediaQuery = mediaQuery.substr(4);
+ }
+ // get a list of the parts of the query.
+ // it should be media type, optionally
+ // followed by "and" followed by
+ // optional media feature expressions
+ var expressions:Array = tokenizeMediaQuery(mediaQuery);
+ var numExpressions:int = expressions.length;
+ if (expressions[0] == "all" || expressions[0] == type)
+ {
+ if (numExpressions == 1 && !notFlag)
+ {
+ goodQueries[originalExpression] = true;
+ return true;
+ }
+ // bail if "and" and no media features (invalid query)
+ if (numExpressions == 2) return false;
+ // kick off the type and "and"
+ expressions.shift();
+ expressions.shift();
+ // see if the media features match
+ result = evalExpressions(expressions);
+ // early exit if it returned true;
+ if ((result && !notFlag) || (!result && notFlag))
+ {
+ goodQueries[originalExpression] = true;
+ return true;
+ }
+ }
+ // if we didn't match on media type and we have a notFlag
+ // then we match
+ else if (notFlag)
+ {
+ goodQueries[originalExpression] = true;
+ return true;
+ }
+ }
+ badQueries[originalExpression] = true;
+ return false;
+ }
+
+ // break up the expression into pieces
+ private function tokenizeMediaQuery(mediaQuery:String):Array
+ {
+ var tokens:Array = [];
+ // if leading off with "(" then
+ // "all and" is implied
+ var pos:int = mediaQuery.indexOf("(");
+ if (pos == 0)
+ {
+ tokens.push("all");
+ tokens.push("and");
+ }
+ else if (pos == -1)
+ {
+ // no parens means the whole thing should
+ // be the media type
+ return [ mediaQuery ];
+ }
+
+ var parenLevel:int = 0;
+ var inComment:Boolean = false;
+ var n:int = mediaQuery.length;
+ var expression:Array = [];
+ // walk through each character looking for the pieces
+ for (var i:int = 0; i < n; i++)
+ {
+ var c:String = mediaQuery.charAt(i);
+ if (StringUtil.isWhitespace(c) && expression.length == 0)
+ {
+ // eat extra whitespace between tokens
+ continue;
+ }
+ else
+ {
+ // this piece should be the media type
+ if (c == '/' && i < n - 1 && mediaQuery.charAt(i + 1) == '*')
+ {
+ inComment = true;
+ i++;
+ continue;
+ }
+ if (inComment)
+ {
+ if (c == '*' && i < n - 1 && mediaQuery.charAt(i + 1) == '/')
+ {
+ inComment = false;
+ i++;
+ }
+ continue;
+ }
+ else if (c == "(") // Not sure whether these should be in the “else” here?
+ parenLevel++;
+ else if (c == ")")
+ parenLevel--;
+ else
+ {
+ expression.push(c);
+ }
+
+ // If we found whitespace and not in a paren, or just closed a paren,
+ // then that's the end of an expression
+ if (parenLevel == 0 && (StringUtil.isWhitespace(c) || (c == ")")))
+ {
+ if (c != ")")
+ expression.length--;
+ tokens.push(expression.join(""));
+ expression.length = 0; // reset
+ }
+
+ }
+ }
+ return tokens;
+ }
+
+ // take a media feature expression and evaluate it
+ private function evalExpressions(expressions:Array):Boolean
+ {
+ var n:int = expressions.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var expr:String = expressions[i];
+ // skip over "and"
+ if (expr == "and")
+ continue;
+
+ // break into two pieces
+ var parts:Array = expr.split(":");
+ var key: String = parts[0];
+ var min:Boolean = false;
+ var max:Boolean = false;
+ var flex: Boolean = false;
+
+ // process custom selectors
+ if (key.indexOf("-flex-") == 0){
+ flex =true;
+ key = key.substr(6);
+ }
+
+ // look for min
+ if (key.indexOf("min-") == 0)
+ {
+ min = true;
+ key = key.substr(4);
+ }
+ // look for max
+ else if (key.indexOf("max-") == 0)
+ {
+ max = true;
+ key = key.substr(4);
+ }
+ // collapse hypens into camelcase ;
+ if (key.indexOf("-") > 0)
+ key = deHyphenate(key, flex);
+
+ if ( key == "deviceWidth")
+ usesDeviceWidth = true;
+ else if (key =="deviceHeight" )
+ usesDeviceHeight = true;
+ else if (key == "flexDeviceDiagonal")
+ usesDeviceDiagonal = true;
+
+ // if only one part, then it only matters that this property exists
+ if (parts.length == 1)
+ {
+ if (!(key in this))
+ return false;
+ }
+ // if two parts, then make sure the property exists and value matches
+ if (parts.length == 2)
+ {
+ // if property doesn't exist, then bail
+ if (!(key in this))
+ return false;
+ var value: Object = normalize(parts[1], this[key]) ;
+ var cmp: int = compareValues(this[key], value) ;
+ // handle min (we don't check if min is allowed for this property)
+ if (min)
+ {
+ if (cmp < 0)
+ return false;
+ }
+ // handle max (we don't check if min is allowed for this property)
+ else if (max)
+ {
+ if (cmp > 0)
+ return false;
+ }
+ // bail if the value doesn't match
+ else if (cmp != 0)
+ {
+ return false;
+ }
+ }
+
+ }
+ // all parts matched so return true
+ return true;
+ }
+
+ // strip off unit if currentValue is Number or int
+ // now supports versions (X.Y.Z) and numbers with units
+ private function normalize(s:String, currentValue: Object ):Object
+ {
+ var index:int;
+
+ // strip leading white space
+ if (s.charAt(0) == " ")
+ s = s.substr(1);
+
+ // for the numbers we currently handle, we
+ // might find dpi or ppi on it, that we just strip off.
+ // We don't handle dpcm yet.
+ if (currentValue is Number)
+ {
+ index = s.indexOf("dpi");
+ if (index != -1)
+ {
+ s = s.substr(0, index);
+ }
+ return Number(s);
+ }
+ else if (currentValue is int)
+ {
+ return int(s);
+ }
+ // string or CSS value
+ // strip quotes of strings
+ if (s.indexOf('"') == 0) {
+ if (s.lastIndexOf('"') == s.length - 1)
+ s = s.substr(1, s.length - 2);
+ else
+ s = s.substr(1);
+ }
+ // string , return
+ if (currentValue is String)
+ {
+ return s;
+ }
+ else if (currentValue is CSSOSVersion) {
+ return new CSSOSVersion(s) ;
+ }
+ else if (currentValue is CSSDimension) {
+ var matches: Array = s.match(/([\d\.]+)(in|cm|dp|pt|px|)$/); // decimal number following by either units or no unit
+ if (matches!= null && matches.length == 3) {
+ var unit: String = matches[2];
+ var refDPI: Number = unit == CSSDimension.UNIT_DP ? applicationDpi : deviceDPI ; // DPI use applicationDPI for conversion
+ return new CSSDimension(Number(matches[1]), refDPI,unit );
+ }
+ else {
+ throw new Error("Unknown unit in css media query:" + s); //TODO NLS Error message
+ return s;
+ }
+
+ }
+ return s;
+ }
+
+ /** @private
+ * Compares current value with test values, using currentValue type to determine comparison function
+ * accepts number, int, string and CSSOSVersion.
+ * Will accept LexicalUnit in the future
+ *
+ * @param currentValue
+ * @param testValue
+ * @return -1 if currentValue < testValue, 1 if currentValue > testValue and 0 if equal
+ */
+ private function compareValues ( currentValue: Object, testValue: Object): int
+ {
+ if (currentValue is CSSOSVersion)
+ return CSSOSVersion(currentValue).compareTo(CSSOSVersion(testValue)) ;
+ else if (currentValue is CSSDimension)
+ return CSSDimension(currentValue).compareTo(CSSDimension(testValue));
+ else // scalar compare operators
+ if ( currentValue == testValue)
+ return 0;
+ else if ( currentValue < testValue)
+ return -1;
+ else
+ return 1;
+ }
+
+ // collapse "-" to camelCase
+ private function deHyphenate(s:String, flex: Boolean):String
+ {
+ var i:int = s.indexOf("-");
+ var part: String;
+ var c: String;
+
+ while (i > 0)
+ {
+ part = s.substr(i + 1);
+ s = s.substr(0, i);
+ c = (part.charAt(0)).toUpperCase();
+ s += c + part.substr(1);
+ i = s.indexOf("-");
+ }
+ // if flex, camel case and prefix with flex
+ if (flex){
+ c = (s.charAt(0)).toUpperCase();
+ s = "flex" + c + s.substr(1);
+ }
+ return s;
+ }
+
+ private function getPlatform():String
+ {
+ var s:String = Capabilities.version.substr(0, 3);
+ // if there is a friendly name, then use it
+ if (platformMap.hasOwnProperty(s))
+ return platformMap[s] as String;
+
+ // otherwise match against the 3 characters.
+ // use lower case because match are case
+ // insensitive and we lower case the entire
+ // expression
+ return s.toLowerCase();
+ }
+
+ /** @private
+ * returns a CSSOSVersion suitable for MediaQueryParser for the current device operating system version.
+ * */
+ private function getOSVersion():CSSOSVersion {
+ return new CSSOSVersion(Platform.osVersion) ;
+ }
+
+ /** @private recompute device dimension
+ *
+ * @return true if any dimension that is used in media queries has changed, and styles need to be regenerated
+ * we ignore changes to deviceDiagonal on purpose, so that only changing
+ */
+ private function computeDeviceDimensions(): Boolean
+ {
+ if (sm) {
+ var w: Number = sm.topOfDisplayList.stageWidth;
+ var h: Number = sm.topOfDisplayList.stageHeight;
+ var diag: Number = Math.sqrt(w * w + h * h);
+
+ // we need to update styles if device-width is used and has changed or device-height is used and has changed
+ // for example after switching orientation or going fullscreen
+ // we ignore changes to device diagonal on purpose
+
+ var needToUpdateStyles: Boolean = (usesDeviceWidth && w != deviceWidth.pixelValue) || (usesDeviceHeight && h != deviceHeight.pixelValue) ;
+
+ deviceWidth = new CSSDimension(w, deviceDPI);
+ deviceHeight = new CSSDimension(h, deviceDPI);
+ flexDeviceDiagonal = new CSSDimension( diag, deviceDPI );
+
+ return needToUpdateStyles;
+ }
+ return false;
+ }
+
+ private function stage_resizeHandler(event: Event): void
+ {
+ if (computeDeviceDimensions()) {
+ // reinit query cache then reload styles
+ goodQueries = {};
+ badQueries = {};
+ reinitApplicationStyles();
+ }
+
+ }
+
+ private function reinitApplicationStyles( ):void {
+
+ var styleManager: IStyleManager2 = StyleManager.getStyleManager(sm);
+
+ styleManager.stylesRoot = null;
+ styleManager.initProtoChainRoots();
+
+ var sms: Array = SystemManagerGlobals.topLevelSystemManagers;
+ var n: int = sms.length;
+ var i: int;
+
+ // Type as Object to avoid dependency on SystemManager.
+ var sm: ISystemManager;
+ var cm: Object;
+
+ // Regenerate all the proto chains
+ // for all objects in the application.
+ for (i = 0; i < n; i++) {
+ sm = sms[i];
+ cm = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ cm.regenerateStyleCache(true);
+ }
+
+ for (i = 0; i < n; i++) {
+ sm = sms[i];
+ cm = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ cm.notifyStyleChangeInChildren(null, true); // all styles
+ }
+ }
+
+ /* real device DPI, use for converting physical units */
+ private var deviceDPI: Number ;
+
+ // the type of the media
+ public var type:String = "screen";
+
+ // the resolution of the media
+ public var applicationDpi:Number;
+
+ // the platform of the media
+ public var osPlatform:String;
+
+ // the platform os version of the media
+ public var osVersion: CSSOSVersion;
+
+ /**
+ * Physical device width.
+ * matches "device-width" selector.
+ */
+ [Bindable]
+ public var deviceWidth: CSSDimension ;
+
+ /**
+ * Physical device height.
+ * matches "device-height" selector
+ */
+ [Bindable]
+ public var deviceHeight: CSSDimension;
+
+ /**
+ * Physical device diagonal.
+ * matches "-flex-device-diagonal" selector
+ * prefixed by "-flex" because it's not W3C standard
+ *
+ */
+ public var flexDeviceDiagonal: CSSDimension;
+
+}
+}
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/NameUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/NameUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/NameUtil.as
new file mode 100644
index 0000000..e8f0823
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/NameUtil.as
@@ -0,0 +1,187 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.display.DisplayObject;
+import flash.utils.getQualifiedClassName;
+import mx.core.IRepeaterClient;
+
+/**
+ * The NameUtil utility class defines static methods for
+ * creating names for Flex objects.
+ * You do not create instances of NameUtil;
+ * instead you call static methods of the class, such as
+ * the <code>NameUtil.createName()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class NameUtil
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static var counter:int = 0;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates a unique name for any Object instance, such as "Button12", by
+ * combining the unqualified class name with an incrementing counter.
+ *
+ * @param object Object requiring a name.
+ *
+ * @return String containing the unique name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function createUniqueName(object:Object):String
+ {
+ if (!object)
+ return null;
+
+ var name:String = getQualifiedClassName(object);
+
+ // If there is a package name, strip it off.
+ var index:int = name.indexOf("::");
+ if (index != -1)
+ name = name.substr(index + 2);
+
+ // If the class name ends with a digit (which some autogenerated
+ // classes do), then append an underscore before appending
+ // the counter.
+ var charCode:int = name.charCodeAt(name.length - 1);
+ if (charCode >= 48 && charCode <= 57)
+ name += "_";
+
+ return name + counter++;
+ }
+
+ /**
+ * Returns a string, such as
+ * "MyApplication0.addressForm.lastName.TextField17",
+ * for a DisplayObject object that indicates its position in the
+ * hierarchy of DisplayObject objects in an application.
+ *
+ * @param displayObject A DisplayObject object whose hierarchy in the application
+ * is desired.
+ *
+ * @return String containing the position of <code>displayObject</code>
+ * in the hierarchy of DisplayObject objects in an application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function displayObjectToString(
+ displayObject:DisplayObject):String
+ {
+ var result:String;
+
+ // Start at the specified object and walk up the parent chain
+ // to build up the string to return.
+ try
+ {
+ for (var o:DisplayObject = displayObject;
+ o != null;
+ o = o.parent)
+ {
+ // If this object is in the display tree,
+ // stop after we've prepended the topmost Application instance.
+ if (o.parent && o.stage && o.parent == o.stage)
+ break;
+
+ // Prefer id over name if specified.
+ var s:String = "id" in o && o["id"] ? o["id"] : o.name;
+
+ if (o is IRepeaterClient)
+ {
+ var indices:Array = IRepeaterClient(o).instanceIndices;
+ if (indices)
+ s += "[" + indices.join("][") + "]";
+ }
+
+ result = result == null ? s : s + "." + result;
+ }
+ }
+ catch (e:SecurityError)
+ {
+ // Ignore error and continue with what we have.
+ // We may not have access to our parent if we are loaded into a sandbox.
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns the name of the specified object's class,
+ * such as <code>"Button"</code>
+ *
+ * <p>This string does not include the package name.
+ * If you need the package name as well, call the
+ * <code>getQualifiedClassName()</code> method in the flash.utils package.
+ * It will return a string such as <code>"mx.controls::Button"</code>.</p>
+ *
+ * @param object The object.
+ *
+ * @return The name of the specified object's class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getUnqualifiedClassName(object:Object):String
+ {
+ var name:String;
+ if (object is String)
+ name = object as String;
+ else
+ name = getQualifiedClassName(object);
+
+ // If there is a package name, strip it off.
+ var index:int = name.indexOf("::");
+ if (index != -1)
+ name = name.substr(index + 2);
+
+ return name;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/ObjectProxy.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/ObjectProxy.as b/frameworks/projects/MX/src/main/flex/mx/utils/ObjectProxy.as
new file mode 100644
index 0000000..03a8f51
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/ObjectProxy.as
@@ -0,0 +1,825 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.utils.getQualifiedClassName;
+import flash.utils.IDataInput;
+import flash.utils.IDataOutput;
+import flash.utils.IExternalizable;
+import flash.utils.Proxy;
+import flash.utils.flash_proxy;
+import mx.core.IPropertyChangeNotifier;
+import mx.events.PropertyChangeEvent;
+import mx.events.PropertyChangeEventKind;
+
+use namespace flash_proxy;
+use namespace object_proxy;
+
+[Bindable("propertyChange")]
+[RemoteClass(alias="flex.messaging.io.ObjectProxy")]
+
+/**
+ * This class provides the ability to track changes to an item
+ * managed by this proxy.
+ * Any number of objects can "listen" for changes on this
+ * object, by using the <code>addEventListener()</code> method.
+ *
+ * @example
+ * <pre>
+ * import mx.events.PropertyChangeEvent;
+ * import mx.utils.ObjectUtil;
+ * import mx.utils.ObjectProxy;
+ * import mx.utils.StringUtil;
+ *
+ * var a:Object = { name: "Tyler", age: 5, ssnum: "555-55-5555" };
+ * var p:ObjectProxy = new ObjectProxy(a);
+ * p.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updateHandler);
+ * p.name = "Jacey";
+ * p.age = 2;
+ * delete p.ssnum;
+ *
+ * // handler function
+ * function updateHandler(event:ChangeEvent):void
+ * {
+ * trace(StringUtil.substitute("updateHandler('{0}', {1}, {2}, {3}, '{4}')",
+ * event.kind,
+ * event.property,
+ * event.oldValue,
+ * event.newValue,
+ * event.target.object_proxy::UUID));
+ * }
+ *
+ * // The trace output appears as:
+ * // updateHandler('opUpdate', name, Tyler, Jacey, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ * // updateHandler('opUpdate', age, 5, 2, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ * // updateHandler('opDelete', ssnum, 555-55-5555, null, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ * </pre>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public dynamic class ObjectProxy extends Proxy
+ implements IExternalizable,
+ IPropertyChangeNotifier
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Initializes this proxy with the specified object, id and proxy depth.
+ *
+ * @param item Object to proxy.
+ * If no item is specified, an anonymous object will be constructed
+ * and assigned.
+ *
+ * @param uid String containing the unique id
+ * for this object instance.
+ * Required for IPropertyChangeNotifier compliance as every object must
+ * provide a unique way of identifying it.
+ * If no value is specified, a random id will be assigned.
+ *
+ * @param proxyDepth An integer indicating how many levels in a complex
+ * object graph should have a proxy created during property access.
+ * The default is -1, meaning "proxy to infinite depth".
+ *
+ * @example
+ *
+ * <pre>
+ * import mx.events.PropertyChangeEvent;
+ * import mx.utils.ObjectUtil;
+ * import mx.utils.ObjectProxy;
+ * import mx.utils.StringUtil;
+ *
+ * var a:Object = { name: "Tyler", age: 5, ssnum: "555-55-5555" };
+ * var p:ObjectProxy = new ObjectProxy(a);
+ * p.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updateHandler);
+ * p.name = "Jacey";
+ * p.age = 2;
+ * delete p.ssnum;
+ *
+ * // handler function
+ * function updateHandler(event:PropertyChangeEvent):void
+ * {
+ * trace(StringUtil.substitute("updateHandler('{0}', {1}, {2}, {3}, '{4}')",
+ * event.kind,
+ * event.property,
+ * event.oldValue,
+ * event.newValue,
+ * event.target.uid));
+ * }
+ *
+ * // trace output
+ * updateHandler('opUpdate', name, Jacey, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ * updateHandler('opUpdate', age, 2, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ * updateHandler('opDelete', ssnum, null, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ * </pre>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ObjectProxy(item:Object = null, uid:String = null,
+ proxyDepth:int = -1)
+ {
+ super();
+
+ if (!item)
+ item = {};
+ _item = item;
+
+ _proxyLevel = proxyDepth;
+
+ notifiers = {};
+
+ dispatcher = new EventDispatcher(this);
+
+ // If we got an id, use it. Otherwise the UID is lazily
+ // created in the getter for UID.
+ if (uid)
+ _id = uid;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * A reference to the EventDispatcher for this proxy.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var dispatcher:EventDispatcher;
+
+ /**
+ * A hashmap of property change notifiers that this proxy is
+ * listening for changes from; the key of the map is the property name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var notifiers:Object;
+
+ /**
+ * Indicates what kind of proxy to create
+ * when proxying complex properties.
+ * Subclasses should assign this value appropriately.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var proxyClass:Class = ObjectProxy;
+
+ /**
+ * Contains a list of all of the property names for the proxied object.
+ * Descendants need to fill this list by overriding the
+ * <code>setupPropertyList()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var propertyList:Array;
+
+ /**
+ * Indicates how deep proxying should be performed.
+ * If -1 (default), always proxy;
+ * if this value is zero, no proxying will be performed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var _proxyLevel:int;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // object
+ //----------------------------------
+
+ /**
+ * Storage for the object property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var _item:Object;
+
+ /**
+ * The object being proxied.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ object_proxy function get object():Object
+ {
+ return _item;
+ }
+
+ //----------------------------------
+ // type
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the qualified type name.
+ */
+ private var _type:QName;
+
+ /**
+ * The qualified type name associated with this object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ object_proxy function get type():QName
+ {
+ return _type;
+ }
+
+ /**
+ * @private
+ */
+ object_proxy function set type(value:QName):void
+ {
+ _type = value;
+ }
+
+ //----------------------------------
+ // uid
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the uid property.
+ */
+ private var _id:String;
+
+ /**
+ * The unique identifier for this object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get uid():String
+ {
+ if (_id === null)
+ _id = UIDUtil.createUID();
+
+ return _id;
+ }
+
+ /**
+ * @private
+ */
+ public function set uid(value:String):void
+ {
+ _id = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns the specified property value of the proxied object.
+ *
+ * @param name Typically a string containing the name of the property,
+ * or possibly a QName where the property name is found by
+ * inspecting the <code>localName</code> property.
+ *
+ * @return The value of the property.
+ * In some instances this value may be an instance of
+ * <code>ObjectProxy</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override flash_proxy function getProperty(name:*):*
+ {
+ // if we have a data proxy for this then
+ var result:*;
+
+ if (notifiers[name.toString()])
+ return notifiers[name];
+
+ result = _item[name];
+
+ if (result)
+ {
+ if (_proxyLevel == 0 || ObjectUtil.isSimple(result))
+ {
+ return result;
+ }
+ else
+ {
+ result = object_proxy::getComplexProperty(name, result);
+ } // if we are proxying
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns the value of the proxied object's method with the specified name.
+ *
+ * @param name The name of the method being invoked.
+ *
+ * @param rest An array specifying the arguments to the
+ * called method.
+ *
+ * @return The return value of the called method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override flash_proxy function callProperty(name:*, ... rest):*
+ {
+ return _item[name].apply(_item, rest)
+ }
+
+ /**
+ * Deletes the specified property on the proxied object and
+ * sends notification of the delete to the handler.
+ *
+ * @param name Typically a string containing the name of the property,
+ * or possibly a QName where the property name is found by
+ * inspecting the <code>localName</code> property.
+ *
+ * @return A Boolean indicating if the property was deleted.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override flash_proxy function deleteProperty(name:*):Boolean
+ {
+ var notifier:IPropertyChangeNotifier = IPropertyChangeNotifier(notifiers[name]);
+ if (notifier)
+ {
+ notifier.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+ propertyChangeHandler);
+ delete notifiers[name];
+ }
+
+ var oldVal:* = _item[name];
+ var deleted:Boolean = delete _item[name];
+
+ if (dispatcher.hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+ {
+ var event:PropertyChangeEvent = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+ event.kind = PropertyChangeEventKind.DELETE;
+ event.property = name;
+ event.oldValue = oldVal;
+ event.source = this;
+ dispatcher.dispatchEvent(event);
+ }
+
+ return deleted;
+ }
+
+ /**
+ * @private
+ */
+ override flash_proxy function hasProperty(name:*):Boolean
+ {
+ return(name in _item);
+ }
+
+ /**
+ * @private
+ */
+ override flash_proxy function nextName(index:int):String
+ {
+ return propertyList[index -1];
+ }
+
+ /**
+ * @private
+ */
+ override flash_proxy function nextNameIndex(index:int):int
+ {
+ if (index == 0)
+ {
+ setupPropertyList();
+ }
+
+ if (index < propertyList.length)
+ {
+ return index + 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ /**
+ * @private
+ */
+ override flash_proxy function nextValue(index:int):*
+ {
+ return _item[propertyList[index -1]];
+ }
+
+ /**
+ * Updates the specified property on the proxied object
+ * and sends notification of the update to the handler.
+ *
+ * @param name Object containing the name of the property that
+ * should be updated on the proxied object.
+ *
+ * @param value Value that should be set on the proxied object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override flash_proxy function setProperty(name:*, value:*):void
+ {
+ var oldVal:* = _item[name];
+ if (oldVal !== value)
+ {
+ // Update item.
+ _item[name] = value;
+
+ // Stop listening for events on old item if we currently are.
+ var notifier:IPropertyChangeNotifier =
+ IPropertyChangeNotifier(notifiers[name]);
+ if (notifier)
+ {
+ notifier.removeEventListener(
+ PropertyChangeEvent.PROPERTY_CHANGE,
+ propertyChangeHandler);
+ delete notifiers[name];
+ }
+
+ // Notify anyone interested.
+ if (dispatcher.hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+ {
+ if (name is QName)
+ name = QName(name).localName;
+ var event:PropertyChangeEvent =
+ PropertyChangeEvent.createUpdateEvent(
+ this, name.toString(), oldVal, value);
+ dispatcher.dispatchEvent(event);
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // object_proxy methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Provides a place for subclasses to override how a complex property that
+ * needs to be either proxied or daisy chained for event bubbling is managed.
+ *
+ * @param name Typically a string containing the name of the property,
+ * or possibly a QName where the property name is found by
+ * inspecting the <code>localName</code> property.
+ *
+ * @param value The property value.
+ *
+ * @return The property value or an instance of <code>ObjectProxy</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ object_proxy function getComplexProperty(name:*, value:*):*
+ {
+ if (value is IPropertyChangeNotifier)
+ {
+ value.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+ propertyChangeHandler);
+ notifiers[name] = value;
+ return value;
+ }
+
+ if (getQualifiedClassName(value) == "Object")
+ {
+ value = new proxyClass(_item[name], null,
+ _proxyLevel > 0 ? _proxyLevel - 1 : _proxyLevel);
+ value.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+ propertyChangeHandler);
+ notifiers[name] = value;
+ return value;
+ }
+
+ return value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // IExternalizable Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Since Flex only uses ObjectProxy to wrap anonymous objects,
+ * the server flex.messaging.io.ObjectProxy instance serializes itself
+ * as a Map that will be returned as a plain ActionScript object.
+ * You can then set the object_proxy object property to this value.
+ *
+ * @param input The source object from which the ObjectProxy is
+ * deserialized.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function readExternal(input:IDataInput):void
+ {
+ var value:Object = input.readObject();
+ _item = value;
+ }
+
+ /**
+ * Since Flex only serializes the inner ActionScript object that it wraps,
+ * the server flex.messaging.io.ObjectProxy populates itself
+ * with this anonymous object's contents and appears to the user
+ * as a Map.
+ *
+ * @param output The source object from which the ObjectProxy is
+ * deserialized.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function writeExternal(output:IDataOutput):void
+ {
+ output.writeObject(_item);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Registers an event listener object
+ * so that the listener receives notification of an event.
+ * For more information, including descriptions of the parameters see
+ * <code>addEventListener()</code> in the
+ * flash.events.EventDispatcher class.
+ *
+ * @param type The type of event.
+ *
+ * @param listener The listener function that processes the event. This function must accept
+ * an Event object as its only parameter and must return nothing.
+ *
+ * @param useCapture Determines whether the listener works in the capture phase or the
+ * target and bubbling phases. If <code>useCapture</code> is set to <code>true</code>,
+ * the listener processes the event only during the capture phase and not in the
+ * target or bubbling phase. If <code>useCapture</code> is <code>false</code>, the
+ * listener processes the event only during the target or bubbling phase. To listen for
+ * the event in all three phases, call <code>addEventListener</code> twice, once with
+ * <code>useCapture</code> set to <code>true</code>, then again with
+ * <code>useCapture</code> set to <code>false</code>.
+ *
+ * @param priority The priority level of the event listener.
+ *
+ * @param useWeakReference Determines whether the reference to the listener is strong or
+ * weak. A strong reference (the default) prevents your listener from being garbage-collected.
+ * A weak reference does not.
+ *
+ * @see flash.events.EventDispatcher#addEventListener()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addEventListener(type:String, listener:Function,
+ useCapture:Boolean = false,
+ priority:int = 0,
+ useWeakReference:Boolean = false):void
+ {
+ dispatcher.addEventListener(type, listener, useCapture,
+ priority, useWeakReference);
+ }
+
+ /**
+ * Removes an event listener.
+ * If there is no matching listener registered with the EventDispatcher object,
+ * a call to this method has no effect.
+ * For more information, see
+ * the flash.events.EventDispatcher class.
+ *
+ * @param type The type of event.
+ *
+ * @param listener The listener object to remove.
+ *
+ * @param useCapture Specifies whether the listener was registered for the capture
+ * phase or the target and bubbling phases. If the listener was registered for both
+ * the capture phase and the target and bubbling phases, two calls to
+ * <code>removeEventListener()</code> are required to remove both, one call with
+ * <code>useCapture</code>
+ * set to <code>true</code>, and another call with <code>useCapture</code>
+ * set to <code>false</code>.
+ *
+ * @see flash.events.EventDispatcher#removeEventListener()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeEventListener(type:String, listener:Function,
+ useCapture:Boolean = false):void
+ {
+ dispatcher.removeEventListener(type, listener, useCapture);
+ }
+
+ /**
+ * Dispatches an event into the event flow.
+ * For more information, see
+ * the flash.events.EventDispatcher class.
+ *
+ * @param event The Event object that is dispatched into the event flow. If the
+ * event is being redispatched, a clone of the event is created automatically.
+ * After an event is dispatched, its target property cannot be changed, so you
+ * must create a new copy of the event for redispatching to work.
+ *
+ * @return Returns <code>true</code> if the event was successfully dispatched.
+ * A value
+ * of <code>false</code> indicates failure or that <code>preventDefault()</code>
+ * was called on the event.
+ *
+ * @see flash.events.EventDispatcher#dispatchEvent()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function dispatchEvent(event:Event):Boolean
+ {
+ return dispatcher.dispatchEvent(event);
+ }
+
+ /**
+ * Checks whether there are any event listeners registered
+ * for a specific type of event.
+ * This allows you to determine where an object has altered handling
+ * of an event type in the event flow hierarchy.
+ * For more information, see
+ * the flash.events.EventDispatcher class.
+ *
+ * @param type The type of event
+ *
+ * @return Returns <code>true</code> if a listener of the specified type is
+ * registered; <code>false</code> otherwise.
+ *
+ * @see flash.events.EventDispatcher#hasEventListener()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function hasEventListener(type:String):Boolean
+ {
+ return dispatcher.hasEventListener(type);
+ }
+
+ /**
+ * Checks whether an event listener is registered with this object
+ * or any of its ancestors for the specified event type.
+ * This method returns <code>true</code> if an event listener is triggered
+ * during any phase of the event flow when an event of the specified
+ * type is dispatched to this object or any of its descendants.
+ * For more information, see the flash.events.EventDispatcher class.
+ *
+ * @param type The type of event.
+ *
+ * @return Returns <code>true</code> if a listener of the specified type will
+ * be triggered; <code>false</code> otherwise.
+ *
+ * @see flash.events.EventDispatcher#willTrigger()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function willTrigger(type:String):Boolean
+ {
+ return dispatcher.willTrigger(type);
+ }
+
+ /**
+ * Called when a complex property is updated.
+ *
+ * @param event An event object that has changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function propertyChangeHandler(event:PropertyChangeEvent):void
+ {
+ dispatcher.dispatchEvent(event);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Protected Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * This method creates an array of all of the property names for the
+ * proxied object.
+ * Descendants must override this method if they wish to add more
+ * properties to this list.
+ * Be sure to call <code>super.setupPropertyList</code> before making any
+ * changes to the <code>propertyList</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function setupPropertyList():void
+ {
+ if (getQualifiedClassName(_item) == "Object")
+ {
+ propertyList = [];
+ for (var prop:String in _item)
+ propertyList.push(prop);
+ }
+ else
+ {
+ propertyList = ObjectUtil.getClassInfo(_item, null, {includeReadOnly:true, uris:["*"]}).properties;
+ }
+ }
+}
+
+}
[26/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEvent.as
new file mode 100644
index 0000000..274e2fb
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEvent.as
@@ -0,0 +1,282 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+import mx.events.PropertyChangeEventKind;
+
+/**
+ * The PropertyChangeEvent class represents the event object
+ * passed to the event listener when one of the properties of
+ * an object has changed, and provides information about the change.
+ * This event is used by collection classes, and is the only way for
+ * collections to know that the data they represent has changed.
+ * This event is also used by the Flex data binding mechanism.
+ *
+ * @see PropertyChangeEventKind
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class PropertyChangeEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ // Note: If the value for CHANGE changes,
+ // update mx.utils.ObjectProxy's Bindable metadata.
+
+ /**
+ * The <code>PropertyChangeEvent.PROPERTY_CHANGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>PropertyChange</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>Determined by the constructor; defaults to false.</td></tr>
+ * <tr><td><code>cancelable</code></td><td>Determined by the constructor; defaults to false.</td></tr>
+ * <tr><td><code>kind</code></td><td>The kind of change; PropertyChangeEventKind.UPDATE
+ * or PropertyChangeEventKind.DELETE.</td></tr>
+ * <tr><td><code>oldValue</code></td><td>The original property value.</td></tr>
+ * <tr><td><code>newValue</code></td><td>The new property value, if any.</td></tr>
+ * <tr><td><code>property</code></td><td>The property that changed.</td></tr>
+ * <tr><td><code>source</code></td><td>The object that contains the property that changed.</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType propertyChange
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const PROPERTY_CHANGE:String = "propertyChange";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns a new PropertyChangeEvent of kind
+ * <code>PropertyChangeEventKind.UPDATE</code>
+ * with the specified properties.
+ * This is a convenience method.
+ *
+ * @param source The object where the change occured.
+ *
+ * @param property A String, QName, or int
+ * specifying the property that changed,
+ *
+ * @param oldValue The value of the property before the change.
+ *
+ * @param newValue The value of the property after the change.
+ *
+ * @return A newly constructed PropertyChangeEvent
+ * with the specified properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function createUpdateEvent(
+ source:Object,
+ property:Object,
+ oldValue:Object,
+ newValue:Object):PropertyChangeEvent
+ {
+ var event:PropertyChangeEvent =
+ new PropertyChangeEvent(PROPERTY_CHANGE);
+
+ event.kind = PropertyChangeEventKind.UPDATE;
+ event.oldValue = oldValue;
+ event.newValue = newValue;
+ event.source = source;
+ event.property = property;
+
+ return event;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that triggered the event.
+ *
+ * @param bubbles Specifies whether the event can bubble
+ * up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @param kind Specifies the kind of change.
+ * The possible values are <code>PropertyChangeEventKind.UPDATE</code>,
+ * <code>PropertyChangeEventKind.DELETE</code>, and <code>null</code>.
+ *
+ * @param property A String, QName, or int
+ * specifying the property that changed.
+ *
+ * @param oldValue The value of the property before the change.
+ *
+ * @param newValue The value of the property after the change.
+ *
+ * @param source The object that the change occured on.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function PropertyChangeEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ kind:String = null,
+ property:Object = null,
+ oldValue:Object = null,
+ newValue:Object = null,
+ source:Object = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.kind = kind;
+ this.property = property;
+ this.oldValue = oldValue;
+ this.newValue = newValue;
+ this.source = source;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // kind
+ //----------------------------------
+
+ /**
+ * Specifies the kind of change.
+ * The possible values are <code>PropertyChangeEventKind.UPDATE</code>,
+ * <code>PropertyChangeEventKind.DELETE</code>, and <code>null</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var kind:String;
+
+ //----------------------------------
+ // newValue
+ //----------------------------------
+
+ /**
+ * The value of the property after the change.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var newValue:Object;
+
+ //----------------------------------
+ // oldValue
+ //----------------------------------
+
+ /**
+ * The value of the property before the change.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var oldValue:Object;
+
+ //----------------------------------
+ // property
+ //----------------------------------
+
+ /**
+ * A String, QName, or int specifying the property that changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var property:Object;
+
+ //----------------------------------
+ // source
+ //----------------------------------
+
+ /**
+ * The object that the change occured on.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var source:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new PropertyChangeEvent(type, bubbles, cancelable, kind,
+ property, oldValue, newValue, source);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEventKind.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEventKind.as b/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEventKind.as
new file mode 100644
index 0000000..4ec706a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/PropertyChangeEventKind.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+/**
+ * The PropertyChangeEventKind class defines the constant values
+ * for the <code>kind</code> property of the PropertyChangeEvent class.
+ *
+ * @see mx.events.PropertyChangeEvent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public final class PropertyChangeEventKind
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Indicates that the value of the property changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const UPDATE:String = "update";
+
+ /**
+ * Indicates that the property was deleted from the object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DELETE:String = "delete";
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/Request.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/Request.as b/frameworks/projects/MX/src/main/flex/mx/events/Request.as
new file mode 100644
index 0000000..90a9bdb
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/Request.as
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * This is an event that is expects its data property to be set by
+ * a responding listener.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public class Request extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+ /**
+ * Dispatched from a sub-application or module to find the module factory of its parent
+ * application or module. The recipient of this request should set the data property to
+ * their module factory.
+ *
+ * The message is dispatched from the content of a loaded module or application.
+ */
+ public static const GET_PARENT_FLEX_MODULE_FACTORY_REQUEST:String = "getParentFlexModuleFactoryRequest";
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor. Does not return anything, but the <code>value</code> property can be modified
+ * to represent a return value of a method.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior associated with the event can be prevented.
+ *
+ * @param name Name of a property or method or name of a manager to instantiate.
+ *
+ * @param value Value of a property, or an array of parameters
+ * for a method (if not null).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function Request(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ value:Object = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.value = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // value
+ //----------------------------------
+
+ /**
+ * Value of property, or array of parameters for method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public var value:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ var cloneEvent:Request = new Request(type, bubbles, cancelable,
+ value);
+
+ return cloneEvent;
+ }
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/ResizeEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/ResizeEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/ResizeEvent.as
new file mode 100644
index 0000000..982d44e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/ResizeEvent.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * Represents event objects that are dispatched when the size of a Flex
+ * component changes.
+ *
+ * @see mx.core.UIComponent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ResizeEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>ResizeEvent.RESIZE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>resize</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>oldHeight</code></td><td>The previous height of the object, in pixels.</td></tr>
+ * <tr><td><code>oldWidth</code></td><td>The previous width of the object, in pixels.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType resize
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const RESIZE:String = "resize";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble
+ * up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @param oldWidth The previous width of the object, in pixels.
+ *
+ * @param oldHeight The previous height of the object, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ResizeEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ oldWidth:Number = NaN, oldHeight:Number = NaN)
+ {
+ super(type, bubbles, cancelable);
+
+ this.oldWidth = oldWidth;
+ this.oldHeight = oldHeight;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // oldHeight
+ //----------------------------------
+
+ /**
+ * The previous <code>height</code> of the object, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var oldHeight:Number;
+
+ //----------------------------------
+ // oldWidth
+ //----------------------------------
+
+ /**
+ * The previous <code>width</code> of the object, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var oldWidth:Number;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new ResizeEvent(type, bubbles, cancelable, oldWidth, oldHeight);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/StateChangeEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/StateChangeEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/StateChangeEvent.as
new file mode 100644
index 0000000..bdb48f3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/StateChangeEvent.as
@@ -0,0 +1,205 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * The StateChangeEvent class represents an event that is dispatched when the
+ * <code>currentState</code> property of a component changes.
+ *
+ * @see mx.core.UIComponent
+ * @see mx.states.State
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class StateChangeEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The StateChangeEvent.CURRENT_STATE_CHANGE constant defines the
+ * value of the <code>type</code> property of the event that is dispatched
+ * when the view state has changed.
+ * The value of this constant is "currentStateChange".
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>newState</code></td><td>The name of the view state
+ * that was entered.</td></tr>
+ * <tr><td><code>oldState</code></td><td>The name of the view state
+ * that was exited.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>type</code></td><td>StateChangeEvent.CURRENT_STATE_CHANGE</td></tr>
+ * </table>
+ *
+ * @eventType currentStateChange
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CURRENT_STATE_CHANGE:String = "currentStateChange";
+
+ /**
+ * The StateChangeEvent.CURRENT_STATE_CHANGING constant defines the
+ * value of the <code>type</code> property of the event that is dispatched
+ * when the view state is about to change.
+ * The value of this constant is "currentStateChanging".
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>newState</code></td><td>The name of the view state
+ * that is being entered.</td></tr>
+ * <tr><td><code>oldState</code></td><td>The name of the view state
+ * that is being exited.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>type</code></td><td>StateChangeEvent.CURRENT_STATE_CHANGING</td></tr>
+ * </table>
+ *
+ * @eventType currentStateChanging
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CURRENT_STATE_CHANGING:String = "currentStateChanging";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ * Normally called by a Flex control and not used in application code.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble
+ * up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @param oldState The name of the view state the component is exiting.
+ *
+ * @param newState The name of the view state the component is entering.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function StateChangeEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ oldState:String = null,
+ newState:String = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.oldState = oldState;
+ this.newState = newState;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // newState
+ //----------------------------------
+
+ /**
+ * The name of the view state that the component is entering.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var newState:String;
+
+ //----------------------------------
+ // oldState
+ //----------------------------------
+
+ /**
+ * The name of the view state that the component is exiting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var oldState:String;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new StateChangeEvent(type, bubbles, cancelable,
+ oldState, newState);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/ToolTipEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/ToolTipEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/ToolTipEvent.as
new file mode 100644
index 0000000..ff00023
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/ToolTipEvent.as
@@ -0,0 +1,299 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+import mx.core.IToolTip;
+
+/**
+ * The ToolTipEvent class represents ToolTip events, which are generated by the ToolTipManager
+ * class. The ToolTipManager class calls the <code>dispatchEvent()</code> method
+ * of the object to which the tip applies to dispatch the event.
+ *
+ * @see mx.managers.ToolTipManager
+ * @see mx.core.UIComponent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ToolTipEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>ToolTipEvent.TOOL_TIP_CREATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>toolTipCreate</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>tooltip</code></td><td>The ToolTip object to
+ * which this event applies.</td></tr>
+ * </table>
+ *
+ * @eventType toolTipCreate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TOOL_TIP_CREATE:String = "toolTipCreate";
+
+ /**
+ * The <code>ToolTipEvent.TOOL_TIP_END</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>toolTipEnd</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>tooltip</code></td><td>The ToolTip object to
+ * which this event applies.</td></tr>
+ * </table>
+ *
+ * @eventType toolTipEnd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TOOL_TIP_END:String = "toolTipEnd";
+
+ /**
+ * The <code>ToolTipEvent.TOOL_TIP_HIDE</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>toolTipHide</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>tooltip</code></td><td>The ToolTip object to
+ * which this event applies.</td></tr>
+ * </table>
+ *
+ * @eventType toolTipHide
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TOOL_TIP_HIDE:String = "toolTipHide";
+
+ /**
+ * The <code>ToolTipEvent.TOOL_TIP_SHOW</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>toolTipShow</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>tooltip</code></td><td>The ToolTip object to
+ * which this event applies.</td></tr>
+ * </table>
+ *
+ * @eventType toolTipShow
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TOOL_TIP_SHOW:String = "toolTipShow";
+
+ /**
+ * The <code>ToolTipEvent.TOOL_TIP_SHOWN</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>toolTipShown</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>tooltip</code></td><td>The ToolTip object to
+ * which this event applies.</td></tr>
+ * </table>
+ *
+ * @eventType toolTipShown
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TOOL_TIP_SHOWN:String = "toolTipShown";
+
+ /**
+ * The <code>ToolTipEvent.TOOL_TIP_START</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>toolTipStart</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>tooltip</code></td><td>The ToolTip object to
+ * which this event applies.</td></tr>
+ * </table>
+ *
+ * @eventType toolTipStart
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TOOL_TIP_START:String = "toolTipStart";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble
+ * up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @param toolTip The ToolTip object to which this event applies.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ToolTipEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ toolTip:IToolTip = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.toolTip = toolTip;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // toolTip
+ //----------------------------------
+
+ /**
+ * The ToolTip object to which this event applies.
+ * This object is normally an instance of ToolTip object,
+ * but can be any UIComponent object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var toolTip:IToolTip;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new ToolTipEvent(type, bubbles, cancelable, toolTip);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/TweenEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/TweenEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/TweenEvent.as
new file mode 100644
index 0000000..403bc02
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/TweenEvent.as
@@ -0,0 +1,229 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * Represents event objects that are specific to Flex tween effects.
+ * Flex effects dispatch two types of tween events:
+ * <ul>
+ * <li><code>tweenUpdate</code></li>
+ * <li><code>tweenEnd</code></li>
+ * </ul>
+ *
+ * @see mx.effects.TweenEffect
+ * @see mx.effects.Tween
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class TweenEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>TweenEvent.TWEEN_END</code> constant defines the value of the
+ * event object's <code>type</code> property for a <code>tweenEnd</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>value</code></td><td>The value passed to the
+ * <code>onTweenEnd()</code> method.</td></tr>
+ * </table>
+ *
+ * @see mx.effects.Effect
+ * @see mx.effects.TweenEffect
+ * @see mx.events.EffectEvent
+ * @eventType tweenEnd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TWEEN_END:String = "tweenEnd";
+
+ /**
+ * The <code>TweenEvent.TWEEN_START</code> constant defines the value of the
+ * event object's <code>type</code> property for a <code>tweenStart</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>value</code></td><td>The value passed to the
+ * <code>onTweenUpdate()</code> method.</td></tr>
+ * </table>
+ *
+ * @eventType tweenStart
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TWEEN_START:String = "tweenStart";
+
+ /**
+ * The <code>TweenEvent.TWEEN_UPDATE</code> constant defines the value of the
+ * event object's <code>type</code> property for a <code>tweenUpdate</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * <tr><td><code>value</code></td><td>The value passed to the
+ * <code>onTweenUpdate()</code> method.</td></tr>
+ * </table>
+ *
+ * @eventType tweenUpdate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const TWEEN_UPDATE:String = "tweenUpdate";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up the
+ * display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior associated with the event can be prevented.
+ *
+ * @param value For a <code>tweenStart</code> or <code>tweenUpdate</code> event, the value passed to the
+ * <code>onTweenUpdate()</code> method; for a <code>tweenEnd</code> event,
+ * the value passed to the <code>onTweenEnd()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function TweenEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ value:Object = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.value = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // value
+ //----------------------------------
+
+ /**
+ * For a <code>tweenStart</code> or <code>tweenUpdate</code> event, the value passed to the
+ * <code>onTweenUpdate()</code> method; for a <code>tweenEnd</code> event,
+ * the value passed to the <code>onTweenEnd()</code> method.
+ *
+ * <p>For the exact value of this property, see the instance class
+ * for each tween effect.</p>
+ *
+ * @see mx.effects.effectClasses.ActionEffectInstance
+ * @see mx.effects.effectClasses.BlurInstance
+ * @see mx.effects.effectClasses.DissolveInstance
+ * @see mx.effects.effectClasses.FadeInstance
+ * @see mx.effects.effectClasses.GlowInstance
+ * @see mx.effects.effectClasses.MaskEffectInstance
+ * @see mx.effects.effectClasses.MoveInstance
+ * @see mx.effects.effectClasses.ResizeInstance
+ * @see mx.effects.effectClasses.RotateInstance
+ * @see mx.effects.effectClasses.ZoomInstance
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var value:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new TweenEvent(type, bubbles, cancelable, value);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/ValidationResultEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/ValidationResultEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/ValidationResultEvent.as
new file mode 100644
index 0000000..0da2461
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/ValidationResultEvent.as
@@ -0,0 +1,236 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * The ValidationResultEvent class represents the event object
+ * passed to the listener for the <code>valid</code> validator event
+ * or the <code>invalid</code> validator event.
+ *
+ * @see mx.validators.Validator
+ * @see mx.validators.ValidationResult
+ * @see mx.validators.RegExpValidationResult
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ValidationResultEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>ValidationResultEvent.INVALID</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>invalid</code> event.
+ * The value of this constant is "invalid".
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>field</code></td><td>The name of the field that failed validation.</td></tr>
+ * <tr><td><code>message</code></td><td>A single string that contains
+ * every error message from all of the ValidationResult objects in the results Array.</td></tr>
+ * <tr><td><code>results</code></td><td>An array of ValidationResult objects,
+ * one per validated field.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType invalid
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const INVALID:String = "invalid";
+
+ /**
+ * The <code>ValidationResultEvent.VALID</code> constant defines the value of the
+ * <code>type</code> property of the event object for a <code>valid</code>event.
+ * The value of this constant is "valid".
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>field</code></td><td>An empty String.</td></tr>
+ * <tr><td><code>message</code></td><td>An empty String.</td></tr>
+ * <tr><td><code>results</code></td><td>An empty Array.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType valid
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VALID:String = "valid";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up the
+ * display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior associated with the event can be prevented.
+ *
+ * @param field The name of the field that failed validation and triggered the event.
+ *
+ * @param results An array of ValidationResult objects, one per validated field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ValidationResultEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ field:String = null,
+ results:Array = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.field = field;
+ this.results = results;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // field
+ //----------------------------------
+
+ /**
+ * The name of the field that failed validation and triggered the event.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var field:String;
+
+ //----------------------------------
+ // message
+ //----------------------------------
+
+ /**
+ * A single string that contains every error message from all
+ * of the ValidationResult objects in the results Array.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get message():String
+ {
+ var msg:String = "";
+ var n:int;
+
+ if (results)
+ n = results.length;
+
+ for (var i:int = 0; i < n; ++i)
+ {
+ if (results[i].isError)
+ {
+ msg += msg == "" ? "" : "\n";
+ msg += results[i].errorMessage;
+ }
+ }
+
+ return msg;
+ }
+
+ //----------------------------------
+ // results
+ //----------------------------------
+
+ /**
+ * An array of ValidationResult objects, one per validated field.
+ *
+ * @see mx.validators.ValidationResult
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var results:Array;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new ValidationResultEvent(type, bubbles, cancelable,
+ field, results);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/geom/RoundedRectangle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/geom/RoundedRectangle.as b/frameworks/projects/MX/src/main/flex/mx/geom/RoundedRectangle.as
new file mode 100644
index 0000000..1eff289
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/geom/RoundedRectangle.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.geom
+{
+import org.apache.flex.geom.Rectangle;
+
+/**
+ * RoundedRectangle represents a Rectangle with curved corners
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class RoundedRectangle extends Rectangle
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param x The x coordinate of the top-left corner of the rectangle.
+ *
+ * @param y The y coordinate of the top-left corner of the rectangle.
+ *
+ * @param width The width of the rectangle, in pixels.
+ *
+ * @param height The height of the rectangle, in pixels.
+ *
+ * @param cornerRadius The radius of each corner, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function RoundedRectangle(x:Number = 0, y:Number = 0,
+ width:Number = 0, height:Number = 0,
+ cornerRadius:Number = 0)
+ {
+ super(x, y, width, height);
+
+ this.cornerRadius = cornerRadius;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // cornerRadius
+ //----------------------------------
+
+ [Inspectable]
+
+ /**
+ * The radius of each corner (in pixels).
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var cornerRadius:Number = 0;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/CursorManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/CursorManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManager.as
new file mode 100644
index 0000000..688818b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManager.as
@@ -0,0 +1,429 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+import mx.core.Singleton;
+import mx.core.mx_internal;
+
+//--------------------------------------
+// Styles
+//--------------------------------------
+
+/**
+ * The skin for the busy cursor.
+ *
+ * @default mx.skins.halo.BusyCursor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="busyCursor", type="Class", inherit="no")]
+
+/**
+ * The class to use as the skin for the busy cursor background.
+ * The default value is the "cursorStretch" symbol from the Assets.swf file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="busyCursorBackground", type="Class", inherit="no")]
+
+/**
+ * The CursorManager class controls a prioritized list of cursors,
+ * where the cursor with the highest priority is currently visible.
+ * If the cursor list contains more than one cursor with the same priority,
+ * the Cursor Manager displays the most recently created cursor.
+ *
+ * <p>For example, if your application performs processing
+ * that requires the user to wait until the processing completes,
+ * you can change the cursor so that it reflects the waiting period.
+ * In this case, you can change the cursor to an hourglass
+ * or other image.</p>
+ *
+ * <p>You also might want to change the cursor to provide feedback
+ * to the user to indicate the actions that the user can perform.
+ * For example, you can use one cursor image to indicate that user input
+ * is enabled, and another to indicate that input is disabled.
+ * You can use a JPEG, GIF, PNG, or SVG image, a Sprite object, or a SWF file
+ * as the cursor image.</p>
+ *
+ * <p>All methods and properties of the CursorManager are static,
+ * so you do not need to create an instance of it.</p>
+ *
+ * <p>In AIR, each mx.core.Window instance uses its own instance of the CursorManager class.
+ * Instead of directly referencing the static methods and properties of the CursorManager class,
+ * use the <code>Window.cursorManager</code> property to reference the CursorManager instance
+ * for the Window instance. </p>
+ *
+ * @see mx.managers.CursorManagerPriority
+ * @see mx.core.Window
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class CursorManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constant that is the value of <code>currentCursorID</code> property
+ * when there is no cursor managed by the CursorManager and therefore
+ * the system cursor is being displayed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const NO_CURSOR:int = 0;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Linker dependency on implementation class.
+ */
+ private static var implClassDependency:CursorManagerImpl;
+
+ /**
+ * @private
+ * Storage for the impl getter.
+ * This gets initialized on first access,
+ * not at static initialization time, in order to ensure
+ * that the Singleton registry has already been initialized.
+ */
+ private static var _impl:ICursorManager;
+
+ /**
+ * @private
+ * The singleton instance of CursorManagerImpl which was
+ * registered as implementing the ICursorManager interface.
+ */
+ private static function get impl():ICursorManager
+ {
+ if (!_impl)
+ {
+ _impl = ICursorManager(
+ Singleton.getInstance("mx.managers::ICursorManager"));
+ }
+
+ return _impl;
+ }
+
+ /**
+ * Each mx.core.Window instance in an AIR application has its own CursorManager instance.
+ * This method returns the CursorManager instance for the main Window instance.
+ *
+ * @return The CursorManager instance for the main Window instance in an AIR application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getInstance():ICursorManager
+ {
+ return impl;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentCursorID
+ //----------------------------------
+
+ /**
+ * ID of the current custom cursor,
+ * or NO_CURSOR if the system cursor is showing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get currentCursorID():int
+ {
+ return impl.currentCursorID;
+ }
+
+ /**
+ * @private
+ */
+ public static function set currentCursorID(value:int):void
+ {
+ impl.currentCursorID = value;
+ }
+
+ //----------------------------------
+ // currentCursorXOffset
+ //----------------------------------
+
+ /**
+ * The x offset of the custom cursor, in pixels,
+ * relative to the mouse pointer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get currentCursorXOffset():Number
+ {
+ return impl.currentCursorXOffset;
+ }
+
+ /**
+ * @private
+ */
+ public static function set currentCursorXOffset(value:Number):void
+ {
+ impl.currentCursorXOffset = value;
+ }
+
+ //----------------------------------
+ // currentCursorYOffset
+ //----------------------------------
+
+ /**
+ * The y offset of the custom cursor, in pixels,
+ * relative to the mouse pointer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get currentCursorYOffset():Number
+ {
+ return impl.currentCursorYOffset;
+ }
+
+ /**
+ * @private
+ */
+ public static function set currentCursorYOffset(value:Number):void
+ {
+ impl.currentCursorYOffset = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Makes the cursor visible.
+ * Cursor visibility is not reference-counted.
+ * A single call to the <code>showCursor()</code> method
+ * always shows the cursor regardless of how many calls
+ * to the <code>hideCursor()</code> method were made.
+ *
+ * <p>Calling this method does not affect the system cursor.
+ * Use the <code>Mouse.show()</code> and
+ * <code>Mouse.hide()</code> methods to directly
+ * control the system cursor. </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function showCursor():void
+ {
+ impl.showCursor();
+ }
+
+ /**
+ * Makes the cursor invisible.
+ * Cursor visibility is not reference-counted.
+ * A single call to the <code>hideCursor()</code> method
+ * always hides the cursor regardless of how many calls
+ * to the <code>showCursor()</code> method were made.
+ *
+ * <p>Calling this method does not affect the system cursor.
+ * Use the <code>Mouse.show()</code> and
+ * <code>Mouse.hide()</code> methods to directly
+ * control the system cursor. </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function hideCursor():void
+ {
+ impl.hideCursor();
+ }
+
+ /**
+ * Creates a new cursor and sets an optional priority for the cursor.
+ * Adds the new cursor to the cursor list.
+ *
+ * @param cursorClass Class of the cursor to display.
+ *
+ * @param priority Integer that specifies
+ * the priority level of the cursor.
+ * Possible values are <code>CursorManagerPriority.HIGH</code>,
+ * <code>CursorManagerPriority.MEDIUM</code>, and <code>CursorManagerPriority.LOW</code>.
+ *
+ * @param xOffset Number that specifies the x offset
+ * of the cursor, in pixels, relative to the mouse pointer.
+ *
+ * @param yOffset Number that specifies the y offset
+ * of the cursor, in pixels, relative to the mouse pointer.
+ *
+ * @param setter The IUIComponent that set the cursor. Necessary (in multi-window environments)
+ * to know which window needs to display the cursor.
+ *
+ * @return The ID of the cursor.
+ *
+ * @see mx.managers.CursorManagerPriority
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setCursor(cursorClass:Class, priority:int = 2,
+ xOffset:Number = 0,
+ yOffset:Number = 0):int
+ {
+ return impl.setCursor(cursorClass, priority, xOffset, yOffset);
+ }
+
+ /**
+ * Removes a cursor from the cursor list.
+ * If the cursor being removed is the currently displayed cursor,
+ * the CursorManager displays the next cursor in the list, if one exists.
+ * If the list becomes empty, the CursorManager displays
+ * the default system cursor.
+ *
+ * @param cursorID ID of cursor to remove.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function removeCursor(cursorID:int):void
+ {
+ impl.removeCursor(cursorID);
+ }
+
+ /**
+ * Removes all of the cursors from the cursor list
+ * and restores the system cursor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function removeAllCursors():void
+ {
+ impl.removeAllCursors();
+ }
+
+ /**
+ * Displays the busy cursor.
+ * The busy cursor has a priority of CursorManagerPriority.LOW.
+ * Therefore, if the cursor list contains a cursor
+ * with a higher priority, the busy cursor is not displayed
+ * until you remove the higher priority cursor.
+ * To create a busy cursor at a higher priority level,
+ * use the <code>setCursor()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setBusyCursor():void
+ {
+ impl.setBusyCursor();
+ }
+
+ /**
+ * Removes the busy cursor from the cursor list.
+ * If other busy cursor requests are still active in the cursor list,
+ * which means you called the <code>setBusyCursor()</code> method more than once,
+ * a busy cursor does not disappear until you remove
+ * all busy cursors from the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function removeBusyCursor():void
+ {
+ impl.removeBusyCursor();
+ }
+
+
+ /**
+ * @private
+ * Called by other components if they want to display
+ * the busy cursor during progress events.
+ */
+ mx_internal static function registerToUseBusyCursor(source:Object):void
+ {
+ impl.registerToUseBusyCursor(source);
+ }
+
+ /**
+ * @private
+ * Called by other components to unregister
+ * a busy cursor from the progress events.
+ */
+ mx_internal static function unRegisterToUseBusyCursor(source:Object):void
+ {
+ impl.unRegisterToUseBusyCursor(source);
+ }
+
+}
+
+}
+
[05/37] git commit: [flex-asjs] [refs/heads/spark] - allow event
dispatchers to control the target
Posted by ah...@apache.org.
allow event dispatchers to control the target
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/40a6abd4
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/40a6abd4
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/40a6abd4
Branch: refs/heads/spark
Commit: 40a6abd4dbcc76bbf4847087dc5cce385ccf6d9d
Parents: bd3bcce
Author: Alex Harui <ah...@apache.org>
Authored: Fri Feb 12 15:01:28 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Feb 12 15:01:28 2016 -0800
----------------------------------------------------------------------
.../main/flex/org/apache/flex/events/EventDispatcher.as | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/40a6abd4/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
index ceec8ee..3256bf9 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
@@ -49,15 +49,22 @@ package org.apache.flex.events
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- public function EventDispatcher()
+ public function EventDispatcher(target:IEventDispatcher = null)
{
- super();
+ super(target);
}
}
COMPILE::JS
public class EventDispatcher extends goog.events.EventTarget implements IEventDispatcher
{
+ public function EventDispatcher(target:IEventDispatcher = null)
+ {
+ super();
+ if (target)
+ setTargetForTesting(target);
+ }
+
public function hasEventListener(type:String):Boolean
{
return goog.events.hasListener(this, type);
[32/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IRepeaterClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IRepeaterClient.as b/frameworks/projects/MX/src/main/flex/mx/core/IRepeaterClient.as
new file mode 100644
index 0000000..78e398e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IRepeaterClient.as
@@ -0,0 +1,160 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IRepeaterClient interface defines the APIs for components
+ * that can have multiple instances created by a Repeater.
+ * The IRepeaterClient interface is implemented by the UIComponent class
+ * and so is inherited by all Flex framework controls and containers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IRepeaterClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // instanceIndices
+ //----------------------------------
+
+ /**
+ * An Array that contains the indices required
+ * to reference the repeated component instance from its document.
+ * This Array is empty unless the component
+ * is within one or more Repeaters.
+ * The first element corresponds to the outermost Repeater.
+ * For example, if the <code>id</code> is <code>"b"</code>
+ * and <code>instanceIndices</code> is <code>[ 2, 4 ]</code>,
+ * you would reference it on the document as <code>b[2][4]</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get instanceIndices():Array;
+
+ /**
+ * @private
+ */
+ function set instanceIndices(value:Array):void;
+
+ //----------------------------------
+ // isDocument
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#isDocument
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get isDocument():Boolean;
+
+ //----------------------------------
+ // repeaterIndices
+ //----------------------------------
+
+ /**
+ * An Array that contains the indices of the items in the data
+ * providers of the Repeaters that produced the component.
+ * The Array is empty unless the component is within one or more
+ * Repeaters.
+ * The first element corresponds to the outermost Repeater component.
+ * For example, if <code>repeaterIndices</code> is <code>[ 2, 4 ]</code>,
+ * the outer Repeater component used its <code>dataProvider[2]</code>
+ * data item and the inner Repeater component used its
+ * <code>dataProvider[4]</code> data item.
+ *
+ * <p>This property differs from <code>instanceIndices</code>
+ * if the <code>startingIndex</code> of any of the Repeater components
+ * is non-zero.
+ * For example, even if a Repeater component starts at
+ * <code>dataProvider</code> item 4, the document reference of the first
+ * repeated component is <code>b[0]</code>, not <code>b[4]</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get repeaterIndices():Array;
+
+ /**
+ * @private
+ */
+ function set repeaterIndices(value:Array):void;
+
+ //----------------------------------
+ // repeaters
+ //----------------------------------
+
+ /**
+ * An Array that contains any enclosing Repeaters of the component.
+ * The Array is empty unless the component is within one or more Repeaters.
+ * The first element corresponds to the outermost Repeater.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get repeaters():Array;
+
+ /**
+ * @private
+ */
+ function set repeaters(value:Array):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Initializes the <code>instanceIndices</code>,
+ * <code>repeaterIndices</code>, and <code>repeaters</code> properties.
+ *
+ * <p>This method is called by the Flex framework.
+ * Developers should not need to call it.</p>
+ *
+ * @param parent The parent Repeater that created this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initializeRepeaterArrays(parent:IRepeaterClient):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/ISpriteInterface.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ISpriteInterface.as b/frameworks/projects/MX/src/main/flex/mx/core/ISpriteInterface.as
new file mode 100644
index 0000000..d7d9757
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ISpriteInterface.as
@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ * The ISprite interface defines the basic set of APIs
+ * for web version of flash.display.Sprite
+ */
+
+ /**
+ * @copy flash.display.Sprite#graphics
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function get graphics():Graphics;
+
+ /**
+ * @copy flash.display.Sprite#buttonMode
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get buttonMode():Boolean;
+ function set buttonMode(value:Boolean):void;
+
+ /**
+ * @copy flash.display.Sprite#startDrag()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void;
+
+ /**
+ * @copy flash.display.Sprite#stopDrag()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function stopDrag():void;
+
+ /**
+ * @copy flash.display.Sprite#dropTarget
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get dropTarget():DisplayObject;
+
+ /**
+ * @copy flash.display.Sprite#hitArea
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get hitArea():Sprite;
+ function set hitArea(value:Sprite):void;
+
+
+ /**
+ * @copy flash.display.Sprite#useHandCursor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get useHandCursor():Boolean;
+ function set useHandCursor(value:Boolean):void;
+
+
+ /**
+ * @copy flash.display.Sprite#soundTransform
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function get soundTransform():SoundTransform;
+ COMPILE::LATER
+ function set soundTransform(sndTransform:SoundTransform):void;
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IStateClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IStateClient.as b/frameworks/projects/MX/src/main/flex/mx/core/IStateClient.as
new file mode 100644
index 0000000..7787b15
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IStateClient.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+/**
+ * The IStateClient interface defines the interface that
+ * components must implement to support view states.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IStateClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentState
+ //----------------------------------
+
+ /**
+ * The current view state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get currentState():String;
+
+ /**
+ * @private
+ */
+ function set currentState(value:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IStateClient2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IStateClient2.as b/frameworks/projects/MX/src/main/flex/mx/core/IStateClient2.as
new file mode 100644
index 0000000..b7cfa08
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IStateClient2.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import org.apache.flex.events.IEventDispatcher;
+
+/**
+ * The IStateClient2 interface defines the interface that
+ * components must implement to support Flex 4 view state
+ * semantics.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IStateClient2 extends IEventDispatcher, IStateClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // states
+ //----------------------------------
+
+ [ArrayElementType("mx.states.State")]
+
+ /**
+ * The set of view state objects.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get states():Array;
+
+ /**
+ * @private
+ */
+ function set states(value:Array):void;
+
+
+ //----------------------------------
+ // transitions
+ //----------------------------------
+
+ [ArrayElementType("mx.states.Transition")]
+
+ /**
+ * The set of view state transitions.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get transitions():Array;
+
+ /**
+ * @private
+ */
+ function set transitions(value:Array):void;
+
+ /**
+ * Determines whether the specified state has been defined on this
+ * UIComponent.
+ *
+ * @param stateName The name of the state being checked.
+ *
+ * @return Whether or not the specified state has been defined
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function hasState(stateName:String):Boolean
+
+}
+
+}
\ 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/core/ISystemCursorClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ISystemCursorClient.as b/frameworks/projects/MX/src/main/flex/mx/core/ISystemCursorClient.as
new file mode 100644
index 0000000..fe6ca8f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ISystemCursorClient.as
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+[ExcludeClass]
+
+/**
+ * The ISystemCursorClient interface defines the interface a component may
+ * implement to notify the CursorManager whether or not the system cursor
+ * should be used in conjunction with a custom cursor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface ISystemCursorClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // showSystemCursor
+ //----------------------------------
+
+ /**
+ * True if the system cursor should always be shown when the mouse
+ * moves over the component. If false, the custom cursor will be shown.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get showSystemCursor():Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IToolTip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IToolTip.as b/frameworks/projects/MX/src/main/flex/mx/core/IToolTip.as
new file mode 100644
index 0000000..9a2efc5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IToolTip.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+import org.apache.flex.geom.Rectangle;
+
+/**
+ * The IToolTip interface defines the API that tooltip-like components
+ * must implement in order to work with the ToolTipManager.
+ * The ToolTip class implements this interface.
+ *
+ * @see mx.controls.ToolTip
+ * @see mx.managers.ToolTipManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IToolTip extends IUIComponent
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // screen
+ //----------------------------------
+
+ /**
+ * A Rectangle that specifies the size and position
+ * of the base drawing surface for this tooltip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get screen():Rectangle;
+
+ //----------------------------------
+ // text
+ //----------------------------------
+
+ /**
+ * The text that appears in the tooltip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get text():String;
+
+ /**
+ * @private
+ */
+ function set text(value:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/ITransientDeferredInstance.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ITransientDeferredInstance.as b/frameworks/projects/MX/src/main/flex/mx/core/ITransientDeferredInstance.as
new file mode 100644
index 0000000..65f31d1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ITransientDeferredInstance.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The ITransientDeferredInstance interface extends IDeferredInstance and adds
+ * the ability for the user to reset the deferred instance factory to its
+ * initial state (usually this implies releasing any known references to the
+ * component, such as the setting the owning document property that refers to
+ * the instance to null).
+ *
+ * This additional capability is leveraged by the AddItems states override when
+ * the desired behavior is to destroy a state-specific element when a state
+ * no longer applies.
+ *
+ * The Flex compiler uses the same automatic coercion rules as with
+ * IDeferredInstance.
+ *
+ * @see mx.states.AddItems
+ * @see mx.core.IDeferredInstance
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface ITransientDeferredInstance extends IDeferredInstance
+{
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Resets the state of our factory to its initial state, clearing any
+ * references to the cached instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function reset():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/mx/core/IUIComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IUIComponent.as b/frameworks/projects/MX/src/main/flex/mx/core/IUIComponent.as
new file mode 100644
index 0000000..3ff57b3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IUIComponent.as
@@ -0,0 +1,574 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.Sprite;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.DisplayObjectContainer;
+ import flex.display.Sprite;
+}
+import mx.managers.ISystemManager;
+
+/**
+ * The IUIComponent interface defines the basic set of APIs
+ * that you must implement to create a child of a Flex container or list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IUIComponent extends IFlexDisplayObject
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // baselinePosition
+ //----------------------------------
+
+ /**
+ * The y-coordinate of the baseline
+ * of the first line of text of the component.
+ *
+ * <p>This property is used to implement
+ * the <code>baseline</code> constraint style.
+ * It is also used to align the label of a FormItem
+ * with the controls in the FormItem.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get baselinePosition():Number;
+
+
+ //----------------------------------
+ // document
+ //----------------------------------
+
+ /**
+ * A reference to the document object associated with this component.
+ * A document object is an Object at the top of the hierarchy
+ * of a Flex application, MXML component, or ActionScript component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get document():Object
+
+ /**
+ * @private
+ */
+ function set document(value:Object):void
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * Whether the component can accept user interaction. After setting the <code>enabled</code>
+ * property to <code>false</code>, some components still respond to mouse interactions such
+ * as mouseOver. As a result, to fully disable UIComponents,
+ * you should also set the value of the <code>mouseEnabled</code> property to <code>false</code>.
+ * If you set the <code>enabled</code> property to <code>false</code>
+ * for a container, Flex dims the color of the container and of all
+ * of its children, and blocks user input to the container
+ * and to all of its children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get enabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set enabled(value:Boolean):void;
+
+ //----------------------------------
+ // explicitHeight
+ //----------------------------------
+
+ /**
+ * The explicitly specified height for the component,
+ * in pixels, as the component's coordinates.
+ * If no height is explicitly specified, the value is <code>NaN</code>.
+ *
+ * @see mx.core.UIComponent#explicitHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get explicitHeight():Number;
+
+ /**
+ * @private
+ */
+ function set explicitHeight(value:Number):void;
+
+ //----------------------------------
+ // explicitMaxHeight
+ //----------------------------------
+
+ /**
+ * Number that specifies the maximum height of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#explicitMaxHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get explicitMaxHeight():Number;
+
+ //----------------------------------
+ // explicitMaxWidth
+ //----------------------------------
+
+ /**
+ * Number that specifies the maximum width of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#explicitMaxWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get explicitMaxWidth():Number;
+
+ //----------------------------------
+ // explicitMinHeight
+ //----------------------------------
+
+ /**
+ * Number that specifies the minimum height of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#explicitMinHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get explicitMinHeight():Number;
+
+ //----------------------------------
+ // explicitMinWidth
+ //----------------------------------
+
+ /**
+ * Number that specifies the minimum width of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#explicitMinWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get explicitMinWidth():Number;
+
+ //----------------------------------
+ // explicitWidth
+ //----------------------------------
+
+ /**
+ * The explicitly specified width for the component,
+ * in pixels, as the component's coordinates.
+ * If no width is explicitly specified, the value is <code>NaN</code>.
+ *
+ * @see mx.core.UIComponent#explicitWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get explicitWidth():Number;
+
+ /**
+ * @private
+ */
+ function set explicitWidth(value:Number):void;
+
+ //----------------------------------
+ // focusPane
+ //----------------------------------
+
+ /**
+ * A single Sprite object that is shared among components
+ * and used as an overlay for drawing the focus indicator.
+ * Components share this object if their parent is a focused component,
+ * not if the component implements the IFocusManagerComponent interface.
+ *
+ * @see mx.core.UIComponent#focusPane
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusPane():Sprite;
+
+ /**
+ * @private
+ */
+ function set focusPane(value:Sprite):void;
+
+ //----------------------------------
+ // includeInLayout
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#includeInLayout
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get includeInLayout():Boolean;
+
+ /**
+ * @private
+ */
+ function set includeInLayout(value:Boolean):void;
+
+ //----------------------------------
+ // isPopUp
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#isPopUp
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get isPopUp():Boolean;
+
+ /**
+ * @private
+ */
+ function set isPopUp(value:Boolean):void;
+
+ //----------------------------------
+ // maxHeight
+ //----------------------------------
+
+ /**
+ * Number that specifies the maximum height of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#maxHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get maxHeight():Number;
+
+ //----------------------------------
+ // maxWidth
+ //----------------------------------
+
+ /**
+ * Number that specifies the maximum width of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#maxWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get maxWidth():Number;
+
+ //----------------------------------
+ // measuredMinHeight
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#measuredMinHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get measuredMinHeight():Number;
+
+ /**
+ * @private
+ */
+ function set measuredMinHeight(value:Number):void;
+
+ //----------------------------------
+ // measuredMinWidth
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#measuredMinWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get measuredMinWidth():Number;
+
+ /**
+ * @private
+ */
+ function set measuredMinWidth(value:Number):void;
+
+ //----------------------------------
+ // minHeight
+ //----------------------------------
+
+ /**
+ * Number that specifies the minimum height of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#minHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get minHeight():Number;
+
+ //----------------------------------
+ // minWidth
+ //----------------------------------
+
+ /**
+ * Number that specifies the minimum width of the component,
+ * in pixels, as the component's coordinates.
+ *
+ * @see mx.core.UIComponent#minWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get minWidth():Number;
+
+ //----------------------------------
+ // owner
+ //----------------------------------
+
+ /**
+ * @copy mx.core.IVisualElement#owner
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get owner():DisplayObjectContainer;
+
+ /**
+ * @private
+ */
+ function set owner(value:DisplayObjectContainer):void;
+
+ //----------------------------------
+ // percentHeight
+ //----------------------------------
+
+ /**
+ * Number that specifies the height of a component as a
+ * percentage of its parent's size.
+ * Allowed values are 0 to 100.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get percentHeight():Number;
+
+ /**
+ * @private
+ */
+ function set percentHeight(value:Number):void;
+
+ //----------------------------------
+ // percentWidth
+ //----------------------------------
+
+ /**
+ * Number that specifies the width of a component as a
+ * percentage of its parent's size.
+ * Allowed values are 0 to 100.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get percentWidth():Number;
+
+ /**
+ * @private
+ */
+ function set percentWidth(value:Number):void;
+
+ //----------------------------------
+ // systemManager
+ //----------------------------------
+
+ /**
+ * A reference to the SystemManager object for this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get systemManager():ISystemManager;
+
+ /**
+ * @private
+ */
+ function set systemManager(value:ISystemManager):void;
+
+ //----------------------------------
+ // tweeningProperties
+ //----------------------------------
+
+ /**
+ * Used by EffectManager.
+ * Returns non-null if a component
+ * is not using the EffectManager to execute a Tween.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get tweeningProperties():Array;
+
+ /**
+ * @private
+ */
+ function set tweeningProperties(value:Array):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Initialize the object.
+ *
+ * @see mx.core.UIComponent#initialize()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initialize():void;
+
+ /**
+ * @copy mx.core.UIComponent#parentChanged()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function parentChanged(p:DisplayObjectContainer):void;
+
+ /**
+ * @copy mx.core.UIComponent#getExplicitOrMeasuredWidth()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getExplicitOrMeasuredWidth():Number;
+
+ /**
+ * @copy mx.core.UIComponent#getExplicitOrMeasuredHeight()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getExplicitOrMeasuredHeight():Number;
+
+ /**
+ * @copy mx.core.UIComponent#setVisible()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setVisible(value:Boolean, noEvent:Boolean = false):void;
+
+ /**
+ * @copy mx.core.UIComponent#owns()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function owns(displayObject:DisplayObject):Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IUID.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IUID.as b/frameworks/projects/MX/src/main/flex/mx/core/IUID.as
new file mode 100644
index 0000000..cd0f321
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IUID.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IUID interface defines the interface for objects that must have
+ * Unique Identifiers (UIDs) to uniquely identify the object.
+ * UIDs do not need to be universally unique for most uses in Flex.
+ * One exception is for messages send by data services.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IUID
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // uid
+ //----------------------------------
+
+ /**
+ * The unique identifier for this object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get uid():String;
+
+ /**
+ * @private
+ */
+ function set uid(value:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IVisualElement.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IVisualElement.as b/frameworks/projects/MX/src/main/flex/mx/core/IVisualElement.as
new file mode 100644
index 0000000..3f1464a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IVisualElement.as
@@ -0,0 +1,290 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+COMPILE::AS3
+{
+ import flash.display.DisplayObjectContainer;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObjectContainer;
+}
+
+import mx.geom.TransformOffsets;
+
+/**
+ * The IVisualElement interface defines the minimum properties and methods
+ * required for a visual element to be laid out and displayed in a Spark container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface IVisualElement extends ILayoutElement, ILayoutDirectionElement
+{
+
+ /**
+ * The owner of this IVisualElement object.
+ * By default, it is the parent of this IVisualElement object.
+ * However, if this IVisualElement object is a child component that is
+ * popped up by its parent, such as the drop-down list of a ComboBox control,
+ * the owner is the component that popped up this IVisualElement object.
+ *
+ * <p>This property is not managed by Flex, but by each component.
+ * Therefore, if you use the <code>PopUpManger.createPopUp()</code> or
+ * <code>PopUpManger.addPopUp()</code> method to pop up a child component,
+ * you should set the <code>owner</code> property of the child component
+ * to the component that popped it up.</p>
+ *
+ * <p>The default value is the value of the <code>parent</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get owner():DisplayObjectContainer;
+
+ /**
+ * @private
+ */
+ function set owner(value:DisplayObjectContainer):void;
+
+ /**
+ * The parent container or component for this component.
+ * Only visual elements should have a <code>parent</code> property.
+ * Non-visual items should use another property to reference
+ * the object to which they belong.
+ * By convention, non-visual objects use an <code>owner</code>
+ * property to reference the object to which they belong.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get parent():DisplayObjectContainer;
+
+ /**
+ * Determines the order in which items inside of containers
+ * are rendered.
+ * Spark containers order their items based on their
+ * <code>depth</code> property, with the lowest depth in the back,
+ * and the higher in the front.
+ * Items with the same depth value appear in the order
+ * they are added to the container.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get depth():Number;
+
+ /**
+ * @private
+ */
+ function set depth(value:Number):void;
+
+ /**
+ * Controls the visibility of this visual element.
+ * If <code>true</code>, the object is visible.
+ *
+ * <p>If an object is not visible, but the <code>includeInLayout</code>
+ * property is set to <code>true</code>, then the object
+ * takes up space in the container, but is invisible.</p>
+ *
+ * <p>If <code>visible</code> is set to <code>true</code>, the object may not
+ * necessarily be visible due to its size and whether container clipping
+ * is enabled.</p>
+ *
+ * <p>Setting <code>visible</code> to <code>false</code>,
+ * prevents the component from getting focus.</p>
+ *
+ * @default true
+ * @see ILayoutElement#includeInLayout
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get visible():Boolean;
+
+ /**
+ * @private
+ */
+ function set visible(value:Boolean):void;
+
+ /**
+ * @copy flash.display.DisplayObject#alpha
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get alpha():Number;
+
+ /**
+ * @private
+ */
+ function set alpha(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#width
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get width():Number;
+
+ /**
+ * @private
+ */
+ function set width(value:Number):void;
+
+ /**
+ * @copy flash.display.DisplayObject#height
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get height():Number;
+
+ /**
+ * @private
+ */
+ function set height(value:Number):void;
+
+ /**
+ * @copy flash.display.DisplayObject#x
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get x():Number;
+
+ /**
+ * @private
+ */
+ function set x(value:Number):void;
+
+
+ /**
+ * @copy flash.display.DisplayObject#y
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get y():Number;
+
+ /**
+ * @private
+ */
+ function set y(value:Number):void;
+
+ /**
+ * Specifies the optional DesignLayer instance associated with this visual
+ * element.
+ *
+ * <p>When a DesignLayer is assigned, a visual element must consider the
+ * visibility and alpha of its parent layer when ultimately committing its
+ * own effective visibility or alpha to its backing DisplayObject
+ * (if applicable).</p>
+ *
+ * <p>A visual element must listen for <code>layerPropertyChange</code>
+ * notifications from the associated layer parent. When the
+ * <code>effectiveAlpha</code> or <code>effectiveVisibility</code> of the
+ * layer changes, the element must then compute its own effective visibility
+ * (or alpha) and apply it accordingly.</p>
+ *
+ * <p>This property should not be set within MXML directly.</p>
+ *
+ * <p>The <code>designLayer</code> property is not used for z-order control,
+ * please see <code>depth</code>.</p>
+ *
+ * @see #depth
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get designLayer():DesignLayer;
+
+ /**
+ * @private
+ */
+ function set designLayer(value:DesignLayer):void;
+
+ /**
+ * Defines a set of adjustments that can be applied to the object's
+ * transform in a way that is invisible to its parent's layout.
+ *
+ * <p>For example, if you want a layout to adjust for an object
+ * that is rotated 90 degrees, set the object's
+ * <code>rotation</code> property. If you want the layout to <i>not</i>
+ * adjust for the object being rotated,
+ * set its <code>postLayoutTransformOffsets.rotationZ</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function get postLayoutTransformOffsets():TransformOffsets;
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ function set postLayoutTransformOffsets(value:TransformOffsets):void;
+
+ /**
+ * Contains <code>true</code> when the element is in 3D.
+ * The element can be in 3D either because
+ * it has 3D transform properties or it has 3D post layout transform offsets or both.
+ *
+ * @see #postLayoutTransformOffsets
+ * @see mx.core.ILayoutElement#hasLayoutMatrix3D
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get is3D():Boolean;
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IVisualElementContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IVisualElementContainer.as b/frameworks/projects/MX/src/main/flex/mx/core/IVisualElementContainer.as
new file mode 100644
index 0000000..ddfccf1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IVisualElementContainer.as
@@ -0,0 +1,281 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+
+/**
+ * The IVisualElementContainer interface defines the minimum properties and methods
+ * required for a container to manage Spark components for display.
+ *
+ * <p>Note that the Spark SkinnableDataContainer and DataGroup containers
+ * do not implement this interface.
+ * Those containers manage their
+ * children through the <code>dataProvider</code> property.</p>
+ *
+ * @see mx.core.IVisualElement
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface IVisualElementContainer
+{
+ //----------------------------------
+ // Visual Element iteration
+ //----------------------------------
+
+ /**
+ * The number of visual elements in this container.
+ * Visual elements include classes that implement
+ * the IVisualElement interface, such as subclasses of
+ * UIComponent and GraphicElement.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get numElements():int;
+
+ /**
+ * Returns the visual element at the specified index.
+ *
+ * @param index The index of the element to retrieve.
+ *
+ * @return The element at the specified index.
+ *
+ * @throws RangeError If the index position does not exist in the child list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getElementAt(index:int):IVisualElement
+
+ //----------------------------------
+ // Visual Element addition
+ //----------------------------------
+
+ /**
+ * Adds a visual element to this container.
+ * The element is added after all other elements
+ * and appears top of all other elements.
+ * To add a visual element to a specific index position, use
+ * the <code>addElementAt()</code> method.
+ *
+ * <p>If you add a visual element that already has a different
+ * container as a parent, the element is removed from
+ * the other container.</p>
+ *
+ * @param element The visual element to add as a child of this container.
+ *
+ * @return The element that was added.
+ *
+ * @event elementAdd spark.events.ElementExistenceEvent Dispatched when
+ * the element is added to the child list.
+ *
+ * @throws ArgumentError If the element is the same as the visual container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function addElement(element:IVisualElement):IVisualElement;
+
+ /**
+ * Adds a visual element to this container.
+ * The element is added at the index position specified.
+ * An index of 0 represents the first element in the display list.
+ *
+ * <p>If you add a visual element that already has a different
+ * container as a parent, the element is removed from
+ * the other container.</p>
+ *
+ * @param element The element to add as a child of this visual container.
+ *
+ * @param index The index position to which the element is added. If
+ * you specify a currently occupied index position, the child
+ * that exists at that position and all higher positions are moved
+ * up one position in the child list.
+ *
+ * @return The element that was added.
+ *
+ * @event elementAdd spark.events.ElementExistenceEvent Dispatched when
+ * the element is added to the child list.
+ *
+ * @throws ArgumentError If the element is the same as the container.
+ *
+ * @throws RangeError If the index position does not exist in the child list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function addElementAt(element:IVisualElement, index:int):IVisualElement;
+
+ //----------------------------------
+ // Visual Element removal
+ //----------------------------------
+
+ /**
+ * Removes the specified visual element from the child list of
+ * this container.
+ * The index positions of any elements
+ * above the element in this visual container are decreased by 1.
+ *
+ * @param element The element to be removed from the container.
+ *
+ * @return The element removed.
+ *
+ * @throws ArgumentError If the element parameter is not a child of
+ * this visual container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function removeElement(element:IVisualElement):IVisualElement;
+
+ /**
+ * Removes a visual element from the specified index position
+ * in the container.
+ * The index positions of any elements
+ * above the element in this visual container are decreased by 1.
+ *
+ * @param index The index of the element to remove.
+ *
+ * @return The element removed.
+ *
+ * @throws RangeError If the index does not exist in the child list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function removeElementAt(index:int):IVisualElement;
+
+ /**
+ * Removes all visual elements from the container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function removeAllElements():void;
+
+ //----------------------------------
+ // Visual Element index
+ //----------------------------------
+
+ /**
+ * Returns the index position of a visual element.
+ *
+ * @param element The visual element.
+ *
+ * @return The index position of the element in the container.
+ *
+ * @throws ArgumentError If the element is not a child of this visual container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getElementIndex(element:IVisualElement):int;
+
+ /**
+ * Changes the position of an existing visual element in the visual container.
+ *
+ * <p>When you call the <code>setElementIndex()</code> method and specify an
+ * index position that is already occupied, the only positions
+ * that change are those in between the elements's former and new position.
+ * All others stay the same.</p>
+ *
+ * <p>If a visual element is moved to an index
+ * lower than its current index, the index of all elements in between increases
+ * by 1. If an element is moved to an index
+ * higher than its current index, the index of all elements in between
+ * decreases by 1.</p>
+ *
+ * @param element The element for which you want to change the index number.
+ *
+ * @param index The resulting index number for the element.
+ *
+ * @throws RangeError If the index does not exist in the child list.
+ *
+ * @throws ArgumentError If the element parameter is not a child
+ * of this visual container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function setElementIndex(element:IVisualElement, index:int):void;
+
+ //----------------------------------
+ // Visual Element swapping
+ //----------------------------------
+
+ /**
+ * Swaps the index of the two specified visual elements. All other elements
+ * remain in the same index position.
+ *
+ * @param element1 The first visual element.
+ *
+ * @param element2 The second visual element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function swapElements(element1:IVisualElement, element2:IVisualElement):void;
+
+ /**
+ * Swaps the visual elements at the two specified index
+ * positions in the container.
+ * All other visual elements remain in the same index position.
+ *
+ * @param index1 The index of the first element.
+ *
+ * @param index2 The index of the second element.
+ *
+ * @throws RangeError If either index does not exist in
+ * the visual container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function swapElementsAt(index1:int, index2:int):void;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/LayoutDirection.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/LayoutDirection.as b/frameworks/projects/MX/src/main/flex/mx/core/LayoutDirection.as
new file mode 100644
index 0000000..3b671c1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/LayoutDirection.as
@@ -0,0 +1,77 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+ /**
+ * The LayoutDirection class defines the constant values
+ * for the <code>layoutDirection</code> style of an IStyleClient and the
+ * <code>layoutDirection</code> property of an ILayoutDirectionElement.
+ *
+ * Left-to-right layoutDirection is typically used with Latin-style
+ * scripts. Right-to-left layoutDirection is used with scripts such as
+ * Arabic or Hebrew.
+ *
+ * If an IStyleClient, set the layoutDirection style to undefined to
+ * inherit the layoutDirection from its ancestor.
+ *
+ * If an ILayoutDirectionElement, set the layoutDirection property to null to
+ * inherit the layoutDirection from its ancestor.
+ *
+ * @see mx.styles.IStyleClient
+ * @see mx.core.ILayoutDirectionElement
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.1
+ */
+ public final class LayoutDirection
+ {
+ include "Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Specifies left-to-right layout direction for a style client or a
+ * visual element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.1
+ */
+ public static const LTR:String = "ltr";
+
+ /**
+ * Specifies right-to-left layout direction for a style client or a
+ * visual element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.1
+ */
+ public static const RTL:String = "rtl";
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..bf97a0d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/LayoutElementUIComponentUtils.as
@@ -0,0 +1,576 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+COMPILE::LATER
+{
+import flash.geom.Matrix;
+import flash.geom.Matrix3D;
+import flash.geom.Point;
+
+import mx.utils.MatrixUtil;
+}
+
+[ExcludeClass]
+
+/**
+ * @private
+ * Helper class to implement the ILayoutElement interface for IUIComponent
+ * classes.
+ */
+public class LayoutElementUIComponentUtils
+{
+
+ include "../core/Version.as";
+
+ public function LayoutElementUIComponentUtils()
+ {
+
+ }
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ // When changing these constants, make sure you change
+ // the constants with the same name in UIComponent
+ private static const DEFAULT_MAX_WIDTH:Number = 10000;
+ private static const DEFAULT_MAX_HEIGHT:Number = 10000;
+
+ /**
+ * @return Returns the preferred width (untransformed) of the IUIComponent.
+ * Takes into account measured width, explicit width, explicit min width
+ * and explicit max width.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static function getPreferredUBoundsWidth(obj:IUIComponent):Number
+ {
+ // explicit trumps measured. measuredWidth should already be
+ // constraint between min & max during measure phase.
+ var result:Number = obj.getExplicitOrMeasuredWidth();
+ 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;
+ }
+
+ /**
+ * @return Returns the preferred height (untransformed) of the IUIComponent.
+ * Takes into account measured height, explicit height, explicit min height
+ * and explicit max height.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static function getPreferredUBoundsHeight(obj:IUIComponent):Number
+ {
+ // explicit trumps measured. measuredWidth should already be
+ // constraint between min & max during measure phase.
+ var result:Number = obj.getExplicitOrMeasuredHeight();
+ 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;
+ }
+
+ private static function getMinUBoundsWidth(obj:IUIComponent):Number
+ {
+ // explicit trumps explicitMin trumps measuredMin.
+ // measuredMin is restricted by explicitMax.
+ var minWidth:Number;
+ if (!isNaN(obj.explicitMinWidth))
+ {
+ minWidth = obj.explicitMinWidth;
+ }
+ else
+ {
+ minWidth = isNaN(obj.measuredMinWidth) ? 0 : obj.measuredMinWidth;
+ if (!isNaN(obj.explicitMaxWidth))
+ minWidth = Math.min(minWidth, obj.explicitMaxWidth);
+ }
+
+ 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;
+ }
+
+ private static function getMinUBoundsHeight(obj:IUIComponent):Number
+ {
+ // explicit trumps explicitMin trumps measuredMin.
+ // measuredMin is restricted by explicitMax.
+ var minHeight:Number;
+ if (!isNaN(obj.explicitMinHeight))
+ {
+ minHeight = obj.explicitMinHeight;
+ }
+ else
+ {
+ minHeight = isNaN(obj.measuredMinHeight) ? 0 : obj.measuredMinHeight;
+ if (!isNaN(obj.explicitMaxHeight))
+ minHeight = Math.min(minHeight, obj.explicitMaxHeight);
+ }
+
+ 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;
+ }
+
+ private static function getMaxUBoundsWidth(obj:IUIComponent):Number
+ {
+ // explicit trumps explicitMax trumps Number.MAX_VALUE.
+ var maxWidth:Number;
+ if (!isNaN(obj.explicitMaxWidth))
+ maxWidth = obj.explicitMaxWidth;
+ else
+ maxWidth = DEFAULT_MAX_WIDTH;
+
+ 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;
+ }
+
+ private static function getMaxUBoundsHeight(obj:IUIComponent):Number
+ {
+ // explicit trumps explicitMax trumps Number.MAX_VALUE.
+ var maxHeight:Number;
+ if (!isNaN(obj.explicitMaxHeight))
+ maxHeight = obj.explicitMaxHeight;
+ else
+ maxHeight = DEFAULT_MAX_HEIGHT;
+
+ 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;
+ }
+
+
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getPreferredBoundsWidth(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ var width:Number = getPreferredUBoundsWidth(obj);
+
+ /*
+ if (transformMatrix)
+ {
+ width = MatrixUtil.transformSize(width, getPreferredUBoundsHeight(obj), transformMatrix).x;
+ }
+ */
+ return width;
+ }
+
+ public static function getPreferredBoundsHeight(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ var height:Number = getPreferredUBoundsHeight(obj);
+
+ /*
+ if (transformMatrix)
+ {
+ height = MatrixUtil.transformSize(getPreferredUBoundsWidth(obj), height, transformMatrix).y;
+ }
+ */
+ return height;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getMinBoundsWidth(obj:IUIComponent/*, transformMatrix:Matrix*/):Number
+ {
+ var width:Number = getMinUBoundsWidth(obj);
+
+ /*
+ if (transformMatrix)
+ {
+ width = MatrixUtil.transformSize(width, getMinUBoundsHeight(obj), transformMatrix).x;
+ }
+ */
+
+ return width;
+ }
+
+ public static function getMinBoundsHeight(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ var height:Number = getMinUBoundsHeight(obj);
+
+ /*
+ if (transformMatrix)
+ {
+ height = MatrixUtil.transformSize(getMinUBoundsWidth(obj), height, transformMatrix).y;
+ }
+ */
+
+ return height;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getMaxBoundsWidth(obj:IUIComponent/*, transformMatrix:Matrix*/):Number
+ {
+ var width:Number = getMaxUBoundsWidth(obj);
+ /*
+ if (transformMatrix)
+ {
+ width = MatrixUtil.transformSize(width, getMaxUBoundsHeight(obj), transformMatrix).x;
+ }
+ */
+
+ return width;
+ }
+
+ public static function getMaxBoundsHeight(obj:IUIComponent/*, transformMatrix:Matrix*/):Number
+ {
+ var height:Number = getMaxUBoundsHeight(obj);
+ /*
+ if (transformMatrix)
+ {
+ height = MatrixUtil.transformSize(getMaxUBoundsWidth(obj), height, transformMatrix).y;
+ }
+ */
+
+ return height;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getBoundsXAtSize(obj:IUIComponent, width:Number, height:Number/*, transformMatrix:Matrix*/):Number
+ {
+ //if (!transformMatrix)
+ return obj.x;
+
+ /*
+ var fitSize:Point = MatrixUtil.fitBounds(width, height, transformMatrix,
+ obj.explicitWidth,
+ obj.explicitHeight,
+ getPreferredUBoundsWidth(obj),
+ getPreferredUBoundsHeight(obj),
+ getMinUBoundsWidth(obj),
+ getMinUBoundsHeight(obj),
+ getMaxUBoundsWidth(obj),
+ getMaxUBoundsHeight(obj));
+
+ // If we couldn't fit at all, default to the minimum size
+ if (!fitSize)
+ fitSize = new Point(getMinUBoundsWidth(obj), getMinUBoundsHeight(obj));
+
+ var pos:Point = new Point();
+ MatrixUtil.transformBounds(fitSize.x, fitSize.y,
+ transformMatrix,
+ pos);
+ return pos.x;
+ */
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getBoundsYAtSize(obj:IUIComponent, width:Number, height:Number/*, transformMatrix:Matrix*/):Number
+ {
+ //if (!transformMatrix)
+ return obj.y;
+
+ /*
+ var fitSize:Point = MatrixUtil.fitBounds(width, height, transformMatrix,
+ obj.explicitWidth,
+ obj.explicitHeight,
+ getPreferredUBoundsWidth(obj),
+ getPreferredUBoundsHeight(obj),
+ getMinUBoundsWidth(obj),
+ getMinUBoundsHeight(obj),
+ getMaxUBoundsWidth(obj),
+ getMaxUBoundsHeight(obj));
+
+ // If we couldn't fit at all, default to the minimum size
+ if (!fitSize)
+ fitSize = new Point(getMinUBoundsWidth(obj), getMinUBoundsHeight(obj));
+
+ var pos:Point = new Point();
+ MatrixUtil.transformBounds(fitSize.x, fitSize.y,
+ transformMatrix,
+ pos);
+ return pos.y;
+ */
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getLayoutBoundsWidth(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ var width:Number = obj.width;
+ 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)
+ {
+ var height:Number = obj.height;
+ 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;
+ }
+
+ // By default the IUIComponent's registration point is the same
+ // as its untransformed border top-left corner, which is (0,0).
+ width = MatrixUtil.transformBounds(width, height,
+ transformMatrix,
+ new Point()).x;
+ }
+ */
+ return width;
+ }
+
+ public static function getLayoutBoundsHeight(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ var height:Number = obj.height;
+ 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)
+ {
+ var width:Number = obj.width;
+ 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;
+ }
+
+ // By default the IUIComponent's registration point is the same
+ // as its untransformed border top-left corner, which is (0,0).
+ height = MatrixUtil.transformBounds(width, height,
+ transformMatrix,
+ new Point()).y;
+ }
+ */
+ return height;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getLayoutBoundsX(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ //if (transformMatrix == null)
+ return obj.x;
+
+ /*
+ var width:Number = obj.width;
+ var height:Number = obj.height;
+
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ {
+ width = (obj.scaleX == 0) ? 0 : width / obj.scaleX;
+ height = (obj.scaleY == 0) ? 0 : height / obj.scaleY;
+ }
+
+ // We are already taking scale into account from the transform,
+ // so adjust here since IUIComponent mixes it with width/height
+ var pos:Point = new Point();
+ MatrixUtil.transformBounds(width, height,
+ transformMatrix,
+ pos);
+ return pos.x;
+ */
+ }
+
+ public static function getLayoutBoundsY(obj:IUIComponent/*,transformMatrix:Matrix*/):Number
+ {
+ //if (transformMatrix == null)
+ return obj.y;
+
+ /*
+ var width:Number = obj.width;
+ var height:Number = obj.height;
+
+ if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+ {
+ width = (obj.scaleX == 0) ? 0 : width / obj.scaleX;
+ height = (obj.scaleY == 0) ? 0 : height / obj.scaleY;
+ }
+
+ // We are already taking scale into account from the transform,
+ // so adjust here since IUIComponent mixes it with width/height
+ var pos:Point = new Point();
+ MatrixUtil.transformBounds(width, height,
+ transformMatrix,
+ pos);
+ return pos.y;
+ */
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setLayoutBoundsPosition(obj:IUIComponent,x:Number, y:Number/*, transformMatrix:Matrix*/):void
+ {
+ /*
+ if (transformMatrix)
+ {
+ //race("Setting actual position to " + x + "," + y);
+ //race("\tcurrent x/y is " + obj.x + "," + obj.y);
+ //race("\tcurrent actual position is " + actualPosition.x + "," + actualPosition.y);
+ x = x - getLayoutBoundsX(obj,transformMatrix) + obj.x;
+ y = y - getLayoutBoundsY(obj,transformMatrix) + obj.y;
+ }
+ */
+ obj.move(x, y);
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setLayoutBoundsSize(obj:IUIComponent,width:Number,
+ height:Number/*,
+ transformMatrix:Matrix*/):void
+ {
+ //if (!transformMatrix)
+ //{
+ if (isNaN(width))
+ width = getPreferredUBoundsWidth(obj);
+ if (isNaN(height))
+ height = getPreferredUBoundsHeight(obj);
+
+ 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;
+ height *= obj.scaleY;
+ }
+ obj.setActualSize(width, height);
+ return;
+ //}
+
+ /*
+ var fitSize:Point = MatrixUtil.fitBounds(width, height, transformMatrix,
+ obj.explicitWidth,
+ obj.explicitHeight,
+ getPreferredUBoundsWidth(obj),
+ getPreferredUBoundsHeight(obj),
+ getMinUBoundsWidth(obj),
+ getMinUBoundsHeight(obj),
+ getMaxUBoundsWidth(obj),
+ getMaxUBoundsHeight(obj));
+
+ // If we couldn't fit at all, default to the minimum size
+ if (!fitSize)
+ fitSize = new Point(getMinUBoundsWidth(obj), getMinUBoundsHeight(obj));
+
+ 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
+ obj.setActualSize(fitSize.x * obj.scaleX, fitSize.y * obj.scaleY);
+ }
+ else
+ obj.setActualSize(fitSize.x, fitSize.y);
+ */
+ }
+}
+}
[15/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/StyleManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/StyleManager.as b/frameworks/projects/MX/src/main/flex/mx/styles/StyleManager.as
new file mode 100644
index 0000000..7f1ac1c
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/StyleManager.as
@@ -0,0 +1,834 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+import org.apache.flex.events.IEventDispatcher;
+COMPILE::LATER
+{
+ import flash.system.ApplicationDomain;
+ import flash.system.SecurityDomain;
+ import flash.utils.Dictionary;
+}
+
+import mx.core.FlexVersion;
+import mx.core.IFlexModuleFactory;
+import mx.core.Singleton;
+import mx.core.mx_internal;
+import mx.managers.SystemManagerGlobals;
+
+/**
+ * The StyleManager class manages the following:
+ * <ul>
+ * <li>Which CSS style properties the class inherits</li>
+ * <li>Which style properties are colors, and therefore get special handling</li>
+ * <li>A list of strings that are aliases for color values</li>
+ * </ul>
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class StyleManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>getColorName()</code> method returns this value if the passed-in
+ * String is not a legitimate color name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const NOT_A_COLOR:uint = 0xFFFFFFFF;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Linker dependency on implementation class.
+ */
+ private static var implClassDependency:StyleManagerImpl;
+
+ /**
+ * @private
+ * Storage for the impl getter.
+ * This gets initialized on first access,
+ * not at static initialization time, in order to ensure
+ * that the Singleton registry has already been initialized.
+ */
+ private static var _impl:IStyleManager2;
+
+ /**
+ * @private
+ * The singleton instance of StyleManagerImpl which was
+ * registered as implementing the IStyleManager2 interface.
+ */
+ private static function get impl():IStyleManager2
+ {
+ if (!_impl)
+ {
+ _impl = IStyleManager2(
+ Singleton.getInstance("mx.styles::IStyleManager2"));
+ }
+
+ return _impl;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Dictionary that maps a moduleFactory to its associated styleManager
+ */
+ COMPILE::LATER
+ private static var styleManagerDictionary:Dictionary;
+
+ /**
+ * Returns the style manager for an object.
+ *
+ * @param moduleFactory The module factory of an object you want the
+ * style manager for. If null, the top-level style manager is returned.
+ *
+ * @return the style manager for the given module factory.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static function getStyleManager(moduleFactory:IFlexModuleFactory):IStyleManager2
+ {
+ COMPILE::LATER
+ {
+ if (!moduleFactory)
+ {
+ moduleFactory = SystemManagerGlobals.topLevelSystemManagers[0];
+ // trace("no style manager specified, using top-level style manager");
+ }
+
+ if (!styleManagerDictionary)
+ styleManagerDictionary = new Dictionary(true);
+
+ var styleManager:IStyleManager2;
+ var dictionary:Dictionary = styleManagerDictionary[moduleFactory];
+ if (dictionary == null)
+ {
+ styleManager = IStyleManager2(moduleFactory.getImplementation("mx.styles::IStyleManager2"));
+ if (styleManager == null)
+ {
+ // All Flex 4 swfs should have a style manager.
+ // In the transition to multiple style managers, use the top-level style manager.
+ // trace("no style manager found");
+ styleManager = impl;
+ }
+
+ dictionary = new Dictionary(true);
+ styleManagerDictionary[moduleFactory] = dictionary;
+ dictionary[styleManager] = 1;
+ }
+ else
+ {
+ for (var o:Object in dictionary)
+ {
+ styleManager = o as IStyleManager2;
+ break;
+ }
+ }
+
+ return styleManager;
+
+ }
+ return impl; // just for now
+ }
+
+ /**
+ * @private
+ * The root of all proto chains used for looking up styles.
+ * This object is initialized once by initProtoChainRoots() and
+ * then updated by calls to setStyle() on the global CSSStyleDeclaration.
+ * It is accessed by code that needs to construct proto chains,
+ * such as the initProtoChain() method of UIComponent.
+ */
+ [Deprecated(replacement="IStyleManager2.stylesRoot on a style manager instance",
+ since="4.0")]
+ mx_internal static function get stylesRoot():Object
+ {
+ return impl.stylesRoot;
+ }
+ mx_internal static function set stylesRoot(value:Object):void
+ {
+ impl.stylesRoot = value;
+ }
+
+ /**
+ * @private
+ * Set of inheriting non-color styles.
+ * This is not the complete set from CSS.
+ * Some of the omitted we don't support at all,
+ * others may be added later as needed.
+ * The method registerInheritingStyle() adds to this set
+ * and isInheritingStyle() queries this set.
+ */
+ [Deprecated(replacement="IStyleManager2.inheritingStyles on a style manager instance",
+ since="4.0")]
+ mx_internal static function get inheritingStyles():Object
+ {
+ return impl.inheritingStyles;
+ }
+ mx_internal static function set inheritingStyles(value:Object):void
+ {
+ impl.inheritingStyles = value;
+ }
+
+ /**
+ * @private
+ */
+ [Deprecated(replacement="IStyleManager2.typeHierarchyCache on a style manager instance",
+ since="4.0")]
+ mx_internal static function get typeHierarchyCache():Object
+ {
+ return impl.typeHierarchyCache;
+ }
+ mx_internal static function set typeHierarchyCache(value:Object):void
+ {
+ impl.typeHierarchyCache = value;
+ }
+
+ /**
+ * @private
+ */
+ [Deprecated(replacement="IStyleManager2.typeSelectorCache on a style manager instance",
+ since="4.0")]
+ mx_internal static function get typeSelectorCache():Object
+ {
+ return impl.typeSelectorCache;
+ }
+ mx_internal static function set typeSelectorCache(value:Object):void
+ {
+ impl.typeSelectorCache = value;
+ }
+
+ /**
+ * @private
+ * This method is called by code autogenerated by the MXML compiler,
+ * after StyleManager.styles is popuplated with CSSStyleDeclarations.
+ */
+ [Deprecated(replacement="IStyleManager2.initProtoChainRoots on a style manager instance",
+ since="4.0")]
+ mx_internal static function initProtoChainRoots():void
+ {
+ impl.initProtoChainRoots();
+ }
+
+ /**
+ * Returns an Array of all the CSS selectors that are registered with the StyleManager.
+ * You can pass items in this Array to the <code>getStyleDeclaration()</code> method to get the corresponding CSSStyleDeclaration object.
+ * Class selectors are prepended with a period.
+ *
+ * @return An Array of all of the selectors
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.selectors on a style manager instance",
+ since="4.0")]
+ public static function get selectors():Array
+ {
+ return impl.selectors;
+ }
+
+ /**
+ * Gets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.getStyleDeclaration on a style manager instance",
+ since="4.0")]
+ public static function getStyleDeclaration(
+ selector:String):CSSStyleDeclaration
+ {
+ return impl.getStyleDeclaration(selector);
+ }
+
+ /**
+ * Sets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the specified selector is a "class selector" and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the specified selector is a "type selector" and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ * @param styleDeclaration The new style declaration.
+ * @param update Set to <code>true</code> to force an immediate update of the styles; internally, Flex
+ * calls the <code>styleChanged()</code> method of UIComponent.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ *
+ * <p>The styles will be updated the next time one of the following methods is called with
+ * the <code>update</code> property set to <code>true</code>:
+ * <ul>
+ * <li><code>clearStyleDeclaration()</code></li>
+ * <li><code>loadStyleDeclarations()</code></li>
+ * <li><code>setStyleDeclaration()</code></li>
+ * <li><code>unloadStyleDeclarations()</code></li>
+ * </ul>
+ * </p>
+ *
+ * <p>Typically, if you call the one of these methods multiple times,
+ * you set this property to <code>true</code> only on the last call,
+ * so that Flex does not call the <code>styleChanged()</code> method multiple times.</p>
+ *
+ * <p>If you call the <code>getStyle()</code> method, Flex returns the style value
+ * that was last applied to the UIComponent through a call to the <code>styleChanged()</code> method.
+ * The component's appearance might not reflect the value returned by the <code>getStyle()</code> method. This occurs
+ * because one of these style declaration methods might not yet have been called with the
+ * <code>update</code> property set to <code>true</code>.</p>
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.setStyleDeclaration on a style manager instance",
+ since="4.0")]
+ public static function setStyleDeclaration(
+ selector:String,
+ styleDeclaration:CSSStyleDeclaration,
+ update:Boolean):void
+ {
+ impl.setStyleDeclaration(selector, styleDeclaration, update);
+ }
+
+ /**
+ * Clears the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the specified selector is a class selector (for example, ".bigMargins" or ".myStyle"),
+ * you must be sure to start the
+ * <code>selector</code> property with a period (.).</p>
+ *
+ * <p>If the specified selector is a type selector (for example, "Button"), do not start the
+ * <code>selector</code> property with a period.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector to clear.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * For more information about this method, see the description in the <code>setStyleDeclaration()</code>
+ * method.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.clearStyleDeclaration on a style manager instance",
+ since="4.0")]
+ public static function clearStyleDeclaration(selector:String,
+ update:Boolean):void
+ {
+ impl.clearStyleDeclaration(selector, update);
+ }
+
+ /**
+ * @private
+ * After an entire selector is added, replaced, or removed,
+ * this method updates all the DisplayList trees.
+ */
+ [Deprecated(replacement="IStyleManager2.styleDeclarationsChanged on a style manager instance",
+ since="4.0")]
+ mx_internal static function styleDeclarationsChanged():void
+ {
+ impl.styleDeclarationsChanged();
+ }
+
+ /**
+ * Adds to the list of styles that can inherit values
+ * from their parents.
+ *
+ * <p><b>Note:</b> Ensure that you avoid using duplicate style names, as name
+ * collisions can result in decreased performance if a style that is
+ * already used becomes inheriting.</p>
+ *
+ * @param styleName The name of the style that is added to the list of styles that can inherit values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.registerInheritingStyle on a style manager instance",
+ since="4.0")]
+ public static function registerInheritingStyle(styleName:String):void
+ {
+ impl.registerInheritingStyle(styleName);
+ }
+
+ /**
+ * Tests to see if a style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified style is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isInheritingStyle on a style manager instance",
+ since="4.0")]
+ public static function isInheritingStyle(styleName:String):Boolean
+ {
+ return impl.isInheritingStyle(styleName);
+ }
+
+ /**
+ * Test to see if a TextFormat style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified TextFormat style
+ * is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isInheritingTextFormatStyle on a style manager instance",
+ since="4.0")]
+ public static function isInheritingTextFormatStyle(styleName:String):Boolean
+ {
+ return impl.isInheritingTextFormatStyle(styleName);
+ }
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.
+ *
+ * @param styleName The name of the style that you add to the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.registerSizeInvalidatingStyle on a style manager instance",
+ since="4.0")]
+ public static function registerSizeInvalidatingStyle(styleName:String):void
+ {
+ impl.registerSizeInvalidatingStyle(styleName);
+ }
+
+ /**
+ * Tests to see if a style changes the size of a component.
+ *
+ * <p>When one of these styles is set with the <code>setStyle()</code> method,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isSizeInvalidatingStyle on a style manager instance",
+ since="4.0")]
+ public static function isSizeInvalidatingStyle(styleName:String):Boolean
+ {
+ return impl.isSizeInvalidatingStyle(styleName);
+ }
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component's parent container.
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.registerParentSizeInvalidatingStyle on a style manager instance",
+ since="4.0")]
+ public static function registerParentSizeInvalidatingStyle(styleName:String):void
+ {
+ impl.registerParentSizeInvalidatingStyle(styleName);
+ }
+
+ /**
+ * Tests to see if the style changes the size of the component's parent container.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isParentSizeInvalidatingStyle on a style manager instance",
+ since="4.0")]
+ public static function isParentSizeInvalidatingStyle(styleName:String):Boolean
+ {
+ return impl.isParentSizeInvalidatingStyle(styleName);
+ }
+
+ /**
+ * Adds to the list of styles which may affect the appearance
+ * or layout of the component's parent container.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.registerParentDisplayListInvalidatingStyle on a style manager instance",
+ since="4.0")]
+ public static function registerParentDisplayListInvalidatingStyle(
+ styleName:String):void
+ {
+ impl.registerParentDisplayListInvalidatingStyle(styleName);
+ }
+
+ /**
+ * Tests to see if this style affects the component's parent container in
+ * such a way as to require that the parent container redraws itself when this style changes.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the appearance or layout of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isParentDisplayListInvalidatingStyle on a style manager instance",
+ since="4.0")]
+ public static function isParentDisplayListInvalidatingStyle(
+ styleName:String):Boolean
+ {
+ return impl.isParentDisplayListInvalidatingStyle(styleName);
+ }
+
+ /**
+ * Adds a color name to the list of aliases for colors.
+ *
+ * @param colorName The name of the color to add to the list; for example, "blue".
+ * If you later access this color name, the value is not case-sensitive.
+ *
+ * @param colorValue Color value, for example, 0x0000FF.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.registerColorName on a style manager instance",
+ since="4.0")]
+ public static function registerColorName(colorName:String, colorValue:uint):void
+ {
+ impl.registerColorName(colorName, colorValue);
+ }
+
+ /**
+ * Tests to see if the given String is an alias for a color value. For example,
+ * by default, the String "blue" is an alias for 0x0000FF.
+ *
+ * @param colorName The color name to test. This parameter is not case-sensitive.
+ *
+ * @return Returns <code>true</code> if <code>colorName</code> is an alias
+ * for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isColorName on a style manager instance",
+ since="4.0")]
+ public static function isColorName(colorName:String):Boolean
+ {
+ return impl.isColorName(colorName);
+ }
+
+ /**
+ * Returns the numeric RGB color value that corresponds to the
+ * specified color string.
+ * The color string can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>.
+ *
+ * <p>This method returns a uint, such as 4521830, that represents a color. You can convert
+ * this uint to a hexadecimal value by passing the numeric base (in this case, 16), to
+ * the uint class's <code>toString()</code> method, as the following example shows:</p>
+ * <pre>
+ * import mx.styles.StyleManager;
+ * private function getNewColorName():void {
+ * StyleManager.registerColorName("soylentGreen",0x44FF66);
+ * trace(StyleManager.getColorName("soylentGreen").toString(16));
+ * }
+ * </pre>
+ *
+ * @param colorName The color name.
+ *
+ * @return Returns a uint that represents the color value or <code>NOT_A_COLOR</code>
+ * if the value of the <code>colorName</code> property is not an alias for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.getColorName on a style manager instance",
+ since="4.0")]
+ public static function getColorName(colorName:Object):uint
+ {
+ return impl.getColorName(colorName);
+ }
+
+ /**
+ * Converts each element of the colors Array from a color name
+ * to a numeric RGB color value.
+ * Each color String can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>..
+ *
+ * @param colors An Array of color names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.getColorNames on a style manager instance",
+ since="4.0")]
+ public static function getColorNames(colors:Array /* of Number or String */):void
+ {
+ impl.getColorNames(colors);
+ }
+
+ /**
+ * Determines if a specified parameter is a valid style property. For example:
+ *
+ * <pre>
+ * trace(StyleManager.isValidStyleValue(myButton.getStyle("color")).toString());
+ * </pre>
+ *
+ * <p>This can be useful because some styles can be set to values
+ * such as 0, <code>NaN</code>,
+ * the empty String (<code>""</code>), or <code>null</code>, which can
+ * cause an <code>if (value)</code> test to fail.</p>
+ *
+ * @param value The style property to test.
+ *
+ * @return If you pass the value returned by a <code>getStyle()</code> method call
+ * to this method, it returns <code>true</code> if the style
+ * was set and <code>false</code> if it was not set.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.isValidStyleValue on a style manager instance",
+ since="4.0")]
+ public static function isValidStyleValue(value:*):Boolean
+ {
+ return impl.isValidStyleValue(value);
+ }
+
+ /**
+ * Loads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ *
+ * @param update Set to <code>true</code> to force
+ * an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update
+ * of the styles in the application.
+ * This parameter is optional and defaults to <code>true</code>
+ * For more information about this parameter, see the description
+ * in the <code>setStyleDeclaration()</code> method.
+ *
+ * @param trustContent Obsolete, no longer used.
+ * This parameter is optional and defaults to <code>false</code>.
+ *
+ * @param applicationDomain The ApplicationDomain passed to the
+ * <code>load()</code> method of the IModuleInfo that loads the style SWF.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @param securityDomain The SecurityDomain passed to the
+ * <code>load()</code> method of the IModuleInfo that loads the style SWF.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @return An IEventDispatcher implementation that supports
+ * StyleEvent.PROGRESS, StyleEvent.COMPLETE, and
+ * StyleEvent.ERROR.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.loadStyleDeclarations on a style manager instance",
+ since="4.0")]
+ COMPILE::LATER
+ public static function loadStyleDeclarations(
+ url:String, update:Boolean = true,
+ trustContent:Boolean = false,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):IEventDispatcher
+ {
+ return impl.loadStyleDeclarations2(url, update,
+ applicationDomain, securityDomain);
+ }
+
+ /**
+ * Unloads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * For more information about this method, see the description in the <code>setStyleDeclaration()</code>
+ * method.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Deprecated(replacement="IStyleManager2.unloadStyleDeclarations on a style manager instance",
+ since="4.0")]
+ COMPILE::LATER
+ public static function unloadStyleDeclarations(
+ url:String, update:Boolean = true):void
+ {
+ impl.unloadStyleDeclarations(url, update);
+ }
+}
+
+}
[36/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/BindingManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/BindingManager.as b/frameworks/projects/MX/src/main/flex/mx/binding/BindingManager.as
new file mode 100644
index 0000000..c70cf16
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/BindingManager.as
@@ -0,0 +1,275 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core.mx_internal;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class BindingManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Store a Binding for the destination relative to the passed in document.
+ * We don't hold a list of bindings per destination
+ * even though it is possible to have multiple.
+ * The reason is that when we refresh the last binding will
+ * always win anyway, so why execute the ones that will lose.
+ *
+ * @param document The document that this binding relates to.
+ *
+ * @param destStr The destination field of this binding.
+ *
+ * @param b The binding itself.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function addBinding(document:Object, destStr:String,
+ b:Binding):void
+ {
+ if (!document._bindingsByDestination)
+ {
+ document._bindingsByDestination = {};
+ document._bindingsBeginWithWord = {};
+ }
+
+ document._bindingsByDestination[destStr] = b;
+ document._bindingsBeginWithWord[getFirstWord(destStr)] = true;
+ }
+
+ /**
+ * Set isEnabled for all bindings associated with a document.
+ *
+ * @param document The document that contains the bindings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setEnabled(document:Object, isEnabled:Boolean):void
+ {
+ if ((document is IBindingClient) && document._bindings)
+ {
+ var bindings:Array = document._bindings as Array;
+
+ for (var i:uint = 0; i < bindings.length; i++)
+ {
+ var binding:Binding = bindings[i];
+ binding.isEnabled = isEnabled;
+ }
+ }
+ }
+
+ /**
+ * Execute all bindings that bind into the specified object.
+ *
+ * @param document The document that this binding relates to.
+ *
+ * @param destStr The destination field that needs to be refreshed.
+ *
+ * @param destObj The actual destination object
+ * (used for RepeatableBinding).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function executeBindings(document:Object,
+ destStr:String,
+ destObj:Object):void
+ {
+ // Bail if this method is accidentally called with an empty or
+ // null destination string. Otherwise, all bindings will
+ // be executed!
+ if (!destStr || (destStr == ""))
+ return;
+
+ // Flex 3 documents will implement IBindingClient when using
+ // data binding. Flex 2.X document's will have a non-null
+ // public _bindingsByDestination variable.
+ if (document &&
+ (document is IBindingClient || document.hasOwnProperty("_bindingsByDestination")) &&
+ document._bindingsByDestination &&
+ document._bindingsBeginWithWord[getFirstWord(destStr)])
+ {
+ for (var binding:String in document._bindingsByDestination)
+ {
+ // If we have been told to execute bindings into a UIComponent
+ // or Repeater with id "a", we want to execute all bindings
+ // whose destination strings look like "a", "a.b", "a.b.c",
+ // "a['b']", etc. but not "aa.bb", "b.a", "b.a.c", "b['a']",
+ // etc.
+
+ // Currently, the only way that this method is used by the
+ // framework is when the destStr passed in is the id of a
+ // UIComponent or Repeater.
+
+ // However, advanced users can call
+ // BindingManager.executeBindings() and pass a compound
+ // destStr like "a.b.c". This has a gotcha: If they have
+ // written <mx:Binding> tags with destination attributes
+ // like "a['b'].c.d" rather than "a.b.c.d", these will
+ // not get executed. They should pass the same form of
+ // destStr to executeBindings() as they used in their
+ // Binding tags.
+
+ if (binding.charAt(0) == destStr.charAt(0))
+ {
+ var length:int = destStr.length;
+ if (
+ //check if binding start with destStr+"." or destStr+"[" with a minimum number of string allocations
+ (length < binding.length && binding.indexOf(destStr) == 0 && (binding.charAt(length) == "." || binding.charAt(length) == "["))
+ || binding == destStr)
+ {
+ // If this is a RepeatableBindings, execute it on just the
+ // specified object, not on all its repeated siblings. For
+ // example, if we are instantiating o[2][3], we don't want to also
+ // refresh o[0][0], o[0][1], etc.
+ document._bindingsByDestination[binding].execute(destObj);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Enable or disable all bindings that bind into the specified object
+ * and match the input destStr.
+ *
+ * @param document The document that this binding relates to.
+ *
+ * @param destStr The destination field that needs to be refreshed.
+ *
+ * @param enable If true enables the specified binding(s), otherwise
+ * disables.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2/5
+ * @productversion Flex 4.5
+ */
+ public static function enableBindings(document:Object,
+ destStr:String,
+ enable:Boolean = true):void
+ {
+ // See implementation comments above for executeBindings as this
+ // method follows the same logic.
+
+ if (!destStr || (destStr == ""))
+ return;
+
+ if (document &&
+ (document is IBindingClient || document.hasOwnProperty("_bindingsByDestination")) &&
+ document._bindingsByDestination &&
+ document._bindingsBeginWithWord[getFirstWord(destStr)])
+ {
+ for (var binding:String in document._bindingsByDestination)
+ {
+ if (binding.charAt(0) == destStr.charAt(0))
+ {
+ if (binding.indexOf(destStr + ".") == 0 ||
+ binding.indexOf(destStr + "[") == 0 ||
+ binding == destStr)
+ {
+ document._bindingsByDestination[binding].isEnabled = enable;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private static function getFirstWord(destStr:String):String
+ {
+ // indexPeriod and indexBracket will be equal only if they
+ // both are -1.
+ var indexPeriod:int = destStr.indexOf(".");
+ var indexBracket:int = destStr.indexOf("[");
+ if (indexPeriod == indexBracket)
+ return destStr;
+
+ // Get the characters leading up to the first period or
+ // bracket.
+ var minIndex:int = Math.min(indexPeriod, indexBracket);
+ if (minIndex == -1)
+ minIndex = Math.max(indexPeriod, indexBracket);
+
+ return destStr.substr(0, minIndex);
+ }
+
+ /**
+ * @private
+ */
+ internal static var debugDestinationStrings:Object = {};
+
+ /**
+ * Enables debugging output for the Binding or Bindings with a matching
+ * destination string.
+ *
+ * @param destinationString The Binding's destination string.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function debugBinding(destinationString:String):void
+ {
+ debugDestinationStrings[destinationString] = true;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * BindingManager has only static methods.
+ * We don't create instances of BindingManager.
+ */
+ public function BindingManager()
+ {
+ super();
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/EvalBindingResponder.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/EvalBindingResponder.as b/frameworks/projects/MX/src/main/flex/mx/binding/EvalBindingResponder.as
new file mode 100644
index 0000000..e5c0a3f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/EvalBindingResponder.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.rpc.IResponder;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This responder is a fallback in case the set or get methods
+ * we are invoking to implement this binding do not properly
+ * catch the ItemPendingError. There may be some issues with
+ * leaving this in long term as we are not handling the
+ * case where this binding is executed multiple times in
+ * rapid succession (and thus piling up responders) and
+ * also not dealing with a potential stale item responder.
+ */
+public class EvalBindingResponder implements IResponder
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Constructor.
+ */
+ public function EvalBindingResponder(binding:Binding, object:Object)
+ {
+ super();
+
+ this.binding = binding;
+ this.object = object;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var binding:Binding;
+
+ /**
+ * @private
+ */
+ private var object:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function result(data:Object):void
+ {
+ binding.execute(object);
+ }
+
+ /**
+ * @private
+ */
+ public function fault(data:Object):void
+ {
+ // skip it
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/FunctionReturnWatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/FunctionReturnWatcher.as b/frameworks/projects/MX/src/main/flex/mx/binding/FunctionReturnWatcher.as
new file mode 100644
index 0000000..7c42552
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/FunctionReturnWatcher.as
@@ -0,0 +1,295 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.events.Event;
+import flex.events.IEventDispatcher;
+import mx.core.EventPriority;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class FunctionReturnWatcher extends Watcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Constructor.
+ */
+ public function FunctionReturnWatcher(functionName:String,
+ document:Object,
+ parameterFunction:Function,
+ events:Object,
+ listeners:Array,
+ functionGetter:Function = null,
+ isStyle:Boolean = false)
+ {
+ super(listeners);
+
+ this.functionName = functionName;
+ this.document = document;
+ this.parameterFunction = parameterFunction;
+ this.events = events;
+ this.functionGetter = functionGetter;
+ this.isStyle = isStyle;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The name of the property, used to actually get the property
+ * and for comparison in propertyChanged events.
+ */
+ private var functionName:String;
+
+ /**
+ * @private
+ * The document is what we need to use to execute the parameter function.
+ */
+ private var document:Object;
+
+ /**
+ * @private
+ * The function that will give us the parameters for calling the function.
+ */
+ private var parameterFunction:Function;
+
+ /**
+ * @private
+ * The events that indicate the property has changed.
+ */
+ private var events:Object;
+
+ /**
+ * @private
+ * The parent object of this function.
+ */
+ private var parentObj:Object;
+
+ /**
+ * @private
+ * The watcher holding onto the parent object.
+ */
+ public var parentWatcher:Watcher;
+
+ /**
+ * Storage for the functionGetter property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var functionGetter:Function;
+
+ /**
+ * Storage for the isStyle property. This will be true, when
+ * watching a function marked with [Bindable(style="true")]. For
+ * example, UIComponent.getStyle().
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ private var isStyle:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function updateParent(parent:Object):void
+ {
+ if (!(parent is Watcher))
+ setupParentObj(parent);
+
+ else if (parent == parentWatcher)
+ setupParentObj(parentWatcher.value);
+
+ updateFunctionReturn();
+ }
+
+ /**
+ * @private
+ */
+ override protected function shallowClone():Watcher
+ {
+ var clone:FunctionReturnWatcher = new FunctionReturnWatcher(functionName,
+ document,
+ parameterFunction,
+ events,
+ listeners,
+ functionGetter);
+
+ return clone;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Get the new return value of the function.
+ */
+ public function updateFunctionReturn():void
+ {
+ wrapUpdate(function():void
+ {
+ if (functionGetter != null)
+ {
+ value = functionGetter(functionName).apply(parentObj,
+ parameterFunction.apply(document));
+ }
+ else
+ {
+ value = parentObj[functionName].apply(parentObj,
+ parameterFunction.apply(document));
+ }
+
+ updateChildren();
+ });
+ }
+
+ /**
+ * @private
+ */
+ private function setupParentObj(newParent:Object):void
+ {
+ var eventDispatcher:IEventDispatcher;
+ var eventName:String;
+
+ // Remove listeners from the old "watched" object.
+ if (parentObj != null &&
+ parentObj is IEventDispatcher)
+ {
+ eventDispatcher = parentObj as IEventDispatcher;
+
+ // events can be null when watching a function marked with
+ // [Bindable(style="true")].
+ if (events != null)
+ {
+ for (eventName in events)
+ {
+ if (eventName != "__NoChangeEvent__")
+ {
+ eventDispatcher.removeEventListener(eventName, eventHandler);
+ }
+ }
+ }
+
+ if (isStyle)
+ {
+ // For example, if the data binding expression is
+ // {getStyle("color")}, the eventName will be
+ // "colorChanged".
+ eventName = parameterFunction.apply(document) + "Changed";
+ eventDispatcher.removeEventListener(eventName, eventHandler);
+ eventDispatcher.removeEventListener("allStylesChanged", eventHandler);
+ }
+ }
+
+ parentObj = newParent;
+
+ // Add listeners the new "watched" object.
+ if (parentObj != null &&
+ parentObj is IEventDispatcher)
+ {
+ eventDispatcher = parentObj as IEventDispatcher;
+
+ // events can be null when watching a function marked with
+ // [Bindable(style="true")].
+ if (events != null)
+ {
+ for (eventName in events)
+ {
+ if (eventName != "__NoChangeEvent__")
+ {
+ eventDispatcher.bindingEventDispatcher.addEventListener(eventName, eventHandler,
+ false);
+ }
+ }
+ }
+
+ if (isStyle)
+ {
+ // For example, if the data binding expression is
+ // {getStyle("color")}, the eventName will be
+ // "colorChanged".
+ eventName = parameterFunction.apply(document) + "Changed";
+ eventDispatcher.bindingEventDispatcher.addEventListener(eventName, eventHandler, false);
+ eventDispatcher.bindingEventDispatcher.addEventListener("allStylesChanged", eventHandler, false);
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function eventHandler(event:Event):void
+ {
+ updateFunctionReturn();
+
+ // events can be null when watching a function marked with
+ // [Bindable(style="true")].
+ if (events != null)
+ {
+ notifyListeners(events[event.type]);
+ }
+
+ if (isStyle)
+ {
+ notifyListeners(true);
+ }
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/IBindingClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/IBindingClient.as b/frameworks/projects/MX/src/main/flex/mx/binding/IBindingClient.as
new file mode 100644
index 0000000..dfe6950
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/IBindingClient.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 mx.binding
+{
+
+/**
+ * This is used to mark documents, which have data bindings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IBindingClient
+{
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/PropertyWatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/PropertyWatcher.as b/frameworks/projects/MX/src/main/flex/mx/binding/PropertyWatcher.as
new file mode 100644
index 0000000..b5223cf
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/PropertyWatcher.as
@@ -0,0 +1,388 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.events.Event;
+import org.apache.flex.events.IEventDispatcher;
+import org.apache.flex.reflection.getQualifiedClassName;
+import mx.core.mx_internal;
+import mx.events.PropertyChangeEvent;
+import mx.utils.DescribeTypeCache;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class PropertyWatcher extends Watcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Create a PropertyWatcher
+ *
+ * @param prop The name of the property to watch.
+ * @param event The event type that indicates the property has changed.
+ * @param listeners The binding objects that are listening to this Watcher.
+ * @param propertyGetter A helper function used to access non-public variables.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function PropertyWatcher(propertyName:String,
+ events:Object,
+ listeners:Array,
+ propertyGetter:Function = null)
+ {
+ super(listeners);
+
+ _propertyName = propertyName;
+ this.events = events;
+ this.propertyGetter = propertyGetter;
+ useRTTI = !events;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The parent object of this property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var parentObj:Object;
+
+ /**
+ * The events that indicate the property has changed
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var events:Object;
+
+ /**
+ * Storage for the propertyGetter property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var propertyGetter:Function;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // propertyName
+ //----------------------------------
+
+ /**
+ * Storage for the propertyName property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var _propertyName:String;
+
+ /**
+ * The name of the property this Watcher is watching.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get propertyName():String
+ {
+ return _propertyName;
+ }
+
+ //----------------------------------
+ // useRTTI
+ //----------------------------------
+
+ /**
+ * If compiler can't determine bindability from static type,
+ * use RTTI on runtime values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var useRTTI:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Watcher
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * If the parent has changed we need to update ourselves
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function updateParent(parent:Object):void
+ {
+ if (parentObj && parentObj is IEventDispatcher)
+ {
+ for (var eventType:String in events)
+ {
+ parentObj.removeEventListener(eventType, eventHandler);
+ }
+ }
+
+ if (parent is Watcher)
+ parentObj = parent.value;
+ else
+ parentObj = parent;
+
+ if (parentObj)
+ {
+ if (useRTTI)
+ {
+ // Use RTTI to ensure that parentObj is an IEventDispatcher,
+ // and that bindability metadata exists
+ // for parentObj[_propertyName].
+
+ events = {};
+
+ if (parentObj is IEventDispatcher)
+ {
+ var info:BindabilityInfo =
+ DescribeTypeCache.describeType(parentObj).
+ bindabilityInfo;
+
+ events = info.getChangeEvents(_propertyName);
+
+ if (objectIsEmpty(events))
+ {
+ trace("warning: unable to bind to property '" +
+ _propertyName + "' on class '" +
+ getQualifiedClassName(parentObj) + "'");
+ }
+ else
+ {
+ addParentEventListeners();
+ }
+ }
+ else
+ {
+ trace("warning: unable to bind to property '" +
+ _propertyName + "' on class '" +
+ getQualifiedClassName(parentObj) +
+ "' (class is not an IEventDispatcher)");
+ }
+ }
+ else
+ {
+ // useRTTI == false implies that the compiler
+ // has provided us with a list of change events.
+ // NOTE: this normally also implies that parentObj
+ // is guaranteed to implement IEventDispatcher.
+ // The guard below is necessitated by Proxy cases,
+ // which provide blanket bindability information
+ // on properties which are not strongly typed,
+ // and so could accept values that do not implement
+ // IEventDispatcher.
+ // In these cases, correct binding behavior depends on
+ // the Proxy implementation providing after-the-fact
+ // bindability by wrapping assigned values and attaching
+ // event listeners at that point.
+ // Here we can only fail silently.
+
+ if (parentObj is IEventDispatcher)
+ addParentEventListeners();
+ }
+ }
+
+ // Now get our property.
+ wrapUpdate(updateProperty);
+ }
+
+ /**
+ * @private
+ */
+ override protected function shallowClone():Watcher
+ {
+ var clone:PropertyWatcher = new PropertyWatcher(_propertyName,
+ events,
+ listeners,
+ propertyGetter);
+
+ return clone;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private function addParentEventListeners():void
+ {
+ for (var eventType:String in events)
+ {
+ if (eventType != "__NoChangeEvent__")
+ {
+ parentObj.bindingEventDispatcher.addEventListener(
+ eventType, eventHandler, false);
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function traceInfo():String
+ {
+ return "Watcher(" + getQualifiedClassName(parentObj) + "." +
+ _propertyName + "): events = [" +
+ eventNamesToString() + (useRTTI ? "] (RTTI)" : "]");
+ }
+
+ /**
+ * @private
+ */
+ private function eventNamesToString():String
+ {
+ var s:String = " ";
+
+ for (var ev:String in events)
+ {
+ s += ev + " ";
+ }
+
+ return s;
+ }
+
+ /**
+ * @private
+ */
+ private function objectIsEmpty(o:Object):Boolean
+ {
+ for (var p:String in o)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Gets the actual property then updates
+ * the Watcher's children appropriately.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function updateProperty():void
+ {
+ if (parentObj)
+ {
+ if (_propertyName == "this")
+ {
+ value = parentObj;
+ }
+ else
+ {
+ if (propertyGetter != null)
+ {
+ value = propertyGetter.apply(parentObj, [ _propertyName ]);
+ }
+ else
+ {
+ value = parentObj[_propertyName];
+ }
+ }
+ }
+ else
+ {
+ value = null;
+ }
+
+ updateChildren();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The generic event handler.
+ * The only event we'll hear indicates that the property has changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function eventHandler(event:Event):void
+ {
+ if (event is PropertyChangeEvent)
+ {
+ var propName:Object = PropertyChangeEvent(event).property;
+
+ if (propName != _propertyName)
+ return;
+ }
+
+ wrapUpdate(updateProperty);
+
+ notifyListeners(events[event.type]);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/StaticPropertyWatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/StaticPropertyWatcher.as b/frameworks/projects/MX/src/main/flex/mx/binding/StaticPropertyWatcher.as
new file mode 100644
index 0000000..9903489
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/StaticPropertyWatcher.as
@@ -0,0 +1,278 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.events.Event;
+import flex.events.IEventDispatcher;
+import mx.events.PropertyChangeEvent;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class StaticPropertyWatcher extends Watcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Create a StaticPropertyWatcher
+ *
+ * @param prop The name of the static property to watch.
+ * @param event The event type that indicates the static property has changed.
+ * @param listeners The binding objects that are listening to this Watcher.
+ * @param propertyGetter A helper function used to access non-public variables.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function StaticPropertyWatcher(propertyName:String,
+ events:Object,
+ listeners:Array,
+ propertyGetter:Function = null)
+ {
+ super(listeners);
+
+ _propertyName = propertyName;
+ this.events = events;
+ this.propertyGetter = propertyGetter;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The parent class of this static property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var parentObj:Class;
+
+ /**
+ * The events that indicate the static property has changed
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var events:Object;
+
+ /**
+ * Storage for the propertyGetter property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var propertyGetter:Function;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // propertyName
+ //----------------------------------
+
+ /**
+ * Storage for the propertyName property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var _propertyName:String;
+
+ /**
+ * The name of the property this Watcher is watching.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get propertyName():String
+ {
+ return _propertyName;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Watcher
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * If the parent has changed we need to update ourselves
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function updateParent(parent:Object):void
+ {
+ // The assumption is that parent is of type, Class, and that
+ // the class has a static variable or property,
+ // staticEventDispatcher, of type IEventDispatcher.
+ parentObj = Class(parent);
+
+ if (parentObj["staticEventDispatcher"] != null)
+ {
+ for (var eventType:String in events)
+ {
+ if (eventType != "__NoChangeEvent__")
+ {
+ var eventDispatcher:IEventDispatcher = parentObj["staticEventDispatcher"];
+
+ eventDispatcher.bindingEventDispatcher.addEventListener(eventType, eventHandler, false);
+ }
+ }
+ }
+
+ // Now get our property.
+ wrapUpdate(updateProperty);
+ }
+
+ /**
+ * @private
+ */
+ override protected function shallowClone():Watcher
+ {
+ var clone:StaticPropertyWatcher = new StaticPropertyWatcher(_propertyName,
+ events,
+ listeners,
+ propertyGetter);
+
+ return clone;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private function traceInfo():String
+ {
+ return ("StaticPropertyWatcher(" + parentObj + "." + _propertyName +
+ "): events = [" + eventNamesToString() + "]");
+ }
+
+ /**
+ * @private
+ */
+ private function eventNamesToString():String
+ {
+ var s:String = " ";
+
+ for (var ev:String in events)
+ {
+ s += ev + " ";
+ }
+
+ return s;
+ }
+
+ /**
+ * Gets the actual property then updates
+ * the Watcher's children appropriately.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function updateProperty():void
+ {
+ if (parentObj)
+ {
+ if (propertyGetter != null)
+ {
+ value = propertyGetter.apply(parentObj, [ _propertyName ]);
+ }
+ else
+ {
+ value = parentObj[_propertyName];
+ }
+ }
+ else
+ {
+ value = null;
+ }
+
+ updateChildren();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The generic event handler.
+ * The only event we'll hear indicates that the property has changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function eventHandler(event:Event):void
+ {
+ if (event is PropertyChangeEvent)
+ {
+ var propName:Object = PropertyChangeEvent(event).property;
+
+ if (propName != _propertyName)
+ return;
+ }
+
+ wrapUpdate(updateProperty);
+
+ notifyListeners(events[event.type]);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/Watcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/Watcher.as b/frameworks/projects/MX/src/main/flex/mx/binding/Watcher.as
new file mode 100644
index 0000000..fef6ee3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/Watcher.as
@@ -0,0 +1,323 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class Watcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function Watcher(listeners:Array = null)
+ {
+ super();
+
+ this.listeners = listeners;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The binding objects that are listening to this Watcher.
+ * The standard event mechanism isn't used because it's too heavyweight.
+ */
+ protected var listeners:Array;
+
+ /**
+ * @private
+ * Children of this watcher are watching sub values.
+ */
+ protected var children:Array;
+
+ /**
+ * @private
+ * The value itself.
+ */
+ public var value:Object;
+
+ /**
+ * @private
+ * Keep track of cloning when used in Repeaters.
+ */
+ protected var cloneIndex:int;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This is an abstract method that subclasses implement.
+ */
+ public function updateParent(parent:Object):void
+ {
+ }
+
+ /**
+ * @private
+ * Add a child to this watcher, meaning that the child
+ * is watching a sub value of ours.
+ */
+ public function addChild(child:Watcher):void
+ {
+ if (!children)
+ children = [ child ];
+ else
+ children.push(child);
+
+ child.updateParent(this);
+ }
+
+ /**
+ * @private
+ * Remove all children beginning at a starting index.
+ * If the index is not specified, it is assumed to be 0.
+ * This capability is used by Repeater, which must remove
+ * cloned RepeaterItemWatchers (and their descendant watchers).
+ */
+ public function removeChildren(startingIndex:int):void
+ {
+ children.splice(startingIndex);
+ }
+
+ /**
+ * We have probably changed, so go through
+ * and make sure our children are updated.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function updateChildren():void
+ {
+ if (children)
+ {
+ var n:int = children.length;
+ for (var i:int = 0; i < n; ++i)
+ {
+ children[i].updateParent(this);
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function valueChanged(oldval:Object):Boolean
+ {
+ if (oldval == null && value == null)
+ return false;
+
+ var valType:String = typeof(value);
+
+ // The first check is meant to catch the delayed instantiation case
+ // where a control comes into existence but its value is still
+ // the equivalent of not having been filled in.
+ // Otherwise we simply return whether the value has changed.
+
+ if (valType == "string")
+ {
+ if (oldval == null && value == "")
+ return false;
+ else
+ return oldval != value;
+ }
+
+ if (valType == "number")
+ {
+ if (oldval == null && value == 0)
+ return false;
+ else
+ return oldval != value;
+ }
+
+ if (valType == "boolean")
+ {
+ if (oldval == null && value == false)
+ return false;
+ else
+ return oldval != value;
+ }
+
+ return true;
+ }
+
+ /**
+ * @private
+ */
+ protected function wrapUpdate(wrappedFunction:Function):void
+ {
+ try
+ {
+ wrappedFunction.apply(this);
+ }
+ catch(error:Error)
+ {
+ if (error is ItemPendingError) {
+ // The parent's value is not yet available. This is being ignored for now -
+ // updateParent() will be called when the parent has a value.
+ value = null;
+ } else if (error is RangeError) {
+ // The parent's value is not yet available. This is being ignored for now -
+ // updateParent() will be called when the parent has a value.
+ value = null;
+ } else {
+ // Certain errors are normal when executing an update, 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
+ // Error #1507: - invalid null argument.
+ // We allow any other errors to be thrown.
+ if ((error.errorID != 1006) &&
+ (error.errorID != 1009) &&
+ (error.errorID != 1010) &&
+ (error.errorID != 1055) &&
+ (error.errorID != 1069) &&
+ (error.errorID != 1507))
+ {
+ throw error;
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ * Clone this Watcher and all its descendants.
+ * Each clone triggers the same Bindings as the original;
+ * in other words, the Bindings do not get cloned.
+ *
+ * This cloning capability is used by Repeater in order
+ * to watch the subproperties of multiple dataProvider items.
+ * For example, suppose a repeated LinkButton's label is
+ * {r.currentItem.firstName} {r.currentItem.lastName}
+ * where r is a Repeater whose dataProvider is
+ * [ { firstName: "Matt", lastName: "Chotin" },
+ * { firstName: "Gordon", lastName: "Smith" } ]
+ * The MXML compiler emits a watcher tree (one item of _watchers[])
+ * that looks like this:
+ * PropertyWatcher for "r"
+ * PropertyWatcher for "dataProvider"
+ * RepeaterItemWatcher
+ * PropertyWatcher for "firstName"
+ * PropertyWatcher for "lastName"
+ * At runtime the RepeaterItemWatcher serves as a template
+ * which gets cloned for each dataProvider item:
+ * PropertyWatcher for "r"
+ * PropertyWatcher for "dataProvider"
+ * RepeaterItemWatcher (index: null)
+ * PropertyWatcher for "firstName" (value: null)
+ * PropertyWatcher for "lastName" (value: null)
+ * RepeaterItemWatcher (index: 0)
+ * PropertyWatcher for "firstName" (value: "Matt")
+ * PropertyWatcher for "lastName" (value: "Chotin")
+ * RepeaterItemWatcher (index: 1)
+ * PropertyWatcher for "firstName" (value: "Gordon")
+ * PropertyWatcher for "lastName" (value: "Smith")
+ */
+ protected function deepClone(index:int):Watcher
+ {
+ // Clone this watcher object itself.
+ var w:Watcher = shallowClone();
+ w.cloneIndex = index;
+
+ // Clone its listener queue.
+ if (listeners)
+ {
+ w.listeners = listeners.concat();
+ }
+
+ // Recursively clone its children.
+ if (children)
+ {
+ var n:int = children.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var clonedChild:Watcher = children[i].deepClone(index);
+ w.addChild(clonedChild);
+ }
+ }
+
+ // Return the cloned tree of watchers.
+ return w;
+ }
+
+ /**
+ * @private
+ * Clone this watcher object itself, without cloning its children.
+ * The clone is not connec
+ * Subclasses must override this method to copy their properties.
+ */
+ protected function shallowClone():Watcher
+ {
+ return new Watcher();
+ }
+
+ /**
+ * @private
+ */
+ public function notifyListeners(commitEvent:Boolean):void
+ {
+ if (listeners)
+ {
+ var n:int = listeners.length;
+
+ for (var i:int = 0; i < n; i++)
+ {
+ listeners[i].watcherFired(commitEvent, cloneIndex);
+ }
+ }
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/binding/XMLWatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/XMLWatcher.as b/frameworks/projects/MX/src/main/flex/mx/binding/XMLWatcher.as
new file mode 100644
index 0000000..617cd04
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/XMLWatcher.as
@@ -0,0 +1,191 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core.mx_internal;
+import mx.utils.XMLNotifier;
+import mx.utils.IXMLNotifiable;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class XMLWatcher extends Watcher implements IXMLNotifiable
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function XMLWatcher(propertyName:String, listeners:Array)
+ {
+ super(listeners);
+
+ _propertyName = propertyName;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The parent object of this property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var parentObj:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // propertyName
+ //----------------------------------
+
+ /**
+ * Storage for the propertyName property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private var _propertyName:String;
+
+ /**
+ * The name of the property this Watcher is watching.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get propertyName():String
+ {
+ return _propertyName;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Watcher
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * If the parent has changed we need to update ourselves
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function updateParent(parent:Object):void
+ {
+ if (parentObj && (parentObj is XML || parentObj is XMLList))
+ XMLNotifier.getInstance().unwatchXML(parentObj, this);
+
+ if (parent is Watcher)
+ parentObj = parent.value;
+ else
+ parentObj = parent;
+
+ if (parentObj && (parentObj is XML || parentObj is XMLList))
+ XMLNotifier.getInstance().watchXML(parentObj, this);
+
+ // Now get our property.
+ wrapUpdate(updateProperty);
+ }
+
+ /**
+ * @private
+ */
+ override protected function shallowClone():Watcher
+ {
+ return new XMLWatcher(_propertyName, listeners);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the actual property then updates
+ * the Watcher's children appropriately.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function updateProperty():void
+ {
+ if (parentObj)
+ {
+ if (_propertyName == "this")
+ value = parentObj;
+ else
+ value = parentObj[_propertyName];
+ }
+ else
+ {
+ value = null;
+ }
+
+ updateChildren();
+ }
+
+ /**
+ * @private
+ */
+ public function xmlNotification(currentTarget:Object, type:String,
+ target:Object, value:Object, detail:Object):void
+ {
+ updateProperty();
+
+ notifyListeners(true);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..4c40ad4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/collections/IList.as
@@ -0,0 +1,271 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.collections
+{
+
+import flash.events.IEventDispatcher;
+import mx.events.CollectionEvent;
+
+/**
+ * Dispatched when the IList has been updated in some way.
+ *
+ * @eventType mx.events.CollectionEvent.COLLECTION_CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="collectionChange", type="mx.events.CollectionEvent")]
+
+/**
+ * A collection of items organized in an ordinal fashion.
+ * Provides access and manipulation methods based on index.
+ *
+ * <p>An <code>IList</code> may be a view onto data
+ * that has been retrieved from a remote location.
+ * When writing for a collection that may be remote,
+ * it is important to handle the case where data
+ * may not yet be available, which is indicated
+ * by the <code>ItemPendingError</code>.</p>
+ *
+ * <p>The <code>ICollectionView</code> is an alternative
+ * to the <code>IList</code>.</p>
+ *
+ * @see mx.collections.errors.ItemPendingError
+ * @see mx.collections.ICollectionView
+ * @see mx.collections.ListCollectionView
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IList extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // length
+ //----------------------------------
+
+ /**
+ * The number of items in this collection.
+ * 0 means no items while -1 means the length is unknown.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get length():int;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds the specified item to the end of the list.
+ * Equivalent to <code>addItemAt(item, length)</code>.
+ *
+ * @param item The item to add.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addItem(item:Object):void;
+
+ /**
+ * Adds the item at the specified index.
+ * The index of any item greater than the index of the added item is increased by one.
+ * If the the specified index is less than zero or greater than the length
+ * of the list, a RangeError is thrown.
+ *
+ * @param item The item to place at the index.
+ *
+ * @param index The index at which to place the item.
+ *
+ * @throws RangeError if index is less than 0 or greater than the length of the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addItemAt(item:Object, index:int):void;
+
+ /**
+ * Gets the item at the specified index.
+ *
+ * @param index The index in the list from which to retrieve the item.
+ *
+ * @param prefetch An <code>int</code> indicating both the direction
+ * and number of items to fetch during the request if the item is
+ * not local.
+ *
+ * @return The item at that index, or <code>null</code> if there is none.
+ *
+ * @throws mx.collections.errors.ItemPendingError if the data for that index needs to be
+ * loaded from a remote location.
+ *
+ * @throws RangeError if <code>index < 0</code>
+ * or <code>index >= length</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getItemAt(index:int, prefetch:int = 0):Object;
+
+ /**
+ * Returns the index of the item if it is in the list such that
+ * getItemAt(index) == item.
+ *
+ * <p>Note: unlike <code>IViewCursor.find<i>xxx</i>()</code> methods,
+ * The <code>getItemIndex()</code> method cannot take a parameter with
+ * only a subset of the fields in the item being serched for;
+ * this method always searches for an item that exactly matches
+ * the input parameter.</p>
+ *
+ * @param item The item to find.
+ *
+ * @return The index of the item, or -1 if the item is not in the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getItemIndex(item:Object):int;
+
+ /**
+ * Notifies the view that an item has been updated.
+ * This is useful if the contents of the view do not implement
+ * <code>IEventDispatcher</code> and dispatches a
+ * <code>PropertyChangeEvent</code>.
+ * If a property is specified the view may be able to optimize its
+ * notification mechanism.
+ * Otherwise it may choose to simply refresh the whole view.
+ *
+ * @param item The item within the view that was updated.
+ *
+ * @param property The name of the property that was updated.
+ *
+ * @param oldValue The old value of that property. (If property was null,
+ * this can be the old value of the item.)
+ *
+ * @param newValue The new value of that property. (If property was null,
+ * there's no need to specify this as the item is assumed to be
+ * the new value.)
+ *
+ * @see mx.events.CollectionEvent
+ * @see mx.events.PropertyChangeEvent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function itemUpdated(item:Object, property:Object = null,
+ oldValue:Object = null,
+ newValue:Object = null):void;
+
+ /**
+ * Removes all items from the list.
+ *
+ * <p>If any item is not local and an asynchronous operation must be
+ * performed, an <code>ItemPendingError</code> will be thrown.</p>
+ *
+ * <p>See the ItemPendingError documentation as well as
+ * the collections documentation for more information
+ * on using the <code>ItemPendingError</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeAll():void;
+
+ /**
+ * Removes the item at the specified index and returns it.
+ * Any items that were after this index are now one index earlier.
+ *
+ * @param index The index from which to remove the item.
+ *
+ * @return The item that was removed.
+ *
+ * @throws RangeError is index is less than 0 or greater than length.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeItemAt(index:int):Object;
+
+ /**
+ * Places the item at the specified index.
+ * If an item was already at that index the new item will replace it
+ * and it will be returned.
+ *
+ * @param item The new item to be placed at the specified index.
+ *
+ * @param index The index at which to place the item.
+ *
+ * @return The item that was replaced, or <code>null</code> if none.
+ *
+ * @throws RangeError if index is less than 0 or greater than length.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setItemAt(item:Object, index:int):Object;
+
+ /**
+ * Returns an Array that is populated in the same order as the IList
+ * implementation.
+ * This method can throw an ItemPendingError.
+ *
+ * @return The array.
+ *
+ * @throws mx.collections.errors.ItemPendingError If the data is not yet completely loaded
+ * from a remote location.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function toArray():Array;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/collections/errors/ItemPendingError.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/collections/errors/ItemPendingError.as b/frameworks/projects/MX/src/main/flex/mx/collections/errors/ItemPendingError.as
new file mode 100644
index 0000000..615bdb7
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/collections/errors/ItemPendingError.as
@@ -0,0 +1,133 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.collections.errors
+{
+
+import mx.rpc.IResponder;
+
+/**
+ * This error is thrown when retrieving an item from a collection view
+ * requires an asynchronous call. This error occurs when the backing data
+ * is provided from a remote source and the data is not yet available locally.
+ *
+ * <p>If the receiver of this error needs notification when the requested item
+ * becomes available (that is, when the asynchronous call completes), it must
+ * use the <code>addResponder()</code> method and specify
+ * an object that supports the <code>mx.rpc.IResponder</code>
+ * interface to respond when the item is available.
+ * The <code>mx.collections.ItemResponder</code> class implements the
+ * IResponder interface and supports a <code>data</code> property.</p>
+ *
+ * @see mx.collections.ItemResponder
+ * @see mx.rpc.IResponder
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ItemPendingError extends Error
+{
+ include "../../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * <p>Called by the Flex Framework when a request is made
+ * for an item that isn't local.</p>
+ *
+ * @param message A message providing information about the error cause.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ItemPendingError(message:String)
+ {
+ super(message);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // responder
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _responders:Array;
+
+ /**
+ * An array of IResponder handlers that will be called when
+ * the asynchronous request completes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get responders():Array
+ {
+ return _responders;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * <code>addResponder</code> adds a responder to an Array of responders.
+ * The object assigned to the responder parameter must implement the
+ * mx.rpc.IResponder interface.
+ *
+ * @param responder A handler which will be called when the asynchronous request completes.
+ *
+ * @see mx.rpc.IResponder
+ * @see mx.collections.ItemResponder
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addResponder(responder:IResponder):void
+ {
+ if (!_responders)
+ _responders = [];
+
+ _responders.push(responder);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/controls/IFlexContextMenu.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/controls/IFlexContextMenu.as b/frameworks/projects/MX/src/main/flex/mx/controls/IFlexContextMenu.as
new file mode 100644
index 0000000..bb6a8d4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/controls/IFlexContextMenu.as
@@ -0,0 +1,75 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls
+{
+
+/**
+ * The IFlexContextMenu interface defines the interface for a
+ * Flex context menus.
+ *
+ * @see mx.core.UIComponent#flexContextMenu
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFlexContextMenu
+{
+COMPILE::AS3
+{
+ import flash.display.InteractiveObject;
+}
+COMPILE::JS
+{
+ import flex.display.InteractiveObject;
+}
+
+ /**
+ * Sets the context menu of an InteractiveObject. This will do
+ * all the necessary steps to add the InteractiveObject as the context
+ * menu for this InteractiveObject, such as adding listeners, etc..
+ *
+ * @param component InteractiveObject to set context menu on
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setContextMenu(component:InteractiveObject):void;
+
+ /**
+ * Unsets the context menu of a InteractiveObject. This will do
+ * all the necessary steps to remove the InteractiveObject as the context
+ * menu for this InteractiveObject, such as removing listeners, etc..
+ *
+ * @param component InteractiveObject to unset context menu on
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function unsetContextMenu(component:InteractiveObject):void;
+
+}
+
+}
[31/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/RuntimeDPIProvider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/RuntimeDPIProvider.as b/frameworks/projects/MX/src/main/flex/mx/core/RuntimeDPIProvider.as
new file mode 100644
index 0000000..7d82fb8
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/RuntimeDPIProvider.as
@@ -0,0 +1,182 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+import flash.display.DisplayObject;
+import flash.display.Stage;
+import flash.system.Capabilities;
+
+import mx.core.mx_internal;
+import mx.managers.SystemManager;
+import mx.utils.Platform;
+
+use namespace mx_internal;
+
+/**
+ * The RuntimeDPIProvider class provides the default mapping of
+ * similar device DPI values into predefined DPI classes.
+ * An Application may have its runtimeDPIProvider property set to a
+ * subclass of RuntimeDPIProvider to override Flex's default mappings.
+ * Overriding Flex's default mappings will cause changes in the Application's
+ * automatic scaling behavior.
+ *
+ * <p>Overriding Flex's default mappings is usually only necessary for devices
+ * that incorrectly report their screenDPI and for devices that may scale better
+ * in a different DPI class.</p>
+ *
+ * <p>Flex's default mappings are:
+ * <table class="innertable">
+ * <tr><td>160 DPI</td><td><140 DPI</td></tr>
+ * <tr><td>160 DPI</td><td>>=140 DPI and <=200 DPI</td></tr>
+ * <tr><td>240 DPI</td><td>>=200 DPI and <=280 DPI</td></tr>
+ * <tr><td>320 DPI</td><td>>=280 DPI and <=400 DPI</td></tr>
+ * <tr><td>480 DPI</td><td>>=400 DPI and <=560 DPI</td></tr>
+ * <tr><td>640 DPI</td><td>>=640 DPI</td></tr>
+ * </table>
+ * </p>
+ *
+ *
+ *
+ * <p>Subclasses of RuntimeDPIProvider should only depend on runtime APIs
+ * and should not depend on any classes specific to the Flex framework except
+ * <code>mx.core.DPIClassification</code>.</p>
+ *
+ * @includeExample examples/RuntimeDPIProviderApp.mxml -noswf
+ * @includeExample examples/RuntimeDPIProviderExample.as -noswf
+ * @includeExample examples/views/RuntimeDPIProviderAppView.mxml -noswf
+ *
+ * @see mx.core.DPIClassification
+ * @see spark.components.Application#applicationDPI
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+public class RuntimeDPIProvider
+{
+
+ mx_internal static const IPAD_MAX_EXTENT:int = 1024;
+ mx_internal static const IPAD_RETINA_MAX_EXTENT: int = 2048;
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public function RuntimeDPIProvider()
+ {
+ }
+
+ /**
+ * Returns the runtime DPI of the current device by mapping its
+ * <code>flash.system.Capabilities.screenDPI</code> to one of several DPI
+ * values in <code>mx.core.DPIClassification</code>.
+ *
+ * A number of devices can have slightly different DPI values and Flex maps these
+ * into the several DPI classes.
+ *
+ * Flex uses this method to calculate the current DPI value when an Application
+ * authored for a specific DPI is adapted to the current one through scaling.
+ *
+ * <p> Exceptions: </p>
+ * <ul>
+ * <li>All non-retina iPads receive 160 DPI </li>
+ * <li>All retina iPads receive 320 DPI </li>
+ * </ul>
+ *
+ * @param dpi The DPI value.
+ * @return The corresponding <code>DPIClassification</code> value.
+ * isI
+ * @see flash.system.Capabilities
+ * @see mx.core.DPIClassification
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+
+ public function get runtimeDPI():Number
+ {
+ if (Platform.isIOS) // as isIPad returns false in the simulator
+ {
+ var scX:Number = Capabilities.screenResolutionX;
+ var scY:Number = Capabilities.screenResolutionY;
+
+ // Use the stage width/height only when debugging, because Capabilities reports the computer resolution
+ if (Capabilities.isDebugger)
+ {
+ var root:DisplayObject = SystemManager.getSWFRoot(this);
+ if (root && root.stage)
+ {
+ scX = root.stage.fullScreenWidth;
+ scY = root.stage.fullScreenHeight;
+ }
+ }
+
+ /* as of Dec 2013, iPad (resp. iPad retina) are the only iOS devices to have 1024 (resp. 2048) screen width or height
+ cf http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density#Apple
+ * */
+ if (scX == IPAD_MAX_EXTENT || scY == IPAD_MAX_EXTENT)
+ return DPIClassification.DPI_160;
+ else if ((scX == IPAD_RETINA_MAX_EXTENT || scY == IPAD_RETINA_MAX_EXTENT))
+ return DPIClassification.DPI_320;
+ }
+
+ return classifyDPI(Capabilities.screenDPI);
+ }
+
+ /**
+ * @private
+ * Matches the specified DPI to a <code>DPIClassification</code> value.
+ * A number of devices can have slightly different DPI values and classifyDPI
+ * maps these into the several DPI classes.
+ *
+ * This method is specifically kept for Design View. Flex uses RuntimeDPIProvider
+ * to calculate DPI classes.
+ *
+ * @param dpi The DPI value.
+ * @return The corresponding <code>DPIClassification</code> value.
+ */
+ mx_internal static function classifyDPI(dpi:Number):Number
+ {
+ if (dpi <= 140)
+ return DPIClassification.DPI_120;
+
+ if (dpi <= 200)
+ return DPIClassification.DPI_160;
+
+ if (dpi <= 280)
+ return DPIClassification.DPI_240;
+
+ if (dpi <= 400)
+ return DPIClassification.DPI_320;
+
+ if (dpi <= 560)
+ return DPIClassification.DPI_480;
+
+ return DPIClassification.DPI_640;
+ }
+}
+}
\ 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/core/Singleton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/Singleton.as b/frameworks/projects/MX/src/main/flex/mx/core/Singleton.as
new file mode 100644
index 0000000..117ce0e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/Singleton.as
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This all-static class serves as a singleton registry.
+ *
+ * For example, pop-up management throughout a Flex application
+ * is provided by a single instance of the PopUpManagerImpl class,
+ * even when the main application loads modules and sub-applications
+ * each of which might have PopUpManagerImpl linked in.
+ *
+ * The factory class for a framework-based application
+ * or a module (i.e., SystemManager or FlexModuleFactory,
+ * both of which implements IFlexModuleFactory) calls
+ * the registerClass() method to populate the registry.
+ *
+ * Later, other classes call getInstance() to access
+ * the singleton instance.
+ *
+ * The registry policy is "first class in wins".
+ * For example, if the main application registers its
+ * PopUpManagerImpl, then a loaded SWF will use that one.
+ * However, if the main application doesn't contain
+ * a PopUpManagerImpl, then it registers null,
+ * and the first loaded SWF containing a PopUpManagerImpl
+ * will register that one.
+ */
+public class Singleton
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * A map of fully-qualified interface names,
+ * such as "mx.managers::IPopUpManager",
+ * to implementation classes which produce singleton instances,
+ * such as mx.managers.PopUpManagerImpl.
+ */
+ private static var classMap:Object = {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Adds an interface-name-to-implementation-class mapping to the registry,
+ * if a class hasn't already been registered for the specified interface.
+ * The class must implement a getInstance() method which returns
+ * its singleton instance.
+ */
+ public static function registerClass(interfaceName:String,
+ clazz:Class):void
+ {
+ var c:Class = classMap[interfaceName];
+ if (!c)
+ classMap[interfaceName] = clazz;
+ }
+
+ /**
+ * @private
+ * Returns the implementation class registered for the specified
+ * interface, or null if no class has been registered for that interface.
+ *
+ * This method should not be called at static initialization time,
+ * because the factory class may not have called registerClass() yet.
+ */
+ public static function getClass(interfaceName:String):Class
+ {
+ return classMap[interfaceName];
+ }
+
+ /**
+ * @private
+ * Returns the singleton instance of the implementation class
+ * that was registered for the specified interface,
+ * by looking up the class in the registry
+ * and calling its getInstance() method.
+ *
+ * This method should not be called at static initialization time,
+ * because the factory class may not have called registerClass() yet.
+ */
+ public static function getInstance(interfaceName:String):Object
+ {
+ var c:Class = classMap[interfaceName];
+ if (!c)
+ {
+ throw new Error("No class registered for interface '" +
+ interfaceName + "'.");
+ }
+ return c["getInstance"]();
+ }
+}
+
+}
[21/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..5b57ce4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/preloaders/IPreloaderDisplay.as
@@ -0,0 +1,193 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.preloaders
+{
+
+import flash.display.Sprite;
+import flash.events.IEventDispatcher;
+
+/**
+ * Defines the interface that
+ * a class must implement to be used as a download progress bar.
+ * The IPreloaderDisplay receives events from the Preloader class
+ * and is responsible for visualizing that information to the user.
+ *
+ * @see mx.preloaders.DownloadProgressBar
+ * @see mx.preloaders.Preloader
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IPreloaderDisplay extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // backgroundAlpha
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#backgroundAlpha
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get backgroundAlpha():Number;
+
+ /**
+ * @private
+ */
+ function set backgroundAlpha(value:Number):void;
+
+ //----------------------------------
+ // backgroundColor
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#backgroundColor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get backgroundColor():uint;
+
+ /**
+ * @private
+ */
+ function set backgroundColor(value:uint):void;
+
+ //----------------------------------
+ // backgroundImage
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#backgroundImage
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get backgroundImage():Object;
+
+ /**
+ * @private
+ */
+ function set backgroundImage(value:Object):void;
+
+ //----------------------------------
+ // backgroundSize
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#backgroundSize
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get backgroundSize():String;
+
+ /**
+ * @private
+ */
+ function set backgroundSize(value:String):void;
+
+ //----------------------------------
+ // preloader
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#preloader
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function set preloader(obj:Sprite):void;
+
+ //----------------------------------
+ // stageHeight
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#stageHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get stageHeight():Number;
+
+ /**
+ * @private
+ */
+ function set stageHeight(value:Number):void;
+
+ //----------------------------------
+ // stageWidth
+ //----------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#stageWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get stageWidth():Number;
+
+ /**
+ * @private
+ */
+ function set stageWidth(value:Number):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @copy mx.preloaders.DownloadProgressBar#initialize()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initialize():void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..4ad40b8
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as
@@ -0,0 +1,684 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.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;
+
+import mx.core.RSLItem;
+import mx.core.RSLListLoader;
+import mx.core.ResourceModuleRSLItem;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+import mx.events.RSLEvent;
+import mx.managers.SystemManagerGlobals;
+import mx.resources.IResourceManager;
+
+use namespace mx_internal;
+
+/**
+ * The Preloader class is used by the SystemManager to monitor
+ * the download and initialization status of a Flex application.
+ * It is also responsible for downloading the runtime shared libraries (RSLs).
+ *
+ * <p>The Preloader class instantiates a download progress bar,
+ * which must implement the IPreloaderDisplay interface, and passes download
+ * and initialization events to the download progress bar.</p>
+ *
+ * @see mx.preloaders.DownloadProgressBar
+ * @see mx.preloaders.Preloader
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class Preloader extends Sprite
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function Preloader()
+ {
+ super()
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var displayClass:IPreloaderDisplay = null;
+
+ /**
+ * @private
+ */
+ private var timer:Timer;
+
+ /**
+ * @private
+ */
+ private var showDisplay:Boolean;
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private var rslListLoader:RSLListLoader;
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private var resourceModuleListLoader:RSLListLoader;
+
+ /**
+ * @private
+ */
+ private var rslDone:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var loadingRSLs:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var waitingToLoadResourceModules:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var sentDocFrameReady:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var app:IEventDispatcher = null;
+
+ /**
+ * @private
+ */
+ private var applicationDomain:ApplicationDomain = null;
+
+ /**
+ * @private
+ */
+ private var waitedAFrame:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ COMPILE::LATER
+ public function initialize(showDisplay:Boolean,
+ displayClassName:Class,
+ backgroundColor:uint,
+ backgroundAlpha:Number,
+ backgroundImage:Object,
+ backgroundSize:String,
+ displayWidth:Number,
+ displayHeight:Number,
+ libs:Array = null,
+ sizes:Array = null,
+ rslList:Array = null,
+ resourceModuleURLs:Array = null,
+ applicationDomain:ApplicationDomain = null):void
+ {
+
+ }
+
+ /**
+ * Called by the SystemManager to initialize a Preloader object.
+ *
+ * @param showDisplay Determines if the display class should be displayed.
+ *
+ * @param displayClassName The IPreloaderDisplay class to use
+ * for displaying the preloader status.
+ *
+ * @param backgroundColor Background color of the application.
+ *
+ * @param backgroundAlpha Background alpha of the application.
+ *
+ * @param backgroundImage Background image of the application.
+ *
+ * @param backgroundSize Background size of the application.
+ *
+ * @param displayWidth Width of the application.
+ *
+ * @param displayHeight Height of the application.
+ *
+ * @param libs Array of string URLs for the runtime shared libraries.
+ *
+ * @param sizes Array of uint values containing the byte size for each URL
+ * in the libs argument
+ *
+ * @param rslList Array of object of type RSLItem and CdRSLItem.
+ * This array describes all the RSLs to load.
+ * The libs and sizes parameters are ignored and must be set to null.
+ *
+ * @param resourceModuleURLs Array of Strings specifying URLs
+ * from which to preload resource modules.
+ *
+ * @param applicationDomain The application domain in which
+ * your code is executing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function initialize(showDisplay:Boolean,
+ displayClassName:Class,
+ backgroundColor:uint,
+ backgroundAlpha:Number,
+ backgroundImage:Object,
+ backgroundSize:String,
+ displayWidth:Number,
+ displayHeight:Number,
+ libs:Array = null,
+ sizes:Array = null):void
+ {
+ COMPILE::LATER
+ {
+ if ((libs != null || sizes != null) && rslList != null)
+ {
+ // both args can't be used at the same time
+ throw new Error("RSLs may only be specified by using libs and sizes or rslList, not both."); // $NON-NLS-1$
+ }
+ }
+
+ this.applicationDomain = applicationDomain;
+
+ root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
+
+ var n:int;
+ var i:int;
+
+ COMPILE::LATER
+ {
+ // Store the RSL information.
+ // Keep this code for API backwards compatibility
+ if (libs && libs.length > 0)
+ {
+ if (rslList == null)
+ {
+ rslList = [];
+ }
+
+ n = libs.length;
+ for (i = 0; i < n; i++)
+ {
+ var node:RSLItem = new RSLItem(libs[i]);
+ rslList.push(node);
+ }
+ }
+
+ var resourceModuleList:Array = [];
+ // Preloading resource modules is similar enough to loading RSLs
+ // that we can simply create ResourceModuleRSLItems for them
+ if (resourceModuleURLs && resourceModuleURLs.length > 0)
+ {
+ n = resourceModuleURLs.length;
+ for (i = 0; i < n; i++)
+ {
+ var resourceModuleNode:ResourceModuleRSLItem =
+ new ResourceModuleRSLItem(resourceModuleURLs[i], applicationDomain);
+ resourceModuleList.push(resourceModuleNode);
+ }
+ }
+
+ rslListLoader = new RSLListLoader(rslList);
+ if (resourceModuleList.length)
+ resourceModuleListLoader = new RSLListLoader(resourceModuleList);
+ }
+ this.showDisplay = showDisplay;
+
+ // Create the timer (really should be adding event listeners to root.LoaderInfo)
+ timer = new Timer(10);
+ timer.addEventListener(TimerEvent.TIMER, timerHandler);
+ timer.start();
+
+ // Create a new instance of the display class and attach it to the stage
+ if (showDisplay)
+ {
+ displayClass = new displayClassName();
+ // Listen for when the displayClass no longer needs to be on the stage
+ displayClass.addEventListener(Event.COMPLETE,
+ displayClassCompleteHandler);
+
+ // Add the display class as a child of the Preloader
+ addChild(DisplayObject(displayClass));
+
+ displayClass.backgroundColor = backgroundColor;
+ displayClass.backgroundAlpha = backgroundAlpha;
+ displayClass.backgroundImage = backgroundImage;
+ displayClass.backgroundSize = backgroundSize;
+ displayClass.stageWidth = displayWidth;
+ displayClass.stageHeight = displayHeight;
+ displayClass.initialize();
+ displayClass.preloader = this;
+
+ // Listen for ENTER_FRAME to make sure that we are going to render the displayClass first,
+ // before dispatching PRELOADER_DOC_FRAME_READY. This way we the run-time can render
+ // the displayClass as soon as possible, before advancing onto frame 2.
+ CONFIG::performanceInstrumentation
+ {
+ import mx.utils.PerfUtil;
+ PerfUtil.getInstance().markTime("Preloader.displayClass created");
+ }
+ this.addEventListener(Event.ENTER_FRAME, waitAFrame);
+ }
+
+ COMPILE::LATER
+ {
+ // move below showDisplay so error messages can be displayed
+ if (rslListLoader.getItemCount() > 0)
+ {
+ // Start loading the RSLs.
+ rslListLoader.load(rslProgressHandler,
+ rslCompleteHandler,
+ rslErrorHandler,
+ rslErrorHandler,
+ rslErrorHandler);
+ loadingRSLs = true;
+ }
+ else if (resourceModuleListLoader && resourceModuleListLoader.getItemCount() > 0)
+ {
+ if (applicationDomain.hasDefinition("mx.resources::ResourceManager"))
+ {
+ rslListLoader = resourceModuleListLoader;
+ // Start loading the resourceModules
+ rslListLoader.load(rslProgressHandler,
+ rslCompleteHandler,
+ rslErrorHandler,
+ rslErrorHandler,
+ rslErrorHandler);
+ }
+ else
+ {
+ waitingToLoadResourceModules = true;
+ rslDone = true;
+ }
+ }
+ else
+ {
+ rslDone = true;
+ }
+ }
+ }
+
+ /**
+ * Called by the SystemManager after it has finished instantiating
+ * an instance of the application class. Flex calls this method; you
+ * do not call it yourself.
+ *
+ * @param app The application object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function registerApplication(app:IEventDispatcher):void
+ {
+ // Listen for events from the application.
+ app.addEventListener("validatePropertiesComplete", appProgressHandler);
+ app.addEventListener("validateSizeComplete", appProgressHandler);
+ app.addEventListener("validateDisplayListComplete", appProgressHandler);
+ app.addEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
+
+ // Cache for later cleanup.
+ this.app = app;
+ }
+
+
+ /**
+ * @private
+ * Return the number of bytes loaded and total for the SWF and any RSLs.
+ */
+ private function getByteValues():Object
+ {
+ var li:LoaderInfo = root.loaderInfo;
+ var loaded:int = li.bytesLoaded;
+ var total:int = li.bytesTotal;
+
+ COMPILE::LATER
+ {
+ // Look up the rsl bytes and include those
+ var n:int = rslListLoader ? rslListLoader.getItemCount() : 0;
+ for (var i:int = 0; i < n; i++)
+ {
+ loaded += rslListLoader.getItem(i).loaded;
+
+ // If the rsl total is zero then provide an average rsl size
+ // to set rough expectations.
+ var rslTotal:int = rslListLoader.getItem(i).total;
+ total += rslTotal;
+ }
+ }
+
+ return { loaded: loaded, total: total };
+ }
+
+ /**
+ * @private
+ */
+ private function dispatchAppEndEvent(event:Object = null):void
+ {
+ // Dispatch the application initialization end event
+ dispatchEvent(new FlexEvent(FlexEvent.INIT_COMPLETE));
+
+ if (!showDisplay)
+ displayClassCompleteHandler(null);
+ }
+
+ /**
+ * @private
+ * We don't listen for the events directly
+ * because we don't know which RSL is sending the event.
+ * So we have the RSLNode listen to the events
+ * and then pass them along to the Preloader.
+ */
+ COMPILE::LATER
+ mx_internal function rslProgressHandler(event:ProgressEvent):void
+ {
+ var index:int = rslListLoader.getIndex();
+ var item:RSLItem = rslListLoader.getItem(index);
+
+
+ var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_PROGRESS);
+ rslEvent.isResourceModule = (rslListLoader == resourceModuleListLoader);
+ rslEvent.bytesLoaded = event.bytesLoaded;
+ rslEvent.bytesTotal = event.bytesTotal;
+ rslEvent.rslIndex = index;
+ rslEvent.rslTotal = rslListLoader.getItemCount();
+ rslEvent.url = item.urlRequest;
+ dispatchEvent(rslEvent);
+ }
+
+
+ /**
+ * @private
+ * Load the next RSL in the list and dispatch an event.
+ */
+ COMPILE::LATER
+ mx_internal function rslCompleteHandler(event:Event):void
+ {
+ var index:int = rslListLoader.getIndex();
+ var item:RSLItem = rslListLoader.getItem(index);
+
+ var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_COMPLETE);
+ rslEvent.isResourceModule = (rslListLoader == resourceModuleListLoader);
+ rslEvent.bytesLoaded = item.total;
+ rslEvent.bytesTotal = item.total;
+ rslEvent.loaderInfo = event.target as LoaderInfo;
+ rslEvent.rslIndex = index;
+ rslEvent.rslTotal = rslListLoader.getItemCount();
+ rslEvent.url = item.urlRequest;
+ dispatchEvent(rslEvent);
+
+ if (loadingRSLs && resourceModuleListLoader && index + 1 == rslEvent.rslTotal)
+ {
+ loadingRSLs = false;
+ waitingToLoadResourceModules = true;
+ // timer will switch over to loading resource modules
+ }
+
+ rslDone = (index + 1 == rslEvent.rslTotal);
+ }
+
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ mx_internal function rslErrorHandler(event:ErrorEvent):void
+ {
+ // send an error event
+ var index:int = rslListLoader.getIndex();
+ var item:RSLItem = rslListLoader.getItem(index);
+ var rslEvent:RSLEvent = new RSLEvent(RSLEvent.RSL_ERROR);
+ rslEvent.isResourceModule = (rslListLoader == resourceModuleListLoader);
+ rslEvent.bytesLoaded = 0;
+ rslEvent.bytesTotal = 0;
+ rslEvent.rslIndex = index;
+ rslEvent.rslTotal = rslListLoader.getItemCount();
+ rslEvent.url = item.urlRequest;
+ rslEvent.errorText = decodeURI(event.text);
+ dispatchEvent(rslEvent);
+
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Listen or poll for progress events and dispatch events
+ * describing the current state of the download
+ */
+ private function timerHandler(event:TimerEvent):void
+ {
+ // loaded swfs may not have root right away
+ if (!root)
+ return;
+
+ var bytes:Object = getByteValues();
+ var loaded:int = bytes.loaded;
+ var total:int = bytes.total;
+
+ // Dispatch a progress event (later we might conditionalize this
+ // so that it isn't sent on a cache load).
+ dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS,
+ false, false, loaded, total));
+
+ COMPILE::LATER
+ {
+ if (waitingToLoadResourceModules)
+ {
+ if (applicationDomain.hasDefinition("mx.resources::ResourceManager"))
+ {
+ waitingToLoadResourceModules = false;
+ rslListLoader = resourceModuleListLoader;
+ rslDone = false;
+ // Start loading the resourceModules
+ rslListLoader.load(rslProgressHandler,
+ rslCompleteHandler,
+ rslErrorHandler,
+ rslErrorHandler,
+ rslErrorHandler);
+ }
+ }
+ }
+
+ // Check if we are finished
+ if (rslDone &&
+ ((loaded >= total && total > 0) || (total == 0 && loaded > 0) || (root is MovieClip && (MovieClip(root).totalFrames > 2) && (MovieClip(root).framesLoaded >= 2)) ))
+ {
+ if (!sentDocFrameReady)
+ {
+ // If there's a displayClass, don't send the PRELOADER_DOC_FRAME_READY
+ // event before we render at least one frame
+ if (showDisplay && !waitedAFrame)
+ return;
+
+ sentDocFrameReady = true;
+ // Dispatch a Frame1 done event.
+ dispatchEvent(new FlexEvent(FlexEvent.PRELOADER_DOC_FRAME_READY));
+ return;
+ }
+
+ COMPILE::LATER
+ {
+ if (waitingToLoadResourceModules)
+ {
+ if (applicationDomain.hasDefinition("mx.resources::ResourceManager"))
+ {
+ waitingToLoadResourceModules = false;
+ rslListLoader = resourceModuleListLoader;
+ rslDone = false;
+ // Start loading the resourceModules
+ rslListLoader.load(rslProgressHandler,
+ rslCompleteHandler,
+ rslErrorHandler,
+ rslErrorHandler,
+ rslErrorHandler);
+ return;
+ }
+ }
+
+ if (resourceModuleListLoader)
+ {
+ var resourceManager:IResourceManager;
+ // do this to prevent dependency on ResourceManager
+ if (applicationDomain.hasDefinition("mx.resources::ResourceManager"))
+ {
+ var resourceManagerClass:Class =
+ Class(applicationDomain.getDefinition("mx.resources::ResourceManager"));
+ resourceManager =
+ IResourceManager(resourceManagerClass["getInstance"]());
+ }
+ // The FlashVars of the SWF's HTML wrapper,
+ // or the query parameters of the SWF URL,
+ // can specify the ResourceManager's localeChain.
+ var localeChainList:String =
+ SystemManagerGlobals.parameters["localeChain"];
+ if (localeChainList != null && localeChainList != "")
+ resourceManager.localeChain = localeChainList.split(",");
+ }
+ }
+ timer.removeEventListener(TimerEvent.TIMER, timerHandler);
+
+ // Stop the timer.
+ timer.reset();
+
+ // Dispatch a complete event.
+ dispatchEvent(new Event(Event.COMPLETE));
+
+ // Dispatch an initProgress event.
+ dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
+
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function ioErrorHandler(event:IOErrorEvent):void
+ {
+ // Ignore the event
+ }
+
+ /**
+ * @private
+ * Called when the displayClass has finished animating
+ * and no longer needs to be displayed.
+ */
+ private function displayClassCompleteHandler(event:Event):void
+ {
+ // Cleanup
+ if (displayClass)
+ displayClass.removeEventListener(Event.COMPLETE, displayClassCompleteHandler);
+
+ if (root)
+ root.loaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
+
+ if (app)
+ {
+ app.removeEventListener("validatePropertiesComplete", appProgressHandler);
+ app.removeEventListener("validateSizeComplete", appProgressHandler);
+ app.removeEventListener("validateDisplayListComplete", appProgressHandler);
+ app.removeEventListener(FlexEvent.CREATION_COMPLETE, appCreationCompleteHandler);
+ app = null;
+ }
+
+ // Send an event to the SystemManager that we are completely finished
+ dispatchEvent(new FlexEvent(FlexEvent.PRELOADER_DONE));
+ }
+
+ /**
+ * @private
+ */
+ private function appCreationCompleteHandler(event:FlexEvent):void
+ {
+ dispatchAppEndEvent();
+ }
+
+ /**
+ * @private
+ */
+ private function appProgressHandler(event:Event):void
+ {
+ dispatchEvent(new FlexEvent(FlexEvent.INIT_PROGRESS));
+ }
+
+ /**
+ * @private
+ */
+ private function waitAFrame(event:Event):void
+ {
+ CONFIG::performanceInstrumentation
+ {
+ mx.utils.PerfUtil.getInstance().markTime("Preloader.displayClass rendered");
+ }
+
+ this.removeEventListener(Event.ENTER_FRAME, waitAFrame);
+ waitedAFrame = true;
+ }
+
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/resources/IResourceBundle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/resources/IResourceBundle.as b/frameworks/projects/MX/src/main/flex/mx/resources/IResourceBundle.as
new file mode 100644
index 0000000..74c0304
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/resources/IResourceBundle.as
@@ -0,0 +1,256 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.resources
+{
+
+/**
+ * The IResourceBundle and IResourceManager interfaces work together
+ * to provide localization support for Flex applications.
+ *
+ * <p>There are three main concepts involved in localization:
+ * locales, resources, and resource bundles.</p>
+ *
+ * <p>A locale specifies a language and a country
+ * for which your application has been localized.
+ * For example, the locale <code>"en_US"</code>
+ * specifies English as spoken in the United States.
+ * (See the mx.resources.Locale class for more information.)</p>
+ *
+ * <p>A resource is a named value that is locale-dependent.
+ * For example, your application might have a resource
+ * whose name is <code>"OPEN"</code>
+ * and whose value for an English locale is <code>"Open"</code>
+ * but whose value for a French locale is <code>"Ouvrir"</code>.</p>
+ *
+ * <p>A resource bundle is a named group of resources
+ * whose values have been localized for a particular locale.
+ * A resource bundle is identified by the combination of its
+ * <code>bundleName</code> and its <code>locale</code>,
+ * and has a <code>content</code> Object that contains
+ * the name-value pairs for the bundle's resources.</p>
+ *
+ * <p>The IResourceBundle interface represents a specific resource bundle.
+ * However, most applications will only need to use IResourceManager.
+ * A single ResourceManager object implementing this interface
+ * manages multiple resource bundles, possibly for multiple locales,
+ * and provides access to the resources that they contain.
+ * For example, you can retrieve a specific resource as a String by calling
+ * <code>resourceManager.getString(bundleName, resourceName)</code>.
+ * By changing the <code>localeChain</code> property of the ResourceManager,
+ * you can change which resource bundles are searched for resource values.</p>
+ *
+ * <p>Generally, you do not create resource bundles yourself;
+ * instead, they are usually compiled from ~~.properties files.
+ * A properties file named MyResources.properties
+ * produces a resource bundle with <code>"MyResources"</code>
+ * for its <code>bundleName</code>.
+ * You generally produce multiple versions of each properties file,
+ * one for each locale that your application supports.</p>
+ *
+ * <p>Flex properties files are similar to Java properties files,
+ * except that they also support MXML's <code>Embed()</code>
+ * and <code>ClassReference()</code> directives.
+ * These directives work the same way in a properties file
+ * as they do in a CSS file, producing class references.
+ * Also, the encoding for Flex properties files
+ * is always assumed to be UTF-8.</p>
+ *
+ * <p>The Flex framework's resources have been localized
+ * for U.S. English (the <code>"en_US"</code> locale) and
+ * for Japanese (the <code>"ja_JP"</code> locale).
+ * The framework resources are organized into multiple bundles
+ * corresponding to framework packages; for example, the "formatters"
+ * bundle is used by classes in the mx.formatters package.
+ * (There is also a "SharedResources" bundle for resources used by
+ * multiple packages.)</p>
+ *
+ * <p>The properties files for the framework resources,
+ * such as formatters.properties, can be found in the
+ * frameworks/projects/framework/bundles/{locale}/src directories
+ * of the Flex SDK.
+ * Your applications normally link against the Flex framework
+ * as a precompiled library, framework.swc,
+ * in the frameworks/libs directory.
+ * This library has no resources in it.
+ * Instead, the framework resources have been compiled into separate
+ * resource bundle libraries such as framework_rb.swc.
+ * These are located in the frameworks/locales/{locale} directories
+ * and your application must also link in one or more of these.</p>
+ *
+ * <p>You are free to organize your application's own resources
+ * into whatever bundles you find convenient.
+ * If you localize your application for locales
+ * other than <code>"en_US"</code> and <code>"ja_JP"</code>,
+ * you should localize the framework's properties files for those locales
+ * as well and compile additional resource bundle libaries for them.</p>
+ *
+ * <p>When your application starts, the ResourceManager is automatically
+ * populated with whatever resource bundles were compiled
+ * into the application.
+ * If you create a code module, by default the resources that its classes
+ * need are compiled into the module.
+ * When the module is loaded into an application, any bundles that the
+ * application does not already have are added to the ResourceManager.</p>
+ *
+ * <p>You can compile "resource modules" that have only resources in them,
+ * and load them with the <code>loadResourceModule()</code> method
+ * of the ResourceManager.
+ * With resource modules, you can support multiple locales by loading
+ * the resources you need at run time rather than compiling them into
+ * your application.</p>
+ *
+ * <p>Although the ResourceManager is normally populated with resource bundles
+ * that were compiled into your application or loaded from modules,
+ * you can also programmatically create resource bundles and add them
+ * to the ResourceManager yourself with the <code>addResourceBundle()</code>
+ * method.</p>
+ *
+ * @see mx.resources.ResourceBundle
+ * @see mx.resources.IResourceManager
+ * @see mx.resources.ResourceManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IResourceBundle
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // bundleName
+ //----------------------------------
+
+ /**
+ * A name that identifies this resource bundle,
+ * such as <code>"MyResources"</code>.
+ *
+ * <p>This read-only property is set
+ * when a resource bundle is constructed.</p>
+ *
+ * <p>Resource bundles that are automatically created from compiled
+ * properties files have bundle names based on the names of those files.
+ * For example, a properties file named MyResources.properties
+ * will produce a resource bundle whose <code>bundleName</code>
+ * is <code>"MyResources"</code>.</p>
+ *
+ * <p>The ResourceManager can manage multiple bundles with the same
+ * <code>bundleName</code> as long as they have different values
+ * for their <code>locale</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get bundleName():String;
+
+ //----------------------------------
+ // content
+ //----------------------------------
+
+ /**
+ * An object containing key-value pairs for the resources
+ * in this resource bundle.
+ *
+ * <p>In general, you should access resources by using IResourceManager
+ * methods such as <code>getString()</code>, rather than directly
+ * accessing them in a resource bundle.
+ * However, if you are programmatically creating your own
+ * resource bundles, you can initialize them with resources,
+ * as follows:</p>
+ *
+ * <pre>
+ * var rb:IResourceBundle = new ResourceBundle("fr_FR", "MyResources");
+ * rb.content["LANGUAGE"] = "Francais";
+ * rb.content["GREETING"] = "Bonjour";
+ * </pre>
+ *
+ * <p>When a resource bundle is produced by compiling a properties
+ * file, its resource values are either of type String or Class.
+ * For example, if the properties file contains</p>
+ *
+ * <pre>
+ * LANGUAGE=English
+ * MINIMUM_AGE=18
+ * ENABLED=true
+ * LOGO=Embed("logo.png")
+ * </pre>
+ *
+ * <p>then the value of the <code>LANGUAGE</code> resource
+ * is the String <code>"English"</code>,
+ * the value of the <code>MINIMUM_AGE</code> resource
+ * is the String <code>"18"</code>,
+ * the value of the <code>ENABLED</code> resource
+ * is the String <code>"true"</code>,
+ * and the value of the <code>LOGO</code> resource
+ * is a Class that represents the embedded PNG file.</p>
+ *
+ * <p>You can use IResourceManager methods such as <code>getInt()</code>
+ * and <code>getBoolean()</code> to convert resource strings like
+ * <code>"18"</code> and <code>"true"</code> into the type
+ * that your code expects.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get content():Object;
+
+ //----------------------------------
+ // locale
+ //----------------------------------
+
+ /**
+ * The locale for which this bundle's resources have been localized.
+ * This is a String such as <code>"en_US"</code> for U.S. English.
+ *
+ * <p>This read-only property is set
+ * when a resource bundle is constructed.</p>
+ *
+ * <p>Resource bundles that are automatically created from compiled
+ * properties files have locales based on the
+ * <code>-compiler.locale</code> option of the mxmlc or compc compilers.
+ * For example, suppose that you compile your application with the option
+ * <code>-compiler.locale=en_US,ja_JP</code> and that you have specified
+ * <code>-compiler.source-path=resources/{locale}</code> so that
+ * your application's resources, located in
+ * resources/en_US/MyResources.properties and
+ * resources/ja_JP/MyResources.properties, are found.
+ * Then your application will have two resource bundles
+ * whose <code>bundleName</code> is <code>"MyResources"</code>,
+ * one whose <code>locale</code> is <code>"en_US"</code>
+ * and one whose <code>locale</code> is <code>"ja_JP"</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get locale():String;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/resources/IResourceManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/resources/IResourceManager.as b/frameworks/projects/MX/src/main/flex/mx/resources/IResourceManager.as
new file mode 100644
index 0000000..a414949
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/resources/IResourceManager.as
@@ -0,0 +1,831 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.resources
+{
+
+import org.apache.flex.events.IEventDispatcher;
+import flex.system.DefinitionManager;
+COMPILE::LATER
+{
+import flash.system.SecurityDomain;
+}
+
+/**
+ * The APIs of the IResourceManager interface
+ * provide localization support for Flex applications.
+ *
+ * <p>There are three main concepts involved in localization:
+ * locales, resources, and resource bundles.</p>
+ *
+ * <p>A locale specifies a language and a country
+ * for which your application has been localized.
+ * For example, the locale <code>"en_US"</code>
+ * specifies English as spoken in the United States.
+ * (See the mx.resources.Locale class for more information.)</p>
+ *
+ * <p>A resource is a named value that is locale-dependent.
+ * For example, your application might have a resource
+ * whose name is <code>"OPEN"</code>
+ * and whose value for an English locale is <code>"Open"</code>
+ * but whose value for a French locale is <code>"Ouvrir"</code>.</p>
+ *
+ * <p>A resource bundle is a named group of resources
+ * whose values have been localized for a particular locale.
+ * A resource bundle is identified by the combination of its
+ * <code>bundleName</code> and its <code>locale</code>,
+ * and has a <code>content</code> object that contains
+ * the name-value pairs for the bundle's resources.
+ * See the documentation for mx.resources.IResourceBundle
+ * for information about how you typically create resource
+ * bundles from properties files.</p>
+ *
+ * <p>A single ResourceManager object implementing the IResourceManager
+ * interface manages multiple resource bundles, possibly for multiple
+ * locales, and provides access to the resources that they contain.
+ * For example, you can retrieve a specific resource as a String by calling
+ * <code>resourceManager.getString(bundleName, resourceName)</code>.</p>
+ *
+ * <p>All classes that extend UIComponent, Formatter, or Validator
+ * have a <code>resourceManager</code> property
+ * that provides a reference to the object implementing this interface.
+ * Other classes can call <code>ResourceManager.getInstance()</code>
+ * to obtain this object.</p>
+ *
+ * <p>Resource retrieval methods such as <code>getString()</code>
+ * search for resources in the locales specified
+ * by the <code>localeChain</code> property.
+ * By changing this property, you can make your application
+ * suddenly use, for example, Japanese rather than English resources.</p>
+ *
+ * <p>When your application starts, the ResourceManager is automatically
+ * populated with whatever resource bundles were compiled
+ * into the application.
+ * If you create a code module, by default the resources that its classes
+ * need are compiled into the module.
+ * When the module is loaded into an application, any bundles that the
+ * application does not already have are added to the ResourceManager.</p>
+ *
+ * <p>You can compile "resource modules" which have only resources in them,
+ * and load them with the <code>loadResourceModule()</code> method
+ * of IResourceManager.
+ * With resource modules, you can support multiple locales by loading
+ * the resources you need at run time rather than compiling them into
+ * your application.</p>
+ *
+ * <p>Although the ResourceManager is normally populated with resource bundles
+ * that were compiled into your application or loaded from modules,
+ * you can also programmatically create resource bundles and add them
+ * to the ResourceManager yourself with the <code>addResourceBundle()</code>
+ * method.</p>
+ *
+ * @see mx.resources.ResourceManager
+ * @see mx.resources.IResourceBundle
+ * @see mx.resources.ResourceBundle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IResourceManager extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // localeChain
+ //----------------------------------
+
+ /**
+ * An Array of locale Strings, such as <code>[ "en_US" ]</code>,
+ * which specifies one or more locales to be searched for resources.
+ *
+ * <p>When you call the ResourceManager methods <code>getObject()</code>,
+ * <code>getString()</code>, <code>getStringArray()</code>,
+ * <code>getNumber()</code>, <code>getInt()</code>,
+ * <code>getUint()</code>, <code>getBoolean()</code>, or
+ * <code>getClass()</code> to get the value of a resource,
+ * you specify a bundle name and a resource name,
+ * but not a locale.
+ * The ResourceManager starts with the first locale in the
+ * <code>localeChain</code> and looks for a ResourceBundle
+ * with the specified bundle name for that locale.
+ * If such a ResourceBundle exists, and the specified resource
+ * exists in it, then the value of that resource is returned.
+ * Otherwise, the ResourceManager proceeds on to the other
+ * locales in the <code>localeChain</code>.</p>
+ *
+ * <p>This scheme makes it possible to have locales that do not
+ * necessarily contain a complete set of localized resources.
+ * For example, if you are localizing your application for
+ * Indian English rather than U.S. English, you need only
+ * supply resources for the <code>en_IN</code> locale in which the
+ * Indian spelling or usage differs from that in the U.S.,
+ * and then set the <code>localeChain</code> property
+ * to <code>[ "en_IN", "en_US" ]</code>.</p>
+ *
+ * <p>Many framework classes assume that they can always
+ * obtain, from some locale, the resources that they expect,
+ * and they will throw errors if they cannot do so.
+ * Therefore, you must ensure that the <code>localeChain</code>
+ * always contains a complete set of resources.
+ * Unless you have done a complete localization of all the
+ * framework's resources as well as your own application's
+ * resources, you can keep the <code>"en_US"</code> locale
+ * at the end of your <code>localeChain</code> to ensure this.</p>
+ *
+ * <p>Setting this property causes the ResourceManager to dispatch
+ * a <code>"change"</code> Event.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get localeChain():Array /* of String */;
+
+ /**
+ * @private
+ */
+ function set localeChain(value:Array /* of String */):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Begins loading a resource module containing resource bundles.
+ *
+ * <p>Each call to this method returns a new event-dispatching object
+ * that you can use to learn how the loading is progressing
+ * and whether it completes successfully or results in an error.
+ * This object dispatches <code>ResourceEvent.PROGRESS</code>,
+ * <code>ResourceEvent.COMPLETE</code>, and
+ * <code>ResourceEvent.ERROR</code> events.</p>
+ *
+ * <p>When the module has been loaded, the resource bundles
+ * are added to the ResourceManager, but the <code>localeChain</code>
+ * is left unchanged.
+ * If the <code>update</code> parameter is <code>true</code>,
+ * the <code>update()</code> method will be called.</p>
+ *
+ * @param url The URL from which to load the resource module.
+ *
+ * @param update Whether to call
+ * the <code>update()</code> method when the module finishes loading.
+ *
+ * @param applicationDomain The ApplicationDomain passed to the
+ * <code>load()</code> method of the IModuleInfo class
+ * that loads the resource module.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @param securityDomain The SecurityDomain passed to the
+ * <code>load()</code> method of the IModuleInfo class
+ * that loads the resource module.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @return An object that is associated with this particular load operation
+ * that dispatches <code>ResourceEvent.PROGRESS</code>,
+ * <code>ResourceEvent.COMPLETE</code>, and
+ * <code>ResourceEvent.ERROR</code> events.
+ *
+ * @see mx.events.ResourceEvent
+ * @see mx.resources.IResourceManager#update()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function loadResourceModule(url:String, update:Boolean = true,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):
+ IEventDispatcher;
+
+ /**
+ * Begins unloading a loaded resource module.
+ *
+ * <p>When the module is unloaded, its resource bundles
+ * are removed from the ResourceManager, but the <code>localeChain</code>
+ * is left unchanged.
+ * If the <code>update</code> parameter is <code>true</code>,
+ * the <code>update()</code> method will be called.</p>
+ *
+ * @param url The URL that was used to load the resource module.
+ *
+ * @param update Whether to call
+ * the <code>update()</code> method when the module finishes unloading.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function unloadResourceModule(url:String, update:Boolean = true):void;
+
+ /**
+ * Adds the specified ResourceBundle to the ResourceManager
+ * so that its resources can be accessed by ResourceManager
+ * methods such as <code>getString()</code>.
+ *
+ * @param resourceBundle The resource bundle to be added.
+ * @param useWeakReference Determines if the ResourceManager
+ * keeps a weak reference to the resource bundle.
+ * If <code>useWeakReference</code> is <code>true</code> then the ResourceManager
+ * provides a weak reference to the resource bundle. When the
+ * caller chooses to use a weak reference it becomes the
+ * caller's responsibility to keep a hard reference the resource bundle
+ * so it is not garbaged collected prematurely. If <code>useWeakReference</code> is
+ * <code>false</code>, the ResourceManager keeps a hard reference to the resource
+ * bundle so it will not be garbage collected.
+ *
+ * <p>When a Flex sub-application or module automatically adds its compiled
+ * resource bundles to the ResourceManager, it calls the <code>addResourceBundle()</code>
+ * with <code>useWeakReference</code> set to <code>true</code>, to avoid becoming pinned in memory.
+ * If you create resource bundles at runtime in a sub-application or
+ * module, you should do the same. You then need to hold on to these
+ * resource bundles with a hard reference to prevent them from being
+ * garbage collected.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addResourceBundle(resourceBundle:IResourceBundle,
+ useWeakReference:Boolean = false):void;
+
+ /**
+ * Removes the specified ResourceBundle from the ResourceManager
+ * so that its resources can no longer be accessed by ResourceManager
+ * methods such as <code>getString()</code>.
+ *
+ * @param locale A locale string such as <code>"en_US"</code>.
+ *
+ * @param bundleName A bundle name such as <code>"MyResources"</code>.
+ *
+ * @see mx.resources.IResourceBundle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeResourceBundle(locale:String, bundleName:String):void;
+
+ /**
+ * Removes all ResourceBundles for the specified locale
+ * from the ResourceManager so that their resources
+ * can no longer be accessed by ResourceManager methods
+ * such as <code>getString()</code>.
+ *
+ * @param locale A locale string such as <code>"en_US"</code>.
+ *
+ * @see mx.resources.IResourceBundle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeResourceBundlesForLocale(locale:String):void;
+
+ /**
+ * Dispatches a <code>change</code> event from the
+ * ResourceManager.
+ *
+ * <p>This causes binding expressions to re-evaluate
+ * if they involve the ResourceManager methods
+ * <code>getObject()</code>, <code>getString()</code>,
+ * <code>getStringArray()</code>, <code>getNumber()</code>,
+ * <code>getInt()</code>, <code>getUint()</code>,
+ * <code>getBoolean()</code>, or <code>getClass()</code>.</p>
+ *
+ * <p>This also causes the <code>resourcesChanged()</code> method
+ * of a UIComponent, Formatter, or Validator to execute.
+ * Many components implement this method to update
+ * their state based on the latest resources.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function update():void;
+
+ /**
+ * Returns an Array of Strings specifying all locales for which
+ * ResourceBundle objects exist in the ResourceManager.
+ *
+ * <p>The order of locales in this array is not specified.</p>
+ *
+ * @return An Array of locale Strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getLocales():Array /* of String */;
+
+ /**
+ * Returns an Array of Strings specifying all locales for which
+ * ResourceBundle objects exist in the ResourceManager,
+ * ordered using user preferences as reported by
+ * <code>Capabilities.language</code> or
+ * <code>Capabilities.languages</code>.
+ *
+ * @return An Array of locale Strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getPreferredLocaleChain():Array /* of String */;
+
+ /**
+ * Returns an Array of Strings specifying the bundle names
+ * for all ResourceBundle objects that exist in the ResourceManager
+ * and that belong to the specified locale.
+ *
+ * <p>The order of bundle names in this Array is not specified.</p>
+ *
+ * @param locale A locale string such as <code>"en_US"</code>.
+ *
+ * @return An Array of bundle names.
+ *
+ * @see mx.resources.IResourceBundle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getBundleNamesForLocale(locale:String):Array /* of String */;
+
+ /**
+ * Returns a ResourceBundle with the specified <code>locale</code>
+ * and <code>bundleName</code> that has been previously added
+ * to the ResourceManager with <code>addResourceBundle()</code>.
+ * If no such ResourceBundle exists, this method returns <code>null</code>.
+ *
+ * @param locale A locale string such as <code>"en_US"</code>.
+ *
+ * @param bundleName A bundle name such as <code>"MyResources"</code>.
+ *
+ * @return The ResourceBundle with the specified <code>locale</code>
+ * and <code>bundleName</code> if one exists; otherwise <code>null</code>.
+ *
+ * @see mx.resources.IResourceBundle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getResourceBundle(locale:String,
+ bundleName:String):IResourceBundle;
+
+ /**
+ * Searches the locales in the <code>localeChain</code>
+ * for the specified resource and returns
+ * the first resource bundle in which it is found.
+ * If the resource isn't found, this method returns <code>null</code>.
+ *
+ * @param bundleName A bundle name such as <code>"MyResources"</code>.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @return The first ResourceBundle in the <code>localeChain</code>
+ * that contains the specified resource, or <code>null</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function findResourceBundleWithResource(
+ bundleName:String,
+ resourceName:String):IResourceBundle;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as an Object.
+ *
+ * <p>The value is returned exactly as it is stored
+ * in the <code>content</code> Object of the ResourceBundle,
+ * with no conversion.
+ * If the resource was compiled from a properties files,
+ * the resource value in the <code>content</code> Object
+ * is always a String unless you used the <code>Embed()</code>
+ * or <code>ClassReference()</code> directive, in which case
+ * it is a Class.
+ * Use the <code>getString()</code>, <code>getStringArray()</code>,
+ * <code>getNumber()</code>, <code>getInt()</code>
+ * <code>getUint()</code>, <code>getBoolean()</code>, and
+ * <code>getClass()</code> methods to convert the value
+ * to more specific types.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns <code>undefined</code>.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, exactly as it is stored
+ * in the <code>content</code> Object,
+ * or <code>undefined</code> if the resource is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getObject(bundleName:String, resourceName:String,
+ locale:String = null):*;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as a String,
+ * after substituting specified values for placeholders.
+ *
+ * <p>This method calls <code>getObject()</code>
+ * and then casts the result to a String.</p>
+ *
+ * <p>If a <code>parameters</code> Array is passed to this method,
+ * the parameters in it are converted to Strings
+ * and then substituted, in order, for the placeholders
+ * <code>"{0}"</code>, <code>"{1}"</code>, and so on, in the String
+ * before it is returned.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns <code>null</code>.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param parameters An Array of parameters that are
+ * substituted for the placeholders.
+ * Each parameter is converted to a String with the <code>toString()</code> method
+ * before being substituted.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as a String,
+ * or <code>null</code> if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getString(bundleName:String, resourceName:String,
+ parameters:Array = null,
+ locale:String = null):String;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as an Array of Strings.
+ *
+ * <p>This method assumes that the resource value is a String
+ * containing a comma-separated list of items.
+ * It calls the <code>getString()</code> method, splits the String
+ * into items at the commas, and trims white space
+ * before and after each item.
+ * It is useful if you have written a line such as:</p>
+ *
+ * <pre>
+ * COUNTRIES=India, China, Japan
+ * </pre>
+ *
+ * <p>in a properties file and you want to obtain the value
+ * <code>[ "India", "China", "Japan" ]</code>
+ * rather than the value <code>"India, China, Japan"</code>.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns <code>null</code>.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as an Array of Strings,
+ * or <code>null</code> if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getStringArray(bundleName:String,
+ resourceName:String,
+ locale:String = null):Array /* of String */;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as a Number.
+ *
+ * <p>This method calls <code>getObject()</code>
+ * and casts the result to a Number.
+ * It is useful if you have written a line such as:</p>
+ *
+ * <pre>
+ * LONGITUDE=170.3
+ * </pre>
+ *
+ * <p>in a properties file and want to obtain the value
+ * 170.3 rather than <code>"170.3"</code>.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns <code>NaN</code>.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as a Number,
+ * or <code>NaN</code> if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getNumber(bundleName:String, resourceName:String,
+ locale:String = null):Number;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as an int.
+ *
+ * <p>This method calls <code>getObject()</code>
+ * and casts the result to an int.
+ * It is useful if you have written a line such as:</p>
+ *
+ * <pre>
+ * MINIMUM=5
+ * </pre>
+ *
+ * <p>in a properties file and want to obtain the value
+ * 5 rather than <code>"5"</code>.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns 0.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as an int,
+ * or 0 if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getInt(bundleName:String, resourceName:String,
+ locale:String = null):int;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as a uint.
+ *
+ * <p>This method calls the <code>getObject()</code> method
+ * and casts the result to a uint.
+ * It is useful if you have written a line such as:</p>
+ *
+ * <pre>
+ * MINIMUM=5
+ * </pre>
+ *
+ * <p>in a properties file and want to obtain the value
+ * 5 rather than <code>"5"</code>.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns 0.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as a uint,
+ * or 0 if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getUint(bundleName:String, resourceName:String,
+ locale:String = null):uint;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as a Boolean.
+ *
+ * <p>This method first calls <code>getString()</code>
+ * and converts the result to lowercase.
+ * It then returns <code>true</code>
+ * if the result was <code>"true"</code>.
+ * and <code>false</code> otherwise.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns <code>false</code>.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as a Boolean,
+ * or <code>false</code> if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getBoolean(bundleName:String, resourceName:String,
+ locale:String = null):Boolean;
+
+ [Bindable("change")]
+
+ /**
+ * Gets the value of a specified resource as a Class.
+ *
+ * <p>This method calls <code>getObject()</code>
+ * and coerces it to type Class using the <code>as</code> operator.
+ * The result will be <code>null</code> if the resource value
+ * was not a class reference.
+ * It is useful if you have written a lines such as</p>
+ *
+ * <pre>
+ * IMAGE=Embed("image.jpg")
+ * BUTTON_SKIN=ClassReference("skins.ButtonSkin_en_US")
+ * </pre>
+ *
+ * <p>in a properties file and want to obtain
+ * the Class that the <code>Embed()</code>
+ * or <code>ClassReference()</code> directive produced.</p>
+ *
+ * <p>If the specified resource is not found,
+ * this method returns <code>null</code>.</p>
+ *
+ * @param bundleName The name of a resource bundle.
+ *
+ * @param resourceName The name of a resource in the resource bundle.
+ *
+ * @param locale A specific locale to be used for the lookup,
+ * or <code>null</code> to search all locales
+ * in the <code>localeChain</code>.
+ * This parameter is optional and defaults to <code>null</code>;
+ * you should seldom need to specify it.
+ *
+ * @return The resource value, as a <code>Class</code>,
+ * or <code>null</code> if it is not found.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getClass(bundleName:String, resourceName:String,
+ locale:String = null):Class;
+
+ /**
+ * Creates instances of all ResourceBundle subclasses that were compiled into the SWF
+ * and adds them to the ResourceManager.
+ *
+ * <p>For example, if the <code>locales</code> parameter is [ "en_US", "ja_JP" ]
+ * and the <code>bundleNames</code> parameter is [ "core", "controls" ],
+ * then four resource bundles will be installed.</p>
+ *
+ * <p>This method is used only by classes that implement the IFlexModuleFactory interface.</p>
+ *
+ * @param applicationDomain The ApplicationDomain that is used to look up the resource bundle
+ * classes by name.
+ *
+ * @param locales An Array of Strings that specify the locales for which the SWF was compiled.
+ *
+ * @param bundleNames An Array of Strings that specify the names of the resource bundles
+ * that were compiled into the SWF.
+ *
+ * @param useWeakReference A flag that specifyies whether the resource bundles should be
+ * intalled into the ResourceManager using a weak reference.
+ *
+ * @return An Array of the ResourceBundle instances that were created
+ * and added to the ResourceManager.
+ *
+ * @see mx.core.IFlexModuleFactory
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function installCompiledResourceBundles(
+ applicationDomain:DefinitionManager,
+ locales:Array /* of String */,
+ bundleNames:Array /* of String */,
+ useWeakReference:Boolean = false):Array;
+
+ /**
+ * Initializes the <code>localeChain</code> property of the ResourceManager
+ * using an algorithm that compares the operating system's list of user-preferred
+ * locales with the list of locales available in the SWF.
+ *
+ * <p>For example, if the user has indicated in the operating system that she
+ * prefers French, and the SWF was compiled for the locales en_US, fr_FR, and de_DE,
+ * then the <code>localeChain</code> will be set so that the first locale in it
+ * is fr_FR.</p>
+ *
+ * <p>This method is used only by classes that implement the IFlexModuleFactory interface.</p>
+ *
+ * @param compiledLocales An Array of Strings specifying the locales
+ * for which the SWF was compiled.
+ *
+ * @see mx.core.IFlexModuleFactory
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initializeLocaleChain(compiledLocales:Array):void;
+}
+
+}
[17/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/SetStyle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/SetStyle.as b/frameworks/projects/MX/src/main/flex/mx/states/SetStyle.as
new file mode 100644
index 0000000..c3bcf1f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/SetStyle.as
@@ -0,0 +1,454 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import mx.core.UIComponent;
+import mx.core.IDeferredInstance;
+import mx.styles.IStyleClient;
+import mx.styles.StyleManager;
+import mx.core.IFlexModule;
+import mx.styles.IStyleManager2;
+
+/**
+ * The SetStyle class specifies a style that is in effect only during the parent view state.
+ * You use this class in the <code>overrides</code> property of the State class.
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:SetStyle></code> tag
+ * has the following attributes:</p>
+ *
+ * <pre>
+ * <mx:SetStyle
+ * <b>Properties</b>
+ * name="null"
+ * target="null"
+ * value"null"
+ * />
+ * </pre>
+ *
+ * @see mx.states.State
+ * @see mx.states.SetEventHandler
+ * @see mx.states.SetProperty
+ * @see mx.effects.SetStyleAction
+ *
+ * @includeExample examples/StatesExample.mxml
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class SetStyle extends OverrideBase
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This is a table of related properties.
+ * Whenever the property being overridden is found in this table,
+ * the related property is also saved and restored.
+ */
+ private static const RELATED_PROPERTIES:Object =
+ {
+ left: [ "x" ],
+ top: [ "y" ],
+ right: [ "x" ],
+ bottom: [ "y" ]
+ };
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param target The object whose style is being set.
+ * By default, Flex uses the immediate parent of the State object.
+ *
+ * @param name The style to set.
+ *
+ * @param value The value of the style in the view state.
+ *
+ * @param valueFactory An optional write-only property from which to obtain
+ * a shared value. This is primarily used when this override's value is
+ * shared by multiple states or state groups.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function SetStyle(
+ target:IStyleClient = null,
+ name:String = null,
+ value:Object = null,
+ valueFactory:IDeferredInstance = null
+ )
+ {
+ super();
+
+ this.target = target;
+ this.name = name;
+ this.value = value;
+ this.valueFactory = valueFactory;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Storage for the old style value.
+ */
+ private var oldValue:Object;
+
+ /**
+ * @private
+ * True if old value was set as an inline style.
+ */
+ private var wasInline:Boolean;
+
+ /**
+ * @private
+ * Storage for the old related property values, if used.
+ */
+ private var oldRelatedValues:Array;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // name
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The name of the style to change.
+ * You must set this property, either in
+ * the SetStyle constructor or by setting
+ * the property value directly.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var name:String;
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ *
+ * The object whose style is being changed.
+ * If the property value is <code>null</code>, Flex uses the
+ * immediate parent of the State object.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var target:Object;
+
+ /**
+ * The cached target for which we applied our override.
+ * We keep track of the applied target while applied since
+ * our target may be swapped out in the owning document and
+ * we want to make sure we roll back the correct (original)
+ * element.
+ *
+ * @private
+ */
+ private var appliedTarget:Object;
+
+ //----------------------------------
+ // value
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * @private
+ * Storage for the style value.
+ */
+ public var _value:Object;
+
+ /**
+ * The new value for the style.
+ *
+ * @default undefined
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get value():Object
+ {
+ return _value;
+ }
+
+ /**
+ * @private
+ */
+ public function set value(val:Object):void
+ {
+ _value = val;
+
+ // Reapply if necessary.
+ if (applied)
+ {
+ apply(parentContext);
+ }
+ }
+
+ //----------------------------------
+ // valueFactory
+ //----------------------------------
+
+ /**
+ * An optional write-only property from which to obtain a shared value. This
+ * is primarily used when this override's value is shared by multiple states
+ * or state groups.
+ *
+ * @default undefined
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ public function set valueFactory(factory:IDeferredInstance):void
+ {
+ // We instantiate immediately in order to retain the instantiation
+ // behavior of a typical (unshared) value. We may later enhance to
+ // allow for deferred instantiation.
+ if (factory)
+ value = factory.getInstance();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // IOverride methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function apply(parent:UIComponent):void
+ {
+ parentContext = parent;
+ var context:Object = getOverrideContext(target, parent);
+ if (context != null)
+ {
+ appliedTarget = context;
+ var obj:IStyleClient = IStyleClient(appliedTarget);
+
+ var relatedProps:Array = RELATED_PROPERTIES[name] ?
+ RELATED_PROPERTIES[name] :
+ null;
+
+ // Remember the original value so it can be restored later
+ // after we are asked to remove our override (and only if we
+ // aren't being asked to re-apply a value).
+ if (!applied)
+ {
+ wasInline = obj.styleDeclaration &&
+ obj.styleDeclaration.getStyle(name) !== undefined;
+ oldValue = wasInline ? obj.getStyle(name) : null;
+ }
+
+ if (relatedProps)
+ {
+ oldRelatedValues = [];
+
+ for (var i:int = 0; i < relatedProps.length; i++)
+ oldRelatedValues[i] = obj[relatedProps[i]];
+ }
+
+ // Set new value
+ if (value === null)
+ {
+ obj.clearStyle(name);
+ }
+ else if (oldValue is Number)
+ {
+ // The "value" for colors can be several different formats:
+ // 0xNNNNNN, #NNNNNN or "red". We can't use
+ // StyleManager.isColorStyle() because that only returns true
+ // for inheriting color styles and misses non-inheriting styles like
+ // backgroundColor.
+ if (name.toLowerCase().indexOf("color") != -1)
+ {
+ var styleManager:IStyleManager2;
+ if (obj is UIComponent)
+ styleManager = UIComponent(obj).styleManager;
+ else
+ styleManager = parent.styleManager;
+
+ obj.setStyle(name, styleManager.getColorName(value));
+ }
+ else if (value is String &&
+ String(value).lastIndexOf("%") ==
+ String(value).length - 1)
+ {
+ obj.setStyle(name, value);
+ }
+ else
+ {
+ obj.setStyle(name, Number(value));
+ }
+ }
+ else if (oldValue is Boolean)
+ {
+ obj.setStyle(name, toBoolean(value));
+ }
+ else
+ {
+ obj.setStyle(name, value);
+ }
+
+ // Disable bindings for the base style if appropriate. If the binding
+ // fires while our override is applied, the correct value will automatically
+ // be applied when the binding is later enabled.
+ enableBindings(obj, parent, name, false);
+ }
+ else if (!applied)
+ {
+ // Our target context is unavailable so we attempt to register
+ // a listener on our parent document to detect when/if it becomes
+ // valid.
+ addContextListener(target);
+ }
+
+ // Save state in case our value or target is changed while applied. This
+ // can occur when our value property is databound or when a target is
+ // deferred instantiated.
+ applied = true;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function remove(parent:UIComponent):void
+ {
+ var obj:IStyleClient = IStyleClient(getOverrideContext(appliedTarget, parent));
+ if (obj != null && appliedTarget)
+ {
+ if (wasInline)
+ {
+ // Restore the old value
+ if (oldValue is Number)
+ obj.setStyle(name, Number(oldValue));
+ else if (oldValue is Boolean)
+ obj.setStyle(name, toBoolean(oldValue));
+ else if (oldValue === null)
+ obj.clearStyle(name);
+ else
+ obj.setStyle(name, oldValue);
+ }
+ else
+ {
+ obj.clearStyle(name);
+ }
+
+ // Re-enable bindings for the base style if appropriate. If the binding
+ // fired while our override was applied, the current value will automatically
+ // be applied once enabled.
+ enableBindings(obj, parent, name);
+
+ var relatedProps:Array = RELATED_PROPERTIES[name] ?
+ RELATED_PROPERTIES[name] :
+ null;
+
+ // Restore related property values, if needed
+ if (relatedProps)
+ {
+ for (var i:int = 0; i < relatedProps.length; i++)
+ {
+ obj[relatedProps[i]] = oldRelatedValues[i];
+ }
+ }
+
+ }
+ else
+ {
+ // It seems our override is no longer active, but we were never
+ // able to successfully apply ourselves, so remove our context
+ // listener if applicable.
+ removeContextListener();
+ }
+
+ // Clear our flags and override context.
+ applied = false;
+ parentContext = null;
+ appliedTarget = null;
+ }
+
+ /**
+ * @private
+ * Converts a value to a Boolean true/false.
+ */
+ private function toBoolean(value:Object):Boolean
+ {
+ if (value is String)
+ return value.toLowerCase() == "true";
+
+ return value != false;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/State.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/State.as b/frameworks/projects/MX/src/main/flex/mx/states/State.as
new file mode 100644
index 0000000..4e24e62
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/State.as
@@ -0,0 +1,291 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import flash.events.EventDispatcher;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+
+use namespace mx_internal;
+
+//--------------------------------------
+// Events
+//--------------------------------------
+
+/**
+ * Dispatched after a view state has been entered.
+ *
+ * @eventType mx.events.FlexEvent.ENTER_STATE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="enterState", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched just before a view state is exited.
+ * This event is dispatched before the changes
+ * to the default view state have been removed.
+ *
+ * @eventType mx.events.FlexEvent.EXIT_STATE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="exitState", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+// Other metadata
+//--------------------------------------
+
+[DefaultProperty("overrides")]
+
+/**
+ * The State class defines a view state, a particular view of a component.
+ * For example, a product thumbnail could have two view states;
+ * a base view state with minimal information, and a rich view state with
+ * additional information.
+ * The <code>overrides</code> property specifies a set of child classes
+ * to add or remove from the base view state, and properties, styles, and event
+ * handlers to set when the view state is in effect.
+ *
+ * <p>You use the State class in the <code>states</code> property
+ * of Flex components.
+ * You can only specify a <code>states</code> property at the root of an
+ * application or a custom control, not on child controls.</p>
+ *
+ * <p>You enable a view state by setting a component's
+ * <code>currentState</code> property.</p>
+ *
+ * @mxml
+ * <p>The <code><mx:State></code> tag has the following attributes:</p>
+ *
+ * <pre>
+ * <mx:State
+ * <b>Properties</b>
+ * basedOn="null"
+ * name="null"
+ * overrides="null"
+ * />
+ * </pre>
+ *
+ * @see mx.states.AddChild
+ * @see mx.states.RemoveChild
+ * @see mx.states.SetEventHandler
+ * @see mx.states.SetProperty
+ * @see mx.states.SetStyle
+ * @see mx.states.Transition
+ *
+ * @includeExample examples/StatesExample.mxml
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class State extends EventDispatcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param properties Object containing property settings for this State.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function State(properties:Object=null)
+ {
+ super();
+
+ // Initialize from object if provided.
+ for (var p:String in properties)
+ {
+ this[p] = properties[p];
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Initialized flag
+ */
+ private var initialized:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // basedOn
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The name of the view state upon which this view state is based, or
+ * <code>null</code> if this view state is not based on a named view state.
+ * If this value is <code>null</code>, the view state is based on a root
+ * state that consists of the properties, styles, event handlers, and
+ * children that you define for a component without using a State class.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var basedOn:String;
+
+ //----------------------------------
+ // name
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The name of the view state.
+ * State names must be unique for a given component.
+ * This property must be set.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var name:String;
+
+ //----------------------------------
+ // overrides
+ //----------------------------------
+
+ [ArrayElementType("mx.states.IOverride")]
+ [Inspectable(category="General")]
+
+ /**
+ * The overrides for this view state, as an Array of objects that implement
+ * the IOverride interface. These overrides are applied in order when the
+ * state is entered, and removed in reverse order when the state is exited.
+ *
+ * <p>The following Flex classes implement the IOverride interface and let you
+ * define the view state characteristics:</p>
+ * <ul>
+ * <li>AddChild</li>
+ * <li>RemoveChild</li>
+ * <li>SetEventHandler</li>
+ * <li>SetProperty</li>
+ * <li>SetStyle</li>
+ * </ul>
+ *
+ * <p>The <code>overrides</code> property is the default property of the
+ * State class. You can omit the <code><mx:overrides></code> tag
+ * and its child <code><mx:Array></code>tag if you use MXML tag
+ * syntax to define the overrides.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var overrides:Array /* of IOverride */ = [];
+
+ //----------------------------------
+ // stateGroups
+ //----------------------------------
+
+ [ArrayElementType("String")]
+ [Inspectable(category="General")]
+
+ /**
+ * The state groups that this view state belongs to as an array of String.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var stateGroups:Array /* of String */ = [];
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Initialize this state and all of its overrides.
+ */
+ mx_internal function initialize():void
+ {
+ if (!initialized)
+ {
+ initialized = true;
+ for (var i:int = 0; i < overrides.length; i++)
+ {
+ IOverride(overrides[i]).initialize();
+ }
+ }
+ }
+
+ /**
+ * @private
+ * Dispatches the "enterState" event.
+ */
+ mx_internal function dispatchEnterState():void
+ {
+ if (hasEventListener(FlexEvent.ENTER_STATE))
+ dispatchEvent(new FlexEvent(FlexEvent.ENTER_STATE));
+ }
+
+ /**
+ * @private
+ * Dispatches the "exitState" event.
+ */
+ mx_internal function dispatchExitState():void
+ {
+ if (hasEventListener(FlexEvent.EXIT_STATE))
+ dispatchEvent(new FlexEvent(FlexEvent.EXIT_STATE));
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/states/Transition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/states/Transition.as b/frameworks/projects/MX/src/main/flex/mx/states/Transition.as
new file mode 100644
index 0000000..768a427
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/states/Transition.as
@@ -0,0 +1,264 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.states
+{
+
+import mx.effects.IEffect;
+
+[DefaultProperty("effect")]
+
+/**
+ * The Transition class defines a set of effects that play in response
+ * to a change of view state. While a view state definition
+ * defines how to change states, a transition defines the order in which
+ * visual changes occur during the state change.
+ *
+ * <p>To define a transition, you set the <code>transitions</code> property of an Application
+ * to an Array of Transition objects. </p>
+ *
+ * <p>You use the <code>toState</code> and <code>fromState</code> properties of
+ * the Transition class to specify the state changes that trigger the transition.
+ * By default, both the <code>fromState</code> and <code>toState</code> properties
+ * are set to "*", meaning apply the transition to any changes to the view state.</p>
+ *
+ * <p>You can use the <code>fromState</code> property to explicitly specify a
+ * view state that your are changing from, and the <code>toState</code> property
+ * to explicitly specify a view state that you are changing to.
+ * If a state change matches two transitions, the <code>toState</code> property
+ * takes precedence over the <code>fromState</code> property. If more than one
+ * transition match, Flex uses the first definition in the transition array. </p>
+ *
+ * <p>You use the <code>effect</code> property to specify the Effect object to play
+ * when you apply the transition. Typically, this is a composite effect object,
+ * such as the Parallel or Sequence effect, that contains multiple effects,
+ * as the following example shows:</p><pre>
+ *
+ * <mx:Transition id="myTransition" fromState="*" toState="*">
+ * <mx:Parallel>
+ * ...
+ * </mx:Parallel>
+ * </mx:Transition>
+ * </pre>
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:Transition></code> tag
+ * defines the following attributes:</p>
+ *
+ * <pre>
+ * <mx:Transition
+ * <b>Properties</b>
+ * id="ID"
+ * effect=""
+ * fromState="*"
+ * toState="*"
+ * autoReverse="false"
+ * />
+ * </pre>
+ *
+ * @see mx.effects.AddChildAction
+ * @see mx.effects.RemoveChildAction
+ * @see mx.effects.SetPropertyAction
+ * @see mx.effects.SetStyleAction
+ *
+ * @includeExample examples/TransitionExample.mxml
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class Transition
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function Transition()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // effect
+ //----------------------------------
+
+ /**
+ * The IEffect object to play when you apply the transition. Typically,
+ * this is a composite effect object, such as the Parallel or Sequence effect,
+ * that contains multiple effects.
+ *
+ * <p>The <code>effect</code> property is the default property of the
+ * Transition class. You can omit the <code><mx:effect></code> tag
+ * if you use MXML tag syntax.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var effect:IEffect;
+
+ //----------------------------------
+ // fromState
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * A String specifying the view state that your are changing from when
+ * you apply the transition. The default value is "*", meaning any view state.
+ *
+ * <p>You can set this property to an empty string, "",
+ * which corresponds to the base view state.</p>
+ *
+ * @default "*"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var fromState:String = "*";
+
+ //----------------------------------
+ // toState
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * A String specifying the view state that you are changing to when
+ * you apply the transition. The default value is "*", meaning any view state.
+ *
+ * <p>You can set this property to an empty string, "",
+ * which corresponds to the base view state.</p>
+ *
+ * @default "*"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var toState:String = "*";
+
+ /**
+ * Set to <code>true</code> to specify that this transition applies
+ * to both the forward and reverse view state changes.
+ * Therefore, use this transition on a change from view state A to
+ * view state B, and on the change from B to A.
+ *
+ * <p>While the transition from view state A to view state B is playing,
+ * the reverse transition can occur to interrupt the current transition.
+ * The reverse transition always halts the current transition at
+ * its current location.
+ * That is, the reverse transition always plays as if
+ * the <code>interruptionBehavior</code> property was set to <code>stop</code>,
+ * regardless of the real value of <code>interruptionBehavior</code>.</p>
+ *
+ * <p>This property is only checked when the new transition is going in the
+ * exact opposite direction of the currently playing one. That is, if
+ * a transition is playing between states A and B and then a transition
+ * to return to A is started. </p>
+ *
+ * <p>If a transition uses the <code>toState</code> and <code>fromState</code>
+ * properties to explicitly handle the transition from view state B to A,
+ * then Flex ignores the <code>autoReverse</code> property. </p>
+ *
+ * @default false
+ *
+ * @see Transition#interruptionBehavior
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var autoReverse:Boolean = false;
+
+ /**
+ * Flex does not support the playing of multiple transitions simultaneously.
+ * If a transition is currently playing when a new transition occurs,
+ * the current transition is interrupted.
+ * This property controls how the current transition behaves when interrupted.
+ *
+ * <p>By default, the current transition ends, which snaps all effects in
+ * the transition to their end values.
+ * This corresponds to a property value of <code>end</code>.
+ * If the value of this property is <code>stop</code>, the current transition
+ * halts at its current location.
+ * The new transition start playing from the halt location of
+ * the previous transition.</p>
+ *
+ * <p>The value of <code>stop</code> can smooth out the appearance of an
+ * interrupted transition.
+ * That is because the user does not see the current transition snap
+ * to its end state before the new transition begins.</p>
+ *
+ * <p>In some cases, the interrupting transition can be the reverse of
+ * the current transition.
+ * For example, while the transition from view state A to view state B
+ * is playing, the reverse transition occurs to interrupt the current transition.
+ * If you set the <code>autoReverse</code> property of a transition instance
+ * to <code>true</code>, you can use the same transition to handle both
+ * the forward and reverse transitions.
+ * When the interrupting transition is the reverse transition of the
+ * current transition and has <code>autoReverse</code> set to <code>true</code>,
+ * the interrupting transition runs as if the
+ * <code>interruptionBehavior</code> property was set to <code>stop</code>,
+ * regardless of the real value of <code>interruptionBehavior</code>.</p>
+ *
+ * <p>The mx.states.InterruptionBehavior class defines
+ * the possible values for this property.</p>
+ *
+ * @default end
+ *
+ * @see Transition#autoReverse
+ * @see mx.states.InterruptionBehavior
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ [Inspectable(category="General", enumeration="end,stop", defaultValue="end")]
+ public var interruptionBehavior:String = InterruptionBehavior.END;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSCondition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSCondition.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSCondition.as
new file mode 100644
index 0000000..af8ffbd
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSCondition.as
@@ -0,0 +1,236 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+import mx.utils.StringUtil;
+
+/**
+ * Represents a condition for a CSSSelector which is used to match a subset of
+ * components based on a particular property.
+ *
+ * @see mx.styles.CSSConditionKind
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public class CSSCondition
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param kind The kind of condition. For valid values see the
+ * CSSConditionKind enumeration.
+ * @param value The condition value (without CSS syntax).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function CSSCondition(kind:String, value:String)
+ {
+ _kind = kind;
+ _value = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // kind
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _kind:String;
+
+
+ /**
+ * The kind of condition this instance represents. Options are class,
+ * id and pseudo.
+ *
+ * @see mx.styles.CSSConditionKind
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get kind():String
+ {
+ return _kind;
+ }
+
+ //----------------------------------
+ // specificity
+ //----------------------------------
+
+ /**
+ * Calculates the specificity of a conditional selector in a selector
+ * chain. The total specificity is used to determine the precedence when
+ * applying several matching style declarations. id conditions contribute
+ * 100 points, pseudo and class conditions each contribute 10 points.
+ * Selectors with a higher specificity override selectors of lower
+ * specificity. If selectors have equal specificity, the declaration order
+ * determines the precedence (i.e. the last one wins).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get specificity():int
+ {
+ if (kind == CSSConditionKind.ID)
+ return 100;
+ else if (kind == CSSConditionKind.CLASS)
+ return 10;
+ else if (kind == CSSConditionKind.PSEUDO)
+ return 10;
+ else
+ return 0;
+ }
+
+ //----------------------------------
+ // value
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _value:String;
+
+ /**
+ * The value of this condition without any CSS syntax. To get a String
+ * representation that includes CSS syntax, call the <code>toString()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get value():String
+ {
+ return _value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether this condition matches the given component.
+ *
+ * @param object The component to which the condition may apply.
+ * @return true if component is a match, otherwise false.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function matchesStyleClient(object:IAdvancedStyleClient):Boolean
+ {
+ if (kind == CSSConditionKind.CLASS)
+ {
+ const styleName:String = object.styleName as String;
+ if (!styleName)
+ {
+ return false;
+ }
+
+ // Look for a match in a whitespace-delimited list of styleNames
+ var index:int = styleName.indexOf(value);
+ while (index != -1)
+ {
+ var next:int = index + value.length;
+
+ // At start or after whitespace?
+ if (index == 0 || StringUtil.isWhitespace(styleName.charAt(index - 1)))
+ {
+ // At end or followed by whitespace?
+ if (next == styleName.length || StringUtil.isWhitespace(styleName.charAt(next)))
+ {
+ return true;
+ }
+ }
+
+ index = styleName.indexOf(value, next)
+ }
+
+ return false;
+ }
+
+ if (kind == CSSConditionKind.ID)
+ {
+ return (object.id == value);
+ }
+
+ if (kind == CSSConditionKind.PSEUDO)
+ {
+ return object.matchesCSSState(value);
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns a String representation of this condition.
+ *
+ * @return A String representation of this condition, including CSS syntax.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function toString():String
+ {
+ var s:String;
+
+ if (kind == CSSConditionKind.CLASS)
+ s = ("." + value);
+ else if (kind == CSSConditionKind.ID)
+ s = ("#" + value);
+ else if (kind == CSSConditionKind.PSEUDO)
+ s = (":" + value);
+ else
+ s = "";
+
+ return s;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSConditionKind.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSConditionKind.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSConditionKind.as
new file mode 100644
index 0000000..67c6a5c
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSConditionKind.as
@@ -0,0 +1,84 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+/**
+ * An enumeration of the kinds of CSSCondition.
+ *
+ * @see mx.styles.CSSCondition
+ * @see mx.styles.CSSSelector
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+final public class CSSConditionKind
+{
+ /**
+ * A selector condition to match a component by styleName.
+ * Examples:
+ * Button.special { ... }
+ * .special { ... }
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const CLASS:String = "class";
+
+ /**
+ * A selector condition to match a component by id.
+ * Examples:
+ * Button#special { ... }
+ * #special { ... }
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const ID:String = "id";
+
+ /**
+ * A selector condition to match a component by state (which may be
+ * dynamic and change over time).
+ * Examples:
+ * Button:special { ... }
+ * :special { ... }
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static const PSEUDO:String = "pseudo";
+
+ /**
+ * Constructor. Not used.
+ * @private
+ */
+ public function CSSConditionKind()
+ {
+ }
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSDimension.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSDimension.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSDimension.as
new file mode 100644
index 0000000..25298f3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSDimension.as
@@ -0,0 +1,152 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+import mx.utils.ObjectUtil;
+
+/**
+ * Represents a dimension with an optional unit, to be used in css media queries.
+ * <p>Valid units are:
+ * no unit
+ * px : pixel
+ * in : inch
+ * cm : centimeter
+ * pt : point
+ * dp : device independent pixel ( 1 pix at about 160 DPI )
+ * </p>
+ *
+ * @langversion 3.0
+ * @playerversion AIR 3.0
+ * @productversion Flex 4.13
+ */
+public class CSSDimension
+{
+ /* device independent units */
+ static public const NO_UNIT: String = "";
+ static public const UNIT_INCH: String = "in";
+ static public const UNIT_CM: String = "cm";
+ static public const UNIT_PT: String = "pt";
+ static public const UNIT_DP: String = "dp";
+
+ /* pixel units */
+ static private const UNIT_PX: String = "px";
+
+ /* scale factor for device independent units */
+ static private const INCH_PER_INCH: Number = 1.0;
+ static private const CM_PER_INCH: Number = 2.54;
+ static private const PT_PER_INCH: Number = 72;
+ static private const DP_PER_INCH: Number = 160;
+
+ private var _value: Number;
+ private var _unit: String;
+ private var _pixelValue: int;
+
+ /** Constructor
+ *
+ * @param value
+ * @param refDPI
+ * @param unit
+ *
+ */
+ public function CSSDimension(value: Number, refDPI: Number, unit: String = NO_UNIT)
+ {
+ _value = value;
+ _unit = unit;
+ _pixelValue = computePixelValue(refDPI);
+ }
+
+ /** Dimension unit, as a string, or empty string if no unit
+ *
+ */
+ public function get unit(): String
+ {
+ return _unit;
+ }
+
+ /** Dimension value as a number, without the unit
+ */
+ public function get value(): Number
+ {
+ return _value;
+ }
+
+ /**
+ * Dimension converted to actual pixels, considering the current device DPI
+ */
+ public function get pixelValue(): Number
+ {
+ return _pixelValue;
+ }
+
+ /**
+ * Compares to another CSSDimension instance.
+ * Actual pixel values are used for comparison, so dimensions can have different units.
+ *
+ * @param other another CSSDimension instance
+ *
+ * @return 0 if both dimensions are of equal value. rounding errors may occur due to conversion
+ * -1 if <code>this</code> is lower than <code>other</code>.
+ * 1 if <code>this</code> is greater than <code>other</code>.
+ *
+ * @langversion 3.0
+ * @playerversion AIR 3.0
+ * @productversion Flex 4.13
+ */
+ public function compareTo(other: CSSDimension): int
+ {
+ return ObjectUtil.numericCompare(_pixelValue, other.pixelValue);
+ }
+
+ /**
+ * Printable string of the dimension
+ * @return version as a string
+ */
+ public function toString(): String
+ {
+ return _value.toString() + _unit;
+ }
+
+ /** @private converts a value with unit an actual pixel value, according to refDPI screen resolution
+ * the formula is the following for physical units
+ * pixelValue = value * refDPI / unit_per_inch ;
+ * eg. 5in at 132 DPI => 5 * 132 /1 =
+ * eg. 19cm at 132 DPI => 19 * 132 /2.54 =
+ * */
+ private function computePixelValue(refDPI: Number): int
+ {
+ switch (_unit) {
+ // test device-independent units
+ case UNIT_INCH:
+ return _value * refDPI;
+ case UNIT_DP:
+ return _value * refDPI / DP_PER_INCH;
+ case UNIT_CM:
+ return _value * refDPI / CM_PER_INCH;
+ case UNIT_PT:
+ return _value * refDPI / PT_PER_INCH;
+ }
+ // else it's pixel unit
+ return _value;
+ }
+
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSOSVersion.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSOSVersion.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSOSVersion.as
new file mode 100644
index 0000000..3eb1782
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSOSVersion.as
@@ -0,0 +1,108 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+/**
+ * Support class for MediaQueryParser to store and compare versions such as X.Y.Z
+ * Its mainly used in os-version media selector.
+ */
+public class CSSOSVersion
+{
+ /** @private
+ * separator between version parts
+ * */
+ static private const SEPARATOR: String = ".";
+
+ /**
+ * major figure of the version.
+ */
+ public var major: int = 0;
+ /**
+ * minor figure of the version.
+ */
+ public var minor: int = 0;
+ /**
+ * revision figure of the version.
+ */
+ public var revision: int = 0;
+
+ /** Contructor
+ * Returns an CSSOSVersion for versionString.
+ * @param versionString
+ */
+ public function CSSOSVersion(versionString: String = "")
+ {
+ var versionParts: Array = versionString.split(SEPARATOR);
+ var l: int = versionParts.length;
+ if (l >= 1)
+ major = Number(versionParts[0]);
+ if (l >= 2)
+ minor = Number(versionParts[1]);
+ if (l >= 3)
+ revision = Number(versionParts[2]);
+ // ignore remaining parts
+ }
+
+ /**
+ * Compares to another CSSOSVersion instance
+ *
+ * @param otherVersion another CSSOSVersion.
+ *
+ * @return 0 if both versions are equal
+ * -1 if <code>this</code> is lower than <code>otherVersion</code>.
+ * 1 if <code>this</code> is greater than <code>otherVersion</code>.
+ * @langversion 3.0
+ * @productversion Flex 4.13
+ */
+ public function compareTo(otherVersion: CSSOSVersion): int
+ {
+ if (major > otherVersion.major)
+ return 1;
+ else if (major < otherVersion.major)
+ return -1;
+ else //major == other.major)
+ {
+ if (minor > otherVersion.minor)
+ return 1;
+ else if (minor < otherVersion.minor)
+ return -1;
+ else //minor == other.minor)
+ {
+ if (revision > otherVersion.revision)
+ return 1;
+ else if (revision < otherVersion.revision)
+ return -1;
+ else
+ return 0; // all equal
+ }
+ }
+ }
+
+ /**
+ * Printable string of the version, as X.Y.Z
+ * @return version as a string
+ */
+ public function toString(): String
+ {
+ return major.toString() + SEPARATOR + minor.toString() + SEPARATOR + revision.toString();
+ }
+
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSSelector.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSSelector.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSSelector.as
new file mode 100644
index 0000000..4eebb9f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSSelector.as
@@ -0,0 +1,328 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+import mx.core.mx_internal;
+
+/**
+ * Represents a selector node in a potential chain of selectors used to match
+ * CSS style declarations to components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public class CSSSelector
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param subject The plain representation of this selector without
+ * conditions or ancestors. This is typically a fully-qualified class name; for example,
+ * "spark.components.Button". You can use "*" to match all components or "global" for a global selector.
+ *
+ * @param conditions An optional Array of objects of type CSSCondition that is used to match a
+ * subset of component instances. Currently only a single or a pair of
+ * conditions are supported.
+ *
+ * @param ancestor An optional selector to match on a component that
+ * descends from an arbitrary ancestor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function CSSSelector(subject:String,
+ conditions:Array=null, ancestor:CSSSelector=null)
+ {
+ _subject = subject;
+ _conditions = conditions;
+ _ancestor = ancestor;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // ancestor
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _ancestor:CSSSelector;
+
+ /**
+ * If this selector is part of a descendant selector it may have a further
+ * selector defined for an arbitrary ancestor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get ancestor():CSSSelector
+ {
+ return _ancestor;
+ }
+
+ //----------------------------------
+ // conditions
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _conditions:Array; // of CSSCondition
+
+ /**
+ * This selector may match a subset of components by specifying further
+ * conditions (for example, a matching component must have a particular id,
+ * styleName (equivalent to a 'class' condition in CSS) or state
+ * (equivalent to a 'pseudo' condition in CSS)).
+ *
+ * <p>If no conditions are specified, this property is null.</p>
+ *
+ * @return Array of CSSCondition specified for this selector.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get conditions():Array // of CSSCondition
+ {
+ return _conditions;
+ }
+
+ //----------------------------------
+ // specificity
+ //----------------------------------
+
+ /**
+ * Calculates the specificity of a selector chain in order to determine
+ * the precedence when applying several matching style declarations. Note
+ * that id conditions contribute 100 points, pseudo and class conditions
+ * each contribute 10 points, types (including descendants in a chain of
+ * selectors) contribute 1 point. Universal selectors ("*") contribute
+ * nothing. The result is the sum of these contributions. Selectors with a
+ * higher specificity override selectors of lower specificity. If
+ * selectors have equal specificity, the declaration order determines
+ * the precedence (the last one wins).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get specificity():int
+ {
+ var s:int = 0;
+
+ if ("*" != subject && "global" != subject && "" != subject)
+ s = 1;
+
+ if (conditions != null)
+ {
+ for each (var condition:CSSCondition in conditions)
+ {
+ s += condition.specificity;
+ }
+ }
+
+ if (ancestor != null)
+ s += ancestor.specificity;
+
+ return s;
+ }
+
+ //----------------------------------
+ // subject
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _subject:String;
+
+ /**
+ * The subject of this selector node (only). To get a String representation
+ * of all conditions and descendants of this selector call the <code>toString()</code>
+ * method.
+ *
+ * <p>If this selector represents the root node of a potential chain of
+ * selectors, the subject also represents the subject of the entire selector
+ * expression.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get subject():String
+ {
+ return _subject;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether this selector matches the given component.
+ *
+ * @param object The component to which the selector may apply.
+ * @return true if component is a match, or false if not.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function matchesStyleClient(object:IAdvancedStyleClient):Boolean
+ {
+ var match:Boolean = false;
+ var condition:CSSCondition = null;
+
+ // If we have an ancestor then this is part of a descendant selector
+ if (ancestor)
+ {
+ if (conditions)
+ {
+ // First, test if the conditions match
+ for each (condition in conditions)
+ {
+ match = condition.matchesStyleClient(object);
+ if (!match)
+ return false;
+ }
+ }
+
+ // Then reset and test if any ancestor matches
+ match = false;
+ var parent:IAdvancedStyleClient = object.styleParent;
+ while (parent != null)
+ {
+ if (parent.matchesCSSType(ancestor.subject)
+ || "*" == ancestor.subject)
+ {
+ match = ancestor.matchesStyleClient(parent);
+ if (match)
+ break;
+ }
+ parent = parent.styleParent;
+ }
+ }
+ else
+ {
+ // Check the type selector matches
+ if (subject == "*" || subject == "" || object.matchesCSSType(subject))
+ {
+ match = true;
+ }
+
+ // Then check if any conditions match
+ if (match && conditions != null)
+ {
+ for each (condition in conditions)
+ {
+ match = condition.matchesStyleClient(object);
+ if (!match)
+ return false;
+ }
+ }
+ }
+
+ return match;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function getPseudoCondition():String
+ {
+ var result:String = null;
+
+ if (conditions)
+ {
+ for each (var condition:CSSCondition in conditions)
+ {
+ if (condition.kind == CSSConditionKind.PSEUDO)
+ {
+ result = condition.value;
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Returns a String representation of this selector.
+ *
+ * @return A String representation of this selector including all of its
+ * syntax, conditions and ancestors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function toString():String
+ {
+ var s:String;
+
+ if (ancestor != null)
+ {
+ s = ancestor.toString() + " " + subject;
+ }
+ else
+ {
+ s = subject;
+ }
+
+ if (conditions != null)
+ {
+ for each (var condition:CSSCondition in conditions)
+ {
+ s += condition.toString();
+ }
+ }
+
+ return s;
+ }
+}
+
+}
[20/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/resources/LocaleSorter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/resources/LocaleSorter.as b/frameworks/projects/MX/src/main/flex/mx/resources/LocaleSorter.as
new file mode 100644
index 0000000..b260b7f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/resources/LocaleSorter.as
@@ -0,0 +1,1084 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.resources
+{
+
+[ExcludeClass]
+
+/**
+ * @private
+ * The APIs of the LocaleSorter class provides the sorting functionality
+ * of application locales against system preferences.
+ */
+public class LocaleSorter
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Sorts a list of locales using the order specified
+ * by the user preferences.
+ *
+ * @param appLocales An Array of locales supported by the application.
+ *
+ * @param systemPreferences The locale chain of user-preferred locales.
+ *
+ * @param ultimateFallbackLocale The ultimate fallback locale
+ * that will be used when no locale from systemPreference matches
+ * a locale from application supported locale list.
+ *
+ * @param addAll When true, adds all the non-matching locales
+ * at the end of the result list preserving the given order.
+ *
+ * @return A locale chain that matches user preferences order.
+ */
+ public static function sortLocalesByPreference(
+ appLocales:Array, systemPreferences:Array,
+ ultimateFallbackLocale:String = null,
+ addAll:Boolean = false):Array
+ {
+ var result:Array = [];
+
+ var hasLocale:Object = {};
+
+ var i:int;
+ var j:int;
+
+ var locales:Array = trimAndNormalize(appLocales);
+ var preferenceLocales:Array = trimAndNormalize(systemPreferences);
+
+ addUltimateFallbackLocale(preferenceLocales, ultimateFallbackLocale);
+
+ var noLocales:int = locales.length;
+ var noPreferenceLocales:int = preferenceLocales.length;
+
+ // For better performance, save the locales in a lookup table.
+ for (j = 0; j < noLocales; j++)
+ {
+ hasLocale[locales[j]] = j;
+ }
+
+ function promote(locale:String):void
+ {
+ if (typeof hasLocale[locale] != "undefined")
+ {
+ result.push(appLocales[hasLocale[locale]]);
+ delete hasLocale[locale];
+ }
+ }
+
+ var preferenceLocalesID:Vector.<LocaleID> = new Vector.<LocaleID>(noPreferenceLocales);
+ for (i = 0; i < noPreferenceLocales; i++)
+ {
+ preferenceLocalesID[i] = LocaleID.fromString(preferenceLocales[i]);
+ }
+
+ var localesID:Vector.<LocaleID> = new Vector.<LocaleID>(noLocales);
+ for (i = 0; i < noLocales; i++)
+ {
+ localesID[i] = LocaleID.fromString(locales[i]);
+ }
+
+ for (i = 0; i < noPreferenceLocales; i++)
+ {
+ var plocale:LocaleID = preferenceLocalesID[i].clone();
+
+ // Step 1: Promote the perfect match.
+ promote(preferenceLocales[i]);
+
+ promote(plocale.toString());
+
+ // Step 2: Promote the parent chain.
+ while (plocale.transformToParent())
+ {
+ promote(plocale.toString());
+ }
+
+ // Parse it again.
+ plocale = preferenceLocalesID[i].clone();
+
+ // Step 3: Promote the order of siblings from preferenceLocales.
+ for (j = 0; j < noPreferenceLocales; j++)
+ {
+ if (plocale.isSiblingOf(preferenceLocalesID[j]))
+ promote(preferenceLocales[j]);
+ }
+
+ // Step 4: Promote all remaining siblings
+ // (aka not in preferenceLocales)
+ // eg. push en_UK after en_US and en if the user
+ // doesn't have en_UK in the preference list
+ for (j = 0; j < noLocales; j++)
+ {
+ if (plocale.isSiblingOf(localesID[j]))
+ promote(locales[j]);
+ }
+ }
+
+ if (addAll)
+ {
+ // Check what locales are not already loaded
+ // and push them preserving the order.
+ for (j = 0; j < noLocales; j++)
+ {
+ promote(locales[j]);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @private
+ */
+ private static function trimAndNormalize(list:Array):Array
+ {
+ var resultList:Array = [];
+
+ for (var i:int = 0; i < list.length; i++)
+ {
+ resultList.push(normalizeLocale(list[i]));
+ }
+
+ return resultList;
+ }
+
+ /**
+ * @private
+ */
+ private static function normalizeLocale(locale:String):String
+ {
+ return locale.toLowerCase().replace(/-/g, "_");
+ }
+
+ /**
+ * @private
+ */
+ private static function addUltimateFallbackLocale(
+ preferenceLocales:Array,
+ ultimateFallbackLocale:String):void
+ {
+ if (ultimateFallbackLocale != null && ultimateFallbackLocale != "")
+ {
+ var locale:String = normalizeLocale(ultimateFallbackLocale);
+
+ if (preferenceLocales.indexOf(locale) == -1)
+ {
+ // Add the locale to the end of the chain.
+ preferenceLocales.push(locale);
+ }
+ }
+ }
+}
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: LocaleID
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ * The APIs of the internal LocaleID class parse a locale string
+ * according to:
+ * RFC 4646: http://www.ietf.org/rfc/rfc4646.txt
+ * RFC 4647: http://www.ietf.org/rfc/rfc4647.txt
+ * IANA Language Subtag Registry:
+ * http://www.iana.org/assignments/language-subtag-registry
+ */
+class LocaleID
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public static const STATE_PRIMARY_LANGUAGE:int = 0;
+
+ /**
+ * @private
+ */
+ public static const STATE_EXTENDED_LANGUAGES:int = 1;
+
+ /**
+ * @private
+ */
+ public static const STATE_SCRIPT:int = 2;
+
+ /**
+ * @private
+ */
+ public static const STATE_REGION:int = 3;
+
+ /**
+ * @private
+ */
+ public static const STATE_VARIANTS:int = 4;
+
+ /**
+ * @private
+ */
+ public static const STATE_EXTENSIONS:int = 5;
+
+ /**
+ * @private
+ */
+ public static const STATE_PRIVATES:int = 6;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static function appendElements(dest:Array, src:Array):void
+ {
+ for (var i:uint = 0, argc:uint = src.length; i < argc; i++)
+ {
+ dest.push(src[i]);
+ }
+ }
+
+ /**
+ * @private
+ */
+ public static function fromString(str:String):LocaleID
+ {
+ var localeID:LocaleID = new LocaleID();
+
+ var state:int = STATE_PRIMARY_LANGUAGE;
+ var subtags:Array = str.replace(/-/g, '_').split('_');
+
+ var last_extension:Array;
+
+ for (var i:int = 0, l:int = subtags.length; i < l; i++)
+ {
+ var subtag:String = subtags[i].toLowerCase();
+
+ if (state == STATE_PRIMARY_LANGUAGE)
+ {
+ if (subtag == "x")
+ {
+ localeID.privateLangs = true;
+ // not used in our implementation,
+ // but makes the tag private
+ }
+ else if (subtag == "i")
+ {
+ localeID.lang += "i-";
+ // and wait the next subtag
+ // to complete the language name
+ }
+ else
+ {
+ localeID.lang += subtag;
+ state = STATE_EXTENDED_LANGUAGES;
+ }
+ }
+ else
+ {
+ // looking for:
+ // an extended language - 3 chars
+ // a script - 4 chars
+ // a region - 2-3 chars
+ // a variant - alpha with at least 5 chars
+ // or numeric with at least 4 chars
+ // an extension/private singleton - 1 char
+
+ var subtag_length:int = subtag.length;
+ if (subtag_length == 0)
+ continue; // skip zero-lengthed subtags
+
+ var firstChar:String = subtag.charAt(0).toLowerCase();
+
+ if (state <= STATE_EXTENDED_LANGUAGES &&
+ subtag_length == 3)
+ {
+ localeID.extended_langs.push(subtag);
+ if (localeID.extended_langs.length == 3)
+ {
+ // Allow a maximum of 3 extended langs.
+ state = STATE_SCRIPT;
+ }
+ }
+ else if (state <= STATE_SCRIPT &&
+ subtag_length == 4)
+ {
+ localeID.script = subtag;
+ state = STATE_REGION;
+ }
+ else if (state <= STATE_REGION &&
+ (subtag_length == 2 || subtag_length == 3))
+ {
+ localeID.region = subtag;
+ state = STATE_VARIANTS;
+ }
+ else if (state <= STATE_VARIANTS &&
+ ((firstChar >= "a" && firstChar <= "z" &&
+ subtag_length >= 5) ||
+ (firstChar >= "0" && firstChar <= "9" &&
+ subtag_length >= 4)))
+ {
+ // variant
+ localeID.variants.push(subtag);
+ state = STATE_VARIANTS;
+ }
+ else if (state < STATE_PRIVATES &&
+ subtag_length == 1)
+ {
+ // singleton
+ if (subtag == "x")
+ {
+ state = STATE_PRIVATES;
+ last_extension = localeID.privates;
+ }
+ else
+ {
+ state = STATE_EXTENSIONS;
+ last_extension = localeID.extensions[subtag] || [];
+ localeID.extensions[subtag] = last_extension;
+ }
+ }
+ else if (state >= STATE_EXTENSIONS)
+ {
+ last_extension.push(subtag);
+ }
+ }
+ }
+
+ localeID.canonicalize();
+
+ return localeID;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function LocaleID()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var lang:String = "";
+
+ /**
+ * @private
+ */
+ private var script:String = "";
+
+ /**
+ * @private
+ */
+ private var region:String = "";
+
+ /**
+ * @private
+ */
+ private var extended_langs:Array = [];
+
+ /**
+ * @private
+ */
+ private var variants:Array = [];
+
+ /**
+ * @private
+ */
+ private var extensions:Object = {};
+
+ /**
+ * @private
+ */
+ private var privates:Array = [];
+
+ /**
+ * @private
+ */
+ private var privateLangs:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function clone():LocaleID {
+
+ var copy:LocaleID = new LocaleID();
+ copy.lang = lang;
+ copy.script = script;
+ copy.region = region;
+ copy.extended_langs = extended_langs.concat();
+ copy.variants = variants.concat();
+ copy.extensions = {};
+ for (var i:String in extensions)
+ {
+ if (extensions.hasOwnProperty(i))
+ {
+ copy.extensions[i] = extensions[i].concat();
+ }
+ }
+
+ copy.privates = privates.concat();
+ copy.privateLangs = privateLangs;
+
+ return copy;
+ }
+
+ /**
+ * @private
+ */
+ public function canonicalize():void
+ {
+ for (var i:String in extensions)
+ {
+ if (extensions.hasOwnProperty(i))
+ {
+ // Also clear zero length extensions.
+ if (extensions[i].length == 0)
+ delete extensions[i];
+ else
+ extensions[i] = extensions[i].sort();
+ }
+ }
+
+ extended_langs = extended_langs.sort();
+ variants = variants.sort();
+ privates = privates.sort();
+
+ if (script == "")
+ script = LocaleRegistry.getScriptByLang(lang);
+
+ // Still no script, check the region.
+ if (script == "" && region != "")
+ script = LocaleRegistry.getScriptByLangAndRegion(lang, region);
+
+ if (region == "" && script != "")
+ {
+ region = LocaleRegistry.getDefaultRegionForLangAndScript(
+ lang, script);
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function toString():String
+ {
+ var stack:Array = [ lang ];
+
+ appendElements(stack, extended_langs);
+
+ if (script != "")
+ stack.push(script);
+
+ if (region != "")
+ stack.push(region);
+
+ appendElements(stack, variants);
+
+ for (var i:String in extensions)
+ {
+ if (extensions.hasOwnProperty(i))
+ {
+ stack.push(i);
+ appendElements(stack, extensions[i]);
+ }
+ }
+
+ if (privates.length > 0)
+ {
+ stack.push("x");
+ appendElements(stack, privates);
+ }
+
+ return stack.join("_");
+ }
+
+ /**
+ * @private
+ */
+ public function equals(locale:LocaleID):Boolean
+ {
+ return toString() == locale.toString();
+ }
+
+ /**
+ * @private
+ */
+ public function isSiblingOf(other:LocaleID):Boolean
+ {
+ return lang == other.lang && script == other.script;
+ }
+
+ /**
+ * @private
+ */
+ public function transformToParent():Boolean
+ {
+ if (privates.length > 0)
+ {
+ privates.splice(privates.length - 1, 1);
+ return true;
+ }
+
+ var lastExtensionName:String = null;
+ for (var i:String in extensions)
+ {
+ if (extensions.hasOwnProperty(i))
+ lastExtensionName = i;
+ }
+
+ if (lastExtensionName)
+ {
+ var lastExtension:Array = extensions[lastExtensionName];
+ if (lastExtension.length == 1)
+ {
+ delete extensions[lastExtensionName];
+ return true;
+ }
+ lastExtension.splice(lastExtension.length - 1, 1);
+ return true;
+ }
+
+ if (variants.length > 0)
+ {
+ variants.splice(variants.length - 1, 1);
+ return true;
+ }
+
+ if (script != "")
+ {
+ // Check if we can suppress the script.
+ if (LocaleRegistry.getScriptByLang(lang) != "")
+ {
+ script = "";
+ return true;
+ }
+ else if (region == "")
+ {
+ // Maybe the default region can suppress the script.
+ var defaultRegion:String =
+ LocaleRegistry.getDefaultRegionForLangAndScript(
+ lang, script);
+ if (defaultRegion != "")
+ {
+ region = defaultRegion;
+ script = "";
+ return true;
+ }
+ }
+ }
+
+ if (region != "")
+ {
+ if (!(script == "" && LocaleRegistry.getScriptByLang(lang) == ""))
+ {
+ region = "";
+ return true;
+ }
+ }
+
+ if (extended_langs.length > 0)
+ {
+ extended_langs.splice(extended_langs.length - 1, 1);
+ return true;
+ }
+
+ return false;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: LocaleRegistry
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+class LocaleRegistry
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * A list of codes representing writing systems, in arbitrary order.
+ * For example, "latn" represents the Latin alphabet, used for
+ * writing languages such as English, French, Indonesian, and Swahili,
+ * and "arab" represents the Arabic script, used for writing
+ * Arabic, Persian, Pashto, and Urdu.
+ */
+ private static const SCRIPTS:Array =
+ [
+ "", // 0
+ "latn", // 1 Latin
+ "ethi", // 2 Ethiopian
+ "arab", // 3 Arabic
+ "beng", // 4 Bengali
+ "cyrl", // 5 Cyrillic
+ "thaa", // 6 Thaana
+ "tibt", // 7 Tibetan
+ "grek", // 8 Greek
+ "gujr", // 9 Gujarati
+ "hebr", // 10 Hebrew
+ "deva", // 11 Devanagari
+ "armn", // 12 Armenian
+ "jpan", // 13 Japanese
+ "geor", // 14 Georgian
+ "khmr", // 15 Khmer
+ "knda", // 16 Kannada
+ "kore", // 17 Korean
+ "laoo", // 18 Lao
+ "mlym", // 19 Malayalam
+ "mymr", // 20 Burmese
+ "orya", // 21 Oriya
+ "guru", // 22 Punjabi
+ "sinh", // 23 Sinhalese
+ "taml", // 24 Tamil
+ "telu", // 25 Telugu
+ "thai", // 26 Thai
+ "nkoo", // 27 N'Ko
+ "blis", // 28 Bliss
+ "hans", // 29 Simplified Chinese
+ "hant", // 30 Traditional Chinese
+ "mong", // 31 Mongolian
+ "syrc" // 32 Syriac
+ ];
+
+ /**
+ * @private
+ * The inverse of the SCRIPT Array.
+ * Maps a script code (like "jpan" for Japanese)
+ * to its index in the SCRIPT Array.
+ */
+ private static const SCRIPT_BY_ID:Object =
+ {
+ latn: 1,
+ ethi: 2,
+ arab: 3,
+ beng: 4,
+ cyrl: 5,
+ thaa: 6,
+ tibt: 7,
+ grek: 8,
+ gujr: 9,
+ hebr: 10,
+ deva: 11,
+ armn: 12,
+ jpan: 13,
+ geor: 14,
+ khmr: 15,
+ knda: 16,
+ kore: 17,
+ laoo: 18,
+ mlym: 19,
+ mymr: 20,
+ orya: 21,
+ guru: 22,
+ sinh: 23,
+ taml: 24,
+ telu: 25,
+ thai: 26,
+ nkoo: 27,
+ blis: 28,
+ hans: 29,
+ hant: 30,
+ mong: 31,
+ syrc: 32
+ };
+
+ /**
+ * @private
+ * This table maps a language and a script to the most
+ * prominent region where that combination is used.
+ *
+ * Note: "is" must be quoted because it is a reserved word.
+ */
+ private static const DEFAULT_REGION_BY_LANG_AND_SCRIPT:Object =
+ {
+ bg: { 5: "bg" }, // Bulgarian / Cyrillic -> Bulgaria
+ ca: { 1: "es" }, // Catalan / Latin -> Spain
+ zh: { 30: "tw", 29: "cn" }, // Chinese / Traditional Chinese -> Taiwan
+ // Chinese / Simplified Chinese -> China
+ cs: { 1: "cz" }, // Czech / Latin -> Czech Republic
+ da: { 1: "dk" }, // Danish / Latin -> Denmark
+ de: { 1: "de" }, // German / Latin -> Germany
+ el: { 8: "gr" }, // Greek / Greek -> Greece
+ en: { 1: "us" }, // English / Latin -> United States
+ es: { 1: "es" }, // Spanish / Latin -> Spain
+ fi: { 1: "fi" }, // Finnish / Latin -> Finland
+ fr: { 1: "fr" }, // French / Latin -> France
+ he: { 10: "il" }, // Hebrew / Hebrew -> Israel
+ hu: { 1: "hu" }, // Hungarian / Latin -> Hungary
+ "is": { 1: "is" }, // Icelandic / Latin -> Iceland
+ it: { 1: "it" }, // Italian / Latin -> Italy
+ ja: { 13: "jp" }, // Japanese / Japanese -> Japan
+ ko: { 17: "kr" }, // Korean / Korean -> Korea
+ nl: { 1: "nl" }, // Dutch / Latin -> Netherlands
+ nb: { 1: "no" }, // Norwegian Bokmaal / Latin -> Norway
+ pl: { 1: "pl" }, // Polish / Latin -> Poland
+ pt: { 1: "br" }, // Portuguese / Latin -> Brazil
+ ro: { 1: "ro" }, // Romanian / Latin -> Romania
+ ru: { 5: "ru" }, // Russian / Cyrillic -> Russia
+ hr: { 1: "hr" }, // Croatian / Latin -> Croatia
+ sk: { 1: "sk" }, // Slovak / Latin -> Slovakia
+ sq: { 1: "al" }, // Albanian / Latin -> Albania
+ sv: { 1: "se" }, // Swedish / Latin -> Sweden
+ th: { 26: "th" }, // Thai / Thai -> Thailand
+ tr: { 1: "tr" }, // Turkish / Latin -> Turkey
+ ur: { 3: "pk" }, // Urdu / Arabic -> Pakistan
+ id: { 1: "id" }, // Indonesian / Latin -> Indonesia
+ uk: { 5: "ua" }, // Ukrainian / Cyrillic -> Ukraine
+ be: { 5: "by" }, // Byelorussian / Cyrillic -> Belarus
+ sl: { 1: "si" }, // Slovenian / Latin -> Slovenia
+ et: { 1: "ee" }, // Estonian / Latin -> Estonia
+ lv: { 1: "lv" }, // Latvian / Latin -> Latvia
+ lt: { 1: "lt" }, // Lithuanian / Latin -> Lithuania
+ fa: { 3: "ir" }, // Persian / Arabic -> Iran
+ vi: { 1: "vn" }, // Vietnamese / Latin -> Vietnam
+ hy: { 12: "am"}, // Armenian / Armenian -> Armenia
+ az: { 1: "az", 5: "az" }, // Azerbaijani / Latin -> Azerbaijan
+ // Azerbaijani / Cyrillic -> Azerbaijan
+ eu: { 1: "es" }, // Basque / Latin -> Spain
+ mk: { 5: "mk" }, // Macedonian / Cyrillic -> Macedonia
+ af: { 1: "za" }, // Afrikaans / Latin -> South Africa
+ ka: { 14: "ge" }, // Georgian / Georgian -> Georgia
+ fo: { 1: "fo" }, // Faeroese / Latin -> Faroe Islands
+ hi: { 11: "in" }, // Hindi / Devanagari -> India
+ ms: { 1: "my" }, // Malay / Latin -> Malaysia
+ kk: { 5: "kz" }, // Kazakh / Cyrillic -> Kazakhstan
+ ky: { 5: "kg" }, // Kirghiz / Cyrillic -> Kyrgyzstan
+ sw: { 1: "ke" }, // Swahili / Latin -> Kenya
+ uz: { 1: "uz", 5: "uz" }, // Uzbek / Latin -> Uzbekistan
+ // Uzbek / Cyrillic -> Uzbekistan
+ tt: { 5: "ru" }, // Tatar / Cyrillic -> Russia
+ pa: { 22: "in" }, // Punjabi / Punjabi -> India
+ gu: { 9: "in" }, // Gujarati / Gujarati -> India
+ ta: { 24: "in" }, // Tamil / Tamil -> India
+ te: { 25: "in" }, // Telugu / Telugu -> India
+ kn: { 16: "in" }, // Kannada / Kannada -> India
+ mr: { 11: "in" }, // Marathi / Devanagari -> India
+ sa: { 11: "in" }, // Sanskrit / Devanagari -> India
+ mn: { 5: "mn" }, // Mongolian / Cyrillic -> Mongolia
+ gl: { 1: "es" }, // Galician / Latin -> Spain
+ kok: { 11: "in" }, // Konkani / Devanagari -> India
+ syr: { 32: "sy" }, // Syriac / Syriac -> Syria
+ dv: { 6: "mv" }, // Dhivehi / Thaana -> Maldives
+ nn: { 1: "no" }, // Norwegian Nynorsk / Latin -> Norway
+ sr: { 1: "cs", 5: "cs" }, // Serbian / Latin -> Serbia
+ // Serbian / Cyrillic -> Serbia
+ cy: { 1: "gb" }, // Welsh / Latin -> United Kingdom
+ mi: { 1: "nz" }, // Maori / Latin -> New Zealand
+ mt: { 1: "mt" }, // Maltese / Latin -> Malta
+ quz: { 1: "bo" }, // Quechua / Latin -> Bolivia
+ tn: { 1: "za" }, // Tswana / Latin -> South Africa
+ xh: { 1: "za" }, // Xhosa / Latin -> South Africa
+ zu: { 1: "za" }, // Zulu / Latin -> South Africa
+ nso: { 1: "za" }, // Northern Sotho / Latin -> South Africa
+ se: { 1: "no" }, // Northern Saami / Latin -> Norway
+ smj: { 1: "no" }, // Lule Saami / Latin -> Norway
+ sma: { 1: "no" }, // Southern Saami / Latin -> Norway
+ sms: { 1: "fi" }, // Skolt Saami / Latin -> Finland
+ smn: { 1: "fi" }, // Inari Saami / Latin -> Finland
+ bs: { 1: "ba" } // Bosnia / Latin -> Bosnia
+ };
+
+ /**
+ * @private
+ * This table maps a language to a script.
+ * It was derived from the entries at
+ * http://www.iana.org/assignments/language-subtag-registry
+ * which have a Suppress-Script property.
+ *
+ * Note: "as", "in", and "is" must be quoted
+ * because they are reserved words.
+ */
+ private static const SCRIPT_ID_BY_LANG:Object =
+ {
+ ab: 5, // Abkhazian -> Cyrillic
+ af: 1, // Afrikaans -> Latin
+ am: 2, // Amharic -> Ethiopian
+ ar: 3, // Arabic -> Arabic
+ "as": 4, // Assamese -> Bengali
+ ay: 1, // Aymara -> Latin
+ be: 5, // Belarusian -> Cyrillic
+ bg: 5, // Bulgarian -> Cyrillic
+ bn: 4, // Bengali -> Bengali
+ bs: 1, // Bosnian -> Latin
+ ca: 1, // Catalan / Valencian -> Latin
+ ch: 1, // Chamorro -> Latin
+ cs: 1, // Czech -> Latin
+ cy: 1, // Welsh -> Latin
+ da: 1, // Danish -> Latin
+ de: 1, // German -> Latin
+ dv: 6, // Dhivehi / Maldivian -> Thaana
+ dz: 7, // Dzongkha -> Tibetan
+ el: 8, // Modern Greek -> Greek
+ en: 1, // English -> Latin
+ eo: 1, // Esperanto -> Latin
+ es: 1, // Spanish / Castilian -> Latin
+ et: 1, // Estonian -> Latin
+ eu: 1, // Basque -> Latin
+ fa: 3, // Persian -> Arabic
+ fi: 1, // Finnish -> Latin
+ fj: 1, // Fijian -> Latin
+ fo: 1, // Faroese -> Latin
+ fr: 1, // French -> Latin
+ frr: 1, // Northern Frisian -> Latin
+ fy: 1, // Western Frisian -> Latin
+ ga: 1, // Irish -> Latin
+ gl: 1, // Galician -> Latin
+ gn: 1, // Guarani -> Latin
+ gu: 9, // Gujarati -> Gujarati
+ gv: 1, // Manx -> Latin
+ he: 10, // Hebrew -> Hebrew
+ hi: 11, // Hindi -> Devanagari
+ hr: 1, // Croatian -> Latin
+ ht: 1, // Haitian Creole -> Latin
+ hu: 1, // Hungarian -> Latin
+ hy: 12, // Armenian -> Armenian
+ id: 1, // Indonesian -> Latin
+ "in": 1, // Indonesian -> Latin
+ "is": 1, // Icelandic -> Latin
+ it: 1, // Italian -> Latin
+ iw: 10, // Hebrew -> Hebrew
+ ja: 13, // Japanese -> Japanese
+ ka: 14, // Georgian -> Georgian
+ kk: 5, // Kazakh -> Cyrillic
+ kl: 1, // Kalaallisut / Greenlandic -> Latin
+ km: 15, // Central Khmer -> Khmer
+ kn: 16, // Kannada -> Kannada
+ ko: 17, // Korean -> Korean
+ la: 1, // Latin -> Latin
+ lb: 1, // Luxembourgish -> Latin
+ ln: 1, // Lingala -> Latin
+ lo: 18, // Lao -> Lao
+ lt: 1, // Lithuanian -> Latin
+ lv: 1, // Latvian -> Latin
+ mg: 1, // Malagasy -> Latin
+ mh: 1, // Marshallese -> Latin
+ mk: 5, // Macedonian -> Cyrillic
+ ml: 19, // Malayalam -> Malayalam
+ mo: 1, // Moldavian -> Latin
+ mr: 11, // Marathi -> Devanagari
+ ms: 1, // Malay -> Latin
+ mt: 1, // Maltese -> Latin
+ my: 20, // Burmese -> Burmese
+ na: 1, // Nauru -> Latin
+ nb: 1, // Norwegian Bokmaal -> Latin
+ nd: 1, // North Ndebele -> Latin
+ ne: 11, // Nepali -> Devanagari
+ nl: 1, // Dutch / Flemish -> Latin
+ nn: 1, // Norwegian Nynorsk -> Latin
+ no: 1, // Norwegian -> Latin
+ nr: 1, // South Ndebele -> Latin
+ ny: 1, // Chichewa / Chewa / Nyanja -> Latin
+ om: 1, // Oromo -> Latin
+ or: 21, // Oriya -> Oriya
+ pa: 22, // Punjabi -> Punjabi
+ pl: 1, // Polish -> Latin
+ ps: 3, // Pashto -> Arabic
+ pt: 1, // Portuguese -> Latin
+ qu: 1, // Quechua -> Latin
+ rn: 1, // Rundi -> Latin
+ ro: 1, // Romanian -> Latin
+ ru: 5, // Russian -> Cyrillic
+ rw: 1, // Kinyarwanda -> Latin
+ sg: 1, // Sango -> Latin
+ si: 23, // Sinhalese -> Sinhalese
+ sk: 1, // Slovak -> Latin
+ sl: 1, // Slovenian -> Latin
+ sm: 1, // Samoan -> Latin
+ so: 1, // Somali -> Latin
+ sq: 1, // Albanian -> Latin
+ ss: 1, // Swati -> Latin
+ st: 1, // Southern Sotho -> Latin
+ sv: 1, // Swedish -> Latin
+ sw: 1, // Swahili -> Latin
+ ta: 24, // Tamil -> Tamil
+ te: 25, // Telugu -> Telugu
+ th: 26, // Thai -> Thai
+ ti: 2, // Tigrinya -> Ethiopian
+ tl: 1, // Tagalog -> Latin
+ tn: 1, // Tswana -> Latin
+ to: 1, // Tonga -> Latin
+ tr: 1, // Turkish -> Latin
+ ts: 1, // Tsonga -> Latin
+ uk: 5, // Ukrainian -> Cyrillic
+ ur: 3, // Urdu -> Arabic
+ ve: 1, // Venda -> Latin
+ vi: 1, // Vietnamese -> Latin
+ wo: 1, // Wolof -> Latin
+ xh: 1, // Xhosa -> Latin
+ yi: 10, // Yiddish -> Hebrew
+ zu: 1, // Zulu -> Latin
+ cpe: 1, // Creoles and pidgins -> Latin
+ dsb: 1, // Lower Sorbian -> Latin
+ frs: 1, // Eastern Frisian -> Latin
+ gsw: 1, // Swiss German / Alemaanic / Alsatian -> Latin
+ hsb: 1, // Upper Sorbian -> Latin
+ kok: 11, // Konkana -> Devanagari
+ mai: 11, // Maithili -> Devanagari
+ men: 1, // Mende -> Latin
+ nds: 1, // Low German -> Latin
+ niu: 1, // Niuean -> Latin
+ nqo: 27, // N'Ko -> N'Ko
+ nso: 1, // Northern Sotho / Pedi / Sepedi -> Latin
+ son: 1, // Songhai -> Latin
+ tem: 1, // Timne -> Latin
+ tkl: 1, // Tokelau -> Latin
+ tmh: 1, // Tamashek -> Latin
+ tpi: 1, // Tok Pisin -> Latin
+ tvl: 1, // Tuvalu -> Latin
+ zbl: 28 // Bliss -> Bliss
+ };
+
+ /**
+ * @private
+ * This table maps a language-as-spoken-in-a-region
+ * to the script used to write it.
+ *
+ * Chinese in China -> Simplified Chinese
+ * Chinese in Singapore -> Simplified Chinese
+ * Chinese in Taiwan -> Traditional Chinese
+ * Chinese in Hong Kong -> Traditional Chinese
+ * Chinese in Macao -> Traditional Chinese
+ * Mongolian in China -> Mongolian
+ * Mongolian in Singapore -> Cyrillic
+ * Punjabi in Pakistan -> Arabic
+ * Punjabi in India -> Punjabi
+ * Hausa in Ghana -> Latin
+ * Hausa in Niger -> Latin
+ */
+ private static const SCRIPT_ID_BY_LANG_AND_REGION:Object =
+ {
+ zh: { cn: 29, sg: 29, tw: 30, hk: 30, mo: 30 },
+ mn: { cn: 31, sg: 5 },
+ pa: { pk: 3, "in": 22 }, // "in" is reserved word
+ ha: { gh: 1, ne: 1 }
+ };
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Given a language and a region, returns the script system
+ * used to write the language there.
+ *
+ * Examples:
+ * lang zh (Chinese), region cn (China) -> hans (Simplified Chinese)
+ * lang zh (Chinese), region tw (Taiwan) -> hast (Traditional Chinese)
+ */
+ public static function getScriptByLangAndRegion(
+ lang:String, region:String):String
+ {
+ var langRegions:Object = SCRIPT_ID_BY_LANG_AND_REGION[lang];
+ if (langRegions == null)
+ return "";
+
+ var scriptID:Object = langRegions[region];
+ if (scriptID == null)
+ return "";
+
+ return SCRIPTS[int(scriptID)].toLowerCase();
+ }
+
+ /**
+ * @private
+ * Given a language, returns the script generally used to write it.
+ *
+ * Examples:
+ * lang bg (Bulgarian) -> cyrl (Cyrillic)
+ */
+ public static function getScriptByLang(lang:String):String
+ {
+ var scriptID:Object = SCRIPT_ID_BY_LANG[lang];
+ if (scriptID == null)
+ return "";
+
+ return SCRIPTS[int(scriptID)].toLowerCase();
+ }
+
+ /**
+ * @private
+ * Given a language and a script used for writing it,
+ * returns the most prominent region where that combination is used.
+ *
+ * Examples:
+ */
+ public static function getDefaultRegionForLangAndScript(
+ lang:String, script:String):String
+ {
+ var langObj:Object = DEFAULT_REGION_BY_LANG_AND_SCRIPT[lang];
+ var scriptID:Object = SCRIPT_BY_ID[script];
+ if (langObj == null || scriptID == null)
+ return "";
+
+ return langObj[int(scriptID)] || "";
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/resources/ResourceBundle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/resources/ResourceBundle.as b/frameworks/projects/MX/src/main/flex/mx/resources/ResourceBundle.as
new file mode 100644
index 0000000..29d3c41
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/resources/ResourceBundle.as
@@ -0,0 +1,249 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.resources
+{
+
+import flash.system.ApplicationDomain;
+
+import mx.core.mx_internal;
+import mx.utils.StringUtil;
+
+use namespace mx_internal;
+
+/**
+ * Provides an implementation of the IResourceBundle interface.
+ * The IResourceManager and IResourceBundle interfaces work together
+ * to provide internationalization support for Flex applications.
+ *
+ * <p>A Flex application typically has multiple instances of this class,
+ * all managed by a single instance of the ResourceManager class.
+ * It is possible to have ResourceBundle instances for multiple locales,
+ * one for each locale. There can be multiple ResourceBundle instances with
+ * different bundle names.</p>
+ *
+ * @see mx.resources.IResourceBundle
+ * @see mx.resources.IResourceManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ResourceBundle implements IResourceBundle
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Set by SystemManager constructor in order to make the deprecated
+ * getResourceBundle() method work with the new resource scheme
+ * in the single-locale case.
+ */
+ mx_internal static var locale:String;
+
+ /**
+ * @private
+ * Set by bootstrap loaders
+ * to allow for alternate search paths for resources
+ */
+ mx_internal static var backupApplicationDomain:ApplicationDomain;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static function getClassByName(name:String,
+ domain:ApplicationDomain):Class
+ {
+ var c:Class;
+
+ if (domain.hasDefinition(name))
+ c = domain.getDefinition(name) as Class;
+
+ return c;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param locale A locale string, such as <code>"en_US"</code>.
+ *
+ * @param bundleName A name that identifies this bundle,
+ * such as <code>"MyResources"</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ResourceBundle(locale:String = null,
+ bundleName:String = null)
+ {
+ // The only reason that the arguments are optional is so that
+ // Flex 3 applications can link against Flex 2 resource SWCs.
+ // In Flex 2, the constructor had no arguments at all
+ // and the autogenerated ResourceBundle subclasses
+ // therefore called super() with no arguments.
+ // If, in Flex 3, the constructor has required arguments,
+ // this causes a VerifyError.
+
+ super();
+
+ _locale = locale;
+ _bundleName = bundleName;
+
+ _content = getContent();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // bundleName
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the bundleName property.
+ */
+ mx_internal var _bundleName:String;
+
+ /**
+ * @copy mx.resources.IResourceBundle#bundleName
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get bundleName():String
+ {
+ return _bundleName;
+ }
+
+ //----------------------------------
+ // content
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the content property.
+ */
+ private var _content:Object = {};
+
+ /**
+ * @copy mx.resources.IResourceBundle#content
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get content():Object
+ {
+ return _content;
+ }
+
+ //----------------------------------
+ // locale
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the locale property.
+ */
+ mx_internal var _locale:String;
+
+ /**
+ * @copy mx.resources.IResourceBundle#locale
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get locale():String
+ {
+ return _locale;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * When a properties file is compiled into a resource bundle,
+ * the MXML compiler autogenerates a subclass of ResourceBundle.
+ * The subclass overrides this method to return an Object
+ * that contains key-value pairs for the bundle's resources.
+ *
+ * <p>If you create your own ResourceBundle instances,
+ * you can set the key-value pairs on the <code>content</code> object.</p>
+ *
+ * @return The Object that contains key-value pairs for the bundle's resources.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function getContent():Object
+ {
+ return {};
+ }
+
+ /**
+ * @private
+ */
+ private function _getObject(key:String):Object
+ {
+ var value:Object = content[key];
+ if (!value)
+ {
+ throw new Error("Key " + key +
+ " was not found in resource bundle " + bundleName);
+ }
+ return value;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManager.as b/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManager.as
new file mode 100644
index 0000000..7442509
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/resources/ResourceManager.as
@@ -0,0 +1,129 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.resources
+{
+
+import org.apache.flex.reflection.getDefinitionByName;
+import mx.core.mx_internal;
+import mx.core.Singleton;
+
+/**
+ * This class is used to get a single instance of the IResourceManager
+ * implementation.
+ * The IResourceManager and IResourceBundle interfaces work together
+ * to provide internationalization support for Flex applications.
+ *
+ * <p>A single instance of an IResourceManager implementation
+ * manages all localized resources
+ * for a Flex application.</p>
+ *
+ * @see mx.resources.IResourceManager
+ * @see mx.resources.IResourceBundle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ResourceManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Linker dependency on implementation class.
+ */
+ private static var implClassDependency:ResourceManagerImpl;
+
+ /**
+ * @private
+ * The sole instance of the ResourceManager.
+ */
+ private static var instance:IResourceManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the single instance of the ResourceManager class.
+ * This object manages all localized resources for a Flex application.
+ *
+ * @return An object implementing IResourceManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getInstance():IResourceManager
+ {
+ if (!instance)
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.markTime("ResourceManager.getInstance().start");
+ }
+
+ if (!Singleton.getClass("mx.resources::IResourceManager"))
+ // install ResourceManagerImpl if not registered already
+ Singleton.registerClass("mx.resources::IResourceManager",
+ Class(getDefinitionByName("mx.resources::ResourceManagerImpl")));
+
+
+ try
+ {
+ instance = IResourceManager(
+ Singleton.getInstance("mx.resources::IResourceManager"));
+ }
+ catch(e:Error)
+ {
+ // In non-Flex apps and modules, the Singleton manager
+ // won't have been initialized by SystemManager
+ // or FlexModuleFactory (since these don't get linked in)
+ // so the above call to getInstance() will throw an exception.
+ }
+
+ // In this situation, the ResourceManager simply creates
+ // its own ResourceManagerImpl.
+ if (!instance)
+ instance = new ResourceManagerImpl();
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("ResourceManager.getInstance().end");
+ }
+ }
+
+ return instance;
+ }
+
+}
+
+}
\ No newline at end of file
[34/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/FlexVersion.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/FlexVersion.as b/frameworks/projects/MX/src/main/flex/mx/core/FlexVersion.as
new file mode 100644
index 0000000..08650af
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/FlexVersion.as
@@ -0,0 +1,488 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import mx.resources.ResourceManager;
+
+[ResourceBundle("core")]
+
+/**
+ * This class controls the backward-compatibility of the framework.
+ * With every new release, some aspects of the framework such as behaviors,
+ * styles, and default settings, are changed which can affect your application.
+ * By setting the <code>compatibilityVersion</code> property, the behavior can be changed
+ * to match previous releases.
+ * This is a 'global' flag; you cannot apply one version to one component or group of components
+ * and a different version to another component or group of components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class FlexVersion
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The current released version of the Flex SDK, encoded as a uint.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CURRENT_VERSION:uint = 0x04100000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.16,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.16
+ */
+ public static const VERSION_4_16:uint = 0x04100000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.15,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.15
+ */
+ public static const VERSION_4_15:uint = 0x040F0000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.14,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.14
+ */
+ public static const VERSION_4_14:uint = 0x040E0000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.13,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.13
+ */
+ public static const VERSION_4_13:uint = 0x040D0000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.12,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.12
+ */
+ public static const VERSION_4_12:uint = 0x040C0000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.11,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.11
+ */
+ public static const VERSION_4_11:uint = 0x040B0000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.10,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.10
+ */
+ public static const VERSION_4_10:uint = 0x040A0000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.9,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.9
+ */
+ public static const VERSION_4_9:uint = 0x04090000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.8,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Apache Flex 4.8
+ */
+ public static const VERSION_4_8:uint = 0x04080000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.6,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 11
+ * @playerversion AIR 3
+ * @productversion Flex 4.6
+ */
+ public static const VERSION_4_6:uint = 0x04060000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.5,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_4_5:uint = 0x04050000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 4.0,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_4_0:uint = 0x04000000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 3.0,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_3_0:uint = 0x03000000;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 2.0.1,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_2_0_1:uint = 0x02000001;
+
+ /**
+ * The <code>compatibilityVersion</code> value of Flex 2.0,
+ * encoded numerically as a <code>uint</code>.
+ * Code can compare this constant against
+ * the <code>compatibilityVersion</code>
+ * to implement version-specific behavior.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_2_0:uint = 0x02000000;
+
+ /**
+ * A String passed as a parameter
+ * to the <code>compatibilityErrorFunction()</code> method
+ * if the compatibility version has already been set.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
+ // Also used as resource string, so be careful changing it.
+
+ /**
+ * A String passed as a parameter
+ * to the <code>compatibilityErrorFunction()</code> method
+ * if the compatibility version has already been read.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
+ // Also used as resource string, so be careful changing it.
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // compatibilityErrorFunction
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the compatibilityErrorFunction property.
+ */
+ private static var _compatibilityErrorFunction:Function;
+
+ /**
+ * A function that gets called when the compatibility version
+ * is set more than once, or set after it has been read.
+ * If this function is not set, the SDK throws an error.
+ * If set, File calls this function, but it is
+ * up to the developer to decide how to handle the call.
+ * This function will also be called if the function is set more than once.
+ * The function takes two parameters: the first is a <code>uint</code>
+ * which is the version that was attempted to be set; the second
+ * is a string that is the reason it failed, either
+ * <code>VERSION_ALREADY_SET</code> or <code>VERSION_ALREADY_READ</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get compatibilityErrorFunction():Function
+ {
+ return _compatibilityErrorFunction;
+ }
+
+ /**
+ * @private
+ */
+ public static function set compatibilityErrorFunction(value:Function):void
+ {
+ _compatibilityErrorFunction = value;
+ }
+
+ //----------------------------------
+ // compatibilityVersion
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the compatibilityVersion property.
+ */
+ private static var _compatibilityVersion:uint = CURRENT_VERSION;
+
+ /**
+ * @private
+ */
+ private static var compatibilityVersionChanged:Boolean = false;
+
+ /**
+ * @private
+ */
+ private static var compatibilityVersionRead:Boolean = false;
+
+ /**
+ * The current version that the framework maintains compatibility for.
+ * This defaults to <code>CURRENT_VERSION</code>.
+ * It can be changed only once; changing it a second time
+ * results in a call to the <code>compatibilityErrorFunction()</code> method
+ * if it exists, or results in a runtime error.
+ * Changing it after the <code>compatibilityVersion</code> property has been read results in an error
+ * because code that is dependent on the version has already run.
+ * There are no notifications; the assumption is that this is set only once, and this it is set
+ * early enough that no code that depends on it has run yet.
+ *
+ * @default FlexVersion.CURRENT_VERSION
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get compatibilityVersion():uint
+ {
+ compatibilityVersionRead = true;
+
+ return _compatibilityVersion;
+ }
+
+ /**
+ * @private
+ */
+ public static function set compatibilityVersion(value:uint):void
+ {
+ if (value == _compatibilityVersion)
+ return;
+
+ var s:String;
+
+ if (compatibilityVersionChanged)
+ {
+ if (compatibilityErrorFunction == null)
+ {
+ s = ResourceManager.getInstance().getString(
+ "core", VERSION_ALREADY_SET);
+ throw new Error(s);
+ }
+ else
+ compatibilityErrorFunction(value, VERSION_ALREADY_SET);
+ }
+
+ if (compatibilityVersionRead)
+ {
+ if (compatibilityErrorFunction == null)
+ {
+ s = ResourceManager.getInstance().getString(
+ "core", VERSION_ALREADY_READ);
+ throw new Error(s);
+ }
+ else
+ compatibilityErrorFunction(value, VERSION_ALREADY_READ);
+ }
+
+ _compatibilityVersion = value;
+ compatibilityVersionChanged = true;
+ }
+
+ //----------------------------------
+ // compatibilityVersionString
+ //----------------------------------
+
+ /**
+ * The compatibility version, as a string of the form "X.X.X".
+ * This is a pass-through to the <code>compatibilityVersion</code>
+ * property, which converts the number to and from a more
+ * human-readable String version.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get compatibilityVersionString():String
+ {
+ var major:uint = (compatibilityVersion >> 24) & 0xFF;
+ var minor:uint = (compatibilityVersion >> 16) & 0xFF;
+ var update:uint = compatibilityVersion & 0xFFFF;
+
+ return major.toString() + "." +
+ minor.toString() + "." +
+ update.toString();
+ }
+
+ /**
+ * @private
+ */
+ public static function set compatibilityVersionString(value:String):void
+ {
+ var pieces:Array = value.split(".");
+
+ var major:uint = parseInt(pieces[0]);
+ var minor:uint = parseInt(pieces[1]);
+ var update:uint = parseInt(pieces[2]);
+
+ compatibilityVersion = (major << 24) + (minor << 16) + update;
+ }
+
+ /**
+ * @private
+ * A back door for changing the compatibility version.
+ * This is provided for Flash Builder's Design View,
+ * which needs to be able to change compatibility mode.
+ * In general, we won't support late changes to compatibility,
+ * because the framework won't watch for changes.
+ * Design View will need to set this early during initialization.
+ */
+ mx_internal static function changeCompatibilityVersionString(
+ value:String):void
+ {
+ var pieces:Array = value.split(".");
+
+ var major:uint = parseInt(pieces[0]);
+ var minor:uint = parseInt(pieces[1]);
+ var update:uint = parseInt(pieces[2]);
+
+ _compatibilityVersion = (major << 24) + (minor << 16) + update;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..9b59813
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IAssetLayoutFeatures.as
@@ -0,0 +1,374 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+import flash.geom.Matrix;
+import flash.geom.Matrix3D;
+
+/**
+ * The IAssetLayoutFeatures interface defines the minimum properties and methods
+ * required for an Object to support advanced transforms in embedded assets.
+ *
+ * @see mx.core.AdvancedLayoutFeatures
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+public interface IAssetLayoutFeatures
+{
+
+ /**
+ * Layout transform convenience property. Represents the x value of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutX(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutX():Number;
+
+ /**
+ * Layout transform convenience property. Represents the y value of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutY(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutY():Number;
+
+ /**
+ * Layout transform convenience property. Represents the z value of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutZ(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutZ():Number;
+
+ /**
+ * Used by the mirroring transform. See the mirror property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get layoutWidth():Number;
+
+ /**
+ * @private
+ */
+ function set layoutWidth(value:Number):void;
+
+ //------------------------------------------------------------------------------
+
+ /**
+ * The x value of the point around which any rotation and scale is performed in both the layout and computed matrix.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set transformX(value:Number):void;
+ /**
+ * @private
+ */
+ function get transformX():Number;
+
+ /**
+ * The y value of the point around which any rotation and scale is performed in both the layout and computed matrix.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set transformY(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get transformY():Number;
+
+ /**
+ * The z value of the point around which any rotation and scale is performed in both the layout and computed matrix.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set transformZ(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get transformZ():Number;
+
+ //------------------------------------------------------------------------------
+
+ /**
+ * Layout transform convenience property. Represents the rotation around the X axis of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutRotationX(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutRotationX():Number;
+
+ /**
+ * Layout transform convenience property. Represents the rotation around the Y axis of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutRotationY(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutRotationY():Number;
+
+ /**
+ * Layout transform convenience property. Represents the rotation around the Z axis of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutRotationZ(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutRotationZ():Number;
+
+ //------------------------------------------------------------------------------
+
+ /**
+ * Layout transform convenience property. Represents the scale along the X axis of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutScaleX(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutScaleX():Number;
+
+ /**
+ * Layout transform convenience property. Represents the scale along the Y axis of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutScaleY(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutScaleY():Number;
+
+ /**
+ * Layout transform convenience property. Represents the scale along the Z axis of the layout matrix used in layout and in
+ * the computed transform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutScaleZ(value:Number):void;
+
+ /**
+ * @private
+ */
+ function get layoutScaleZ():Number;
+
+ /**
+ * The 2D matrix used during layout calculations to determine the layout and size of the component and its parent and siblings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutMatrix(value:Matrix):void;
+
+ /**
+ * @private
+ */
+ function get layoutMatrix():Matrix;
+
+ /**
+ * The 3D matrix used during layout calculations to determine the layout and size of the component and its parent and siblings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function set layoutMatrix3D(value:Matrix3D):void;
+
+ /**
+ * @private
+ */
+ function get layoutMatrix3D():Matrix3D;
+
+ /**
+ * True if the computed transform has 3D values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get is3D():Boolean;
+
+ /**
+ * True if the layout transform has 3D values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get layoutIs3D():Boolean;
+
+ /**
+ * If true the X axis is scaled by -1 and the x coordinate of the origin
+ * is translated by the component's width.
+ *
+ * The net effect of this "mirror" transform is to flip the direction
+ * that the X axis increases in without changing the layout element's
+ * location relative to the parent's origin.
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get mirror():Boolean;
+
+ /**
+ * @private
+ */
+ function set mirror(value:Boolean):void;
+
+
+ /**
+ * The stretchY is the horizontal component of the stretch scale factor which
+ * is applied before any other transformation property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get stretchX():Number;
+
+ /**
+ * @private
+ */
+ function set stretchX(value:Number):void;
+
+ /**
+ * The stretchY is the vertical component of the stretch scale factor which
+ * is applied before any other transformation property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get stretchY():Number;
+
+ /**
+ * @private
+ */
+ function set stretchY(value:Number):void;
+
+ //------------------------------------------------------------------------------
+
+ /**
+ * The computed matrix, calculated by combining the layout matrix and any offsets provided.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get computedMatrix():Matrix;
+
+ /**
+ * The computed 3D matrix, calculated by combining the 3D layout matrix and any offsets provided.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ function get computedMatrix3D():Matrix3D;
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IBorder.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IBorder.as b/frameworks/projects/MX/src/main/flex/mx/core/IBorder.as
new file mode 100644
index 0000000..7e98be4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IBorder.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IBorder interface defines the interface that all classes
+ * used for border skins should implement.
+ *
+ * <p>It is not an error if the border skin does not implement IBorder.
+ * In this case, however, the container using the skin cannot determine
+ * the border metrics of the border.
+ * Therefore, the container places content starting at its top-left edge
+ * (adjusted for padding, if any).
+ * For the HaloBorder class, the <code>borderThickness</code> style
+ * usually determines the value of the <code>borderMetrics</code> style.
+ * For graphical skin classes, Flex examines the <code>scale9Grid</code>
+ * property to determine the value of the <code>borderMetrics</code> style.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IBorder
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // borderMetrics
+ //----------------------------------
+
+ /**
+ * Returns an EdgeMetrics object for the border that has four properties:
+ * <code>left</code>, <code>top</code>, <code>right</code>,
+ * and <code>bottom</code>.
+ * The value of each property is equal to the thickness of one side
+ * of the border, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get borderMetrics():EdgeMetrics;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IButton.as b/frameworks/projects/MX/src/main/flex/mx/core/IButton.as
new file mode 100644
index 0000000..14371e1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IButton.as
@@ -0,0 +1,77 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IButton interface is a marker interface that indicates that a component
+ * acts as a button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IButton extends IUIComponent
+{
+ /**
+ * @copy mx.controls.Button#emphasized
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get emphasized():Boolean;
+ function set emphasized(value:Boolean):void;
+
+ /**
+ * @copy mx.core.UIComponent#callLater()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function callLater(method:Function,
+ args:Array /* of Object */ = null):void
+
+ /**
+ * Gets the text on a Button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion ApacheFlex 4.10
+ */
+ function get label():String;
+
+ /**
+ * Sets the text on a Button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion ApacheFlex 4.10
+ */
+ function set label(value:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..feb5112
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IChildList.as
@@ -0,0 +1,313 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.geom.Point;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import org.apache.flex.geom.Point;
+}
+
+/**
+ * The IChildList interface defines the properties and methods
+ * for accessing and manipulating child lists, which are subsets
+ * of a DisplayObjectContainer's children.
+ *
+ * <p>As an example, consider the Container class.
+ * It overrides DisplayObjectContainer APIs such as the
+ * <code>numChildren</code> and <code>getChildAt()</code> methods
+ * to access only "content" children, which are the controls
+ * and other containers that you put inside it.
+ * But a Container can also have additional children
+ * created automatically by the framework, such as a background or border
+ * skin and scrollbars.
+ * So Container exposes a property called <code>rawChildren</code>
+ * of type IChildList, which lets you access all its children,
+ * not just the content children.</p>
+ *
+ * <p>As another example, the SystemManager class is a DisplayObjectContainer
+ * whose children are partitioned into various layers:
+ * normal children like the Application are on the bottom,
+ * popups above them, tooltips above them, and cursors on the top.
+ * The SystemManager class has properties named <code>popUpChildren</code>,
+ * <code>toolTipChildren</code>, and <code>cursorChildren</code>
+ * which let you access these layers, and the type of each of these
+ * properties is IChildList.
+ * Therefore, you can count the number of popups using the
+ * <code>systemManager.popUpChildren.numChildren</code> property,
+ * insert another DisplayObject into the tooltip layer using the
+ * <code>systemManager.toolTipChildren.addChild()</code> method, and so on.</p>
+ *
+ * @see mx.core.Container#rawChildren
+ * @see mx.managers.SystemManager#rawChildren
+ * @see mx.managers.SystemManager#popUpChildren
+ * @see mx.managers.SystemManager#toolTipChildren
+ * @see mx.managers.SystemManager#cursorChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IChildList
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // numChildren
+ //----------------------------------
+
+ /**
+ * The number of children in this child list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get numChildren():int;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds a child DisplayObject after the end of this child list.
+ *
+ * <p>Calling <code>childList.addChild(child)</code> is the same as calling
+ * <code>childList.addChild(child, childList.numChildren)</code>
+ * After it has been added, its index of the new child
+ * will be <code>(child.numChildren - 1)</code></p>
+ *
+ * @param child The DisplayObject to add as a child.
+ *
+ * @return The child that was added; this is the same
+ * as the argument passed in.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addChild(child:DisplayObject):DisplayObject;
+
+ /**
+ * Adds a child DisplayObject to this child list at the index specified.
+ * An index of 0 represents the beginning of the DisplayList,
+ * and an index of <code>numChildren</code> represents the end.
+ *
+ * <p>Adding a child anywhere except at the end of a child list
+ * will increment the indexes of children that were previously
+ * at that index or at higher indices.</p>
+ *
+ * @param child The DisplayObject to add as a child.
+ *
+ * @param index The index to add the child at.
+ *
+ * @return The child that was added; this is the same
+ * as the <code>child</code> argument passed in.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addChildAt(child:DisplayObject, index:int):DisplayObject;
+
+ /**
+ * Removes the specified child DisplayObject from this child list.
+ *
+ * <p>Removing a child anywhere except from the end of a child list
+ * will decrement the indexes of children that were at higher indices.</p>
+ *
+ * <p>The removed child will have its parent set to null and will be
+ * garbage collected if no other references to it exist.</p>
+ *
+ * @param child The DisplayObject to remove.
+ *
+ * @return The child that was removed; this is the same
+ * as the argument passed in.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeChild(child:DisplayObject):DisplayObject;
+
+ /**
+ * Removes the child DisplayObject at the specified index
+ * from this child list.
+ *
+ * <p>Removing a child anywhere except from the end of a child list
+ * will decrement the indexes of children that were at higher indices.</p>
+ *
+ * <p>The removed child will have its parent set to null and will be
+ * garbage collected if no other references to it exist.</p>
+ *
+ * @param index The child index of the DisplayObject to remove.
+ *
+ * @return The child that was removed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeChildAt(index:int):DisplayObject;
+
+ /**
+ * Gets the child DisplayObject at the specified index in this child list.
+ *
+ * @param index An integer from 0 to <code>(numChildren - 1)</code>
+ * that specifies the index of a child in this child list.
+ *
+ * @return The child at the specified index.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getChildAt(index:int):DisplayObject;
+
+ /**
+ * Gets the child DisplayObject with the specified name
+ * in this child list.
+ *
+ * @param name The name of the child to return.
+ *
+ * @return The child with the specified name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getChildByName(name:String):DisplayObject;
+
+ /**
+ * Gets the index of a specific child in this child list.
+ *
+ * <p>The first child in the child list has an index of 0,
+ * the second child has an index of 1, and the last child
+ * has an index of <code>(numChildren - 1)</code>.</p>
+ *
+ * <p>If <code>getChildIndex(myChild)</code> returns 5,
+ * then <code>myView.getChildAt(5)</code> returns
+ * <code>myChild</code>.</p>
+ *
+ * <p>If you add a child by calling the <code>addChild()</code> method,
+ * the new child's index is equal to the largest index among the
+ * existing children plus one.</p>
+ *
+ * <p>You can insert a child at a specified index by using the
+ * <code>addChildAt()</code> method
+ * In that case the children previously at that index and higher
+ * indices have their index increased by 1 so that all
+ * children are indexed from 0 to <code>(numChildren - 1)</code>.</p>
+ *
+ * <p>If you remove a child by calling the <code>removeChild()</code>
+ * or <code>removeChildAt()</code> method, then the children
+ * at higher indices have their index decreased by 1 so that
+ * all children are indexed from 0 to <code>(numChildren - 1)</code>.</p>
+ *
+ * <p>If you change a child's index by calling the
+ * <code>setChildIndex()</code> method, then the children between
+ * the old index and the new index, inclusive, have their indexes
+ * adjusted so that all children are indexed from
+ * 0 to <code>(numChildren - 1)</code>.</p>
+ *
+ * @param child The child whose index to get.
+ *
+ * @return The index of the child, which is an integer
+ * between 0 and <code>(numChildren - 1)</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getChildIndex(child:DisplayObject):int;
+
+ /**
+ * Changes the index of a particular child in this child list.
+ * See the <code>getChildIndex()</code> method for a
+ * description of the child's index.
+ *
+ * @param child The child whose index to set.
+ *
+ * @param newIndex The new index for the specified child.
+ * This must be an integer between zero and <code>(numChildren - 1)</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setChildIndex(child:DisplayObject, newIndex:int):void;
+
+ /**
+ * Returns an array of DisplayObjects that lie under the specified point
+ * and are in this child list.
+ *
+ * @param point The point under which to look.
+ *
+ * @return An array of object that lie under the specified point
+ * that are children of this Container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getObjectsUnderPoint(point:Point):Array;
+
+ /**
+ * Determines if a DisplayObject is in this child list,
+ * or is a descendant of an child in this child list.
+ *
+ * @param child The DisplayObject to test.
+ *
+ * @return <code>true</code> if the DisplayObject is in this child list
+ * or is a descendant of an child in this child list;
+ * <code>false</code> otherwise.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function contains(child:DisplayObject):Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IConstraintClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IConstraintClient.as b/frameworks/projects/MX/src/main/flex/mx/core/IConstraintClient.as
new file mode 100644
index 0000000..ea9728f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IConstraintClient.as
@@ -0,0 +1,96 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IConstraintClient interface defines the interface for components that
+ * support layout constraints. This interface is only used by implementations
+ * of constraint-based layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+
+public interface IConstraintClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // getConstraintValue
+ //----------------------------------
+
+ /**
+ * Returns the specified constraint value.
+ *
+ * @param constraintName name of the constraint value. Constraint parameters are
+ * "<code>baseline</code>", "<code>bottom</code>", "<code>horizontalCenter</code>",
+ * "<code>left</code>", "<code>right</code>", "<code>top</code>", and
+ * "<code>verticalCenter</code>".
+ *
+ * <p>For more information about these parameters, see the Canvas and Panel containers and
+ * Styles Metadata AnchorStyles.</p>
+ *
+ * @return The constraint value, or null if it is not defined.
+ *
+ * @see mx.containers.Canvas
+ * @see mx.containers.Panel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getConstraintValue(constraintName:String):*;
+
+ //----------------------------------
+ // setConstraintValue
+ //----------------------------------
+
+ /**
+ * Sets the specified constraint value.
+ *
+ * @param constraintName name of the constraint value. Constraint parameters are
+ * "<code>baseline</code>", "<code>bottom</code>", "<code>horizontalCenter</code>",
+ * "<code>left</code>", "<code>right</code>", "<code>top</code>", and
+ * "<code>verticalCenter</code>".
+ *
+ * <p>For more information about these parameters, see the Canvas and Panel containers and
+ * Styles Metadata AnchorStyles.</p>
+ *
+ * @param value The new value for the constraint.
+ *
+ * @see mx.containers.Canvas
+ * @see mx.containers.Panel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setConstraintValue(constraintName:String, value:*):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/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
new file mode 100644
index 0000000..a482148
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IContainer.as
@@ -0,0 +1,126 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+import mx.managers.IFocusManager;
+
+/**
+ * IContainer is a interface that indicates a component
+ * extends or mimics mx.core.Container
+ *
+ * @see mx.core.Container
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IContainer extends IUIComponent
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+ import flash.geom.Rectangle;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.Sprite;
+ import org.apache.flex.geom.Rectangle;
+}
+COMPILE::LATER
+{
+ import flash.display.Graphics;
+ import flash.media.SoundTransform;
+}
+
+include "ISpriteInterface.as"
+include "IDisplayObjectContainerInterface.as"
+include "IInteractiveObjectInterface.as"
+
+ /**
+ * @copy mx.core.Container#defaultButton
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get defaultButton():IFlexDisplayObject;
+ function set defaultButton(value:IFlexDisplayObject):void;
+
+ /**
+ * @copy mx.core.Container#creatingContentPane
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get creatingContentPane():Boolean;
+ function set creatingContentPane(value:Boolean):void;
+
+ /**
+ * @copy mx.core.Container#viewMetrics
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get viewMetrics():EdgeMetrics;
+
+ /**
+ * @copy mx.core.Container#horizontalScrollPosition
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get horizontalScrollPosition():Number;
+ function set horizontalScrollPosition(value:Number):void;
+
+ /**
+ * @copy mx.core.Container#verticalScrollPosition
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get verticalScrollPosition():Number;
+ function set verticalScrollPosition(value:Number):void;
+
+ /**
+ * @copy mx.core.UIComponent#focusManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusManager():IFocusManager;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IDeferredContentOwner.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IDeferredContentOwner.as b/frameworks/projects/MX/src/main/flex/mx/core/IDeferredContentOwner.as
new file mode 100644
index 0000000..7dba39b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IDeferredContentOwner.as
@@ -0,0 +1,104 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * Dispatched after the content for this component has been created. With deferred
+ * instantiation, the content for a component can be created long after the
+ * component is created.
+ *
+ * @eventType mx.events.FlexEvent.CONTENT_CREATION_COMPLETE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Event(name="contentCreationComplete", type="mx.events.FlexEvent")]
+
+/**
+ * The IDeferredContentOwner interface defines the properties and methods
+ * for deferred instantiation.
+ *
+ * @see spark.components.SkinnableContainer
+ * @see mx.core.Container
+ * @see mx.core.INavigatorContent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface IDeferredContentOwner extends IUIComponent
+{
+ [Inspectable(enumeration="auto, all, none", defaultValue="auto")]
+
+ /**
+ * Content creation policy for this component.
+ *
+ * <p>Possible values are:
+ * <ul>
+ * <li><code>auto</code> - Automatically create the content immediately before it is needed.</li>
+ * <li><code>all</code> - Create the content as soon as the parent component is created. This
+ * option should only be used as a last resort because it increases startup time and memory usage.</li>
+ * <li><code>none</code> - Content must be created manually by calling
+ * the <code>createDeferredContent()</code> method.</li>
+ * </ul>
+ * </p>
+ *
+ * <p>If no <code>creationPolicy</code> is specified for a container, that container inherits the value of
+ * its parent's <code>creationPolicy</code> property.</p>
+ *
+ * @default "auto"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get creationPolicy():String;
+ function set creationPolicy(value:String):void;
+
+ /**
+ * Create the content for this component. If the value of the <code>creationPolicy</code> property
+ * is <code>auto</code> or <code>all</code>, this the Flex framework calls this method. If the value of the
+ * <code>creationPolicy</code> property is <code>none</code>, you must explicitly call this method
+ * to create the content for the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function createDeferredContent():void;
+
+ /**
+ * A flag that indicates whether the deferred content has been created.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get deferredContentCreated():Boolean;
+}
+
+}
\ 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/core/IDeferredInstance.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstance.as b/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstance.as
new file mode 100644
index 0000000..be0e0f9
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstance.as
@@ -0,0 +1,106 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IDeferredInstance interface defines the Flex deferred instance factory interface.
+ * An implementation of IDeferredInstance creates a particular instance value
+ * when the <code>getInstance()</code> method is first called, and returns a reference to that value
+ * when the <code>getInstance()</code> method is called subsequently.
+ *
+ * <p>The Flex compiler performs the following automatic coercions when it
+ * encounters MXML that assigns a value to a property with the
+ * IDeferredInstance type:</p>
+ *
+ * <ol>
+ * <li>If you assign a property of type IDeferredInstance a value that is
+ * an MXML child tag representing a class, such as a component
+ * tag, the compiler creates an IDeferredInstance implementation
+ * whose <code>getInstance()</code> method returns an instance
+ * of the class, configured as specified in the MXML code.
+ * The following example shows this format; in this example,
+ * MyComp is a custom component that has a variable called
+ * myDeferredInstanceProperty of type IDeferredInstance. The compiler
+ * generates an IDeferredInstance1 implementation whose
+ * <code>getInstance()</code> method returns an instance of the
+ * Label class, with its text property set to
+ * "This is a deferred label":
+ * <pre>
+ * <MyComp>
+ * <myDeferredInstanceProperty>
+ * <Label text="This is a deferred label"/>
+ * </myDeferredInstanceProperty>
+ * </MyComp></pre>
+ * </li>
+ * <li>If you assign a text string to a property of type IDeferredInstance,
+ * the compiler interprets the string as a fully qualified class name,
+ * and creates an
+ * IDeferredInstance implementation whose <code>getInstance()</code>
+ * method returns a new instance of the specified class.
+ * The specified class must have a constructor with no arguments.
+ * The following example shows this format; in this example, the compiler
+ * generates an IDeferredInstance1 implementation whose
+ * <code>getInstance()</code> method returns an instance of the
+ * MyClass class:
+ * <pre>
+ * <MyComp myDeferredInstanceProperty="myPackage.MyClass/></pre>
+ * </li>
+ * </ol>
+ *
+ * <p>Use the IDeferredInstance interface when an ActionScript class defers
+ * the instantiation of a property value.
+ * You cannot use IDeferredInstance if an ActionScript class requires
+ * multiple instances of the same value.
+ * In those situations, use the IFactory interface.</p>
+ *
+ * <p>The states.AddChild class includes a <code>childFactory</code>
+ * property that is of type IDeferredInstance.</p>
+ *
+ * @see mx.states.AddChild
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IDeferredInstance
+{
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates an instance Object from a class or function,
+ * if the instance does not yet exist.
+ *
+ * @return The instance Object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getInstance():Object;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstantiationUIComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstantiationUIComponent.as b/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstantiationUIComponent.as
new file mode 100644
index 0000000..714e0bb
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IDeferredInstantiationUIComponent.as
@@ -0,0 +1,170 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The IDeferredInstantiationUIComponent interface defines the interface for a component
+ * or object that defers instantiation.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IDeferredInstantiationUIComponent extends IUIComponent
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // cacheHeuristic
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#cacheHeuristic
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function set cacheHeuristic(value:Boolean):void;
+
+ //----------------------------------
+ // cachePolicy
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#cachePolicy
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get cachePolicy():String
+
+ //----------------------------------
+ // descriptor
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#descriptor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get descriptor():UIComponentDescriptor;
+
+ /**
+ * @private
+ */
+ function set descriptor(value:UIComponentDescriptor):void;
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#id
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get id():String;
+
+ /**
+ * @private
+ */
+ function set id(value:String):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates an <code>id</code> reference to this IUIComponent object
+ * on its parent document object.
+ * This function can create multidimensional references
+ * such as b[2][4] for objects inside one or more repeaters.
+ * If the indices are null, it creates a simple non-Array reference.
+ *
+ * @param parentDocument The parent of this IUIComponent object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function createReferenceOnParentDocument(
+ parentDocument:IFlexDisplayObject):void;
+
+ /**
+ * Deletes the <code>id</code> reference to this IUIComponent object
+ * on its parent document object.
+ * This function can delete from multidimensional references
+ * such as b[2][4] for objects inside one or more Repeaters.
+ * If the indices are null, it deletes the simple non-Array reference.
+ *
+ * @param parentDocument The parent of this IUIComponent object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function deleteReferenceOnParentDocument(
+ parentDocument:IFlexDisplayObject):void;
+
+ /**
+ * @copy mx.core.UIComponent#executeBindings()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function executeBindings(recurse:Boolean = false):void;
+
+ /**
+ * For each effect event, register the EffectManager
+ * as one of the event listeners.
+ *
+ * @param effects An Array of strings of effect names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerEffects(effects:Array):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..5fb6229
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectContainerInterface.as
@@ -0,0 +1,203 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ * The IDisplayObjectContainerInterface defines the basic set of APIs
+ * for web version of flash.display.DisplayObjectContainer
+ *
+ */
+import flash.text.TextSnapshot;
+import flash.geom.Point;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#addChild()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addChild(child:DisplayObject):DisplayObject;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#addChildAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addChildAt(child:DisplayObject, index:int):DisplayObject;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#removeChild()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeChild(child:DisplayObject):DisplayObject;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#removeChildAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeChildAt(index:int):DisplayObject;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#getChildIndex()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getChildIndex(child:DisplayObject):int;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#setChildIndex()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setChildIndex(child:DisplayObject, index:int):void;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#getChildAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getChildAt(index:int):DisplayObject;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#getChildByName()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getChildByName(name:String):DisplayObject;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#numChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get numChildren():int;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#textSnapshot
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get textSnapshot():TextSnapshot;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#getObjectsUnderPoint()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getObjectsUnderPoint(point:Point):Array;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#areInaccessibleObjectsUnderPoint()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function areInaccessibleObjectsUnderPoint(point:Point):Boolean;
+
+ /**
+ * Determines whether the children of the object are tab enabled.
+ *
+ * <p><b>Note:</b> Do not use this property with Flex.
+ * Instead, use the <code>UIComponent.hasFocusableChildren</code> property.</p>
+ *
+ * @see mx.core.UIComponent#hasFocusableChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get tabChildren():Boolean;
+ function set tabChildren(enable:Boolean):void;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#mouseChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mouseChildren():Boolean;
+ function set mouseChildren(enable:Boolean):void;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#contains()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function contains(child:DisplayObject):Boolean;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#swapChildrenAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function swapChildrenAt(index1:int, index2:int):void;
+
+ /**
+ * @copy flash.display.DisplayObjectContainer#swapChildren()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function swapChildren(child1:DisplayObject, child2:DisplayObject):void;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..e0739e6
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/IDisplayObjectInterface.as
@@ -0,0 +1,380 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/*
+ * 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():DisplayObjectContainer;
+
+
+ /**
+ * @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
+ */
+ COMPILE::LATER
+ function globalToLocal(point:Point):Point;
+
+ /**
+ * @copy flash.display.DisplayObject#localToGlobal()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ 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;
+
[12/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/ColorUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/ColorUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/ColorUtil.as
new file mode 100644
index 0000000..315af33
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/ColorUtil.as
@@ -0,0 +1,166 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+/**
+ * The ColorUtil class is an all-static class
+ * with methods for working with RGB colors within Flex.
+ * You do not create instances of ColorUtil;
+ * instead you simply call static methods such as
+ * the <code>ColorUtil.adjustBrightness()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ColorUtil
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Performs a linear brightness adjustment of an RGB color.
+ *
+ * <p>The same amount is added to the red, green, and blue channels
+ * of an RGB color.
+ * Each color channel is limited to the range 0 through 255.</p>
+ *
+ * @param rgb Original RGB color.
+ *
+ * @param brite Amount to be added to each color channel.
+ * The range for this parameter is -255 to 255;
+ * -255 produces black while 255 produces white.
+ * If this parameter is 0, the RGB color returned
+ * is the same as the original color.
+ *
+ * @return New RGB color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function adjustBrightness(rgb:uint, brite:Number):uint
+ {
+ var r:Number = Math.max(Math.min(((rgb >> 16) & 0xFF) + brite, 255), 0);
+ var g:Number = Math.max(Math.min(((rgb >> 8) & 0xFF) + brite, 255), 0);
+ var b:Number = Math.max(Math.min((rgb & 0xFF) + brite, 255), 0);
+
+ return (r << 16) | (g << 8) | b;
+ }
+
+ /**
+ * Performs a scaled brightness adjustment of an RGB color.
+ *
+ * @param rgb Original RGB color.
+ *
+ * @param brite The percentage to brighten or darken the original color.
+ * If positive, the original color is brightened toward white
+ * by this percentage. If negative, it is darkened toward black
+ * by this percentage.
+ * The range for this parameter is -100 to 100;
+ * -100 produces black while 100 produces white.
+ * If this parameter is 0, the RGB color returned
+ * is the same as the original color.
+ *
+ * @return New RGB color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function adjustBrightness2(rgb:uint, brite:Number):uint
+ {
+ var r:Number;
+ var g:Number;
+ var b:Number;
+
+ if (brite == 0)
+ return rgb;
+
+ if (brite < 0)
+ {
+ brite = (100 + brite) / 100;
+ r = ((rgb >> 16) & 0xFF) * brite;
+ g = ((rgb >> 8) & 0xFF) * brite;
+ b = (rgb & 0xFF) * brite;
+ }
+ else // bright > 0
+ {
+ brite /= 100;
+ r = ((rgb >> 16) & 0xFF);
+ g = ((rgb >> 8) & 0xFF);
+ b = (rgb & 0xFF);
+
+ r += ((0xFF - r) * brite);
+ g += ((0xFF - g) * brite);
+ b += ((0xFF - b) * brite);
+
+ r = Math.min(r, 255);
+ g = Math.min(g, 255);
+ b = Math.min(b, 255);
+ }
+
+ return (r << 16) | (g << 8) | b;
+ }
+
+ /**
+ * Performs an RGB multiplication of two RGB colors.
+ *
+ * <p>This always results in a darker number than either
+ * original color unless one of them is white,
+ * in which case the other color is returned.</p>
+ *
+ * @param rgb1 First RGB color.
+ *
+ * @param rgb2 Second RGB color.
+ *
+ * @return RGB multiplication of the two colors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function rgbMultiply(rgb1:uint, rgb2:uint):uint
+ {
+ var r1:Number = (rgb1 >> 16) & 0xFF;
+ var g1:Number = (rgb1 >> 8) & 0xFF;
+ var b1:Number = rgb1 & 0xFF;
+
+ var r2:Number = (rgb2 >> 16) & 0xFF;
+ var g2:Number = (rgb2 >> 8) & 0xFF;
+ var b2:Number = rgb2 & 0xFF;
+
+ return ((r1 * r2 / 255) << 16) |
+ ((g1 * g2 / 255) << 8) |
+ (b1 * b2 / 255);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/DensityUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/DensityUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/DensityUtil.as
new file mode 100644
index 0000000..e80bad5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/DensityUtil.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+import mx.core.DPIClassification;
+import mx.core.RuntimeDPIProvider;
+import mx.core.Singleton;
+
+[ExcludeClass]
+
+/**
+ * The <code>DensityUtil</code> class is an all-static class with methods for working with
+ * density within Flex.
+ *
+ * Flex uses this class to calculate the scaling factor when automatic density
+ * scaling is enabled for the <code>Application</code>.
+ *
+ * @see mx.core.DPIClassification
+ * @see spark.components.Application#applicationDPI
+ */
+public class DensityUtil
+{
+ /**
+ * Cached runtimeDPI value, which is computed from the runtimeDPIProvider class.
+ */
+ private static var runtimeDPI:Number;
+
+ /**
+ * Returns the current runtimeDPI value which is calculated by
+ * an instance of the runtimeDPIProvider class.
+ * If a runtimeDPIProvider class is not provided to the Application,
+ * Flex uses the default class, RuntimeDPIProvider.
+ *
+ * @see #getDPIScale
+ * @see mx.core.RuntimeDPIProvider
+ */
+ public static function getRuntimeDPI():Number
+ {
+ if (!isNaN(runtimeDPI))
+ return runtimeDPI;
+
+ var runtimeDPIProviderClass:Class = Singleton.getClass("mx.core::RuntimeDPIProvider");
+
+ // Default to RuntimeDPIProvider
+ if (!runtimeDPIProviderClass)
+ runtimeDPIProviderClass = RuntimeDPIProvider;
+
+ var instance:RuntimeDPIProvider = RuntimeDPIProvider(new runtimeDPIProviderClass());
+ runtimeDPI = instance.runtimeDPI;
+
+ return runtimeDPI;
+ }
+
+ /**
+ * Calculates a scale factor to be used when element authored for
+ * <code>sourceDPI</code> is rendered at <code>targetDPI</code>.
+ *
+ * @param sourceDPI The <code>DPIClassification</code> dpi value for which
+ * a resource is optimized.
+ *
+ * @param targetDPI The <code>DPIClassification</code> dpi value at
+ * which a resource is rendered.
+ *
+ * @return The scale factor to be applied to the resource at render time.
+ *
+ * @see #getRuntimeDPI
+ * @see mx.core.DPIClassification
+ */
+ public static function getDPIScale(sourceDPI:Number, targetDPI:Number):Number
+ {
+ // Unknown dpi returns NaN
+ if ((sourceDPI != DPIClassification.DPI_120 && sourceDPI != DPIClassification.DPI_160 && sourceDPI != DPIClassification.DPI_240 && sourceDPI != DPIClassification.DPI_320 && sourceDPI != DPIClassification.DPI_480 && sourceDPI != DPIClassification.DPI_640) ||
+ (targetDPI != DPIClassification.DPI_120 && targetDPI != DPIClassification.DPI_160 && targetDPI != DPIClassification.DPI_240 && targetDPI != DPIClassification.DPI_320 && targetDPI != DPIClassification.DPI_480 && targetDPI != DPIClassification.DPI_640))
+ {
+ return NaN;
+ }
+
+ return targetDPI / sourceDPI;
+ }
+}
+}
\ 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/utils/DescribeTypeCache.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCache.as b/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCache.as
new file mode 100644
index 0000000..f11f69d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCache.as
@@ -0,0 +1,173 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.utils.describeType;
+import flash.utils.getDefinitionByName;
+import flash.utils.getQualifiedClassName;
+import mx.binding.BindabilityInfo;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * DescribeTypeCache is a convenience class that is used to
+ * cache the return values of <code>flash.utils.describeType()</code>
+ * so that calls made subsequent times return faster.
+ *
+ * This class also lets you set handler functions for specific value types.
+ * These will get called when the user tries to access these values on
+ * the <code>DescribeTypeCacheRecord</code> class.
+ *
+ * @see mx.utils.DescribeTypeCacheRecord
+ */
+public class DescribeTypeCache
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class initialization
+ //
+ //--------------------------------------------------------------------------
+
+ registerCacheHandler("bindabilityInfo", bindabilityInfoHandler);
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static var typeCache:Object = {};
+
+ /**
+ * @private
+ */
+ private static var cacheHandlers:Object = {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Calls <code>flash.utils.describeType()</code> for the first time and caches
+ * the return value so that subsequent calls return faster.
+ *
+ * @param o Can be either a string describing a fully qualified class name or any
+ * ActionScript value, including all available ActionScript types, object instances,
+ * primitive types (such as <code>uint</code>), and class objects.
+ *
+ * @return Returns the cached record.
+ *
+ * @see flash.utils#describeType()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function describeType(o:*):DescribeTypeCacheRecord
+ {
+ var className:String;
+ var cacheKey:String;
+
+ if (o is String)
+ cacheKey = className = o;
+ else
+ cacheKey = className = getQualifiedClassName(o);
+
+ //Need separate entries for describeType(Foo) and describeType(myFoo)
+ if (o is Class)
+ cacheKey += "$";
+
+ if (cacheKey in typeCache)
+ {
+ return typeCache[cacheKey];
+ }
+ else
+ {
+ if (o is String)
+ {
+ try
+ {
+ o = getDefinitionByName(o);
+ }
+ catch (error:ReferenceError)
+ {
+ // The o parameter doesn't refer to an ActionScript
+ // definition, it's just a string value.
+ }
+ }
+ var typeDescription:XML = flash.utils.describeType(o);
+ var record:DescribeTypeCacheRecord = new DescribeTypeCacheRecord();
+ record.typeDescription = typeDescription;
+ record.typeName = className;
+ typeCache[cacheKey] = record;
+
+ return record;
+ }
+ }
+
+ /**
+ * registerCacheHandler lets you add function handler for specific strings.
+ * These functions get called when the user refers to these values on a
+ * instance of <code>DescribeTypeCacheRecord</code>.
+ *
+ * @param valueName String that specifies the value for which the handler must be set.
+ * @param handler Function that should be called when user references valueName.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function registerCacheHandler(valueName:String, handler:Function):void
+ {
+ cacheHandlers[valueName] = handler;
+ }
+
+ /**
+ * @private
+ */
+ internal static function extractValue(valueName:String, record:DescribeTypeCacheRecord):*
+ {
+ if (valueName in cacheHandlers)
+ return cacheHandlers[valueName](record);
+
+ return undefined;
+ }
+
+ /**
+ * @private
+ */
+ private static function bindabilityInfoHandler(record:DescribeTypeCacheRecord):*
+ {
+ return new BindabilityInfo(record.typeDescription);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as b/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
new file mode 100644
index 0000000..ea17f6c
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
@@ -0,0 +1,129 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.utils.Proxy;
+import flash.utils.flash_proxy;
+
+use namespace flash_proxy;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This class represents a single cache entry, this gets created
+ * as part of the <code>describeType</code> method call on the
+ * <code>DescribeTypeCache</code> class.
+ */
+
+public dynamic class DescribeTypeCacheRecord extends Proxy
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var cache:Object = {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // typeDescription
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var typeDescription:XML;
+
+ //----------------------------------
+ // typeName
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public var typeName:String;
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function DescribeTypeCacheRecord()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override flash_proxy function getProperty(name:*):*
+ {
+ var result:* = cache[name];
+
+ if (result === undefined)
+ {
+ result = DescribeTypeCache.extractValue(name, this);
+ cache[name] = result;
+ }
+
+ return result;
+ }
+
+ /**
+ * @private
+ */
+ override flash_proxy function hasProperty(name:*):Boolean
+ {
+ if (name in cache)
+ return true;
+
+ var value:* = DescribeTypeCache.extractValue(name, this);
+
+ if (value === undefined)
+ return false;
+
+ cache[name] = value;
+
+ return true;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..fd7e58d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/GraphicsUtil.as
@@ -0,0 +1,298 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.display.Graphics;
+
+/**
+ * The Graphics class is an all-static class with utility methods
+ * related to the Graphics class.
+ * You do not create instances of GraphicsUtil;
+ * instead you simply call methods such as the
+ * <code>GraphicsUtil.drawRoundRectComplex()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class GraphicsUtil
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Draws a rounded rectangle using the size of a radius to draw the rounded corners.
+ * You must set the line style, fill, or both
+ * on the Graphics object before
+ * you call the <code>drawRoundRectComplex()</code> method
+ * by calling the <code>linestyle()</code>,
+ * <code>lineGradientStyle()</code>, <code>beginFill()</code>,
+ * <code>beginGradientFill()</code>, or
+ * <code>beginBitmapFill()</code> method.
+ *
+ * @param graphics The Graphics object that draws the rounded rectangle.
+ *
+ * @param x The horizontal position relative to the
+ * registration point of the parent display object, in pixels.
+ *
+ * @param y The vertical position relative to the
+ * registration point of the parent display object, in pixels.
+ *
+ * @param width The width of the round rectangle, in pixels.
+ *
+ * @param height The height of the round rectangle, in pixels.
+ *
+ * @param topLeftRadius The radius of the upper-left corner, in pixels.
+ *
+ * @param topRightRadius The radius of the upper-right corner, in pixels.
+ *
+ * @param bottomLeftRadius The radius of the bottom-left corner, in pixels.
+ *
+ * @param bottomRightRadius The radius of the bottom-right corner, in pixels.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function drawRoundRectComplex(graphics:Graphics, x:Number, y:Number,
+ width:Number, height:Number,
+ topLeftRadius:Number, topRightRadius:Number,
+ bottomLeftRadius:Number, bottomRightRadius:Number):void
+ {
+ var xw:Number = x + width;
+ var yh:Number = y + height;
+
+ // Make sure none of the radius values are greater than w/h.
+ // These are all inlined to avoid function calling overhead
+ var minSize:Number = width < height ? width * 2 : height * 2;
+ topLeftRadius = topLeftRadius < minSize ? topLeftRadius : minSize;
+ topRightRadius = topRightRadius < minSize ? topRightRadius : minSize;
+ bottomLeftRadius = bottomLeftRadius < minSize ? bottomLeftRadius : minSize;
+ bottomRightRadius = bottomRightRadius < minSize ? bottomRightRadius : minSize;
+
+ // Math.sin and Math,tan values for optimal performance.
+ // Math.rad = Math.PI / 180 = 0.0174532925199433
+ // r * Math.sin(45 * Math.rad) = (r * 0.707106781186547);
+ // r * Math.tan(22.5 * Math.rad) = (r * 0.414213562373095);
+ //
+ // We can save further cycles by precalculating
+ // 1.0 - 0.707106781186547 = 0.292893218813453 and
+ // 1.0 - 0.414213562373095 = 0.585786437626905
+
+ // bottom-right corner
+ var a:Number = bottomRightRadius * 0.292893218813453; // radius - anchor pt;
+ var s:Number = bottomRightRadius * 0.585786437626905; // radius - control pt;
+ graphics.moveTo(xw, yh - bottomRightRadius);
+ graphics.curveTo(xw, yh - s, xw - a, yh - a);
+ graphics.curveTo(xw - s, yh, xw - bottomRightRadius, yh);
+
+ // bottom-left corner
+ a = bottomLeftRadius * 0.292893218813453;
+ s = bottomLeftRadius * 0.585786437626905;
+ graphics.lineTo(x + bottomLeftRadius, yh);
+ graphics.curveTo(x + s, yh, x + a, yh - a);
+ graphics.curveTo(x, yh - s, x, yh - bottomLeftRadius);
+
+ // top-left corner
+ a = topLeftRadius * 0.292893218813453;
+ s = topLeftRadius * 0.585786437626905;
+ graphics.lineTo(x, y + topLeftRadius);
+ graphics.curveTo(x, y + s, x + a, y + a);
+ graphics.curveTo(x + s, y, x + topLeftRadius, y);
+
+ // top-right corner
+ a = topRightRadius * 0.292893218813453;
+ s = topRightRadius * 0.585786437626905;
+ graphics.lineTo(xw - topRightRadius, y);
+ graphics.curveTo(xw - s, y, xw - a, y + a);
+ graphics.curveTo(xw, y + s, xw, y + topRightRadius);
+ graphics.lineTo(xw, yh - bottomRightRadius);
+ }
+
+ /**
+ * Draws a rounded rectangle using the size of individual x and y radii to
+ * draw the rounded corners.
+ * You must set the line style, fill, or both
+ * on the Graphics object before
+ * you call the <code>drawRoundRectComplex2()</code> method
+ * by calling the <code>linestyle()</code>,
+ * <code>lineGradientStyle()</code>, <code>beginFill()</code>,
+ * <code>beginGradientFill()</code>, or
+ * <code>beginBitmapFill()</code> method.
+ *
+ * @param graphics The Graphics object that draws the rounded rectangle.
+ *
+ * @param x The horizontal position relative to the
+ * registration point of the parent display object, in pixels.
+ *
+ * @param y The vertical position relative to the
+ * registration point of the parent display object, in pixels.
+ *
+ * @param width The width of the round rectangle, in pixels.
+ *
+ * @param height The height of the round rectangle, in pixels.
+ *
+ * @param radiusX The default radiusX to use, if corner-specific values are not specified.
+ * This value must be specified.
+ *
+ * @param radiusY The default radiusY to use, if corner-specific values are not specified.
+ * If 0, the value of radiusX is used.
+ *
+ * @param topLeftRadiusX The x radius of the upper-left corner, in pixels. If NaN,
+ * the value of radiusX is used.
+ *
+ * @param topLeftRadiusY The y radius of the upper-left corner, in pixels. If NaN,
+ * the value of topLeftRadiusX is used.
+ *
+ * @param topRightRadiusX The x radius of the upper-right corner, in pixels. If NaN,
+ * the value of radiusX is used.
+ *
+ * @param topRightRadiusY The y radius of the upper-right corner, in pixels. If NaN,
+ * the value of topRightRadiusX is used.
+ *
+ * @param bottomLeftRadiusX The x radius of the bottom-left corner, in pixels. If NaN,
+ * the value of radiusX is used.
+ *
+ * @param bottomLeftRadiusY The y radius of the bottom-left corner, in pixels. If NaN,
+ * the value of bottomLeftRadiusX is used.
+ *
+ * @param bottomRightRadiusX The x radius of the bottom-right corner, in pixels. If NaN,
+ * the value of radiusX is used.
+ *
+ * @param bottomRightRadiusY The y radius of the bottom-right corner, in pixels. If NaN,
+ * the value of bottomRightRadiusX is used.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static function drawRoundRectComplex2(graphics:Graphics, x:Number, y:Number,
+ width:Number, height:Number,
+ radiusX:Number, radiusY:Number,
+ topLeftRadiusX:Number, topLeftRadiusY:Number,
+ topRightRadiusX:Number, topRightRadiusY:Number,
+ bottomLeftRadiusX:Number, bottomLeftRadiusY:Number,
+ bottomRightRadiusX:Number, bottomRightRadiusY:Number):void
+ {
+ var xw:Number = x + width;
+ var yh:Number = y + height;
+ var maxXRadius:Number = width / 2;
+ var maxYRadius:Number = height / 2;
+
+ // Rules for determining radius for each corner:
+ // - If explicit nnnRadiusX value is set, use it. Otherwise use radiusX.
+ // - If explicit nnnRadiusY value is set, use it. Otherwise use corresponding nnnRadiusX.
+ if (radiusY == 0)
+ radiusY = radiusX;
+ if (isNaN(topLeftRadiusX))
+ topLeftRadiusX = radiusX;
+ if (isNaN(topLeftRadiusY))
+ topLeftRadiusY = topLeftRadiusX;
+ if (isNaN(topRightRadiusX))
+ topRightRadiusX = radiusX;
+ if (isNaN(topRightRadiusY))
+ topRightRadiusY = topRightRadiusX;
+ if (isNaN(bottomLeftRadiusX))
+ bottomLeftRadiusX = radiusX;
+ if (isNaN(bottomLeftRadiusY))
+ bottomLeftRadiusY = bottomLeftRadiusX;
+ if (isNaN(bottomRightRadiusX))
+ bottomRightRadiusX = radiusX;
+ if (isNaN(bottomRightRadiusY))
+ bottomRightRadiusY = bottomRightRadiusX;
+
+ // Pin radius values to half of the width/height
+ if (topLeftRadiusX > maxXRadius)
+ topLeftRadiusX = maxXRadius;
+ if (topLeftRadiusY > maxYRadius)
+ topLeftRadiusY = maxYRadius;
+ if (topRightRadiusX > maxXRadius)
+ topRightRadiusX = maxXRadius;
+ if (topRightRadiusY > maxYRadius)
+ topRightRadiusY = maxYRadius;
+ if (bottomLeftRadiusX > maxXRadius)
+ bottomLeftRadiusX = maxXRadius;
+ if (bottomLeftRadiusY > maxYRadius)
+ bottomLeftRadiusY = maxYRadius;
+ if (bottomRightRadiusX > maxXRadius)
+ bottomRightRadiusX = maxXRadius;
+ if (bottomRightRadiusY > maxYRadius)
+ bottomRightRadiusY = maxYRadius;
+
+ // Math.sin and Math,tan values for optimal performance.
+ // Math.rad = Math.PI / 180 = 0.0174532925199433
+ // r * Math.sin(45 * Math.rad) = (r * 0.707106781186547);
+ // r * Math.tan(22.5 * Math.rad) = (r * 0.414213562373095);
+ //
+ // We can save further cycles by precalculating
+ // 1.0 - 0.707106781186547 = 0.292893218813453 and
+ // 1.0 - 0.414213562373095 = 0.585786437626905
+
+ // bottom-right corner
+ var aX:Number = bottomRightRadiusX * 0.292893218813453; // radius - anchor pt;
+ var aY:Number = bottomRightRadiusY * 0.292893218813453; // radius - anchor pt;
+ var sX:Number = bottomRightRadiusX * 0.585786437626905; // radius - control pt;
+ var sY:Number = bottomRightRadiusY * 0.585786437626905; // radius - control pt;
+ graphics.moveTo(xw, yh - bottomRightRadiusY);
+ graphics.curveTo(xw, yh - sY, xw - aX, yh - aY);
+ graphics.curveTo(xw - sX, yh, xw - bottomRightRadiusX, yh);
+
+ // bottom-left corner
+ aX = bottomLeftRadiusX * 0.292893218813453;
+ aY = bottomLeftRadiusY * 0.292893218813453;
+ sX = bottomLeftRadiusX * 0.585786437626905;
+ sY = bottomLeftRadiusY * 0.585786437626905;
+ graphics.lineTo(x + bottomLeftRadiusX, yh);
+ graphics.curveTo(x + sX, yh, x + aX, yh - aY);
+ graphics.curveTo(x, yh - sY, x, yh - bottomLeftRadiusY);
+
+ // top-left corner
+ aX = topLeftRadiusX * 0.292893218813453;
+ aY = topLeftRadiusY * 0.292893218813453;
+ sX = topLeftRadiusX * 0.585786437626905;
+ sY = topLeftRadiusY * 0.585786437626905;
+ graphics.lineTo(x, y + topLeftRadiusY);
+ graphics.curveTo(x, y + sY, x + aX, y + aY);
+ graphics.curveTo(x + sX, y, x + topLeftRadiusX, y);
+
+ // top-right corner
+ aX = topRightRadiusX * 0.292893218813453;
+ aY = topRightRadiusY * 0.292893218813453;
+ sX = topRightRadiusX * 0.585786437626905;
+ sY = topRightRadiusY * 0.585786437626905;
+ graphics.lineTo(xw - topRightRadiusX, y);
+ graphics.curveTo(xw - sX, y, xw - aX, y + aY);
+ graphics.curveTo(xw, y + sY, xw, y + topRightRadiusY);
+ graphics.lineTo(xw, yh - bottomRightRadiusY);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/IXMLNotifiable.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/IXMLNotifiable.as b/frameworks/projects/MX/src/main/flex/mx/utils/IXMLNotifiable.as
new file mode 100644
index 0000000..0ca48bc
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/IXMLNotifiable.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+/**
+ * The IXMLNotifiable interface.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IXMLNotifiable
+{
+ /**
+ * @private
+ */
+ function xmlNotification(currentTarget:Object,
+ type:String,
+ target:Object,
+ value:Object,
+ detail:Object):void;
+}
+
+}
\ No newline at end of file
[28/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/effects/IEffect.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/IEffect.as b/frameworks/projects/MX/src/main/flex/mx/effects/IEffect.as
new file mode 100644
index 0000000..792f9ad
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/IEffect.as
@@ -0,0 +1,717 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * The IEffect interface defines the base
+ * interface of all Flex effects.
+ * The IEffectInstance interface defines the base interface for all effect
+ * instance subclasses.
+ *
+ * @see mx.effects.IEffectInstance
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IEffect extends IAbstractEffect
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // className
+ //----------------------------------
+
+ /**
+ * The name of the effect class, such as <code>"Fade"</code>.
+ *
+ * <p>This is a short, or unqualified, class name
+ * that does not include the package name.
+ * If you need the qualified name, use the
+ * <code>getQualifiedClassName()</code> method
+ * in the flash.utils package.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get className():String;
+
+ //----------------------------------
+ // customFilter
+ //----------------------------------
+
+ /**
+ * Specifies a custom filter object, of type EffectTargetFilter,
+ * used by the effect to determine the targets
+ * on which to play the effect.
+ *
+ * <p>Target filtering is only performed if you call the
+ * <code>captureStartValues()</code> method before playing the effect.
+ * Flex automatically calls the <code>captureStartValues()</code> method
+ * when the effect is part of a transition.</p>
+ *
+ * <p>Use the <code>filter</code> property for simple filtering.
+ * If the <code>customFilter</code> property is non-null,
+ * the <code>filter</code> property is ignored.</p>
+ *
+ * @default null
+ *
+ * @see mx.effects.EffectTargetFilter
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get customFilter():EffectTargetFilter;
+
+ /**
+ * @private
+ */
+ function set customFilter(value:EffectTargetFilter):void;
+
+ //----------------------------------
+ // duration
+ //----------------------------------
+
+ /**
+ * Duration of the effect in milliseconds.
+ *
+ * <p>In a Parallel or Sequence effect, the <code>duration</code>
+ * property sets the duration of each effect.
+ * For example, if a Sequence effect has its <code>duration</code>
+ * property set to 3000, each effect in the Sequence takes 3000 ms
+ * to play.</p>
+ *
+ * <p>For a repeated effect, the <code>duration</code> property
+ * specifies the duration of a single instance of the effect.
+ * Therefore, if an effect has a <code>duration</code> property
+ * set to 2000, and a <code>repeatCount</code> property set to 3,
+ * the effect takes a total of 6000 ms (6 seconds) to play.</p>
+ *
+ * @default 500
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get duration():Number;
+
+ /**
+ * @private
+ */
+ function set duration(value:Number):void;
+
+ //----------------------------------
+ // effectTargetHost
+ //----------------------------------
+
+ /**
+ * A property that lets you access the target list-based control
+ * of a data effect.
+ * This property enables an instance of an effect class to communicate
+ * with the list-based control on which the effect is playing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get effectTargetHost():IEffectTargetHost;
+
+ /**
+ * @private
+ */
+ function set effectTargetHost(value:IEffectTargetHost):void;
+
+ //----------------------------------
+ // filter
+ //----------------------------------
+
+ /**
+ * Specifies an algorithm for filtering targets for an effect.
+ * A value of <code>null</code> specifies no filtering.
+ *
+ * <p>Target filtering is only performed if you call the
+ * <code>captureStartValues()</code> method before playing the effect.
+ * Flex automatically calls the <code>captureStartValues()</code> method
+ * when the effect is part of a transition, or part of a data effect
+ * for a list-based control.</p>
+ *
+ * <p>Use this property for simple filtering.
+ * Use the <code>customFilter</code> property for more complex filtering.
+ * If the <code>customFilter</code> property has a non-null value,
+ * this property is ignored.</p>
+ *
+ * <p>You can use the following values for the <code>filter</code>
+ * property:</p>
+ *
+ * <ul>
+ * <li>A value of <code>"add"</code> plays the effect on any targets
+ * that are added as a child to a container.</li>
+ * <li>A value of <code>"addItem"</code> plays the effect
+ * on the item renderer for any list items added to a List
+ * or TileList control.</li>
+ * <li>A value of <code>"hide"</code> plays the effect on any targets
+ * whose visible property changed from <code>true</code> to
+ * <code>false</code>.</li>
+ * <li>A value of <code>"move"</code> plays the effect on any targets
+ * that changed their <code>x</code> or <code>y</code>
+ * properties.</li>
+ * <li>A value of <code>"remove"</code> plays the effect on any targets
+ * that are removed as a child of a container.</li>
+ * <li>A value of <code>"removeItem"</code> plays the effect
+ * on the item renderer for any list items removed from a List
+ * or TileList control.</li>
+ * <li>A value of <code>"replacedItem"</code> plays the effect
+ * on the item renderer for any list items replaced in a List
+ * or TileList control by a new item.</li>
+ * <li>A value of <code>"replacementItem"</code> plays the effect
+ * on the item renderer for any list items added to a List
+ * or TileList control that replaces an existing item.</li>
+ * <li>A value of <code>"resize"</code> plays the effect
+ * on any targets that changed their <code>width</code>
+ * or <code>height</code> properties.</li>
+ * <li>A value of <code>"show"</code> plays the effect
+ * on any targets whose visible property changed
+ * from <code>false</code> to <code>true</code>.</li>
+ * <li>A value of <code>""</code> specifies no filtering.</li>
+ * </ul>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get filter():String;
+
+ /**
+ * @private
+ */
+ function set filter(value:String):void;
+
+ //----------------------------------
+ // hideFocusRing
+ //----------------------------------
+
+ /**
+ * Determines whether the effect should hide the focus ring
+ * when starting the effect.
+ * The effect target is responsible for the hiding the focus ring.
+ * Subclasses of the UIComponent class hide the focus ring automatically.
+ * If the effect target is not a subclass of the UIComponent class,
+ * add functionality to it to hide the focus ring.
+ *
+ * <p>Set this property to <code>true</code>
+ * to hide the focus ring during the effect.</p>
+ *
+ * <p>For subclasses of Effect, the default value is <code>false</code>.
+ * For subclasses of MaskEffect, the default value is <code>true</code>.
+ * </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get hideFocusRing():Boolean;
+
+ /**
+ * @private
+ */
+ function set hideFocusRing(value:Boolean):void;
+
+ //----------------------------------
+ // isPlaying
+ //----------------------------------
+
+ /**
+ * A read-only flag which is true if any instances of the effect
+ * are currently playing, and false if none are.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get isPlaying():Boolean;
+
+ //----------------------------------
+ // perElementOffset
+ //----------------------------------
+
+ /**
+ * Additional delay, in milliseconds, for effect targets
+ * after the first target of the effect.
+ * This value is added to the value
+ * of the <code>startDelay</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get perElementOffset():Number;
+
+ /**
+ * @private
+ */
+ function set perElementOffset(value:Number):void;
+
+ //----------------------------------
+ // relevantProperties
+ //----------------------------------
+
+ /**
+ * An Array of property names to use when performing filtering.
+ * This property is used internally and should not be set by
+ * effect users.
+ *
+ * <p>The default value is equal to the Array returned by
+ * the <code>getAffectedProperties()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get relevantProperties():Array /* of String */;
+
+ /**
+ * @private
+ */
+ function set relevantProperties(values:Array /* of String */):void;
+
+ //----------------------------------
+ // relevantStyles
+ //----------------------------------
+
+ /**
+ * An Array of style names to use when performing filtering.
+ * This property is used internally and should not be set by
+ * effect users.
+ *
+ * <p>The default value is equal to the Array returned by
+ * the <code>getAffectedProperties()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get relevantStyles():Array /* of String */;
+
+ /**
+ * @private
+ */
+ function set relevantStyles(values:Array /* of String */):void;
+
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ /**
+ * The object to which this effect is applied.
+ * When an effect is triggered by an effect trigger,
+ * the <code>target</code> property is automatically set to be
+ * the object that triggers the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get target():Object;
+
+ /**
+ * @private
+ */
+ function set target(value:Object):void;
+
+ //----------------------------------
+ // targets
+ //----------------------------------
+
+ /**
+ * An Array of objects that are targets for the effect.
+ * When the effect is playing, it performs the effect on each target
+ * in parallel.
+ * Setting the <code>target</code> property replaces all objects
+ * in this Array.
+ * When the <code>targets</code> property is set, the <code>target</code>
+ * property returns the first item in this Array.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get targets():Array;
+
+ /**
+ * @private
+ */
+ function set targets(value:Array):void;
+
+ //----------------------------------
+ // triggerEvent
+ //----------------------------------
+
+ /**
+ * The Event object passed to this Effect
+ * by the EffectManager when an effect is triggered,
+ * or <code>null</code> if the effect is not being
+ * played by the EffectManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get triggerEvent():Event;
+
+ /**
+ * @private
+ */
+ function set triggerEvent(value:Event):void;
+
+ //----------------------------------
+ // playheadTime
+ //----------------------------------
+
+ /**
+ * Current time position of the effect.
+ * This property has a value between 0 and the total duration,
+ * which includes the Effect's <code>startDelay</code>,
+ * <code>repeatCount</code>, and <code>repeatDelay</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get playheadTime():Number;
+
+ /**
+ * @private
+ */
+ function set playheadTime(value:Number):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns an Array of Strings, where each String is the name
+ * of a property changed by this effect.
+ * For example, the Move effect returns an Array that contains
+ * <code>"x"</code> and <code>"y"</code>.
+ *
+ * <p>Every subclass of Effect must implement this method.
+ * The EffectManager uses this method
+ * to ensure that no two effects are trying to animate
+ * the same property of the same object at the same time.</p>
+ *
+ * @return An Array of Strings specifying the names of the
+ * properties modified by this effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getAffectedProperties():Array /* of String */;
+
+ /**
+ * Takes an Array of target objects and invokes the
+ * <code>createInstance()</code> method on each target.
+ *
+ * @param targets Array of objects to animate with this effect.
+ *
+ * @return Array of effect instance objects, one per target,
+ * for the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function createInstances(targets:Array = null):Array /* of EffectInstance */;
+
+ /**
+ * Creates a single effect instance and initializes it.
+ * Use this method instead of the <code>play()</code> method
+ * to manipulate the effect instance properties
+ * before the effect instance plays.
+ *
+ * <p>The effect instance is created with the type
+ * specified in the <code>instanceClass</code> property.
+ * It is then initialized using the <code>initInstance()</code> method.
+ * If the instance was created by the EffectManager
+ * (when the effect is triggered by an effect trigger),
+ * the effect is further initialized by a call to the
+ * <code>EffectInstance.initEffect()</code> method.</p>
+ *
+ * <p>Calling the <code>createInstance()</code> method
+ * does not play the effect.
+ * Call the <code>startEffect()</code> method
+ * on the returned effect instance. </p>
+ *
+ * <p>This function is automatically called by the
+ * <code>Effect.play()</code> method. </p>
+ *
+ * @param target Object to animate with this effect.
+ *
+ * @return The effect instance object for the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function createInstance(target:Object = null):IEffectInstance;
+
+ /**
+ * Removes event listeners from an instance
+ * and removes it from the list of instances.
+ *
+ * @param instance The effect instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function deleteInstance(instance:IEffectInstance):void;
+
+ /**
+ * Begins playing the effect.
+ * You typically call the <code>end()</code> method
+ * before you call the <code>play()</code> method
+ * to ensure that any previous instance of the effect
+ * has ended before you start a new one.
+ *
+ * <p>All subclasses must implement this method.</p>
+ *
+ * @param targets Array of target objects on which to play this effect.
+ * If this parameter is specified, then the effect's <code>targets</code>
+ * property is not used.
+ *
+ * @param playReversedFromEnd If <code>true</code>,
+ * play the effect backwards.
+ *
+ * @return Array of EffectInstance objects, one per target,
+ * for the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function play(targets:Array = null,
+ playReversedFromEnd:Boolean = false):
+ Array /* of EffectInstance */;
+
+ /**
+ * Pauses the effect until you call the <code>resume()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function pause():void;
+
+ /**
+ * Stops the effect, leaving the effect targets in their current state.
+ * Unlike a call to the <code>pause()</code> method,
+ * you cannot call the <code>resume()</code> method after calling
+ * the <code>stop()</code> method.
+ * However, you can call the <code>play()</code> method to restart the effect.
+ *
+ * <p>The effect instance dispatches an <code>effectEnd</code> event
+ * when you call this method as part of ending the effect.</p>
+ *
+ * <p>For mask effects, the mask is not removed automatically
+ * when the effect is stopped.
+ * Running further mask effects on the same target(s)
+ * without first removing the mask can produce unexpected results.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function stop():void;
+
+ /**
+ * Resumes the effect after it has been paused
+ * by a call to the <code>pause()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function resume():void;
+
+ /**
+ * Plays the effect in reverse, if the effect is currently playing,
+ * starting from the current position of the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function reverse():void;
+
+ /**
+ * Interrupts an effect that is currently playing,
+ * and jumps immediately to the end of the effect.
+ * Calling this method invokes the <code>EffectInstance.end()</code>
+ * method.
+ *
+ * <p>The effect instance dispatches an <code>effectEnd</code> event
+ * when you call this method as part of ending the effect.</p>
+ *
+ * <p>If you pass an effect instance as an argument,
+ * just that instance is interrupted.
+ * If no argument is passed in, all effect instances currently
+ * spawned from the effect are interrupted.</p>
+ *
+ * @param effectInstance EffectInstance to terminate.
+ *
+ * @see mx.effects.EffectInstance#end()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function end(effectInstance:IEffectInstance = null):void;
+
+ /**
+ * Captures the current values of the relevant properties
+ * on the effect's targets.
+ * Flex automatically calls the <code>captureStartValues()</code>
+ * method when the effect is part of a transition.
+ *
+ * <p>Use this function when you want the effect to figure out the start
+ * and end values of the effect.
+ * The proper usage of this function is to use it
+ * in the following steps:</p>
+ *
+ * <ol>
+ * <li>Call the <code>captureStartValues()</code> method.
+ * The effect captures the starting effect values.</li>
+ * <li>Make changes to your effect targets, such as
+ * adding/removing children, altering properties,
+ * changing location, or changing dimensions.</li>
+ * <li>Call the <code>play()</code> method.
+ * The effect captures the end values.
+ * This function populates the
+ * <code>EffectInstance.propertyChanges</code> property
+ * for each effect instance created by this effect.
+ * Effect developers can use the <code>propertyChanges</code> property
+ * to retrieve the start and end values for their effect.</li>
+ * </ol>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function captureStartValues():void;
+
+ /**
+ * Captures the current values of the relevant properties
+ * of an additional set of targets
+ *
+ * <p>Flex uses this function when a data change
+ * effect is run.</p>
+ *
+ * @param targets Array of targets for which values are captured
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function captureMoreStartValues(targets:Array):void;
+
+ /**
+ * Captures the current values of the relevant properties
+ * on the effect's targets and saves them as end values.
+ *
+ * <p>Flex automatically calls the <code>captureEndValues()</code> method
+ * when the effect is part of a data change effect.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function captureEndValues():void;
+
+ //----------------------------------
+ // suspendBackgroundProcessing
+ //----------------------------------
+
+ /**
+ * If <code>true</code>, blocks all background processing
+ * while the effect is playing.
+ * Background processing includes measurement, layout,
+ * and processing responses that have arrived from the server.
+ *
+ * @default false
+ * @see mx.effects.Effect#suspendBackgroundProcessing
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get suspendBackgroundProcessing():Boolean;
+
+ /**
+ * @private
+ */
+ function set suspendBackgroundProcessing(value:Boolean):void;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/effects/IEffectInstance.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/IEffectInstance.as b/frameworks/projects/MX/src/main/flex/mx/effects/IEffectInstance.as
new file mode 100644
index 0000000..ed6515b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/IEffectInstance.as
@@ -0,0 +1,585 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects
+{
+
+import org.apache.flex.events.Event;
+
+import mx.effects.effectClasses.PropertyChanges;
+
+/**
+ * The IEffectInstance interface represents an instance of an effect
+ * playing on a target.
+ * Each target has a separate effect instance associated with it.
+ * An effect instance's lifetime is transitory.
+ * An instance is created when the effect is played on a target
+ * and is destroyed when the effect has finished playing.
+ * If there are multiple effects playing on a target at the same time
+ * (for example, a Parallel effect), there is a separate effect instance
+ * for each effect.
+ *
+ * <p>Effect developers must create an instance class
+ * for their custom effects.</p>
+ *
+ * @see mx.effects.Effect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IEffectInstance
+{
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // className
+ //----------------------------------
+
+ /**
+ * The name of the effect class, such as <code>"FadeInstance"</code>.
+ *
+ * <p>This is a short or "unqualified" class name
+ * that does not include the package name.
+ * If you need the qualified name, use the
+ * <code>getQualifiedClassName()</code> method
+ * in the flash.utils package.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get className():String;
+
+ //----------------------------------
+ // duration
+ //----------------------------------
+
+ /**
+ * The duration of the effect, in milliseconds.
+ *
+ * @default 500
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get duration():Number;
+
+ /**
+ * @private
+ */
+ function set duration(value:Number):void;
+
+ //----------------------------------
+ // effect
+ //----------------------------------
+
+ /**
+ * The IEffect object that created this IEffectInstance object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get effect():IEffect;
+
+ /**
+ * @private
+ */
+ function set effect(value:IEffect):void;
+
+ //----------------------------------
+ // effectTargetHost
+ //----------------------------------
+
+ /**
+ * A property that lets you access the target
+ * list-based control of a data effect.
+ * This property enables an instance of an effect class
+ * to communicate with the list-based control
+ * on which the effect is playing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get effectTargetHost():IEffectTargetHost;
+
+ /**
+ * @private
+ */
+ function set effectTargetHost(value:IEffectTargetHost):void;
+
+ //----------------------------------
+ // eventHandler
+ //----------------------------------
+
+ /**
+ * The event handler used by the effect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get eventHandler():Function;
+
+ /**
+ * @private
+ */
+ function set eventHandler(value:Function):void;
+
+ //----------------------------------
+ // hideFocusRing
+ //----------------------------------
+
+ /**
+ * Determines whether the effect should hide
+ * the focus ring when starting the effect.
+ * The effect target is responsible for the hiding the focus ring.
+ * Subclasses of the UIComponent class hide the focus ring automatically.
+ * If the effect target is not a subclass of the UIComponent class,
+ * you must add functionality to it to hide the focus ring.
+ *
+ * <p>Set this property to <code>true</code>
+ * to hide the focus ring during the effect.</p>
+ *
+ * <p>For subclasses of Effect, the default value is <code>false</code>.
+ * For subclasses of MaskEffect, the default value is <code>true</code>.
+ * </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get hideFocusRing():Boolean;
+
+ /**
+ * @private
+ */
+ function set hideFocusRing(value:Boolean):void;
+
+ //----------------------------------
+ // hideOnEffectEnd
+ //----------------------------------
+
+ /**
+ * Determines whether the effect should hide
+ * when the effect ends.
+ * The effect target is responsible for the hiding the focus ring.
+ * Subclasses of the UIComponent class hide the focus ring automatically.
+ * If the effect target is not a subclass of the UIComponent class,
+ * you must add functionality to it to hide the focus ring.
+ *
+ * <p>Set this property to <code>true</code>
+ * to hide the focus ring during the effect.</p>
+ *
+ * <p>For subclasses of Effect, the default value is <code>false</code>.
+ * For subclasses of MaskEffect, the default value is <code>true</code>.
+ * </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get hideOnEffectEnd():Boolean;
+
+ /**
+ * @private
+ */
+ function set hideOnEffectEnd(value:Boolean):void;
+
+ //----------------------------------
+ // playheadTime
+ //----------------------------------
+
+ /**
+ * Current time position of the effect.
+ * This property has a value between 0 and the total duration,
+ * which includes the Effect's <code>startDelay</code>,
+ * <code>repeatCount</code>, and <code>repeatDelay</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get playheadTime():Number;
+
+ /**
+ * @private
+ */
+ function set playheadTime(value:Number):void;
+
+ //----------------------------------
+ // propertyChanges
+ //----------------------------------
+
+ /**
+ * Specifies the PropertyChanges object containing
+ * the start and end values for the set of properties
+ * relevant to the effect's targets.
+ * This property is only set if the
+ * <code>captureStartValues()</code> method was called
+ * on the effect that created this effect instance.
+ *
+ * <p>You often use the <code>propertyChanges</code> property
+ * to create an effect that is used as part of a transition.
+ * Flex automatically calls the <code>captureStartValues()</code>
+ * method when it starts a transition.
+ * Within your override of the <code>Effectinstance.play()</code>
+ * method, you can examine the information within the
+ * <code>propertyChanges()</code> method to initialize
+ * the start and end values of the effect.</p>
+ *
+ * @see mx.effects.effectClasses.PropertyChanges
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get propertyChanges():PropertyChanges;
+
+ /**
+ * @private
+ */
+ function set propertyChanges(value:PropertyChanges):void;
+
+ //----------------------------------
+ // repeatCount
+ //----------------------------------
+
+ /**
+ * Number of times to repeat the effect.
+ * Possible values are any integer greater than or equal to 0.
+ *
+ * @default 1
+ * @see mx.effects.Effect#repeatCount
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get repeatCount():int;
+
+ /**
+ * @private
+ */
+ function set repeatCount(value:int):void;
+
+ //----------------------------------
+ // repeatDelay
+ //----------------------------------
+
+ /**
+ * Amount of time, in milliseconds,
+ * to wait before repeating the effect.
+ *
+ * @default 0
+ * @see mx.effects.Effect#repeatDelay
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get repeatDelay():int;
+
+ /**
+ * @private
+ */
+ function set repeatDelay(value:int):void;
+
+ //----------------------------------
+ // startDelay
+ //----------------------------------
+
+ /**
+ * Amount of time, in milliseconds,
+ * to wait before starting the effect.
+ * Possible values are any int greater than or equal to 0.
+ * If the effect is repeated by using the <code>repeatCount</code>
+ * property, the <code>startDelay</code> property is applied
+ * only the first time the effect is played.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get startDelay():int;
+
+ /**
+ * @private
+ */
+ function set startDelay(value:int):void;
+
+ //----------------------------------
+ // suspendBackgroundProcessing
+ //----------------------------------
+
+ /**
+ * If <code>true</code>, blocks all background processing
+ * while the effect is playing.
+ * Background processing includes measurement, layout,
+ * and processing responses that have arrived from the server.
+ *
+ * @default false
+ * @see mx.effects.Effect#suspendBackgroundProcessing
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get suspendBackgroundProcessing():Boolean;
+
+ /**
+ * @private
+ */
+ function set suspendBackgroundProcessing(value:Boolean):void;
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ /**
+ * The UIComponent object to which this effect is applied.
+ *
+ * @see mx.effects.Effect#target
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get target():Object;
+
+ /**
+ * @private
+ */
+ function set target(value:Object):void;
+
+ //----------------------------------
+ // triggerEvent
+ //----------------------------------
+
+ /**
+ * The event, if any, which triggered the playing of the effect.
+ * This property is useful when an effect is assigned to
+ * multiple triggering events.
+ *
+ * <p>If the effect was played programmatically by a call to the
+ * <code>play()</code> method, rather than being triggered by an event,
+ * this property is <code>null</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get triggerEvent():Event;
+
+ /**
+ * @private
+ */
+ function set triggerEvent(value:Event):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * This method is called if the effect was triggered by the EffectManager.
+ * This base class version saves the event that triggered the effect
+ * in the <code>triggerEvent</code> property.
+ * Each subclass should override this method.
+ *
+ * @param event The Event object that was dispatched
+ * to trigger the effect.
+ * For example, if the trigger was a mouseDownEffect, the event
+ * would be a MouseEvent with type equal to MouseEvent.MOUSEDOWN.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function initEffect(event:Event):void;
+
+ /**
+ * Plays the effect instance on the target after the
+ * <code>startDelay</code> period has elapsed.
+ * Called by the Effect class.
+ * Use this function instead of the <code>play()</code> method
+ * when starting an EffectInstance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function startEffect():void;
+
+ /**
+ * Plays the effect instance on the target.
+ * Call the <code>startEffect()</code> method instead
+ * to make an effect start playing on an EffectInstance.
+ *
+ * <p>In a subclass of EffectInstance, you must override this method.
+ * The override must call the <code>super.play()</code> method
+ * so that an <code>effectStart</code> event is dispatched
+ * from the target.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function play():void;
+
+ /**
+ * Pauses the effect until you call the <code>resume()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function pause():void;
+
+ /**
+ * Stops the effect, leaving the target in its current state.
+ * This method is invoked by a call
+ * to the <code>Effect.stop()</code> method.
+ * As part of its implementation, it calls
+ * the <code>finishEffect()</code> method.
+ *
+ * <p>The effect instance dispatches an <code>effectEnd</code> event
+ * when you call this method as part of ending the effect.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function stop():void;
+
+ /**
+ * Resumes the effect after it has been paused
+ * by a call to the <code>pause()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function resume():void;
+
+ /**
+ * Plays the effect in reverse, starting from
+ * the current position of the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function reverse():void;
+
+ /**
+ * Interrupts an effect instance that is currently playing,
+ * and jumps immediately to the end of the effect.
+ * This method is invoked by a call
+ * to the <code>Effect.end()</code> method.
+ * As part of its implementation, it calls
+ * the <code>finishEffect()</code> method.
+ *
+ * <p>The effect instance dispatches an <code>effectEnd</code> event
+ * when you call this method as part of ending the effect.</p>
+ *
+ * <p>In a subclass of EffectInstance,
+ * you can optionally override this method
+ * As part of your override, you should call
+ * the <code>super.end()</code> method
+ * from the end of your override, after your logic.</p>
+ *
+ * @see mx.effects.Effect#end()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function end():void;
+
+ /**
+ * Called by the <code>end()</code> method when the effect
+ * finishes playing.
+ * This function dispatches an <code>endEffect</code> event
+ * for the effect target.
+ *
+ * <p>You do not have to override this method in a subclass.
+ * You do not need to call this method when using effects,
+ * but you may need to call it if you create an effect subclass.</p>
+ *
+ * @see mx.events.EffectEvent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function finishEffect():void;
+
+ /**
+ * Called after each iteration of a repeated effect finishes playing.
+ *
+ * <p>You do not have to override this method in a subclass.
+ * You do not need to call this method when using effects.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function finishRepeat():void;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/effects/IEffectTargetHost.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/IEffectTargetHost.as b/frameworks/projects/MX/src/main/flex/mx/effects/IEffectTargetHost.as
new file mode 100644
index 0000000..754bc1d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/IEffectTargetHost.as
@@ -0,0 +1,123 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects
+{
+
+/**
+ * The IEffectTargetHost interface defines the interface that lets you access the
+ * target list-based control of a data effect.
+ * All list-based controls implement this interface.
+ * This interface enables an instance of an effect class to communicate with the
+ * list-based control on which the effect is playing.
+ * This interface is also used for determining whether to play an effect based on if a data item is
+ * added, removed, or replaced in the target control.
+ *
+ * @see mx.controls.listClasses.ListBase
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IEffectTargetHost
+{
+
+ /**
+ * Called by an <code>UnconstrainItemAction</code> effect
+ * as part of a data change effect if the item renderers corresponding
+ * to certain data items need to move outside the normal positions
+ * of item renderers in the control.
+ * The control does not attempt to position the item render for the
+ * duration of the effect.
+ *
+ * @param item The item renderer that is a target of the effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function unconstrainRenderer(item:Object):void;
+
+ /**
+ * Removes an item renderer if a data change effect is running.
+ * The item renderer must correspond to data that has already
+ * been removed from the data provider collection.
+ *
+ * This function will be called by a <code>RemoveItemAction</code>
+ * effect as part of a data change effect to specify the point
+ * at which a data item ceases to displayed by the control using
+ * an item renderer.
+ *
+ * @param item The item renderer to remove from the control's layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function removeDataEffectItem(target:Object):void;
+
+ /**
+ * Adds an item renderer if a data change effect is running.
+ * The item renderer should correspond to a recently added
+ * data item in the data provider's collection that isn't
+ * yet being displayed.
+ *
+ * <p>This function will be called by an <code>AddItemAction</code>
+ * effect as part of a data change effect to specify the point
+ * at which a data item added to a collection begins to be displayed
+ * by the control using an item renderer.</p>
+ *
+ * @param item The item renderer to add to the control's layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function addDataEffectItem(target:Object):void;
+
+ /**
+ * Returns <code>true</code> or <code>false</code>
+ * to indicates whether the effect should play on the target.
+ * The EffectTargetFilter class calls this method when you set
+ * the <code>filter</code> property on a data effect.
+ * For example, you set <code>filter</code> property
+ * to <code>addItem</code> or <code>removeItem</code>.
+ *
+ * @param target An item renderer
+ *
+ * @param semanticProperty The semantic property of the renderer
+ * whose value will be returned.
+ *
+ * @return <code>true</code> or <code>false</code>
+ * to indicates whether the effect should play on the target.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getRendererSemanticValue(target:Object,semanticProperty:String):Object;
+
+}
+
+}
\ 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/effects/effectClasses/PropertyChanges.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/effectClasses/PropertyChanges.as b/frameworks/projects/MX/src/main/flex/mx/effects/effectClasses/PropertyChanges.as
new file mode 100644
index 0000000..0ad49cd
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/effectClasses/PropertyChanges.as
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.effects.effectClasses
+{
+
+/**
+ * The PropertyChanges class defines the start and end values
+ * for a set of properties of a target component of a transition.
+ * The <code>start</code> and <code>end</code> fields
+ * of the PropertyChanges class contain the same set of properties,
+ * but with different values.
+ *
+ * <p>Target properties that have the same start and end values
+ * are not included in the <code>start</code> and <code>end</code> fields.</p>
+ *
+ * @see mx.states.Transition
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class PropertyChanges
+{
+ include "../../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The PropertyChanges constructor.
+ *
+ * @param target Object that is a target of an effect.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function PropertyChanges(target:Object)
+ {
+ super();
+
+ this.target = target;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // end
+ //----------------------------------
+
+ /**
+ * An Object containing the ending properties of the <code>target</code>
+ * component modified by the change in view state.
+ *
+ * <p>For example, for a <code>target</code> component that is both
+ * moved and resized by a change to the view state, <code>end</code>
+ * contains the ending position and size of the component,
+ * as the following example shows:
+ * <pre>{ x: 100, y: 100, width: 200, height: 200 }</pre></p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var end:Object = {};
+
+ //----------------------------------
+ // start
+ //----------------------------------
+
+ /**
+ * An Object containing the starting properties of the <code>target</code>
+ * component modified by the change in view state.
+ *
+ * <p>For example, for a <code>target</code> component that is both
+ * moved and resized by a change to the view state, <code>start</code>
+ * contains the starting position and size of the component,
+ * as the following example shows:
+ * <pre>{ x: 0, y: 0, width: 100, height: 100}</pre></p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var start:Object = {};
+
+ //----------------------------------
+ // target
+ //----------------------------------
+
+ /**
+ * A target component of a transition.
+ * The <code>start</code> and <code>end</code> fields
+ * of the PropertyChanges object define how the target component
+ * is modified by the change to the view state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var target:Object;
+
+ // TODO (chaase): This flag is currently used by the transform-related
+ // effects. We should investigate whether we really need it, or can get
+ // by without it
+ /**
+ * This flag controls whether values that are the same in the
+ * start and end states are stripped from those objects.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var stripUnchangedValues:Boolean = true;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..488cab4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/ChildExistenceChangedEvent.as
@@ -0,0 +1,213 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+}
+import org.apache.flex.events.Event;
+
+/**
+ * Represents events that are dispatched when a the child of a control
+ * is created or destroyed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ChildExistenceChangedEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>ChildExistenceChangedEvent.CHILD_ADD</code> constant
+ * defines the value of the <code>type</code> property of the event
+ * object for a <code>childAdd</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>relatedObject</code></td><td>Contains a reference
+ * to the child object that was created.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType childAdd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CHILD_ADD:String = "childAdd";
+
+ /**
+ * The <code>ChildExistenceChangedEvent.CHILD_REMOVE</code> constant
+ * defines the value of the <code>type</code> property of the event
+ * object for a <code>childRemove</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>relatedObject</code></td><td>Contains a reference
+ * to the child object that is about to be removed.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType childRemove
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const CHILD_REMOVE:String = "childRemove";
+
+ /**
+ * The <code>ChildExistenceChangedEvent.OVERLAY_CREATED</code> constant
+ * defines the value of the <code>type</code> property of the event object
+ * for a <code>overlayCreated</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>relatedObject</code></td><td>Contains a reference
+ * to the child object whose overlay was created.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType overlayCreated
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const OVERLAY_CREATED:String = "overlayCreated";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior associated with the event can be prevented.
+ *
+ * @param relatedObject Reference to the child object that was created or destroyed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ChildExistenceChangedEvent(
+ type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ relatedObject:DisplayObject = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.relatedObject = relatedObject;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // relatedObject
+ //----------------------------------
+
+ /**
+ * Reference to the child object that was created or destroyed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var relatedObject:DisplayObject;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new ChildExistenceChangedEvent(type, bubbles, cancelable,
+ relatedObject);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/DynamicEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/DynamicEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/DynamicEvent.as
new file mode 100644
index 0000000..7fa4a56
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/DynamicEvent.as
@@ -0,0 +1,109 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+
+/**
+ * This subclass of Event is dynamic, meaning that you can set
+ * arbitrary event properties on its instances at runtime.
+ *
+ * <p>By contrast, Event and its other subclasses are non-dynamic,
+ * meaning that you can only set properties that are declared
+ * in those classes.
+ * When prototyping an application, using a DynamicEvent can be
+ * easier because you don't have to write an Event subclass
+ * to declare the properties in advance.
+ * However, you should eventually eliminate your DynamicEvents
+ * and write Event subclasses because these are faster and safer.
+ * A DynamicEvent is so flexible that the compiler can't help you
+ * catch your error when you set the wrong property or assign it
+ * a value of an incorrect type.</p>
+ *
+ * <p>Example:</p>
+ *
+ * <pre>
+ * var event:DynamicEvent = new DynamicEvent("credentialsChanged");
+ * event.name = name;
+ * event.passsword = password; // misspelling won't be caught!
+ * dispatchEvent(event);
+ * </pre>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public dynamic class DynamicEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up
+ * the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior
+ * associated with the event can be prevented.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function DynamicEvent(type:String, bubbles:Boolean = false,
+ cancelable:Boolean = false)
+ {
+ super(type, bubbles, cancelable);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ var event:DynamicEvent = new DynamicEvent(type, bubbles, cancelable);
+
+ for (var p:String in this)
+ {
+ event[p] = this[p];
+ }
+
+ return event;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/EffectEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/EffectEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/EffectEvent.as
new file mode 100644
index 0000000..213a73f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/EffectEvent.as
@@ -0,0 +1,288 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+
+import org.apache.flex.events.Event;
+import mx.effects.IEffectInstance;
+
+/**
+ * Represents event objects that are specific to Flex effects.
+ * Flex effects dispatch the following types of events:
+ * <ul>
+ * <li><code>effectStart</code></li>
+ * <li><code>effectStop</code></li>
+ * <li><code>effectRepeat</code></li>
+ * <li><code>effectEnd</code></li>
+ * <li><code>effectRepeat</code></li>
+ * </ul>
+ *
+ * @see mx.effects.Effect
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class EffectEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>EffectEvent.EFFECT_END</code> constant defines the value of the
+ * <code>type</code> property of the event object for an
+ * <code>effectEnd</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>effectInstance</code></td><td>The effect instance object
+ * for the event.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.effects.Effect
+ *
+ * @eventType effectEnd
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EFFECT_END:String = "effectEnd";
+
+ /**
+ * The <code>EffectEvent.EFFECT_STOP</code> constant defines the value of the
+ * <code>type</code> property of the event object for an
+ * <code>effectStop</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>effectInstance</code></td><td>The effect instance object
+ * for the event.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.effects.Effect
+ *
+ * @eventType effectStop
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EFFECT_STOP:String = "effectStop";
+
+ /**
+ * The <code>EffectEvent.EFFECT_START</code> constant defines the value of the
+ * <code>type</code> property of the event object for an
+ * <code>effectStart</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>effectInstance</code></td><td>The effect instance object
+ * for the event.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.effects.Effect
+ *
+ * @eventType effectStart
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EFFECT_START:String = "effectStart";
+
+ /**
+ * The <code>EffectEvent.EFFECT_REPEAT</code> constant defines the value of the
+ * <code>type</code> property of the event object for an
+ * <code>effectRepeat</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>effectInstance</code></td><td>The effect instance object
+ * for the event.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.effects.Effect
+ *
+ * @eventType effectRepeat
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EFFECT_REPEAT:String = "effectRepeat";
+
+ /**
+ * The <code>EffectEvent.EFFECT_UPDATE</code> constant defines the value of the
+ * <code>type</code> property of the event object for an
+ * <code>effectUpdate</code> event.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>effectInstance</code></td><td>The effect instance object
+ * for the event.</td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @see mx.effects.Effect
+ *
+ * @eventType effectUpdate
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EFFECT_UPDATE:String = "effectUpdate";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param eventType The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up the
+ * display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior associated with the event can be prevented.
+ *
+ * @param effectInstance The effect instance that triggered the event.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function EffectEvent(eventType:String, bubbles:Boolean = false,
+ cancelable:Boolean = false,
+ effectInstance:IEffectInstance = null)
+ {
+ super(eventType, bubbles, cancelable);
+
+ this.effectInstance = effectInstance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // effectInstance
+ //----------------------------------
+
+ /**
+ * The effect instance object for the event.
+ * You can use this property to access the properties of the effect
+ * instance object from within your event listener.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var effectInstance:IEffectInstance;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new EffectEvent(type, bubbles, cancelable, effectInstance);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/events/FlexChangeEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/events/FlexChangeEvent.as b/frameworks/projects/MX/src/main/flex/mx/events/FlexChangeEvent.as
new file mode 100644
index 0000000..ba77342
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/events/FlexChangeEvent.as
@@ -0,0 +1,187 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.events
+{
+import org.apache.flex.events.Event;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * The FlexChangeEvent class represents the event object passed to
+ * an event listener for Flex events that have data associated with
+ * some change in Flex. The <code>data</code> property provides
+ * additional information about the event.
+ *
+ */
+public class FlexChangeEvent extends Event
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The <code>FlexChangeEvent.ADD_CHILD_BRIDGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>addChildBridge</code> event.
+ *
+ * This event is dispatch by a SystemManager after a child SWFBridge has been added. This
+ * event's <code>data</code> property is a reference to the added SWFBridge.
+ *
+ * added to the SystemManager.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType addChildBridge
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ADD_CHILD_BRIDGE:String = "addChildBridge";
+
+ /**
+ * The <code>FlexChangeEvent.REMOVE_CHILD_BRIDGE</code> constant defines the value of the
+ * <code>type</code> property of the event object for an <code>removeChildBridge</code> event.
+ *
+ * This event is dispatch by a SystemManager just before a child SWFBridge is removed. This
+ * event's <code>data</code> property is a reference to the removed SWFBridge.
+ *
+ * <p>The properties of the event object have the following values:</p>
+ * <table class="innertable">
+ * <tr><th>Property</th><th>Value</th></tr>
+ * <tr><td><code>bubbles</code></td><td>false</td></tr>
+ * <tr><td><code>cancelable</code></td><td>false</td></tr>
+ * <tr><td><code>currentTarget</code></td><td>The Object that defines the
+ * event listener that handles the event. For example, if you use
+ * <code>myButton.addEventListener()</code> to register an event listener,
+ * myButton is the value of the <code>currentTarget</code>. </td></tr>
+ * <tr><td><code>target</code></td><td>The Object that dispatched the event;
+ * it is not always the Object listening for the event.
+ * Use the <code>currentTarget</code> property to always access the
+ * Object listening for the event.</td></tr>
+ * </table>
+ *
+ * @eventType removeChildBridge
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const REMOVE_CHILD_BRIDGE:String = "removeChildBridge";
+
+ /**
+ * @private
+ *
+ * Dispatched by a StyleManager when a style property is changed.
+ *
+ * The data parameter is an object that describes what changed:
+ *
+ * "property" - This property describes what kind of style manager
+ * property changed.
+ * If the "property" property is "inheritingStyles" then the
+ * StyleManager's inheritingStyles property was updated.
+ *
+ */
+ public static const STYLE_MANAGER_CHANGE:String = "styleManagerChange";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param type The event type; indicates the action that caused the event.
+ *
+ * @param bubbles Specifies whether the event can bubble up the display list hierarchy.
+ *
+ * @param cancelable Specifies whether the behavior associated with the event can be prevented.
+ *
+ * @param data Data related to the event.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function FlexChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, data:Object = null)
+ {
+ super(type, bubbles, cancelable);
+
+ this.data = data;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // data
+ //----------------------------------
+
+ /**
+ * Data related to the event. For more information on this object, see each event type.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var data:Object;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: Event
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override public function cloneEvent():Event
+ {
+ return new FlexChangeEvent(type, bubbles, cancelable, data);
+ }
+
+}
+}
\ No newline at end of file
[09/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
new file mode 100644
index 0000000..fba73e5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
@@ -0,0 +1,1640 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+COMPILE::AS3
+{
+ import flash.utils.ByteArray;
+ import flash.utils.Dictionary;
+ import flash.utils.getQualifiedClassName;
+ import flash.xml.XMLNode;
+}
+
+import mx.collections.IList;
+
+/**
+ * The ObjectUtil class is an all-static class with methods for
+ * working with Objects within Flex.
+ * You do not create instances of ObjectUtil;
+ * instead you simply call static methods such as the
+ * <code>ObjectUtil.isSimple()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ObjectUtil
+{
+ include "../core/Version.as";
+
+ /**
+ * Array of properties to exclude from debugging output.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static var defaultToStringExcludes:Array = ["password", "credentials"];
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Compares the Objects and returns an integer value
+ * indicating if the first item is less than greater than or equal to
+ * the second item.
+ * This method will recursively compare properties on nested objects and
+ * will return as soon as a non-zero result is found.
+ * By default this method will recurse to the deepest level of any property.
+ * To change the depth for comparison specify a non-negative value for
+ * the <code>depth</code> parameter.
+ *
+ * @param a Object.
+ *
+ * @param b Object.
+ *
+ * @param depth Indicates how many levels should be
+ * recursed when performing the comparison.
+ * Set this value to 0 for a shallow comparison of only the primitive
+ * representation of each property.
+ * For example:<pre>
+ * var a:Object = {name:"Bob", info:[1,2,3]};
+ * var b:Object = {name:"Alice", info:[5,6,7]};
+ * var c:int = ObjectUtil.compare(a, b, 0);</pre>
+ *
+ * <p>In the above example the complex properties of <code>a</code> and
+ * <code>b</code> will be flattened by a call to <code>toString()</code>
+ * when doing the comparison.
+ * In this case the <code>info</code> property will be turned into a string
+ * when performing the comparison.</p>
+ *
+ * @return Return 0 if a and b are null, NaN, or equal.
+ * Return 1 if a is null or greater than b.
+ * Return -1 if b is null or greater than a.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function compare(a:Object, b:Object, depth:int = -1):int
+ {
+ return internalCompare(a, b, 0, depth, new CircularReferenceManager());
+ }
+
+ /**
+ * Copies the specified Object and returns a reference to the copy.
+ * The copy is made using a native serialization technique.
+ * This means that custom serialization will be respected during the copy.
+ *
+ * <p>This method is designed for copying data objects,
+ * such as elements of a collection. It is not intended for copying
+ * a UIComponent object, such as a TextInput control. If you want to create copies
+ * of specific UIComponent objects, you can create a subclass of the component and implement
+ * a <code>clone()</code> method, or other method to perform the copy.</p>
+ *
+ * @param value Object that should be copied.
+ *
+ * @return Copy of the specified Object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function copy(value:Object):Object
+ {
+ COMPILE::AS3
+ {
+ var buffer:ByteArray = new ByteArray();
+ buffer.writeObject(value);
+ buffer.position = 0;
+ var result:Object = buffer.readObject();
+ return result;
+ }
+ COMPILE::JS
+ {
+ return copyObject(value);
+ }
+ }
+
+ COMPILE::JS
+ private static function copyObject(value:*):*
+ {
+ var t:String = typeof(value);
+ if (t === "undefined")
+ return undefined;
+ else if (t === "boolean")
+ return value;
+ else if (t === "string")
+ return value;
+ else if (t === "function")
+ return value; // need to copy?
+ else if (t === null)
+ return null;
+
+ var newObj:Object;
+ if (value.constructor)
+ newObj = new value.constructor(); // what about required constuctor args?
+ else
+ newObj = {};
+ for (var p:String in value)
+ {
+ newObj[p] = copyObject(value[p]);
+ }
+ return newObj;
+ }
+
+ /**
+ * Clones the specified Object and returns a reference to the clone.
+ * The clone is made using a native serialization technique.
+ * This means that custom serialization will be respected during the
+ * cloning. clone() differs from copy() in that the uid property of
+ * each object instance is retained.
+ *
+ * <p>This method is designed for cloning data objects,
+ * such as elements of a collection. It is not intended for cloning
+ * a UIComponent object, such as a TextInput control. If you want to clone
+ * specific UIComponent objects, you can create a subclass of the component
+ * and implement a <code>clone()</code> method.</p>
+ *
+ * @param value Object that should be cloned.
+ *
+ * @return Clone of the specified Object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ public static function clone(value:Object):Object
+ {
+ var result:Object = copy(value);
+ cloneInternal(result, value);
+ return result;
+ }
+
+ /**
+ * Recursive helper used by the public clone method.
+ * @private
+ */
+ private static function cloneInternal(result:Object, value:Object):void
+ {
+ if (value && value.hasOwnProperty("uid"))
+ result.uid = value.uid;
+
+ var classInfo:Object = getClassInfo(value);
+ var v:Object;
+ for each (var p:* in classInfo.properties)
+ {
+ v = value[p];
+ if (v && v.hasOwnProperty("uid"))
+ cloneInternal(result[p], v);
+ }
+ }
+
+ /**
+ * Returns <code>true</code> if the object reference specified
+ * is a simple data type. The simple data types include the following:
+ * <ul>
+ * <li><code>String</code></li>
+ * <li><code>Number</code></li>
+ * <li><code>uint</code></li>
+ * <li><code>int</code></li>
+ * <li><code>Boolean</code></li>
+ * <li><code>Date</code></li>
+ * <li><code>Array</code></li>
+ * </ul>
+ *
+ * @param value Object inspected.
+ *
+ * @return <code>true</code> if the object specified
+ * is one of the types above; <code>false</code> otherwise.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isSimple(value:Object):Boolean
+ {
+ var objectType:String = typeof(value);
+ switch (objectType)
+ {
+ case "number":
+ case "string":
+ case "boolean":
+ {
+ return true;
+ }
+
+ case "object":
+ {
+ return (value is Date) || (value is Array);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Compares two numeric values.
+ *
+ * @param a First number.
+ *
+ * @param b Second number.
+ *
+ * @return 0 is both numbers are NaN.
+ * 1 if only <code>a</code> is a NaN.
+ * -1 if only <code>b</code> is a NaN.
+ * -1 if <code>a</code> is less than <code>b</code>.
+ * 1 if <code>a</code> is greater than <code>b</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function numericCompare(a:Number, b:Number):int
+ {
+ if (isNaN(a) && isNaN(b))
+ return 0;
+
+ if (isNaN(a))
+ return 1;
+
+ if (isNaN(b))
+ return -1;
+
+ if (a < b)
+ return -1;
+
+ if (a > b)
+ return 1;
+
+ return 0;
+ }
+
+ /**
+ * Compares two String values.
+ *
+ * @param a First String value.
+ *
+ * @param b Second String value.
+ *
+ * @param caseInsensitive Specifies to perform a case insensitive compare,
+ * <code>true</code>, or not, <code>false</code>.
+ *
+ * @return 0 is both Strings are null.
+ * 1 if only <code>a</code> is null.
+ * -1 if only <code>b</code> is null.
+ * -1 if <code>a</code> precedes <code>b</code>.
+ * 1 if <code>b</code> precedes <code>a</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function stringCompare(a:String, b:String,
+ caseInsensitive:Boolean = false):int
+ {
+ if (a == null && b == null)
+ return 0;
+
+ if (a == null)
+ return 1;
+
+ if (b == null)
+ return -1;
+
+ // Convert to lowercase if we are case insensitive.
+ if (caseInsensitive)
+ {
+ a = a.toLocaleLowerCase();
+ b = b.toLocaleLowerCase();
+ }
+
+ var result:int = a.localeCompare(b);
+
+ if (result < -1)
+ result = -1;
+ else if (result > 1)
+ result = 1;
+
+ return result;
+ }
+
+ /**
+ * Compares the two Date objects and returns an integer value
+ * indicating if the first Date object is before, equal to,
+ * or after the second item.
+ *
+ * @param a Date object.
+ *
+ * @param b Date object.
+ *
+ * @return 0 if <code>a</code> and <code>b</code> are equal
+ * (or both are <code>null</code>);
+ * -1 if <code>a</code> is before <code>b</code>
+ * (or <code>b</code> is <code>null</code>);
+ * 1 if <code>a</code> is after <code>b</code>
+ * (or <code>a</code> is <code>null</code>);
+ * 0 is both dates getTime's are NaN;
+ * 1 if only <code>a</code> getTime is a NaN;
+ * -1 if only <code>b</code> getTime is a NaN.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function dateCompare(a:Date, b:Date):int
+ {
+ if (a == null && b == null)
+ return 0;
+
+ if (a == null)
+ return 1;
+
+ if (b == null)
+ return -1;
+
+ var na:Number = a.getTime();
+ var nb:Number = b.getTime();
+
+ if (na < nb)
+ return -1;
+
+ if (na > nb)
+ return 1;
+
+ if (isNaN(na) && isNaN(nb))
+ return 0;
+
+ if (isNaN(na))
+ return 1;
+
+ if (isNaN(nb))
+ return -1;
+
+ return 0;
+ }
+
+ /**
+ * Pretty-prints the specified Object into a String.
+ * All properties will be in alpha ordering.
+ * Each object will be assigned an id during printing;
+ * this value will be displayed next to the object type token
+ * preceded by a '#', for example:
+ *
+ * <pre>
+ * (mx.messaging.messages::AsyncMessage)#2.</pre>
+ *
+ * <p>This id is used to indicate when a circular reference occurs.
+ * Properties of an object that are of the <code>Class</code> type will
+ * appear only as the assigned type.
+ * For example a custom definition like the following:</p>
+ *
+ * <pre>
+ * public class MyCustomClass {
+ * public var clazz:Class;
+ * }</pre>
+ *
+ * <p>With the <code>clazz</code> property assigned to <code>Date</code>
+ * will display as shown below:</p>
+ *
+ * <pre>
+ * (somepackage::MyCustomClass)#0
+ * clazz = (Date)</pre>
+ *
+ * @param value Object to be pretty printed.
+ *
+ * @param namespaceURIs Array of namespace URIs for properties
+ * that should be included in the output.
+ * By default only properties in the public namespace will be included in
+ * the output.
+ * To get all properties regardless of namespace pass an array with a
+ * single element of "*".
+ *
+ * @param exclude Array of the property names that should be
+ * excluded from the output.
+ * Use this to remove data from the formatted string.
+ *
+ * @return String containing the formatted version
+ * of the specified object.
+ *
+ * @example
+ * <pre>
+ * // example 1
+ * var obj:AsyncMessage = new AsyncMessage();
+ * obj.body = [];
+ * obj.body.push(new AsyncMessage());
+ * obj.headers["1"] = { name: "myName", num: 15.3};
+ * obj.headers["2"] = { name: "myName", num: 15.3};
+ * obj.headers["10"] = { name: "myName", num: 15.3};
+ * obj.headers["11"] = { name: "myName", num: 15.3};
+ * trace(ObjectUtil.toString(obj));
+ *
+ * // will output to flashlog.txt
+ * (mx.messaging.messages::AsyncMessage)#0
+ * body = (Array)#1
+ * [0] (mx.messaging.messages::AsyncMessage)#2
+ * body = (Object)#3
+ * clientId = (Null)
+ * correlationId = ""
+ * destination = ""
+ * headers = (Object)#4
+ * messageId = "378CE96A-68DB-BC1B-BCF7FFFFFFFFB525"
+ * sequenceId = (Null)
+ * sequencePosition = 0
+ * sequenceSize = 0
+ * timeToLive = 0
+ * timestamp = 0
+ * clientId = (Null)
+ * correlationId = ""
+ * destination = ""
+ * headers = (Object)#5
+ * 1 = (Object)#6
+ * name = "myName"
+ * num = 15.3
+ * 10 = (Object)#7
+ * name = "myName"
+ * num = 15.3
+ * 11 = (Object)#8
+ * name = "myName"
+ * num = 15.3
+ * 2 = (Object)#9
+ * name = "myName"
+ * num = 15.3
+ * messageId = "1D3E6E96-AC2D-BD11-6A39FFFFFFFF517E"
+ * sequenceId = (Null)
+ * sequencePosition = 0
+ * sequenceSize = 0
+ * timeToLive = 0
+ * timestamp = 0
+ *
+ * // example 2 with circular references
+ * obj = {};
+ * obj.prop1 = new Date();
+ * obj.prop2 = [];
+ * obj.prop2.push(15.2);
+ * obj.prop2.push("testing");
+ * obj.prop2.push(true);
+ * obj.prop3 = {};
+ * obj.prop3.circular = obj;
+ * obj.prop3.deeper = new ErrorMessage();
+ * obj.prop3.deeper.rootCause = obj.prop3.deeper;
+ * obj.prop3.deeper2 = {};
+ * obj.prop3.deeper2.deeperStill = {};
+ * obj.prop3.deeper2.deeperStill.yetDeeper = obj;
+ * trace(ObjectUtil.toString(obj));
+ *
+ * // will output to flashlog.txt
+ * (Object)#0
+ * prop1 = Tue Apr 26 13:59:17 GMT-0700 2005
+ * prop2 = (Array)#1
+ * [0] 15.2
+ * [1] "testing"
+ * [2] true
+ * prop3 = (Object)#2
+ * circular = (Object)#0
+ * deeper = (mx.messaging.messages::ErrorMessage)#3
+ * body = (Object)#4
+ * clientId = (Null)
+ * code = (Null)
+ * correlationId = ""
+ * destination = ""
+ * details = (Null)
+ * headers = (Object)#5
+ * level = (Null)
+ * message = (Null)
+ * messageId = "14039376-2BBA-0D0E-22A3FFFFFFFF140A"
+ * rootCause = (mx.messaging.messages::ErrorMessage)#3
+ * sequenceId = (Null)
+ * sequencePosition = 0
+ * sequenceSize = 0
+ * timeToLive = 0
+ * timestamp = 0
+ * deeper2 = (Object)#6
+ * deeperStill = (Object)#7
+ * yetDeeper = (Object)#0
+ *
+ * // example 3 with Dictionary
+ * var point:Point = new Point(100, 100);
+ * var point2:Point = new Point(100, 100);
+ * var obj:Dictionary = new Dictionary();
+ * obj[point] = "point";
+ * obj[point2] = "point2";
+ * obj["1"] = { name: "one", num: 1};
+ * obj["two"] = { name: "2", num: 2};
+ * obj[3] = 3;
+ * trace(ObjectUtil.toString(obj));
+ *
+ * // will output to flashlog.txt
+ * (flash.utils::Dictionary)#0
+ * {(flash.geom::Point)#1
+ * length = 141.4213562373095
+ * x = 100
+ * y = 100} = "point2"
+ * {(flash.geom::Point)#2
+ * length = 141.4213562373095
+ * x = 100
+ * y = 100} = "point"
+ * {1} = (Object)#3
+ * name = "one"
+ * num = 1
+ * {3} = 3
+ * {"two"} = (Object)#4
+ * name = "2"
+ * num = 2
+ *
+ * </pre>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function toString(value:Object,
+ namespaceURIs:Array = null,
+ exclude:Array = null):String
+ {
+ if (exclude == null)
+ {
+ exclude = defaultToStringExcludes;
+ }
+
+ refCount = 0;
+ return internalToString(value, 0, null, namespaceURIs, exclude);
+ }
+
+ /**
+ * This method cleans up all of the additional parameters that show up in AsDoc
+ * code hinting tools that developers shouldn't ever see.
+ * @private
+ */
+ private static function internalToString(value:Object,
+ indent:int = 0,
+ refs:CircularReferenceManager = null,
+ namespaceURIs:Array = null,
+ exclude:Array = null):String
+ {
+ var str:String;
+ var objectType:String = value == null ? "null" : typeof(value);
+ switch (objectType)
+ {
+ case "boolean":
+ case "number":
+ {
+ return value.toString();
+ }
+
+ case "string":
+ {
+ return "\"" + value.toString() + "\"";
+ }
+
+ case "object":
+ {
+ if (value is Date)
+ {
+ return value.toString();
+ }
+ else if (isXMLNode(value))
+ {
+ return value.toString();
+ }
+ else if (value is Class)
+ {
+ return "(" + getQualifiedClassName(value) + ")";
+ }
+ else
+ {
+ var classInfo:Object = getClassInfo(value, exclude,
+ { includeReadOnly: true, uris: namespaceURIs });
+
+ var properties:Array = classInfo.properties;
+
+ str = "(" + classInfo.name + ")";
+
+ // refs help us avoid circular reference infinite recursion.
+ // Each time an object is encoumtered it is pushed onto the
+ // refs stack so that we can determine if we have visited
+ // this object already.
+ if (refs == null)
+ refs = new CircularReferenceManager();
+
+ // Check to be sure we haven't processed this object before
+ // Dictionary has some bugs, so we want to work around them as best we can
+ try
+ {
+ var id:Object = refs[value];
+ if (id != null)
+ {
+ str += "#" + int(id);
+ return str;
+ }
+ }
+ catch (e:Error)
+ {
+ //Since we can't test for infinite loop, we simply return toString.
+ return String(value);
+ }
+
+ if (value != null)
+ {
+ str += "#" + refCount.toString();
+ refs[value] = refCount;
+ refCount++;
+ }
+
+ var isArray:Boolean = value is Array;
+ var isDict:Boolean;
+ COMPILE::AS3
+ {
+ isDict = value is Dictionary;
+ }
+ var prop:*;
+ indent += 2;
+
+ // Print all of the variable values.
+ for (var j:int = 0; j < properties.length; j++)
+ {
+ str = newline(str, indent);
+ prop = properties[j];
+
+ if (isArray)
+ str += "[";
+ else if (isDict)
+ str += "{";
+
+
+ if (isDict)
+ {
+ // in dictionaries, recurse on the key, because it can be a complex object
+ str += internalToString(prop, indent, refs,
+ namespaceURIs, exclude);
+ }
+ else
+ {
+ str += prop.toString();
+ }
+
+ if (isArray)
+ str += "] ";
+ else if (isDict)
+ str += "} = ";
+ else
+ str += " = ";
+
+ try
+ {
+ // print the value
+ str += internalToString(value[prop], indent, refs,
+ namespaceURIs, exclude);
+ }
+ catch(e:Error)
+ {
+ // value[prop] can cause an RTE
+ // for certain properties of certain objects.
+ // For example, accessing the properties
+ // actionScriptVersion
+ // childAllowsParent
+ // frameRate
+ // height
+ // loader
+ // parentAllowsChild
+ // sameDomain
+ // swfVersion
+ // width
+ // of a Stage's loaderInfo causes
+ // Error #2099: The loading object is not
+ // sufficiently loaded to provide this information
+ // In this case, we simply output ? for the value.
+ str += "?";
+ }
+ }
+ indent -= 2;
+ return str;
+ }
+ break;
+ }
+
+ case "xml":
+ {
+ return value.toXMLString();
+ }
+
+ default:
+ {
+ return "(" + objectType + ")";
+ }
+ }
+
+ return "(unknown)";
+ }
+
+ /**
+ * @private
+ * This method will append a newline and the specified number of spaces
+ * to the given string.
+ */
+ private static function newline(str:String, n:int = 0):String
+ {
+ var result:String = str;
+ result += "\n";
+
+ for (var i:int = 0; i < n; i++)
+ {
+ result += " ";
+ }
+ return result;
+ }
+
+ private static function internalCompare(a:Object, b:Object,
+ currentDepth:int, desiredDepth:int,
+ refs:CircularReferenceManager):int
+ {
+ if (a == null && b == null)
+ return 0;
+
+ if (a == null)
+ return 1;
+
+ if (b == null)
+ return -1;
+
+ if (a is ObjectProxy)
+ a = ObjectProxy(a).object_proxy::object;
+
+ if (b is ObjectProxy)
+ b = ObjectProxy(b).object_proxy::object;
+
+ var typeOfA:String = typeof(a);
+ var typeOfB:String = typeof(b);
+
+ var result:int = 0;
+
+ if (typeOfA == typeOfB)
+ {
+ switch(typeOfA)
+ {
+ case "boolean":
+ {
+ result = numericCompare(Number(a), Number(b));
+ break;
+ }
+
+ case "number":
+ {
+ result = numericCompare(a as Number, b as Number);
+ break;
+ }
+
+ case "string":
+ {
+ result = stringCompare(a as String, b as String);
+ break;
+ }
+
+ case "object":
+ {
+ var newDepth:int = desiredDepth > 0 ? desiredDepth -1 : desiredDepth;
+
+ // refs help us avoid circular reference infinite recursion.
+ var aRef:Object = getRef(a,refs);
+ var bRef:Object = getRef(b,refs);
+
+ if (aRef == bRef)
+ return 0;
+ // the cool thing about our dictionary is that if
+ // we've seen objects and determined that they are unequal, then
+ // we would've already exited out of this compare() call. So the
+ // only info in the dictionary are sets of equal items
+
+ // let's first define them as equal
+ // this stops an "infinite loop" problem where A.i = B and B.i = A
+ // if we later find that an object (one of the subobjects) is in fact unequal,
+ // then we will return false and quit out of everything. These refs are thrown away
+ // so it doesn't matter if it's correct.
+ refs[bRef] = aRef;
+
+ if (desiredDepth != -1 && (currentDepth > desiredDepth))
+ {
+ // once we try to go beyond the desired depth we should
+ // toString() our way out
+ result = stringCompare(a.toString(), b.toString());
+ }
+ else if ((a is Array) && (b is Array))
+ {
+ result = arrayCompare(a as Array, b as Array, currentDepth, desiredDepth, refs);
+ }
+ else if ((a is Date) && (b is Date))
+ {
+ result = dateCompare(a as Date, b as Date);
+ }
+ else if ((a is IList) && (b is IList))
+ {
+ result = listCompare(a as IList, b as IList, currentDepth, desiredDepth, refs);
+ }
+ else if (areBothByteArrays(a, b))
+ {
+ COMPILE::AS3
+ {
+ result = byteArrayCompare(a as ByteArray, b as ByteArray);
+ }
+ }
+ else if (getQualifiedClassName(a) == getQualifiedClassName(b))
+ {
+ var aProps:Array = getClassInfo(a).properties;
+ var bProps:Array;
+
+ // if the objects are dynamic they could have different
+ // # of properties and should be treated on that basis first
+ var isObjectDynamic:Boolean = isDynamicObject(a);
+
+ // if it's dynamic, check to see that they have all the same properties
+ if (isObjectDynamic)
+ {
+ bProps = getClassInfo(b).properties;
+ result = arrayCompare(aProps, bProps, currentDepth, newDepth, refs);
+ if (result != 0)
+ return result;
+ }
+
+ // now that we know we have the same properties, let's compare the values
+ var propName:QName;
+ var aProp:Object;
+ var bProp:Object;
+ for (var i:int = 0; i < aProps.length; i++)
+ {
+ propName = aProps[i];
+ aProp = a[propName];
+ bProp = b[propName];
+ result = internalCompare(aProp, bProp, currentDepth+1, newDepth, refs);
+ if (result != 0)
+ {
+ return result;
+ }
+ }
+ }
+ else
+ {
+ // We must be unequal, so return 1
+ return 1;
+ }
+ break;
+ }
+ }
+ }
+ else // be consistent with the order we return here
+ {
+ return stringCompare(typeOfA, typeOfB);
+ }
+
+ return result;
+ }
+
+ private static function isXMLNode(value:Object):Boolean
+ {
+ COMPILE::AS3
+ {
+ return (value is XMLNode);
+ }
+ COMPILE::JS
+ {
+ return false;
+ }
+ }
+
+ private static function areBothByteArrays(a:Object, b:Object):Boolean
+ {
+ COMPILE::AS3
+ {
+ return (a is ByteArray) && (b is ByteArray)
+ }
+ COMPILE::JS
+ {
+ return false;
+ }
+ }
+ /**
+ * Returns information about the class, and properties of the class, for
+ * the specified Object.
+ *
+ * @param obj The Object to inspect.
+ *
+ * @param excludes Array of Strings specifying the property names that should be
+ * excluded from the returned result. For example, you could specify
+ * <code>["currentTarget", "target"]</code> for an Event object since these properties
+ * can cause the returned result to become large.
+ *
+ * @param options An Object containing one or more properties
+ * that control the information returned by this method.
+ * The properties include the following:
+ *
+ * <ul>
+ * <li><code>includeReadOnly</code>: If <code>false</code>,
+ * exclude Object properties that are read-only.
+ * The default value is <code>true</code>.</li>
+ * <li><code>includeTransient</code>: If <code>false</code>,
+ * exclude Object properties and variables that have <code>[Transient]</code> metadata.
+ * The default value is <code>true</code>.</li>
+ * <li><code>uris</code>: Array of Strings of all namespaces that should be included in the output.
+ * It does allow for a wildcard of "~~".
+ * By default, it is null, meaning no namespaces should be included.
+ * For example, you could specify <code>["mx_internal", "mx_object"]</code>
+ * or <code>["~~"]</code>.</li>
+ * </ul>
+ *
+ * @return An Object containing the following properties:
+ * <ul>
+ * <li><code>name</code>: String containing the name of the class.</li>
+ * <li><code>properties</code>: Sorted list of the property names of the specified object,
+ * or references to the original key if the specified object is a Dictionary. The individual
+ * array elements are QName instances, which contain both the local name of the property as well as the URI.</li>
+ * </ul>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getClassInfo(obj:Object,
+ excludes:Array = null,
+ options:Object = null):Object
+ {
+ var n:int;
+ var i:int;
+
+ if (obj is ObjectProxy)
+ obj = ObjectProxy(obj).object_proxy::object;
+
+ if (options == null)
+ options = { includeReadOnly: true, uris: null, includeTransient: true };
+
+ var result:Object;
+ var propertyNames:Array = [];
+ var cacheKey:String;
+
+ var className:String;
+ var classAlias:String;
+ var properties:XMLList;
+ var prop:XML;
+ var isDynamic:Boolean = false;
+ var metadataInfo:Object;
+
+ if (typeof(obj) == "xml")
+ {
+ className = "XML";
+ properties = obj.text();
+ if (properties.length())
+ propertyNames.push("*");
+ properties = obj.attributes();
+ }
+ else
+ {
+ var classInfo:XML = DescribeTypeCache.describeType(obj).typeDescription;
+ className = classInfo.@name.toString();
+ classAlias = classInfo.@alias.toString();
+ isDynamic = classInfo.@isDynamic.toString() == "true";
+
+ if (options.includeReadOnly)
+ properties = classInfo..accessor.(@access != "writeonly") + classInfo..variable;
+ else
+ properties = classInfo..accessor.(@access == "readwrite") + classInfo..variable;
+
+ var numericIndex:Boolean = false;
+ }
+
+ // If type is not dynamic, check our cache for class info...
+ if (!isDynamic)
+ {
+ cacheKey = getCacheKey(obj, excludes, options);
+ result = CLASS_INFO_CACHE[cacheKey];
+ if (result != null)
+ return result;
+ }
+
+ result = {};
+ result["name"] = className;
+ result["alias"] = classAlias;
+ result["properties"] = propertyNames;
+ result["dynamic"] = isDynamic;
+ result["metadata"] = metadataInfo = recordMetadata(properties);
+
+ var excludeObject:Object = {};
+ if (excludes)
+ {
+ n = excludes.length;
+ for (i = 0; i < n; i++)
+ {
+ excludeObject[excludes[i]] = 1;
+ }
+ }
+
+ var isArray:Boolean = (obj is Array);
+ var isDict:Boolean = (obj is Dictionary);
+
+ if (isDict)
+ {
+ // dictionaries can have multiple keys of the same type,
+ // (they can index by reference rather than QName, String, or number),
+ // which cannot be looked up by QName, so use references to the actual key
+ for (var key:* in obj)
+ {
+ propertyNames.push(key);
+ }
+ }
+ else if (isDynamic)
+ {
+ for (var p:String in obj)
+ {
+ if (excludeObject[p] != 1)
+ {
+ if (isArray)
+ {
+ var pi:Number = parseInt(p);
+ if (isNaN(pi))
+ propertyNames.push(new QName("", p));
+ else
+ propertyNames.push(pi);
+ }
+ else
+ {
+ propertyNames.push(new QName("", p));
+ }
+ }
+ }
+ numericIndex = isArray && !isNaN(Number(p));
+ }
+
+ if (isArray || isDict || className == "Object")
+ {
+ // Do nothing since we've already got the dynamic members
+ }
+ else if (className == "XML")
+ {
+ n = properties.length();
+ for (i = 0; i < n; i++)
+ {
+ p = properties[i].name();
+ if (excludeObject[p] != 1)
+ propertyNames.push(new QName("", "@" + p));
+ }
+ }
+ else
+ {
+ n = properties.length();
+ var uris:Array = options.uris;
+ var uri:String;
+ var qName:QName;
+ for (i = 0; i < n; i++)
+ {
+ prop = properties[i];
+ p = prop.@name.toString();
+ uri = prop.@uri.toString();
+
+ if (excludeObject[p] == 1)
+ continue;
+
+ if (!options.includeTransient && internalHasMetadata(metadataInfo, p, "Transient"))
+ continue;
+
+ if (uris != null)
+ {
+ if (uris.length == 1 && uris[0] == "*")
+ {
+ qName = new QName(uri, p);
+ try
+ {
+ obj[qName]; // access the property to ensure it is supported
+ propertyNames.push();
+ }
+ catch(e:Error)
+ {
+ // don't keep property name
+ }
+ }
+ else
+ {
+ for (var j:int = 0; j < uris.length; j++)
+ {
+ uri = uris[j];
+ if (prop.@uri.toString() == uri)
+ {
+ qName = new QName(uri, p);
+ try
+ {
+ obj[qName];
+ propertyNames.push(qName);
+ }
+ catch(e:Error)
+ {
+ // don't keep property name
+ }
+ }
+ }
+ }
+ }
+ else if (uri.length == 0)
+ {
+ qName = new QName(uri, p);
+ try
+ {
+ obj[qName];
+ propertyNames.push(qName);
+ }
+ catch(e:Error)
+ {
+ // don't keep property name
+ }
+ }
+ }
+ }
+
+ propertyNames.sort(Array.CASEINSENSITIVE |
+ (numericIndex ? Array.NUMERIC : 0));
+
+ // dictionary keys can be indexed by an object reference
+ // there's a possibility that two keys will have the same toString()
+ // so we don't want to remove dupes
+ if (!isDict)
+ {
+ // for Arrays, etc., on the other hand...
+ // remove any duplicates, i.e. any items that can't be distingushed by toString()
+ for (i = 0; i < propertyNames.length - 1; i++)
+ {
+ // the list is sorted so any duplicates should be adjacent
+ // two properties are only equal if both the uri and local name are identical
+ if (propertyNames[i].toString() == propertyNames[i + 1].toString())
+ {
+ propertyNames.splice(i, 1);
+ i--; // back up
+ }
+ }
+ }
+
+ // For normal, non-dynamic classes we cache the class info
+ // Don't cache XML as it can be dynamic
+ if (!isDynamic && className != "XML")
+ {
+ cacheKey = getCacheKey(obj, excludes, options);
+ CLASS_INFO_CACHE[cacheKey] = result;
+ }
+
+ return result;
+ }
+
+ /**
+ * Uses <code>getClassInfo</code> and examines the metadata information to
+ * determine whether a property on a given object has the specified
+ * metadata.
+ *
+ * @param obj The object holding the property.
+ * @param propName The property to check for metadata.
+ * @param metadataName The name of the metadata to check on the property.
+ * @param excludes If any properties need to be excluded when generating class info. (Optional)
+ * @param options If any options flags need to changed when generating class info. (Optional)
+ * @return true if the property has the specified metadata.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function hasMetadata(obj:Object,
+ propName:String,
+ metadataName:String,
+ excludes:Array = null,
+ options:Object = null):Boolean
+ {
+ var classInfo:Object = getClassInfo(obj, excludes, options);
+ var metadataInfo:Object = classInfo["metadata"];
+ return internalHasMetadata(metadataInfo, propName, metadataName);
+ }
+
+ /**
+ * Returns <code>true</code> if the object is an instance of a dynamic class.
+ *
+ * @param obj The object.
+ *
+ * @return <code>true</code> if the object is an instance of a dynamic class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isDynamicObject(obj:Object):Boolean
+ {
+ try
+ {
+ // this test for checking whether an object is dynamic or not is
+ // pretty hacky, but it assumes that no-one actually has a
+ // property defined called "wootHackwoot"
+ obj["wootHackwoot"];
+ }
+ catch (e:Error)
+ {
+ // our object isn't from a dynamic class
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Returns the value at the end of the property chain <code>path</code>.
+ * If the value cannot be reached due to null links on the chain,
+ * <code>undefined</code> is returned.
+ *
+ * @param obj The object at the beginning of the property chain
+ * @param path The path to inspect (e.g. "address.street")
+ *
+ * @return the value at the end of the property chain, <code>undefined</code>
+ * if it cannot be reached, or the object itself when <code>path</code> is empty.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getValue(obj:Object, path:Array):*
+ {
+ if(!obj)
+ return undefined;
+
+ if(!path || !path.length)
+ return obj;
+
+ var result:* = obj;
+ var i:int = -1;
+ while(++i < path.length && result)
+ result = result.hasOwnProperty(path[i]) ? result[path[i]] : undefined;
+
+ return result;
+ }
+
+
+ /**
+ * Sets a new value at the end of the property chain <code>path</code>.
+ * If the value cannot be reached due to null links on the chain,
+ * <code>false</code> is returned.
+ *
+ * @param obj The object at the beginning of the property chain
+ * @param path The path to traverse (e.g. "address.street")
+ * @param newValue The value to set (e.g. "Fleet Street")
+ *
+ * @return <code>true</code> if the value is successfully set,
+ * <code>false</code> otherwise. Note that the function does not
+ * use a try/catch block. You can implement one in the calling
+ * function if there's a risk of type mismatch or other errors during
+ * the assignment.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function setValue(obj:Object, path:Array, newValue:*):Boolean
+ {
+ if(!obj || !path || !path.length)
+ return false;
+
+ var secondToLastLink:* = getValue(obj, path.slice(0, -1));
+ if(secondToLastLink && secondToLastLink.hasOwnProperty(path[path.length - 1]))
+ {
+ secondToLastLink[path[path.length - 1]] = newValue;
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * @private
+ */
+ private static function internalHasMetadata(metadataInfo:Object, propName:String, metadataName:String):Boolean
+ {
+ if (metadataInfo != null)
+ {
+ var metadata:Object = metadataInfo[propName];
+ if (metadata != null)
+ {
+ if (metadata[metadataName] != null)
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @private
+ */
+ private static function recordMetadata(properties:XMLList):Object
+ {
+ var result:Object = null;
+
+ try
+ {
+ for each (var prop:XML in properties)
+ {
+ var propName:String = prop.attribute("name").toString();
+ var metadataList:XMLList = prop.metadata;
+
+ if (metadataList.length() > 0)
+ {
+ if (result == null)
+ result = {};
+
+ var metadata:Object = {};
+ result[propName] = metadata;
+
+ for each (var md:XML in metadataList)
+ {
+ var mdName:String = md.attribute("name").toString();
+
+ var argsList:XMLList = md.arg;
+ var value:Object = {};
+
+ for each (var arg:XML in argsList)
+ {
+ var argKey:String = arg.attribute("key").toString();
+ if (argKey != null)
+ {
+ var argValue:String = arg.attribute("value").toString();
+ value[argKey] = argValue;
+ }
+ }
+
+ var existing:Object = metadata[mdName];
+ if (existing != null)
+ {
+ var existingArray:Array;
+ if (existing is Array)
+ existingArray = existing as Array;
+ else
+ {
+ existingArray = [existing];
+ delete metadata[mdName];
+ }
+ existingArray.push(value);
+ existing = existingArray;
+ }
+ else
+ {
+ existing = value;
+ }
+ metadata[mdName] = existing;
+ }
+ }
+ }
+ }
+ catch(e:Error)
+ {
+ }
+
+ return result;
+ }
+
+
+ /**
+ * @private
+ */
+ private static function getCacheKey(o:Object, excludes:Array = null, options:Object = null):String
+ {
+ var key:String = getQualifiedClassName(o);
+
+ if (excludes != null)
+ {
+ var length:int = excludes.length;
+ for (var i:uint = 0; i < length; i++)
+ {
+ var excl:String = excludes[i] as String;
+ if (excl != null)
+ key += excl;
+ }
+ }
+
+ if (options != null)
+ {
+ for (var flag:String in options)
+ {
+ key += flag;
+ var value:String = options[flag];
+ if (value != null)
+ key += value.toString();
+ }
+ }
+ return key;
+ }
+
+ /**
+ * @private
+ */
+ private static function arrayCompare(a:Array, b:Array,
+ currentDepth:int, desiredDepth:int,
+ refs:CircularReferenceManager):int
+ {
+ var result:int = 0;
+
+ if (a.length != b.length)
+ {
+ if (a.length < b.length)
+ result = -1;
+ else
+ result = 1;
+ }
+ else
+ {
+ var key:Object;
+ for (key in a)
+ {
+ if (b.hasOwnProperty(key))
+ {
+ result = internalCompare(a[key], b[key], currentDepth,
+ desiredDepth, refs);
+
+ if (result != 0)
+ return result;
+ }
+ else
+ {
+ return -1;
+ }
+ }
+
+ for (key in b)
+ {
+ if (!a.hasOwnProperty(key))
+ {
+ return 1;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private static function byteArrayCompare(a:ByteArray, b:ByteArray):int
+ {
+ var result:int = 0;
+
+ if (a == b)
+ return result;
+
+ if (a.length != b.length)
+ {
+ if (a.length < b.length)
+ result = -1;
+ else
+ result = 1;
+ }
+ else
+ {
+ for (var i:int = 0; i < a.length; i++)
+ {
+ result = numericCompare(a[i], b[i]);
+ if (result != 0)
+ {
+ i = a.length;
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @private
+ */
+ private static function listCompare(a:IList, b:IList, currentDepth:int,
+ desiredDepth:int, refs:CircularReferenceManager):int
+ {
+ var result:int = 0;
+
+ if (a.length != b.length)
+ {
+ if (a.length < b.length)
+ result = -1;
+ else
+ result = 1;
+ }
+ else
+ {
+ for (var i:int = 0; i < a.length; i++)
+ {
+ result = internalCompare(a.getItemAt(i), b.getItemAt(i),
+ currentDepth+1, desiredDepth, refs);
+ if (result != 0)
+ {
+ i = a.length;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @private
+ * This is the "find" for our union-find algorithm when doing object searches.
+ * The dictionary keeps track of sets of equal objects
+ */
+ private static function getRef(o:Object, refs:CircularReferenceManager):Object
+ {
+ var oRef:Object = refs[o];
+ while (oRef && oRef != refs[oRef])
+ {
+ oRef = refs[oRef];
+ }
+ if (!oRef)
+ oRef = o;
+ if (oRef != refs[o])
+ refs[o] = oRef;
+
+ return oRef;
+ }
+
+ /**
+ * @private
+ */
+ private static var refCount:int = 0;
+
+ /**
+ * @private
+ */
+ private static var CLASS_INFO_CACHE:Object = {};
+}
+
+}
+
+COMPILE::AS3
+{
+ import flash.utils.Dictionary;
+}
+
+class CircularReferenceManager
+{
+ COMPILE::AS3
+ private var dict:Dictionary = new Dictionary(true);
+
+ COMPILE::JS
+ private var array:Array = [];
+
+ public function CircularReferenceManager()
+ {
+ }
+
+ public function put(obj:Object):void
+ {
+ COMPILE::AS3
+ {
+ dict[obj] = 1;
+ }
+ COMPILE::JS
+ {
+ array.push(obj);
+ }
+ }
+
+ public function contains(obj:Object):Boolean
+ {
+ COMPILE::AS3
+ {
+ return (dict[obj] == 1);
+ }
+ COMPILE::JS
+ {
+ return array.indexOf(obj) != -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/mx/utils/OnDemandEventDispatcher.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/OnDemandEventDispatcher.as b/frameworks/projects/MX/src/main/flex/mx/utils/OnDemandEventDispatcher.as
new file mode 100644
index 0000000..c4a0d3b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/OnDemandEventDispatcher.as
@@ -0,0 +1,153 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+COMPILE::AS3
+{
+ import flash.events.Event;
+}
+COMPILE::JS
+{
+ import org.apache.flex.events.Event;
+}
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * OnDemandEventDispatcher serves as a base class for classes that dispatch events but expect listeners
+ * to be infrequent. When a class extends OnDemandEventDispatcher instead of the standard EventDispatcher,
+ * it is trading off a small overhead on every single instance for a slightly larger overhead on only the instances
+ * that actually have listeners attached to them.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public class OnDemandEventDispatcher implements IEventDispatcher
+ {
+ private var _dispatcher:EventDispatcher;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function OnDemandEventDispatcher()
+ {
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::AS3
+ public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
+ {
+ if (_dispatcher == null)
+ {
+ _dispatcher = new EventDispatcher(this);
+ }
+ _dispatcher.addEventListener(type,listener,useCapture,priority,useWeakReference);
+ }
+ COMPILE::JS
+ public function addEventListener(type:String, listener:Function, useCapture:Boolean = false):void
+ {
+ if (_dispatcher == null)
+ {
+ _dispatcher = new EventDispatcher(this);
+ }
+ _dispatcher.addEventListener(type,listener,useCapture);
+ }
+
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function dispatchEvent(event:Event):Boolean
+ {
+ if (_dispatcher != null)
+ return _dispatcher.dispatchEvent(event);
+ return true;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function hasEventListener(type:String):Boolean
+ {
+ if (_dispatcher != null)
+ return _dispatcher.hasEventListener(type);
+ return false;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
+ {
+ if (_dispatcher != null)
+ _dispatcher.removeEventListener(type,listener,useCapture);
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function willTrigger(type:String):Boolean
+ {
+ if (_dispatcher != null)
+ return _dispatcher.willTrigger(type);
+ return false;
+ }
+
+ }
+}
\ 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/utils/Platform.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/Platform.as b/frameworks/projects/MX/src/main/flex/mx/utils/Platform.as
new file mode 100644
index 0000000..6a19b2e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/Platform.as
@@ -0,0 +1,337 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+import flash.system.Capabilities;
+import flash.utils.getDefinitionByName;
+
+/**
+ * The Platform utility class contains several static methods to check what
+ * desktop or mobile platform the application is running on.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+public class Platform
+{
+ include "../core/Version.as";
+
+ private static var _instance: Platform;
+
+ protected static var _initialized:Boolean;
+ protected static var _isAndroid:Boolean;
+ protected static var _isIOS:Boolean;
+ protected static var _isIPad:Boolean;
+ protected static var _isBlackBerry:Boolean;
+ protected static var _isMobile:Boolean;
+ protected static var _isMac:Boolean;
+ protected static var _isWindows:Boolean;
+ protected static var _isLinux:Boolean;
+ protected static var _isDesktop:Boolean;
+ protected static var _isBrowser:Boolean;
+ protected static var _isAir:Boolean;
+ private static var _osVersion: String = null;
+
+ /**
+ * This value is set from AndroidPlatformVersionOverride
+ *
+ */
+ mx_internal static var androidVersionOverride:String;
+
+ /**
+ * This value is set from IOSPlatformVersionOverride
+ *
+ */
+ mx_internal static var iosVersionOverride:String;
+
+ /**
+ * Returns true if the application is running on IOS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isIOS():Boolean
+ {
+ getPlatforms();
+
+ return _isIOS;
+ }
+
+ /**
+ * Returns true if the application is running on an iPad.
+ * Note this returns false in the AIR mobile device simulator.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isIPad():Boolean
+ {
+ getPlatforms();
+
+ return _isIPad;
+ }
+
+ /**
+ * Returns true if the application is running on a BlackBerry.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isBlackBerry():Boolean
+ {
+ getPlatforms();
+
+ return _isBlackBerry;
+ }
+
+ /**
+ * Returns true if the application is running on Android.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isAndroid():Boolean
+ {
+ getPlatforms();
+
+ return _isAndroid;
+ }
+
+ /**
+ * Returns true if the application is running on Windows.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isWindows():Boolean
+ {
+ getPlatforms();
+
+ return _isWindows;
+ }
+
+ /**
+ * Returns true if the application is running on a Mac.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isMac():Boolean
+ {
+ getPlatforms();
+
+ return _isMac;
+ }
+
+ /**
+ * Returns true if the application is running on Linux.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isLinux():Boolean
+ {
+ getPlatforms();
+
+ return _isLinux;
+ }
+
+ /**
+ * Returns true if the application is running on a Desktop OS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isDesktop():Boolean
+ {
+ getPlatforms();
+
+ return _isDesktop;
+ }
+
+ /**
+ * Returns true if the application is running on a Mobile device.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isMobile():Boolean
+ {
+ getPlatforms();
+
+ return _isMobile;
+ }
+
+ /**
+ * Returns true if the application is running on a desktop AIR.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isAir():Boolean
+ {
+ getPlatforms();
+
+ return _isAir;
+ }
+
+ /**
+ * Returns true if the application is running in a browser.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.12
+ */
+ public static function get isBrowser():Boolean
+ {
+ getPlatforms();
+
+ return _isBrowser;
+ }
+
+ /**
+ * Returns the version of the OS the application is running on
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.0
+ * @productversion Flex 4.13
+ */
+ public static function get osVersion(): String
+ {
+ //We needed to compute _osVersion later than getPlatforms, because it relies on resources that ready later
+ if (_osVersion == null){
+ if(mx_internal::androidVersionOverride == null && mx_internal::iosVersionOverride == null)
+ {
+ _osVersion = computeOSVersionString();
+ }
+ else if(mx_internal::androidVersionOverride != null)
+ {
+ _osVersion = mx_internal::androidVersionOverride;
+ }
+ else if(mx_internal::iosVersionOverride != null)
+ {
+ _osVersion = mx_internal::iosVersionOverride;
+ }
+ }
+ return _osVersion;
+ }
+
+ /* Notes on Capabilities.os for mobile apps:
+ - on ADL => returns the OS where the ADL is running ( eg. Windows 7, or Mac OS )
+ - on device => returns the OS of the device (eg. iPhone OS ... for iOS devices )
+ * */
+ protected static function getPlatforms():void {
+ if (!_initialized)
+ {
+ var cap: Class = Capabilities;
+ var version: String = Capabilities.version;
+ var os: String = Capabilities.os;
+ var playerType: String = Capabilities.playerType;
+
+ _isAndroid = version.indexOf("AND") > -1;
+ _isIOS = version.indexOf('IOS') > -1;
+ _isBlackBerry = version.indexOf('QNX') > -1;
+ _isMobile = _isAndroid || _isIOS || _isBlackBerry;
+
+ _isMac = os.indexOf("Mac OS") != -1;
+ _isWindows = os.indexOf("Windows") != -1;
+ _isLinux = os.indexOf("Linux") != -1; // note that Android is also Linux
+ _isIPad = os.indexOf('iPad') > -1;
+ _isDesktop = !_isMobile;
+
+ _isAir = playerType == "Desktop";
+ _isBrowser = (playerType == "PlugIn" || playerType == "ActiveX");
+
+ _initialized = true;
+ }
+ }
+
+ /** @private
+ * extract OS version information from Capabilities.os
+ * os is typically a non-numeric string (such as Windows, iPhone OS, Android, etc...) followed by a number sequence.
+ * if no number is found, OS version is set to 0.
+ * os on ADL will return the host OS and not the device OS.
+ *
+ * That's why we need to check for a specific sequence for iOS and Android.
+ * On Android, os is the Linux kernel version (such as Linux 3.4.34-1790463).
+ * So the version information must be retrieved from an internal file.
+ * Since reading files API is only available on AIR, it's delegated to PlatformMobileHelper in mobilecomponents.swc
+ * @see spark.utils.PlatformMobileHelper
+ *
+ * @return version number string, or empty string if could not retrieve the version.
+ * */
+ private static function computeOSVersionString(): String
+ {
+ var os: String = Capabilities.os;
+ var osVersionMatch: Array;
+ var version: String = "";
+
+ if (isIOS) {
+ osVersionMatch = os.match(/iPhone OS\s([\d\.]+)/);
+ if (osVersionMatch && osVersionMatch.length == 2)
+ version = osVersionMatch[1];
+ }
+ else if (isAndroid) {
+ try {
+ var mobileHelperClass: Class = Class(getDefinitionByName("spark.utils::PlatformMobileHelper"));
+ if (mobileHelperClass != null) {
+ version = mobileHelperClass["computeOSVersionForAndroid"]();
+ }
+ }
+ catch (e: Error) {
+ trace("Error: " + e.message);
+ }
+ }
+ else {
+ //on other OS, extract version
+ osVersionMatch = os.match(/[A-Za-z\s]+([\d\.]+)/);
+ if (osVersionMatch && osVersionMatch.length == 2)
+ version = osVersionMatch[1];
+ }
+ return version;
+ }
+
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/utils/StringUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/StringUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/StringUtil.as
new file mode 100644
index 0000000..d8ff8a8
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/StringUtil.as
@@ -0,0 +1,365 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+/**
+ * The StringUtil utility class is an all-static class with methods for
+ * working with String objects within Flex.
+ * You do not create instances of StringUtil;
+ * instead you call methods such as
+ * the <code>StringUtil.substitute()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class StringUtil
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Removes all whitespace characters from the beginning and end
+ * of the specified string.
+ *
+ * @param str The String whose whitespace should be trimmed.
+ *
+ * @return Updated String where whitespace was removed from the
+ * beginning and end.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function trim(str:String):String
+ {
+ if (str == null) return '';
+
+ var startIndex:int = 0;
+ while (isWhitespace(str.charAt(startIndex)))
+ ++startIndex;
+
+ var endIndex:int = str.length - 1;
+ while (isWhitespace(str.charAt(endIndex)))
+ --endIndex;
+
+ if (endIndex >= startIndex)
+ return str.slice(startIndex, endIndex + 1);
+ else
+ return "";
+ }
+
+ /**
+ * Removes all whitespace characters from the beginning and end
+ * of each element in an Array, where the Array is stored as a String.
+ *
+ * @param value The String whose whitespace should be trimmed.
+ *
+ * @param separator The String that delimits each Array element in the string.
+ *
+ * @return Updated String where whitespace was removed from the
+ * beginning and end of each element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function trimArrayElements(value:String, delimiter:String):String
+ {
+ if (value != "" && value != null)
+ {
+ var items:Array = value.split(delimiter);
+
+ var len:int = items.length;
+ for (var i:int = 0; i < len; i++)
+ {
+ items[i] = StringUtil.trim(items[i]);
+ }
+
+ if (len > 0)
+ {
+ value = items.join(delimiter);
+ }
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns <code>true</code> if the specified string is
+ * a single space, tab, carriage return, newline, or formfeed character.
+ *
+ * @param str The String that is is being queried.
+ *
+ * @return <code>true</code> if the specified string is
+ * a single space, tab, carriage return, newline, or formfeed character.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function isWhitespace(character:String):Boolean
+ {
+ switch (character)
+ {
+ case " ":
+ case "\t":
+ case "\r":
+ case "\n":
+ case "\f":
+ // non breaking space
+ case "\u00A0":
+ // line seperator
+ case "\u2028":
+ // paragraph seperator
+ case "\u2029":
+ // ideographic space
+ case "\u3000":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Substitutes "{n}" tokens within the specified string
+ * with the respective arguments passed in.
+ *
+ * Note that this uses String.replace and "$" can have special
+ * meaning in the argument strings escape by using "$$".
+ *
+ * @param str The string to make substitutions in.
+ * This string can contain special tokens of the form
+ * <code>{n}</code>, where <code>n</code> is a zero based index,
+ * that will be replaced with the additional parameters
+ * found at that index if specified.
+ *
+ * @param rest Additional parameters that can be substituted
+ * in the <code>str</code> parameter at each <code>{n}</code>
+ * location, where <code>n</code> is an integer (zero based)
+ * index value into the array of values specified.
+ * If the first parameter is an array this array will be used as
+ * a parameter list.
+ * This allows reuse of this routine in other methods that want to
+ * use the ... rest signature.
+ * For example <pre>
+ * public function myTracer(str:String, ... rest):void
+ * {
+ * label.text += StringUtil.substitute(str, rest) + "\n";
+ * } </pre>
+ *
+ * @return New string with all of the <code>{n}</code> tokens
+ * replaced with the respective arguments specified.
+ *
+ * @example
+ *
+ * var str:String = "here is some info '{0}' and {1}";
+ * trace(StringUtil.substitute(str, 15.4, true));
+ *
+ * // this will output the following string:
+ * // "here is some info '15.4' and true"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function substitute(str:String, ... rest):String
+ {
+ if (str == null) return '';
+
+ // Replace all of the parameters in the msg string.
+ var len:uint = rest.length;
+ var args:Array;
+ if (len == 1 && rest[0] is Array)
+ {
+ args = rest[0] as Array;
+ len = args.length;
+ }
+ else
+ {
+ args = rest;
+ }
+
+ for (var i:int = 0; i < len; i++)
+ {
+ str = str.replace(new RegExp("\\{"+i+"\\}", "g"), args[i]);
+ }
+
+ return str;
+ }
+
+ /**
+ * Returns a string consisting of a specified string
+ * concatenated with itself a specified number of times.
+ *
+ * @param str The string to be repeated.
+ *
+ * @param n The repeat count.
+ *
+ * @return The repeated string.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ public static function repeat(str:String, n:int):String
+ {
+ if (n == 0)
+ return "";
+
+ var s:String = str;
+ for (var i:int = 1; i < n; i++)
+ {
+ s += str;
+ }
+ return s;
+ }
+
+ /**
+ * Removes "unallowed" characters from a string.
+ * A "restriction string" such as <code>"A-Z0-9"</code>
+ * is used to specify which characters are allowed.
+ * This method uses the same logic as the <code>restrict</code>
+ * property of TextField.
+ *
+ * @param str The input string.
+ *
+ * @param restrict The restriction string.
+ *
+ * @return The input string, minus any characters
+ * that are not allowed by the restriction string.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+ public static function restrict(str:String, restrict:String):String
+ {
+ // A null 'restrict' string means all characters are allowed.
+ if (restrict == null)
+ return str;
+
+ // An empty 'restrict' string means no characters are allowed.
+ if (restrict == "")
+ return "";
+
+ // Otherwise, we need to test each character in 'str'
+ // to determine whether the 'restrict' string allows it.
+ var charCodes:Array = [];
+
+ var n:int = str.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var charCode:uint = str.charCodeAt(i);
+ if (testCharacter(charCode, restrict))
+ charCodes.push(charCode);
+ }
+
+ return String.fromCharCode.apply(null, charCodes);
+ }
+
+ /**
+ * @private
+ * Helper method used by restrict() to test each character
+ * in the input string against the restriction string.
+ * The logic in this method implements the same algorithm
+ * as in TextField's 'restrict' property (which is quirky,
+ * such as how it handles a '-' at the beginning of the
+ * restriction string).
+ */
+ private static function testCharacter(charCode:uint,
+ restrict:String):Boolean
+ {
+ var allowIt:Boolean = false;
+
+ var inBackSlash:Boolean = false;
+ var inRange:Boolean = false;
+ var setFlag:Boolean = true;
+ var lastCode:uint = 0;
+
+ var n:int = restrict.length;
+ var code:uint;
+
+ if (n > 0)
+ {
+ code = restrict.charCodeAt(0);
+ if (code == 94) // caret
+ allowIt = true;
+ }
+
+ for (var i:int = 0; i < n; i++)
+ {
+ code = restrict.charCodeAt(i)
+
+ var acceptCode:Boolean = false;
+ if (!inBackSlash)
+ {
+ if (code == 45) // hyphen
+ inRange = true;
+ else if (code == 94) // caret
+ setFlag = !setFlag;
+ else if (code == 92) // backslash
+ inBackSlash = true;
+ else
+ acceptCode = true;
+ }
+ else
+ {
+ acceptCode = true;
+ inBackSlash = false;
+ }
+
+ if (acceptCode)
+ {
+ if (inRange)
+ {
+ if (lastCode <= charCode && charCode <= code)
+ allowIt = setFlag;
+ inRange = false;
+ lastCode = 0;
+ }
+ else
+ {
+ if (charCode == code)
+ allowIt = setFlag;
+ lastCode = code;
+ }
+ }
+ }
+
+ return allowIt;
+ }
+}
+
+}
[35/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/controls/ToolTip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/controls/ToolTip.as b/frameworks/projects/MX/src/main/flex/mx/controls/ToolTip.as
new file mode 100644
index 0000000..f6a4b9f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/controls/ToolTip.as
@@ -0,0 +1,515 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.controls
+{
+
+import flash.display.DisplayObject;
+import flash.text.TextFieldAutoSize;
+import flash.text.TextFormat;
+import mx.core.EdgeMetrics;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModuleFactory;
+import mx.core.IFontContextComponent;
+import mx.core.IRectangularBorder;
+import mx.core.IToolTip;
+import mx.core.IUITextField;
+import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.core.mx_internal;
+import mx.styles.ISimpleStyleClient;
+
+use namespace mx_internal;
+
+//--------------------------------------
+// Styles
+//--------------------------------------
+
+/*
+ Note: ToolTip is affected by the following styles:
+
+ backgroundColor
+ borderColor
+ borderStyle
+ color
+ fontFamily
+ fontSize
+ fontStyle
+ fontWidth
+ paddingBottom
+ paddingLeft
+ paddingRight
+ paddingTop
+ shadowColor (when borderStyle is "toolTip")
+ textAlign
+ textDecoration
+*/
+
+include "../styles/metadata/ContainerBackgroundStyles.as"
+include "../styles/metadata/BorderStyles.as"
+include "../styles/metadata/LeadingStyle.as"
+include "../styles/metadata/PaddingStyles.as"
+include "../styles/metadata/TextStyles.as"
+
+/**
+ * Radius of component corners.
+ *
+ * @default 2
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="cornerRadius", type="Number", format="Length", inherit="no", theme="halo, spark, mobile")]
+
+/**
+ * Number of pixels between the container's bottom border and its content area.
+ * The default value is -1, so the bottom border of the last header
+ * overlaps the Accordion container's bottom border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ * Number of pixels between the container's top border and its content area.
+ * The default value is -1, so the top border of the first header
+ * overlaps the Accordion container's top border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
+
+/**
+ * Because this component does not define a skin for the mobile theme, Adobe
+ * recommends that you not use it in a mobile application. Alternatively, you
+ * can define your own mobile skin for the component. For more information,
+ * see <a href="http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c698e85712b3011fe73-8000.html">Basics of mobile skinning</a>.
+ */
+[DiscouragedForProfile("mobileDevice")]
+
+/**
+ * The ToolTip control lets you provide helpful information to your users.
+ * When a user moves the mouse pointer over a graphical component, the ToolTip
+ * control pops up and displays text that provides information about the
+ * component.
+ * You can use ToolTips to guide users as they work with your application
+ * or customize the ToolTip controls to provide additional functionality.
+ *
+ * @see mx.managers.ToolTipManager
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ToolTip extends UIComponent implements IToolTip, IFontContextComponent
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ [Inspectable(category="Other")]
+
+ /**
+ * Maximum width in pixels for new ToolTip controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static var maxWidth:Number = 300;
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ToolTip()
+ {
+ super();
+
+ // InteractiveObject variables.
+ // Make the ToolTip invisible to the mouse so that it doesn't
+ // interfere with the ToolTipManager's mouse-tracking.
+ mouseEnabled = false;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The internal object that draws the border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ mx_internal var border:IFlexDisplayObject;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // borderMetrics
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private function get borderMetrics():EdgeMetrics
+ {
+ if (border is IRectangularBorder)
+ return IRectangularBorder(border).borderMetrics;
+
+ return EdgeMetrics.EMPTY;
+ }
+
+ //----------------------------------
+ // fontContext
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ public function get fontContext():IFlexModuleFactory
+ {
+ return moduleFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set fontContext(moduleFactory:IFlexModuleFactory):void
+ {
+ this.moduleFactory = moduleFactory;
+ }
+
+ //----------------------------------
+ // text
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the text property.
+ */
+ private var _text:String;
+
+ /**
+ * @private
+ */
+ private var textChanged:Boolean;
+
+ /**
+ * The text displayed by the ToolTip.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get text():String
+ {
+ return _text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ _text = value;
+ textChanged = true;
+
+ invalidateProperties();
+ invalidateSize();
+ invalidateDisplayList();
+ }
+
+ //----------------------------------
+ // textField
+ //----------------------------------
+
+ /**
+ * The internal UITextField that renders the text of this ToolTip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var textField:IUITextField;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ override protected function createChildren():void
+ {
+ super.createChildren();
+
+ // Create the border/background.
+ createBorder();
+
+ // Create the TextField that displays the tooltip text.
+ createTextField(-1);
+ }
+
+ /**
+ * @private
+ */
+ override protected function commitProperties():void
+ {
+ super.commitProperties();
+
+ // if the font changed and we already created the label, we will need to
+ // destory it so it can be re-created, possibly in a different swf context.
+ if (hasFontContextChanged() && textField != null)
+ {
+ var index:int = getChildIndex(DisplayObject(textField));
+ removeTextField();
+ createTextField(index);
+ invalidateSize();
+ textChanged = true;
+ }
+
+ if (textChanged)
+ {
+ // In general, we want the ToolTip style to be applied.
+ // However, we don't want leftMargin and rightMargin
+ // of the TextField's TextFormat to be set to the
+ // paddingLeft and paddingRight of the ToolTip style.
+ // We want these styles to affect the space between the
+ // TextField and the border, but not the space within
+ // the TextField.
+ var textFormat:TextFormat = textField.getTextFormat();
+ textFormat.leftMargin = 0;
+ textFormat.rightMargin = 0;
+ textField.defaultTextFormat = textFormat;
+
+ textField.text = _text;
+ textChanged = false;
+ }
+ }
+
+ /**
+ * @private
+ */
+ override protected function measure():void
+ {
+ super.measure();
+
+ var bm:EdgeMetrics = borderMetrics;
+
+ var leftInset:Number = bm.left + getStyle("paddingLeft");
+ var topInset:Number = bm.top + getStyle("paddingTop");
+ var rightInset:Number = bm.right + getStyle("paddingRight");
+ var bottomInset:Number = bm.bottom + getStyle("paddingBottom");
+
+ var widthSlop:Number = leftInset + rightInset;
+ var heightSlop:Number = topInset + bottomInset;
+
+ textField.wordWrap = false;
+
+ if (textField.textWidth + widthSlop > ToolTip.maxWidth)
+ {
+ textField.width = ToolTip.maxWidth - widthSlop;
+ textField.wordWrap = true;
+ }
+
+ measuredWidth = textField.width + widthSlop;
+ measuredHeight = textField.height + heightSlop;
+ }
+
+ /**
+ * @private
+ */
+ override protected function updateDisplayList(unscaledWidth:Number,
+ unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ var bm:EdgeMetrics = borderMetrics;
+
+ var leftInset:Number = bm.left + getStyle("paddingLeft");
+ var topInset:Number = bm.top + getStyle("paddingTop");
+ var rightInset:Number = bm.right + getStyle("paddingRight");
+ var bottomInset:Number = bm.bottom + getStyle("paddingBottom");
+
+ var widthSlop:Number = leftInset + rightInset;
+ var heightSlop:Number = topInset + bottomInset;
+
+ border.setActualSize(unscaledWidth, unscaledHeight);
+
+ textField.move(leftInset, topInset);
+ textField.setActualSize(unscaledWidth - widthSlop, unscaledHeight - heightSlop);
+ }
+
+ /**
+ * @private
+ */
+ override public function styleChanged(styleProp:String):void
+ {
+ // This will take care of doing invalidateSize() if styleProp
+ // is "styleName" or a registered layout style such as "borderStyle".
+ super.styleChanged(styleProp);
+
+ // However, if the borderStyle changes from "errorTipAbove" to
+ // "errorTipBelow" or vice versa, the measured size won't change.
+ // (The pointy part of the skin simply changes from the bottom
+ // to the top or vice versa.) This means that the LayoutManager
+ // won't call updateDisplayList() because the size hasn't changed.
+ // But the TextField has to be repositioned, so we need to
+ // invalidate the layout as well as the size.
+ if (styleProp == "styleName" ||
+ styleProp == "borderSkin" ||
+ styleProp == null)
+ {
+ //if the border skin has changed then rebuild it.
+ if(border)
+ {
+ removeChild(DisplayObject(border));
+ border = null;
+ }
+
+ createBorder();
+ }
+ else if (styleProp == "borderStyle")
+ {
+ invalidateDisplayList();
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Creates the text field child and adds it as a child of this component.
+ *
+ * @param childIndex The index of where to add the child.
+ * If -1, the text field is appended to the end of the list.
+ */
+ mx_internal function createTextField(childIndex:int):void
+ {
+ if (!textField)
+ {
+ textField = IUITextField(createInFontContext(UITextField));
+
+ textField.autoSize = TextFieldAutoSize.LEFT;
+ textField.mouseEnabled = false;
+ textField.multiline = true;
+ textField.selectable = false;
+ textField.wordWrap = false;
+ textField.styleName = this;
+
+ if (childIndex == -1)
+ addChild(DisplayObject(textField));
+ else
+ addChildAt(DisplayObject(textField), childIndex);
+ }
+ }
+
+ /**
+ * @private
+ * Removes the text field from this component.
+ */
+ mx_internal function removeTextField():void
+ {
+ if (textField)
+ {
+ removeChild(DisplayObject(textField));
+ textField = null;
+ }
+ }
+
+
+ /**
+ * @private
+ */
+ mx_internal function getTextField():IUITextField
+ {
+ return textField;
+ }
+
+ /**
+ * @private
+ */
+ private function createBorder():void
+ {
+ if (!border)
+ {
+ var borderClass:Class = getStyle("borderSkin");
+
+ if (borderClass != null)
+ {
+ border = new borderClass();
+
+ if (border is ISimpleStyleClient)
+ ISimpleStyleClient(border).styleName = this;
+
+ // Add the border behind all the children.
+ addChildAt(DisplayObject(border), 0);
+
+ invalidateDisplayList();
+ }
+ }
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/ComponentDescriptor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ComponentDescriptor.as b/frameworks/projects/MX/src/main/flex/mx/core/ComponentDescriptor.as
new file mode 100644
index 0000000..246a2df
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ComponentDescriptor.as
@@ -0,0 +1,436 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * ComponentDescriptor is the base class for the UIComponentDescriptor class,
+ * which encapsulates the information that you specified in an MXML tag
+ * for an instance of a visual component.
+ * In Flex, non-visual components are treated differently and do not
+ * have descriptors, but in a future version the ComponentDescriptor
+ * base class may be used for them as well.
+ *
+ * <p>Most of the tags in an MXML file describe a tree of UIComponent objects.
+ * For example, the <code><mx:Application></code> tag represents a
+ * UIComponent object, and its child containers and controls are all
+ * UIComponent objects.</p>
+ *
+ * <p>The MXML compiler compiles each of these MXML tags into a
+ * UIComponentDescriptor instance.
+ * To be precise, the MXML compiler autogenerates an ActionScript
+ * data structure which is a tree of UIComponentDescriptor objects.</p>
+ *
+ * <p>At runtime, the <code>createComponentsFromDescriptors()</code> method
+ * of the Container class uses the information in the UIComponentDescriptor
+ * objects in the container's <code>childDescriptors</code> array to create
+ * the actual UIComponent objects that are the container's children,
+ * plus deeper descendants as well.
+ * Depending on the value of the container's <code>creationPolicy</code>,
+ * property, the descendants might be created at application startup,
+ * when some part of the component is about to become visible,
+ * or when the application developer manually calls
+ * the <code>createComponentsFromDescriptors()</code> method.</p>
+ *
+ * <p>You do not typically create ComponentDescriptor or UIComponentDescriptor
+ * instances yourself; you can access the ones that the MXML compiler
+ * autogenerates, via the <code>childDescriptors</code> array
+ * of the Container class.</p>
+ *
+ * @see mx.core.UIComponentDescriptor
+ * @see mx.core.Container#childDescriptors
+ * @see mx.core.Container#creationPolicy
+ * @see mx.core.Container#createComponentsFromDescriptors()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ComponentDescriptor
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param descriptorProperties An Object containing name/value pairs
+ * for the properties of the ComponentDescriptor object, such as its
+ * <code>type</code>, <code>id</code>, <code>propertiesFactory</code>
+ * and <code>events</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ComponentDescriptor(descriptorProperties:Object)
+ {
+ super();
+
+ for (var p:String in descriptorProperties)
+ {
+ this[p] = descriptorProperties[p];
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // document
+ //----------------------------------
+
+ /**
+ * A reference to the document Object in which the component
+ * is to be created.
+ *
+ * @see mx.core.IUIComponent#document
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var document:Object;
+
+ //----------------------------------
+ // events
+ //----------------------------------
+
+ /**
+ * An Object containing name/value pairs for the component's
+ * event handlers, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:DataGrid id="dg" initialize="fetchData(); initDataGrid();" change="changeHandler(event);"/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>events</code> property is the Object</p>
+ *
+ * <pre>
+ * { initialize: "__dg_initialize", change: "__dg_change" }
+ * </pre>
+ *
+ * <p>The <code>event</code>property is <code>null</code>
+ * if no MXML event handlers were specified for the component</p>
+ *
+ * <p>The strings <code>"__dg_initialize"</code>
+ * and <code>"__dg_change"</code> are the names of event handler
+ * methods that the MXML compiler autogenerates.
+ * The body of these methods contain the ActionScript statements
+ * that you specified as the values of the event attributes.
+ * For example, the autogenerated <code>initialize</code> handler is</p>
+ *
+ * <pre>
+ * public function __dg_initialize(event:mx.events.FlexEvent):void
+ * {
+ * fetchData();
+ * initDataGrid();
+ * }
+ * </pre>
+ *
+ * <p>You should not assume that the autogenerated event handlers
+ * will always be specified by name; this may change in a future
+ * version of Flex.</p>
+ *
+ * <p>This property is used by the Container method
+ * <code>createComponentsFromDescriptors()</code>
+ * to register the autogenerated event handlers
+ * using the <code>addEventListener()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var events:Object;
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * The identifier for the component, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput id="firstName" text="Enter your first name here"/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>id</code> property is the String
+ * <code>"firstName"</code>.</p>
+ *
+ * <p>The <code>id</code> property is <code>null</code>
+ * if no MXML id was specified for the component.</p>
+ *
+ * <p>The value of the <code>id</code> property becomes the name
+ * of a public variable in the MXML document object,
+ * autogenerated by the MXML compiler.
+ * The value of this variable is a reference to the UIComponent object
+ * created from this descriptor.
+ * This is why you can, for example, reference the TextInput control's
+ * <code>text</code> property as <code>firstName.text</code>
+ * from anywhere within the document containing this TextInput instance.</p>
+ *
+ * <p>If an <code>id</code> is specified, and it isn't the empty string,
+ * it also becomes the <code>name</code> of the DisplayObject object.
+ * If an <code>id</code> is not specified or is empty, the DisplayObject
+ * object's <code>name</code> remains an autogenerated string,
+ * such as <code>"Button3"</code>, as returned by the
+ * <code>NameUtil.createUniqueName()</code> method.
+ * The <code>name</code> is used in generating the string returned
+ * by the <code>toString()</code> method.
+ * It can also be used to find the component from its parent
+ * by calling <code>getChildByName()</code>.</p>
+ *
+ * @see flash.display.DisplayObject#name
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var id:String;
+
+ //----------------------------------
+ // properties
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _properties:Object;
+
+ /**
+ * An Object containing name/value pairs for the component's properties,
+ * as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput width="150" text="Hello"/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>properties</code> property
+ * is the Object</p>
+ *
+ * <pre>
+ * { width: 150, text: "Hello" }
+ * </pre>
+ *
+ * <p>The <code>properties</code> property is <code>null</code>
+ * if no MXML properties were specified for the component.
+ * In this case, the component will use default property values.</p>
+ *
+ * <p> This Object is produced by calling the function specified by the
+ * <code>propertiesFactory</code> property, and then cached
+ * for subsequent access.
+ * However, when a Repeater produces multiple instances of a component
+ * from the same descriptor, a fresh copy of the <code>properties</code>
+ * Object should be produced for each component instance so that they
+ * don't share property values which are Arrays or Object references.
+ * The Repeater accomplishes this by calling the
+ * <code>invalidateProperties()</code> method on the descriptor.</p>
+ *
+ * @see #propertiesFactory
+ * @see #invalidateProperties()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get properties():Object
+ {
+ if (_properties)
+ return _properties;
+
+ if (propertiesFactory != null)
+ _properties = propertiesFactory.call(document);
+
+ // Propagate the 'document' property, set by the MXML compiler
+ // on the document descriptor, down to all descendant descriptors.
+ if (_properties)
+ {
+ var cd:Array = _properties.childDescriptors;
+ if (cd)
+ {
+ var n:int = cd.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ cd[i].document = document;
+ }
+ }
+ }
+ else
+ {
+ _properties = {};
+ }
+
+ return _properties;
+ }
+
+ //----------------------------------
+ // propertiesFactory
+ //----------------------------------
+
+ /**
+ * A Function that returns an Object containing name/value pairs
+ * for the component's properties, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput width="150" text="Hello">
+ * </pre>
+ *
+ * <p>then the descriptor's <code>propertiesFactory</code> property
+ * is the Function:</p>
+ *
+ * <pre>
+ * function():Object { return { width: 150, text: "Hello" }; }
+ * </pre>
+ *
+ * <p>The <code>propertiesFactory</code>property is <code>null</code>
+ * if no MXML properties were specified for the component.
+ * In this case, the component will use default property values.</p>
+ *
+ * <p>The reason that <code>propertyFactory</code> is a
+ * Function returning an Object rather than an actual Object
+ * is to allow the tree of ComponentDescriptor objects
+ * to "unfold" incrementally.
+ * If all the descriptors in the descriptor tree for the document
+ * were created at launch time, the time to launch would be greater.</p>
+ *
+ * <p>The <code>properties</code> property returns a cached Object
+ * that was produced by this factory function.</p>
+ *
+ * <p>Note: Event handlers such as <code>click="doSomething();"</code>
+ * appear in the <code>events</code> Object,
+ * not in the <code>properties</code> Object.</p>
+ *
+ * @see #properties
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var propertiesFactory:Function;
+
+ //----------------------------------
+ // type
+ //----------------------------------
+
+ /**
+ * The Class of the component, as specified in MXML.
+ *
+ * <p>For example, if you write</p>
+ *
+ * <pre>
+ * <mx:TextInput/>
+ * </pre>
+ *
+ * <p>then the descriptor's <code>type</code> property
+ * the Class mx.controls.TextInput.</p>
+ *
+ * <p>The property is never <code>null</code> for the
+ * ComponentDescriptor objects created by the MXML compiler,
+ * because every MXML tag has a tag name such as mx:TextInput.</p>
+ *
+ * <p>The mapping between an MXML tag and its corresponding class
+ * is determined by the XML namespace and the "manifest" file,
+ * if any, that is associated with that namespace.
+ * For example, the standard Flex namespace
+ * <code>http://www.adobe.com/2006/mxml</code>
+ * represented by the mx: prefix is associated (in the flex-config.xml
+ * file) with the manifest file mxml-manifest.xml,
+ * and this file has the tag</p>
+ *
+ * <pre>
+ * <component id="TextInput" class="mx.controls.TextInput"/>
+ * </pre>
+ *
+ * <p>which maps the tag name mx:TextInput
+ * to the Class mx.controls.TextInput.
+ * Note that the use of a manifest file allows components in single
+ * XML namespace to map to classes in multiple ActionScript packages.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var type:Class;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Invalidates the cached <code>properties</code> property.
+ * The next time you read the <code>properties</code> property,
+ * the properties are regenerated from the function specified by the
+ * value of the <code>propertiesFactory</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function invalidateProperties():void
+ {
+ _properties = null;
+ }
+
+ /**
+ * Returns the string "ComponentDescriptor_" plus the value of the
+ * <code>id</code> property.
+ *
+ * @return The string "ComponentDescriptor_" plus the value of the
+ * <code>id</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function toString():String
+ {
+ return "ComponentDescriptor_" + id;
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/ContainerCreationPolicy.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ContainerCreationPolicy.as b/frameworks/projects/MX/src/main/flex/mx/core/ContainerCreationPolicy.as
new file mode 100644
index 0000000..7e9cb5d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ContainerCreationPolicy.as
@@ -0,0 +1,109 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The ContainerCreationPolicy class defines the constant values
+ * for the <code>creationPolicy</code> property of the Container class.
+ *
+ * @see mx.core.Container#creationPolicy
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public final class ContainerCreationPolicy
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Delay creating some or all descendants until they are needed.
+ *
+ * <p>For example, if a navigator container such as a TabNavigator
+ * has this <code>creationPolicy</code>, it will immediately create
+ * all of its children, plus the descendants of the initially
+ * selected child.
+ * However, it will wait to create the descendants of the other children
+ * until the user navigates to them.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const AUTO:String = "auto";
+
+ /**
+ * Immediately create all descendants.
+ *
+ * <p>Avoid using this <code>creationPolicy</code> because
+ * it increases the startup time of your application.
+ * There is usually no good reason to create components at startup
+ * which the user cannot see.
+ * If you are using this policy so that you can "push" data into
+ * hidden components at startup, you should instead design your
+ * application so that the data is stored in data variables
+ * and components which are created later "pull" in this data,
+ * via databinding or an <code>initialize</code> handler.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const ALL:String = "all";
+
+ /**
+ * Add the container to a creation queue.
+ * Deprecated since Flex 4.0.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const QUEUED:String = "queued";
+
+ /**
+ * Do not create any children.
+ *
+ * <p>With this <code>creationPolicy</code>, it is the developer's
+ * responsibility to programmatically create the children
+ * from the UIComponentDescriptors by calling
+ * <code>createComponentsFromDescriptors()</code>
+ * on the parent container.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const NONE:String = "none";
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/ContainerGlobals.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/ContainerGlobals.as b/frameworks/projects/MX/src/main/flex/mx/core/ContainerGlobals.as
new file mode 100644
index 0000000..5c76b97
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/ContainerGlobals.as
@@ -0,0 +1,114 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+COMPILE::AS3
+{
+ import flash.display.InteractiveObject;
+}
+COMPILE::JS
+{
+ import flex.display.InteractiveObject;
+}
+import mx.managers.IFocusManager;
+import mx.managers.IFocusManagerContainer;
+
+/**
+* @private
+*/
+public class ContainerGlobals
+{
+ /**
+ * @private
+ * Internal variable that keeps track of the container
+ * that currently has focus.
+ */
+ public static var focusedContainer:InteractiveObject;
+
+ /**
+ * @private
+ * Support for defaultButton.
+ */
+ public static function checkFocus(oldObj:InteractiveObject,
+ newObj:InteractiveObject):void
+ {
+ var objParent:InteractiveObject = newObj;
+ var currObj:InteractiveObject = newObj;
+ var lastUIComp:IUIComponent = null;
+
+ if (newObj != null && oldObj == newObj)
+ return;
+
+ // Find the Container parent with a defaultButton defined.
+ while (currObj)
+ {
+ if (currObj.parent)
+ {
+ objParent = currObj.parent;
+ }
+ else
+ {
+ objParent = null;
+ }
+
+ if (currObj is IUIComponent)
+ lastUIComp = IUIComponent(currObj);
+
+ currObj = objParent;
+
+ if (currObj &&
+ currObj is IFocusManagerContainer && IFocusManagerContainer(currObj).defaultButton)
+ {
+ break;
+ }
+ }
+
+ if (ContainerGlobals.focusedContainer != currObj ||
+ (ContainerGlobals.focusedContainer == null && currObj == null))
+ {
+ if (!currObj)
+ currObj = InteractiveObject(lastUIComp);
+
+ if (currObj && currObj is IFocusManagerContainer)
+ {
+ var fm:IFocusManager = IFocusManagerContainer(currObj).focusManager;
+ if (!fm)
+ return;
+ var defButton:IButton = IFocusManagerContainer(currObj).defaultButton as IButton;
+ if (defButton)
+ {
+ ContainerGlobals.focusedContainer = InteractiveObject(currObj);
+ fm.defaultButton = defButton as IButton;
+ }
+ else
+ {
+ ContainerGlobals.focusedContainer = InteractiveObject(currObj);
+ fm.defaultButton = null;
+ }
+ }
+ }
+ }
+
+
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/DPIClassification.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/DPIClassification.as b/frameworks/projects/MX/src/main/flex/mx/core/DPIClassification.as
new file mode 100644
index 0000000..acd4a2d
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/DPIClassification.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * An enum of the device screen density classess.
+ *
+ * When working with DPI, Flex collapses similar DPI values into DPI classes.
+ *
+ * @see spark.components.Application#applicationDPI
+ * @see spark.components.Application#runtimeDPI
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+public final class DPIClassification
+{
+ /**
+ * Density value for extra-low-density devices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion ApacheFlex 4.11
+ */
+ public static const DPI_120:Number = 120;
+
+ /**
+ * Density value for low-density devices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const DPI_160:Number = 160;
+
+ /**
+ * Density value for medium-density devices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const DPI_240:Number = 240;
+
+ /**
+ * Density value for high-density devices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+ public static const DPI_320:Number = 320;
+
+ /**
+ * Density value for extra-high-density devices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion ApacheFlex 4.10
+ */
+ public static const DPI_480:Number = 480;
+
+ /**
+ * Density value for extra-extra-high-density devices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion ApacheFlex 4.11
+ */
+ public static const DPI_640:Number = 640;
+}
+}
\ 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/core/DesignLayer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/DesignLayer.as b/frameworks/projects/MX/src/main/flex/mx/core/DesignLayer.as
new file mode 100644
index 0000000..de98fe9
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/DesignLayer.as
@@ -0,0 +1,447 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+ import org.apache.flex.events.EventDispatcher;
+ import mx.events.PropertyChangeEvent;
+ import mx.events.PropertyChangeEventKind;
+
+ /**
+ * Dispatched by the layer when either <code>effectiveVisibility</code> or
+ * <code>effectiveAlpha</code> changes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ [Event(name="layerPropertyChange", type="mx.events.PropertyChangeEvent")]
+
+ /**
+ * The DesignLayer class represents a visibility group that can be associated
+ * with one or more IVisualElement instances at runtime.
+ *
+ * DesignLayer instances support a <code>visible</code> and alpha property
+ * that when set will propagate to the associated layer children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public class DesignLayer extends EventDispatcher implements IMXMLObject
+ {
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function DesignLayer()
+ {
+ super();
+ }
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for id property.
+ */
+ private var _id:String;
+
+ /**
+ * ID of the layer component. This value becomes the instance name of the
+ * layer and as such, should not contain any white space or special
+ * characters.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get id():String
+ {
+ return _id;
+ }
+
+ /**
+ * @private
+ */
+ public function set id(value:String):void
+ {
+ _id = value;
+ }
+
+ //----------------------------------
+ // parent
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for parent property.
+ */
+ private var _parent:DesignLayer;
+
+ /**
+ * This layer's parent layer.
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get parent():DesignLayer
+ {
+ return _parent;
+ }
+
+ /**
+ * @private
+ * Called when a DesignLayer instance is added to or removed from a parent.
+ * Developers typically never need to call this method.
+ *
+ * @param p The new parent layer of this DesignLayer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ protected function parentChanged(value:DesignLayer):void
+ {
+ // We remove our layer from the old parent unless the new
+ // parent is null (in this case we know we are invoking this
+ // directly from removeLayer).
+ if (_parent && value)
+ _parent.removeLayer(this);
+
+ _parent = value;
+ effectiveVisibilityChanged(_visible);
+ effectiveAlphaChanged(_alpha);
+ }
+
+ //----------------------------------
+ // layerChildren
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var layerChildren:Array = [];
+
+ //----------------------------------
+ // visible
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _visible:Boolean = true;
+
+ /**
+ * The visibility for this design layer instance.
+ *
+ * <p>When updated, the appropriate change event for <code>effectiveVisibility</code>
+ * will be dispatched to all <code>layerPropertyChange</code> listeners for
+ * this layer, as well as those of affected descendant layers if any.</p>
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get visible():Boolean
+ {
+ return _visible;
+ }
+
+ /**
+ * @private
+ */
+ public function set visible(value:Boolean):void
+ {
+ if (_visible != value)
+ {
+ _visible = value;
+ effectiveVisibilityChanged(effectiveVisibility);
+ }
+ }
+
+ //----------------------------------
+ // effectiveVisibility
+ //----------------------------------
+
+ /**
+ * Returns the effective visibility of this design layer.
+ * This value takes into consideration the visibility of
+ * this layer and any ancestor layers.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get effectiveVisibility():Boolean
+ {
+ var isVisible:Boolean = _visible;
+ var currentLayer:DesignLayer = this;
+ while (isVisible && currentLayer.parent)
+ {
+ currentLayer = currentLayer.parent;
+ isVisible = currentLayer.visible;
+ }
+ return isVisible;
+ }
+
+ /**
+ * @private
+ * Used to notify the visual elements associated with this layer that the
+ * effective visiblity has changed. Dispatches a <code>layerPropertyChange</code>
+ * event with property field set to "effectiveVisibility".
+ */
+ protected function effectiveVisibilityChanged(value:Boolean):void
+ {
+ dispatchEvent(new PropertyChangeEvent("layerPropertyChange", false,
+ false, PropertyChangeEventKind.UPDATE, "effectiveVisibility",
+ !effectiveVisibility, effectiveVisibility));
+
+ for (var i:int = 0; i < layerChildren.length; i++)
+ {
+ var layerChild:DesignLayer = layerChildren[i];
+
+ // We only need to notify those layers that are visible, because
+ // those that aren't don't really care about their layer parents
+ // visibility.
+ if (layerChild.visible)
+ layerChild.effectiveVisibilityChanged(value);
+ }
+ }
+
+ //----------------------------------
+ // alpha
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _alpha:Number = 1.0;
+
+ /**
+ * The alpha for this design layer instance, between 0.0 and 1.0.
+ *
+ * <p>When updated, the appropriate change event for <code>effectiveAlpha</code>
+ * will be dispatched to all <code>layerPropertyChange</code> listeners
+ * for this layer, as well as those of affected descendant layers if any.</p>
+ *
+ * @default 1.0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get alpha():Number
+ {
+ return _alpha;
+ }
+
+ /**
+ * @private
+ */
+ public function set alpha(value:Number):void
+ {
+ if (_alpha != value)
+ {
+ var oldAlpha:Number = _alpha;
+ _alpha = value;
+ effectiveAlphaChanged(oldAlpha);
+ }
+ }
+
+ //----------------------------------
+ // effectiveAlpha
+ //----------------------------------
+
+ /**
+ * Property that returns the effective alpha, between 0.0 and 1.0,
+ * of this design layer.
+ * This value multiplies the alpha of this layer by the alpha of
+ * any ancestor layers.
+ *
+ * @default 1.0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get effectiveAlpha():Number
+ {
+ var currentAlpha:Number = _alpha;
+ var currentLayer:DesignLayer = this;
+ while (currentLayer.parent)
+ {
+ currentLayer = currentLayer.parent;
+ currentAlpha = currentAlpha * currentLayer.alpha;
+ }
+ return currentAlpha;
+ }
+
+ /**
+ * @private
+ * Used to notify the visual elements associated with this layer that the
+ * effective alpha has changed. Dispatches a <code>layerPropertyChange</code>
+ * event with the property field set to "effectiveAlpha".
+ */
+ protected function effectiveAlphaChanged(oldAlpha:Number):void
+ {
+ dispatchEvent(new PropertyChangeEvent("layerPropertyChange", false,
+ false, PropertyChangeEventKind.UPDATE, "effectiveAlpha",
+ oldAlpha, effectiveAlpha));
+
+ for (var i:int = 0; i < layerChildren.length; i++)
+ {
+ var layerChild:DesignLayer = layerChildren[i];
+ layerChild.effectiveAlphaChanged(layerChild.alpha);
+ }
+ }
+
+ //----------------------------------
+ // numLayers
+ //----------------------------------
+
+ /**
+ * The number of DesignLayer children directly parented by this layer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get numLayers():int
+ {
+ return layerChildren.length;
+ }
+
+ //----------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //----------------------------------------------------------------------
+
+ /**
+ * Adds a DesignLayer child to this layer.
+ *
+ * @param value The layer child to add.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function addLayer(value:DesignLayer):void
+ {
+ value.parentChanged(this);
+ layerChildren.push(value);
+ }
+
+ /**
+ * Returns the DesignLayer child at the specified index.
+ *
+ * <p>Note that the order of DesignLayer children is insignificant.
+ * The <code>getLayerAt</code> method is meant to be used in
+ * conjunction with numLayers to iterate over the child list.</p>
+ *
+ * @param index The 0-based index of a DesignLayer child.
+ *
+ * @return The specified DesignLayer child if index is between
+ * 0 and <code>numLayers</code> - 1. Returns <code>null</code>
+ * if the index is invalid.
+ *
+ * @see numLayers
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function getLayerAt(index:int):DesignLayer
+ {
+ return ((index < layerChildren.length) && index >= 0) ?
+ layerChildren[index] : null;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function initialized(document:Object, id:String):void
+ {
+ this.id = id;
+ }
+
+ /**
+ * Removes a DesignLayer child from this layer.
+ *
+ * @param value The layer child to remove.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function removeLayer(value:DesignLayer):void
+ {
+ for (var i:int = 0; i < layerChildren.length; i++)
+ {
+ if (layerChildren[i] == value)
+ {
+ value.parentChanged(null);
+ layerChildren.splice(i,1);
+ return;
+ }
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/EdgeMetrics.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/EdgeMetrics.as b/frameworks/projects/MX/src/main/flex/mx/core/EdgeMetrics.as
new file mode 100644
index 0000000..bdd9d4b
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/EdgeMetrics.as
@@ -0,0 +1,201 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * The EdgeMetrics class specifies the thickness, in pixels,
+ * of the four edge regions around a visual component.
+ *
+ * <p>The following Flex properties have values that are EdgeMetrics
+ * objects:</p>
+ *
+ * <ul>
+ * <li>The <code>borderMetrics</code> property of the mx.core.Container and
+ * mx.skins.Border classes includes only the border in the calculations
+ * of the property values of the EdgeMetrics object.</li>
+ *
+ * <li>The <code>viewMetrics</code> property of the mx.core.Container
+ * class, and of subclasses of the Container class, includes possible
+ * scrollbars and non-content elements -- such as a Panel container's
+ * header area and the area for a ControlBar component -- in the calculations
+ * of the property values of the EdgeMetrics object.</li>
+ *
+ * <li>The <code>viewMetricsAndPadding</code> property of the
+ * mx.core.Container class includes the items listed for the
+ * <code>viewMetrics</code> property, plus the any areas defined by
+ * the margins of the container in the calculations of the
+ * property values of the EdgeMetrics object.</li>
+ * </ul>
+ *
+ * <p>These three properites all return a reference to the same
+ * EdgeMetrics object that the Container is using for its measurement
+ * and layout; they do not return a copy of this object.
+ * If you need a copy, call the <code>clone()</code> method.</p>
+ *
+ * @see mx.core.Container
+ * @see mx.skins.Border
+ * @see mx.containers.Panel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class EdgeMetrics
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * An EdgeMetrics object with a value of zero for its
+ * <code>left</code>, <code>top</code>, <code>right</code>,
+ * and <code>bottom</code> properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param left The width, in pixels, of the left edge region.
+ *
+ * @param top The height, in pixels, of the top edge region.
+ *
+ * @param right The width, in pixels, of the right edge region.
+ *
+ * @param bottom The height, in pixels, of the bottom edge region.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function EdgeMetrics(left:Number = 0, top:Number = 0,
+ right:Number = 0, bottom:Number = 0)
+ {
+ super();
+
+ this.left = left;
+ this.top = top;
+ this.right = right;
+ this.bottom = bottom;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // bottom
+ //----------------------------------
+
+ /**
+ * The height, in pixels, of the bottom edge region.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var bottom:Number;
+
+ //----------------------------------
+ // left
+ //----------------------------------
+
+ /**
+ * The width, in pixels, of the left edge region.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var left:Number;
+
+ //----------------------------------
+ // right
+ //----------------------------------
+
+ /**
+ * The width, in pixels, of the right edge region.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var right:Number;
+
+ //----------------------------------
+ // top
+ //----------------------------------
+
+ /**
+ * The height, in pixels, of the top edge region.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public var top:Number;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns a copy of this EdgeMetrics object.
+ *
+ * @return A copy of this EdgeMetrics object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function clone():EdgeMetrics
+ {
+ return new EdgeMetrics(left, top, right, bottom);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/EmbeddedFont.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/EmbeddedFont.as b/frameworks/projects/MX/src/main/flex/mx/core/EmbeddedFont.as
new file mode 100644
index 0000000..11be4e2
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/EmbeddedFont.as
@@ -0,0 +1,223 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+[ExcludeClass]
+
+/**
+ * @private
+ * Describes the properties that make an embedded font unique.
+ */
+public class EmbeddedFont
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // embeddedFontRegistry
+ //----------------------------------
+
+ private static var noEmbeddedFonts:Boolean;
+
+ /**
+ * @private
+ * Storage for the _embeddedFontRegistry property.
+ * Note: This gets initialized on first access,
+ * not when this class is initialized, in order to ensure
+ * that the Singleton registry has already been initialized.
+ */
+ private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
+
+ /**
+ * @private
+ * A reference to the embedded font registry.
+ * Single registry in the system.
+ * Used to look up the moduleFactory of a font.
+ */
+ private static function get embeddedFontRegistry():IEmbeddedFontRegistry
+ {
+ if (!_embeddedFontRegistry && !noEmbeddedFonts)
+ {
+ try
+ {
+ _embeddedFontRegistry = IEmbeddedFontRegistry(
+ Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
+ }
+ catch (e:Error)
+ {
+ noEmbeddedFonts = true;
+ }
+ }
+
+ return _embeddedFontRegistry;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Create a new EmbeddedFont object.
+ *
+ * @param fontName The name of the font.
+ *
+ * @param bold true if the font is bold, false otherwise.
+ *
+ * @param italic true if the font is italic, false otherwise,
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function EmbeddedFont(fontName:String, bold:Boolean, italic:Boolean)
+ {
+ super();
+
+ initialize(fontName, bold, italic);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // bold
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the bold property.
+ */
+ private var _bold:Boolean;
+
+ /**
+ * True if the font is bold
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get bold():Boolean
+ {
+ return _bold;
+ }
+
+ //----------------------------------
+ // fontName
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the fontName property.
+ */
+ private var _fontName:String;
+
+ /**
+ * The name of the font.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get fontName():String
+ {
+ return _fontName;
+ }
+
+ //----------------------------------
+ // fontStyle
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the fontStyle property.
+ */
+ private var _fontStyle:String;
+
+ /**
+ * The style of the font.
+ * The value is one of the values in flash.text.FontStyle.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get fontStyle():String
+ {
+ return _fontStyle;
+ }
+
+ //----------------------------------
+ // italic
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the italic property.
+ */
+ private var _italic:Boolean;
+
+ /**
+ * True if the font is italic
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get italic():Boolean
+ {
+ return _italic;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Initialize
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function initialize(fontName:String, bold:Boolean,
+ italic:Boolean):void
+ {
+ _bold = bold;
+ _italic = italic;
+ _fontName = fontName;
+ _fontStyle = embeddedFontRegistry.getFontStyle(bold, italic);
+}
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/FlexGlobals.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/FlexGlobals.as b/frameworks/projects/MX/src/main/flex/mx/core/FlexGlobals.as
new file mode 100644
index 0000000..b07a5d2
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/FlexGlobals.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+
+/**
+ * A class that contains variables that are global to all applications within
+ * the same ApplicationDomain.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ *
+ */
+public class FlexGlobals
+{
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The first application run in an ApplicationDomain is the top-level application.
+ * This property is set to a reference to the top-level application in the top-level
+ * application's constructor. Each ApplicationDomain will have its own
+ * <code>topLevelApplication</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public static var topLevelApplication:Object;
+}
+
+}
[06/37] git commit: [flex-asjs] [refs/heads/spark] - need to
re-convert places where Flash returns a Flash rectagle
Posted by ah...@apache.org.
need to re-convert places where Flash returns a Flash rectagle
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a99793c3
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a99793c3
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a99793c3
Branch: refs/heads/spark
Commit: a99793c3cc7b74828d4edf2536bc563e7d2685ff
Parents: 40a6abd
Author: Alex Harui <ah...@apache.org>
Authored: Fri Feb 12 15:02:45 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Feb 12 15:02:45 2016 -0800
----------------------------------------------------------------------
.../src/main/flex/org/apache/flex/geom/Rectangle.as | 13 +++++++++++++
1 file changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a99793c3/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
index a68c080..3f48dc0 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
@@ -42,6 +42,14 @@ public class Rectangle extends flash.geom.Rectangle
{
super(x, y, width, height);
}
+
+ /**
+ * Convert rectangles of other types to this Rectangle type.
+ */
+ public static function convert(obj:Object):org.apache.flex.geom.Rectangle
+ {
+ return new org.apache.flex.geom.Rectangle(obj.x, obj.y, obj.width, obj.height);
+ }
}
/**
@@ -89,6 +97,11 @@ public class Rectangle
{
height = value - top;
}
+
+ public static function convert(obj:Object):org.apache.flex.geom.Rectangle
+ {
+ return new org.apache.flex.geom.Rectangle(obj.x, obj.y, obj.width, obj.height);
+ }
}
[25/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as
new file mode 100644
index 0000000..a66b83e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as
@@ -0,0 +1,1034 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.InteractiveObject;
+import flash.display.Sprite;
+import flash.events.ContextMenuEvent;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import flash.events.IOErrorEvent;
+import flash.events.MouseEvent;
+import flash.events.ProgressEvent;
+import flash.geom.Point;
+import flash.text.TextField;
+import flash.text.TextFieldType;
+import flash.ui.Mouse;
+import mx.core.FlexGlobals;
+import org.apache.flex.core.UIBase;
+import mx.core.mx_internal;
+import mx.core.ISystemCursorClient;
+import mx.core.IUIComponent;
+import mx.events.Request;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
+import mx.core.IFlexModuleFactory;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class CursorManagerImpl extends EventDispatcher implements ICursorManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static var instance:ICursorManager;
+
+ /**
+ * @private
+ *
+ * Place to hook in additional classes
+ */
+ public static var mixins:Array;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public static function getInstance():ICursorManager
+ {
+ if (!instance)
+ instance = new CursorManagerImpl();
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function CursorManagerImpl(systemManager:ISystemManager = null)
+ {
+ super();
+
+ if (instance && !systemManager)
+ throw new Error("Instance already exists.");
+
+ if (systemManager)
+ this.systemManager = systemManager as ISystemManager;
+ else
+ this.systemManager = SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager;
+
+ if (mixins)
+ {
+ var n:int = mixins.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ new mixins[i](this);
+
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var nextCursorID:int = 1;
+
+ /**
+ * @private
+ */
+ private var cursorList:Array = [];
+
+ /**
+ * @private
+ */
+ private var busyCursorList:Array = [];
+
+ /**
+ * @private
+ */
+ mx_internal var initialized:Boolean = false;
+
+ /**
+ * @private
+ */
+ mx_internal var cursorHolder:Sprite;
+
+ /**
+ * @private
+ */
+ private var currentCursor:DisplayObject;
+
+ /**
+ * @private
+ */
+ private var listenForContextMenu:Boolean = false;
+
+ /*******************************************************************
+ * Regarding overTextField, showSystemCursor, and showCustomCursor:
+ * Don't modify or read these variables unless you are certain
+ * you will not create race conditions. E.g. you may get the
+ * wrong (or no) cursor, and get stuck in an inconsistent state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+
+ /**
+ * @private
+ */
+ private var overTextField:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var overLink:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var showSystemCursor:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var showCustomCursor:Boolean = false;
+
+ /**
+ * @private
+ *
+ * State variable -- set when there is a custom cursor and the
+ * mouse has left the stage. Upon return, mouseMoveHandler will
+ * restore the custom cursor and remove the system cursor.
+ */
+ private var customCursorLeftStage:Boolean = false;
+
+ /*******************************************************************/
+
+ /**
+ * @private
+ */
+ mx_internal var systemManager:ISystemManager = null;
+
+ /**
+ * @private
+ */
+ mx_internal var sandboxRoot:IEventDispatcher = null;
+
+ /**
+ * @private
+ */
+ private var sourceArray:Array = [];
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentCursorID
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentCursorID:int = 0 /* CursorManager.NO_CURSOR */;
+
+ /**
+ * ID of the current custom cursor,
+ * or CursorManager.NO_CURSOR if the system cursor is showing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentCursorID():int
+ {
+ return _currentCursorID;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentCursorID(value:int):void
+ {
+ _currentCursorID = value;
+
+ if (hasEventListener("currentCursorID"))
+ dispatchEvent(new Event("currentCursorID"));
+ }
+
+ //----------------------------------
+ // currentCursorXOffset
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentCursorXOffset:Number = 0;
+
+ /**
+ * The x offset of the custom cursor, in pixels,
+ * relative to the mouse pointer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentCursorXOffset():Number
+ {
+ return _currentCursorXOffset;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentCursorXOffset(value:Number):void
+ {
+ _currentCursorXOffset = value;
+
+ if (hasEventListener("currentCursorXOffset"))
+ dispatchEvent(new Event("currentCursorXOffset"));
+ }
+
+ //----------------------------------
+ // currentCursorYOffset
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentCursorYOffset:Number = 0;
+
+ /**
+ * The y offset of the custom cursor, in pixels,
+ * relative to the mouse pointer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentCursorYOffset():Number
+ {
+ return _currentCursorYOffset;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentCursorYOffset(value:Number):void
+ {
+ _currentCursorYOffset = value;
+
+ if (hasEventListener("currentCursorYOffset"))
+ dispatchEvent(new Event("currentCursorYOffset"));
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Makes the cursor visible.
+ * Cursor visibility is not reference-counted.
+ * A single call to the <code>showCursor()</code> method
+ * always shows the cursor regardless of how many calls
+ * to the <code>hideCursor()</code> method were made.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function showCursor():void
+ {
+ if (cursorHolder)
+ cursorHolder.visible = true;
+
+ if (hasEventListener("showCursor"))
+ dispatchEvent(new Event("showCursor"));
+ }
+
+ /**
+ * Makes the cursor invisible.
+ * Cursor visibility is not reference-counted.
+ * A single call to the <code>hideCursor()</code> method
+ * always hides the cursor regardless of how many calls
+ * to the <code>showCursor()</code> method were made.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function hideCursor():void
+ {
+ if (cursorHolder)
+ cursorHolder.visible = false;
+
+ if (hasEventListener("hideCursor"))
+ dispatchEvent(new Event("hideCursor"));
+
+ }
+
+ /**
+ * Creates a new cursor and sets an optional priority for the cursor.
+ * Adds the new cursor to the cursor list.
+ *
+ * @param cursorClass Class of the cursor to display.
+ *
+ * @param priority Integer that specifies
+ * the priority level of the cursor.
+ * Possible values are <code>CursorManagerPriority.HIGH</code>,
+ * <code>CursorManagerPriority.MEDIUM</code>, and <code>CursorManagerPriority.LOW</code>.
+ *
+ * @param xOffset Number that specifies the x offset
+ * of the cursor, in pixels, relative to the mouse pointer.
+ *
+ * @param yOffset Number that specifies the y offset
+ * of the cursor, in pixels, relative to the mouse pointer.
+ *
+ * @param setter The IUIComponent that set the cursor. Necessary (in multi-window environments)
+ * to know which window needs to display the cursor.
+ *
+ * @return The ID of the cursor.
+ *
+ * @see mx.managers.CursorManagerPriority
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setCursor(cursorClass:Class, priority:int = 2,
+ xOffset:Number = 0,
+ yOffset:Number = 0):int
+ {
+ if (hasEventListener("setCursor"))
+ {
+ var event:Request = new Request("setCursor", false, true);
+ event.value = [ cursorClass, priority, xOffset, yOffset ];
+ if (!dispatchEvent(event))
+ {
+ return event.value as int;
+ }
+ }
+
+ var cursorID:int = nextCursorID++;
+
+ // Create a new CursorQueueItem.
+ var item:CursorQueueItem = new CursorQueueItem();
+ item.cursorID = cursorID;
+ item.cursorClass = cursorClass;
+ item.priority = priority;
+ item.x = xOffset;
+ item.y = yOffset;
+ if (systemManager)
+ item.systemManager = systemManager;
+ else
+ item.systemManager = FlexGlobals.topLevelApplication.systemManager;
+
+ // Push it onto the cursor list.
+ cursorList.push(item);
+
+ // Re-sort the cursor list based on priority level.
+ cursorList.sort(priorityCompare);
+
+ // Determine which cursor to display
+ showCurrentCursor();
+
+ return cursorID;
+ }
+
+ /**
+ * @private
+ */
+ private function priorityCompare(a:CursorQueueItem, b:CursorQueueItem):int
+ {
+ if (a.priority < b.priority)
+ return -1;
+ else if (a.priority == b.priority)
+ return 0;
+
+ return 1;
+ }
+
+ /**
+ * Removes a cursor from the cursor list.
+ * If the cursor being removed is the currently displayed cursor,
+ * the CursorManager displays the next cursor in the list, if one exists.
+ * If the list becomes empty, the CursorManager displays
+ * the default system cursor.
+ *
+ * @param cursorID ID of cursor to remove.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeCursor(cursorID:int):void
+ {
+ if (hasEventListener("removeCursor"))
+ if (!dispatchEvent(new Request("removeCursor", false, true, cursorID)))
+ return;
+
+ for (var i:Object in cursorList)
+ {
+ var item:CursorQueueItem = cursorList[i];
+ if (item.cursorID == cursorID)
+ {
+ // Remove the element from the array.
+ cursorList.splice(i, 1);
+
+ // Determine which cursor to display.
+ showCurrentCursor();
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * Removes all of the cursors from the cursor list
+ * and restores the system cursor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeAllCursors():void
+ {
+ if (hasEventListener("removeAllCursors"))
+ if (!dispatchEvent(new Event("removeAllCursors", false, true)))
+ return;
+
+ cursorList.splice(0);
+
+ showCurrentCursor();
+ }
+
+ /**
+ * Displays the busy cursor.
+ * The busy cursor has a priority of CursorManagerPriority.LOW.
+ * Therefore, if the cursor list contains a cursor
+ * with a higher priority, the busy cursor is not displayed
+ * until you remove the higher priority cursor.
+ * To create a busy cursor at a higher priority level,
+ * use the <code>setCursor()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setBusyCursor():void
+ {
+ if (hasEventListener("setBusyCursor"))
+ if (!dispatchEvent(new Event("setBusyCursor", false, true)))
+ return;
+
+ var cursorManagerStyleDeclaration:CSSStyleDeclaration =
+ StyleManager.getStyleManager(systemManager as IFlexModuleFactory).
+ getMergedStyleDeclaration("mx.managers.CursorManager");
+
+ var busyCursorClass:Class =
+ cursorManagerStyleDeclaration.getStyle("busyCursor");
+
+ busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW));
+ }
+
+ /**
+ * Removes the busy cursor from the cursor list.
+ * If other busy cursor requests are still active in the cursor list,
+ * which means you called the <code>setBusyCursor()</code> method more than once,
+ * a busy cursor does not disappear until you remove
+ * all busy cursors from the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeBusyCursor():void
+ {
+ if (hasEventListener("removeBusyCursor"))
+ if (!dispatchEvent(new Event("removeBusyCursor", false, true)))
+ return;
+
+ if (busyCursorList.length > 0)
+ removeCursor(int(busyCursorList.pop()));
+ }
+
+ /**
+ * @private
+ * Decides what cursor to display.
+ */
+ private function showCurrentCursor():void
+ {
+ // if there are custom cursors...
+ if (cursorList.length > 0)
+ {
+ if (!initialized)
+ {
+ initialized = true;
+
+ var e:Event;
+ if (hasEventListener("initialize"))
+ {
+ e = new Event("initialize", false, true);
+ }
+ if (!e || dispatchEvent(e))
+ {
+ // The first time a cursor is requested of the CursorManager,
+ // create a Sprite to hold the cursor symbol
+ cursorHolder = new UIBase();
+ cursorHolder.name = "cursorHolder";
+ cursorHolder.mouseEnabled = false;
+ cursorHolder.mouseChildren = false;
+ systemManager.cursorChildren.addChild(cursorHolder);
+ }
+ }
+
+ // Get the top most cursor.
+ var item:CursorQueueItem = cursorList[0];
+
+ // If the system cursor was being displayed, hide it.
+ if (currentCursorID == CursorManager.NO_CURSOR)
+ Mouse.hide();
+
+ // If the current cursor has changed...
+ if (item.cursorID != currentCursorID)
+ {
+ if (cursorHolder.numChildren > 0)
+ cursorHolder.removeChildAt(0);
+
+ currentCursor = new item.cursorClass();
+
+ if (currentCursor)
+ {
+ if (currentCursor is InteractiveObject)
+ InteractiveObject(currentCursor).mouseEnabled = false;
+ if (currentCursor is DisplayObjectContainer)
+ DisplayObjectContainer(currentCursor).mouseChildren = false;
+ cursorHolder.addChild(currentCursor);
+
+ addContextMenuHandlers();
+
+ var pt:Point;
+ // make sure systemManager is not other implementation of ISystemManager
+ if (systemManager is SystemManager)
+ {
+ pt = new Point(SystemManager(systemManager).mouseX + item.x, SystemManager(systemManager).mouseY + item.y);
+ pt = SystemManager(systemManager).localToGlobal(pt);
+ pt = cursorHolder.parent.globalToLocal(pt);
+ cursorHolder.x = pt.x;
+ cursorHolder.y = pt.y;
+ }
+ // WindowedSystemManager
+ else if (systemManager is DisplayObject)
+ {
+ pt = new Point(DisplayObject(systemManager).mouseX + item.x, DisplayObject(systemManager).mouseY + item.y);
+ pt = DisplayObject(systemManager).localToGlobal(pt);
+ pt = cursorHolder.parent.globalToLocal(pt);
+ cursorHolder.x = DisplayObject(systemManager).mouseX + item.x;
+ cursorHolder.y = DisplayObject(systemManager).mouseY + item.y;
+ }
+ // otherwise
+ else
+ {
+ cursorHolder.x = item.x;
+ cursorHolder.y = item.y;
+ }
+
+ COMPILE::LATER
+ {
+ var e2:Event;
+ if (hasEventListener("addMouseMoveListener"))
+ e2 = new Event("addMouseMoveListener", false, true);
+ if (!e2 || dispatchEvent(e2))
+ systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE,
+ mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);
+
+ var e3:Event;
+ if (hasEventListener("addMouseOutListener"))
+ e3 = new Event("addMouseOutListener", false, true);
+ if (!e3 || dispatchEvent(e3))
+ systemManager.stage.addEventListener(MouseEvent.MOUSE_OUT,
+ mouseOutHandler,true,EventPriority.CURSOR_MANAGEMENT);
+ }
+ }
+
+ currentCursorID = item.cursorID;
+ currentCursorXOffset = item.x;
+ currentCursorYOffset = item.y;
+ }
+ }
+ else
+ {
+ showCustomCursor = false;
+
+ if (currentCursorID != CursorManager.NO_CURSOR)
+ {
+ // There is no cursor in the cursor list to display,
+ // so cleanup and restore the system cursor.
+ currentCursorID = CursorManager.NO_CURSOR;
+ currentCursorXOffset = 0;
+ currentCursorYOffset = 0;
+
+ COMPILE::LATER
+ {
+ var e4:Event;
+ if (hasEventListener("removeMouseMoveListener"))
+ e4 = new Event("removeMouseMoveListener", false, true)
+ if (!e4 || dispatchEvent(e4))
+ {
+ systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE,
+ mouseMoveHandler,true);
+ }
+
+ var e5:Event;
+ if (hasEventListener("removeMouseMoveListener"))
+ e5 = new Event("removeMouseOutListener", false, true)
+ if (!e5 || dispatchEvent(e5))
+ {
+ systemManager.stage.removeEventListener(MouseEvent.MOUSE_OUT,
+ mouseOutHandler,true);
+ }
+ }
+ cursorHolder.removeChild(currentCursor);
+
+ removeContextMenuHandlers();
+ }
+ Mouse.show();
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function addContextMenuHandlers():void
+ {
+ if (!listenForContextMenu)
+ {
+ const app:InteractiveObject = systemManager.document as InteractiveObject;
+ const sm:InteractiveObject = systemManager as InteractiveObject;
+
+ COMPILE::LATER
+ {
+ if (app && app.contextMenu)
+ {
+ app.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler,
+ true, EventPriority.CURSOR_MANAGEMENT);
+ listenForContextMenu = true;
+ }
+
+ if (sm && sm.contextMenu)
+ {
+ sm.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler,
+ true, EventPriority.CURSOR_MANAGEMENT);
+ listenForContextMenu = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function removeContextMenuHandlers():void
+ {
+ if (listenForContextMenu)
+ {
+ const app:InteractiveObject = systemManager.document as InteractiveObject;
+ const sm:InteractiveObject = systemManager as InteractiveObject;
+
+ if (app && app.contextMenu)
+ app.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true);
+
+ if (sm && sm.contextMenu)
+ sm.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true);
+
+ listenForContextMenu = false;
+ }
+ }
+
+ /**
+ * @private
+ * Called by other components if they want to display
+ * the busy cursor during progress events.
+ */
+ public function registerToUseBusyCursor(source:Object):void
+ {
+ if (hasEventListener("registerToUseBusyCursor"))
+ if (!dispatchEvent(new Request("registerToUseBusyCursor", false, true, source)))
+ return;
+
+ if (source && source is EventDispatcher)
+ {
+ source.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+ source.addEventListener(Event.COMPLETE, completeHandler);
+ source.addEventListener(IOErrorEvent.IO_ERROR, completeHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Called by other components to unregister
+ * a busy cursor from the progress events.
+ */
+ public function unRegisterToUseBusyCursor(source:Object):void
+ {
+ if (hasEventListener("unRegisterToUseBusyCursor"))
+ if (!dispatchEvent(new Request("unRegisterToUseBusyCursor", false, true, source)))
+ return;
+
+ if (source && source is EventDispatcher)
+ {
+ source.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
+ source.removeEventListener(Event.COMPLETE, completeHandler);
+ source.removeEventListener(IOErrorEvent.IO_ERROR, completeHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Called when contextMenu is opened
+ */
+ private function contextMenu_menuSelectHandler(event:ContextMenuEvent):void
+ {
+ showCustomCursor = true; // Restore the custom cursor
+ // Standalone player doesn't initially send mouseMove when the contextMenu is closed,
+ // so we need to listen for mouseOver as well.
+ sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
+ }
+
+ /**
+ * @private
+ */
+ private function mouseOverHandler(event:MouseEvent):void
+ {
+ sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
+ mouseMoveHandler(event);
+ }
+
+ /**
+ * @private
+ */
+ private function findSource(target:Object):int
+ {
+ var n:int = sourceArray.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (sourceArray[i] === target)
+ return i;
+ }
+ return -1;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ *
+ * Handles the mouse leaving the stage; hides the custom cursor and restores the system cursor.
+ */
+ mx_internal function mouseOutHandler(event:MouseEvent):void
+ {
+ // relatedObject==null implies the mouse left the stage.
+ // this also fires when you are returning from a context menu click.
+ //
+ // it sometimes fires after you drag off the stage, and back to the stage quickly,
+ // and let go of the button -- this seems like a player bug
+ if ((event.relatedObject == null) && (cursorList.length > 0))
+ {
+ //trace("mouseOutHandler", event);
+
+ // this will get unset in mouseMoveHandler (since that fires when
+ // the mouse returns/glides over the stage)
+ customCursorLeftStage = true;
+ hideCursor();
+ Mouse.show();
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function mouseMoveHandler(event:MouseEvent):void
+ {
+
+ var pt:Point = new Point(event.stageX, event.stageY);
+ pt = cursorHolder.parent.globalToLocal(pt);
+ pt.x += currentCursorXOffset;
+ pt.y += currentCursorYOffset;
+ cursorHolder.x = pt.x;
+ cursorHolder.y = pt.y;
+
+ var target:Object = event.target;
+
+ var isInputTextField:Boolean =
+ (target is TextField && target.type == TextFieldType.INPUT) ||
+ (target is ISystemCursorClient &&
+ ISystemCursorClient(target).showSystemCursor);
+
+ // Do target test.
+ if (!overTextField && isInputTextField)
+ {
+ overTextField = true;
+ showSystemCursor = true;
+ }
+ else if (overTextField && !isInputTextField)
+ {
+ overTextField = false;
+ showCustomCursor = true;
+ }
+ else
+ {
+ showCustomCursor = true
+ }
+
+ // Handle switching between system and custom cursor.
+ if (showSystemCursor)
+ {
+ showSystemCursor = false;
+ cursorHolder.visible = false;
+ Mouse.show();
+ }
+ if (showCustomCursor)
+ {
+ showCustomCursor = false;
+ cursorHolder.visible = true;
+ Mouse.hide();
+
+ if (hasEventListener("showCustomCursor"))
+ dispatchEvent(new Event("showCustomCursor"));
+ }
+ }
+
+ /**
+ * @private
+ * Displays the busy cursor if a component is in a busy state.
+ */
+ private function progressHandler(event:ProgressEvent):void
+ {
+ // Only pay attention to the first progress call. Ignore all others.
+ var sourceIndex:int = findSource(event.target);
+ if (sourceIndex == -1)
+ {
+ // Add the target to the list of objects we are listening for.
+ sourceArray.push(event.target);
+
+ setBusyCursor();
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function completeHandler(event:Event):void
+ {
+ var sourceIndex:int = findSource(event.target);
+ if (sourceIndex != -1)
+ {
+ // Remove from the list of targets we are listening to.
+ sourceArray.splice(sourceIndex, 1);
+
+ removeBusyCursor();
+ }
+ }
+
+}
+
+}
+
+import mx.managers.CursorManager;
+import mx.managers.CursorManagerPriority;
+import mx.managers.ISystemManager;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: CursorQueueItem
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+class CursorQueueItem
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function CursorQueueItem()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public var cursorID:int = CursorManager.NO_CURSOR;
+
+ /**
+ * @private
+ */
+ public var cursorClass:Class = null;
+
+ /**
+ * @private
+ */
+ public var priority:int = CursorManagerPriority.MEDIUM;
+
+ /**
+ * @private
+ */
+ public var systemManager:ISystemManager;
+
+ /**
+ * @private
+ */
+ public var x:Number;
+
+ /**
+ * @private
+ */
+ public var y:Number;
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as
new file mode 100644
index 0000000..43bfd1a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as
@@ -0,0 +1,79 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+/**
+ * The CursorManagerPriority class defines the constant values for the
+ * <code>priority</code> argument to the
+ * <code>CursorManager.setCursor()</code> method.
+ *
+ * @see mx.managers.CursorManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public final class CursorManagerPriority
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constant that specifies the highest cursor priority when passed
+ * as the <code>priority</code> argument to <code>setCursor()</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const HIGH:int = 1;
+
+ /**
+ * Constant that specifies a medium cursor priority when passed
+ * as the <code>priority</code> argument to <code>setCursor()</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const MEDIUM:int = 2;
+
+ /**
+ * Constant that specifies the lowest cursor priority when passed
+ * as the <code>priority</code> argument to <code>setCursor()</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const LOW:int = 3;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as
new file mode 100644
index 0000000..4594de1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public interface ICursorManager
+{
+ function get currentCursorID():int;
+ function set currentCursorID(value:int):void;
+ function get currentCursorXOffset():Number
+ function set currentCursorXOffset(value:Number):void;
+ function get currentCursorYOffset():Number
+ function set currentCursorYOffset(value:Number):void;
+
+ function showCursor():void;
+ function hideCursor():void;
+ function setCursor(cursorClass:Class, priority:int = 2,
+ xOffset:Number = 0, yOffset:Number = 0):int;
+ function removeCursor(cursorID:int):void;
+ function removeAllCursors():void;
+ function setBusyCursor():void;
+ function removeBusyCursor():void;
+
+ function registerToUseBusyCursor(source:Object):void;
+ function unRegisterToUseBusyCursor(source:Object):void;
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..33dab83
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as
@@ -0,0 +1,300 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import org.apache.flex.core.IUIBase;
+import org.apache.flex.events.IEventDispatcher;
+//import flash.display.InteractiveObject;
+import flash.display.Sprite;
+import mx.core.IButton;
+
+/**
+ * The IFocusManager interface defines the interface that components must implement
+ * to manage the focus on components in response to mouse activity or
+ * keyboard activity (Tab key), and to support a default button.
+ *
+ * @see mx.managers.FocusManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFocusManager extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // defaultButton
+ //----------------------------------
+
+ /**
+ * A reference to the original default Button control.
+ * Pressing the Enter key while the focus is on any control
+ * activates the Button control by dispatching a <code>click</code> event
+ * on the Button control, just as if it was clicked with the mouse.
+ * The actual default Button control changes if focus is given to another
+ * Button control, but switches back to the original if focus is not
+ * on a button.
+ *
+ * <p>This property is managed by Flex containers; do not set it directly
+ * to specify the default button.</p>
+ *
+ * <p>The <code>defaultButton</code> must be of class
+ * <code>mx.controls.Button</code> even though this property
+ * is of type <code>IUIComponent</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get defaultButton():IButton;
+
+ /**
+ * @private
+ */
+ function set defaultButton(value:IButton):void;
+
+ //----------------------------------
+ // defaultButtonEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the FocusManager should
+ * check for the Enter key being pressed to activate the default button.
+ * TextArea and other components that want to recognize
+ * the <code>Enter</code> key
+ * set this property to <code>false</code> to disable the Enter
+ * key from dispatching a <code>click</code> event on the
+ * default button, if it exists.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get defaultButtonEnabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set defaultButtonEnabled(value:Boolean):void;
+
+ //----------------------------------
+ // focusPane
+ //----------------------------------
+
+ /**
+ * A single Sprite that is moved from container to container
+ * as the focus moves to those containers.
+ * The Sprite is used as the parent of the visual indicator
+ * that a component has focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusPane():Sprite;
+
+ /**
+ * @private
+ */
+ function set focusPane(value:Sprite):void;
+
+ //----------------------------------
+ // nextTabIndex
+ //----------------------------------
+
+ /**
+ * The next unique tab index to use in this tab loop.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get nextTabIndex():int;
+
+ //----------------------------------
+ // showFocusIndicator
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether to display an indicator that
+ * a component has focus.
+ * If <code>true</code> a component receiving focus
+ * draws a visible indicator that it has focus.
+ *
+ * <p>By default, this is <code>false</code> until the user uses
+ * the Tab key, then it is set to <code>true</code>.</p>
+ *
+ * <p>In general it is better to use
+ * the <code>showFocus()</code> and <code>hideFocus()</code> methods
+ * to change this property as those methods also update the
+ * visual indicator that a component has focus.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get showFocusIndicator():Boolean;
+
+ /**
+ * @private
+ */
+ function set showFocusIndicator(value:Boolean):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the IFocusManagerComponent component that currently has the focus.
+ * Calling this method is recommended instead of using the Stage object
+ * because it indicates which component has focus.
+ * The Stage might return a subcomponent in that component.
+ *
+ * @return IFocusManagerComponent object that has focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getFocus():IFocusManagerComponent;
+
+ /**
+ * Sets focus to an IFocusManagerComponent component. Does not check for
+ * the components visibility, enabled state, or any other conditions.
+ *
+ * @param o A component that can receive focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setFocus(o:IFocusManagerComponent):void;
+
+ /**
+ * Sets <code>showFocusIndicator</code> to <code>true</code>
+ * and draws the visual focus indicator on the focused object, if any.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function showFocus():void;
+
+ /**
+ * Sets <code>showFocusIndicator</code> to <code>false</code>
+ * and removes the visual focus indicator from the focused object, if any.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function hideFocus():void;
+
+ /**
+ * The SystemManager activates and deactivates a FocusManager
+ * if more than one IFocusManagerContainer is visible at the same time.
+ * If the mouse is clicked in an IFocusManagerContainer with a deactivated
+ * FocusManager, the SystemManager will call
+ * the <code>activate()</code> method on that FocusManager.
+ * The FocusManager that was activated will have its <code>deactivate()</code> method
+ * called prior to the activation of another FocusManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function activate():void;
+
+ /**
+ * The SystemManager activates and deactivates a FocusManager
+ * if more than one IFocusManagerContainer is visible at the same time.
+ * If the mouse is clicked in an IFocusManagerContainer with a deactivated
+ * FocusManager, the SystemManager will call
+ * the <code>activate()</code> method on that FocusManager.
+ * The FocusManager that was activated will have its <code>deactivate()</code> method
+ * called prior to the activation of another FocusManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function deactivate():void;
+
+ /**
+ * Returns the IFocusManagerComponent that contains the given object, if any.
+ * Because the player can set focus to a subcomponent of a Flex component
+ * this method determines which IFocusManagerComponent has focus from
+ * the component perspective.
+ *
+ * @param o An object that can have player-level focus.
+ *
+ * @return The IFOcusManagerComponent containing <code>o</code> or
+ * <code>null</code>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function findFocusManagerComponent(o:IUIBase /* was InteractiveObject*/):IFocusManagerComponent;
+
+ /**
+ * Returns the IFocusManagerComponent that would receive focus
+ * if the user pressed the Tab key to navigate to another component.
+ * It will return the same component as the current focused component
+ * if there are no other valid components in the application.
+ *
+ * @param backward If <code>true</code>, return the object
+ * as if the Shift-Tab keys were pressed.
+ *
+ * @return The component that would receive focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getNextFocusManagerComponent(
+ backward:Boolean = false):IFocusManagerComponent;
+
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as
new file mode 100644
index 0000000..20487e1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as
@@ -0,0 +1,193 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+/**
+ * The IFocusManagerComponent interface defines the interface
+ * that focusable components must implement in order to
+ * receive focus from the FocusManager.
+ * The base implementations of this interface are in the UIComponent class,
+ * but UIComponent does not implement the full IFocusManagerComponent interface
+ * since some UIComponents are not intended to receive focus.
+ * Therefore, to make a UIComponent-derived component be a valid focusable
+ * component, you simply add "implements IFocusManagerComponent" to the class
+ * definition.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFocusManagerComponent
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // focusEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the component can receive focus when selected.
+ *
+ * <p>As an optimization, if a child component in your component
+ * implements the IFocusManagerComponent interface, and you
+ * never want it to receive focus,
+ * you can set <code>focusEnabled</code>
+ * to <code>false</code> before calling <code>addChild()</code>
+ * on the child component.</p>
+ *
+ * <p>This will cause the FocusManager to ignore this component
+ * and not monitor it for changes to the <code>tabFocusEnabled</code>,
+ * <code>hasFocusableChildren</code>, and <code>mouseFocusEnabled</code> properties.
+ * This also means you cannot change this value after
+ * <code>addChild()</code> and expect the FocusManager to notice.</p>
+ *
+ * <p>Note: It does not mean that you cannot give this object focus
+ * programmatically in your <code>setFocus()</code> method;
+ * it just tells the FocusManager to ignore this IFocusManagerComponent
+ * component in the Tab and mouse searches.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusEnabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set focusEnabled(value:Boolean):void;
+
+ //----------------------------------
+ // hasFocusableChildren
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#hasFocusableChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get hasFocusableChildren():Boolean;
+
+ /**
+ * @private
+ */
+ function set hasFocusableChildren(value:Boolean):void;
+
+ //----------------------------------
+ // mouseFocusEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the component can receive focus
+ * when selected with the mouse.
+ * If <code>false</code>, focus will be transferred to
+ * the first parent that is <code>mouseFocusEnabled</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mouseFocusEnabled():Boolean;
+
+ //----------------------------------
+ // tabFocusEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether pressing the Tab key eventually
+ * moves focus to this component.
+ * Even if <code>false</code>, you can still be given focus
+ * by being selected with the mouse or via a call to
+ * <code>setFocus()</code>. This property replaces
+ * InteractiveObject.tabEnabled which must be set to true
+ * in Flex apps.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get tabFocusEnabled():Boolean;
+
+ //----------------------------------
+ // tabIndex
+ //----------------------------------
+
+ /**
+ * If <code>tabFocusEnabled</code>, the order in which the component receives focus.
+ * If -1, then the component receives focus based on z-order.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get tabIndex():int;
+
+ /**
+ * @private
+ */
+ function set tabIndex(value:int):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Called by the FocusManager when the component receives focus.
+ * The component may in turn set focus to an internal component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setFocus():void;
+
+ /**
+ * Called by the FocusManager when the component receives focus.
+ * The component should draw or hide a graphic
+ * that indicates that the component has focus.
+ *
+ * @param isFocused If <code>true</code>, draw the focus indicator,
+ * otherwise hide it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function drawFocus(isFocused:Boolean):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..9d96121
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as
@@ -0,0 +1,130 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import flex.display.DisplayObject;
+import org.apache.flex.events.IEventDispatcher;
+import mx.core.IFlexDisplayObject;
+import mx.managers.IFocusManager;
+import mx.managers.ISystemManager;
+
+/**
+ * The IFocusManagerContainer interface defines the interface that
+ * containers implement to host a FocusManager.
+ * The PopUpManager automatically installs a FocusManager
+ * in any IFocusManagerContainer it pops up.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFocusManagerContainer extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // focusManager
+ //----------------------------------
+
+ /**
+ * The FocusManager for this component.
+ * The FocusManager must be in a <code>focusManager</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusManager():IFocusManager;
+
+ /**
+ * @private
+ */
+ function set focusManager(value:IFocusManager):void;
+
+ //----------------------------------
+ // defaultButton
+ //----------------------------------
+
+ /**
+ * The Button control designated as the default button
+ * for the container.
+ * When controls in the container have focus, pressing the
+ * Enter key is the same as clicking this Button control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ * @default null
+ */
+ function get defaultButton():IFlexDisplayObject;
+
+ /**
+ * @private
+ */
+ function set defaultButton(value:IFlexDisplayObject):void;
+
+ //----------------------------------
+ // systemManager
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#systemManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get systemManager():ISystemManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether the specified display object is a child
+ * of the container instance or the instance itself.
+ * The search includes the entire display list including this container instance.
+ * Grandchildren, great-grandchildren, and so on each return <code>true</code>.
+ *
+ * @param child The child object to test.
+ *
+ * @return <code>true</code> if the child object is a child of the container
+ * or the container itself; otherwise <code>false</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function contains(child:DisplayObject):Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as
new file mode 100644
index 0000000..5df3910
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as
@@ -0,0 +1,320 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import org.apache.flex.events.IEventDispatcher;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ * The LayoutManager is the engine behind
+ * Flex's measurement and layout strategy.
+ * Layout is performed in three phases; commit, measurement, and layout.
+ *
+ * <p>Each phase is distinct from the others and all UIComponents of
+ * one phase are processed prior to moving on to the next phase.
+ * During the processing of UIComponents in a phase, requests for
+ * UIComponents to get re-processed by some phase may occur.
+ * These requests are queued and are only processed
+ * during the next run of the phase.</p>
+ *
+ * <p>The <b>commit</b> phase begins with a call to
+ * <code>validateProperties()</code>, which walks through a list
+ * (reverse sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateProperties()">
+ * <code>validateProperties()</code></a>method.</p>
+ *
+ * <p>The objects in the list are processed in reversed nesting order,
+ * with the <b>least</b> deeply nested object accessed first.
+ * This can also be referred to as top-down or outside-in ordering.</p>
+ *
+ * <p>This phase allows components whose contents depend on property
+ * settings to configure themselves prior to the measurement
+ * and the layout phases.
+ * For the sake of performance, sometimes a component's property setter
+ * method does not do all the work to update to the new property value.
+ * Instead, the property setter calls the <code>invalidateProperties()</code>
+ * method, deferring the work until this phase runs.
+ * This prevents unnecessary work if the property is set multiple times.</p>
+ *
+ * <p>The <b>measurement</b> phase begins with a call to
+ * <code>validateSize()</code>, which walks through a list
+ * (sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateSize()"><code>validateSize()</code></a>
+ * method to determine if the object has changed in size.</p>
+ *
+ * <p>If an object's <a href="../core/UIComponent.html#invalidateSize()">
+ * <code>invalidateSize()</code></a> method was previously called,
+ * then the <code>validateSize()</code> method is called.
+ * If the size or position of the object was changed as a result of the
+ * <code>validateSize()</code> call, then the object's
+ * <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> method is called, thus adding
+ * the object to the processing queue for the next run of the layout phase.
+ * Additionally, the object's parent is marked for both measurement
+ * and layout phases, by calling
+ * <a href="../core/UIComponent.html#invalidateSize()">
+ * <code>invalidateSize()</code></a> and
+ * <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> respectively.</p>
+ *
+ * <p>The objects in the list are processed by nesting order,
+ * with the <b>most</b> deeply nested object accessed first.
+ * This can also be referred to as bottom-up inside-out ordering.</p>
+ *
+ * <p>The <b>layout</b> phase begins with a call to the
+ * <code>validateDisplayList()</code> method, which walks through a list
+ * (reverse sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateDisplayList()">
+ * <code>validateDisplayList()</code></a> method to request the object to size
+ * and position all components contained within it (i.e. its children).</p>
+ *
+ * <p>If an object's <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> method was previously called,
+ * then <code>validateDisplayList()</code> method for the object is called.</p>
+ *
+ * <p>The objects in the list are processed in reversed nesting order,
+ * with the <b>least</b> deeply nested object accessed first.
+ * This can also be referred to as top-down or outside-in ordering.</p>
+ *
+ * <p>In general, components do not override the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, or <code>validateDisplayList()</code> methods.
+ * In the case of UIComponents, most components override the
+ * <code>commitProperties()</code>, <code>measure()</code>, or
+ * <code>updateDisplayList()</code> methods, which are called
+ * by the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, or
+ * <code>validateDisplayList()</code> methods, respectively.</p>
+ *
+ * <p>At application startup, a single instance of the LayoutManager is created
+ * and stored in the <code>UIComponent.layoutManager</code> property.
+ * All components are expected to use that instance.
+ * If you do not have access to the UIComponent object,
+ * you can also access the LayoutManager using the static
+ * <code>LayoutManager.getInstance()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ILayoutManager extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // usePhasedInstantiation
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the LayoutManager allows screen updates
+ * between phases.
+ * If <code>true</code>, measurement and layout are done in phases, one phase
+ * per screen update.
+ * All components have their <code>validateProperties()</code>
+ * and <code>commitProperties()</code> methods
+ * called until all their properties are validated.
+ * The screen will then be updated.
+ *
+ * <p>Then all components will have their <code>validateSize()</code>
+ * and <code>measure()</code>
+ * methods called until all components have been measured, then the screen
+ * will be updated again. </p>
+ *
+ * <p>Finally, all components will have their
+ * <code>validateDisplayList()</code> and
+ * <code>updateDisplayList()</code> methods called until all components
+ * have been validated, and the screen will be updated again.
+ * If in the validation of one phase, an earlier phase gets invalidated,
+ * the LayoutManager starts over.
+ * This is more efficient when large numbers of components
+ * are being created an initialized. The framework is responsible for setting
+ * this property.</p>
+ *
+ * <p>If <code>false</code>, all three phases are completed before the screen is updated.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get usePhasedInstantiation():Boolean;
+
+ /**
+ * @private
+ */
+ function set usePhasedInstantiation(value:Boolean):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Invalidation
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds an object to the list of components that want their
+ * <code>validateProperties()</code> method called.
+ * A component should call this method when a property changes.
+ * Typically, a property setter method
+ * stores a the new value in a temporary variable and calls
+ * the <code>invalidateProperties()</code> method
+ * so that its <code>validateProperties()</code>
+ * and <code>commitProperties()</code> methods are called
+ * later, when the new value will actually be applied to the component and/or
+ * its children. The advantage of this strategy is that often, more than one
+ * property is changed at a time and the properties may interact with each
+ * other, or repeat some code as they are applied, or need to be applied in
+ * a specific order. This strategy allows the most efficient method of
+ * applying new property values.
+ *
+ * @param obj The object whose property changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateProperties(obj:ILayoutManagerClient ):void;
+
+ /**
+ * Adds an object to the list of components that want their
+ * <code>validateSize()</code> method called.
+ * Called when an object's size changes.
+ *
+ * <p>An object's size can change for two reasons:</p>
+ *
+ * <ol>
+ * <li>The content of the object changes. For example, the size of a
+ * button changes when its <code>label</code> is changed.</li>
+ * <li>A script explicitly changes one of the following properties:
+ * <code>minWidth</code>, <code>minHeight</code>,
+ * <code>explicitWidth</code>, <code>explicitHeight</code>,
+ * <code>maxWidth</code>, or <code>maxHeight</code>.</li>
+ * </ol>
+ *
+ * <p>When the first condition occurs, it's necessary to recalculate
+ * the measurements for the object.
+ * When the second occurs, it's not necessary to recalculate the
+ * measurements because the new size of the object is known.
+ * However, it's necessary to remeasure and relayout the object's
+ * parent.</p>
+ *
+ * @param obj The object whose size changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateSize(obj:ILayoutManagerClient ):void;
+
+ /**
+ * Called when a component changes in some way that its layout and/or visuals
+ * need to be changed.
+ * In that case, it is necessary to run the component's layout algorithm,
+ * even if the component's size hasn't changed. For example, when a new child component
+ * is added, or a style property changes or the component has been given
+ * a new size by its parent.
+ *
+ * @param obj The object that changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateDisplayList(obj:ILayoutManagerClient ):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Commitment, measurement, layout, and drawing
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * When properties are changed, components generally do not apply those changes immediately.
+ * Instead the components usually call one of the LayoutManager's invalidate methods and
+ * apply the properties at a later time. The actual property you set can be read back
+ * immediately, but if the property affects other properties in the component or its
+ * children or parents, those other properties may not be immediately updated. To
+ * guarantee that the values are updated, you can call the <code>validateNow()</code> method.
+ * It updates all properties in all components before returning.
+ * Call this method only when necessary as it is a computationally intensive call.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateNow():void;
+
+ /**
+ * When properties are changed, components generally do not apply those changes immediately.
+ * Instead the components usually call one of the LayoutManager's invalidate methods and
+ * apply the properties at a later time. The actual property you set can be read back
+ * immediately, but if the property affects other properties in the component or its
+ * children or parents, those other properties may not be immediately updated.
+ *
+ * <p>To guarantee that the values are updated,
+ * you can call the <code>validateClient()</code> method.
+ * It updates all properties in all components whose nest level is greater than or equal
+ * to the target component before returning.
+ * Call this method only when necessary as it is a computationally intensive call.</p>
+ *
+ * @param target The component passed in is used to test which components
+ * should be validated. All components contained by this component will have their
+ * <code>validateProperties()</code>, <code>commitProperties()</code>,
+ * <code>validateSize()</code>, <code>measure()</code>,
+ * <code>validateDisplayList()</code>,
+ * and <code>updateDisplayList()</code> methods called.
+ *
+ * @param skipDisplayList If <code>true</code>,
+ * does not call the <code>validateDisplayList()</code>
+ * and <code>updateDisplayList()</code> methods.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean = false):void;
+
+ /**
+ * Returns <code>true</code> if there are components that need validating;
+ * <code>false</code> if all components have been validated.
+ *
+ * @return Returns <code>true</code> if there are components that need validating;
+ * <code>false</code> if all components have been validated.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isInvalid():Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..bf291b5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
@@ -0,0 +1,211 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import flash.events.IEventDispatcher;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ * The ILayoutManagerClient interface defines the interface
+ * that a component must implement to participate in the
+ * LayoutManager's commit/measurement/layout sequence.
+ *
+ * <p>Objects that implement this interface can be passed to the
+ * LayoutManager's <code>invalidateProperties()</code> method.
+ * When the LayoutManager reaches the commit properties phase,
+ * the LayoutManager invokes this object's <code>validateProperties()</code>
+ * method.</p>
+ *
+ * <p>Similarly, if an object is passed to the LayoutManager's
+ * <code>invalidateSize()</code> method, then the LayoutManager
+ * calls that object's <code>validateSize()</code> method
+ * during its measurement phase, and if an object is passed
+ * to LayoutManager's <code>invalidateDisplayList()</code> method,
+ * then the LayoutManager calls its <code>validateDisplayList()</code> method
+ * during the layout phase.</p>
+ *
+ * <p>The ILayoutManagerClient interface is implemented by the UIComponent
+ * and ProgrammaticSkin classes.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ILayoutManagerClient extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // initialized
+ //----------------------------------
+
+ /**
+ * A flag that determines if an object has been through all three phases
+ * of layout validation (provided that any were required)
+ * This flag should only be modified by the LayoutManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get initialized():Boolean;
+
+ /**
+ * @private
+ */
+ function set initialized(value:Boolean):void;
+
+ //----------------------------------
+ // nestLevel
+ //----------------------------------
+
+ /**
+ * The top-level SystemManager has a nestLevel of 1.
+ * Its immediate children (the top-level Application and any pop-up
+ * windows) have a <code>nestLevel</code> of 2.
+ * Their children have a <code>nestLevel</code> of 3, and so on.
+ *
+ * The <code>nestLevel</code> is used to sort ILayoutManagerClients
+ * during the measurement and layout phases.
+ * During the commit phase, the LayoutManager commits properties on clients
+ * in order of increasing <code>nestLevel</code>, so that an object's
+ * children have already had their properties committed before Flex
+ * commits properties on the object itself.
+ * During the measurement phase, the LayoutManager measures clients
+ * in order of decreasing <code>nestLevel</code>, so that an object's
+ * children have already been measured before Flex measures
+ * the object itself.
+ * During the layout phase, the LayoutManager lays out clients
+ * in order of increasing <code>nestLevel</code>, so that an object
+ * has a chance to set the sizes of its children before the child
+ * objects are asked to position and size their children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get nestLevel():int;
+
+ /**
+ * @private
+ */
+ function set nestLevel(value:int):void;
+
+ //----------------------------------
+ // processedDescriptors
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#processedDescriptors
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get processedDescriptors():Boolean;
+
+ /**
+ * @private
+ */
+ function set processedDescriptors(value:Boolean):void;
+
+ //----------------------------------
+ // updateCompletePendingFlag
+ //----------------------------------
+
+ /**
+ * A flag that determines if an object is waiting to have its
+ * <code>updateComplete</code> event dispatched.
+ * This flag should only be modified by the LayoutManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get updateCompletePendingFlag():Boolean;
+
+ /**
+ * @private
+ */
+ function set updateCompletePendingFlag(value:Boolean):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Validates the properties of a component.
+ * If the <code>LayoutManager.invalidateProperties()</code> method is called with
+ * this ILayoutManagerClient, then the <code>validateProperties()</code> method
+ * is called when it's time to commit property values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateProperties():void;
+
+ /**
+ * Validates the measured size of the component
+ * If the <code>LayoutManager.invalidateSize()</code> method is called with
+ * this ILayoutManagerClient, then the <code>validateSize()</code> method
+ * is called when it's time to do measurements.
+ *
+ * @param recursive If <code>true</code>, call this method
+ * on the objects children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateSize(recursive:Boolean = false):void;
+
+ /**
+ * Validates the position and size of children and draws other
+ * visuals.
+ * If the <code>LayoutManager.invalidateDisplayList()</code> method is called with
+ * this ILayoutManagerClient, then the <code>validateDisplayList()</code> method
+ * is called when it's time to update the display list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateDisplayList():void;
+}
+
+}
[24/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..f2352e3
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManager.as
@@ -0,0 +1,506 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.Sprite;
+}
+import flex.display.ModuleInfo;
+import flex.display.TopOfDisplayList;
+
+import flex.events.IEventDispatcher;
+import org.apache.flex.geom.Rectangle;
+import flash.text.TextFormat;
+
+import mx.core.IChildList;
+import mx.core.IFlexModuleFactory;
+
+/**
+ * An ISystemManager manages an "application window".
+ * Every application that runs on the desktop or in a browser
+ * has an area where the visuals of the application will be
+ * displayed. It may be a window in the operating system
+ * or an area within the browser. That is an "application window"
+ * and different from an instance of <code>mx.core.Application</code>, which
+ * is the main "top-level" window within an application.
+ *
+ * <p>Every application has an ISystemManager.
+ * The ISystemManager sends an event if
+ * the size of the application window changes (you cannot change it from
+ * within the application, but only through interaction with the operating
+ * system window or browser). It parents all displayable items within the
+ * application, such as the main mx.core.Application instance and all popups,
+ * tooltips, cursors, an so on. Any object parented by the ISystemManager is
+ * considered to be a "top-level" window, even tooltips and cursors.</p>
+ *
+ * <p>The ISystemManager also switches focus between top-level windows
+ * if there are more than one IFocusManagerContainer displayed and users
+ * are interacting with components within the IFocusManagerContainers.</p>
+ *
+ * <p>All keyboard and mouse activity that is not expressly trapped is seen
+ * by the ISystemManager, making it a good place to monitor activity
+ * should you need to do so.</p>
+ *
+ * <p>If an application is loaded into another application, an ISystemManager
+ * will still be created, but will not manage an "application window",
+ * depending on security and domain rules.
+ * Instead, it will be the <code>content</code> of the <code>Loader</code>
+ * that loaded it and simply serve as the parent of the sub-application</p>
+ *
+ * <p>The ISystemManager maintains multiple lists of children, one each for
+ * tooltips, cursors, popup windows.
+ * This is how it ensures that popup windows "float" above the main
+ * application windows and that tooltips "float" above that
+ * and cursors above that.
+ * If you examine the <code>numChildren</code> property
+ * or <code>getChildAt()</code> method on the ISystemManager
+ * you are accessing the main application window and any other windows
+ * that aren't popped up.
+ * To get the list of all windows, including popups, tooltips and cursors,
+ * use the <code>rawChildren</code> property.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // cursorChildren
+ //----------------------------------
+
+ /**
+ * An list of the custom cursors
+ * being parented by this ISystemManager.
+ *
+ * <p>An ISystemManager has various types of children,
+ * such as the Application, popups, top-most windows,
+ * tooltips, and custom cursors.
+ * You can access the custom cursors through
+ * the <code>cursorChildren</code> property.</p>
+ *
+ * <p>The IChildList object has methods like <code>getChildAt()</code>
+ * and properties like <code>numChildren</code>.
+ * For example, <code>cursorChildren.numChildren</code> gives
+ * the number of custom cursors (which will be either 0 or 1)
+ * and, if a custom cursor exists, you can access it as
+ * <code>cursorChildren.getChildAt(0)</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get cursorChildren():IChildList;
+
+ //----------------------------------
+ // document
+ //----------------------------------
+
+ /**
+ * A reference to the document object.
+ * A document object is an Object at the top of the hierarchy of a
+ * Flex application, MXML component, or AS component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get document():Object;
+
+ /**
+ * @private
+ */
+ function set document(value:Object):void;
+
+ //----------------------------------
+ // embeddedFontList
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get embeddedFontList():Object;
+
+ //----------------------------------
+ // focusPane
+ //----------------------------------
+
+ /**
+ * A single Sprite shared among components used as an overlay for drawing focus.
+ * You share it if you parent a focused component, not if you are IFocusManagerComponent.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusPane():Sprite;
+
+ /**
+ * @private
+ */
+ function set focusPane(value:Sprite):void;
+
+ //----------------------------------
+ // isProxy
+ //----------------------------------
+
+ /**
+ * True if the ISystemManager is a proxy and not a root class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get isProxy():Boolean;
+
+ //----------------------------------
+ // loaderInfo
+ //----------------------------------
+
+ /**
+ * The LoaderInfo object that represents information about the application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get moduleInfo():ModuleInfo;
+
+ //----------------------------------
+ // numModalWindows
+ //----------------------------------
+
+ /**
+ * The number of modal windows.
+ *
+ * <p>Modal windows don't allow
+ * clicking in another windows which would normally
+ * activate the FocusManager in that window. The PopUpManager
+ * modifies this count as it creates and destroy modal windows.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get numModalWindows():int;
+
+ /**
+ * @private
+ */
+ function set numModalWindows(value:int):void;
+
+ //----------------------------------
+ // popUpChildren
+ //----------------------------------
+
+ /**
+ * An list of the topMost (popup)
+ * windows being parented by this ISystemManager.
+ *
+ * <p>An ISystemManager has various types of children,
+ * such as the Application, popups,
+ * tooltips, and custom cursors.
+ * You can access the top-most windows through
+ * the <code>popUpChildren</code> property.</p>
+ *
+ * <p>The IChildList object has methods like <code>getChildAt()</code>
+ * and properties like <code>numChildren</code>.
+ * For example, <code>popUpChildren.numChildren</code> gives
+ * the number of topmost windows and you can access them as
+ * <code>popUpChildren.getChildAt(i)</code>.</p>
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get popUpChildren():IChildList;
+
+ //----------------------------------
+ // rawChildren
+ //----------------------------------
+
+ /**
+ * A list of all children
+ * being parented by this ISystemManager.
+ *
+ * <p>An ISystemManager has various types of children,
+ * such as the Application, popups,
+ * tooltips, and custom cursors.</p>
+ *
+ * <p>The IChildList object has methods like <code>getChildAt()</code>
+ * and properties like <code>numChildren</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get rawChildren():IChildList;
+
+ //----------------------------------
+ // screen
+ //----------------------------------
+
+ /**
+ * The size and position of the application window.
+ *
+ * The Rectangle object contains <code>x</code>, <code>y</code>,
+ * <code>width</code>, and <code>height</code> properties.
+ *
+ * The Rectangle is in sandbox root coordinates.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get screen():Rectangle
+
+ //----------------------------------
+ // topOfDisplayList
+ //----------------------------------
+
+ /**
+ * The flash.display.Stage that represents the application window
+ * mapped to this SystemManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get topOfDisplayList():TopOfDisplayList
+
+ //----------------------------------
+ // toolTipChildren
+ //----------------------------------
+
+ /**
+ * A list of the tooltips
+ * being parented by this ISystemManager.
+ *
+ * <p>An ISystemManager has various types of children,
+ * such as the Application, popups, topmost windows,
+ * tooltips, and custom cursors.</p>
+ *
+ * <p>The IChildList object has methods like <code>getChildAt()</code>
+ * and properties like <code>numChildren</code>.
+ * For example, <code>toolTipChildren.numChildren</code> gives
+ * the number of tooltips (which will be either 0 or 1)
+ * and, if a tooltip exists, you can access it as
+ * <code>toolTipChildren.getChildAt(0)</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get toolTipChildren():IChildList;
+
+ //----------------------------------
+ // topLevelSystemManager
+ //----------------------------------
+
+ /**
+ * The ISystemManager responsible for the application window.
+ * This will be the same ISystemManager unless this application
+ * has been loaded into another application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get topLevelSystemManager():ISystemManager;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Converts the given String to a Class or package-level Function.
+ * Calls the appropriate <code>ApplicationDomain.getDefinition()</code>
+ * method based on
+ * whether you are loaded into another application or not.
+ *
+ * @param name Name of class, for example "mx.video.VideoManager".
+ *
+ * @return The Class represented by the <code>name</code>, or null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getDefinitionByName(name:String):Object;
+
+ /**
+ * Returns <code>true</code> if this ISystemManager is responsible
+ * for an application window, and <code>false</code> if this
+ * application has been loaded into another application.
+ *
+ * @return <code>true</code> if this ISystemManager is responsible
+ * for an application window.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isTopLevel():Boolean;
+
+ /**
+ * Returns <code>true</code> if the required font face is embedded
+ * in this application, or has been registered globally by using the
+ * <code>Font.registerFont()</code> method.
+ *
+ * @param tf The TextFormat class representing character formatting information.
+ *
+ * @return <code>true</code> if the required font face is embedded
+ * in this application, or has been registered globally by using the
+ * <code>Font.registerFont()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function isFontFaceEmbedded(tf:TextFormat):Boolean;
+
+ /**
+ * Tests if this system manager is the root of all
+ * top level system managers.
+ *
+ * @return <code>true</code> if the SystemManager
+ * is the root of all SystemManagers on the display list,
+ * and <code>false</code> otherwise.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isTopLevelRoot():Boolean;
+
+ /**
+ * Attempts to get the system manager that is the in the main application.
+ *
+ * @return The main application's systemManager if allowed by
+ * security restrictions or null if it is in a different SecurityDomain.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getTopLevelRoot():DisplayObject;
+
+ /**
+ * Gets the system manager that is the root of all
+ * top level system managers in this SecurityDomain.
+ *
+ * @return the highest-level systemManager in the sandbox
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getSandboxRoot():DisplayObject;
+
+ /**
+ * Get the bounds of the loaded application that are visible to the user
+ * on the screen.
+ *
+ * @param bounds Optional. The starting bounds for the visible rect. The
+ * bounds are in global coordinates. If <code>bounds</code> is null the
+ * starting bounds is defined by the <code>screen</code> property of the
+ * system manager.
+ *
+ * @return a <code>Rectangle</code> including the visible portion of the this
+ * object. The rectangle is in global coordinates.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getVisibleApplicationRect(bounds:Rectangle = null, skipToSandboxRoot:Boolean = false):Rectangle;
+
+ /**
+ * Deploy or remove mouse shields. Mouse shields block mouse input to untrusted
+ * applications. The reason you would want to block mouse input is because
+ * when you are dragging over an untrusted application you would normally not
+ * receive any mouse move events. The Flash Player does not send events
+ * across trusted/untrusted boundries due to security concerns. By covering
+ * the untrusted application with a mouse shield (assuming you are its parent)
+ * you can get mouse move message and the drag operation will work as expected.
+ *
+ * @param deploy <code>true</code> to deploy the mouse shields, <code>false</code>
+ * to remove the mouse shields.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function deployMouseShields(deploy:Boolean):void;
+
+ /**
+ * Attempt to notify the parent SWFLoader that the application's size may
+ * have changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function invalidateParentSizeAndDisplayList():void;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManagerChildManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManagerChildManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManagerChildManager.as
new file mode 100644
index 0000000..a716ca1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ISystemManagerChildManager.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+}
+
+[ExcludeClass]
+
+/**
+ */
+public interface ISystemManagerChildManager
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ function addingChild(child:DisplayObject):void;
+ function childAdded(child:DisplayObject):void;
+
+ function childRemoved(child:DisplayObject):void;
+ function removingChild(child:DisplayObject):void;
+
+ function initializeTopLevelWindow(width:Number, height:Number):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/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
new file mode 100644
index 0000000..ad810f7
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager.as
@@ -0,0 +1,206 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import flash.display.DisplayObject;
+
+import mx.core.IToolTip;
+import mx.core.IUIComponent;
+import mx.effects.Effect;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This interface was used by Flex 2.0.1.
+ * Flex 3 uses IToolTipManager2 instead.
+ */
+public interface IToolTipManager
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentTarget
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get currentTarget():DisplayObject;
+
+ /**
+ * @private
+ */
+ function set currentTarget(value:DisplayObject):void;
+
+ //----------------------------------
+ // currentToolTip
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get currentToolTip():IToolTip;
+
+ /**
+ * @private
+ */
+ function set currentToolTip(value:IToolTip):void;
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get enabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set enabled(value:Boolean):void;
+
+ //----------------------------------
+ // hideDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get hideDelay():Number;
+
+ /**
+ * @private
+ */
+ function set hideDelay(value:Number):void;
+
+ //----------------------------------
+ // hideEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get hideEffect():Effect;
+
+ /**
+ * @private
+ */
+ function set hideEffect(value:Effect):void;
+
+ //----------------------------------
+ // scrubDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get scrubDelay():Number;
+
+ /**
+ * @private
+ */
+ function set scrubDelay(value:Number):void;
+
+ //----------------------------------
+ // showDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get showDelay():Number;
+
+ /**
+ * @private
+ */
+ function set showDelay(value:Number):void;
+
+ //----------------------------------
+ // showEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get showEffect():Effect;
+
+ /**
+ * @private
+ */
+ function set showEffect(value:Effect):void;
+
+ //----------------------------------
+ // showEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get toolTipClass():Class;
+
+ /**
+ * @private
+ */
+ function set toolTipClass(value:Class):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ function registerToolTip(target:DisplayObject, oldToolTip:String,
+ newToolTip:String):void;
+
+ /**
+ * @private
+ */
+ function registerErrorString(target:DisplayObject, oldErrorString:String,
+ newErrorString:String):void;
+
+ /**
+ * @private
+ */
+ function sizeTip(toolTip:IToolTip):void;
+
+ /**
+ * @private
+ */
+ function createToolTip(text:String, x:Number, y:Number,
+ errorTipBorderStyle:String = null,
+ context:IUIComponent = null):IToolTip;
+
+ /**
+ * @private
+ */
+ function destroyToolTip(toolTip:IToolTip):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager2.as b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager2.as
new file mode 100644
index 0000000..05b0c24
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManager2.as
@@ -0,0 +1,219 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import flash.display.DisplayObject;
+
+import mx.core.IToolTip;
+import mx.core.IUIComponent;
+import mx.effects.IAbstractEffect;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This interface is used internally by Flex 3.
+ * Flex 2.0.1 used the IToolTipManager interface.
+ *
+ * This interface does not extend IToolTipManager
+ * because IToolTipManager had a dependency on Effect,
+ * which has a dependency on UIComponent.
+ * IToolTipManager2 fixes this by depending on IAbstractEffect,
+ * a new interface in Flex 3.
+ *
+ * IToolTipManager2 must be in the cross-versioning
+ * bootstrap set of classes (see bootstrap-defs.as)
+ * and if the bootstrap loader contains implementation
+ * classes such as Effect and UIComponent then any apps
+ * and modules it loads would use the bootstrap's version
+ * of these classes, instead of using their own versions.
+ */
+public interface IToolTipManager2
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentTarget
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get currentTarget():DisplayObject;
+
+ /**
+ * @private
+ */
+ function set currentTarget(value:DisplayObject):void;
+
+ //----------------------------------
+ // currentToolTip
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get currentToolTip():IToolTip;
+
+ /**
+ * @private
+ */
+ function set currentToolTip(value:IToolTip):void;
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get enabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set enabled(value:Boolean):void;
+
+ //----------------------------------
+ // hideDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get hideDelay():Number;
+
+ /**
+ * @private
+ */
+ function set hideDelay(value:Number):void;
+
+ //----------------------------------
+ // hideEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get hideEffect():IAbstractEffect;
+
+ /**
+ * @private
+ */
+ function set hideEffect(value:IAbstractEffect):void;
+
+ //----------------------------------
+ // scrubDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get scrubDelay():Number;
+
+ /**
+ * @private
+ */
+ function set scrubDelay(value:Number):void;
+
+ //----------------------------------
+ // showDelay
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get showDelay():Number;
+
+ /**
+ * @private
+ */
+ function set showDelay(value:Number):void;
+
+ //----------------------------------
+ // showEffect
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get showEffect():IAbstractEffect;
+
+ /**
+ * @private
+ */
+ function set showEffect(value:IAbstractEffect):void;
+
+ //----------------------------------
+ // toolTipClass
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get toolTipClass():Class;
+
+ /**
+ * @private
+ */
+ function set toolTipClass(value:Class):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ function registerToolTip(target:DisplayObject, oldToolTip:String,
+ newToolTip:String):void;
+
+ /**
+ * @private
+ */
+ function registerErrorString(target:DisplayObject, oldErrorString:String,
+ newErrorString:String):void;
+
+ /**
+ * @private
+ */
+ function sizeTip(toolTip:IToolTip):void;
+
+ /**
+ * @private
+ */
+ function createToolTip(text:String, x:Number, y:Number,
+ errorTipBorderStyle:String = null,
+ context:IUIComponent = null):IToolTip;
+
+ /**
+ * @private
+ */
+ function destroyToolTip(toolTip:IToolTip):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManagerClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManagerClient.as b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManagerClient.as
new file mode 100644
index 0000000..06d9068
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IToolTipManagerClient.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+import mx.core.IFlexDisplayObject;
+
+/**
+ * Components that implement IToolTipManagerClient can have tooltips and must
+ * have a toolTip getter/setter.
+ * The ToolTipManager class manages showing and hiding the
+ * tooltip on behalf of any component which is an IToolTipManagerClient.
+ *
+ * @see mx.controls.ToolTip
+ * @see mx.managers.ToolTipManager
+ * @see mx.core.IToolTip
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IToolTipManagerClient extends IFlexDisplayObject
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // toolTip
+ //----------------------------------
+
+ /**
+ * The text of this component's tooltip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get toolTip():String;
+
+ /**
+ * @private
+ */
+ function set toolTip(value:String):void;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/SystemChildrenList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/SystemChildrenList.as b/frameworks/projects/MX/src/main/flex/mx/managers/SystemChildrenList.as
new file mode 100644
index 0000000..b1588f4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/SystemChildrenList.as
@@ -0,0 +1,300 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.managers
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.geom.Point;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import org.apache.flex.geom.Point;
+}
+import mx.core.IChildList;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * A SystemManager has various types of children,
+ * such as the Application, popups, tooltips, and custom cursors.
+ *
+ * You can access all the children via the <code>rawChildren</code> property.
+ * You can access just the popups via <code>popUpChildren</code>,
+ * the tooltips via <code>toolTipChildren</code>,
+ * and the custom cursors via <code>cursorChildren</code>.
+ * Each of these returns a SystemChildrenList which implements IChildList.
+ *
+ * The SystemChildrenList is given two indices that map
+ * to a subset of the indices of children within the entire
+ * set of child indices in the SystemManager.
+ * It manages the children within those two indices.
+ */
+public class SystemChildrenList implements IChildList
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function SystemChildrenList(owner:SystemManager,
+ lowerBoundReference:QName,
+ upperBoundReference:QName)
+ {
+ super();
+
+ this.owner = owner;
+ this.lowerBoundReference = lowerBoundReference;
+ this.upperBoundReference = upperBoundReference;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var owner:SystemManager;
+
+ /**
+ * @private
+ * Either "noTopMostIndex", "topMostIndex", or "toolTipIndex".
+ * The popUpChildren extends from noTopMostIndex to topMostIndex.
+ * The toolTips extends from topMostIndex to toolTipIndex.
+ * The cursors extends from toolTipIndex to cursorIndex.
+ */
+ private var lowerBoundReference:QName;
+
+ /**
+ * @private
+ * Either "topMostIndex", "toolTipIndex", or "cursorIndex".
+ * The popUpChildren extends from noTopMostIndex to topMostIndex.
+ * The toolTips extends from topMostIndex to toolTipIndex.
+ * The cursors extends from toolTipIndex to cursorIndex.
+ */
+ private var upperBoundReference:QName;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @copy mx.core.IChildList#numChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get numChildren():int
+ {
+ return owner[upperBoundReference] - owner[lowerBoundReference];
+ }
+
+ /**
+ * @copy mx.core.IChildList#addChild
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addChild(child:DisplayObject):DisplayObject
+ {
+ owner.rawChildren_addChildAt(
+ child, owner[upperBoundReference]);
+ owner[upperBoundReference]++;
+ return child;
+ }
+
+ /**
+ * @copy mx.core.IChildList#addChildAt
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ owner.rawChildren_addChildAt(
+ child, owner[lowerBoundReference] + index);
+ owner[upperBoundReference]++;
+ return child;
+ }
+
+ /**
+ * @copy mx.core.IChildList#removeChild
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeChild(child:DisplayObject):DisplayObject
+ {
+ var index:int = owner.rawChildren_getChildIndex(child);
+ if (owner[lowerBoundReference] <= index &&
+ index < owner[upperBoundReference])
+ {
+ owner.rawChildren_removeChild(child);
+ owner[upperBoundReference]--;
+ }
+ return child;
+ }
+
+ /**
+ * @copy mx.core.IChildList#removeChildAt
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeChildAt(index:int):DisplayObject
+ {
+ var child:DisplayObject =
+ owner.rawChildren_removeChildAt(
+ index + owner[lowerBoundReference]);
+ owner[upperBoundReference]--;
+ return child;
+ }
+
+ /**
+ * @copy mx.core.IChildList#getChildAt
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChildAt(index:int):DisplayObject
+ {
+ var retval:DisplayObject =
+ owner.rawChildren_getChildAt(
+ owner[lowerBoundReference] + index);
+ return retval;
+ }
+
+ /**
+ * @copy mx.core.IChildList#getChildByName
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChildByName(name:String):DisplayObject
+ {
+ return owner.rawChildren_getChildByName(name);
+ }
+
+ /**
+ * @copy mx.core.IChildList#getChildIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getChildIndex(child:DisplayObject):int
+ {
+ var retval:int = owner.rawChildren_getChildIndex(child);
+ retval -= owner[lowerBoundReference];
+ return retval;
+ }
+
+ /**
+ * @copy mx.core.IChildList#setChildIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setChildIndex(child:DisplayObject, newIndex:int):void
+ {
+ owner.rawChildren_setChildIndex(
+ child, owner[lowerBoundReference] + newIndex);
+ }
+
+ /**
+ * @copy mx.core.IChildList#getObjectsUnderPoint
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getObjectsUnderPoint(point:Point):Array
+ {
+ return owner.rawChildren_getObjectsUnderPoint(point);
+ }
+
+ /**
+ * @copy mx.core.IChildList#contains
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function contains(child:DisplayObject):Boolean
+ {
+ if (child != owner && owner.rawChildren_contains(child))
+ {
+ while (child.parent != owner)
+ {
+ child = child.parent;
+ }
+ var childIndex:int = owner.rawChildren_getChildIndex(child);
+ if (childIndex >= owner[lowerBoundReference] &&
+ childIndex < owner[upperBoundReference])
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+}
[03/37] git commit: [flex-asjs] [refs/heads/spark] - Merge branch
'develop' into spark
Posted by ah...@apache.org.
Merge branch 'develop' into spark
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b3809cf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b3809cf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b3809cf
Branch: refs/heads/spark
Commit: 9b3809cf9c438c4107623ace9dd050f9c8c0a31d
Parents: b93fb1c 9080199
Author: Alex Harui <ah...@apache.org>
Authored: Mon Feb 8 17:37:21 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Feb 8 17:37:21 2016 -0800
----------------------------------------------------------------------
asdoc/build.xml | 2 +-
frameworks/air-config-template.xml | 90 +-
frameworks/air-config.xml | 90 +-
frameworks/asdoc-config.xml | 104 +-
frameworks/fb.properties | 5 +
frameworks/flex-config-template.xml | 125 +-
frameworks/flex-config.xml | 125 +-
.../projects/Binding/.actionScriptProperties | 38 +-
.../.externalToolBuilders/BindingASJS.launch | 44 +
frameworks/projects/Binding/.flexLibProperties | 18 +
frameworks/projects/Binding/.project | 35 +-
.../projects/Binding/as/src/BindingClasses.as | 34 -
.../flex/binding/ApplicationDataBinding.as | 338 ----
.../src/org/apache/flex/binding/ChainBinding.as | 215 ---
.../org/apache/flex/binding/ConstantBinding.as | 195 --
.../apache/flex/binding/ContainerDataBinding.as | 384 ----
.../org/apache/flex/binding/GenericBinding.as | 232 ---
.../flex/binding/MXMLBeadViewBaseDataBinding.as | 333 ----
.../org/apache/flex/binding/PropertyWatcher.as | 229 ---
.../org/apache/flex/binding/SimpleBinding.as | 206 ---
.../apache/flex/binding/ViewBaseDataBinding.as | 329 ----
.../src/org/apache/flex/binding/WatcherBase.as | 339 ----
frameworks/projects/Binding/basic-manifest.xml | 31 -
frameworks/projects/Binding/build.xml | 39 +-
.../projects/Binding/compile-asjs-config.xml | 79 -
frameworks/projects/Binding/compile-config.xml | 78 -
.../Binding/src/main/flex/BindingClasses.as | 34 +
.../flex/binding/ApplicationDataBinding.as | 338 ++++
.../org/apache/flex/binding/ChainBinding.as | 215 +++
.../org/apache/flex/binding/ConstantBinding.as | 195 ++
.../apache/flex/binding/ContainerDataBinding.as | 384 ++++
.../org/apache/flex/binding/GenericBinding.as | 232 +++
.../flex/binding/MXMLBeadViewBaseDataBinding.as | 333 ++++
.../org/apache/flex/binding/PropertyWatcher.as | 229 +++
.../org/apache/flex/binding/SimpleBinding.as | 206 +++
.../apache/flex/binding/ViewBaseDataBinding.as | 329 ++++
.../flex/org/apache/flex/binding/WatcherBase.as | 339 ++++
.../src/main/resources/basic-manifest.xml | 31 +
.../src/main/resources/compile-asjs-config.xml | 79 +
.../src/main/resources/compile-config.xml | 78 +
.../projects/Charts/.actionScriptProperties | 42 +-
.../.externalToolBuilders/ChartsASJS.launch | 44 +
frameworks/projects/Charts/.flexLibProperties | 18 +
frameworks/projects/Charts/.project | 37 +-
frameworks/projects/Charts/as/defaults.css | 108 --
.../projects/Charts/as/src/ChartsClasses.as | 75 -
.../as/src/org/apache/flex/charts/BarChart.as | 49 -
.../src/org/apache/flex/charts/ColumnChart.as | 48 -
.../as/src/org/apache/flex/charts/LineChart.as | 48 -
.../as/src/org/apache/flex/charts/PieChart.as | 47 -
.../org/apache/flex/charts/StackedBarChart.as | 48 -
.../apache/flex/charts/StackedColumnChart.as | 48 -
.../apache/flex/charts/beads/AxisBaseBead.as | 246 ---
.../charts/beads/ChartItemRendererFactory.as | 155 --
.../org/apache/flex/charts/beads/ChartView.as | 174 --
.../DataItemRendererFactoryForSeriesData.as | 131 --
.../org/apache/flex/charts/beads/DataTipBead.as | 162 --
.../charts/beads/HorizontalCategoryAxisBead.as | 191 --
.../charts/beads/HorizontalLinearAxisBead.as | 246 ---
.../charts/beads/VerticalCategoryAxisBead.as | 198 --
.../flex/charts/beads/VerticalLinearAxisBead.as | 236 ---
.../flex/charts/beads/layouts/BarChartLayout.as | 149 --
.../charts/beads/layouts/ChartBaseLayout.as | 147 --
.../charts/beads/layouts/ColumnChartLayout.as | 140 --
.../layouts/LineChartCategoryVsLinearLayout.as | 152 --
.../layouts/LineChartLinearVsLinearLayout.as | 166 --
.../flex/charts/beads/layouts/PieChartLayout.as | 140 --
.../beads/layouts/StackedBarChartLayout.as | 164 --
.../beads/layouts/StackedColumnChartLayout.as | 161 --
.../apache/flex/charts/core/CartesianChart.as | 85 -
.../org/apache/flex/charts/core/ChartBase.as | 77 -
.../org/apache/flex/charts/core/IAxisBead.as | 58 -
.../org/apache/flex/charts/core/IAxisGroup.as | 42 -
.../flex/charts/core/ICartesianChartLayout.as | 34 -
.../src/org/apache/flex/charts/core/IChart.as | 48 -
.../apache/flex/charts/core/IChartDataGroup.as | 55 -
.../flex/charts/core/IChartItemRenderer.as | 116 --
.../org/apache/flex/charts/core/IChartSeries.as | 69 -
.../flex/charts/core/IConnectedItemRenderer.as | 55 -
.../flex/charts/core/IHorizontalAxisBead.as | 65 -
.../flex/charts/core/IVerticalAxisBead.as | 65 -
.../org/apache/flex/charts/core/PolarChart.as | 66 -
.../flex/charts/optimized/SVGBoxItemRenderer.as | 166 --
.../flex/charts/optimized/SVGChartAxisGroup.as | 142 --
.../flex/charts/optimized/SVGChartDataGroup.as | 192 --
.../optimized/SVGLineSegmentItemRenderer.as | 205 ---
.../charts/optimized/SVGWedgeItemRenderer.as | 281 ---
.../flex/charts/supportClasses/BarSeries.as | 103 --
.../charts/supportClasses/BoxItemRenderer.as | 268 ---
.../charts/supportClasses/ChartAxisGroup.as | 182 --
.../charts/supportClasses/ChartDataGroup.as | 100 -
.../flex/charts/supportClasses/ColumnSeries.as | 93 -
.../supportClasses/ILineSegmentItemRenderer.as | 57 -
.../charts/supportClasses/IWedgeItemRenderer.as | 113 --
.../supportClasses/LineSegmentItemRenderer.as | 198 --
.../flex/charts/supportClasses/LineSeries.as | 114 --
.../flex/charts/supportClasses/PieSeries.as | 85 -
.../charts/supportClasses/WedgeItemRenderer.as | 272 ---
frameworks/projects/Charts/basic-manifest.xml | 50 -
frameworks/projects/Charts/build.xml | 39 +-
.../projects/Charts/compile-as-to-js-config.xml | 76 -
.../projects/Charts/compile-asjs-config.xml | 71 -
frameworks/projects/Charts/compile-config.xml | 84 -
.../projects/Charts/compile-js-config.xml | 87 -
.../Charts/src/main/flex/ChartsClasses.as | 75 +
.../flex/org/apache/flex/charts/BarChart.as | 49 +
.../flex/org/apache/flex/charts/ColumnChart.as | 48 +
.../flex/org/apache/flex/charts/LineChart.as | 48 +
.../flex/org/apache/flex/charts/PieChart.as | 47 +
.../org/apache/flex/charts/StackedBarChart.as | 48 +
.../apache/flex/charts/StackedColumnChart.as | 48 +
.../apache/flex/charts/beads/AxisBaseBead.as | 246 +++
.../charts/beads/ChartItemRendererFactory.as | 155 ++
.../org/apache/flex/charts/beads/ChartView.as | 174 ++
.../DataItemRendererFactoryForSeriesData.as | 131 ++
.../org/apache/flex/charts/beads/DataTipBead.as | 162 ++
.../charts/beads/HorizontalCategoryAxisBead.as | 191 ++
.../charts/beads/HorizontalLinearAxisBead.as | 246 +++
.../charts/beads/VerticalCategoryAxisBead.as | 198 ++
.../flex/charts/beads/VerticalLinearAxisBead.as | 236 +++
.../flex/charts/beads/layouts/BarChartLayout.as | 149 ++
.../charts/beads/layouts/ChartBaseLayout.as | 147 ++
.../charts/beads/layouts/ColumnChartLayout.as | 140 ++
.../layouts/LineChartCategoryVsLinearLayout.as | 152 ++
.../layouts/LineChartLinearVsLinearLayout.as | 166 ++
.../flex/charts/beads/layouts/PieChartLayout.as | 140 ++
.../beads/layouts/StackedBarChartLayout.as | 164 ++
.../beads/layouts/StackedColumnChartLayout.as | 161 ++
.../apache/flex/charts/core/CartesianChart.as | 85 +
.../org/apache/flex/charts/core/ChartBase.as | 77 +
.../org/apache/flex/charts/core/IAxisBead.as | 58 +
.../org/apache/flex/charts/core/IAxisGroup.as | 42 +
.../flex/charts/core/ICartesianChartLayout.as | 34 +
.../flex/org/apache/flex/charts/core/IChart.as | 48 +
.../apache/flex/charts/core/IChartDataGroup.as | 55 +
.../flex/charts/core/IChartItemRenderer.as | 116 ++
.../org/apache/flex/charts/core/IChartSeries.as | 69 +
.../flex/charts/core/IConnectedItemRenderer.as | 55 +
.../flex/charts/core/IHorizontalAxisBead.as | 65 +
.../flex/charts/core/IVerticalAxisBead.as | 65 +
.../org/apache/flex/charts/core/PolarChart.as | 66 +
.../flex/charts/optimized/SVGBoxItemRenderer.as | 166 ++
.../flex/charts/optimized/SVGChartAxisGroup.as | 142 ++
.../flex/charts/optimized/SVGChartDataGroup.as | 192 ++
.../optimized/SVGLineSegmentItemRenderer.as | 205 +++
.../charts/optimized/SVGWedgeItemRenderer.as | 281 +++
.../flex/charts/supportClasses/BarSeries.as | 103 ++
.../charts/supportClasses/BoxItemRenderer.as | 268 +++
.../charts/supportClasses/ChartAxisGroup.as | 182 ++
.../charts/supportClasses/ChartDataGroup.as | 100 +
.../flex/charts/supportClasses/ColumnSeries.as | 93 +
.../supportClasses/ILineSegmentItemRenderer.as | 57 +
.../charts/supportClasses/IWedgeItemRenderer.as | 113 ++
.../supportClasses/LineSegmentItemRenderer.as | 198 ++
.../flex/charts/supportClasses/LineSeries.as | 114 ++
.../flex/charts/supportClasses/PieSeries.as | 85 +
.../charts/supportClasses/WedgeItemRenderer.as | 272 +++
.../src/main/resources/basic-manifest.xml | 50 +
.../main/resources/compile-as-to-js-config.xml | 76 +
.../src/main/resources/compile-asjs-config.xml | 71 +
.../src/main/resources/compile-config.xml | 84 +
.../src/main/resources/compile-js-config.xml | 87 +
.../Charts/src/main/resources/defaults.css | 108 ++
.../Collections/.actionScriptProperties | 38 +-
.../CollectionsASJS.launch | 44 +
.../projects/Collections/.flexLibProperties | 18 +
frameworks/projects/Collections/.project | 35 +-
.../Collections/as/src/CollectionsClasses.as | 35 -
.../org/apache/flex/collections/ArrayList.as | 396 ----
.../org/apache/flex/collections/ICollection.as | 43 -
.../flex/collections/IStringCollection.as | 43 -
.../apache/flex/collections/LazyCollection.as | 267 ---
.../collections/converters/IItemConverter.as | 49 -
.../collections/converters/JSONItemConverter.as | 74 -
.../flex/collections/parsers/IInputParser.as | 50 -
.../flex/collections/parsers/JSONInputParser.as | 54 -
.../projects/Collections/basic-manifest.xml | 29 -
frameworks/projects/Collections/build.xml | 65 +-
.../Collections/compile-asjs-config.xml | 69 -
.../projects/Collections/compile-config.xml | 78 -
.../src/main/flex/CollectionsClasses.as | 35 +
.../org/apache/flex/collections/ArrayList.as | 396 ++++
.../org/apache/flex/collections/ICollection.as | 43 +
.../flex/collections/IStringCollection.as | 43 +
.../apache/flex/collections/LazyCollection.as | 267 +++
.../collections/converters/IItemConverter.as | 49 +
.../collections/converters/JSONItemConverter.as | 74 +
.../flex/collections/parsers/IInputParser.as | 50 +
.../flex/collections/parsers/JSONInputParser.as | 54 +
.../src/main/resources/basic-manifest.xml | 29 +
.../src/main/resources/compile-asjs-config.xml | 69 +
.../src/main/resources/compile-config.xml | 78 +
.../projects/Core/.actionScriptProperties | 36 +-
.../Core/.externalToolBuilders/CoreASJS.launch | 44 +
frameworks/projects/Core/.flexLibProperties | 18 +
frameworks/projects/Core/.project | 34 +-
frameworks/projects/Core/as/src/CoreClasses.as | 150 --
.../projects/Core/as/src/CoreJSClasses.as | 99 -
.../as/src/org/apache/flex/core/Application.as | 602 ------
.../src/org/apache/flex/core/ApplicationBase.as | 110 --
.../as/src/org/apache/flex/core/BeadViewBase.as | 97 -
.../org/apache/flex/core/BindableCSSStyles.as | 134 --
.../apache/flex/core/BrowserResizeListener.as | 138 --
.../src/org/apache/flex/core/BrowserScroller.as | 89 -
.../src/org/apache/flex/core/BrowserWindow.as | 61 -
.../src/org/apache/flex/core/CSSFontFaceBead.as | 160 --
.../as/src/org/apache/flex/core/CSSShape.as | 163 --
.../as/src/org/apache/flex/core/CSSSprite.as | 163 --
.../as/src/org/apache/flex/core/CSSTextField.as | 163 --
.../src/org/apache/flex/core/CallLaterBead.as | 128 --
.../as/src/org/apache/flex/core/ClassFactory.as | 90 -
.../src/org/apache/flex/core/ContainerBase.as | 443 -----
.../flex/core/ContainerBaseStrandChildren.as | 99 -
.../src/org/apache/flex/core/DataBindingBase.as | 45 -
.../src/org/apache/flex/core/FilledRectangle.as | 125 --
.../org/apache/flex/core/HTMLElementWrapper.as | 247 ---
.../as/src/org/apache/flex/core/IAlertModel.as | 135 --
.../org/apache/flex/core/IApplicationView.as | 45 -
.../Core/as/src/org/apache/flex/core/IBead.as | 47 -
.../src/org/apache/flex/core/IBeadController.as | 37 -
.../as/src/org/apache/flex/core/IBeadLayout.as | 40 -
.../as/src/org/apache/flex/core/IBeadModel.as | 39 -
.../as/src/org/apache/flex/core/IBeadView.as | 46 -
.../as/src/org/apache/flex/core/IBorderModel.as | 46 -
.../Core/as/src/org/apache/flex/core/IChild.as | 59 -
.../Core/as/src/org/apache/flex/core/IChrome.as | 37 -
.../src/org/apache/flex/core/IComboBoxModel.as | 108 --
.../as/src/org/apache/flex/core/IContainer.as | 47 -
.../src/org/apache/flex/core/IContainerView.as | 33 -
.../as/src/org/apache/flex/core/IContentView.as | 38 -
.../org/apache/flex/core/IContentViewHost.as | 35 -
.../src/org/apache/flex/core/IDataGridModel.as | 44 -
.../flex/core/IDataGridPresentationModel.as | 45 -
.../core/IDataProviderItemRendererMapper.as | 52 -
.../org/apache/flex/core/IDateChooserModel.as | 101 --
.../as/src/org/apache/flex/core/IDocument.as | 48 -
.../src/org/apache/flex/core/IDragInitiator.as | 67 -
.../as/src/org/apache/flex/core/IEffectTimer.as | 68 -
.../as/src/org/apache/flex/core/IFactory.as | 46 -
.../as/src/org/apache/flex/core/IFlexInfo.as | 43 -
.../src/org/apache/flex/core/IFlexJSElement.as | 27 -
.../as/src/org/apache/flex/core/IFormatBead.as | 69 -
.../as/src/org/apache/flex/core/IImageModel.as | 48 -
.../src/org/apache/flex/core/IItemRenderer.as | 57 -
.../flex/core/IItemRendererClassFactory.as | 60 -
.../org/apache/flex/core/IItemRendererParent.as | 52 -
.../apache/flex/core/IItemRendererProvider.as | 58 -
.../as/src/org/apache/flex/core/ILayoutChild.as | 175 --
.../as/src/org/apache/flex/core/ILayoutHost.as | 44 -
.../apache/flex/core/IListPresentationModel.as | 54 -
.../src/org/apache/flex/core/IMXMLDocument.as | 66 -
.../org/apache/flex/core/IMeasurementBead.as | 53 -
.../as/src/org/apache/flex/core/IPanelModel.as | 45 -
.../Core/as/src/org/apache/flex/core/IParent.as | 109 --
.../src/org/apache/flex/core/IParentIUIBase.as | 37 -
.../Core/as/src/org/apache/flex/core/IPopUp.as | 33 -
.../as/src/org/apache/flex/core/IPopUpHost.as | 33 -
.../as/src/org/apache/flex/core/IRangeModel.as | 95 -
.../src/org/apache/flex/core/IRollOverModel.as | 46 -
.../src/org/apache/flex/core/IScrollBarModel.as | 58 -
.../apache/flex/core/ISelectableItemRenderer.as | 95 -
.../src/org/apache/flex/core/ISelectionModel.as | 100 -
.../as/src/org/apache/flex/core/IStatesImpl.as | 37 -
.../src/org/apache/flex/core/IStatesObject.as | 74 -
.../Core/as/src/org/apache/flex/core/IStrand.as | 77 -
.../org/apache/flex/core/IStrandWithModel.as | 50 -
.../as/src/org/apache/flex/core/IStyleObject.as | 45 -
.../org/apache/flex/core/IStyleableObject.as | 71 -
.../as/src/org/apache/flex/core/ITextModel.as | 56 -
.../src/org/apache/flex/core/ITitleBarModel.as | 73 -
.../org/apache/flex/core/IToggleButtonModel.as | 67 -
.../Core/as/src/org/apache/flex/core/IUIBase.as | 160 --
.../apache/flex/core/IValueToggleButtonModel.as | 69 -
.../as/src/org/apache/flex/core/IValuesImpl.as | 153 --
.../as/src/org/apache/flex/core/IViewport.as | 80 -
.../src/org/apache/flex/core/IViewportModel.as | 50 -
.../org/apache/flex/core/IViewportScroller.as | 36 -
.../flex/core/ItemRendererClassFactory.as | 194 --
.../as/src/org/apache/flex/core/ListBase.as | 126 --
.../apache/flex/core/ListBaseStrandChildren.as | 100 -
.../org/apache/flex/core/MXMLDragInitiator.as | 131 --
.../org/apache/flex/core/ParentDocumentBead.as | 127 --
.../org/apache/flex/core/SimpleApplication.as | 102 --
.../src/org/apache/flex/core/SimpleCSSStyles.as | 106 --
.../org/apache/flex/core/SimpleCSSValuesImpl.as | 765 --------
.../org/apache/flex/core/SimpleStatesImpl.as | 222 ---
.../org/apache/flex/core/SimpleValuesImpl.as | 188 --
.../as/src/org/apache/flex/core/StageProxy.as | 127 --
.../Core/as/src/org/apache/flex/core/Strand.as | 182 --
.../apache/flex/core/StyleableCSSTextField.as | 201 --
.../Core/as/src/org/apache/flex/core/UIBase.as | 1483 ---------------
.../as/src/org/apache/flex/core/UIButtonBase.as | 860 ---------
.../src/org/apache/flex/core/ValuesManager.as | 72 -
.../as/src/org/apache/flex/core/ViewBase.as | 98 -
.../org/apache/flex/core/WrappedHTMLElement.as | 21 -
.../src/org/apache/flex/events/BrowserEvent.as | 475 -----
.../src/org/apache/flex/events/CustomEvent.as | 64 -
.../src/org/apache/flex/events/ElementEvents.as | 51 -
.../Core/as/src/org/apache/flex/events/Event.as | 133 --
.../org/apache/flex/events/EventDispatcher.as | 66 -
.../org/apache/flex/events/IEventDispatcher.as | 49 -
.../as/src/org/apache/flex/events/MouseEvent.as | 366 ----
.../org/apache/flex/events/ValueChangeEvent.as | 129 --
.../as/src/org/apache/flex/events/ValueEvent.as | 68 -
.../flex/events/utils/IHandlesOriginalEvent.as | 35 -
.../flex/events/utils/MouseEventConverter.as | 173 --
.../org/apache/flex/events/utils/MouseUtils.as | 103 --
.../Core/as/src/org/apache/flex/geom/Point.as | 72 -
.../as/src/org/apache/flex/geom/Rectangle.as | 95 -
.../Core/as/src/org/apache/flex/geom/Size.as | 41 -
.../as/src/org/apache/flex/states/AddItems.as | 101 --
.../org/apache/flex/states/ItemAndDescriptor.as | 70 -
.../org/apache/flex/states/SetEventHandler.as | 79 -
.../src/org/apache/flex/states/SetProperty.as | 81 -
.../Core/as/src/org/apache/flex/states/State.as | 83 -
.../as/src/org/apache/flex/utils/BinaryData.as | 391 ----
.../src/org/apache/flex/utils/CSSBorderUtils.as | 219 ---
.../org/apache/flex/utils/CSSContainerUtils.as | 194 --
.../as/src/org/apache/flex/utils/CSSUtils.as | 328 ----
.../as/src/org/apache/flex/utils/EffectTimer.as | 136 --
.../as/src/org/apache/flex/utils/HTMLLoader.as | 42 -
.../as/src/org/apache/flex/utils/Language.as | 362 ----
.../apache/flex/utils/MXMLDataInterpreter.as | 463 -----
.../src/org/apache/flex/utils/MixinManager.as | 105 --
.../as/src/org/apache/flex/utils/PNGEncoder.as | 305 ----
.../as/src/org/apache/flex/utils/PointUtils.as | 125 --
.../org/apache/flex/utils/SolidBorderUtil.as | 191 --
.../src/org/apache/flex/utils/StringTrimmer.as | 176 --
.../Core/as/src/org/apache/flex/utils/Timer.as | 148 --
.../as/src/org/apache/flex/utils/UIUtils.as | 107 --
.../flex/utils/ViewSourceContextMenuOption.as | 97 -
.../org/apache/flex/utils/dbg/DOMPathUtil.as | 95 -
.../as/tests/FlexUnitFlexJSApplication.mxml | 46 -
frameworks/projects/Core/as/tests/build.xml | 165 --
.../Core/as/tests/flexUnitTests/StrandTester.as | 27 -
.../as/tests/flexUnitTests/StrandTesterTest.as | 55 -
frameworks/projects/Core/basic-manifest.xml | 41 -
frameworks/projects/Core/build.xml | 45 +-
.../projects/Core/compile-as-to-js-config.xml | 77 -
.../projects/Core/compile-asjs-config.xml | 78 -
frameworks/projects/Core/compile-config.xml | 83 -
frameworks/projects/Core/compile-js-config.xml | 87 -
.../projects/Core/src/main/flex/CoreClasses.as | 150 ++
.../Core/src/main/flex/CoreJSClasses.as | 99 +
.../flex/org/apache/flex/core/Application.as | 602 ++++++
.../org/apache/flex/core/ApplicationBase.as | 110 ++
.../flex/org/apache/flex/core/BeadViewBase.as | 97 +
.../org/apache/flex/core/BindableCSSStyles.as | 134 ++
.../apache/flex/core/BrowserResizeListener.as | 138 ++
.../org/apache/flex/core/BrowserScroller.as | 89 +
.../flex/org/apache/flex/core/BrowserWindow.as | 61 +
.../org/apache/flex/core/CSSFontFaceBead.as | 160 ++
.../main/flex/org/apache/flex/core/CSSShape.as | 163 ++
.../main/flex/org/apache/flex/core/CSSSprite.as | 163 ++
.../flex/org/apache/flex/core/CSSTextField.as | 163 ++
.../flex/org/apache/flex/core/CallLaterBead.as | 128 ++
.../flex/org/apache/flex/core/ClassFactory.as | 90 +
.../flex/org/apache/flex/core/ContainerBase.as | 443 +++++
.../flex/core/ContainerBaseStrandChildren.as | 99 +
.../org/apache/flex/core/DataBindingBase.as | 45 +
.../org/apache/flex/core/FilledRectangle.as | 125 ++
.../org/apache/flex/core/HTMLElementWrapper.as | 247 +++
.../flex/org/apache/flex/core/IAlertModel.as | 135 ++
.../org/apache/flex/core/IApplicationView.as | 45 +
.../src/main/flex/org/apache/flex/core/IBead.as | 47 +
.../org/apache/flex/core/IBeadController.as | 37 +
.../flex/org/apache/flex/core/IBeadLayout.as | 40 +
.../flex/org/apache/flex/core/IBeadModel.as | 39 +
.../main/flex/org/apache/flex/core/IBeadView.as | 46 +
.../flex/org/apache/flex/core/IBorderModel.as | 46 +
.../main/flex/org/apache/flex/core/IChild.as | 59 +
.../main/flex/org/apache/flex/core/IChrome.as | 37 +
.../flex/org/apache/flex/core/IComboBoxModel.as | 108 ++
.../flex/org/apache/flex/core/IContainer.as | 47 +
.../flex/org/apache/flex/core/IContainerView.as | 33 +
.../flex/org/apache/flex/core/IContentView.as | 38 +
.../org/apache/flex/core/IContentViewHost.as | 35 +
.../flex/org/apache/flex/core/IDataGridModel.as | 44 +
.../flex/core/IDataGridPresentationModel.as | 45 +
.../core/IDataProviderItemRendererMapper.as | 52 +
.../org/apache/flex/core/IDateChooserModel.as | 101 ++
.../main/flex/org/apache/flex/core/IDocument.as | 48 +
.../flex/org/apache/flex/core/IDragInitiator.as | 67 +
.../flex/org/apache/flex/core/IEffectTimer.as | 68 +
.../main/flex/org/apache/flex/core/IFactory.as | 46 +
.../main/flex/org/apache/flex/core/IFlexInfo.as | 43 +
.../flex/org/apache/flex/core/IFlexJSElement.as | 27 +
.../flex/org/apache/flex/core/IFormatBead.as | 69 +
.../flex/org/apache/flex/core/IImageModel.as | 48 +
.../flex/org/apache/flex/core/IItemRenderer.as | 57 +
.../flex/core/IItemRendererClassFactory.as | 60 +
.../org/apache/flex/core/IItemRendererParent.as | 52 +
.../apache/flex/core/IItemRendererProvider.as | 58 +
.../flex/org/apache/flex/core/ILayoutChild.as | 175 ++
.../flex/org/apache/flex/core/ILayoutHost.as | 44 +
.../apache/flex/core/IListPresentationModel.as | 54 +
.../flex/org/apache/flex/core/IMXMLDocument.as | 66 +
.../org/apache/flex/core/IMeasurementBead.as | 53 +
.../flex/org/apache/flex/core/IPanelModel.as | 45 +
.../main/flex/org/apache/flex/core/IParent.as | 109 ++
.../flex/org/apache/flex/core/IParentIUIBase.as | 37 +
.../main/flex/org/apache/flex/core/IPopUp.as | 33 +
.../flex/org/apache/flex/core/IPopUpHost.as | 33 +
.../flex/org/apache/flex/core/IRangeModel.as | 95 +
.../flex/org/apache/flex/core/IRollOverModel.as | 46 +
.../org/apache/flex/core/IScrollBarModel.as | 58 +
.../apache/flex/core/ISelectableItemRenderer.as | 95 +
.../org/apache/flex/core/ISelectionModel.as | 100 +
.../flex/org/apache/flex/core/IStatesImpl.as | 37 +
.../flex/org/apache/flex/core/IStatesObject.as | 74 +
.../main/flex/org/apache/flex/core/IStrand.as | 77 +
.../org/apache/flex/core/IStrandWithModel.as | 50 +
.../flex/org/apache/flex/core/IStyleObject.as | 45 +
.../org/apache/flex/core/IStyleableObject.as | 71 +
.../flex/org/apache/flex/core/ITextModel.as | 56 +
.../flex/org/apache/flex/core/ITitleBarModel.as | 73 +
.../org/apache/flex/core/IToggleButtonModel.as | 67 +
.../main/flex/org/apache/flex/core/IUIBase.as | 160 ++
.../apache/flex/core/IValueToggleButtonModel.as | 69 +
.../flex/org/apache/flex/core/IValuesImpl.as | 153 ++
.../main/flex/org/apache/flex/core/IViewport.as | 80 +
.../flex/org/apache/flex/core/IViewportModel.as | 50 +
.../org/apache/flex/core/IViewportScroller.as | 36 +
.../flex/core/ItemRendererClassFactory.as | 194 ++
.../main/flex/org/apache/flex/core/ListBase.as | 126 ++
.../apache/flex/core/ListBaseStrandChildren.as | 100 +
.../org/apache/flex/core/MXMLDragInitiator.as | 131 ++
.../org/apache/flex/core/ParentDocumentBead.as | 127 ++
.../org/apache/flex/core/SimpleApplication.as | 102 ++
.../org/apache/flex/core/SimpleCSSStyles.as | 106 ++
.../org/apache/flex/core/SimpleCSSValuesImpl.as | 765 ++++++++
.../org/apache/flex/core/SimpleStatesImpl.as | 222 +++
.../org/apache/flex/core/SimpleValuesImpl.as | 188 ++
.../flex/org/apache/flex/core/StageProxy.as | 127 ++
.../main/flex/org/apache/flex/core/Strand.as | 182 ++
.../apache/flex/core/StyleableCSSTextField.as | 201 ++
.../main/flex/org/apache/flex/core/UIBase.as | 1483 +++++++++++++++
.../flex/org/apache/flex/core/UIButtonBase.as | 860 +++++++++
.../flex/org/apache/flex/core/ValuesManager.as | 72 +
.../main/flex/org/apache/flex/core/ViewBase.as | 98 +
.../org/apache/flex/core/WrappedHTMLElement.as | 21 +
.../flex/org/apache/flex/events/BrowserEvent.as | 475 +++++
.../flex/org/apache/flex/events/CustomEvent.as | 64 +
.../org/apache/flex/events/ElementEvents.as | 51 +
.../main/flex/org/apache/flex/events/Event.as | 133 ++
.../org/apache/flex/events/EventDispatcher.as | 66 +
.../org/apache/flex/events/IEventDispatcher.as | 49 +
.../flex/org/apache/flex/events/MouseEvent.as | 366 ++++
.../org/apache/flex/events/ValueChangeEvent.as | 129 ++
.../flex/org/apache/flex/events/ValueEvent.as | 68 +
.../flex/events/utils/IHandlesOriginalEvent.as | 35 +
.../flex/events/utils/MouseEventConverter.as | 173 ++
.../org/apache/flex/events/utils/MouseUtils.as | 103 ++
.../src/main/flex/org/apache/flex/geom/Point.as | 72 +
.../main/flex/org/apache/flex/geom/Rectangle.as | 95 +
.../src/main/flex/org/apache/flex/geom/Size.as | 41 +
.../flex/org/apache/flex/states/AddItems.as | 101 ++
.../org/apache/flex/states/ItemAndDescriptor.as | 70 +
.../org/apache/flex/states/SetEventHandler.as | 79 +
.../flex/org/apache/flex/states/SetProperty.as | 81 +
.../main/flex/org/apache/flex/states/State.as | 83 +
.../flex/org/apache/flex/utils/BinaryData.as | 391 ++++
.../org/apache/flex/utils/CSSBorderUtils.as | 219 +++
.../org/apache/flex/utils/CSSContainerUtils.as | 194 ++
.../main/flex/org/apache/flex/utils/CSSUtils.as | 328 ++++
.../flex/org/apache/flex/utils/EffectTimer.as | 136 ++
.../flex/org/apache/flex/utils/HTMLLoader.as | 42 +
.../main/flex/org/apache/flex/utils/Language.as | 362 ++++
.../apache/flex/utils/MXMLDataInterpreter.as | 463 +++++
.../flex/org/apache/flex/utils/MixinManager.as | 105 ++
.../flex/org/apache/flex/utils/PNGEncoder.as | 305 ++++
.../flex/org/apache/flex/utils/PointUtils.as | 125 ++
.../org/apache/flex/utils/SolidBorderUtil.as | 191 ++
.../flex/org/apache/flex/utils/StringTrimmer.as | 176 ++
.../main/flex/org/apache/flex/utils/Timer.as | 148 ++
.../main/flex/org/apache/flex/utils/UIUtils.as | 107 ++
.../flex/utils/ViewSourceContextMenuOption.as | 97 +
.../org/apache/flex/utils/dbg/DOMPathUtil.as | 95 +
.../Core/src/main/resources/basic-manifest.xml | 41 +
.../src/main/resources/compile-asjs-config.xml | 78 +
.../Core/src/main/resources/compile-config.xml | 77 +
.../test/flex/FlexUnitFlexJSApplication.mxml | 46 +
.../projects/Core/src/test/flex/build.xml | 162 ++
.../src/test/flex/flexUnitTests/StrandTester.as | 27 +
.../test/flex/flexUnitTests/StrandTesterTest.as | 55 +
.../projects/CreateJS/.actionScriptProperties | 40 +-
.../.externalToolBuilders/CreateJSASJS.launch | 44 +
frameworks/projects/CreateJS/.flexLibProperties | 18 +
frameworks/projects/CreateJS/.project | 36 +-
frameworks/projects/CreateJS/as/defaults.css | 36 -
.../projects/CreateJS/as/src/CreateJSClasses.as | 33 -
.../src/org/apache/flex/createjs/Application.as | 120 --
.../as/src/org/apache/flex/createjs/CheckBox.as | 124 --
.../as/src/org/apache/flex/createjs/Label.as | 81 -
.../src/org/apache/flex/createjs/TextButton.as | 118 --
.../src/org/apache/flex/createjs/core/UIBase.as | 449 -----
.../org/apache/flex/createjs/core/ViewBase.as | 206 ---
frameworks/projects/CreateJS/build.xml | 76 +-
.../projects/CreateJS/compile-asjs-config.xml | 83 -
frameworks/projects/CreateJS/compile-config.xml | 83 -
.../projects/CreateJS/createjs-manifest.xml | 31 -
.../CreateJS/src/main/flex/CreateJSClasses.as | 33 +
.../org/apache/flex/createjs/Application.as | 120 ++
.../flex/org/apache/flex/createjs/CheckBox.as | 124 ++
.../main/flex/org/apache/flex/createjs/Label.as | 81 +
.../flex/org/apache/flex/createjs/TextButton.as | 118 ++
.../org/apache/flex/createjs/core/UIBase.as | 449 +++++
.../org/apache/flex/createjs/core/ViewBase.as | 206 +++
.../src/main/resources/compile-asjs-config.xml | 83 +
.../src/main/resources/compile-config.xml | 83 +
.../src/main/resources/createjs-manifest.xml | 31 +
.../CreateJS/src/main/resources/defaults.css | 36 +
.../projects/DragDrop/.actionScriptProperties | 38 +-
.../.externalToolBuilders/DragDropASJS.launch | 44 +
frameworks/projects/DragDrop/.flexLibProperties | 18 +
frameworks/projects/DragDrop/.project | 35 +-
.../projects/DragDrop/as/src/DragDropClasses.as | 35 -
.../as/src/org/apache/flex/core/DropType.as | 64 -
.../as/src/org/apache/flex/events/DragEvent.as | 373 ----
.../src/org/apache/flex/events/DragEventBase.as | 51 -
.../beads/controllers/DragMouseController.as | 261 ---
.../beads/controllers/DropMouseController.as | 185 --
frameworks/projects/DragDrop/basic-manifest.xml | 27 -
frameworks/projects/DragDrop/build.xml | 74 +-
.../projects/DragDrop/compile-asjs-config.xml | 79 -
frameworks/projects/DragDrop/compile-config.xml | 78 -
.../DragDrop/src/main/flex/DragDropClasses.as | 35 +
.../main/flex/org/apache/flex/core/DropType.as | 64 +
.../flex/org/apache/flex/events/DragEvent.as | 373 ++++
.../org/apache/flex/events/DragEventBase.as | 51 +
.../beads/controllers/DragMouseController.as | 261 +++
.../beads/controllers/DropMouseController.as | 185 ++
.../src/main/resources/basic-manifest.xml | 27 +
.../src/main/resources/compile-asjs-config.xml | 79 +
.../src/main/resources/compile-config.xml | 78 +
.../projects/Effects/.actionScriptProperties | 38 +-
.../.externalToolBuilders/EffectsASJS.launch | 44 +
frameworks/projects/Effects/.flexLibProperties | 18 +
frameworks/projects/Effects/.project | 35 +-
.../projects/Effects/as/src/EffectsClasses.as | 38 -
.../flex/core/StatesWithTransitionsImpl.as | 346 ----
.../as/src/org/apache/flex/effects/Effect.as | 263 ---
.../as/src/org/apache/flex/effects/Fade.as | 165 --
.../as/src/org/apache/flex/effects/IEffect.as | 136 --
.../as/src/org/apache/flex/effects/Move.as | 240 ---
.../as/src/org/apache/flex/effects/Parallel.as | 152 --
.../org/apache/flex/effects/PlatformWiper.as | 138 --
.../as/src/org/apache/flex/effects/Resize.as | 197 --
.../as/src/org/apache/flex/effects/Sequence.as | 152 --
.../as/src/org/apache/flex/effects/Tween.as | 665 -------
.../as/src/org/apache/flex/effects/Wipe.as | 156 --
.../as/src/org/apache/flex/states/Transition.as | 80 -
frameworks/projects/Effects/basic-manifest.xml | 32 -
frameworks/projects/Effects/build.xml | 81 +-
.../projects/Effects/compile-asjs-config.xml | 79 -
frameworks/projects/Effects/compile-config.xml | 78 -
.../Effects/src/main/flex/EffectsClasses.as | 38 +
.../flex/core/StatesWithTransitionsImpl.as | 346 ++++
.../main/flex/org/apache/flex/effects/Effect.as | 263 +++
.../main/flex/org/apache/flex/effects/Fade.as | 165 ++
.../flex/org/apache/flex/effects/IEffect.as | 136 ++
.../main/flex/org/apache/flex/effects/Move.as | 240 +++
.../flex/org/apache/flex/effects/Parallel.as | 152 ++
.../org/apache/flex/effects/PlatformWiper.as | 138 ++
.../main/flex/org/apache/flex/effects/Resize.as | 197 ++
.../flex/org/apache/flex/effects/Sequence.as | 152 ++
.../main/flex/org/apache/flex/effects/Tween.as | 665 +++++++
.../main/flex/org/apache/flex/effects/Wipe.as | 156 ++
.../flex/org/apache/flex/states/Transition.as | 80 +
.../src/main/resources/basic-manifest.xml | 32 +
.../src/main/resources/compile-asjs-config.xml | 79 +
.../src/main/resources/compile-config.xml | 78 +
.../projects/Flat/.actionScriptProperties | 58 +
.../Flat/.externalToolBuilders/FlatASJS.launch | 44 +
frameworks/projects/Flat/.flexLibProperties | 24 +
frameworks/projects/Flat/.project | 48 +
.../.settings/org.eclipse.core.resources.prefs | 3 +
frameworks/projects/Flat/as/defaults.css | 842 ---------
frameworks/projects/Flat/as/src/FlatClasses.as | 44 -
.../as/src/org/apache/flex/flat/CheckBox.as | 161 --
.../as/src/org/apache/flex/flat/DropDownList.as | 368 ----
.../as/src/org/apache/flex/flat/RadioButton.as | 245 ---
.../beads/CSSContentAndTextToggleButtonView.as | 304 ----
.../flex/flat/beads/CSSScrollBarButtonView.as | 178 --
.../apache/flex/flat/beads/CSSScrollBarView.as | 241 ---
...CheckboxCSSContentAndTextToggleButtonView.as | 48 -
.../apache/flex/flat/beads/DropDownListView.as | 309 ----
.../RadioCSSContentAndTextToggleButtonView.as | 47 -
.../flat/supportClasses/DropDownListList.as | 64 -
.../DropDownListStringItemRenderer.as | 70 -
frameworks/projects/Flat/build.xml | 76 +-
.../projects/Flat/compile-asjs-config.xml | 80 -
frameworks/projects/Flat/compile-config.xml | 91 -
frameworks/projects/Flat/flat-as-manifest.xml | 26 -
frameworks/projects/Flat/flat-manifest.xml | 99 -
.../projects/Flat/src/main/flex/FlatClasses.as | 44 +
.../main/flex/org/apache/flex/flat/CheckBox.as | 161 ++
.../flex/org/apache/flex/flat/DropDownList.as | 368 ++++
.../flex/org/apache/flex/flat/RadioButton.as | 245 +++
.../beads/CSSContentAndTextToggleButtonView.as | 304 ++++
.../flex/flat/beads/CSSScrollBarButtonView.as | 178 ++
.../apache/flex/flat/beads/CSSScrollBarView.as | 241 +++
...CheckboxCSSContentAndTextToggleButtonView.as | 48 +
.../apache/flex/flat/beads/DropDownListView.as | 309 ++++
.../RadioCSSContentAndTextToggleButtonView.as | 47 +
.../flat/supportClasses/DropDownListList.as | 64 +
.../DropDownListStringItemRenderer.as | 70 +
.../src/main/resources/compile-asjs-config.xml | 80 +
.../Flat/src/main/resources/compile-config.xml | 91 +
.../Flat/src/main/resources/defaults.css | 842 +++++++++
.../src/main/resources/flat-as-manifest.xml | 26 +
.../Flat/src/main/resources/flat-manifest.xml | 99 +
.../projects/Formatters/.actionScriptProperties | 40 +-
.../.externalToolBuilders/FormattersASJS.launch | 44 +
.../projects/Formatters/.flexLibProperties | 18 +
frameworks/projects/Formatters/.project | 36 +-
.../Formatters/as/src/FormattersClasses.as | 41 -
.../as/src/org/apache/flex/core/FormatBase.as | 113 --
.../flex/html/accessories/CurrencyFormatter.as | 215 ---
.../html/accessories/DateFormatMMDDYYYYBead.as | 158 --
.../flex/html/accessories/NumberFormatter.as | 210 ---
.../flex/html/beads/FormatableLabelView.as | 90 -
.../flex/html/beads/FormatableTextInputView.as | 91 -
.../projects/Formatters/basic-manifest.xml | 25 -
frameworks/projects/Formatters/build.xml | 75 +-
.../projects/Formatters/compile-asjs-config.xml | 80 -
.../projects/Formatters/compile-config.xml | 79 -
.../src/main/flex/FormattersClasses.as | 41 +
.../flex/org/apache/flex/core/FormatBase.as | 113 ++
.../flex/html/accessories/CurrencyFormatter.as | 215 +++
.../html/accessories/DateFormatMMDDYYYYBead.as | 158 ++
.../flex/html/accessories/NumberFormatter.as | 210 +++
.../flex/html/beads/FormatableLabelView.as | 90 +
.../flex/html/beads/FormatableTextInputView.as | 91 +
.../src/main/resources/basic-manifest.xml | 25 +
.../src/main/resources/compile-asjs-config.xml | 80 +
.../src/main/resources/compile-config.xml | 79 +
.../projects/GoogleMaps/.actionScriptProperties | 38 +-
.../.externalToolBuilders/GoogleMapsASJS.launch | 44 +
.../projects/GoogleMaps/.flexLibProperties | 28 +-
frameworks/projects/GoogleMaps/.project | 35 +-
frameworks/projects/GoogleMaps/as/defaults.css | 29 -
.../GoogleMaps/as/src/GoogleMapsClasses.as | 36 -
.../GoogleMaps/as/src/GoogleStubClasses.as | 42 -
.../GoogleMaps/as/src/google/maps/Animation.as | 24 -
.../as/src/google/maps/BicyclingLayer.as | 29 -
.../GoogleMaps/as/src/google/maps/Circle.as | 108 --
.../as/src/google/maps/ControlPosition.as | 94 -
.../as/src/google/maps/DirectionsRenderer.as | 76 -
.../as/src/google/maps/DirectionsService.as | 24 -
.../as/src/google/maps/DirectionsStatus.as | 66 -
.../google/maps/DistanceMatrixElementStatus.as | 31 -
.../as/src/google/maps/DistanceMatrixService.as | 24 -
.../as/src/google/maps/DistanceMatrixStatus.as | 59 -
.../as/src/google/maps/ElevationService.as | 32 -
.../as/src/google/maps/ElevationStatus.as | 45 -
.../as/src/google/maps/FusionTablesHeatmap.as | 22 -
.../as/src/google/maps/FusionTablesLayer.as | 37 -
.../google/maps/FusionTablesMarkerOptions.as | 22 -
.../google/maps/FusionTablesPolygonOptions.as | 46 -
.../google/maps/FusionTablesPolylineOptions.as | 34 -
.../as/src/google/maps/FusionTablesQuery.as | 52 -
.../as/src/google/maps/FusionTablesStyle.as | 40 -
.../GoogleMaps/as/src/google/maps/Geocoder.as | 24 -
.../src/google/maps/GeocoderAddressComponent.as | 34 -
.../as/src/google/maps/GeocoderGeometry.as | 40 -
.../as/src/google/maps/GeocoderLocationType.as | 38 -
.../as/src/google/maps/GeocoderResult.as | 40 -
.../as/src/google/maps/GeocoderStatus.as | 59 -
.../as/src/google/maps/GroundOverlay.as | 57 -
.../as/src/google/maps/ImageMapType.as | 30 -
.../GoogleMaps/as/src/google/maps/InfoWindow.as | 77 -
.../GoogleMaps/as/src/google/maps/KmlAuthor.as | 34 -
.../as/src/google/maps/KmlFeatureData.as | 52 -
.../GoogleMaps/as/src/google/maps/KmlLayer.as | 61 -
.../as/src/google/maps/KmlLayerMetadata.as | 40 -
.../as/src/google/maps/KmlLayerStatus.as | 73 -
.../as/src/google/maps/KmlMouseEvent.as | 34 -
.../GoogleMaps/as/src/google/maps/LatLng.as | 78 -
.../as/src/google/maps/LatLngBounds.as | 96 -
.../GoogleMaps/as/src/google/maps/MVCArray.as | 85 -
.../GoogleMaps/as/src/google/maps/MVCObject.as | 103 --
.../GoogleMaps/as/src/google/maps/Map.as | 168 --
.../as/src/google/maps/MapCanvasProjection.as | 52 -
.../GoogleMaps/as/src/google/maps/MapPanes.as | 58 -
.../as/src/google/maps/MapTypeControlStyle.as | 31 -
.../GoogleMaps/as/src/google/maps/MapTypeId.as | 38 -
.../as/src/google/maps/MapTypeRegistry.as | 17 -
.../as/src/google/maps/MapsEventListener.as | 16 -
.../GoogleMaps/as/src/google/maps/Marker.as | 299 ---
.../as/src/google/maps/MaxZoomService.as | 24 -
.../as/src/google/maps/MaxZoomStatus.as | 24 -
.../GoogleMaps/as/src/google/maps/MouseEvent.as | 28 -
.../as/src/google/maps/OverlayView.as | 59 -
.../GoogleMaps/as/src/google/maps/Point.as | 43 -
.../as/src/google/maps/PolyMouseEvent.as | 34 -
.../GoogleMaps/as/src/google/maps/Polygon.as | 102 --
.../GoogleMaps/as/src/google/maps/Polyline.as | 89 -
.../GoogleMaps/as/src/google/maps/Rectangle.as | 89 -
.../as/src/google/maps/ScaleControlStyle.as | 17 -
.../GoogleMaps/as/src/google/maps/Size.as | 45 -
.../src/google/maps/StreetViewCoverageLayer.as | 29 -
.../as/src/google/maps/StreetViewPanorama.as | 108 --
.../as/src/google/maps/StreetViewPov.as | 28 -
.../as/src/google/maps/StreetViewService.as | 33 -
.../as/src/google/maps/StreetViewStatus.as | 31 -
.../as/src/google/maps/StrokePosition.as | 31 -
.../as/src/google/maps/StyledMapType.as | 18 -
.../GoogleMaps/as/src/google/maps/SymbolPath.as | 45 -
.../as/src/google/maps/TrafficLayer.as | 29 -
.../as/src/google/maps/TransitLayer.as | 29 -
.../GoogleMaps/as/src/google/maps/TravelMode.as | 38 -
.../GoogleMaps/as/src/google/maps/UnitSystem.as | 24 -
.../as/src/google/maps/ZoomControlStyle.as | 31 -
.../GoogleMaps/as/src/google/maps/adsense.as | 27 -
.../as/src/google/maps/adsense/AdFormat.as | 136 --
.../as/src/google/maps/adsense/AdUnit.as | 146 --
.../GoogleMaps/as/src/google/maps/drawing.as | 33 -
.../src/google/maps/drawing/DrawingManager.as | 53 -
.../google/maps/drawing/OverlayCompleteEvent.as | 28 -
.../as/src/google/maps/drawing/OverlayType.as | 45 -
.../GoogleMaps/as/src/google/maps/event.as | 83 -
.../GoogleMaps/as/src/google/maps/geometry.as | 33 -
.../as/src/google/maps/geometry/encoding.as | 28 -
.../as/src/google/maps/geometry/poly.as | 34 -
.../as/src/google/maps/geometry/spherical.as | 86 -
.../GoogleMaps/as/src/google/maps/panoramio.as | 30 -
.../src/google/maps/panoramio/PanoramioLayer.as | 66 -
.../GoogleMaps/as/src/google/maps/places.as | 103 --
.../as/src/google/maps/places/Autocomplete.as | 54 -
.../google/maps/places/AutocompleteService.as | 32 -
.../google/maps/places/ComponentRestrictions.as | 22 -
.../as/src/google/maps/places/PhotoOptions.as | 28 -
.../src/google/maps/places/PlaceAspectRating.as | 28 -
.../as/src/google/maps/places/PlaceGeometry.as | 31 -
.../as/src/google/maps/places/PlaceResult.as | 142 --
.../as/src/google/maps/places/PlaceReview.as | 40 -
.../google/maps/places/PlaceSearchPagination.as | 28 -
.../as/src/google/maps/places/PlacesService.as | 49 -
.../google/maps/places/PlacesServiceStatus.as | 52 -
.../as/src/google/maps/places/RankBy.as | 24 -
.../as/src/google/maps/places/SearchBox.as | 40 -
.../as/src/google/maps/visualization.as | 74 -
.../maps/visualization/DemographicsLayer.as | 65 -
.../google/maps/visualization/HeatmapLayer.as | 47 -
.../maps/visualization/MapsEngineLayer.as | 91 -
.../maps/visualization/MapsEngineStatus.as | 31 -
.../GoogleMaps/as/src/google/maps/weather.as | 60 -
.../as/src/google/maps/weather/CloudLayer.as | 32 -
.../as/src/google/maps/weather/LabelColor.as | 24 -
.../src/google/maps/weather/TemperatureUnit.as | 24 -
.../as/src/google/maps/weather/WeatherLayer.as | 40 -
.../as/src/google/maps/weather/WindSpeedUnit.as | 31 -
.../org/apache/flex/maps/google/GoogleMap.as | 133 --
.../flex/maps/google/beads/GoogleMapView.as | 899 ---------
.../flex/maps/google/beads/MapView_original.as | 515 ------
.../apache/flex/maps/google/models/MapModel.as | 165 --
frameworks/projects/GoogleMaps/build.xml | 75 +-
.../projects/GoogleMaps/compile-asjs-config.xml | 75 -
.../projects/GoogleMaps/compile-config.xml | 83 -
.../projects/GoogleMaps/google-manifest.xml | 24 -
.../src/main/flex/GoogleMapsClasses.as | 36 +
.../src/main/flex/GoogleStubClasses.as | 42 +
.../src/main/flex/google/maps/Animation.as | 24 +
.../src/main/flex/google/maps/BicyclingLayer.as | 29 +
.../src/main/flex/google/maps/Circle.as | 108 ++
.../main/flex/google/maps/ControlPosition.as | 94 +
.../main/flex/google/maps/DirectionsRenderer.as | 78 +
.../main/flex/google/maps/DirectionsService.as | 24 +
.../main/flex/google/maps/DirectionsStatus.as | 66 +
.../google/maps/DistanceMatrixElementStatus.as | 31 +
.../flex/google/maps/DistanceMatrixService.as | 24 +
.../flex/google/maps/DistanceMatrixStatus.as | 59 +
.../main/flex/google/maps/ElevationService.as | 32 +
.../main/flex/google/maps/ElevationStatus.as | 45 +
.../flex/google/maps/FusionTablesHeatmap.as | 22 +
.../main/flex/google/maps/FusionTablesLayer.as | 37 +
.../google/maps/FusionTablesMarkerOptions.as | 22 +
.../google/maps/FusionTablesPolygonOptions.as | 46 +
.../google/maps/FusionTablesPolylineOptions.as | 34 +
.../main/flex/google/maps/FusionTablesQuery.as | 52 +
.../main/flex/google/maps/FusionTablesStyle.as | 40 +
.../src/main/flex/google/maps/Geocoder.as | 24 +
.../google/maps/GeocoderAddressComponent.as | 34 +
.../main/flex/google/maps/GeocoderGeometry.as | 40 +
.../flex/google/maps/GeocoderLocationType.as | 38 +
.../src/main/flex/google/maps/GeocoderResult.as | 40 +
.../src/main/flex/google/maps/GeocoderStatus.as | 59 +
.../src/main/flex/google/maps/GroundOverlay.as | 57 +
.../src/main/flex/google/maps/ImageMapType.as | 30 +
.../src/main/flex/google/maps/InfoWindow.as | 77 +
.../src/main/flex/google/maps/KmlAuthor.as | 34 +
.../src/main/flex/google/maps/KmlFeatureData.as | 52 +
.../src/main/flex/google/maps/KmlLayer.as | 61 +
.../main/flex/google/maps/KmlLayerMetadata.as | 40 +
.../src/main/flex/google/maps/KmlLayerStatus.as | 73 +
.../src/main/flex/google/maps/KmlMouseEvent.as | 34 +
.../src/main/flex/google/maps/LatLng.as | 78 +
.../src/main/flex/google/maps/LatLngBounds.as | 96 +
.../src/main/flex/google/maps/MVCArray.as | 85 +
.../src/main/flex/google/maps/MVCObject.as | 103 ++
.../GoogleMaps/src/main/flex/google/maps/Map.as | 168 ++
.../flex/google/maps/MapCanvasProjection.as | 52 +
.../src/main/flex/google/maps/MapPanes.as | 60 +
.../flex/google/maps/MapTypeControlStyle.as | 31 +
.../src/main/flex/google/maps/MapTypeId.as | 38 +
.../main/flex/google/maps/MapTypeRegistry.as | 17 +
.../main/flex/google/maps/MapsEventListener.as | 16 +
.../src/main/flex/google/maps/Marker.as | 299 +++
.../src/main/flex/google/maps/MaxZoomService.as | 24 +
.../src/main/flex/google/maps/MaxZoomStatus.as | 24 +
.../src/main/flex/google/maps/MouseEvent.as | 28 +
.../src/main/flex/google/maps/OverlayView.as | 59 +
.../src/main/flex/google/maps/Point.as | 43 +
.../src/main/flex/google/maps/PolyMouseEvent.as | 34 +
.../src/main/flex/google/maps/Polygon.as | 102 ++
.../src/main/flex/google/maps/Polyline.as | 89 +
.../src/main/flex/google/maps/Rectangle.as | 89 +
.../main/flex/google/maps/ScaleControlStyle.as | 17 +
.../src/main/flex/google/maps/Size.as | 45 +
.../flex/google/maps/StreetViewCoverageLayer.as | 29 +
.../main/flex/google/maps/StreetViewPanorama.as | 108 ++
.../src/main/flex/google/maps/StreetViewPov.as | 28 +
.../main/flex/google/maps/StreetViewService.as | 33 +
.../main/flex/google/maps/StreetViewStatus.as | 31 +
.../src/main/flex/google/maps/StrokePosition.as | 31 +
.../src/main/flex/google/maps/StyledMapType.as | 18 +
.../src/main/flex/google/maps/SymbolPath.as | 45 +
.../src/main/flex/google/maps/TrafficLayer.as | 29 +
.../src/main/flex/google/maps/TransitLayer.as | 29 +
.../src/main/flex/google/maps/TravelMode.as | 38 +
.../src/main/flex/google/maps/UnitSystem.as | 24 +
.../main/flex/google/maps/ZoomControlStyle.as | 31 +
.../src/main/flex/google/maps/adsense.as | 27 +
.../main/flex/google/maps/adsense/AdFormat.as | 136 ++
.../src/main/flex/google/maps/adsense/AdUnit.as | 147 ++
.../src/main/flex/google/maps/drawing.as | 33 +
.../flex/google/maps/drawing/DrawingManager.as | 53 +
.../google/maps/drawing/OverlayCompleteEvent.as | 28 +
.../flex/google/maps/drawing/OverlayType.as | 45 +
.../src/main/flex/google/maps/event.as | 83 +
.../src/main/flex/google/maps/geometry.as | 33 +
.../main/flex/google/maps/geometry/encoding.as | 28 +
.../src/main/flex/google/maps/geometry/poly.as | 34 +
.../main/flex/google/maps/geometry/spherical.as | 86 +
.../src/main/flex/google/maps/panoramio.as | 30 +
.../google/maps/panoramio/PanoramioLayer.as | 66 +
.../src/main/flex/google/maps/places.as | 103 ++
.../flex/google/maps/places/Autocomplete.as | 55 +
.../google/maps/places/AutocompleteService.as | 32 +
.../google/maps/places/ComponentRestrictions.as | 22 +
.../flex/google/maps/places/PhotoOptions.as | 28 +
.../google/maps/places/PlaceAspectRating.as | 28 +
.../flex/google/maps/places/PlaceGeometry.as | 31 +
.../main/flex/google/maps/places/PlaceResult.as | 142 ++
.../main/flex/google/maps/places/PlaceReview.as | 40 +
.../google/maps/places/PlaceSearchPagination.as | 28 +
.../flex/google/maps/places/PlacesService.as | 49 +
.../google/maps/places/PlacesServiceStatus.as | 52 +
.../src/main/flex/google/maps/places/RankBy.as | 24 +
.../main/flex/google/maps/places/SearchBox.as | 42 +
.../src/main/flex/google/maps/visualization.as | 74 +
.../maps/visualization/DemographicsLayer.as | 65 +
.../google/maps/visualization/HeatmapLayer.as | 47 +
.../maps/visualization/MapsEngineLayer.as | 91 +
.../maps/visualization/MapsEngineStatus.as | 31 +
.../src/main/flex/google/maps/weather.as | 60 +
.../main/flex/google/maps/weather/CloudLayer.as | 32 +
.../main/flex/google/maps/weather/LabelColor.as | 24 +
.../flex/google/maps/weather/TemperatureUnit.as | 24 +
.../flex/google/maps/weather/WeatherLayer.as | 40 +
.../flex/google/maps/weather/WindSpeedUnit.as | 31 +
.../main/flex/google/pseudo/HTMLInputElement.as | 5 +
.../src/main/flex/google/pseudo/Node.as | 5 +
.../org/apache/flex/maps/google/GoogleMap.as | 133 ++
.../flex/maps/google/beads/GoogleMapView.as | 866 +++++++++
.../flex/maps/google/beads/MapView_original.as | 515 ++++++
.../apache/flex/maps/google/models/MapModel.as | 165 ++
.../src/main/resources/compile-asjs-config.xml | 75 +
.../src/main/resources/compile-config.xml | 83 +
.../GoogleMaps/src/main/resources/defaults.css | 29 +
.../src/main/resources/google-manifest.xml | 24 +
.../projects/Graphics/.actionScriptProperties | 38 +-
.../.externalToolBuilders/GraphicsASJS.launch | 44 +
frameworks/projects/Graphics/.flexLibProperties | 18 +
frameworks/projects/Graphics/.project | 35 +-
.../projects/Graphics/as/src/GraphicsClasses.as | 44 -
.../src/org/apache/flex/core/graphics/Circle.as | 98 -
.../org/apache/flex/core/graphics/Ellipse.as | 91 -
.../apache/flex/core/graphics/GradientBase.as | 229 ---
.../apache/flex/core/graphics/GradientEntry.as | 133 --
.../apache/flex/core/graphics/GraphicShape.as | 213 ---
.../flex/core/graphics/GraphicsContainer.as | 302 ---
.../src/org/apache/flex/core/graphics/IFill.as | 32 -
.../org/apache/flex/core/graphics/IStroke.as | 29 -
.../apache/flex/core/graphics/LinearGradient.as | 123 --
.../src/org/apache/flex/core/graphics/Path.as | 103 --
.../src/org/apache/flex/core/graphics/Rect.as | 87 -
.../org/apache/flex/core/graphics/SolidColor.as | 112 --
.../flex/core/graphics/SolidColorStroke.as | 130 --
.../src/org/apache/flex/core/graphics/Text.as | 140 --
.../graphics/utils/AdvancedLayoutFeatures.as | 1140 ------------
.../core/graphics/utils/CompoundTransform.as | 777 --------
.../core/graphics/utils/IAssetLayoutFeatures.as | 371 ----
.../flex/core/graphics/utils/MatrixUtil.as | 1605 ----------------
.../flex/core/graphics/utils/PathHelper.as | 1712 ------------------
.../core/graphics/utils/TransformOffsets.as | 367 ----
frameworks/projects/Graphics/basic-manifest.xml | 34 -
frameworks/projects/Graphics/build.xml | 82 +-
.../projects/Graphics/compile-asjs-config.xml | 82 -
frameworks/projects/Graphics/compile-config.xml | 78 -
.../Graphics/src/main/flex/GraphicsClasses.as | 44 +
.../org/apache/flex/core/graphics/Circle.as | 98 +
.../org/apache/flex/core/graphics/Ellipse.as | 91 +
.../apache/flex/core/graphics/GradientBase.as | 229 +++
.../apache/flex/core/graphics/GradientEntry.as | 133 ++
.../apache/flex/core/graphics/GraphicShape.as | 213 +++
.../flex/core/graphics/GraphicsContainer.as | 302 +++
.../flex/org/apache/flex/core/graphics/IFill.as | 32 +
.../org/apache/flex/core/graphics/IStroke.as | 29 +
.../apache/flex/core/graphics/LinearGradient.as | 123 ++
.../flex/org/apache/flex/core/graphics/Path.as | 103 ++
.../flex/org/apache/flex/core/graphics/Rect.as | 87 +
.../org/apache/flex/core/graphics/SolidColor.as | 112 ++
.../flex/core/graphics/SolidColorStroke.as | 130 ++
.../flex/org/apache/flex/core/graphics/Text.as | 140 ++
.../graphics/utils/AdvancedLayoutFeatures.as | 1140 ++++++++++++
.../core/graphics/utils/CompoundTransform.as | 777 ++++++++
.../core/graphics/utils/IAssetLayoutFeatures.as | 371 ++++
.../flex/core/graphics/utils/MatrixUtil.as | 1605 ++++++++++++++++
.../flex/core/graphics/utils/PathHelper.as | 1712 ++++++++++++++++++
.../core/graphics/utils/TransformOffsets.as | 367 ++++
.../src/main/resources/basic-manifest.xml | 34 +
.../src/main/resources/compile-asjs-config.xml | 82 +
.../src/main/resources/compile-config.xml | 78 +
.../projects/HTML/.actionScriptProperties | 43 +-
.../HTML/.externalToolBuilders/HTMLASJS.launch | 44 +
frameworks/projects/HTML/.flexLibProperties | 18 +
frameworks/projects/HTML/.project | 38 +-
frameworks/projects/HTML/as/defaults.css | 623 -------
frameworks/projects/HTML/as/src/HTMLClasses.as | 176 --
.../apache/flex/core/IScrollingLayoutParent.as | 68 -
.../org/apache/flex/events/ItemAddedEvent.as | 88 -
.../org/apache/flex/events/ItemClickedEvent.as | 115 --
.../org/apache/flex/events/ItemRemovedEvent.as | 88 -
.../HTML/as/src/org/apache/flex/html/Alert.as | 287 ---
.../HTML/as/src/org/apache/flex/html/Button.as | 112 --
.../as/src/org/apache/flex/html/ButtonBar.as | 76 -
.../as/src/org/apache/flex/html/CheckBox.as | 181 --
.../as/src/org/apache/flex/html/CloseButton.as | 66 -
.../as/src/org/apache/flex/html/ComboBox.as | 277 ---
.../as/src/org/apache/flex/html/Container.as | 108 --
.../as/src/org/apache/flex/html/ControlBar.as | 99 -
.../as/src/org/apache/flex/html/DataGrid.as | 164 --
.../as/src/org/apache/flex/html/DateChooser.as | 74 -
.../as/src/org/apache/flex/html/DateField.as | 95 -
.../as/src/org/apache/flex/html/DropDownList.as | 235 ---
.../as/src/org/apache/flex/html/HContainer.as | 61 -
.../HTML/as/src/org/apache/flex/html/HRule.as | 63 -
.../HTML/as/src/org/apache/flex/html/Image.as | 99 -
.../org/apache/flex/html/ImageAndTextButton.as | 128 --
.../as/src/org/apache/flex/html/ImageButton.as | 89 -
.../HTML/as/src/org/apache/flex/html/Label.as | 163 --
.../HTML/as/src/org/apache/flex/html/List.as | 311 ----
.../org/apache/flex/html/MXMLBeadViewBase.as | 317 ----
.../src/org/apache/flex/html/MultilineLabel.as | 76 -
.../src/org/apache/flex/html/NumericStepper.as | 214 ---
.../HTML/as/src/org/apache/flex/html/Panel.as | 121 --
.../org/apache/flex/html/PanelWithControlBar.as | 121 --
.../as/src/org/apache/flex/html/RadioButton.as | 348 ----
.../as/src/org/apache/flex/html/SimpleAlert.as | 140 --
.../as/src/org/apache/flex/html/SimpleList.as | 79 -
.../HTML/as/src/org/apache/flex/html/Slider.as | 233 ---
.../HTML/as/src/org/apache/flex/html/Spacer.as | 64 -
.../HTML/as/src/org/apache/flex/html/Spinner.as | 187 --
.../as/src/org/apache/flex/html/TextArea.as | 126 --
.../as/src/org/apache/flex/html/TextButton.as | 120 --
.../as/src/org/apache/flex/html/TextInput.as | 185 --
.../as/src/org/apache/flex/html/TitleBar.as | 146 --
.../org/apache/flex/html/ToggleTextButton.as | 170 --
.../HTML/as/src/org/apache/flex/html/ToolTip.as | 60 -
.../as/src/org/apache/flex/html/VContainer.as | 62 -
.../HTML/as/src/org/apache/flex/html/VRule.as | 68 -
.../accessories/NumericOnlyTextInputBead.as | 199 --
.../flex/html/accessories/PasswordInputBead.as | 102 --
.../flex/html/accessories/TextPromptBead.as | 148 --
.../apache/flex/html/accessories/ToolTipBead.as | 141 --
.../flex/html/beads/AlertMeasurementBead.as | 88 -
.../src/org/apache/flex/html/beads/AlertView.as | 226 ---
.../flex/html/beads/BackgroundImageBead.as | 112 --
.../org/apache/flex/html/beads/ButtonBarView.as | 69 -
.../org/apache/flex/html/beads/CSSButtonView.as | 167 --
.../html/beads/CSSImageAndTextButtonView.as | 367 ----
.../apache/flex/html/beads/CSSTextButtonView.as | 347 ----
.../flex/html/beads/CSSTextToggleButtonView.as | 105 --
.../org/apache/flex/html/beads/CheckBoxView.as | 296 ---
.../apache/flex/html/beads/CloseButtonView.as | 101 --
.../org/apache/flex/html/beads/ComboBoxView.as | 247 ---
.../org/apache/flex/html/beads/ContainerView.as | 553 ------
.../html/beads/ControlBarMeasurementBead.as | 116 --
.../flex/html/beads/DataGridColumnView.as | 101 --
.../apache/flex/html/beads/DataGridLinesBead.as | 199 --
.../org/apache/flex/html/beads/DataGridView.as | 294 ---
.../DataItemRendererFactoryForArrayData.as | 161 --
.../DataItemRendererFactoryForArrayList.as | 174 --
.../DataItemRendererFactoryForColumnData.as | 142 --
.../html/beads/DataProviderChangeNotifier.as | 154 --
.../apache/flex/html/beads/DateChooserView.as | 256 ---
.../org/apache/flex/html/beads/DateFieldView.as | 192 --
.../flex/html/beads/DownArrowButtonView.as | 111 --
.../apache/flex/html/beads/DropDownListView.as | 300 ---
.../src/org/apache/flex/html/beads/HRuleView.as | 87 -
.../flex/html/beads/HScrollBarThumbView.as | 120 --
.../flex/html/beads/HScrollBarTrackView.as | 118 --
.../apache/flex/html/beads/HScrollBarView.as | 99 -
.../apache/flex/html/beads/IBackgroundBead.as | 35 -
.../org/apache/flex/html/beads/IBorderBead.as | 35 -
.../org/apache/flex/html/beads/IComboBoxView.as | 78 -
.../org/apache/flex/html/beads/IDataGridView.as | 36 -
.../apache/flex/html/beads/IDropDownListView.as | 57 -
.../apache/flex/html/beads/IGraphicsDrawing.as | 36 -
.../src/org/apache/flex/html/beads/IListView.as | 48 -
.../apache/flex/html/beads/IScrollBarView.as | 80 -
.../org/apache/flex/html/beads/ISliderView.as | 60 -
.../org/apache/flex/html/beads/ISpinnerView.as | 61 -
.../apache/flex/html/beads/ITextFieldView.as | 44 -
.../apache/flex/html/beads/ITextItemRenderer.as | 45 -
.../flex/html/beads/ImageAndTextButtonView.as | 276 ---
.../apache/flex/html/beads/ImageButtonView.as | 158 --
.../src/org/apache/flex/html/beads/ImageView.as | 223 ---
.../flex/html/beads/LeftArrowButtonView.as | 112 --
.../src/org/apache/flex/html/beads/ListView.as | 210 ---
.../flex/html/beads/MultilineTextFieldView.as | 56 -
.../flex/html/beads/NumericStepperView.as | 186 --
.../src/org/apache/flex/html/beads/PanelView.as | 168 --
.../flex/html/beads/PanelWithControlBarView.as | 207 ---
.../apache/flex/html/beads/RadioButtonView.as | 281 ---
.../flex/html/beads/RightArrowButtonView.as | 112 --
.../org/apache/flex/html/beads/ScrollBarView.as | 216 ---
.../apache/flex/html/beads/SimpleAlertView.as | 149 --
.../flex/html/beads/SingleLineBorderBead.as | 91 -
.../apache/flex/html/beads/SliderThumbView.as | 156 --
.../apache/flex/html/beads/SliderTrackView.as | 153 --
.../org/apache/flex/html/beads/SliderView.as | 179 --
.../flex/html/beads/SolidBackgroundBead.as | 191 --
.../org/apache/flex/html/beads/SpinnerView.as | 135 --
.../org/apache/flex/html/beads/TextAreaView.as | 263 ---
.../html/beads/TextButtonMeasurementBead.as | 86 -
.../apache/flex/html/beads/TextButtonView.as | 217 ---
.../html/beads/TextFieldLabelMeasurementBead.as | 92 -
.../org/apache/flex/html/beads/TextFieldView.as | 54 -
.../apache/flex/html/beads/TextFieldViewBase.as | 404 -----
.../org/apache/flex/html/beads/TextInputView.as | 135 --
.../flex/html/beads/TextInputWithBorderView.as | 100 -
.../TextItemRendererFactoryForArrayData.as | 144 --
...extItemRendererFactoryForStringVectorData.as | 128 --
.../flex/html/beads/TitleBarMeasurementBead.as | 108 --
.../apache/flex/html/beads/TitleBarView.mxml | 58 -
.../apache/flex/html/beads/UpArrowButtonView.as | 112 --
.../src/org/apache/flex/html/beads/VRuleView.as | 87 -
.../flex/html/beads/VScrollBarThumbView.as | 119 --
.../flex/html/beads/VScrollBarTrackView.as | 118 --
.../apache/flex/html/beads/VScrollBarView.as | 99 -
.../html/beads/controllers/AlertController.as | 88 -
.../controllers/ButtonAutoRepeatController.as | 147 --
.../beads/controllers/ComboBoxController.as | 104 --
.../controllers/DateChooserMouseController.as | 126 --
.../controllers/DateFieldMouseController.as | 95 -
.../beads/controllers/DropDownListController.as | 117 --
.../EditableTextKeyboardController.as | 86 -
.../controllers/HScrollBarMouseController.as | 101 --
.../controllers/ItemRendererMouseController.as | 209 ---
.../ListSingleSelectionMouseController.as | 154 --
.../controllers/ScrollBarMouseControllerBase.as | 184 --
.../beads/controllers/SliderMouseController.as | 286 ---
.../beads/controllers/SpinnerMouseController.as | 125 --
.../controllers/VScrollBarMouseController.as | 101 --
.../flex/html/beads/layouts/BasicLayout.as | 445 -----
.../flex/html/beads/layouts/ButtonBarLayout.as | 143 --
.../flex/html/beads/layouts/DataGridLayout.as | 156 --
.../FlexibleFirstChildHorizontalLayout.as | 244 ---
.../flex/html/beads/layouts/HScrollBarLayout.as | 121 --
.../flex/html/beads/layouts/HorizontalLayout.as | 325 ----
.../html/beads/layouts/LayoutChangeNotifier.as | 103 --
.../layouts/OneFlexibleChildHorizontalLayout.as | 332 ----
.../layouts/OneFlexibleChildVerticalLayout.as | 459 -----
.../flex/html/beads/layouts/TileLayout.as | 246 ---
.../flex/html/beads/layouts/VScrollBarLayout.as | 122 --
.../html/beads/layouts/VerticalColumnLayout.as | 199 --
.../flex/html/beads/layouts/VerticalLayout.as | 362 ----
.../apache/flex/html/beads/models/AlertModel.as | 288 ---
.../beads/models/ArrayListSelectionModel.as | 244 ---
.../html/beads/models/ArraySelectionModel.as | 243 ---
.../flex/html/beads/models/ComboBoxModel.as | 100 -
.../flex/html/beads/models/DataGridModel.as | 71 -
.../beads/models/DataGridPresentationModel.as | 88 -
.../flex/html/beads/models/DateChooserModel.as | 189 --
.../flex/html/beads/models/ImageAndTextModel.as | 77 -
.../apache/flex/html/beads/models/ImageModel.as | 89 -
.../html/beads/models/ListPresentationModel.as | 107 --
.../apache/flex/html/beads/models/PanelModel.as | 158 --
.../apache/flex/html/beads/models/RangeModel.as | 222 ---
.../flex/html/beads/models/ScrollBarModel.as | 98 -
.../html/beads/models/SingleLineBorderModel.as | 85 -
.../html/beads/models/StringSelectionModel.as | 221 ---
.../apache/flex/html/beads/models/TextModel.as | 125 --
.../flex/html/beads/models/TitleBarModel.as | 136 --
.../flex/html/beads/models/ToggleButtonModel.as | 145 --
.../html/beads/models/ValueToggleButtonModel.as | 123 --
.../flex/html/beads/models/ViewportModel.as | 72 -
.../apache/flex/html/supportClasses/Border.as | 49 -
.../ButtonBarButtonItemRenderer.as | 145 --
.../html/supportClasses/ContainerContentArea.as | 80 -
.../flex/html/supportClasses/DataGridColumn.as | 127 --
.../flex/html/supportClasses/DataGroup.as | 121 --
.../html/supportClasses/DataItemRenderer.as | 178 --
.../html/supportClasses/DateChooserButton.as | 67 -
.../html/supportClasses/DropDownListList.as | 63 -
.../html/supportClasses/GraphicsItemRenderer.as | 295 ---
.../flex/html/supportClasses/HScrollBar.as | 49 -
.../flex/html/supportClasses/ScrollBar.as | 50 -
.../html/supportClasses/ScrollingViewport.as | 351 ----
.../html/supportClasses/StringItemRenderer.as | 183 --
.../supportClasses/TextFieldItemRenderer.as | 541 ------
.../html/supportClasses/UIItemRendererBase.as | 282 ---
.../flex/html/supportClasses/VScrollBar.as | 49 -
.../apache/flex/html/supportClasses/Viewport.as | 151 --
.../as/src/org/apache/flex/svg/TextButton.as | 30 -
.../as/tests/FlexUnitFlexJSApplication.mxml | 46 -
frameworks/projects/HTML/as/tests/build.xml | 159 --
.../tests/flexUnitTests/DataGridColumnTester.as | 27 -
.../flexUnitTests/DataGridColumnTesterTest.as | 55 -
frameworks/projects/HTML/basic-as-manifest.xml | 37 -
frameworks/projects/HTML/basic-manifest.xml | 105 --
frameworks/projects/HTML/build.xml | 77 +-
.../projects/HTML/compile-asjs-config.xml | 90 -
frameworks/projects/HTML/compile-config.xml | 94 -
.../projects/HTML/src/main/flex/HTMLClasses.as | 176 ++
.../apache/flex/core/IScrollingLayoutParent.as | 68 +
.../org/apache/flex/events/ItemAddedEvent.as | 88 +
.../org/apache/flex/events/ItemClickedEvent.as | 115 ++
.../org/apache/flex/events/ItemRemovedEvent.as | 88 +
.../src/main/flex/org/apache/flex/html/Alert.as | 287 +++
.../main/flex/org/apache/flex/html/Button.as | 112 ++
.../main/flex/org/apache/flex/html/ButtonBar.as | 76 +
.../main/flex/org/apache/flex/html/CheckBox.as | 181 ++
.../flex/org/apache/flex/html/CloseButton.as | 66 +
.../main/flex/org/apache/flex/html/ComboBox.as | 277 +++
.../main/flex/org/apache/flex/html/Container.as | 108 ++
.../flex/org/apache/flex/html/ControlBar.as | 99 +
.../main/flex/org/apache/flex/html/DataGrid.as | 164 ++
.../flex/org/apache/flex/html/DateChooser.as | 74 +
.../main/flex/org/apache/flex/html/DateField.as | 95 +
.../flex/org/apache/flex/html/DropDownList.as | 235 +++
.../flex/org/apache/flex/html/HContainer.as | 61 +
.../src/main/flex/org/apache/flex/html/HRule.as | 63 +
.../src/main/flex/org/apache/flex/html/Image.as | 99 +
.../org/apache/flex/html/ImageAndTextButton.as | 128 ++
.../flex/org/apache/flex/html/ImageButton.as | 89 +
.../src/main/flex/org/apache/flex/html/Label.as | 163 ++
.../src/main/flex/org/apache/flex/html/List.as | 311 ++++
.../org/apache/flex/html/MXMLBeadViewBase.as | 317 ++++
.../flex/org/apache/flex/html/MultilineLabel.as | 76 +
.../flex/org/apache/flex/html/NumericStepper.as | 214 +++
.../src/main/flex/org/apache/flex/html/Panel.as | 121 ++
.../org/apache/flex/html/PanelWithControlBar.as | 121 ++
.../flex/org/apache/flex/html/RadioButton.as | 348 ++++
.../flex/org/apache/flex/html/SimpleAlert.as | 140 ++
.../flex/org/apache/flex/html/SimpleList.as | 79 +
.../main/flex/org/apache/flex/html/Slider.as | 233 +++
.../main/flex/org/apache/flex/html/Spacer.as | 64 +
.../main/flex/org/apache/flex/html/Spinner.as | 187 ++
.../main/flex/org/apache/flex/html/TextArea.as | 126 ++
.../flex/org/apache/flex/html/TextButton.as | 120 ++
.../main/flex/org/apache/flex/html/TextInput.as | 185 ++
.../main/flex/org/apache/flex/html/TitleBar.as | 146 ++
.../org/apache/flex/html/ToggleTextButton.as | 170 ++
.../main/flex/org/apache/flex/html/ToolTip.as | 60 +
.../flex/org/apache/flex/html/VContainer.as | 62 +
.../src/main/flex/org/apache/flex/html/VRule.as | 68 +
.../accessories/NumericOnlyTextInputBead.as | 199 ++
.../flex/html/accessories/PasswordInputBead.as | 102 ++
.../flex/html/accessories/TextPromptBead.as | 148 ++
.../apache/flex/html/accessories/ToolTipBead.as | 141 ++
.../flex/html/beads/AlertMeasurementBead.as | 88 +
.../org/apache/flex/html/beads/AlertView.as | 226 +++
.../flex/html/beads/BackgroundImageBead.as | 112 ++
.../org/apache/flex/html/beads/ButtonBarView.as | 69 +
.../org/apache/flex/html/beads/CSSButtonView.as | 167 ++
.../html/beads/CSSImageAndTextButtonView.as | 367 ++++
.../apache/flex/html/beads/CSSTextButtonView.as | 347 ++++
.../flex/html/beads/CSSTextToggleButtonView.as | 105 ++
.../org/apache/flex/html/beads/CheckBoxView.as | 296 +++
.../apache/flex/html/beads/CloseButtonView.as | 101 ++
.../org/apache/flex/html/beads/ComboBoxView.as | 247 +++
.../org/apache/flex/html/beads/ContainerView.as | 553 ++++++
.../html/beads/ControlBarMeasurementBead.as | 116 ++
.../flex/html/beads/DataGridColumnView.as | 101 ++
.../apache/flex/html/beads/DataGridLinesBead.as | 199 ++
.../org/apache/flex/html/beads/DataGridView.as | 294 +++
.../DataItemRendererFactoryForArrayData.as | 161 ++
.../DataItemRendererFactoryForArrayList.as | 174 ++
.../DataItemRendererFactoryForColumnData.as | 142 ++
.../html/beads/DataProviderChangeNotifier.as | 154 ++
.../apache/flex/html/beads/DateChooserView.as | 256 +++
.../org/apache/flex/html/beads/DateFieldView.as | 192 ++
.../flex/html/beads/DownArrowButtonView.as | 111 ++
.../apache/flex/html/beads/DropDownListView.as | 300 +++
.../org/apache/flex/html/beads/HRuleView.as | 87 +
.../flex/html/beads/HScrollBarThumbView.as | 120 ++
.../flex/html/beads/HScrollBarTrackView.as | 118 ++
.../apache/flex/html/beads/HScrollBarView.as | 99 +
.../apache/flex/html/beads/IBackgroundBead.as | 35 +
.../org/apache/flex/html/beads/IBorderBead.as | 35 +
.../org/apache/flex/html/beads/IComboBoxView.as | 78 +
.../org/apache/flex/html/beads/IDataGridView.as | 36 +
.../apache/flex/html/beads/IDropDownListView.as | 57 +
.../apache/flex/html/beads/IGraphicsDrawing.as | 36 +
.../org/apache/flex/html/beads/IListView.as | 48 +
.../apache/flex/html/beads/IScrollBarView.as | 80 +
.../org/apache/flex/html/beads/ISliderView.as | 60 +
.../org/apache/flex/html/beads/ISpinnerView.as | 61 +
.../apache/flex/html/beads/ITextFieldView.as | 44 +
.../apache/flex/html/beads/ITextItemRenderer.as | 45 +
.../flex/html/beads/ImageAndTextButtonView.as | 276 +++
.../apache/flex/html/beads/ImageButtonView.as | 158 ++
.../org/apache/flex/html/beads/ImageView.as | 223 +++
.../flex/html/beads/LeftArrowButtonView.as | 112 ++
.../flex/org/apache/flex/html/beads/ListView.as | 210 +++
.../flex/html/beads/MultilineTextFieldView.as | 56 +
.../flex/html/beads/NumericStepperView.as | 186 ++
.../org/apache/flex/html/beads/PanelView.as | 168 ++
.../flex/html/beads/PanelWithControlBarView.as | 207 +++
.../apache/flex/html/beads/RadioButtonView.as | 281 +++
.../flex/html/beads/RightArrowButtonView.as | 112 ++
.../org/apache/flex/html/beads/ScrollBarView.as | 216 +++
.../apache/flex/html/beads/SimpleAlertView.as | 149 ++
.../flex/html/beads/SingleLineBorderBead.as | 91 +
.../apache/flex/html/beads/SliderThumbView.as | 156 ++
.../apache/flex/html/beads/SliderTrackView.as | 153 ++
.../org/apache/flex/html/beads/SliderView.as | 179 ++
.../flex/html/beads/SolidBackgroundBead.as | 191 ++
.../org/apache/flex/html/beads/SpinnerView.as | 135 ++
.../org/apache/flex/html/beads/TextAreaView.as | 263 +++
.../html/beads/TextButtonMeasurementBead.as | 86 +
.../apache/flex/html/beads/TextButtonView.as | 217 +++
.../html/beads/TextFieldLabelMeasurementBead.as | 92 +
.../org/apache/flex/html/beads/TextFieldView.as | 54 +
.../apache/flex/html/beads/TextFieldViewBase.as | 404 +++++
.../org/apache/flex/html/beads/TextInputView.as | 135 ++
.../flex/html/beads/TextInputWithBorderView.as | 100 +
.../TextItemRendererFactoryForArrayData.as | 144 ++
...extItemRendererFactoryForStringVectorData.as | 128 ++
.../flex/html/beads/TitleBarMeasurementBead.as | 108 ++
.../apache/flex/html/beads/TitleBarView.mxml | 58 +
.../apache/flex/html/beads/UpArrowButtonView.as | 112 ++
.../org/apache/flex/html/beads/VRuleView.as | 87 +
.../flex/html/beads/VScrollBarThumbView.as | 119 ++
.../flex/html/beads/VScrollBarTrackView.as | 118 ++
.../apache/flex/html/beads/VScrollBarView.as | 99 +
.../html/beads/controllers/AlertController.as | 88 +
.../controllers/ButtonAutoRepeatController.as | 147 ++
.../beads/controllers/ComboBoxController.as | 104 ++
.../controllers/DateChooserMouseController.as | 126 ++
.../controllers/DateFieldMouseController.as | 95 +
.../beads/controllers/DropDownListController.as | 117 ++
.../EditableTextKeyboardController.as | 86 +
.../controllers/HScrollBarMouseController.as | 101 ++
.../controllers/ItemRendererMouseController.as | 209 +++
.../ListSingleSelectionMouseController.as | 154 ++
.../controllers/ScrollBarMouseControllerBase.as | 184 ++
.../beads/controllers/SliderMouseController.as | 286 +++
.../beads/controllers/SpinnerMouseController.as | 125 ++
.../controllers/VScrollBarMouseController.as | 101 ++
.../flex/html/beads/layouts/BasicLayout.as | 445 +++++
.../flex/html/beads/layouts/ButtonBarLayout.as | 143 ++
.../flex/html/beads/layouts/DataGridLayout.as | 156 ++
.../FlexibleFirstChildHorizontalLayout.as | 244 +++
.../flex/html/beads/layouts/HScrollBarLayout.as | 121 ++
.../flex/html/beads/layouts/HorizontalLayout.as | 325 ++++
.../html/beads/layouts/LayoutChangeNotifier.as | 103 ++
.../layouts/OneFlexibleChildHorizontalLayout.as | 332 ++++
.../layouts/OneFlexibleChildVerticalLayout.as | 459 +++++
.../flex/html/beads/layouts/TileLayout.as | 246 +++
.../flex/html/beads/layouts/VScrollBarLayout.as | 122 ++
.../html/beads/layouts/VerticalColumnLayout.as | 199 ++
.../flex/html/beads/layouts/VerticalLayout.as | 362 ++++
.../apache/flex/html/beads/models/AlertModel.as | 288 +++
.../beads/models/ArrayListSelectionModel.as | 244 +++
.../html/beads/models/ArraySelectionModel.as | 243 +++
.../flex/html/beads/models/ComboBoxModel.as | 100 +
.../flex/html/beads/models/DataGridModel.as | 71 +
.../beads/models/DataGridPresentationModel.as | 88 +
.../flex/html/beads/models/DateChooserModel.as | 189 ++
.../flex/html/beads/models/ImageAndTextModel.as | 77 +
.../apache/flex/html/beads/models/ImageModel.as | 89 +
.../html/beads/models/ListPresentationModel.as | 107 ++
.../apache/flex/html/beads/models/PanelModel.as | 158 ++
.../apache/flex/html/beads/models/RangeModel.as | 222 +++
.../flex/html/beads/models/ScrollBarModel.as | 98 +
.../html/beads/models/SingleLineBorderModel.as | 85 +
.../html/beads/models/StringSelectionModel.as | 221 +++
.../apache/flex/html/beads/models/TextModel.as | 125 ++
.../flex/html/beads/models/TitleBarModel.as | 136 ++
.../flex/html/beads/models/ToggleButtonModel.as | 145 ++
.../html/beads/models/ValueToggleButtonModel.as | 123 ++
.../flex/html/beads/models/ViewportModel.as | 72 +
.../apache/flex/html/supportClasses/Border.as | 49 +
.../ButtonBarButtonItemRenderer.as | 145 ++
.../html/supportClasses/ContainerContentArea.as | 80 +
.../flex/html/supportClasses/DataGridColumn.as | 127 ++
.../flex/html/supportClasses/DataGroup.as | 121 ++
.../html/supportClasses/DataItemRenderer.as | 178 ++
.../html/supportClasses/DateChooserButton.as | 67 +
.../html/supportClasses/DropDownListList.as | 63 +
.../html/supportClasses/GraphicsItemRenderer.as | 295 +++
.../flex/html/supportClasses/HScrollBar.as | 49 +
.../flex/html/supportClasses/ScrollBar.as | 50 +
.../html/supportClasses/ScrollingViewport.as | 351 ++++
.../html/supportClasses/StringItemRenderer.as | 183 ++
.../supportClasses/TextFieldItemRenderer.as | 541 ++++++
.../html/supportClasses/UIItemRendererBase.as | 282 +++
.../flex/html/supportClasses/VScrollBar.as | 49 +
.../apache/flex/html/supportClasses/Viewport.as | 151 ++
.../main/flex/org/apache/flex/svg/TextButton.as | 30 +
.../src/main/resources/basic-as-manifest.xml | 37 +
.../HTML/src/main/resources/basic-manifest.xml | 105 ++
.../src/main/resources/compile-asjs-config.xml | 90 +
.../HTML/src/main/resources/compile-config.xml | 94 +
.../HTML/src/main/resources/defaults.css | 623 +++++++
.../HTML/src/main/resources/svg-manifest.xml | 24 +
.../test/flex/FlexUnitFlexJSApplication.mxml | 46 +
.../projects/HTML/src/test/flex/build.xml | 165 ++
.../flex/flexUnitTests/DataGridColumnTester.as | 27 +
.../flexUnitTests/DataGridColumnTesterTest.as | 55 +
frameworks/projects/HTML/svg-manifest.xml | 24 -
.../projects/HTML5/.actionScriptProperties | 57 +
.../.externalToolBuilders/HTML5ASJS.launch | 44 +
frameworks/projects/HTML5/.flexLibProperties | 24 +
frameworks/projects/HTML5/.project | 47 +
.../.settings/org.eclipse.core.resources.prefs | 3 +
frameworks/projects/HTML5/as/defaults.css | 68 -
.../projects/HTML5/as/src/HTML5Classes.as | 33 -
.../as/src/org/apache/flex/html5/Button.as | 26 -
.../as/src/org/apache/flex/html5/CheckBox.as | 26 -
.../as/src/org/apache/flex/html5/ComboBox.as | 26 -
.../src/org/apache/flex/html5/DropDownList.as | 26 -
.../HTML5/as/src/org/apache/flex/html5/Label.as | 33 -
.../HTML5/as/src/org/apache/flex/html5/List.as | 33 -
.../as/src/org/apache/flex/html5/RadioButton.as | 26 -
.../as/src/org/apache/flex/html5/TextArea.as | 26 -
.../as/src/org/apache/flex/html5/TextButton.as | 30 -
.../as/src/org/apache/flex/html5/TextInput.as | 25 -
frameworks/projects/HTML5/build.xml | 75 +-
.../projects/HTML5/compile-asjs-config.xml | 70 -
frameworks/projects/HTML5/compile-config.xml | 83 -
frameworks/projects/HTML5/html5-manifest.xml | 35 -
.../HTML5/src/main/flex/HTML5Classes.as | 33 +
.../main/flex/org/apache/flex/html5/Button.as | 26 +
.../main/flex/org/apache/flex/html5/CheckBox.as | 26 +
.../main/flex/org/apache/flex/html5/ComboBox.as | 26 +
.../flex/org/apache/flex/html5/DropDownList.as | 26 +
.../main/flex/org/apache/flex/html5/Label.as | 33 +
.../src/main/flex/org/apache/flex/html5/List.as | 33 +
.../flex/org/apache/flex/html5/RadioButton.as | 26 +
.../main/flex/org/apache/flex/html5/TextArea.as | 26 +
.../flex/org/apache/flex/html5/TextButton.as | 30 +
.../flex/org/apache/flex/html5/TextInput.as | 25 +
.../src/main/resources/compile-asjs-config.xml | 70 +
.../HTML5/src/main/resources/compile-config.xml | 83 +
.../HTML5/src/main/resources/defaults.css | 68 +
.../HTML5/src/main/resources/html5-manifest.xml | 35 +
.../projects/JQuery/.actionScriptProperties | 40 +-
.../.externalToolBuilders/JQueryASJS.launch | 44 +
frameworks/projects/JQuery/.flexLibProperties | 18 +
frameworks/projects/JQuery/.project | 36 +-
frameworks/projects/JQuery/as/defaults.css | 51 -
.../projects/JQuery/as/src/JQueryClasses.as | 33 -
.../src/org/apache/flex/jquery/Application.as | 43 -
.../as/src/org/apache/flex/jquery/CheckBox.as | 27 -
.../src/org/apache/flex/jquery/RadioButton.as | 43 -
.../as/src/org/apache/flex/jquery/TextButton.as | 56 -
.../org/apache/flex/jquery/ToggleTextButton.as | 42 -
frameworks/projects/JQuery/build.xml | 82 +-
.../projects/JQuery/compile-asjs-config.xml | 86 -
frameworks/projects/JQuery/compile-config.xml | 83 -
frameworks/projects/JQuery/jquery-manifest.xml | 30 -
.../JQuery/src/main/flex/JQueryClasses.as | 33 +
.../flex/org/apache/flex/jquery/Application.as | 43 +
.../flex/org/apache/flex/jquery/CheckBox.as | 27 +
.../flex/org/apache/flex/jquery/RadioButton.as | 43 +
.../flex/org/apache/flex/jquery/TextButton.as | 56 +
.../org/apache/flex/jquery/ToggleTextButton.as | 42 +
.../src/main/resources/compile-asjs-config.xml | 86 +
.../src/main/resources/compile-config.xml | 83 +
.../JQuery/src/main/resources/defaults.css | 51 +
.../src/main/resources/jquery-manifest.xml | 30 +
.../projects/Mobile/.actionScriptProperties | 40 +-
.../.externalToolBuilders/MobileASJS.launch | 44 +
frameworks/projects/Mobile/.flexLibProperties | 18 +
frameworks/projects/Mobile/.project | 36 +-
frameworks/projects/Mobile/as/defaults.css | 33 -
.../projects/Mobile/as/src/CordovaClasses.as | 36 -
.../projects/Mobile/as/src/MobileClasses.as | 43 -
.../as/src/org/apache/cordova/Application.as | 56 -
.../Mobile/as/src/org/apache/cordova/Weinre.as | 88 -
.../as/src/org/apache/cordova/camera/Camera.as | 179 --
.../as/src/org/apache/flex/mobile/IView.as | 43 -
.../src/org/apache/flex/mobile/IViewManager.as | 42 -
.../src/org/apache/flex/mobile/ManagerBase.as | 184 --
.../apache/flex/mobile/StackedViewManager.as | 161 --
.../org/apache/flex/mobile/TabbedViewManager.as | 85 -
.../as/src/org/apache/flex/mobile/View.as | 103 --
.../org/apache/flex/mobile/ViewManagerBase.as | 236 ---
.../flex/mobile/beads/StackedViewManagerView.as | 127 --
.../flex/mobile/beads/TabbedViewManagerView.as | 139 --
.../apache/flex/mobile/beads/ViewManagerView.as | 165 --
.../apache/flex/mobile/chrome/NavigationBar.as | 103 --
.../src/org/apache/flex/mobile/chrome/TabBar.as | 50 -
.../org/apache/flex/mobile/chrome/ToolBar.as | 80 -
.../flex/mobile/models/ViewManagerModel.as | 263 ---
frameworks/projects/Mobile/basic-manifest.xml | 29 -
frameworks/projects/Mobile/build.xml | 75 +-
.../projects/Mobile/compile-asjs-config.xml | 89 -
frameworks/projects/Mobile/compile-config.xml | 89 -
frameworks/projects/Mobile/cordova-manifest.xml | 28 -
.../Mobile/src/main/flex/CordovaClasses.as | 36 +
.../Mobile/src/main/flex/MobileClasses.as | 43 +
.../main/flex/org/apache/cordova/Application.as | 56 +
.../src/main/flex/org/apache/cordova/Weinre.as | 88 +
.../flex/org/apache/cordova/camera/Camera.as | 179 ++
.../main/flex/org/apache/flex/mobile/IView.as | 43 +
.../flex/org/apache/flex/mobile/IViewManager.as | 42 +
.../flex/org/apache/flex/mobile/ManagerBase.as | 184 ++
.../apache/flex/mobile/StackedViewManager.as | 161 ++
.../org/apache/flex/mobile/TabbedViewManager.as | 85 +
.../main/flex/org/apache/flex/mobile/View.as | 103 ++
.../org/apache/flex/mobile/ViewManagerBase.as | 236 +++
.../flex/mobile/beads/StackedViewManagerView.as | 127 ++
.../flex/mobile/beads/TabbedViewManagerView.as | 139 ++
.../apache/flex/mobile/beads/ViewManagerView.as | 165 ++
.../apache/flex/mobile/chrome/NavigationBar.as | 103 ++
.../org/apache/flex/mobile/chrome/TabBar.as | 50 +
.../org/apache/flex/mobile/chrome/ToolBar.as | 80 +
.../flex/mobile/models/ViewManagerModel.as | 263 +++
.../src/main/resources/basic-manifest.xml | 29 +
.../src/main/resources/compile-asjs-config.xml | 89 +
.../src/main/resources/compile-config.xml | 89 +
.../src/main/resources/cordova-manifest.xml | 28 +
.../Mobile/src/main/resources/defaults.css | 33 +
.../projects/Network/.actionScriptProperties | 38 +-
.../.externalToolBuilders/NetworkASJS.launch | 44 +
frameworks/projects/Network/.flexLibProperties | 18 +
frameworks/projects/Network/.project | 35 +-
.../projects/Network/as/src/NetworkClasses.as | 33 -
.../src/org/apache/flex/net/BinaryUploader.as | 738 --------
.../as/src/org/apache/flex/net/HTTPHeader.as | 79 -
.../as/src/org/apache/flex/net/HTTPService.as | 805 --------
.../src/org/apache/flex/net/HTTPServiceBase.as | 47 -
frameworks/projects/Network/basic-manifest.xml | 27 -
frameworks/projects/Network/build.xml | 80 +-
.../projects/Network/compile-asjs-config.xml | 82 -
frameworks/projects/Network/compile-config.xml | 78 -
.../Network/src/main/flex/NetworkClasses.as | 33 +
.../flex/org/apache/flex/net/BinaryUploader.as | 738 ++++++++
.../main/flex/org/apache/flex/net/HTTPHeader.as | 79 +
.../flex/org/apache/flex/net/HTTPService.as | 805 ++++++++
.../flex/org/apache/flex/net/HTTPServiceBase.as | 47 +
.../src/main/resources/basic-manifest.xml | 27 +
.../src/main/resources/compile-asjs-config.xml | 82 +
.../src/main/resources/compile-config.xml | 78 +
.../projects/Reflection/.actionScriptProperties | 56 +
.../.externalToolBuilders/ReflectionASJS.launch | 44 +
.../projects/Reflection/.flexLibProperties | 24 +
frameworks/projects/Reflection/.project | 46 +
.../.settings/org.eclipse.core.resources.prefs | 3 +
.../apache/flex/reflection/DefinitionBase.as | 51 -
.../flex/reflection/DefinitionWithMetaData.as | 79 -
.../flex/reflection/FunctionDefinition.as | 37 -
.../flex/reflection/MetaDataArgDefinition.as | 45 -
.../flex/reflection/MetaDataDefinition.as | 71 -
.../apache/flex/reflection/MethodDefinition.as | 50 -
.../apache/flex/reflection/TypeDefinition.as | 260 ---
.../flex/reflection/VariableDefinition.as | 38 -
.../org/apache/flex/reflection/describeType.as | 47 -
.../flex/reflection/getDefinitionByName.as | 51 -
.../flex/reflection/getQualifiedClassName.as | 51 -
.../reflection/getQualifiedSuperclassName.as | 49 -
frameworks/projects/Reflection/build.xml | 82 +-
.../projects/Reflection/compile-asjs-config.xml | 77 -
.../projects/Reflection/compile-config.xml | 73 -
.../apache/flex/reflection/DefinitionBase.as | 51 +
.../flex/reflection/DefinitionWithMetaData.as | 79 +
.../flex/reflection/FunctionDefinition.as | 37 +
.../flex/reflection/MetaDataArgDefinition.as | 45 +
.../flex/reflection/MetaDataDefinition.as | 71 +
.../apache/flex/reflection/MethodDefinition.as | 50 +
.../apache/flex/reflection/TypeDefinition.as | 260 +++
.../flex/reflection/VariableDefinition.as | 38 +
.../org/apache/flex/reflection/describeType.as | 47 +
.../flex/reflection/getDefinitionByName.as | 51 +
.../flex/reflection/getQualifiedClassName.as | 51 +
.../reflection/getQualifiedSuperclassName.as | 49 +
.../src/main/resources/compile-asjs-config.xml | 77 +
.../src/main/resources/compile-config.xml | 73 +
1505 files changed, 95372 insertions(+), 93057 deletions(-)
----------------------------------------------------------------------
[13/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as b/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
new file mode 100644
index 0000000..b7b9a9e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
@@ -0,0 +1,1065 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.styles
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.DisplayObjectContainer;
+}
+import flex.system.DefinitionManager;
+import org.apache.flex.reflection.getQualifiedClassName;
+import org.apache.flex.reflection.getQualifiedSuperclassName;
+
+import mx.core.FlexGlobals;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModule;
+import mx.core.IFlexModuleFactory;
+import mx.core.IFontContextComponent;
+import mx.core.IInvalidating;
+import mx.core.IUITextField;
+import mx.core.IVisualElement;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.effects.EffectManager;
+import mx.managers.SystemManager;
+import mx.modules.IModule;
+import mx.modules.ModuleManager;
+import mx.utils.NameUtil;
+import mx.utils.OrderedObject;
+import mx.utils.object_proxy;
+
+use namespace mx_internal;
+use namespace object_proxy;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * This is an all-static class with methods for building the protochains
+ * that Flex uses to look up CSS style properties.
+ */
+public class StyleProtoChain
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The inheritingStyles and nonInheritingStyles properties
+ * are initialized to this empty Object.
+ * This allows the getStyle() and getStyle()
+ * methods to simply access inheritingStyles[] and nonInheritingStyles[]
+ * without needing to first check whether those objects exist.
+ * If they were simply initialized to {}, we couldn't determine
+ * whether the style chain has already been built or not.
+ */
+ public static var STYLE_UNINITIALIZED:Object = {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Implements the getClassStyleDeclarations() logic
+ * for UIComponent and TextBase.
+ * The 'object' parameter will be one or the other.
+ */
+ public static function getClassStyleDeclarations(object:IStyleClient):Array
+ {
+ var styleManager:IStyleManager2 = getStyleManager(object);
+ var qualified:Boolean = styleManager.qualifiedTypeSelectors;
+ var className:String = qualified ? getQualifiedClassName(object) : object.className;
+ var advancedObject:IAdvancedStyleClient = object as IAdvancedStyleClient;
+
+ var typeHierarchy:OrderedObject = getTypeHierarchy(object, styleManager, qualified);
+ var types:Array = typeHierarchy.propertyList;
+ var typeCount:int = types.length;
+ var classDecls:Array = null;
+
+ if (!styleManager.hasAdvancedSelectors())
+ {
+ classDecls = styleManager.typeSelectorCache[className];
+ if (classDecls)
+ return classDecls;
+ }
+
+ classDecls = [];
+
+ // Loop over the type hierarhcy starting at the base type and work
+ // down the chain of subclasses.
+ for (var i:int = typeCount - 1; i >= 0; i--)
+ {
+ var type:String = types[i].toString();
+ if (styleManager.hasAdvancedSelectors() && advancedObject != null)
+ {
+ var decls:Object = styleManager.getStyleDeclarations(type);
+ if (decls)
+ {
+ var matchingDecls:Array = matchStyleDeclarations(decls, advancedObject);
+ classDecls = classDecls.concat(matchingDecls);
+ }
+ }
+ else
+ {
+ var decl:CSSStyleDeclaration = styleManager.getMergedStyleDeclaration(type);
+ if (decl)
+ classDecls.push(decl);
+ }
+ }
+
+ if (styleManager.hasAdvancedSelectors() && advancedObject != null)
+ {
+ // Advanced selectors may result in more than one match per type so
+ // we sort based on specificity, but we preserve the declaration
+ // order for equal selectors.
+ classDecls = sortOnSpecificity(classDecls);
+ }
+ else
+ {
+ // Cache the simple type declarations for this class
+ styleManager.typeSelectorCache[className] = classDecls;
+ }
+
+ return classDecls;
+ }
+
+ /**
+ * @private
+ * Implements the initProtoChain() logic for UIComponent and TextBase.
+ * The 'object' parameter will be one or the other.
+ */
+ public static function initProtoChain(object:IStyleClient, inheritPopUpStylesFromOwner:Boolean=true):void
+ {
+ var styleManager:IStyleManager2 = getStyleManager(object);
+ var n:int;
+ var i:int;
+
+ var uicObject:UIComponent = object as UIComponent;
+ var advancedObject:IAdvancedStyleClient = object as IAdvancedStyleClient;
+ var styleDeclaration:CSSStyleDeclaration = null;
+
+ var universalSelectors:Array = [];
+ var hasStyleName:Boolean = false;
+ var styleName:Object = object.styleName;
+ if (styleName)
+ {
+ if (styleName is CSSStyleDeclaration)
+ {
+ // Get the styles referenced by the styleName property.
+ universalSelectors.push(CSSStyleDeclaration(styleName));
+ }
+ else if (styleName is IFlexDisplayObject || styleName is IStyleClient)
+ {
+ // If the styleName property is a UIComponent, then there's a
+ // special search path for that case.
+ StyleProtoChain.initProtoChainForUIComponentStyleName(object);
+ return;
+ }
+ else if (styleName is String)
+ {
+ hasStyleName = true;
+ }
+ }
+
+ // To build the proto chain, we start at the end and work forward.
+ // Referring to the list at the top of this function, we'll start
+ // by getting the tail of the proto chain, which is:
+ // - for non-inheriting styles, the global style sheet
+ // - for inheriting styles, my parent's style object
+ var nonInheritChain:Object = styleManager.stylesRoot;
+
+ if (nonInheritChain && nonInheritChain.effects)
+ object.registerEffects(nonInheritChain.effects);
+
+ var p:IStyleClient = null;
+ if (object is IVisualElement)
+ p = IVisualElement(object).parent as IStyleClient;
+ else if (object is IAdvancedStyleClient)
+ p = IAdvancedStyleClient(object).styleParent as IStyleClient;
+
+ if (p)
+ {
+ var inheritChain:Object = p.inheritingStyles;
+ if (inheritChain == StyleProtoChain.STYLE_UNINITIALIZED)
+ inheritChain = nonInheritChain;
+
+ // If this object is a module then add its global styles to the
+ // inheritChain. If we don't have global styles in this style manager
+ // then the user didn't declare a global style in the module and the
+ // compiler didn't add a duplicate default style. In that case don't
+ // add global styles to the chain because the parent style manager's
+ // global styles are already on the chain.
+ if (object is IModule)
+ {
+ styleDeclaration = styleManager.getStyleDeclaration("global");
+ if (styleDeclaration)
+ inheritChain = styleDeclaration.addStyleToProtoChain(inheritChain, DisplayObject(object));
+ }
+ }
+ else
+ {
+ // Pop ups inheriting chain starts at Application instead of global.
+ // This allows popups to grab styles like themeColor that are
+ // set on Application.
+ if (uicObject && uicObject.isPopUp)
+ {
+ var owner:DisplayObjectContainer = uicObject._owner;
+ if (inheritPopUpStylesFromOwner && owner && (owner is IStyleClient))
+ {
+ inheritChain = IStyleClient(owner).inheritingStyles;
+ }
+ else
+ {
+ inheritChain = FlexGlobals.topLevelApplication.inheritingStyles;
+ }
+ }
+ else
+ {
+ inheritChain = styleManager.stylesRoot;
+ }
+ }
+
+ var styleDeclarations:Array = null;
+
+ // If we have an advanced style client, we handle this separately
+ // because of the considerably more complex selector matches...
+ if (styleManager.hasAdvancedSelectors() && advancedObject != null)
+ {
+ styleDeclarations = getMatchingStyleDeclarations(advancedObject, universalSelectors);
+
+ n = styleDeclarations != null ? styleDeclarations.length : 0;
+ for (i = 0; i < n; i++)
+ {
+ styleDeclaration = styleDeclarations[i];
+ inheritChain = styleDeclaration.addStyleToProtoChain(inheritChain, uicObject);
+ nonInheritChain = styleDeclaration.addStyleToProtoChain(nonInheritChain, uicObject);
+
+ if (styleDeclaration.effects)
+ advancedObject.registerEffects(styleDeclaration.effects);
+ }
+ }
+ // Otherwise we use the legacy Flex 3 logic for simple selectors.
+ else
+ {
+ // Get the styles referenced by the styleName property
+ if (hasStyleName)
+ {
+ var styleNames:Array = styleName.split(/\s+/);
+ n = styleNames.length;
+ for (i = 0; i < n; i++)
+ {
+ if (styleNames[i].length)
+ {
+ styleDeclaration = styleManager.getMergedStyleDeclaration("." + styleNames[i]);
+ if (styleDeclaration)
+ universalSelectors.push(styleDeclaration);
+ }
+ }
+ }
+
+ // Working backwards up the list, the next element in the
+ // search path is the type selector
+ styleDeclarations = object.getClassStyleDeclarations();
+ n = styleDeclarations != null ? styleDeclarations.length : 0;
+ for (i = 0; i < n; i++)
+ {
+ styleDeclaration = styleDeclarations[i];
+ inheritChain = styleDeclaration.addStyleToProtoChain(inheritChain, uicObject);
+ nonInheritChain = styleDeclaration.addStyleToProtoChain(nonInheritChain, uicObject);
+
+ if (styleDeclaration.effects)
+ object.registerEffects(styleDeclaration.effects);
+ }
+
+ // Next are the class selectors
+ n = universalSelectors.length;
+ for (i = 0; i < n; i++)
+ {
+ styleDeclaration = universalSelectors[i];
+ if (styleDeclaration)
+ {
+ inheritChain =
+ styleDeclaration.addStyleToProtoChain(inheritChain, uicObject);
+
+ nonInheritChain =
+ styleDeclaration.addStyleToProtoChain(nonInheritChain, uicObject);
+
+ if (styleDeclaration.effects)
+ object.registerEffects(styleDeclaration.effects);
+ }
+ }
+ }
+
+ // Finally, we'll add the in-line styles
+ // to the head of the proto chain.
+
+ styleDeclaration = object.styleDeclaration;
+
+ object.inheritingStyles =
+ styleDeclaration ?
+ styleDeclaration.addStyleToProtoChain(inheritChain, uicObject) :
+ inheritChain;
+
+ object.nonInheritingStyles =
+ styleDeclaration ?
+ styleDeclaration.addStyleToProtoChain(nonInheritChain, uicObject) :
+ nonInheritChain;
+ }
+
+ /**
+ * @private
+ * If the styleName property points to a UIComponent, then we search
+ * for stylable properties in the following order:
+ *
+ * 1) Look for inline styles on this object
+ * 2) Look for inline styles on the styleName object
+ * 3) Look for class selectors on the styleName object
+ * 4) Look for type selectors on the styleName object
+ * 5) Look for type selectors on this object
+ * 6) Follow the usual search path for the styleName object
+ *
+ * If this object doesn't have any type selectors, then the
+ * search path can be simplified to two steps:
+ *
+ * 1) Look for inline styles on this object
+ * 2) Follow the usual search path for the styleName object
+ */
+ public static function initProtoChainForUIComponentStyleName(
+ obj:IStyleClient):void
+ {
+ var styleManager:IStyleManager2 = getStyleManager(obj);
+ var styleName:IStyleClient = IStyleClient(obj.styleName);
+ var target:DisplayObject = obj as DisplayObject;
+
+ // Push items onto the proto chain in reverse order, beginning with
+ // 6) Follow the usual search path for the styleName object
+ var nonInheritChain:Object = styleName.nonInheritingStyles;
+ if (!nonInheritChain ||
+ nonInheritChain == StyleProtoChain.STYLE_UNINITIALIZED)
+ {
+ nonInheritChain = styleManager.stylesRoot;
+
+ if (nonInheritChain.effects)
+ obj.registerEffects(nonInheritChain.effects);
+ }
+
+ var inheritChain:Object = styleName.inheritingStyles;
+ if (!inheritChain ||
+ inheritChain == StyleProtoChain.STYLE_UNINITIALIZED)
+ {
+ inheritChain = styleManager.stylesRoot;
+ }
+
+ // If there's no type selector on this object, then we can collapse
+ // 6 steps to 2 (see above)
+ var typeSelectors:Array = obj.getClassStyleDeclarations();
+ var n:int = typeSelectors.length;
+
+ // If we are a StyleProxy and we aren't building the protochain from
+ // our type selectors, then we need to build the protochain from
+ // the styleName since styleName.nonInheritingStyles is always null.
+ if (styleName is StyleProxy)
+ {
+ if (n == 0)
+ {
+ // 4) Look for type selectors on the styleName object
+ // 3) Look for class selectors on the styleName object
+ // 2) Look for inline styles on the styleName object
+ nonInheritChain = addProperties(nonInheritChain, styleName, false);
+ }
+ target = StyleProxy(styleName).source as DisplayObject;
+ }
+
+ for (var i:int = 0; i < n; i++)
+ {
+ var typeSelector:CSSStyleDeclaration = typeSelectors[i];
+
+ // If there's no *inheriting* type selector on this object, then we
+ // can still collapse 6 steps to 2 for the inheriting properties.
+
+ // 5) Look for type selectors on this object
+ inheritChain = typeSelector.addStyleToProtoChain(inheritChain, target);
+
+ // 4) Look for type selectors on the styleName object
+ // 3) Look for class selectors on the styleName object
+ // 2) Look for inline styles on the styleName object
+ inheritChain = addProperties(inheritChain, styleName, true);
+
+ // 5) Look for type selectors on this object
+ nonInheritChain = typeSelector.addStyleToProtoChain(nonInheritChain, target);
+
+ // 4) Look for type selectors on the styleName object
+ // 3) Look for class selectors on the styleName object
+ // 2) Look for inline styles on the styleName object
+ nonInheritChain = addProperties(nonInheritChain, styleName, false);
+
+ if (typeSelector.effects)
+ obj.registerEffects(typeSelector.effects);
+ }
+
+ // 1) Look for inline styles on this object
+
+ obj.inheritingStyles =
+ obj.styleDeclaration ?
+ obj.styleDeclaration.addStyleToProtoChain(inheritChain, target) :
+ inheritChain;
+
+ obj.nonInheritingStyles =
+ obj.styleDeclaration ?
+ obj.styleDeclaration.addStyleToProtoChain(nonInheritChain, target) :
+ nonInheritChain;
+ }
+
+ /**
+ * See the comment for the initProtoChainForUIComponentStyleName
+ * function. The comment for that function includes a six-step
+ * sequence. This sub-function implements the following pieces
+ * of that sequence:
+ *
+ * 2) Look for inline styles on the styleName object
+ * 3) Look for class selectors on the styleName object
+ * 4) Look for type selectors on the styleName object
+ *
+ * This piece is broken out as a separate function so that it
+ * can be called recursively when the styleName object has a
+ * styleName property is itself another UIComponent.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private static function addProperties(chain:Object, obj:IStyleClient,
+ bInheriting:Boolean):Object
+ {
+ // Only use a filter map if styleName is a StyleProxy and we are building the nonInheritingStyles chain
+ var filterMap:Object = obj is StyleProxy && !bInheriting ? StyleProxy(obj).filterMap : null;
+
+ // StyleProxy's usually have sources that are DisplayObject's, but a StyleProxy can also have
+ // another StyleProxy as it's source (Example: CalendarLayout's source is a StyleProxy for DateChooser,
+ // whose style is a StyleProxy for DateField)
+
+ // The way we use target is a bit hacky, but we always assume that styles (if pointed to DisplayObjects)
+ // are the parent (or atleast an ancestor), and we rely on this down the line (such as in
+ // DataGridColumn.addStyleToProtoChain)
+ var curObj:IStyleClient = obj;
+ while (curObj is StyleProxy)
+ {
+ curObj = StyleProxy(curObj).source;
+ }
+ var target:DisplayObject = curObj as DisplayObject;
+
+ var advancedObject:IAdvancedStyleClient = obj as IAdvancedStyleClient;
+ var styleName:Object = obj.styleName;
+ var styleDeclarations:Array;
+ var decl:CSSStyleDeclaration;
+ var styleManager:IStyleManager2 = getStyleManager(target);
+
+ // If we have an advanced style client, we handle this separately
+ // because of the considerably more complex selector matches...
+ if (advancedObject != null && styleManager.hasAdvancedSelectors())
+ {
+ // Handle special case of styleName as a CSSStyleDeclaration
+ if (styleName is CSSStyleDeclaration)
+ {
+ styleDeclarations = [CSSStyleDeclaration(styleName)];
+ }
+
+ // Find matching style declarations, sorted by specificity
+ styleDeclarations = getMatchingStyleDeclarations(advancedObject, styleDeclarations);
+
+ // Then apply matching selectors to the proto chain
+ for (i = 0; i < styleDeclarations.length; i++)
+ {
+ decl = styleDeclarations[i];
+ if (decl)
+ {
+ chain = decl.addStyleToProtoChain(chain, target, filterMap);
+ if (decl.effects)
+ obj.registerEffects(decl.effects);
+ }
+ }
+
+ // Finally, handle special case of styleName as an IStyleClient
+ // which overrides any of the selectors above
+ if (styleName is IStyleClient)
+ {
+ // If the styleName property is another UIComponent, then
+ // recursively add type selectors, class selectors, and
+ // inline styles for that UIComponent
+ chain = addProperties(chain, IStyleClient(styleName),
+ bInheriting);
+ }
+ }
+ else
+ {
+ // 4) Add type selectors
+ styleDeclarations = obj.getClassStyleDeclarations();
+ var n:int = styleDeclarations.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ decl = styleDeclarations[i];
+ chain = decl.addStyleToProtoChain(chain, target, filterMap);
+
+ if (decl.effects)
+ obj.registerEffects(decl.effects);
+ }
+
+ // 3) Add class selectors
+ if (styleName)
+ {
+ styleDeclarations = [];
+ if (typeof(styleName) == "object")
+ {
+ if (styleName is CSSStyleDeclaration)
+ {
+ // Get the style sheet referenced by the styleName property.
+ styleDeclarations.push(CSSStyleDeclaration(styleName));
+ }
+ else
+ {
+ // If the styleName property is another UIComponent, then
+ // recursively add type selectors, class selectors, and
+ // inline styles for that UIComponent
+ chain = addProperties(chain, IStyleClient(styleName),
+ bInheriting);
+ }
+ }
+ else
+ {
+ // Get the style sheets referenced by the styleName property
+ var styleNames:Array = styleName.split(/\s+/);
+ for (var c:int=0; c < styleNames.length; c++)
+ {
+ if (styleNames[c].length)
+ {
+ styleDeclarations.push(styleManager.getMergedStyleDeclaration("." + styleNames[c]));
+ }
+ }
+ }
+
+ for (i = 0; i < styleDeclarations.length; i++)
+ {
+ decl = styleDeclarations[i];
+ if (decl)
+ {
+ chain = decl.addStyleToProtoChain(chain, target, filterMap);
+ if (decl.effects)
+ obj.registerEffects(decl.effects);
+ }
+ }
+ }
+ }
+
+ // 2) Add inline styles
+ if (obj.styleDeclaration)
+ chain = obj.styleDeclaration.addStyleToProtoChain(chain, target, filterMap);
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ public static function initTextField(obj:IUITextField):void
+ {
+ // TextFields never have any inline styles or type selector, so
+ // this is an optimized version of the initObject function (above)
+ var styleManager:IStyleManager2 = StyleManager.getStyleManager(obj.moduleFactory);
+ var styleName:Object = obj.styleName;
+ var classSelectors:Array = [];
+
+ if (styleName)
+ {
+ if (typeof(styleName) == "object")
+ {
+ if (styleName is CSSStyleDeclaration)
+ {
+ // Get the style sheet referenced by the styleName property.
+ classSelectors.push(CSSStyleDeclaration(styleName));
+ }
+ else if (styleName is StyleProxy)
+ {
+ obj.inheritingStyles =
+ IStyleClient(styleName).inheritingStyles;
+
+ obj.nonInheritingStyles = addProperties(styleManager.stylesRoot, IStyleClient(styleName), false);
+
+ return;
+ }
+ else
+ {
+ // styleName points to a UIComponent, so just set
+ // this TextField's proto chains to be the same
+ // as that UIComponent's proto chains.
+ obj.inheritingStyles =
+ IStyleClient(styleName).inheritingStyles;
+ obj.nonInheritingStyles =
+ IStyleClient(styleName).nonInheritingStyles;
+ return;
+ }
+ }
+ else
+ {
+ // Get the style sheets referenced by the styleName property
+ var styleNames:Array = styleName.split(/\s+/);
+ for (var c:int=0; c < styleNames.length; c++)
+ {
+ if (styleNames[c].length) {
+ classSelectors.push(styleManager.getMergedStyleDeclaration("." +
+ styleNames[c]));
+ }
+ }
+ }
+ }
+
+ // To build the proto chain, we start at the end and work forward.
+ // We'll start by getting the tail of the proto chain, which is:
+ // - for non-inheriting styles, the global style sheet
+ // - for inheriting styles, my parent's style object
+ var inheritChain:Object = IStyleClient(obj.parent).inheritingStyles;
+ var nonInheritChain:Object = styleManager.stylesRoot;
+ if (!inheritChain)
+ inheritChain = styleManager.stylesRoot;
+
+ // Next are the class selectors
+ for (var i:int = 0; i < classSelectors.length; i++)
+ {
+ var classSelector:CSSStyleDeclaration = classSelectors[i];
+ if (classSelector)
+ {
+ inheritChain =
+ classSelector.addStyleToProtoChain(inheritChain, DisplayObject(obj));
+
+ nonInheritChain =
+ classSelector.addStyleToProtoChain(nonInheritChain, DisplayObject(obj));
+ }
+ }
+
+ obj.inheritingStyles = inheritChain;
+ obj.nonInheritingStyles = nonInheritChain;
+ }
+
+ /**
+ * @private
+ * Implements the setStyle() logic for UIComponent and TextBase.
+ * The 'object' parameter will be one or the other.
+ */
+ public static function setStyle(object:IStyleClient, styleProp:String,
+ newValue:*):void
+ {
+ var styleManager:IStyleManager2 = getStyleManager(object);
+
+ if (styleProp == "styleName")
+ {
+ // Let the setter handle this one, see UIComponent.
+ object.styleName = newValue;
+
+ // Short circuit, because styleName isn't really a style.
+ return;
+ }
+
+ COMPILE::LATER
+ {
+ if (EffectManager.getEventForEffectTrigger(styleProp) != "")
+ EffectManager.setStyle(styleProp, object);
+ }
+
+ // If this object didn't previously have any inline styles,
+ // then regenerate its proto chain
+ // (and the proto chains of its descendants).
+ var isInheritingStyle:Boolean =
+ styleManager.isInheritingStyle(styleProp);
+ var isProtoChainInitialized:Boolean =
+ object.inheritingStyles != StyleProtoChain.STYLE_UNINITIALIZED;
+ var valueChanged:Boolean = object.getStyle(styleProp) != newValue;
+
+ if (!object.styleDeclaration)
+ {
+ object.styleDeclaration = new CSSStyleDeclaration(null, styleManager);
+
+ object.styleDeclaration.setLocalStyle(styleProp, newValue);
+
+ // If inheritingStyles is undefined, then this object is being
+ // initialized and we haven't yet generated the proto chain. To
+ // avoid redundant work, don't bother to create the proto chain here.
+ if (isProtoChainInitialized)
+ object.regenerateStyleCache(isInheritingStyle);
+ }
+ else
+ {
+ object.styleDeclaration.setLocalStyle(styleProp, newValue);
+ }
+
+ if (isProtoChainInitialized && valueChanged)
+ {
+ object.styleChanged(styleProp);
+ object.notifyStyleChangeInChildren(styleProp, isInheritingStyle);
+ }
+ }
+
+ /**
+ * @private
+ * Implements the styleChanged() logic for UIComponent and TextBase.
+ * The 'object' parameter will be one or the other.
+ */
+ public static function styleChanged(object:IInvalidating, styleProp:String):void
+ {
+ var styleManager:IStyleManager2 = getStyleManager(object);
+
+ // If font changed, then invalidateProperties so
+ // we can re-create the text field in commitProperties
+ // TODO (gosmith): Should hasFontContextChanged() be added to IFontContextComponent?
+ if (object is IFontContextComponent &&
+ "hasFontContextChanged" in object &&
+ object["hasFontContextChanged"]())
+ {
+ object.invalidateProperties();
+ }
+
+ if (!styleProp ||
+ styleProp == "styleName" ||
+ styleProp == "layoutDirection")
+ {
+ object.invalidateProperties();
+ }
+
+ // Check to see if this is one of the style properties
+ // that is known to affect layout.
+ if (!styleProp ||
+ styleProp == "styleName" ||
+ styleManager.isSizeInvalidatingStyle(styleProp))
+ {
+ // This style property change may affect the layout of this
+ // object. Signal the LayoutManager to re-measure the object.
+ object.invalidateSize();
+ }
+
+ // TODO (gosmith): Should initThemeColor() be in some interface?
+ if (!styleProp ||
+ styleProp == "styleName" ||
+ styleProp == "themeColor")
+ {
+ if (object is UIComponent)
+ object["initThemeColor"]();
+ }
+
+ object.invalidateDisplayList();
+
+ var parent:IInvalidating;
+ if (object is IVisualElement)
+ parent = IVisualElement(object).parent as IInvalidating;
+
+ if (parent)
+ {
+ if (styleProp == "styleName" || styleManager.isParentSizeInvalidatingStyle(styleProp))
+ parent.invalidateSize();
+
+ if (styleProp == "styleName" || styleManager.isParentDisplayListInvalidatingStyle(styleProp))
+ parent.invalidateDisplayList();
+ }
+ }
+
+ /**
+ * @private
+ */
+ public static function matchesCSSType(object:IAdvancedStyleClient, cssType:String):Boolean
+ {
+ var styleManager:IStyleManager2 = getStyleManager(object);
+ var qualified:Boolean = styleManager.qualifiedTypeSelectors;
+ var typeHierarchy:OrderedObject = getTypeHierarchy(object, styleManager, qualified);
+ return typeHierarchy.object_proxy::getObjectProperty(cssType) != null;
+ }
+
+ /**
+ * @private
+ * Find all matching style declarations for an IAdvancedStyleClient
+ * component. The result is sorted in terms of specificity, but the
+ * declaration order is preserved.
+ *
+ * @param object - an IAdvancedStyleClient instance of the component to
+ * match.
+ * @param styleDeclarations - an optional Array of additional
+ * CSSStyleDeclarations to be included in the sorted matches.
+ *
+ * @return An Array of matching style declarations sorted by specificity.
+ */
+ public static function getMatchingStyleDeclarations(object:IAdvancedStyleClient,
+ styleDeclarations:Array=null):Array // of CSSStyleDeclaration
+ {
+ var styleManager:IStyleManager2 = getStyleManager(object);
+
+ if (styleDeclarations == null)
+ styleDeclarations = [];
+
+ // First, look for universal selectors
+ var universalDecls:Object = styleManager.getStyleDeclarations("*");
+ styleDeclarations = matchStyleDeclarations(universalDecls, object).concat(styleDeclarations);
+
+ // Next, look for type selectors (includes ActionScript supertype matches)
+ // If we also had universal selectors, concatenate them with our type
+ // selectors and then resort by specificity...
+ if (styleDeclarations.length > 0)
+ {
+ styleDeclarations = object.getClassStyleDeclarations().concat(styleDeclarations);
+ styleDeclarations = sortOnSpecificity(styleDeclarations);
+ }
+ else
+ {
+ // Otherwise, we only have type selectors (which are already sorted)
+ styleDeclarations = object.getClassStyleDeclarations();
+ }
+ return styleDeclarations;
+ }
+
+ /**
+ * @private
+ * @param object - the IStyleClient to be introspected
+ * @param qualified - whether qualified type names should be used
+ * @return an ordered map of class names, starting with the object's class
+ * name and then each super class name until we hit a stop class, such as
+ * mx.core::UIComponent.
+ */
+ private static function getTypeHierarchy(object:IStyleClient, styleManager:IStyleManager2, qualified:Boolean=true):OrderedObject
+ {
+ var className:String = getQualifiedClassName(object);
+ var hierarchy:OrderedObject = styleManager.typeHierarchyCache[className] as OrderedObject;
+ if (hierarchy == null)
+ {
+ hierarchy = new OrderedObject();
+
+ var myApplicationDomain:DefinitionManager;
+ var factory:IFlexModuleFactory = ModuleManager.getAssociatedFactory(object);
+ if (factory != null)
+ {
+ myApplicationDomain = new DefinitionManager(factory.info()["currentDomain"]);
+ }
+ else
+ {
+ var myRoot:DisplayObject = SystemManager.getSWFRoot(object);
+ if (!myRoot)
+ return hierarchy;
+ myApplicationDomain = new DefinitionManager(myRoot.loaderInfo.applicationDomain);
+ }
+
+ styleManager.typeHierarchyCache[className] = hierarchy;
+ while (!isStopClass(className))
+ {
+ try
+ {
+ var type:String;
+ if (qualified)
+ type = className.replace("::", ".");
+ else
+ type = NameUtil.getUnqualifiedClassName(className);
+
+ hierarchy.object_proxy::setObjectProperty(type, true);
+ className = getQualifiedSuperclassName(
+ myApplicationDomain.getDefinition(className));
+ }
+ catch(e:ReferenceError)
+ {
+ className = null;
+ }
+ }
+ }
+ return hierarchy;
+ }
+
+ /**
+ * @private
+ * Our style type hierarhcy stops at UIComponent, UITextField or
+ * GraphicElement, not Object.
+ */
+ private static function isStopClass(value:String):Boolean
+ {
+ return value == null ||
+ value == "mx.core::UIComponent" ||
+ value == "mx.core::UITextField" ||
+ value == "mx.graphics.baseClasses::GraphicElement";
+ }
+
+ /**
+ * @private
+ * Find all matching style declarations for an IAdvancedStyleClient
+ * component. The result is unsorted in terms of specificity, but the
+ * declaration order is preserved.
+ *
+ * @param declarations - a map of declarations to be searched for matches.
+ * @param object - an instance of the component to match.
+ *
+ * @return An unsorted Array of matching style declarations for the given
+ * subject.
+ */
+ private static function matchStyleDeclarations(declarations:Object,
+ object:IAdvancedStyleClient):Array // of CSSStyleDeclaration
+ {
+ var matchingDecls:Array = [];
+ var pseudos:Array = declarations["pseudo"];
+ var classes:Array = declarations["class"];
+ var ids:Array = declarations["id"];
+ var unconditionals:Array = declarations["unconditional"];
+
+ var decl:CSSStyleDeclaration;
+
+ // Find the subset of declarations that match this component
+ for each (decl in unconditionals)
+ {
+ if (decl.matchesStyleClient(object))
+ matchingDecls.push(decl);
+ }
+
+ if (object.styleName is String)
+ {
+ // Find the subset of declarations that match this component
+ for each (decl in classes)
+ {
+ if (decl.matchesStyleClient(object))
+ matchingDecls.push(decl);
+ }
+ }
+
+ if (object.hasCSSState())
+ {
+ // Find the subset of declarations that match this component
+ for each (decl in pseudos)
+ {
+ if (decl.matchesStyleClient(object))
+ matchingDecls.push(decl);
+ }
+ }
+
+ if (object.id)
+ {
+ // Find the subset of declarations that match this component
+ for each (decl in ids)
+ {
+ if (decl.matchesStyleClient(object))
+ matchingDecls.push(decl);
+ }
+ }
+
+ if (matchingDecls.length > 1)
+ matchingDecls.sortOn("selectorIndex", Array.NUMERIC);
+
+ // if there are declarations from the parent StyleManager, match them in their own
+ // order, then prepend them. Parent styles go on the chain before child styles.
+ if (declarations.parent)
+ matchingDecls = matchStyleDeclarations(declarations.parent, object).concat(matchingDecls);
+
+ return matchingDecls;
+ }
+
+ /**
+ * @private
+ * Sort algorithm to order style declarations by specificity. Note that
+ * Array.sort() is not used as it does not employ a stable algorithm and
+ * CSS requires the order of equal style declaration to be preserved.
+ */
+ private static function sortOnSpecificity(decls:Array):Array // of CSSStyleDeclaration
+ {
+ // TODO (pfarland): Copied algorithm from Group.sortOnLayer as the
+ // number of declarations to be sorted is usually small. We may consider
+ // replacing this insertion sort with an efficient but stable merge sort
+ // or the like if many style declarations need to sorted.
+ var len:Number = decls.length;
+ var tmp:CSSStyleDeclaration;
+
+ if (len <= 1)
+ return decls;
+
+ for (var i:int = 1; i < len; i++)
+ {
+ for (var j:int = i; j > 0; j--)
+ {
+ if (decls[j].specificity < decls[j-1].specificity)
+ {
+ tmp = decls[j];
+ decls[j] = decls[j-1];
+ decls[j-1] = tmp;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+
+ return decls;
+ }
+
+ /**
+ * @private
+ * Get the style manager of any object. If the object does not implement IFlexModule or
+ * is not of type StyleProxy, then the top-level style manager will be returned.
+ *
+ * @param object - Typed as Object because various interfaces are passed here.
+ * @return a style manager, will not be null.
+ */
+ private static function getStyleManager(object:Object):IStyleManager2
+ {
+ if (object is IFlexModule)
+ return StyleManager.getStyleManager(IFlexModule(object).moduleFactory);
+ else if (object is StyleProxy)
+ return getStyleManagerFromStyleProxy(StyleProxy(object));
+ else
+ return StyleManager.getStyleManager(null);
+ }
+
+ /**
+ * @private
+ * Get the style manager for a given StyleProxy object.
+ *
+ * @return a style manager, will not be null.
+ */
+ private static function getStyleManagerFromStyleProxy(obj:StyleProxy):IStyleManager2
+ {
+ // StyleProxy's usually have sources that are DisplayObject's, but a StyleProxy can also have
+ // another StyleProxy as it's source (Example: CalendarLayout's source is a StyleProxy for DateChooser,
+ // whose style is a StyleProxy for DateField)
+ var curObj:IStyleClient = obj;
+ while (curObj is StyleProxy)
+ {
+ curObj = StyleProxy(curObj).source;
+ }
+
+ if (curObj is IFlexModule)
+ return StyleManager.getStyleManager(IFlexModule(curObj).moduleFactory);
+
+ return StyleManager.getStyleManager(null);
+ }
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/AnchorStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/AnchorStyles.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/AnchorStyles.as
new file mode 100644
index 0000000..89c93e4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/AnchorStyles.as
@@ -0,0 +1,158 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * The vertical distance in pixels from the top edge of the content area to
+ * the control's baseline position.
+ * If this style is set, the baseline of the component is
+ * anchored to the top edge of its content area; when its container
+ * is resized, the two edges maintain their separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="baseline", type="String", inherit="no")]
+
+/**
+ * The vertical distance, in pixels, from the bottom edge of the component
+ * to the bottom edge of its parent container's content area.
+ * If this style is set, the lower edge of the component is
+ * anchored to the bottom edge of its content area; when its container
+ * is resized, the two edges maintain their separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="bottom", type="String", inherit="no")]
+
+/**
+ * The horizontal distance in pixels from the center of the component's
+ * content area to the center of the component.
+ * If this style is set, the center of the component is
+ * anchored to the center of its content area; when its container
+ * is resized, the two centers maintain their horizontal separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="horizontalCenter", type="String", inherit="no")]
+
+/**
+ * The horizontal distance, in pixels, from the left edge of the component
+ * to the left edge of its parent container's content area.
+ * If this style is set, the left edge of the component is
+ * anchored to the left edge of its content area; when its container
+ * is resized, the two edges maintain their separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="left", type="String", inherit="no")]
+
+/**
+ * The horizontal distance, in pixels, from the right edge of the component
+ * to the right edge of its parent container's content area.
+ * If this style is set, the right edge of the component is
+ * anchored to the right edge of its content area; when its container
+ * is resized, the two edges maintain their separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="right", type="String", inherit="no")]
+
+/**
+ * The vertical distance, in pixels, from the top edge of the component
+ * to the top edge of its parent container's content area.
+ * If this style is set, the top edge of the component is
+ * anchored to the top edge of its content area; when its container
+ * is resized, the two edges maintain their separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="top", type="String", inherit="no")]
+
+/**
+ * The vertical distance in pixels from the center of the component's
+ * content area to the center of the component.
+ * If this style is set, the center of the component is
+ * anchored to the center of its content area; when its container
+ * is resized, the two centers maintain their vertical separation.
+ *
+ * <p>This style only has an effect when used on a component in a Canvas container,
+ * or when used on a component in a Panel or Application container that has the
+ * <code>layout</code> property set to <code>absolute</code>.</p>
+ *
+ * <p>The default value is <code>undefined</code>, which means it is not set.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="verticalCenter", type="String", inherit="no")]
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BarColorStyle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BarColorStyle.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BarColorStyle.as
new file mode 100644
index 0000000..c247291
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BarColorStyle.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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Determines the color of a ProgressBar.
+ * A ProgressBar is filled with a vertical gradient between this color
+ * and a brighter color computed from it.
+ * This style has no effect on other components, but can be set on a container
+ * to control the appearance of all progress bars found within.
+ * The default value is <code>undefined</code>, which means it is not set.
+ * In this case, the <code>themeColor</code> style property is used.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="barColor", type="uint", format="Color", inherit="yes", theme="halo")]
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BorderStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BorderStyles.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BorderStyles.as
new file mode 100644
index 0000000..9fc4a1f
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/BorderStyles.as
@@ -0,0 +1,250 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Background color of the component when it is disabled.
+ * The global default value is <code>undefined</code>.
+ * The default value for List controls is <code>0xDDDDDD</code> (light gray).
+ * If a container is disabled, the background is dimmed, and the degree of
+ * dimming is controlled by the <code>disabledOverlayAlpha</code> style.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="backgroundDisabledColor", type="uint", format="Color", inherit="yes", theme="halo")]
+
+/**
+ * Background image of a component. This can be an absolute or relative
+ * URL or class. You can set either the <code>backgroundColor</code> or the
+ * <code>backgroundImage</code>. The background image is displayed
+ * on top of the background color.
+ * The default value is <code>undefined</code>, meaning "not set".
+ * If this style and the <code>backgroundColor</code> style are undefined,
+ * the component has a transparent background.
+ *
+ * <p>The default skins of most Flex controls are partially transparent. As a result, the background image of
+ * a container partially "bleeds through" to controls that are in that container. You can avoid this by setting the
+ * alpha values of the control's <code>fillAlphas</code> property to 1, as the following example shows:
+ * <pre>
+ * <mx:<i>Container</i> backgroundColor="0x66CC66"/>
+ * <mx:<i>ControlName</i> ... fillAlphas="[1,1]"/>
+ * </mx:<i>Container</i>></pre>
+ * </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="backgroundImage", type="Object", format="File", inherit="no", theme="halo")]
+
+/**
+ * Scales the image specified by <code>backgroundImage</code>
+ * to different percentage sizes.
+ * A value of <code>"100%"</code> stretches the image
+ * to fit the entire component.
+ * To specify a percentage value, you must include the percent sign (%).
+ * The default for the Application container is <code>100%</code>.
+ * The default value for all other containers is <code>auto</code>, which maintains
+ * the original size of the image.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="backgroundSize", type="String", inherit="no", theme="halo")]
+
+/**
+ * Alpha of the border.
+ * @default 1
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="borderAlpha", type="Number", inherit="no", theme="spark")]
+
+/**
+ * Color of the border.
+ * The default value depends on the component class;
+ * if not overridden for the class, the default value is <code>0xB7BABC</code>
+ * for the Halo theme and <code>0x696969</code> for the Spark theme.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="borderColor", type="uint", format="Color", inherit="no", theme="halo, spark, mobile")]
+
+/**
+ * Bounding box sides.
+ * A space-delimited String that specifies the sides of the border to show.
+ * The String can contain <code>"left"</code>, <code>"top"</code>,
+ * <code>"right"</code>, and <code>"bottom"</code> in any order.
+ * The default value is <code>"left top right bottom"</code>,
+ * which shows all four sides.
+ *
+ * This style is only used when borderStyle is <code>"solid"</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="borderSides", type="String", inherit="no", theme="halo")]
+
+/**
+ * The border skin class of the component.
+ * The default value in all components that do not explicitly
+ * set their own default for the Halo theme is <code>mx.skins.halo.HaloBorder</code>
+ * and for the Spark theme is <code>mx.skins.spark.BorderSkin</code>.
+ * The Panel container has a default value of <code>mx.skins.halo.PanelSkin</code>
+ * for the Halo theme and <code>mx.skins.spark.BorderSkin</code> for the Spark theme.
+ * To determine the default value for a component, see the default.css file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="borderSkin", type="Class", inherit="no")]
+
+/**
+ * Bounding box style.
+ * The possible values are <code>"none"</code>, <code>"solid"</code>,
+ * <code>"inset"</code>, and <code>"outset"</code>.
+ * The default value depends on the component class;
+ * if not overridden for the class, the default value is <code>"inset"</code>.
+ * The default value for most Containers is <code>"none"</code>.
+ * The <code>"inset"</code> and <code>"outset"</code> values are only
+ * valid with the halo theme.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="borderStyle", type="String", enumeration="inset,outset,solid,none", inherit="no")]
+
+/**
+ * Bounding box thickness.
+ * Only used when <code>borderStyle</code> is set to <code>"solid"</code>.
+ *
+ * @default 1
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="borderThickness", type="Number", format="Length", inherit="no", theme="halo")]
+
+/**
+ * Visibility of the border.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="borderVisible", type="Boolean", inherit="no", theme="spark")]
+
+/**
+ * Boolean property that specifies whether the component has a visible
+ * drop shadow.
+ * This style is used with <code>borderStyle="solid"</code>.
+ * The default value is <code>false</code>.
+ *
+ * <p><b>Note:</b> For drop shadows to appear on containers, set
+ * <code>backgroundColor</code> or <code>backgroundImage</code> properties.
+ * Otherwise, the shadow appears behind the container because
+ * the default background of a container is transparent.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="dropShadowEnabled", type="Boolean", inherit="no", theme="halo")]
+
+/**
+ * Boolean property that specifies whether the component has a visible
+ * drop shadow.
+ * The default value is <code>false</code>.
+ *
+ * <p><b>Note:</b> For drop shadows to appear on containers, set
+ * <code>contentBackgroundColor</code> property.
+ * Otherwise, the shadow appears behind the container because
+ * the default background of a container is transparent.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="dropShadowVisible", type="Boolean", inherit="no", theme="spark")]
+
+/**
+ * Color of the drop shadow.
+ *
+ * @default 0x000000
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="dropShadowColor", type="uint", format="Color", inherit="yes", theme="halo")]
+
+/**
+ * Direction of the drop shadow.
+ * Possible values are <code>"left"</code>, <code>"center"</code>,
+ * and <code>"right"</code>.
+ *
+ * @default "center"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="shadowDirection", type="String", enumeration="left,center,right", inherit="no", theme="halo")]
+
+/**
+ * Distance of the drop shadow.
+ * If the property is set to a negative value, the shadow appears above the component.
+ *
+ * @default 2
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="shadowDistance", type="Number", format="Length", inherit="no", theme="halo")]
+
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/ContainerBackgroundStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/ContainerBackgroundStyles.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/ContainerBackgroundStyles.as
new file mode 100644
index 0000000..7da71d7
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/ContainerBackgroundStyles.as
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Alpha level of the color defined by the <code>backgroundColor</code>
+ * property, of the image or SWF file defined by the <code>backgroundImage</code>
+ * style.
+ * Valid values range from 0.0 to 1.0. For most controls, the default value is 1.0,
+ * but for ToolTip controls, the default value is 0.95 and for Alert controls, the default value is 0.9.
+ *
+ * @default 1.0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="backgroundAlpha", type="Number", inherit="no", theme="halo, spark, mobile")]
+
+/**
+ * Background color of a component.
+ * You can have both a <code>backgroundColor</code> and a
+ * <code>backgroundImage</code> set.
+ * Some components do not have a background.
+ * The DataGrid control ignores this style.
+ * The default value is <code>undefined</code>, which means it is not set.
+ * If both this style and the <code>backgroundImage</code> style
+ * are <code>undefined</code>, the component has a transparent background.
+ *
+ * <p>For the Application container, this style specifies the background color
+ * while the application loads, and a background gradient while it is running.
+ * Flex calculates the gradient pattern between a color slightly darker than
+ * the specified color, and a color slightly lighter than the specified color.</p>
+ *
+ * <p>The default skins of most Flex controls are partially transparent. As a result, the background color of
+ * a container partially "bleeds through" to controls that are in that container. You can avoid this by setting the
+ * alpha values of the control's <code>fillAlphas</code> property to 1, as the following example shows:
+ * <pre>
+ * <mx:<i>Container</i> backgroundColor="0x66CC66"/>
+ * <mx:<i>ControlName</i> ... fillAlphas="[1,1]"/>
+ * </mx:<i>Container</i>></pre>
+ * </p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="backgroundColor", type="uint", format="Color", inherit="no", theme="halo, spark, mobile")]
\ 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/styles/metadata/GapStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/GapStyles.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/GapStyles.as
new file mode 100644
index 0000000..f0f34be
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/GapStyles.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Number of pixels between children in the horizontal direction.
+ * The default value depends on the component class;
+ * if not overridden for the class, the default value is 8.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="horizontalGap", type="Number", format="Length", inherit="no")]
+
+/**
+ * Number of pixels between children in the vertical direction.
+ * The default value depends on the component class;
+ * if not overridden for the class, the default value is 6.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="verticalGap", type="Number", format="Length", inherit="no")]
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/LeadingStyle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/LeadingStyle.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/LeadingStyle.as
new file mode 100644
index 0000000..a860586
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/LeadingStyle.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Additional vertical space between lines of text.
+ *
+ * <p>The default value is 2.</p>
+ * <p>The default value for the ComboBox control is 0.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="leading", type="Number", format="Length", inherit="yes")]
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/PaddingStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/PaddingStyles.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/PaddingStyles.as
new file mode 100644
index 0000000..8ed2c6a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/PaddingStyles.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Number of pixels between the component's left border
+ * and the left edge of its content area.
+ * <p>The default value is 0.</p>
+ * <p>The default value for a Button control in the Halo theme is 10
+ * and in the Spark theme is 6.</p>
+ * <p>The default value for the ComboBox control is 5.</p>
+ * <p>The default value for the Form container is 16.</p>
+ * <p>The default value for the Tree control is 2.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ * Number of pixels between the component's right border
+ * and the right edge of its content area.
+ * <p>The default value is 0.</p>
+ * <p>The default value for a Button control in the Halo theme is 10
+ * and in the Spark theme is 6.</p>
+ * <p>The default value for the ComboBox control is 5.</p>
+ * <p>The default value for the Form container is 16.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="paddingRight", type="Number", format="Length", inherit="no")]
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/metadata/TextStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/metadata/TextStyles.as b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/TextStyles.as
new file mode 100644
index 0000000..d43179e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/metadata/TextStyles.as
@@ -0,0 +1,351 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Color of text in the component, including the component label.
+ *
+ * The default value for the Halo theme is <code>0x0B333C</code>.
+ * The default value for the Spark theme is <code>0x000000</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="color", type="uint", format="Color", inherit="yes")]
+
+/**
+ * The directionality of the text displayed by the component.
+ *
+ * <p>The allowed values are <code>"ltr"</code> for left-to-right text,
+ * as in Latin-style scripts,
+ * and <code>"rtl"</code> for right-to-left text,
+ * as in Arabic and Hebrew.</p>
+ *
+ * <p>FTE and TLF use this value in their bidirectional text layout algorithm,
+ * which maps Unicode character order to glyph order.</p>
+ *
+ * <p>Note: This style only applies when an MX component
+ * specifies UIFTETextField as its <code>textFieldClass</code>.</p>
+ *
+ * <p>The <code>direction</code> also affects the alignment
+ * of the text within the bounds of the TLFTextField.
+ * It does not, however, affect the the placement
+ * of the TLFTextField within the component.</p>
+ *
+ * @default "ltr"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="direction", type="String", enumeration="ltr,rtl,inherit", inherit="yes")]
+
+/**
+ * Color of text in the component if it is disabled.
+ *
+ * @default 0xAAB3B3
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="disabledColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ * Sets the <code>antiAliasType</code> property of internal TextFields. The possible values are
+ * <code>"normal"</code> (<code>flash.text.AntiAliasType.NORMAL</code>)
+ * and <code>"advanced"</code> (<code>flash.text.AntiAliasType.ADVANCED</code>).
+ *
+ * <p>The default value is <code>"advanced"</code>, which enables advanced anti-aliasing for the font.
+ * Set to <code>"normal"</code> to disable the advanced anti-aliasing.</p>
+ *
+ * <p>This style has no effect for system fonts.</p>
+ *
+ * <p>This style applies to all the text in a TextField subcontrol;
+ * you cannot apply it to some characters and not others.</p>
+
+ * @default "advanced"
+ *
+ * @see flash.text.TextField
+ * @see flash.text.AntiAliasType
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontAntiAliasType", type="String", enumeration="normal,advanced", inherit="yes")]
+
+/**
+ * Name of the font to use.
+ * Unlike in a full CSS implementation,
+ * comma-separated lists are not supported.
+ * You can use any font family name.
+ * If you specify a generic font name,
+ * it is converted to an appropriate device font.
+ *
+ * The default font for the Halo theme is <code>"Verdana"</code>.
+ * The default font for the Spark theme is <code>"Arial"</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontFamily", type="String", inherit="yes")]
+
+/**
+ * Sets the <code>gridFitType</code> property of internal TextFields that represent text in Flex controls.
+ * The possible values are <code>"none"</code> (<code>flash.text.GridFitType.NONE</code>),
+ * <code>"pixel"</code> (<code>flash.text.GridFitType.PIXEL</code>),
+ * and <code>"subpixel"</code> (<code>flash.text.GridFitType.SUBPIXEL</code>).
+ *
+ * <p>This property only applies when you are using an embedded font
+ * and the <code>fontAntiAliasType</code> property
+ * is set to <code>"advanced"</code>.</p>
+ *
+ * <p>This style has no effect for system fonts.</p>
+ *
+ * <p>This style applies to all the text in a TextField subcontrol;
+ * you can't apply it to some characters and not others.</p>
+ *
+ * @default "pixel"
+ *
+ * @see flash.text.TextField
+ * @see flash.text.GridFitType
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontGridFitType", type="String", enumeration="none,pixel,subpixel", inherit="yes")]
+
+/**
+ * Sets the <code>sharpness</code> property of internal TextFields that represent text in Flex controls.
+ * This property specifies the sharpness of the glyph edges. The possible values are Numbers
+ * from -400 through 400.
+ *
+ * <p>This property only applies when you are using an embedded font
+ * and the <code>fontAntiAliasType</code> property
+ * is set to <code>"advanced"</code>.</p>
+ *
+ * <p>This style has no effect for system fonts.</p>
+ *
+ * <p>This style applies to all the text in a TextField subcontrol;
+ * you can't apply it to some characters and not others.</p>
+ *
+ * @default 0
+ *
+ * @see flash.text.TextField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontSharpness", type="Number", inherit="yes")]
+
+/**
+ * Height of the text, in pixels.
+ *
+ * In the Halo theme, the default value is 10 for all controls except
+ * the ColorPicker control. For the Halo themed ColorPicker control,
+ * the default value is 11. In the Spark theme, the default value is
+ * 12 for all controls except the ColorPicker control. For the Spark
+ * themed ColorPicker control, the default value is 11.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontSize", type="Number", format="Length", inherit="yes")]
+
+/**
+ * Determines whether the text is italic font.
+ * Recognized values are <code>"normal"</code> and <code>"italic"</code>.
+ *
+ * @default "normal"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontStyle", type="String", enumeration="normal,italic", inherit="yes")]
+
+/**
+ * Sets the <code>thickness</code> property of internal TextFields that represent text in Flex controls.
+ * This property specifies the thickness of the glyph edges.
+ * The possible values are Numbers from -200 to 200.
+ *
+ * <p>This property only applies when you are using an embedded font
+ * and the <code>fontAntiAliasType</code> property
+ * is set to <code>"advanced"</code>.</p>
+ *
+ * <p>This style has no effect on system fonts.</p>
+ *
+ * <p>This style applies to all the text in a TextField subcontrol;
+ * you can't apply it to some characters and not others.</p>
+ *
+ * @default 0
+ *
+ * @see flash.text.TextField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontThickness", type="Number", inherit="yes")]
+
+/**
+ * Determines whether the text is boldface.
+ * Recognized values are <code>normal</code> and <code>bold</code>.
+ * The default value for Button controls is <code>bold</code>.
+ * The default value for all other controls is <code>normal</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="fontWeight", type="String", enumeration="normal,bold", inherit="yes")]
+
+/**
+ * A Boolean value that indicates whether kerning
+ * is enabled (<code>true</code>) or disabled (<code>false</code>).
+ * Kerning adjusts the gap between certain character pairs
+ * to improve readability, and should be used only when necessary,
+ * such as with headings in large fonts.
+ * Kerning is supported for embedded fonts only.
+ * Certain fonts, such as Verdana, and monospaced fonts,
+ * such as Courier New, do not support kerning.
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="kerning", type="Boolean", inherit="yes")]
+
+/**
+ * The number of additional pixels to appear between each character.
+ * A positive value increases the character spacing beyond the normal spacing,
+ * while a negative value decreases it.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="letterSpacing", type="Number", inherit="yes")]
+
+/**
+ * The locale of the text displayed by this component.
+ *
+ * <p>FTE and TLF use this locale to map Unicode characters
+ * to font glyphs and to find fallback fonts.</p>
+ *
+ * <p>Note: This style only applies when an MX component
+ * specifies UIFTETextField as its <code>textFieldClass</code>.</p>
+ *
+ * @default "en"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="locale", type="String", inherit="yes")]
+
+/**
+ * Alignment of text within a container.
+ * Possible values are <code>"left"</code>, <code>"right"</code>,
+ * or <code>"center"</code>.
+ *
+ * <p>The default value for most components is <code>"left"</code>.
+ * For the FormItem component,
+ * the default value is <code>"right"</code>.
+ * For the Button, LinkButton, and AccordionHeader components,
+ * the default value is <code>"center"</code>, and
+ * this property is only recognized when the
+ * <code>labelPlacement</code> property is set to <code>"left"</code> or
+ * <code>"right"</code>.
+ * If <code>labelPlacement</code> is set to <code>"top"</code> or
+ * <code>"bottom"</code>, the text and any icon are centered.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="textAlign", type="String", enumeration="left,center,right", inherit="yes")]
+
+/**
+ * Determines whether the text is underlined.
+ * Possible values are <code>"none"</code> and <code>"underline"</code>.
+ *
+ * @default "none"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="textDecoration", type="String", enumeration="none,underline", inherit="yes")]
+
+/**
+ * The class implementing IUITextField that is used by this component
+ * to render text.
+ *
+ * <p>It can be set to either the mx.core.UITextField class
+ * (to use the classic TextField class built into Flash Player)
+ * or the mx.core.UIFTETextField class
+ * (to use the Text Layout Framework to get improved text rendering,
+ * including bidirectional layout).</p>
+ *
+ * @default mx.core.UITextField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="textFieldClass", type="Class", inherit="no")]
+
+/**
+ * Offset of first line of text from the left side of the container, in pixels.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="textIndent", type="Number", format="Length", inherit="yes")]
[02/37] git commit: [flex-asjs] [refs/heads/spark] - merge develop
into spark
Posted by ah...@apache.org.
merge develop into spark
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b93fb1c9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b93fb1c9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b93fb1c9
Branch: refs/heads/spark
Commit: b93fb1c9d9388f6bf9e787ae351f467dac1cc635
Parents: 194943f ceb75a7
Author: Alex Harui <ah...@apache.org>
Authored: Mon Feb 1 21:30:20 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Feb 1 21:30:20 2016 -0800
----------------------------------------------------------------------
examples/flexjs/DesktopMap/DesktopMap-app.xml | 6 +-
examples/flexjs/DesktopMap/build.xml | 4 +-
.../src/productsView/CatalogTitleButtons.mxml | 4 +-
.../productsView/ProductCatalogThumbnail.mxml | 2 +-
.../flexjs/MobileTrader/src/MyInitialView.mxml | 2 +-
frameworks/projects/Core/as/src/CoreClasses.as | 1 +
.../as/src/org/apache/flex/events/MouseEvent.as | 434 +++++++++++--------
.../flex/events/utils/IHandlesOriginalEvent.as | 35 ++
.../flex/events/utils/MouseEventConverter.as | 7 +
.../org/apache/flex/events/utils/MouseUtils.as | 2 +-
.../as/src/org/apache/flex/utils/HTMLLoader.as | 42 ++
.../GoogleMaps/as/src/GoogleStubClasses.as | 42 ++
.../GoogleMaps/as/src/google/maps/Animation.as | 24 +
.../as/src/google/maps/BicyclingLayer.as | 29 ++
.../GoogleMaps/as/src/google/maps/Circle.as | 108 +++++
.../as/src/google/maps/ControlPosition.as | 94 ++++
.../as/src/google/maps/DirectionsRenderer.as | 76 ++++
.../as/src/google/maps/DirectionsService.as | 24 +
.../as/src/google/maps/DirectionsStatus.as | 66 +++
.../google/maps/DistanceMatrixElementStatus.as | 31 ++
.../as/src/google/maps/DistanceMatrixService.as | 24 +
.../as/src/google/maps/DistanceMatrixStatus.as | 59 +++
.../as/src/google/maps/ElevationService.as | 32 ++
.../as/src/google/maps/ElevationStatus.as | 45 ++
.../as/src/google/maps/FusionTablesHeatmap.as | 22 +
.../as/src/google/maps/FusionTablesLayer.as | 37 ++
.../google/maps/FusionTablesMarkerOptions.as | 22 +
.../google/maps/FusionTablesPolygonOptions.as | 46 ++
.../google/maps/FusionTablesPolylineOptions.as | 34 ++
.../as/src/google/maps/FusionTablesQuery.as | 52 +++
.../as/src/google/maps/FusionTablesStyle.as | 40 ++
.../GoogleMaps/as/src/google/maps/Geocoder.as | 24 +
.../src/google/maps/GeocoderAddressComponent.as | 34 ++
.../as/src/google/maps/GeocoderGeometry.as | 40 ++
.../as/src/google/maps/GeocoderLocationType.as | 38 ++
.../as/src/google/maps/GeocoderResult.as | 40 ++
.../as/src/google/maps/GeocoderStatus.as | 59 +++
.../as/src/google/maps/GroundOverlay.as | 57 +++
.../as/src/google/maps/ImageMapType.as | 30 ++
.../GoogleMaps/as/src/google/maps/InfoWindow.as | 77 ++++
.../GoogleMaps/as/src/google/maps/KmlAuthor.as | 34 ++
.../as/src/google/maps/KmlFeatureData.as | 52 +++
.../GoogleMaps/as/src/google/maps/KmlLayer.as | 61 +++
.../as/src/google/maps/KmlLayerMetadata.as | 40 ++
.../as/src/google/maps/KmlLayerStatus.as | 73 ++++
.../as/src/google/maps/KmlMouseEvent.as | 34 ++
.../GoogleMaps/as/src/google/maps/LatLng.as | 78 ++++
.../as/src/google/maps/LatLngBounds.as | 96 ++++
.../GoogleMaps/as/src/google/maps/MVCArray.as | 85 ++++
.../GoogleMaps/as/src/google/maps/MVCObject.as | 103 +++++
.../GoogleMaps/as/src/google/maps/Map.as | 168 +++++++
.../as/src/google/maps/MapCanvasProjection.as | 52 +++
.../GoogleMaps/as/src/google/maps/MapPanes.as | 58 +++
.../as/src/google/maps/MapTypeControlStyle.as | 31 ++
.../GoogleMaps/as/src/google/maps/MapTypeId.as | 38 ++
.../as/src/google/maps/MapTypeRegistry.as | 17 +
.../as/src/google/maps/MapsEventListener.as | 16 +
.../GoogleMaps/as/src/google/maps/Marker.as | 299 +++++++++++++
.../as/src/google/maps/MaxZoomService.as | 24 +
.../as/src/google/maps/MaxZoomStatus.as | 24 +
.../GoogleMaps/as/src/google/maps/MouseEvent.as | 28 ++
.../as/src/google/maps/OverlayView.as | 59 +++
.../GoogleMaps/as/src/google/maps/Point.as | 43 ++
.../as/src/google/maps/PolyMouseEvent.as | 34 ++
.../GoogleMaps/as/src/google/maps/Polygon.as | 102 +++++
.../GoogleMaps/as/src/google/maps/Polyline.as | 89 ++++
.../GoogleMaps/as/src/google/maps/Rectangle.as | 89 ++++
.../as/src/google/maps/ScaleControlStyle.as | 17 +
.../GoogleMaps/as/src/google/maps/Size.as | 45 ++
.../src/google/maps/StreetViewCoverageLayer.as | 29 ++
.../as/src/google/maps/StreetViewPanorama.as | 108 +++++
.../as/src/google/maps/StreetViewPov.as | 28 ++
.../as/src/google/maps/StreetViewService.as | 33 ++
.../as/src/google/maps/StreetViewStatus.as | 31 ++
.../as/src/google/maps/StrokePosition.as | 31 ++
.../as/src/google/maps/StyledMapType.as | 18 +
.../GoogleMaps/as/src/google/maps/SymbolPath.as | 45 ++
.../as/src/google/maps/TrafficLayer.as | 29 ++
.../as/src/google/maps/TransitLayer.as | 29 ++
.../GoogleMaps/as/src/google/maps/TravelMode.as | 38 ++
.../GoogleMaps/as/src/google/maps/UnitSystem.as | 24 +
.../as/src/google/maps/ZoomControlStyle.as | 31 ++
.../GoogleMaps/as/src/google/maps/adsense.as | 27 ++
.../as/src/google/maps/adsense/AdFormat.as | 136 ++++++
.../as/src/google/maps/adsense/AdUnit.as | 146 +++++++
.../GoogleMaps/as/src/google/maps/drawing.as | 33 ++
.../src/google/maps/drawing/DrawingManager.as | 53 +++
.../google/maps/drawing/OverlayCompleteEvent.as | 28 ++
.../as/src/google/maps/drawing/OverlayType.as | 45 ++
.../GoogleMaps/as/src/google/maps/event.as | 83 ++++
.../GoogleMaps/as/src/google/maps/geometry.as | 33 ++
.../as/src/google/maps/geometry/encoding.as | 28 ++
.../as/src/google/maps/geometry/poly.as | 34 ++
.../as/src/google/maps/geometry/spherical.as | 86 ++++
.../GoogleMaps/as/src/google/maps/panoramio.as | 30 ++
.../src/google/maps/panoramio/PanoramioLayer.as | 66 +++
.../GoogleMaps/as/src/google/maps/places.as | 103 +++++
.../as/src/google/maps/places/Autocomplete.as | 54 +++
.../google/maps/places/AutocompleteService.as | 32 ++
.../google/maps/places/ComponentRestrictions.as | 22 +
.../as/src/google/maps/places/PhotoOptions.as | 28 ++
.../src/google/maps/places/PlaceAspectRating.as | 28 ++
.../as/src/google/maps/places/PlaceGeometry.as | 31 ++
.../as/src/google/maps/places/PlaceResult.as | 142 ++++++
.../as/src/google/maps/places/PlaceReview.as | 40 ++
.../google/maps/places/PlaceSearchPagination.as | 28 ++
.../as/src/google/maps/places/PlacesService.as | 49 +++
.../google/maps/places/PlacesServiceStatus.as | 52 +++
.../as/src/google/maps/places/RankBy.as | 24 +
.../as/src/google/maps/places/SearchBox.as | 40 ++
.../as/src/google/maps/visualization.as | 74 ++++
.../maps/visualization/DemographicsLayer.as | 65 +++
.../google/maps/visualization/HeatmapLayer.as | 47 ++
.../maps/visualization/MapsEngineLayer.as | 91 ++++
.../maps/visualization/MapsEngineStatus.as | 31 ++
.../GoogleMaps/as/src/google/maps/weather.as | 60 +++
.../as/src/google/maps/weather/CloudLayer.as | 32 ++
.../as/src/google/maps/weather/LabelColor.as | 24 +
.../src/google/maps/weather/TemperatureUnit.as | 24 +
.../as/src/google/maps/weather/WeatherLayer.as | 40 ++
.../as/src/google/maps/weather/WindSpeedUnit.as | 31 ++
.../org/apache/flex/maps/google/GoogleMap.as | 2 +-
.../flex/maps/google/beads/GoogleMapView.as | 370 +++++++++++++++-
frameworks/projects/GoogleMaps/build.xml | 2 +-
.../projects/GoogleMaps/compile-asjs-config.xml | 1 +
.../projects/GoogleMaps/compile-config.xml | 1 +
.../HTML/as/src/org/apache/flex/html/Button.as | 2 +-
.../as/src/org/apache/flex/html/CheckBox.as | 5 +-
.../as/src/org/apache/flex/html/RadioButton.as | 5 +-
.../org/apache/flex/html/ToggleTextButton.as | 42 +-
.../beads/controllers/DropDownListController.as | 15 +-
.../controllers/ItemRendererMouseController.as | 5 +-
.../flex/reflection/DefinitionWithMetaData.as | 15 +-
.../flex/reflection/MetaDataDefinition.as | 9 +-
manualtests/ReflectionTest/build.xml | 2 +
.../ReflectionTest/src/MyInitialView.mxml | 54 ++-
136 files changed, 6499 insertions(+), 259 deletions(-)
----------------------------------------------------------------------
[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
Posted by ah...@apache.org.
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;
+ }
+ }
+}
+
+}
[30/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
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
new file mode 100644
index 0000000..32c70ed
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
@@ -0,0 +1,14827 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+/*
+import flash.accessibility.Accessibility;
+import flash.accessibility.AccessibilityProperties;
+import flash.display.BlendMode;
+*/
+import flex.display.TopOfDisplayList;
+import flex.events.Event;
+import flex.events.EventPhase;
+import flex.ui.Keyboard;
+
+import org.apache.flex.events.Event;
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.InteractiveObject;
+ import flash.display.Sprite;
+ import flash.display.GradientType;
+ import flash.display.Graphics;
+ import flash.display.Loader;
+ import flash.events.Event;
+ import flash.geom.Matrix;
+ import flash.geom.Matrix3D;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.DisplayObjectContainer;
+ import flex.display.InteractiveObject;
+ import flex.display.Loader;
+ import flex.display.Sprite;
+}
+/*
+import flash.display.Shader;
+*/
+import mx.events.FocusEvent;
+import mx.events.KeyboardEvent;
+/*
+import flash.events.IEventDispatcher;
+import flash.geom.ColorTransform;
+import flash.geom.PerspectiveProjection;
+*/
+import org.apache.flex.geom.Point;
+import org.apache.flex.geom.Rectangle;
+import org.apache.flex.utils.PointUtils;
+/*
+import flash.geom.Transform;
+import flash.geom.Vector3D;
+import flash.system.ApplicationDomain;
+import flash.system.Capabilities;
+import flash.text.TextFormatAlign;
+import flash.text.TextLineMetrics;
+import flash.utils.Dictionary;
+*/
+import org.apache.flex.reflection.getQualifiedClassName;
+
+import mx.automation.IAutomationObject;
+import mx.binding.Binding;
+import mx.binding.BindingManager;
+import mx.binding.FunctionReturnWatcher;
+import mx.binding.PropertyWatcher;
+import mx.binding.Watcher;
+import mx.binding.StaticPropertyWatcher;
+import mx.binding.XMLWatcher;
+import mx.controls.IFlexContextMenu;
+import mx.core.LayoutDirection;
+import mx.effects.EffectManager;
+import mx.effects.IEffect;
+import mx.effects.IEffectInstance;
+import mx.events.ChildExistenceChangedEvent;
+import mx.events.DynamicEvent;
+import mx.events.EffectEvent;
+import mx.events.FlexEvent;
+import mx.events.MoveEvent;
+import mx.events.PropertyChangeEvent;
+import mx.events.ResizeEvent;
+import mx.events.StateChangeEvent;
+import mx.events.ValidationResultEvent;
+/*
+import mx.filters.BaseFilter;
+import mx.filters.IBitmapFilter;
+*/
+import mx.geom.RoundedRectangle;
+/*
+import mx.geom.Transform;
+import mx.geom.TransformOffsets;
+import mx.graphics.shaderClasses.ColorBurnShader;
+import mx.graphics.shaderClasses.ColorDodgeShader;
+import mx.graphics.shaderClasses.ColorShader;
+import mx.graphics.shaderClasses.ExclusionShader;
+import mx.graphics.shaderClasses.HueShader;
+import mx.graphics.shaderClasses.LuminosityShader;
+import mx.graphics.shaderClasses.SaturationShader;
+import mx.graphics.shaderClasses.SoftLightShader;
+*/
+import mx.managers.CursorManager;
+import mx.managers.ICursorManager;
+import mx.managers.IFocusManager;
+import mx.managers.IFocusManagerComponent;
+import mx.managers.IFocusManagerContainer;
+import mx.managers.ILayoutManagerClient;
+import mx.managers.ISystemManager;
+import mx.managers.IToolTipManagerClient;
+import mx.managers.SystemManagerGlobals;
+import mx.managers.SystemManager;
+import mx.managers.ToolTipManager;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.states.State;
+import mx.states.Transition;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.IAdvancedStyleClient;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.styles.IStyleManager2;
+import mx.styles.StyleProtoChain;
+import mx.styles.StyleManager;
+import mx.utils.ColorUtil;
+import mx.utils.GraphicsUtil;
+/*
+import mx.utils.MatrixUtil;
+*/
+import mx.utils.NameUtil;
+import mx.utils.StringUtil;
+/*
+import mx.utils.TransformUtil;
+*/
+import mx.validators.IValidatorListener;
+import mx.validators.ValidationResult;
+
+use namespace mx_internal;
+
+import org.apache.flex.core.UIBase;
+import flex.system.DefinitionManager;
+import org.apache.flex.events.EventDispatcher;
+import org.apache.flex.events.IEventDispatcher;
+
+// Excluding the property to enable code hinting for the layoutDirection style
+[Exclude(name="layoutDirection", kind="property")]
+
+//--------------------------------------
+// Lifecycle events
+//--------------------------------------
+
+/**
+ * Dispatched when the component is added to a container as a content child
+ * by using the <code>addChild()</code>, <code>addChildAt()</code>,
+ * <code>addElement()</code>, or <code>addElementAt()</code> method.
+ * If the component is added to the container as a noncontent child by
+ * using the <code>rawChildren.addChild()</code> or
+ * <code>rawChildren.addChildAt()</code> method, the event is not dispatched.
+ *
+ * <p>This event is only dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.ADD
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="add", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when the component has finished its construction,
+ * property processing, measuring, layout, and drawing.
+ *
+ * <p>At this point, depending on its <code>visible</code> property,
+ * the component is not visible even though it has been drawn.</p>
+ *
+ * @eventType mx.events.FlexEvent.CREATION_COMPLETE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="creationComplete", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when an object has had its <code>commitProperties()</code>,
+ * <code>measure()</code>, and
+ * <code>updateDisplayList()</code> methods called (if needed).
+ *
+ * <p>This is the last opportunity to alter the component before it is
+ * displayed. All properties have been committed and the component has
+ * been measured and layed out.</p>
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.UPDATE_COMPLETE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="updateComplete", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when an object's state changes from visible to invisible.
+ *
+ * <p>This event is only dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.HIDE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="hide", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when the component has finished its construction
+ * and has all initialization properties set.
+ *
+ * <p>After the initialization phase, properties are processed, the component
+ * is measured, laid out, and drawn, after which the
+ * <code>creationComplete</code> event is dispatched.</p>
+ *
+ * @eventType mx.events.FlexEvent.INITIALIZE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="initialize", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when the object has moved.
+ *
+ * <p>You can move the component by setting the <code>x</code>
+ * or <code>y</code> properties, by calling the <code>move()</code>
+ * method, by setting one
+ * of the following properties either on the component or on other
+ * components such that the LayoutManager needs to change the
+ * <code>x</code> or <code>y</code> properties of the component:</p>
+ *
+ * <ul>
+ * <li><code>minWidth</code></li>
+ * <li><code>minHeight</code></li>
+ * <li><code>maxWidth</code></li>
+ * <li><code>maxHeight</code></li>
+ * <li><code>explicitWidth</code></li>
+ * <li><code>explicitHeight</code></li>
+ * </ul>
+ *
+ * <p>When you call the <code>move()</code> method, the <code>move</code>
+ * event is dispatched before the method returns.
+ * In all other situations, the <code>move</code> event is not dispatched
+ * until after the property changes.</p>
+ *
+ * <p>This event only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.MoveEvent.MOVE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="move", type="mx.events.MoveEvent")]
+
+/**
+ * Dispatched at the beginning of the component initialization sequence.
+ * The component is in a very raw state when this event is dispatched.
+ * Many components, such as the Button control, create internal child
+ * components to implement functionality; for example, the Button control
+ * creates an internal UITextField component to represent its label text.
+ * When Flex dispatches the <code>preinitialize</code> event,
+ * the children, including the internal children, of a component
+ * have not yet been created.
+ *
+ * @eventType mx.events.FlexEvent.PREINITIALIZE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="preinitialize", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when the component is removed from a container as a content child
+ * by using the <code>removeChild()</code>, <code>removeChildAt()</code>,
+ * <code>removeElement()</code>, or <code>removeElementAt()</code> method.
+ * If the component is removed from the container as a noncontent child by
+ * using the <code>rawChildren.removeChild()</code> or
+ * <code>rawChildren.removeChildAt()</code> method, the event is not dispatched.
+ *
+ * <p>This event only dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.REMOVE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="remove", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when the component is resized.
+ *
+ * <p>You can resize the component by setting the <code>width</code> or
+ * <code>height</code> property, by calling the <code>setActualSize()</code>
+ * method, or by setting one of
+ * the following properties either on the component or on other components
+ * such that the LayoutManager needs to change the <code>width</code> or
+ * <code>height</code> properties of the component:</p>
+ *
+ * <ul>
+ * <li><code>minWidth</code></li>
+ * <li><code>minHeight</code></li>
+ * <li><code>maxWidth</code></li>
+ * <li><code>maxHeight</code></li>
+ * <li><code>explicitWidth</code></li>
+ * <li><code>explicitHeight</code></li>
+ * </ul>
+ *
+ * <p>The <code>resize</code> event is not
+ * dispatched until after the property changes.</p>
+ *
+ * <p>This event only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.ResizeEvent.RESIZE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="resize", type="mx.events.ResizeEvent")]
+
+/**
+ * Dispatched when an object's state changes from invisible to visible.
+ *
+ * <p>This event is only dispatched when there are one or more relevant listeners
+ * attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.SHOW
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="show", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+// Mouse events
+//--------------------------------------
+
+/**
+ * Dispatched from a component opened using the PopUpManager
+ * when the user clicks outside it.
+ *
+ * @eventType mx.events.FlexMouseEvent.MOUSE_DOWN_OUTSIDE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="mouseDownOutside", type="mx.events.FlexMouseEvent")]
+
+/**
+ * Dispatched from a component opened using the PopUpManager
+ * when the user scrolls the mouse wheel outside it.
+ *
+ * @eventType mx.events.FlexMouseEvent.MOUSE_WHEEL_OUTSIDE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="mouseWheelOutside", type="mx.events.FlexMouseEvent")]
+
+//--------------------------------------
+// Validation events
+//--------------------------------------
+
+/**
+ * Dispatched when values are changed programmatically
+ * or by user interaction.
+ *
+ * <p>Because a programmatic change triggers this event, make sure
+ * that any <code>valueCommit</code> event handler does not change
+ * a value that causes another <code>valueCommit</code> event.
+ * For example, do not change a control's <code>dataProvider</code>
+ * property in a <code>valueCommit</code> event handler. </p>
+ *
+ * @eventType mx.events.FlexEvent.VALUE_COMMIT
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="valueCommit", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when a component is monitored by a Validator
+ * and the validation failed.
+ *
+ * @eventType mx.events.FlexEvent.INVALID
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="invalid", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when a component is monitored by a Validator
+ * and the validation succeeded.
+ *
+ * @eventType mx.events.FlexEvent.VALID
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="valid", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+// Drag-and-drop events
+//--------------------------------------
+
+/**
+ * Dispatched by a component when the user moves the mouse over the component
+ * during a drag operation.
+ * In an application running in Flash Player,
+ * the event is dispatched many times when you move the mouse over any component.
+ * In an application running in AIR, the event is dispatched only once.
+ *
+ * <p>In order to be a valid drop target, you must define a handler
+ * for this event.
+ * In the handler, you can change the appearance of the drop target
+ * to provide visual feedback to the user that the component can accept
+ * the drag.
+ * For example, you could draw a border around the drop target,
+ * or give focus to the drop target.</p>
+ *
+ * <p>If you want to accept the drag, you must call the
+ * <code>DragManager.acceptDragDrop()</code> method. If you don't
+ * call <code>acceptDragDrop()</code>, you do not get any of the
+ * other drag events.</p>
+ *
+ * <p>In Flash Player, the value of the <code>action</code> property is always
+ * <code>DragManager.MOVE</code>, even if you are doing a copy.
+ * This is because the <code>dragEnter</code> event occurs before
+ * the control recognizes that the Control key is pressed to signal a copy.
+ * The <code>action</code> property of the event object for the
+ * <code>dragOver</code> event does contain a value that signifies the type of
+ * drag operation. You can change the type of drag action by calling the
+ * <code>DragManager.showFeedback()</code> method.</p>
+ *
+ * <p>In AIR, the default value of the <code>action</code> property is
+ * <code>DragManager.COPY</code>.</p>
+ *
+ * <p>Because of the way data to a Tree control is structured,
+ * the Tree control handles drag and drop differently from the other list-based controls.
+ * For the Tree control, the event handler for the <code>dragDrop</code> event
+ * only performs an action when you move or copy data in the same Tree control,
+ * or copy data to another Tree control.
+ * If you drag data from one Tree control and drop it onto another Tree control
+ * to move the data, the event handler for the <code>dragComplete</code> event
+ * actually performs the work to add the data to the destination Tree control,
+ * rather than the event handler for the dragDrop event,
+ * and also removes the data from the source Tree control.
+ * This is necessary because to reparent the data being moved,
+ * Flex must remove it first from the source Tree control.</p>
+ *
+ * @see mx.managers.DragManager
+ *
+ * @eventType mx.events.DragEvent.DRAG_ENTER
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dragEnter", type="mx.events.DragEvent")]
+
+/**
+ * Dispatched by a component when the user moves the mouse while over the component
+ * during a drag operation.
+ * In Flash Player, the event is dispatched
+ * when you drag an item over a valid drop target.
+ * In AIR, the event is dispatched when you drag an item over
+ * any component, even if the component is not a valid drop target.
+ *
+ * <p>In the handler, you can change the appearance of the drop target
+ * to provide visual feedback to the user that the component can accept
+ * the drag.
+ * For example, you could draw a border around the drop target,
+ * or give focus to the drop target.</p>
+ *
+ * <p>Handle this event to perform additional logic
+ * before allowing the drop, such as dropping data to various locations
+ * in the drop target, reading keyboard input to determine if the
+ * drag-and-drop action is a move or copy of the drag data, or providing
+ * different types of visual feedback based on the type of drag-and-drop
+ * action.</p>
+ *
+ * <p>You can also change the type of drag action by changing the
+ * <code>DragManager.showFeedback()</code> method.
+ * The default value of the <code>action</code> property is
+ * <code>DragManager.MOVE</code>.</p>
+ *
+ * @see mx.managers.DragManager
+ *
+ * @eventType mx.events.DragEvent.DRAG_OVER
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dragOver", type="mx.events.DragEvent")]
+
+/**
+ * Dispatched by the component when the user drags outside the component,
+ * but does not drop the data onto the target.
+ *
+ * <p>You use this event to restore the drop target to its normal appearance
+ * if you modified its appearance as part of handling the
+ * <code>dragEnter</code> or <code>dragOver</code> event.</p>
+ *
+ * @eventType mx.events.DragEvent.DRAG_EXIT
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dragExit", type="mx.events.DragEvent")]
+
+/**
+ * Dispatched by the drop target when the user releases the mouse over it.
+ *
+ * <p>You use this event handler to add the drag data to the drop target.</p>
+ *
+ * <p>If you call <code>Event.preventDefault()</code> in the event handler
+ * for the <code>dragDrop</code> event for
+ * a Tree control when dragging data from one Tree control to another,
+ * it prevents the drop.</p>
+ *
+ * @eventType mx.events.DragEvent.DRAG_DROP
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dragDrop", type="mx.events.DragEvent")]
+
+/**
+ * Dispatched by the drag initiator (the component that is the source
+ * of the data being dragged) when the drag operation completes,
+ * either when you drop the dragged data onto a drop target or when you end
+ * the drag-and-drop operation without performing a drop.
+ *
+ * <p>You can use this event to perform any final cleanup
+ * of the drag-and-drop operation.
+ * For example, if you drag a List control item from one list to another,
+ * you can delete the List control item from the source if you no longer
+ * need it.</p>
+ *
+ * <p>If you call <code>Event.preventDefault()</code> in the event handler
+ * for the <code>dragComplete</code> event for
+ * a Tree control when dragging data from one Tree control to another,
+ * it prevents the drop.</p>
+ *
+ * @eventType mx.events.DragEvent.DRAG_COMPLETE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dragComplete", type="mx.events.DragEvent")]
+
+/**
+ * Dispatched by the drag initiator when starting a drag operation.
+ * This event is used internally by the list-based controls;
+ * you do not handle it when implementing drag and drop.
+ * If you want to control the start of a drag-and-drop operation,
+ * use the <code>mouseDown</code> or <code>mouseMove</code> event.
+ *
+ * @eventType mx.events.DragEvent.DRAG_START
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="dragStart", type="mx.events.DragEvent")]
+
+//--------------------------------------
+// Effect events
+//--------------------------------------
+
+/**
+ * Dispatched just before an effect starts.
+ *
+ * <p>The effect does not start changing any visuals
+ * until after this event is fired.</p>
+ *
+ * @eventType mx.events.EffectEvent.EFFECT_START
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="effectStart", type="mx.events.EffectEvent")]
+
+/**
+ * Dispatched after an effect is stopped, which happens
+ * only by a call to <code>stop()</code> on the effect.
+ *
+ * <p>The effect then dispatches the EFFECT_END event
+ * as the effect finishes. The purpose of the EFFECT_STOP
+ * event is to let listeners know that the effect came to
+ * a premature end, rather than ending naturally or as a
+ * result of a call to <code>end()</code>.</p>
+ *
+ * @eventType mx.events.EffectEvent.EFFECT_STOP
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="effectStop", type="mx.events.EffectEvent")]
+
+/**
+ * Dispatched after an effect ends.
+ *
+ * <p>The effect makes the last set of visual changes
+ * before this event is fired, but those changes are not
+ * rendered on the screen.
+ * Thus, you might have to use the <code>callLater()</code> method
+ * to delay any other changes that you want to make until after the
+ * changes have been rendered onscreen.</p>
+ *
+ * @eventType mx.events.EffectEvent.EFFECT_END
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="effectEnd", type="mx.events.EffectEvent")]
+
+
+//--------------------------------------
+// State events
+//--------------------------------------
+
+/**
+ * Dispatched after the <code>currentState</code> property changes,
+ * but before the view state changes.
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGING
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="currentStateChanging", type="mx.events.StateChangeEvent")]
+
+/**
+ * Dispatched after the view state has changed.
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="currentStateChange", type="mx.events.StateChangeEvent")]
+
+/**
+ * Dispatched after the component has entered a view state.
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.ENTER_STATE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="enterState", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched just before the component exits a view state.
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.EXIT_STATE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="exitState", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched after the component has entered a new state and
+ * any state transition animation to that state has finished playing.
+ *
+ * The event is dispatched immediately if there's no transition playing
+ * between the states.
+ *
+ * If the component switches to a different state while the transition is
+ * underway, this event will be dispatched after the component completes the
+ * transition to that new state.
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.STATE_CHANGE_COMPLETE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+[Event(name="stateChangeComplete", type="mx.events.FlexEvent")]
+
+/**
+ * Dispatched when a component interrupts a transition to its current
+ * state in order to switch to a new state.
+ *
+ * <p>This event is only dispatched when there are one or more
+ * relevant listeners attached to the dispatching object.</p>
+ *
+ * @eventType mx.events.FlexEvent.STATE_CHANGE_INTERRUPTED
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+[Event(name="stateChangeInterrupted", type="mx.events.FlexEvent")]
+
+
+//--------------------------------------
+// TouchInteraction events
+//--------------------------------------
+
+/**
+ * A cancellable event, dispatched by a component in an attempt to
+ * respond to a touch interaction user gesture.
+ *
+ * <p>The event is a bubbling event dispatched on the
+ * DisplayObject that the touch interaction
+ * started (where the mouseDown/touchBegin occurred).</p>
+ *
+ * <p>Components responding to touch interactions should listen for
+ * touch interaction events to coordinate with other components around
+ * what type of touch interaction the user intended to make and which component
+ * is responding to that touch interaction.</p>
+ *
+ * <p>A Scroller component will dispatch a touchInteractionStarting event
+ * to alert other components that may be responding to the same user's
+ * touch interaction that it would like to take control of this touch interaction.
+ * This is an opportunity for other components to cancel the Scroller's
+ * action and to maintain control over this touch interaction.</p>
+ *
+ * @eventType mx.events.TouchInteractionEvent.TOUCH_INTERACTION_STARTING
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+[Event(name="touchInteractionStarting", type="mx.events.TouchInteractionEvent")]
+
+/**
+ * A non-cancellable event, dispatched by a component when it starts
+ * responding to a touch interaction user gesture.
+ *
+ * <p>The event is a bubbling event dispatched on the
+ * DisplayObject that the touch interaction
+ * started (where the mouseDown/touchBegin occurred).</p>
+ *
+ * <p>Components responding to touch interactions should listen for
+ * touch interaction events to coordinate with other components around
+ * what type of touch interaction the user intended to make and which component
+ * is responding to that touch interaction.</p>
+ *
+ * <p>A Scroller component will dispatch a touchInteractionStart event
+ * to alert other components that may be responding to the same user's
+ * touch interaction that it is taking control of this touch interaction.
+ * When they see this event, other components should stop responding
+ * to the touch interaction, remove any visual indications that it is
+ * responding to the touch interaction, and perform other clean up.</p>
+ *
+ * @eventType mx.events.TouchInteractionEvent.TOUCH_INTERACTION_START
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+[Event(name="touchInteractionStart", type="mx.events.TouchInteractionEvent")]
+
+/**
+ * A non-cancellable event, dispatched by a component when it is done
+ * responding to a touch interaction user gesture.
+ *
+ * <p>The event is a bubbling event dispatched on the
+ * DisplayObject that the touch interaction
+ * started (where the mouseDown/touchBegin occurred).</p>
+ *
+ * <p>Components responding to touch interactions should listen for
+ * touch interaction events to coordinate with other components around
+ * what type of touch interaction the user intended to make and which component
+ * is responding to that touch interaction.</p>
+ *
+ * <p>A Scroller component will dispatch a touchInteractionEnd event
+ * to alert other components that it is done responding to the user's
+ * touch interaction.</p>
+ *
+ * @eventType mx.events.TouchInteractionEvent.TOUCH_INTERACTION_END
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+[Event(name="touchInteractionEnd", type="mx.events.TouchInteractionEvent")]
+
+//--------------------------------------
+// Tooltip events
+//--------------------------------------
+
+/**
+ * Dispatched by the component when it is time to create a ToolTip.
+ *
+ * <p>If you create your own IToolTip object and place a reference
+ * to it in the <code>toolTip</code> property of the event object
+ * that is passed to your <code>toolTipCreate</code> handler,
+ * the ToolTipManager displays your custom ToolTip.
+ * Otherwise, the ToolTipManager creates an instance of
+ * <code>ToolTipManager.toolTipClass</code> to display.</p>
+ *
+ * <p>The sequence of ToolTip events is <code>toolTipStart</code>,
+ * <code>toolTipCreate</code>, <code>toolTipShow</code>,
+ * <code>toolTipShown</code>, <code>toolTipHide</code>,
+ * and <code>toolTipEnd</code>.</p>
+ *
+ * @eventType mx.events.ToolTipEvent.TOOL_TIP_CREATE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="toolTipCreate", type="mx.events.ToolTipEvent")]
+
+/**
+ * Dispatched by the component when its ToolTip has been hidden
+ * and is to be discarded soon.
+ *
+ * <p>If you specify an effect using the
+ * <code>ToolTipManager.hideEffect</code> property,
+ * this event is dispatched after the effect stops playing.</p>
+ *
+ * <p>The sequence of ToolTip events is <code>toolTipStart</code>,
+ * <code>toolTipCreate</code>, <code>toolTipShow</code>,
+ * <code>toolTipShown</code>, <code>toolTipHide</code>,
+ * and <code>toolTipEnd</code>.</p>
+ *
+ * @eventType mx.events.ToolTipEvent.TOOL_TIP_END
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="toolTipEnd", type="mx.events.ToolTipEvent")]
+
+/**
+ * Dispatched by the component when its ToolTip is about to be hidden.
+ *
+ * <p>If you specify an effect using the
+ * <code>ToolTipManager.hideEffect</code> property,
+ * this event is dispatched before the effect starts playing.</p>
+ *
+ * <p>The sequence of ToolTip events is <code>toolTipStart</code>,
+ * <code>toolTipCreate</code>, <code>toolTipShow</code>,
+ * <code>toolTipShown</code>, <code>toolTipHide</code>,
+ * and <code>toolTipEnd</code>.</p>
+ *
+ * @eventType mx.events.ToolTipEvent.TOOL_TIP_HIDE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="toolTipHide", type="mx.events.ToolTipEvent")]
+
+/**
+ * Dispatched by the component when its ToolTip is about to be shown.
+ *
+ * <p>If you specify an effect using the
+ * <code>ToolTipManager.showEffect</code> property,
+ * this event is dispatched before the effect starts playing.
+ * You can use this event to modify the ToolTip before it appears.</p>
+ *
+ * <p>The sequence of ToolTip events is <code>toolTipStart</code>,
+ * <code>toolTipCreate</code>, <code>toolTipShow</code>,
+ * <code>toolTipShown</code>, <code>toolTipHide</code>,
+ * and <code>toolTipEnd</code>.</p>
+ *
+ * @eventType mx.events.ToolTipEvent.TOOL_TIP_SHOW
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="toolTipShow", type="mx.events.ToolTipEvent")]
+
+/**
+ * Dispatched by the component when its ToolTip has been shown.
+ *
+ * <p>If you specify an effect using the
+ * <code>ToolTipManager.showEffect</code> property,
+ * this event is dispatched after the effect stops playing.</p>
+ *
+ * <p>The sequence of ToolTip events is <code>toolTipStart</code>,
+ * <code>toolTipCreate</code>, <code>toolTipShow</code>,
+ * <code>toolTipShown</code>, <code>toolTipHide</code>,
+ * and <code>toolTipEnd</code>.</p>
+ *
+ * @eventType mx.events.ToolTipEvent.TOOL_TIP_SHOWN
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="toolTipShown", type="mx.events.ToolTipEvent")]
+
+/**
+ * Dispatched by a component whose <code>toolTip</code> property is set,
+ * as soon as the user moves the mouse over it.
+ *
+ * <p>The sequence of ToolTip events is <code>toolTipStart</code>,
+ * <code>toolTipCreate</code>, <code>toolTipShow</code>,
+ * <code>toolTipShown</code>, <code>toolTipHide</code>,
+ * and <code>toolTipEnd</code>.</p>
+ *
+ * @eventType mx.events.ToolTipEvent.TOOL_TIP_START
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Event(name="toolTipStart", type="mx.events.ToolTipEvent")]
+
+//--------------------------------------
+// Styles
+//--------------------------------------
+
+include "../styles/metadata/AnchorStyles.as";
+
+/**
+ * The main color for a component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+[Style(name="chromeColor", type="uint", format="Color", inherit="yes", theme="spark")]
+
+/**
+ * Color of the component highlight when validation fails.
+ * Flex also sets the <code>borderColor</code> style of the component to this
+ * <code>errorColor</code> on a validation failure.
+ *
+ * The default value for the Halo theme is <code>0xFF0000</code>.
+ * The default value for the Spark theme is <code>0xFE0000</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="errorColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ * The primary interaction mode for this component. The acceptable values are:
+ * <code>mouse</code> and <code>touch</code>.
+ *
+ * The default value for the Halo theme is <code>mouse</code>.
+ * The default value for the Spark theme is <code>mouse</code>.
+ * The default value for the Mobile theme is <code>touch</code>.
+ *
+ * @see mx.core.InteractionMode#MOUSE
+ * @see mx.core.InteractionMode#TOUCH
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.5
+ */
+[Style(name="interactionMode", type="String", enumeration="mouse,touch", inherit="yes")]
+
+/**
+ * Blend mode used by the focus rectangle.
+ * For more information, see the <code>blendMode</code> property
+ * of the flash.display.DisplayObject class.
+ *
+ * @default "normal"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="focusBlendMode", type="String", inherit="no")]
+
+/**
+ * Skin used to draw the focus rectangle.
+ *
+ * The default value for Halo components is mx.skins.halo.HaloFocusRect.
+ * The default value for Spark components is spark.skins.spark.FocusSkin.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="focusSkin", type="Class", inherit="no")]
+
+/**
+ * Thickness, in pixels, of the focus rectangle outline.
+ *
+ * @default 2
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="focusThickness", type="Number", format="Length", inherit="no", minValue="0.0")]
+
+/**
+ * Specifies the desired layout direction of a component. The allowed values
+ * are <code>"ltr"</code> for left-to-right layout, used for
+ * components using Latin-style scripts, and <code>"rtl"</code> for
+ * right-to-left layout, used for components using scripts such
+ * as Arabic and Hebrew.
+ *
+ * <p>In ActionScript you can set the layoutDirection using the values
+ * <code>mx.core.LayoutDirection.LTR</code>,
+ * <code>mx.core.LayoutDirection.RTL</code> or
+ * <code>undefined</code>, to inherit the layoutDirection from the parent.</p>
+ *
+ * <p>The layoutDirection should typically be set on the
+ * <code>Application</code> rather than on individual components. If the
+ * layoutDirection is <code>"rtl"</code>, most visual elements, except text
+ * and images, will be mirrored. The directionality of text is determined
+ * by the <code>direction</code> style.</p>
+ *
+ * <p>Components which handle Keyboard.LEFT and Keyboard.RIGHT events
+ * typically swap the key’s meaning when layoutDirection is
+ * <code>“rtl”</code>. In other words, left always means move left and
+ * right always means move right, regardless of the
+ * <code>layoutDirection</code></p>
+ *
+ * <p>Note: This style applies to all Spark components and MX components that
+ * specify UIFTETextField as their textFieldClass.</p>
+ *
+ * @default "ltr"
+ *
+ * @see MXFTEText.css
+ * @see mx.core.ILayoutDirectionElement
+ * @see mx.core.LayoutDirection
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.1
+ */
+[Style(name="layoutDirection", type="String", enumeration="ltr,rtl", inherit="yes")]
+
+/**
+ * Show the error border or skin when this component is invalid
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.5
+ */
+[Style(name="showErrorSkin", type="Boolean", inherit="yes")]
+
+/**
+ * Show the error tip when this component is invalid and the user
+ * rolls over it
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.5
+ */
+[Style(name="showErrorTip", type="Boolean", inherit="yes")]
+
+/**
+ * Theme color of a component. This property controls the appearance of highlights,
+ * appearance when a component is selected, and other similar visual cues, but it
+ * does not have any effect on the regular borders or background colors of the component.
+ * The preferred values are <code>haloGreen</code>, <code>haloBlue</code>,
+ * <code>haloOrange</code>, and <code>haloSilver</code>, although any valid color
+ * value can be used.
+ *
+ * <p>The default values of the <code>rollOverColor</code> and
+ * <code>selectionColor</code> styles are based on the
+ * <code>themeColor</code> value.</p>
+ *
+ * @default "haloBlue"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="themeColor", type="uint", format="Color", inherit="yes", theme="halo")]
+
+//--------------------------------------
+// Effects
+//--------------------------------------
+
+/**
+ * Played when the component is created.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="creationCompleteEffect", event="creationComplete")]
+
+/**
+ * Played when the component is moved.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="moveEffect", event="move")]
+
+/**
+ * Played when the component is resized.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="resizeEffect", event="resize")]
+
+/**
+ * Played when the component becomes visible.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="showEffect", event="show")]
+
+/**
+ * Played when the component becomes invisible.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="hideEffect", event="hide")]
+
+/**
+ * Played when the user presses the mouse button while over the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="mouseDownEffect", event="mouseDown")]
+
+/**
+ * Played when the user releases the mouse button while over the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="mouseUpEffect", event="mouseUp")]
+
+/**
+ * Played when the user rolls the mouse over the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="rollOverEffect", event="rollOver")]
+
+/**
+ * Played when the user rolls the mouse so it is no longer over the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="rollOutEffect", event="rollOut")]
+
+/**
+ * Played when the component gains keyboard focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="focusInEffect", event="focusIn")]
+
+/**
+ * Played when the component loses keyboard focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="focusOutEffect", event="focusOut")]
+
+/**
+ * Played when the component is added as a child to a Container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="addedEffect", event="added")]
+
+/**
+ * Played when the component is removed from a Container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Effect(name="removedEffect", event="removed")]
+
+//--------------------------------------
+// Other metadata
+//--------------------------------------
+
+[AccessibilityClass(implementation="mx.accessibility.UIComponentAccProps")]
+
+[ResourceBundle("core")]
+
+// skins resources aren't found because CSS visited by the compiler
+[ResourceBundle("skins")]
+
+/**
+ * The UIComponent class is the base class for all visual components,
+ * both interactive and noninteractive.
+ *
+ * <p>An interactive component can participate in tabbing and other kinds of
+ * keyboard focus manipulation, accept low-level events like keyboard and
+ * mouse input, and be disabled so that it does not receive keyboard and
+ * mouse input.
+ * This is in contrast to noninteractive components, like Label and
+ * ProgressBar, which simply display contents and are not manipulated by
+ * the user.</p>
+ * <p>The UIComponent class is not used as an MXML tag, but is used as a base
+ * class for other classes.</p>
+ *
+ * @mxml
+ *
+ * <p>All user interface components in Flex extend the UIComponent class.
+ * Flex components inherit the following properties from the UIComponent
+ * class:</p>
+ *
+ * <pre>
+ * <mx:<i>tagname</i>
+ * <b>Properties </b>
+ * accessibilityDescription="null"
+ * accessibilityName="null"
+ * accessibilityShortcut="null"
+ * accessibilitySilent="true|false"
+ * automationName="null"
+ * cachePolicy="auto|on|off"
+ * currentState="null"
+ * doubleClickEnabled="false|true"
+ * enabled="true|false"
+ * explicitHeight="NaN"
+ * explicitMaxHeight="NaN"
+ * explicitMaxWidth="NaN"
+ * explicitMinHeight="NaN"
+ * explicitMinWidth="NaN"
+ * explicitWidth="NaN"
+ * focusEnabled="true|false"
+ * hasFocusableChildren="false|true"
+ * height="0"
+ * id=""
+ * includeInLayout="true|false"
+ * maxHeight="10000"
+ * maxWidth="10000"
+ * measuredHeight=
+ * measuredMinHeight=
+ * measuredMinWidth=
+ * measuredWidth=
+ * minHeight="0"
+ * minWidth="0"
+ * mouseFocusEnabled="true|false"
+ * percentHeight="NaN"
+ * percentWidth="NaN"
+ * scaleX="1.0"
+ * scaleY="1.0"
+ * states="null"
+ * styleName="undefined"
+ * toolTip="null"
+ * transitions=""
+ * validationSubField
+ * width="0"
+ * x="0"
+ * y="0"
+ *
+ * <b>Styles</b>
+ * bottom="undefined"
+ * errorColor="0xFF0000"
+ * focusBlendMode="normal"
+ * focusSkin="HaloFocusRect""
+ * focusThickness="2"
+ * horizontalCenter="undefined"
+ * layoutDirection="ltr"
+ * left="undefined"
+ * right="undefined"
+ * themeColor="haloGreen"
+ * top="undefined"
+ * verticalCenter="undefined"
+ *
+ * <b>Effects</b>
+ * addedEffect="<i>No default</i>"
+ * creationCompleteEffect="<i>No default</i>"
+ * focusInEffect="<i>No default</i>"
+ * focusOutEffect="<i>No default</i>"
+ * hideEffect="<i>No default</i>"
+ * mouseDownEffect="<i>No default</i>"
+ * mouseUpEffect="<i>No default</i>"
+ * moveEffect="<i>No default</i>"
+ * removedEffect="<i>No default</i>"
+ * resizeEffect="<i>No default</i>"
+ * rollOutEffect="<i>No default</i>"
+ * rollOverEffect="<i>No default</i>"
+ * showEffect="<i>No default</i>"
+ *
+ * <b>Events</b>
+ * add="<i>No default</i>"
+ * creationComplete="<i>No default</i>"
+ * currentStateChange="<i>No default</i>"
+ * currentStateChanging="<i>No default</i>"
+ * dragComplete="<i>No default</i>"
+ * dragDrop="<i>No default</i>"
+ * dragEnter="<i>No default</i>"
+ * dragExit="<i>No default</i>"
+ * dragOver="<i>No default</i>"
+ * effectEnd="<i>No default</i>"
+ * effectStart="<i>No default</i>"
+ * enterState="<i>No default</i>"
+ * exitState="<i>No default</i>"
+ * hide="<i>No default</i>"
+ * initialize="<i>No default</i>"
+ * invalid="<i>No default</i>"
+ * mouseDownOutside="<i>No default</i>"
+ * mouseWheelOutside="<i>No default</i>"
+ * move="<i>No default</i>"
+ * preinitialize="<i>No default</i>"
+ * remove="<i>No default</i>"
+ * resize="<i>No default</i>"
+ * show="<i>No default</i>"
+ * toolTipCreate="<i>No default</i>"
+ * toolTipEnd="<i>No default</i>"
+ * toolTipHide="<i>No default</i>"
+ * toolTipShow="<i>No default</i>"
+ * toolTipShown="<i>No default</i>"
+ * toolTipStart="<i>No default</i>"
+ * updateComplete="<i>No default</i>"
+ * valid="<i>No default</i>"
+ * valueCommit="<i>No default</i>"
+ * >
+ * </pre>
+ *
+ * @see mx.core.UIComponent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class UIComponent extends UIBase
+ implements IAutomationObject, IChildList, IConstraintClient,
+ IDeferredInstantiationUIComponent, IFlexDisplayObject, IFlexModule,
+ IInvalidating, ILayoutManagerClient, IPropertyChangeNotifier,
+ IRepeaterClient, IStateClient, IAdvancedStyleClient, IToolTipManagerClient,
+ IUIComponent, IValidatorListener, IVisualElement
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The default value for the <code>measuredWidth</code> property.
+ * Most components calculate a measuredWidth but some are flow-based and
+ * have to pick a number that looks reasonable.
+ *
+ * @default 160
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DEFAULT_MEASURED_WIDTH:Number = 160;
+
+ /**
+ * The default value for the <code>measuredMinWidth</code> property.
+ * Most components calculate a measuredMinWidth but some are flow-based and
+ * have to pick a number that looks reasonable.
+ *
+ * @default 40
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DEFAULT_MEASURED_MIN_WIDTH:Number = 40;
+
+ /**
+ * The default value for the <code>measuredHeight</code> property.
+ * Most components calculate a measuredHeight but some are flow-based and
+ * have to pick a number that looks reasonable.
+ *
+ * @default 22
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DEFAULT_MEASURED_HEIGHT:Number = 22;
+
+ /**
+ * The default value for the <code>measuredMinHeight</code> property.
+ * Most components calculate a measuredMinHeight but some are flow-based and
+ * have to pick a number that looks reasonable.
+ *
+ * @default 22
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DEFAULT_MEASURED_MIN_HEIGHT:Number = 22;
+
+ /**
+ * The default value for the <code>maxWidth</code> property.
+ *
+ * @default 10000
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DEFAULT_MAX_WIDTH:Number = 10000;
+ // When changing this constant, make sure you change
+ // the constant with the same name in LayoutElementUIComponentUtils
+
+ /**
+ * The default value for the <code>maxHeight</code> property.
+ *
+ * @default 10000
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const DEFAULT_MAX_HEIGHT:Number = 10000;
+ // When changing this constant, make sure you change
+ // the constant with the same name in LayoutElementUIComponentUtils
+
+ /**
+ * @private
+ * Static constant representing no cached layout direction style value.
+ */
+ private static const LAYOUT_DIRECTION_CACHE_UNSET:String = "layoutDirectionCacheUnset";
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Class mixins
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Placeholder for mixin by UIComponentAccProps.
+ */
+ mx_internal static var createAccessibilityImplementation:Function;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // embeddedFontRegistry
+ //----------------------------------
+
+ private static var noEmbeddedFonts:Boolean;
+
+ /**
+ * @private
+ * Storage for the _embeddedFontRegistry property.
+ * Note: This gets initialized on first access,
+ * not when this class is initialized, in order to ensure
+ * that the Singleton registry has already been initialized.
+ */
+ private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
+
+ /**
+ * @private
+ * A reference to the embedded font registry.
+ * Single registry in the system.
+ * Used to look up the moduleFactory of a font.
+ */
+ mx_internal static function get embeddedFontRegistry():IEmbeddedFontRegistry
+ {
+ if (!_embeddedFontRegistry && !noEmbeddedFonts)
+ {
+ try
+ {
+ _embeddedFontRegistry = IEmbeddedFontRegistry(
+ Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
+ }
+ catch (e:Error)
+ {
+ noEmbeddedFonts = true;
+ }
+ }
+
+ return _embeddedFontRegistry;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Blocks the background processing of methods
+ * queued by <code>callLater()</code>,
+ * until <code>resumeBackgroundProcessing()</code> is called.
+ *
+ * <p>These methods can be useful when you have time-critical code
+ * which needs to execute without interruption.
+ * For example, when you set the <code>suspendBackgroundProcessing</code>
+ * property of an Effect to <code>true</code>,
+ * <code>suspendBackgroundProcessing()</code> is automatically called
+ * when it starts playing, and <code>resumeBackgroundProcessing</code>
+ * is called when it stops, in order to ensure that the animation
+ * is smooth.</p>
+ *
+ * <p>Since the LayoutManager uses <code>callLater()</code>,
+ * this means that <code>commitProperties()</code>,
+ * <code>measure()</code>, and <code>updateDisplayList()</code>
+ * is not called in between calls to
+ * <code>suspendBackgroundProcessing()</code> and
+ * <code>resumeBackgroundProcessing()</code>.</p>
+ *
+ * <p>It is safe for both an outer method and an inner method
+ * (i.e., one that the outer methods calls) to call
+ * <code>suspendBackgroundProcessing()</code>
+ * and <code>resumeBackgroundProcessing()</code>, because these
+ * methods actually increment and decrement a counter
+ * which determines whether background processing occurs.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function suspendBackgroundProcessing():void
+ {
+ UIComponentGlobals.callLaterSuspendCount++;
+ }
+
+ /**
+ * Resumes the background processing of methods
+ * queued by <code>callLater()</code>, after a call to
+ * <code>suspendBackgroundProcessing()</code>.
+ *
+ * <p>Refer to the description of
+ * <code>suspendBackgroundProcessing()</code> for more information.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function resumeBackgroundProcessing():void
+ {
+ if (UIComponentGlobals.callLaterSuspendCount > 0)
+ {
+ UIComponentGlobals.callLaterSuspendCount--;
+
+ // Once the suspend count gets back to 0, we need to
+ // force a render event to happen
+ if (UIComponentGlobals.callLaterSuspendCount == 0)
+ {
+ var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0];
+ if (sm && sm.topOfDisplayList)
+ sm.topOfDisplayList.invalidate();
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function UIComponent()
+ {
+ super();
+
+ // Override variables in superclasses.
+ focusRect = false; // We do our own focus drawing.
+ // We are tab enabled by default if IFocusManagerComponent
+ tabEnabled = (this is IFocusManagerComponent);
+ tabFocusEnabled = (this is IFocusManagerComponent);
+
+ // Whether the component can accept user interaction.
+ // The default is true. If you set enabled to false for a container,
+ // Flex dims the color of the container and of all of its children,
+ // and blocks user input to the container and to all of its children.
+ // We set enabled to true here because some components keep their
+ // own _enabled flag and may not initialize it to true.
+ enabled = true;
+
+ // Make the component invisible until the initialization sequence
+ // is complete.
+ // It will be set visible when the 'initialized' flag is set.
+ $visible = false;
+
+ addEventListener(flex.events.Event.ADDED, addedHandler);
+ addEventListener(flex.events.Event.REMOVED, removedHandler);
+ addEventListener(flex.events.Event.REMOVED_FROM_STAGE, removedFromStageHandler);
+
+ // Register for focus and keyboard events.
+ if (this is IFocusManagerComponent)
+ {
+ addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
+ addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
+ addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
+ addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
+ }
+
+ resourcesChanged();
+
+ // Register as a weak listener for "change" events from ResourceManager.
+ // If UIComponents registered as a strong listener,
+ // they wouldn't get garbage collected.
+ resourceManager.addEventListener(
+ org.apache.flex.events.Event.CHANGE, resourceManager_changeHandler, false, 0, true);
+
+ _width = super.width;
+ _height = super.height;
+
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Temporarily stores the values of styles specified with setStyle() until
+ * moduleFactory is set.
+ */
+ private var deferredSetStyles:Object;
+
+ /**
+ * @private
+ * There is a bug (139381) where we occasionally get callLaterDispatcher()
+ * even though we didn't expect it.
+ * That causes us to do a removeEventListener() twice,
+ * which messes up some internal thing in the player so that
+ * the next addEventListener() doesn't actually get us the render event.
+ */
+ private var listeningForRender:Boolean = false;
+
+ /**
+ * @private
+ * List of methods used by callLater().
+ */
+ private var methodQueue:Array /* of MethodQueueElement */ = [];
+
+ /**
+ * @private
+ * Whether or not we "own" the focus graphic
+ */
+ private var hasFocusRect:Boolean = false;
+
+ /**
+ * @private
+ * These variables cache the transition state from/to information for
+ * the transition currently running. This information is used when
+ * determining what to do with a new transition that interrupts the
+ * running transition.
+ */
+ private var transitionFromState:String;
+ private var transitionToState:String;
+
+ /**
+ * @private
+ */
+ private var parentChangedFlag:Boolean = false;
+
+ /**
+ * @private
+ * Cached layout direction style
+ */
+ private var layoutDirectionCachedValue:String = LAYOUT_DIRECTION_CACHE_UNSET;
+
+ /**
+ * @private
+ * Whether or not we've processed the MXMLDescriptors
+ */
+ mx_internal var processedMXMLDescriptors:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Event Priority
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // bindingEventDispatcher
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the binding event dispatcher.
+ */
+ private var _bindingEventDispatcher:EventDispatcher;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * Events get dispatched here first
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get bindingEventDispatcher():IEventDispatcher
+ {
+ if (_bindingEventDispatcher == null)
+ _bindingEventDispatcher = new EventDispatcher();
+ return _bindingEventDispatcher;
+ }
+
+ //----------------------------------
+ // effectEventDispatcher
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the effect event dispatcher.
+ */
+ private var _effectEventDispatcher:EventDispatcher;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * Events get dispatched here last
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get effectEventDispatcher():IEventDispatcher
+ {
+ if (_effectEventDispatcher == null)
+ _effectEventDispatcher = new EventDispatcher();
+ return _effectEventDispatcher;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Creation
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // initialized
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the initialized property.
+ */
+ private var _initialized:Boolean = false;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * A flag that determines if an object has been through all three phases
+ * of layout: commitment, measurement, and layout (provided that any were required).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get initialized():Boolean
+ {
+ return _initialized;
+ }
+
+ /**
+ * @private
+ */
+ public function set initialized(value:Boolean):void
+ {
+ _initialized = value;
+
+ if (value)
+ {
+ setVisible(_visible, true);
+ dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE));
+ }
+ }
+
+ //----------------------------------
+ // processedDescriptors
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the processedDescriptors property.
+ */
+ private var _processedDescriptors:Boolean = false;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * Set to <code>true</code> after immediate or deferred child creation,
+ * depending on which one happens. For a Container object, it is set
+ * to <code>true</code> at the end of
+ * the <code>createComponentsFromDescriptors()</code> method,
+ * meaning after the Container object creates its children from its child descriptors.
+ *
+ * <p>For example, if an Accordion container uses deferred instantiation,
+ * the <code>processedDescriptors</code> property for the second pane of
+ * the Accordion container does not become <code>true</code> until after
+ * the user navigates to that pane and the pane creates its children.
+ * But, if the Accordion had set the <code>creationPolicy</code> property
+ * to <code>"all"</code>, the <code>processedDescriptors</code> property
+ * for its second pane is set to <code>true</code> during application startup.</p>
+ *
+ * <p>For classes that are not containers, which do not have descriptors,
+ * it is set to <code>true</code> after the <code>createChildren()</code>
+ * method creates any internal component children.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get processedDescriptors():Boolean
+ {
+ return _processedDescriptors;
+ }
+
+ /**
+ * @private
+ */
+ public function set processedDescriptors(value:Boolean):void
+ {
+ _processedDescriptors = value;
+
+ if (value)
+ dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE));
+ }
+
+ //----------------------------------
+ // updateCompletePendingFlag
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the updateCompletePendingFlag property.
+ */
+ private var _updateCompletePendingFlag:Boolean = false;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * A flag that determines if an object has been through all three phases
+ * of layout validation (provided that any were required).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get updateCompletePendingFlag():Boolean
+ {
+ return _updateCompletePendingFlag;
+ }
+
+ /**
+ * @private
+ */
+ public function set updateCompletePendingFlag(value:Boolean):void
+ {
+ _updateCompletePendingFlag = value;
+ }
+
+ //------------------------------------------------------------------------
+ //
+ // Properties: Accessibility
+ //
+ //------------------------------------------------------------------------
+
+ /**
+ * A convenience accessor for the <code>silent</code> property
+ * in this UIComponent's <code>accessibilityProperties</code> object.
+ *
+ * <p>Note that <code>accessibilityEnabled</code> has the opposite sense from silent;
+ * <code>accessibilityEnabled</code> is <code>true</code>
+ * when <code>silent</code> is <code>false</code>.</p>
+ *
+ * <p>The getter simply returns <code>accessibilityProperties.silent</code>,
+ * or <code>true</code> if <code>accessibilityProperties</code> is null.
+ * The setter first checks whether <code>accessibilityProperties</code> is null,
+ * and if it is, sets it to a new AccessibilityProperties instance.
+ * Then it sets <code>accessibilityProperties.silent</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get accessibilityEnabled():Boolean
+ {
+ return accessibilityProperties ? !accessibilityProperties.silent : true;
+ }
+
+ COMPILE::LATER
+ public function set accessibilityEnabled(value:Boolean):void
+ {
+ if (!Capabilities.hasAccessibility)
+ return;
+
+ if (!accessibilityProperties)
+ accessibilityProperties = new AccessibilityProperties();
+
+ accessibilityProperties.silent = !value;
+ Accessibility.updateProperties();
+ }
+
+ /**
+ * A convenience accessor for the <code>name</code> property
+ * in this UIComponent's <code>accessibilityProperties</code> object.
+ *
+ * <p>The getter simply returns <code>accessibilityProperties.name</code>,
+ * or "" if accessibilityProperties is null.
+ * The setter first checks whether <code>accessibilityProperties</code> is null,
+ * and if it is, sets it to a new AccessibilityProperties instance.
+ * Then it sets <code>accessibilityProperties.name</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get accessibilityName():String
+ {
+ return accessibilityProperties ? accessibilityProperties.name : "";
+ }
+
+ COMPILE::LATER
+ public function set accessibilityName(value:String):void
+ {
+ if (!Capabilities.hasAccessibility)
+ return;
+
+ if (!accessibilityProperties)
+ accessibilityProperties = new AccessibilityProperties();
+
+ accessibilityProperties.name = value;
+ Accessibility.updateProperties();
+ }
+
+ /**
+ * A convenience accessor for the <code>description</code> property
+ * in this UIComponent's <code>accessibilityProperties</code> object.
+ *
+ * <p>The getter simply returns <code>accessibilityProperties.description</code>,
+ * or "" if <code>accessibilityProperties</code> is null.
+ * The setter first checks whether <code>accessibilityProperties</code> is null,
+ * and if it is, sets it to a new AccessibilityProperties instance.
+ * Then it sets <code>accessibilityProperties.description</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get accessibilityDescription():String
+ {
+ return accessibilityProperties ? accessibilityProperties.description : "";
+ }
+
+ COMPILE::LATER
+ public function set accessibilityDescription(value:String):void
+ {
+ if (!Capabilities.hasAccessibility)
+ return;
+
+ if (!accessibilityProperties)
+ accessibilityProperties = new AccessibilityProperties();
+
+ accessibilityProperties.description = value;
+ Accessibility.updateProperties();
+ }
+
+ /**
+ * A convenience accessor for the <code>shortcut</code> property
+ * in this UIComponent's <code>accessibilityProperties</code> object.
+ *
+ * <p>The getter simply returns <code>accessibilityProperties.shortcut</code>,
+ * or "" if <code>accessibilityProperties</code> is null.
+ * The setter first checks whether <code>accessibilityProperties</code> is null,
+ * and if it is, sets it to a new AccessibilityProperties instance.
+ * Then it sets <code>accessibilityProperties.shortcut</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get accessibilityShortcut():String
+ {
+ return accessibilityProperties ? accessibilityProperties.shortcut : "";
+ }
+
+ COMPILE::LATER
+ public function set accessibilityShortcut(value:String):void
+ {
+ if (!Capabilities.hasAccessibility)
+ return;
+
+ if (!accessibilityProperties)
+ accessibilityProperties = new AccessibilityProperties();
+
+ accessibilityProperties.shortcut = value;
+ Accessibility.updateProperties();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Invalidation
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Whether this component needs to have its
+ * commitProperties() method called.
+ */
+ mx_internal var invalidatePropertiesFlag:Boolean = false;
+
+ /**
+ * @private
+ * Whether this component needs to have its
+ * measure() method called.
+ */
+ mx_internal var invalidateSizeFlag:Boolean = false;
+
+ /**
+ * @private
+ * Whether this component needs to be have its
+ * updateDisplayList() method called.
+ */
+ mx_internal var invalidateDisplayListFlag:Boolean = false;
+
+ /**
+ * @private
+ * Whether setActualSize() has been called on this component
+ * at least once. This is used in validateBaselinePosition()
+ * to resize the component to explicit or measured
+ * size if baselinePosition getter is called before the
+ * component has been resized by the layout.
+ */
+ mx_internal var setActualSizeCalled:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Measurement
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Holds the last recorded value of the x property.
+ * Used in dispatching a MoveEvent.
+ */
+ private var oldX:Number = 0;
+
+ /**
+ * @private
+ * Holds the last recorded value of the y property.
+ * Used in dispatching a MoveEvent.
+ */
+ private var oldY:Number = 0;
+
+ /**
+ * @private
+ * Holds the last recorded value of the width property.
+ * Used in dispatching a ResizeEvent.
+ */
+ private var oldWidth:Number = 0;
+
+ /**
+ * @private
+ * Holds the last recorded value of the height property.
+ * Used in dispatching a ResizeEvent.
+ */
+ private var oldHeight:Number = 0;
+
+ /**
+ * @private
+ * Holds the last recorded value of the minWidth property.
+ */
+ private var oldMinWidth:Number;
+
+ /**
+ * @private
+ * Holds the last recorded value of the minHeight property.
+ */
+ private var oldMinHeight:Number;
+
+ /**
+ * @private
+ * Holds the last recorded value of the explicitWidth property.
+ */
+ private var oldExplicitWidth:Number;
+
+ /**
+ * @private
+ * Holds the last recorded value of the explicitHeight property.
+ */
+ private var oldExplicitHeight:Number;
+
+ /**
+ * @private
+ * Holds the last recorded value of the scaleX property.
+ */
+ private var oldScaleX:Number = 1.0;
+
+ /**
+ * @private
+ * Holds the last recorded value of the scaleY property.
+ */
+ private var oldScaleY:Number = 1.0;
+
+ /**
+ * @private
+ * True if createInFontContext has been called.
+ */
+ private var hasFontContextBeenSaved:Boolean = false;
+
+ /**
+ * @private
+ * Holds the last recorded value of the module factory used to create the font.
+ */
+ private var oldEmbeddedFontContext:IFlexModuleFactory = null;
+
+ /**
+ * @private
+ *
+ * storage for advanced layout and transform properties.
+ */
+ COMPILE::LATER
+ mx_internal var _layoutFeatures:AdvancedLayoutFeatures;
+ mx_internal var _layoutFeatures:Object;
+
+ /**
+ * @private
+ *
+ * storage for the modified Transform object that can dispatch change events correctly.
+ */
+ COMPILE::LATER
+ private var _transform:flash.geom.Transform;
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Styles
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var cachedTextFormat:UITextFormat;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Effects
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Sprite used to display an overlay.
+ */
+ mx_internal var effectOverlay:UIComponent;
+
+ /**
+ * @private
+ * Color used for overlay.
+ */
+ mx_internal var effectOverlayColor:uint;
+
+ /**
+ * @private
+ * Counter to keep track of the number of current users
+ * of the overlay.
+ */
+ mx_internal var effectOverlayReferenceCount:int = 0;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Validation
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var saveBorderColor:Boolean = true;
+
+ /**
+ * @private
+ */
+ mx_internal var origBorderColor:Number;
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables: Other
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Storage for automatically-created RadioButtonGroups.
+ * If a RadioButton's groupName isn't the id of a RadioButtonGroup tag,
+ * we automatically create a RadioButtonGroup and store it here as
+ * document.automaticRadioButtonGroups[groupName] = theRadioButtonGroup;
+ */
+ mx_internal var automaticRadioButtonGroups:Object;
+
+ private var _usingBridge:int = -1;
+
+ /**
+ * @private
+ */
+ private function get usingBridge():Boolean
+ {
+ if (_usingBridge == 0) return false;
+ if (_usingBridge == 1) return true;
+
+ if (!_systemManager) return false;
+
+ // no types so no dependencies
+ var mp:Object = _systemManager.getImplementation("mx.managers::IMarshalSystemManager");
+ if (!mp)
+ {
+ _usingBridge = 0;
+ return false;
+ }
+ if (mp.useSWFBridge())
+ {
+ _usingBridge = 1;
+ return true;
+ }
+ _usingBridge = 0;
+ return false;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // owner
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _owner:DisplayObjectContainer;
+
+ /**
+ * @copy mx.core.IVisualElement#owner
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get owner():DisplayObjectContainer
+ {
+ return _owner ? _owner : parent;
+ }
+
+ public function set owner(value:DisplayObjectContainer):void
+ {
+ _owner = value;
+ }
+
+ //----------------------------------
+ // parent
+ //----------------------------------
+
+ /**
+ * @private
+ * Reference to this component's virtual parent container.
+ * "Virtual" means that this parent may not be the same
+ * as the one that the Player returns as the 'parent'
+ * property of a DisplayObject.
+ * For example, if a Container has created a contentPane
+ * to improve scrolling performance,
+ * then its "children" are really its grandchildren
+ * and their "parent" is actually their grandparent,
+ * because we don't want developers to be concerned with
+ * whether a contentPane exists or not.
+ */
+ mx_internal var _parent:DisplayObjectContainer;
+
+ /**
+ * @copy mx.core.IVisualElement#parent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function get parent():DisplayObjectContainer
+ {
+ // Flash PlaceObject tags can have super.parent set
+ // before we get to setting the _parent property.
+ try
+ {
+ return _parent ? _parent : super.parent;
+ }
+ catch (e:SecurityError)
+ {
+ // trace("UIComponent.get parent(): " + e);
+ }
+
+ return null;
+ }
+
+ //----------------------------------
+ // x
+ //----------------------------------
+
+ [Bindable("xChanged")]
+ [Inspectable(category="General")]
+
+ /**
+ * Number that specifies the component's horizontal position,
+ * in pixels, within its parent container.
+ *
+ * <p>Setting this property directly or calling <code>move()</code>
+ * has no effect -- or only a temporary effect -- if the
+ * component is parented by a layout container such as HBox, Grid,
+ * or Form, because the layout calculations of those containers
+ * set the <code>x</code> position to the results of the calculation.
+ * However, the <code>x</code> property must almost always be set
+ * when the parent is a Canvas or other absolute-positioning
+ * container because the default value is 0.</p>
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function get x():Number
+ {
+ return (_layoutFeatures == null) ? super.x : _layoutFeatures.layoutX;
+ }
+
+ /**
+ * @private
+ */
+ override public function set x(value:Number):void
+ {
+ if (x == value)
+ return;
+
+ if (_layoutFeatures == null)
+ {
+ super.x = value;
+ }
+ else
+ {
+ _layoutFeatures.layoutX = value;
+ invalidateTransform();
+ }
+
+ invalidateProperties();
+
+ if (parent && parent is UIComponent)
+ UIComponent(parent).childXYChanged();
+
+ if (hasEventListener("xChanged"))
+ dispatchEvent(new flex.events.Event("xChanged"));
+ }
+
+ [Bindable("zChanged")]
+ [Inspectable(category="General")]
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ override public function get z():Number
+ {
+ return (_layoutFeatures == null) ? super.z : _layoutFeatures.layoutZ;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ override public function set z(value:Number):void
+ {
+ if (z == value)
+ return;
+
+ // validateMatrix when switching between 2D/3D, works around player bug
+ // see sdk-23421
+ var was3D:Boolean = is3D;
+ if (_layoutFeatures == null)
+ initAdvancedLayoutFeatures();
+
+ _layoutFeatures.layoutZ = value;
+ invalidateTransform();
+ invalidateProperties();
+ if (was3D != is3D)
+ validateMatrix();
+
+ if (hasEventListener("zChanged"))
+ dispatchEvent(new flex.events.Event("zChanged"));
+ }
+
+ /**
+ * Sets the x coordinate for the transform center of the component.
+ *
+ * <p>When this component is the target of a Spark transform effect,
+ * you can override this property by setting
+ * the <code>AnimateTransform.autoCenterTransform</code> property.
+ * If <code>autoCenterTransform</code> is <code>false</code>, the transform
+ * center is determined by the <code>transformX</code>,
+ * <code>transformY</code>, and <code>transformZ</code> properties
+ * of the effect target.
+ * If <code>autoCenterTransform</code> is <code>true</code>,
+ * the effect occurs around the center of the target,
+ * <code>(width/2, height/2)</code>.</p>
+ *
+ * <p>Setting this property on the Spark effect class
+ * overrides the setting on the target component.</p>
+ *
+ * @see spark.effects.AnimateTransform#autoCenterTransform
+ * @see spark.effects.AnimateTransform#transformX
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get transformX():Number
+ {
+ return (_layoutFeatures == null) ? 0 : _layoutFeatures.transformX;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ public function set transformX(value:Number):void
+ {
+ if (transformX == value)
+ return;
+ if (_layoutFeatures == null)
+ initAdvancedLayoutFeatures();
+ _layoutFeatures.transformX = value;
+ invalidateTransform();
+ invalidateProperties();
+ invalidateParentSizeAndDisplayList();
+ }
+
+ /**
+ * Sets the y coordinate for the transform center of the component.
+ *
+ * <p>When this component is the target of a Spark transform effect,
+ * you can override this property by setting
+ * the <code>AnimateTransform.autoCenterTransform</code> property.
+ * If <code>autoCenterTransform</code> is <code>false</code>, the transform
+ * center is determined by the <code>transformX</code>,
+ * <code>transformY</code>, and <code>transformZ</code> properties
+ * of the effect target.
+ * If <code>autoCenterTransform</code> is <code>true</code>,
+ * the effect occurs around the center of the target,
+ * <code>(width/2, height/2)</code>.</p>
+ *
+ * <p>Seeting this property on the Spark effect class
+ * overrides the setting on the target component.</p>
+ *
+ * @see spark.effects.AnimateTransform#autoCenterTransform
+ * @see spark.effects.AnimateTransform#transformY
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get transformY():Number
+ {
+ return (_layoutFeatures == null) ? 0 : _layoutFeatures.transformY;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ public function set transformY(value:Number):void
+ {
+ if (transformY == value)
+ return;
+ if (_layoutFeatures == null)
+ initAdvancedLayoutFeatures();
+ _layoutFeatures.transformY = value;
+ invalidateTransform();
+ invalidateProperties();
+ invalidateParentSizeAndDisplayList();
+ }
+
+ /**
+ * Sets the z coordinate for the transform center of the component.
+ *
+ * <p>When this component is the target of a Spark transform effect,
+ * you can override this property by setting
+ * the <code>AnimateTransform.autoCenterTransform</code> property.
+ * If <code>autoCenterTransform</code> is <code>false</code>, the transform
+ * center is determined by the <code>transformX</code>,
+ * <code>transformY</code>, and <code>transformZ</code> properties
+ * of the effect target.
+ * If <code>autoCenterTransform</code> is <code>true</code>,
+ * the effect occurs around the center of the target,
+ * <code>(width/2, height/2)</code>.</p>
+ *
+ * <p>Seeting this property on the Spark effect class
+ * overrides the setting on the target component.</p>
+ *
+ * @see spark.effects.AnimateTransform#autoCenterTransform
+ * @see spark.effects.AnimateTransform#transformZ
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ public function get transformZ():Number
+ {
+ return (_layoutFeatures == null) ? 0 : _layoutFeatures.transformZ;
+ }
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ public function set transformZ(value:Number):void
+ {
+ if (transformZ == value)
+ return;
+ if (_layoutFeatures == null)
+ initAdvancedLayoutFeatures();
+
+ _layoutFeatures.transformZ = value;
+ invalidateTransform();
+ invalidateProperties();
+ invalidateParentSizeAndDisplayL
<TRUNCATED>