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 2015/04/15 23:43:57 UTC
[52/55] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - build
scripts work, examples all compile, DataBindingTest and FlexStore run
build scripts work, examples all compile, DataBindingTest and FlexStore run
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/379e517c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/379e517c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/379e517c
Branch: refs/heads/develop
Commit: 379e517c9492246493a87ae1e9a2ce9ceb9938ea
Parents: 13e8b44
Author: Alex Harui <ah...@apache.org>
Authored: Wed Apr 15 14:26:06 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Apr 15 14:26:06 2015 -0700
----------------------------------------------------------------------
build.xml | 4 +-
.../FlexJSStore/src/ProductJSONItemConverter.as | 2 +-
examples/FlexJSStore/src/ProductsView.mxml | 2 +-
.../src/productsView/ProductCatalogPanel.mxml | 2 +-
examples/build_example.xml | 16 +-
frameworks/as/projects/MXMLCClasses/build.xml | 4 +-
frameworks/build.xml | 38 ++
frameworks/projects/Binding/build.xml | 69 ++++
.../projects/Binding/compile-asjs-config.xml | 70 ++++
.../apache/flex/binding/ViewBaseDataBinding.js | 345 +++++++++++++++++++
frameworks/projects/Charts/build.xml | 70 ++++
.../projects/Charts/compile-asjs-config.xml | 72 ++++
frameworks/projects/Collections/build.xml | 54 +++
.../Collections/compile-asjs-config.xml | 70 ++++
.../apache/flex/collections/LazyCollection.js | 163 +++++++++
.../collections/converters/JSONItemConverter.js | 48 +++
.../flex/collections/parsers/JSONInputParser.js | 48 +++
frameworks/projects/Core/build.xml | 70 ++++
.../projects/Core/compile-asjs-config.xml | 72 ++++
.../js/src/org/apache/flex/core/FormatBase.js | 126 -------
.../org/apache/flex/core/ViewBaseDataBinding.js | 345 -------------------
.../src/org/apache/flex/core/graphics/Circle.js | 101 ------
.../org/apache/flex/core/graphics/Ellipse.js | 80 -----
.../apache/flex/core/graphics/GradientBase.js | 141 --------
.../apache/flex/core/graphics/GradientEntry.js | 126 -------
.../apache/flex/core/graphics/GraphicShape.js | 204 -----------
.../flex/core/graphics/GraphicsContainer.js | 232 -------------
.../src/org/apache/flex/core/graphics/IFill.js | 52 ---
.../org/apache/flex/core/graphics/IStroke.js | 52 ---
.../src/org/apache/flex/core/graphics/Line.js | 79 -----
.../apache/flex/core/graphics/LinearGradient.js | 125 -------
.../src/org/apache/flex/core/graphics/Path.js | 101 ------
.../src/org/apache/flex/core/graphics/Rect.js | 80 -----
.../org/apache/flex/core/graphics/SolidColor.js | 92 -----
.../flex/core/graphics/SolidColorStroke.js | 109 ------
.../src/org/apache/flex/core/graphics/Text.js | 70 ----
.../js/src/org/apache/flex/events/DragEvent.js | 146 --------
frameworks/projects/CreateJS/build.xml | 54 +++
.../DragDrop/asjs/src/DragDropASJSClasses.as | 3 +-
frameworks/projects/DragDrop/build.xml | 79 ++++-
.../projects/DragDrop/compile-asjs-config.xml | 70 ++++
.../js/src/org/apache/flex/events/DragEvent.js | 146 ++++++++
.../Effects/asjs/src/EffectsASJSClasses.as | 1 +
frameworks/projects/Effects/build.xml | 76 +++-
.../projects/Effects/compile-asjs-config.xml | 70 ++++
frameworks/projects/Formatters/build.xml | 76 +++-
.../projects/Formatters/compile-asjs-config.xml | 71 ++++
.../js/src/org/apache/flex/core/FormatBase.js | 126 +++++++
frameworks/projects/GoogleMaps/build.xml | 59 +++-
frameworks/projects/Graphics/build.xml | 60 +++-
.../src/org/apache/flex/core/graphics/Circle.js | 101 ++++++
.../org/apache/flex/core/graphics/Ellipse.js | 80 +++++
.../apache/flex/core/graphics/GradientBase.js | 141 ++++++++
.../apache/flex/core/graphics/GradientEntry.js | 126 +++++++
.../apache/flex/core/graphics/GraphicShape.js | 204 +++++++++++
.../flex/core/graphics/GraphicsContainer.js | 232 +++++++++++++
.../src/org/apache/flex/core/graphics/IFill.js | 52 +++
.../org/apache/flex/core/graphics/IStroke.js | 52 +++
.../src/org/apache/flex/core/graphics/Line.js | 79 +++++
.../apache/flex/core/graphics/LinearGradient.js | 125 +++++++
.../src/org/apache/flex/core/graphics/Path.js | 101 ++++++
.../src/org/apache/flex/core/graphics/Rect.js | 80 +++++
.../org/apache/flex/core/graphics/SolidColor.js | 92 +++++
.../flex/core/graphics/SolidColorStroke.js | 109 ++++++
.../src/org/apache/flex/core/graphics/Text.js | 70 ++++
frameworks/projects/HTML/build.xml | 76 +++-
.../projects/HTML/compile-asjs-config.xml | 72 ++++
.../DataItemRendererFactoryForArrayData.js | 2 +-
frameworks/projects/HTML5/build.xml | 60 +++-
frameworks/projects/JQuery/build.xml | 59 +++-
frameworks/projects/Mobile/build.xml | 75 +++-
.../projects/Mobile/compile-asjs-config.xml | 71 ++++
frameworks/projects/Network/build.xml | 60 +++-
.../src/org/apache/flex/net/JSONInputParser.js | 48 ---
.../org/apache/flex/net/JSONItemConverter.js | 48 ---
.../flex/net/dataConverters/LazyCollection.js | 163 ---------
76 files changed, 4187 insertions(+), 2562 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index dd3f0f1..3fcd81b 100644
--- a/build.xml
+++ b/build.xml
@@ -412,13 +412,13 @@
<target name="frameworks-js-jenkins" description="Full check of all JavaScript framework files, using gsjlint and jshint">
<property name="no.lint" value="true" />
- <ant dir="${basedir}/frameworks/js">
+ <ant dir="${basedir}/frameworks" target="js">
<property name="locale" value="${locale}"/>
</ant>
</target>
<target name="frameworks-js" description="Full check of all JavaScript framework files, using gsjlint and jshint">
- <ant dir="${basedir}/frameworks/js">
+ <ant dir="${basedir}/frameworks" target="js">
<property name="locale" value="${locale}"/>
</ant>
</target>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/examples/FlexJSStore/src/ProductJSONItemConverter.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/ProductJSONItemConverter.as b/examples/FlexJSStore/src/ProductJSONItemConverter.as
index 4d44ecf..cb27bde 100755
--- a/examples/FlexJSStore/src/ProductJSONItemConverter.as
+++ b/examples/FlexJSStore/src/ProductJSONItemConverter.as
@@ -18,7 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package
{
- import org.apache.flex.net.JSONItemConverter;
+ import org.apache.flex.collections.converters.JSONItemConverter;
import samples.flexstore.Product;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/examples/FlexJSStore/src/ProductsView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/ProductsView.mxml b/examples/FlexJSStore/src/ProductsView.mxml
index 8f9ec9a..46605a6 100755
--- a/examples/FlexJSStore/src/ProductsView.mxml
+++ b/examples/FlexJSStore/src/ProductsView.mxml
@@ -31,7 +31,7 @@ limitations under the License.
<fx:Script>
<![CDATA[
import org.apache.flex.events.Event;
- import org.apache.flex.net.dataConverters.LazyCollection;
+ import org.apache.flex.collections.LazyCollection;
import samples.flexstore.Product;
private var _catalog:LazyCollection;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml b/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
index 6879199..ad46206 100755
--- a/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
+++ b/examples/FlexJSStore/src/productsView/ProductCatalogPanel.mxml
@@ -45,7 +45,7 @@ limitations under the License.
import org.apache.flex.effects.Tween;
import org.apache.flex.events.DragEvent;
import org.apache.flex.events.Event;
- import org.apache.flex.net.dataConverters.LazyCollection;
+ import org.apache.flex.collections.LazyCollection;
import samples.flexstore.Product;
import samples.flexstore.ProductFilter;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/examples/build_example.xml
----------------------------------------------------------------------
diff --git a/examples/build_example.xml b/examples/build_example.xml
index 2e2cc7d..c3ab330 100644
--- a/examples/build_example.xml
+++ b/examples/build_example.xml
@@ -154,10 +154,9 @@
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="-js-output-type=FLEXJS" />
<arg value="-closure-lib=${GOOG_HOME}" />
- <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src" />
<arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
- <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src/jquery_externals.js" />
- <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src/createjs_externals.js" />
+ <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs/jquery_externals.js" />
+ <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs/createjs_externals.js" />
<arg value="${basedir}/src/${example}.mxml" />
</java>
<fail>
@@ -193,10 +192,9 @@
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="-js-output-type=FLEXJS" />
<arg value="-closure-lib=${GOOG_HOME}" />
- <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src" />
<arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
- <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src/jquery_externals.js" />
- <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src/createjs_externals.js" />
+ <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs/jquery_externals.js" />
+ <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs/createjs_externals.js" />
<arg value="${basedir}/src/${example}.mxml" />
</java>
<fail>
@@ -233,9 +231,9 @@
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="-js-output-type=FLEXJS" />
<arg value="-closure-lib=${GOOG_HOME}" />
- <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src" />
- <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src/jquery_externals.js" />
- <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/src/createjs_externals.js" />
+ <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs/jquery_externals.js" />
+ <arg value="-external-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs/createjs_externals.js" />
<arg value="${basedir}/src/${example}.as" />
</java>
<fail>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/as/projects/MXMLCClasses/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/MXMLCClasses/build.xml b/frameworks/as/projects/MXMLCClasses/build.xml
index c8d4377..faa85b3 100644
--- a/frameworks/as/projects/MXMLCClasses/build.xml
+++ b/frameworks/as/projects/MXMLCClasses/build.xml
@@ -33,7 +33,7 @@
<target name="clean">
<delete failonerror="false">
- <fileset dir="${FLEXJS_HOME}/frameworks/as/libs">
+ <fileset dir="${FLEXJS_HOME}/frameworks/libs">
<include name="MXMLCClasses.swc"/>
</fileset>
</delete>
@@ -64,7 +64,7 @@
into the file bundles.properties in this directory.
-->
<compc fork="true"
- output="${FLEXJS_HOME}/frameworks/as/libs/MXMLCClasses.swc">
+ output="${FLEXJS_HOME}/frameworks/libs/MXMLCClasses.swc">
<jvmarg line="${compc.jvm.args}"/>
<load-config filename="compile-config.xml" />
<arg value="+playerglobal.version=${playerglobal.version}" />
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index d117ce5..dcfbcc2 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -94,6 +94,44 @@
<antcall target="Network"/>
</target>
+ <target name="compile-asjs" description="Cross-compiles all SWCs">
+ <ant dir="${basedir}/projects/Binding" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Charts" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Collections" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Core" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/CreateJS" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/DragDrop" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Effects" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Formatters" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/GoogleMaps" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Graphics" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/HTML" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/HTML5" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/JQuery" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Mobile" target="compile-asjs"/>
+ <ant dir="${basedir}/projects/Network" target="compile-asjs"/>
+ </target>
+
+ <target name="lint-js" description="Cross-compiles all SWCs">
+ <ant dir="${basedir}/projects/Binding" target="lint-js"/>
+ <ant dir="${basedir}/projects/Charts" target="lint-js"/>
+ <ant dir="${basedir}/projects/Collections" target="lint-js"/>
+ <ant dir="${basedir}/projects/Core" target="lint-js"/>
+ <ant dir="${basedir}/projects/CreateJS" target="lint-js"/>
+ <ant dir="${basedir}/projects/DragDrop" target="lint-js"/>
+ <ant dir="${basedir}/projects/Effects" target="lint-js"/>
+ <ant dir="${basedir}/projects/Formatters" target="lint-js"/>
+ <ant dir="${basedir}/projects/GoogleMaps" target="lint-js"/>
+ <ant dir="${basedir}/projects/Graphics" target="lint-js"/>
+ <ant dir="${basedir}/projects/HTML" target="lint-js"/>
+ <ant dir="${basedir}/projects/HTML5" target="lint-js"/>
+ <ant dir="${basedir}/projects/JQuery" target="lint-js"/>
+ <ant dir="${basedir}/projects/Mobile" target="lint-js"/>
+ <ant dir="${basedir}/projects/Network" target="lint-js"/>
+ </target>
+
+ <target name="js" depends="compile-asjs, lint-js" />
+
<target name="other.locales" description ="Builds resource SWCs for all locales">
<!--<ant dir="${basedir}/projects/FlexJSUI" target="other.locales"/>-->
</target>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Binding/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/build.xml b/frameworks/projects/Binding/build.xml
index f33faad..5b3a23a 100644
--- a/frameworks/projects/Binding/build.xml
+++ b/frameworks/projects/Binding/build.xml
@@ -27,16 +27,31 @@
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
<property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="gjslint" value="gjslint" />
+ <property name="jshint" value="jshint" />
+ <condition property="no.lint" value="true">
+ <os family="windows"/>
+ </condition>
<target name="main" depends="clean,compile,test" description="Clean build of Binding.swc">
</target>
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Binding.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">
@@ -78,4 +93,58 @@
</compc>
</target>
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling Binding/asjs"/>
+ <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
+ <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <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=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <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}" />
+ </java>
+ </target>
+
+ <target name="lint-js" depends="gjslint, jshint, copy-js" />
+ <target name="copy-js" >
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <fileset dir="${basedir}/js/src">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="gjslint" unless="no.lint">
+ <echo>running gjslint</echo>
+ <exec executable="${gjslint}" dir="${basedir}" failonerror="true">
+ <arg value="--strict" />
+ <arg value="--disable" />
+ <arg value="006,100,214,300" />
+ <!-- 006: wrong indentation -->
+ <!-- 100: cannot have non-primitive value -->
+ <!-- 214: @fileoverview tag missing description -->
+ <!-- 300: missing newline at end of file -->
+ <arg value="--max_line_length" />
+ <arg value="120" />
+ <arg value="-r" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
+ <target name="jshint" unless="no.lint">
+ <echo>running jshint</echo>
+ <exec executable="${jshint}" dir="${basedir}" failonerror="true">
+ <arg value="--config" />
+ <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Binding/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/compile-asjs-config.xml b/frameworks/projects/Binding/compile-asjs-config.xml
new file mode 100644
index 0000000..7cfc23c
--- /dev/null
+++ b/frameworks/projects/Binding/compile-asjs-config.xml
@@ -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.
+
+-->
+<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>
+ <path-element>../../libs/Binding.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/>
+
+ <source-path>
+ <path-element>asjs/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ <path-element>asjs/src</path-element>
+ </include-sources>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Binding/js/src/org/apache/flex/binding/ViewBaseDataBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/js/src/org/apache/flex/binding/ViewBaseDataBinding.js b/frameworks/projects/Binding/js/src/org/apache/flex/binding/ViewBaseDataBinding.js
new file mode 100644
index 0000000..b5428a6
--- /dev/null
+++ b/frameworks/projects/Binding/js/src/org/apache/flex/binding/ViewBaseDataBinding.js
@@ -0,0 +1,345 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org_apache_flex_binding_ViewBaseDataBinding');
+
+goog.require('org_apache_flex_binding_ConstantBinding');
+goog.require('org_apache_flex_binding_GenericBinding');
+goog.require('org_apache_flex_binding_PropertyWatcher');
+goog.require('org_apache_flex_binding_SimpleBinding');
+goog.require('org_apache_flex_events_Event');
+goog.require('org_apache_flex_events_ValueChangeEvent');
+
+
+
+/**
+ * @constructor
+ */
+org_apache_flex_binding_ViewBaseDataBinding = function() {
+
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.strand_ = null;
+
+ /**
+ * @protected
+ * @type {Object}
+ */
+ this.deferredBindings = {};
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_binding_ViewBaseDataBinding.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'ViewBaseDataBinding',
+ qName: 'org_apache_flex_binding_ViewBaseDataBinding'}] };
+
+
+Object.defineProperties(org_apache_flex_binding_ViewBaseDataBinding.prototype, {
+ /** @expose */
+ strand: {
+ /** @this {org_apache_flex_binding_ViewBaseDataBinding} */
+ set: function(value) {
+ if (this.strand_ !== value) {
+ this.strand_ = value;
+ this.strand_.addEventListener('initComplete',
+ goog.bind(this.initCompleteHandler, this));
+ }
+ }
+ }
+});
+
+
+/**
+ * @protected
+ * @param {Object} event The event.
+ */
+org_apache_flex_binding_ViewBaseDataBinding.prototype.initCompleteHandler =
+ function(event) {
+
+ var prop;
+ var fieldWatcher;
+ var sb;
+ var bindingData = this.strand_._bindings;
+ var n = bindingData[0];
+ var bindings = [];
+ var i;
+ var binding;
+ var destination;
+ var index = 1;
+ for (i = 0; i < n; i++)
+ {
+ binding = {};
+ binding.source = bindingData[index++];
+ binding.destFunc = bindingData[index++];
+ binding.destination = bindingData[index++];
+ bindings.push(binding);
+ }
+ var watchers = this.decodeWatcher(bindingData.slice(index));
+ for (i = 0; i < n; i++)
+ {
+ binding = bindings[i];
+ // try to determine if it is an array
+ if (typeof(binding.source) == 'object' &&
+ typeof(binding.source.slice) == 'function')
+ {
+ if (binding.source[0] == 'applicationModel')
+ {
+ if (binding.source.length == 2 &&
+ binding.destination.length == 2)
+ {
+ // can be simplebinding or constantbinding
+ var modelWatcher =
+ watchers.watcherMap.applicationModel;
+ var childMap = modelWatcher.children.watcherMap;
+ fieldWatcher = childMap[binding.source[1]];
+ if (typeof(fieldWatcher.eventNames) == 'string')
+ {
+ sb = new org_apache_flex_binding_SimpleBinding();
+ sb.destinationPropertyName =
+ binding.destination[1];
+ sb.eventName = fieldWatcher.eventNames;
+ sb.sourceID = binding.source[0];
+ sb.sourcePropertyName = binding.source[1];
+ sb.setDocument(this.strand_);
+ prop = binding.destination[0];
+
+ destination = this.strand_[prop];
+
+ if (destination)
+ destination.addBead(sb);
+ else
+ {
+ this.deferredBindings[prop] =
+ sb;
+ this.strand_.addEventListener('valueChange',
+ goog.bind(this.deferredBindingsHandler, this));
+ }
+ }
+ else if (fieldWatcher.eventNames == null)
+ {
+ var cb;
+ cb = org_apache_flex_binding_ConstantBinding;
+ cb = new cb();
+ cb.destinationPropertyName =
+ binding.destination[1];
+ cb.sourceID = binding.source[0];
+ cb.sourcePropertyName = binding.source[1];
+ cb.setDocument(this.strand_);
+ prop = binding.destination[0];
+ destination = this.strand_[prop];
+
+ if (destination)
+ destination.addBead(cb);
+ else
+ {
+ this.deferredBindings[prop] =
+ cb;
+ this.strand_.addEventListener('valueChange',
+ this.deferredBindingsHandler);
+ }
+ }
+ }
+ }
+ }
+ else if (typeof(binding.source) == 'string')
+ {
+ fieldWatcher = watchers.watcherMap[binding.source];
+ if (typeof(fieldWatcher.eventNames) == 'string')
+ {
+ sb = new org_apache_flex_binding_SimpleBinding();
+ sb.destinationPropertyName = binding.destination[1];
+ sb.eventName = fieldWatcher.eventNames;
+ sb.sourcePropertyName = binding.source;
+ sb.setDocument(this.strand_);
+ prop = binding.destination[0];
+ destination = this.strand_[prop];
+
+ if (destination)
+ destination.addBead(sb);
+ else
+ {
+ this.deferredBindings[prop] = sb;
+ this.strand_.addEventListener('valueChange',
+ this.deferredBindingsHandler);
+ }
+ }
+ }
+ else
+ {
+ this.makeGenericBinding(binding, i, watchers);
+ }
+ }
+};
+
+
+/**
+ * @protected
+ * @param {Object} binding The binding object.
+ * @param {number} index The offset in the Binding database.
+ * @param {Object} watchers The database of Watchers.
+ */
+org_apache_flex_binding_ViewBaseDataBinding.prototype.makeGenericBinding =
+ function(binding, index, watchers) {
+ var gb = new org_apache_flex_binding_GenericBinding();
+ gb.setDocument(this.strand_);
+ gb.destinationData = binding.destination;
+ gb.destinationFunction = binding.destFunc;
+ gb.source = binding.source;
+ this.setupWatchers(gb, index, watchers.watchers, null);
+};
+
+
+/**
+ * @protected
+ * @param {Object} gb The generic binding object.
+ * @param {number} index The offset in the Binding database.
+ * @param {Object} watchers The array of Watchers.
+ * @param {Object} parentWatcher The parent Watcher or null if top.
+ */
+org_apache_flex_binding_ViewBaseDataBinding.prototype.setupWatchers =
+ function(gb, index, watchers, parentWatcher) {
+ var i, n;
+ n = watchers.length;
+ for (i = 0; i < n; i++)
+ {
+ var watcher = watchers[i];
+ if (watcher.bindings.indexOf(index) != -1)
+ {
+ var type = watcher.type;
+ switch (type)
+ {
+ case 'property':
+ {
+ var pw = new org_apache_flex_binding_PropertyWatcher(
+ this,
+ watcher.propertyName,
+ watcher.eventNames,
+ watcher.getterFunction);
+ watcher.watcher = pw;
+ if (parentWatcher)
+ pw.parentChanged(parentWatcher.value);
+ else
+ pw.parentChanged(this.strand_);
+ if (parentWatcher)
+ parentWatcher.addChild(pw);
+ if (watcher.children == null)
+ pw.addBinding(gb);
+ break;
+ }
+ }
+ if (watcher.children)
+ {
+ this.setupWatchers(gb, index, watcher.children,
+ watcher.watcher);
+ }
+ }
+ }
+};
+
+
+/**
+ * @protected
+ * @param {Object} bindingData The watcher data to decode.
+ * @return {Object} The watcher tree structure.
+ */
+org_apache_flex_binding_ViewBaseDataBinding.prototype.decodeWatcher =
+ function(bindingData) {
+ var watcherMap = {};
+ var watchers = [];
+ var n = bindingData.length - 1; // there is an extra null because
+ // it is easier for the compiler
+ var index = 0;
+ var watcherData;
+ while (index < n)
+ {
+ var watcherIndex = bindingData[index++];
+ var type = bindingData[index++];
+ switch (type)
+ {
+ case 0:
+ {
+ watcherData = { type: 'function' };
+ watcherData.functionName = bindingData[index++];
+ watcherData.paramFunction = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ break;
+ }
+ case 1:
+ {
+ watcherData = { type: 'static' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherData.getterFunction = bindingData[index++];
+ watcherData.parentObj = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
+ case 2:
+ {
+ watcherData = { type: 'property' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherData.getterFunction = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
+ case 3:
+ {
+ watcherData = { type: 'xml' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
+ }
+ watcherData.children = bindingData[index++];
+ if (watcherData.children != null)
+ {
+ watcherData.children = this.decodeWatcher(watcherData.children);
+ }
+ watcherData.index = watcherIndex;
+ watchers.push(watcherData);
+ }
+ return { watchers: watchers, watcherMap: watcherMap };
+};
+
+
+/**
+ * @protected
+ * @param {org_apache_flex_events_ValueChangeEvent} event The event.
+ */
+org_apache_flex_binding_ViewBaseDataBinding.prototype.deferredBindingsHandler =
+ function(event) {
+ var p;
+ var destination;
+ for (p in this.deferredBindings)
+ {
+ if (p != event.propertyName) continue;
+ destination = this.strand_[p];
+ destination.addBead(this.deferredBindings[p]);
+ delete this.deferredBindings[p];
+ }
+};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Charts/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/build.xml b/frameworks/projects/Charts/build.xml
index 7d90350..034c929 100644
--- a/frameworks/projects/Charts/build.xml
+++ b/frameworks/projects/Charts/build.xml
@@ -27,16 +27,31 @@
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
<property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="gjslint" value="gjslint" />
+ <property name="jshint" value="jshint" />
+ <condition property="no.lint" value="true">
+ <os family="windows"/>
+ </condition>
<target name="main" depends="clean,compile,test" description="Clean build of Charts.swc">
</target>
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Charts.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">
@@ -78,4 +93,59 @@
</compc>
</target>
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling Charts/asjs"/>
+ <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
+ <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <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=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <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}" />
+ </java>
+ </target>
+
+ <target name="lint-js" depends="gjslint, jshint, copy-js" />
+ <target name="copy-js" >
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <fileset dir="${basedir}/js/src">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="gjslint" unless="no.lint">
+ <echo>running gjslint</echo>
+ <exec executable="${gjslint}" dir="${basedir}" failonerror="true">
+ <arg value="--strict" />
+ <arg value="--disable" />
+ <arg value="006,100,214,300" />
+ <!-- 006: wrong indentation -->
+ <!-- 100: cannot have non-primitive value -->
+ <!-- 214: @fileoverview tag missing description -->
+ <!-- 300: missing newline at end of file -->
+ <arg value="--max_line_length" />
+ <arg value="120" />
+ <arg value="-r" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
+ <target name="jshint" unless="no.lint">
+ <echo>running jshint</echo>
+ <exec executable="${jshint}" dir="${basedir}" failonerror="true">
+ <arg value="--config" />
+ <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Charts/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/compile-asjs-config.xml b/frameworks/projects/Charts/compile-asjs-config.xml
new file mode 100644
index 0000000..a89e04b
--- /dev/null
+++ b/frameworks/projects/Charts/compile-asjs-config.xml
@@ -0,0 +1,72 @@
+<!--
+
+ 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>
+ <path-element>../../libs/Graphics.swc</path-element>
+ <path-element>../../libs/HTML.swc</path-element>
+ <path-element>../../libs/Charts.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/>
+
+ <source-path>
+ <path-element>asjs/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ <path-element>asjs/src</path-element>
+ </include-sources>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Collections/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Collections/build.xml b/frameworks/projects/Collections/build.xml
index 394b4ed..9bef9c4 100644
--- a/frameworks/projects/Collections/build.xml
+++ b/frameworks/projects/Collections/build.xml
@@ -27,16 +27,31 @@
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
<property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="gjslint" value="gjslint" />
+ <property name="jshint" value="jshint" />
+ <condition property="no.lint" value="true">
+ <os family="windows"/>
+ </condition>
<target name="main" depends="clean,compile,test" description="Clean build of Collections.swc">
</target>
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Binding.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">
@@ -78,4 +93,43 @@
</compc>
</target>
+ <target name="compile-asjs" >
+ <!-- nothing to cross-compile yet -->
+ </target>
+
+ <target name="lint-js" depends="gjslint, jshint, copy-js" />
+ <target name="copy-js" >
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <fileset dir="${basedir}/js/src">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="gjslint" unless="no.lint">
+ <echo>running gjslint</echo>
+ <exec executable="${gjslint}" dir="${basedir}" failonerror="true">
+ <arg value="--strict" />
+ <arg value="--disable" />
+ <arg value="006,100,214,300" />
+ <!-- 006: wrong indentation -->
+ <!-- 100: cannot have non-primitive value -->
+ <!-- 214: @fileoverview tag missing description -->
+ <!-- 300: missing newline at end of file -->
+ <arg value="--max_line_length" />
+ <arg value="120" />
+ <arg value="-r" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
+ <target name="jshint" unless="no.lint">
+ <echo>running jshint</echo>
+ <exec executable="${jshint}" dir="${basedir}" failonerror="true">
+ <arg value="--config" />
+ <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Collections/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Collections/compile-asjs-config.xml b/frameworks/projects/Collections/compile-asjs-config.xml
new file mode 100644
index 0000000..d1a80df
--- /dev/null
+++ b/frameworks/projects/Collections/compile-asjs-config.xml
@@ -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.
+
+-->
+<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>
+ <path-element>../../libs/Collections.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/>
+
+ <source-path>
+ <path-element>asjs/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ <path-element>asjs/src</path-element>
+ </include-sources>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Collections/js/src/org/apache/flex/collections/LazyCollection.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Collections/js/src/org/apache/flex/collections/LazyCollection.js b/frameworks/projects/Collections/js/src/org/apache/flex/collections/LazyCollection.js
new file mode 100644
index 0000000..891c4a3
--- /dev/null
+++ b/frameworks/projects/Collections/js/src/org/apache/flex/collections/LazyCollection.js
@@ -0,0 +1,163 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org_apache_flex_collections_LazyCollection');
+
+goog.require('org_apache_flex_events_EventDispatcher');
+goog.require('org_apache_flex_events_IEventDispatcher');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_events_EventDispatcher}
+ */
+org_apache_flex_collections_LazyCollection = function() {
+ org_apache_flex_collections_LazyCollection.base(this, 'constructor');
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.data_ = null;
+
+ /**
+ * @private
+ * @type {Object}
+ */
+
+ this.itemConverter_ = null;
+
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.inputParser_ = null;
+
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.rawData_ = null;
+
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.strand_ = null;
+};
+goog.inherits(org_apache_flex_collections_LazyCollection, org_apache_flex_events_EventDispatcher);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_collections_LazyCollection.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'LazyCollection',
+ qName: 'org_apache_flex_collections_LazyCollection'}],
+ interfaces: [org_apache_flex_events_IEventDispatcher]};
+
+
+Object.defineProperties(org_apache_flex_collections_LazyCollection.prototype, {
+ /** @expose */
+ strand: {
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ set: function(value) {
+ if (this.strand_ !== value) {
+ this.strand_ = value;
+ this.strand_.addEventListener('complete',
+ goog.bind(this.completeHandler, this));
+ }
+ }
+ },
+ /** @expose */
+ length: {
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ get: function() {
+ return this.rawData_ ? this.rawData_.length : 0;
+ }
+ },
+ /** @expose */
+ inputParser: {
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ get: function() {
+ return this.inputParser_;
+ },
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ set: function(value) {
+ this.inputParser_ = value;
+ }
+ },
+ /** @expose */
+ itemConverter: {
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ get: function() {
+ return this.itemConverter_;
+ },
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ set: function(value) {
+ this.itemConverter_ = value;
+ }
+ },
+ /** @expose */
+ id: {
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ get: function() {
+ return this.id_;
+ },
+ /** @this {org_apache_flex_collections_LazyCollection} */
+ set: function(value) {
+ if (this.id_ !== value) {
+ this.id_ = value;
+ // this.dispatchEvent(new Event('idChanged'));
+ }
+ }
+ }
+});
+
+
+/**
+ * @private
+ * @type {string}
+ */
+org_apache_flex_collections_LazyCollection.prototype.id_ = '';
+
+
+/**
+ * @protected
+ */
+org_apache_flex_collections_LazyCollection.prototype.completeHandler =
+ function() {
+ var results = this.strand_.data;
+ this.rawData_ = this.inputParser_.parseItems(results);
+ this.data_ = [];
+ this.dispatchEvent('complete');
+};
+
+
+/**
+ * @expose
+ * @param {number} index The index in the collection.
+ * @return {Object} An item in the collection.
+ */
+org_apache_flex_collections_LazyCollection.prototype.getItemAt =
+ function(index) {
+ if (this.data_[index] === undefined) {
+ this.data_[index] =
+ this.itemConverter_.convertItem(this.rawData_[index]);
+ }
+
+ return this.data_[index];
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Collections/js/src/org/apache/flex/collections/converters/JSONItemConverter.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Collections/js/src/org/apache/flex/collections/converters/JSONItemConverter.js b/frameworks/projects/Collections/js/src/org/apache/flex/collections/converters/JSONItemConverter.js
new file mode 100644
index 0000000..bb167b7
--- /dev/null
+++ b/frameworks/projects/Collections/js/src/org/apache/flex/collections/converters/JSONItemConverter.js
@@ -0,0 +1,48 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org_apache_flex_collections_converters_JSONItemConverter');
+
+
+
+/**
+ * @constructor
+ */
+org_apache_flex_collections_converters_JSONItemConverter = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_collections_converters_JSONItemConverter.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'JSONItemConverter',
+ qName: 'org_apache_flex_collections_converters_JSONItemConverter'}] };
+
+
+/**
+ * @expose
+ * @param {string} s The input string.
+ * @return {*} The object.
+ */
+org_apache_flex_collections_converters_JSONItemConverter.prototype.convertItem = function(s) {
+ var c = s.indexOf('{)');
+ if (c > 0)
+ s = s.substring(c);
+ if (s.indexOf('}') == -1)
+ s += '}';
+ return JSON.parse(s);
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Collections/js/src/org/apache/flex/collections/parsers/JSONInputParser.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Collections/js/src/org/apache/flex/collections/parsers/JSONInputParser.js b/frameworks/projects/Collections/js/src/org/apache/flex/collections/parsers/JSONInputParser.js
new file mode 100644
index 0000000..ed96c00
--- /dev/null
+++ b/frameworks/projects/Collections/js/src/org/apache/flex/collections/parsers/JSONInputParser.js
@@ -0,0 +1,48 @@
+/**
+ * Licensed 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.
+ */
+
+goog.provide('org_apache_flex_collections_parsers_JSONInputParser');
+
+
+
+/**
+ * @constructor
+ */
+org_apache_flex_collections_parsers_JSONInputParser = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_collections_parsers_JSONInputParser.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'JSONInputParser',
+ qName: 'org_apache_flex_collections_parsers_JSONInputParser'}] };
+
+
+/**
+ * @expose
+ * @param {string} s The input string.
+ * @return {Array.<string>} The Array of unparsed objects.
+ */
+org_apache_flex_collections_parsers_JSONInputParser.prototype.parseItems = function(s) {
+ var c = s.indexOf('[');
+ if (c != -1) {
+ var c2 = s.lastIndexOf(']');
+ s = s.substring(c + 1, c2);
+ }
+ return s.split('},');
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/build.xml b/frameworks/projects/Core/build.xml
index 51bfc32..513f574 100644
--- a/frameworks/projects/Core/build.xml
+++ b/frameworks/projects/Core/build.xml
@@ -27,10 +27,19 @@
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
<property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="gjslint" value="gjslint" />
+ <property name="jshint" value="jshint" />
+ <condition property="no.lint" value="true">
+ <os family="windows"/>
+ </condition>
<target name="main" depends="clean,compile,test" description="Clean build of Core.swc">
</target>
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Core.swc">
+ </target>
+
<target name="test" unless="is.jenkins">
<ant dir="as/tests" />
<!-- no tests yet
@@ -38,6 +47,12 @@
-->
</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">
@@ -79,4 +94,59 @@
</compc>
</target>
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling Core/asjs"/>
+ <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
+ <mkdir dir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <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=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
+ <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}" />
+ </java>
+ </target>
+
+ <target name="lint-js" depends="gjslint, jshint, copy-js" />
+ <target name="copy-js" >
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <fileset dir="${basedir}/js/src">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="gjslint" unless="no.lint">
+ <echo>running gjslint</echo>
+ <exec executable="${gjslint}" dir="${basedir}" failonerror="true">
+ <arg value="--strict" />
+ <arg value="--disable" />
+ <arg value="006,100,214,300" />
+ <!-- 006: wrong indentation -->
+ <!-- 100: cannot have non-primitive value -->
+ <!-- 214: @fileoverview tag missing description -->
+ <!-- 300: missing newline at end of file -->
+ <arg value="--max_line_length" />
+ <arg value="120" />
+ <arg value="-r" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
+ <target name="jshint" unless="no.lint">
+ <echo>running jshint</echo>
+ <exec executable="${jshint}" dir="${basedir}" failonerror="true">
+ <arg value="--config" />
+ <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/compile-asjs-config.xml b/frameworks/projects/Core/compile-asjs-config.xml
new file mode 100644
index 0000000..a89e04b
--- /dev/null
+++ b/frameworks/projects/Core/compile-asjs-config.xml
@@ -0,0 +1,72 @@
+<!--
+
+ 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>
+ <path-element>../../libs/Graphics.swc</path-element>
+ <path-element>../../libs/HTML.swc</path-element>
+ <path-element>../../libs/Charts.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/>
+
+ <source-path>
+ <path-element>asjs/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ <path-element>asjs/src</path-element>
+ </include-sources>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/js/src/org/apache/flex/core/FormatBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/FormatBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/FormatBase.js
deleted file mode 100644
index 41358eb..0000000
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/FormatBase.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * Licensed 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.
- */
-
-/**
- * @fileoverview
- * @suppress {checkTypes}
- */
-
-goog.provide('org_apache_flex_core_FormatBase');
-
-goog.require('org_apache_flex_core_IFormatBead');
-goog.require('org_apache_flex_events_EventDispatcher');
-
-
-
-/**
- * @constructor
- * @implements {org_apache_flex_core_IFormatBead}
- * @extends {org_apache_flex_events_EventDispatcher}
- */
-org_apache_flex_core_FormatBase = function() {
- goog.base(this);
-};
-goog.inherits(org_apache_flex_core_FormatBase,
- org_apache_flex_events_EventDispatcher);
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_core_FormatBase.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'FormatBase',
- qName: 'org_apache_flex_core_FormatBase' }],
- interfaces: [org_apache_flex_core_IFormatBead] };
-
-
-/**
- * @private
- * @type {org_apache_flex_core_IStrand}
- */
-org_apache_flex_core_FormatBase.prototype.strand_ = null;
-
-
-/**
- * @type {string}
- */
-org_apache_flex_core_FormatBase.prototype._propertyName = 'text';
-
-
-/**
- * @type {string}
- */
-org_apache_flex_core_FormatBase.prototype._eventName = 'textChange';
-
-
-/**
- * @type {string}
- */
-org_apache_flex_core_FormatBase.prototype._formattedResult = '';
-
-
-Object.defineProperties(org_apache_flex_core_FormatBase.prototype, {
- /** @expose */
- strand: {
- /** @this {org_apache_flex_core_FormatBase} */
- set: function(value) {
- this.strand_ = value;
- }
- },
- /** @expose */
- propertyValue: {
- /** @this {org_apache_flex_core_FormatBase} */
- get: function() {
- var value = this.strand_[this.propertyName];
- return value;
- }
- },
- /** @expose */
- propertyName: {
- /** @this {org_apache_flex_core_FormatBase} */
- get: function() {
- if (this._propertyName == null) {
- this._propertyName = 'text';
- }
- return this._propertyName;
- },
- /** @this {org_apache_flex_core_FormatBase} */
- set: function(value) {
- this._propertyName = value;
- }
- },
- /** @expose */
- eventName: {
- /** @this {org_apache_flex_core_FormatBase} */
- get: function() {
- if (this._eventName == null) {
- return this._propertyName + 'Change';
- }
- return this._eventName;
- },
- /** @this {org_apache_flex_core_FormatBase} */
- set: function(value) {
- this._eventName = value;
- }
- },
- /** @expose */
- formattedString: {
- /** @this {org_apache_flex_core_FormatBase} */
- get: function() {
- return null;
- }
- }
-});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js
deleted file mode 100644
index 6271c0f..0000000
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js
+++ /dev/null
@@ -1,345 +0,0 @@
-/**
- * Licensed 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.
- */
-
-goog.provide('org_apache_flex_core_ViewBaseDataBinding');
-
-goog.require('org_apache_flex_binding_ConstantBinding');
-goog.require('org_apache_flex_binding_GenericBinding');
-goog.require('org_apache_flex_binding_PropertyWatcher');
-goog.require('org_apache_flex_binding_SimpleBinding');
-goog.require('org_apache_flex_events_Event');
-goog.require('org_apache_flex_events_ValueChangeEvent');
-
-
-
-/**
- * @constructor
- */
-org_apache_flex_core_ViewBaseDataBinding = function() {
-
- /**
- * @private
- * @type {Object}
- */
- this.strand_ = null;
-
- /**
- * @protected
- * @type {Object}
- */
- this.deferredBindings = {};
-
-};
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_core_ViewBaseDataBinding.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'ViewBaseDataBinding',
- qName: 'org_apache_flex_core_ViewBaseDataBinding'}] };
-
-
-Object.defineProperties(org_apache_flex_core_ViewBaseDataBinding.prototype, {
- /** @expose */
- strand: {
- /** @this {org_apache_flex_core_ViewBaseDataBinding} */
- set: function(value) {
- if (this.strand_ !== value) {
- this.strand_ = value;
- this.strand_.addEventListener('initComplete',
- goog.bind(this.initCompleteHandler, this));
- }
- }
- }
-});
-
-
-/**
- * @protected
- * @param {Object} event The event.
- */
-org_apache_flex_core_ViewBaseDataBinding.prototype.initCompleteHandler =
- function(event) {
-
- var prop;
- var fieldWatcher;
- var sb;
- var bindingData = this.strand_._bindings;
- var n = bindingData[0];
- var bindings = [];
- var i;
- var binding;
- var destination;
- var index = 1;
- for (i = 0; i < n; i++)
- {
- binding = {};
- binding.source = bindingData[index++];
- binding.destFunc = bindingData[index++];
- binding.destination = bindingData[index++];
- bindings.push(binding);
- }
- var watchers = this.decodeWatcher(bindingData.slice(index));
- for (i = 0; i < n; i++)
- {
- binding = bindings[i];
- // try to determine if it is an array
- if (typeof(binding.source) == 'object' &&
- typeof(binding.source.slice) == 'function')
- {
- if (binding.source[0] == 'applicationModel')
- {
- if (binding.source.length == 2 &&
- binding.destination.length == 2)
- {
- // can be simplebinding or constantbinding
- var modelWatcher =
- watchers.watcherMap.applicationModel;
- var childMap = modelWatcher.children.watcherMap;
- fieldWatcher = childMap[binding.source[1]];
- if (typeof(fieldWatcher.eventNames) == 'string')
- {
- sb = new org_apache_flex_binding_SimpleBinding();
- sb.destinationPropertyName =
- binding.destination[1];
- sb.eventName = fieldWatcher.eventNames;
- sb.sourceID = binding.source[0];
- sb.sourcePropertyName = binding.source[1];
- sb.setDocument(this.strand_);
- prop = binding.destination[0];
-
- destination = this.strand_[prop];
-
- if (destination)
- destination.addBead(sb);
- else
- {
- this.deferredBindings[prop] =
- sb;
- this.strand_.addEventListener('valueChange',
- goog.bind(this.deferredBindingsHandler, this));
- }
- }
- else if (fieldWatcher.eventNames == null)
- {
- var cb;
- cb = org_apache_flex_binding_ConstantBinding;
- cb = new cb();
- cb.destinationPropertyName =
- binding.destination[1];
- cb.sourceID = binding.source[0];
- cb.sourcePropertyName = binding.source[1];
- cb.setDocument(this.strand_);
- prop = binding.destination[0];
- destination = this.strand_[prop];
-
- if (destination)
- destination.addBead(cb);
- else
- {
- this.deferredBindings[prop] =
- cb;
- this.strand_.addEventListener('valueChange',
- this.deferredBindingsHandler);
- }
- }
- }
- }
- }
- else if (typeof(binding.source) == 'string')
- {
- fieldWatcher = watchers.watcherMap[binding.source];
- if (typeof(fieldWatcher.eventNames) == 'string')
- {
- sb = new org_apache_flex_binding_SimpleBinding();
- sb.destinationPropertyName = binding.destination[1];
- sb.eventName = fieldWatcher.eventNames;
- sb.sourcePropertyName = binding.source;
- sb.setDocument(this.strand_);
- prop = binding.destination[0];
- destination = this.strand_[prop];
-
- if (destination)
- destination.addBead(sb);
- else
- {
- this.deferredBindings[prop] = sb;
- this.strand_.addEventListener('valueChange',
- this.deferredBindingsHandler);
- }
- }
- }
- else
- {
- this.makeGenericBinding(binding, i, watchers);
- }
- }
-};
-
-
-/**
- * @protected
- * @param {Object} binding The binding object.
- * @param {number} index The offset in the Binding database.
- * @param {Object} watchers The database of Watchers.
- */
-org_apache_flex_core_ViewBaseDataBinding.prototype.makeGenericBinding =
- function(binding, index, watchers) {
- var gb = new org_apache_flex_binding_GenericBinding();
- gb.setDocument(this.strand_);
- gb.destinationData = binding.destination;
- gb.destinationFunction = binding.destFunc;
- gb.source = binding.source;
- this.setupWatchers(gb, index, watchers.watchers, null);
-};
-
-
-/**
- * @protected
- * @param {Object} gb The generic binding object.
- * @param {number} index The offset in the Binding database.
- * @param {Object} watchers The array of Watchers.
- * @param {Object} parentWatcher The parent Watcher or null if top.
- */
-org_apache_flex_core_ViewBaseDataBinding.prototype.setupWatchers =
- function(gb, index, watchers, parentWatcher) {
- var i, n;
- n = watchers.length;
- for (i = 0; i < n; i++)
- {
- var watcher = watchers[i];
- if (watcher.bindings.indexOf(index) != -1)
- {
- var type = watcher.type;
- switch (type)
- {
- case 'property':
- {
- var pw = new org_apache_flex_binding_PropertyWatcher(
- this,
- watcher.propertyName,
- watcher.eventNames,
- watcher.getterFunction);
- watcher.watcher = pw;
- if (parentWatcher)
- pw.parentChanged(parentWatcher.value);
- else
- pw.parentChanged(this.strand_);
- if (parentWatcher)
- parentWatcher.addChild(pw);
- if (watcher.children == null)
- pw.addBinding(gb);
- break;
- }
- }
- if (watcher.children)
- {
- this.setupWatchers(gb, index, watcher.children,
- watcher.watcher);
- }
- }
- }
-};
-
-
-/**
- * @protected
- * @param {Object} bindingData The watcher data to decode.
- * @return {Object} The watcher tree structure.
- */
-org_apache_flex_core_ViewBaseDataBinding.prototype.decodeWatcher =
- function(bindingData) {
- var watcherMap = {};
- var watchers = [];
- var n = bindingData.length - 1; // there is an extra null because
- // it is easier for the compiler
- var index = 0;
- var watcherData;
- while (index < n)
- {
- var watcherIndex = bindingData[index++];
- var type = bindingData[index++];
- switch (type)
- {
- case 0:
- {
- watcherData = { type: 'function' };
- watcherData.functionName = bindingData[index++];
- watcherData.paramFunction = bindingData[index++];
- watcherData.eventNames = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- break;
- }
- case 1:
- {
- watcherData = { type: 'static' };
- watcherData.propertyName = bindingData[index++];
- watcherData.eventNames = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- watcherData.getterFunction = bindingData[index++];
- watcherData.parentObj = bindingData[index++];
- watcherMap[watcherData.propertyName] = watcherData;
- break;
- }
- case 2:
- {
- watcherData = { type: 'property' };
- watcherData.propertyName = bindingData[index++];
- watcherData.eventNames = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- watcherData.getterFunction = bindingData[index++];
- watcherMap[watcherData.propertyName] = watcherData;
- break;
- }
- case 3:
- {
- watcherData = { type: 'xml' };
- watcherData.propertyName = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- watcherMap[watcherData.propertyName] = watcherData;
- break;
- }
- }
- watcherData.children = bindingData[index++];
- if (watcherData.children != null)
- {
- watcherData.children = this.decodeWatcher(watcherData.children);
- }
- watcherData.index = watcherIndex;
- watchers.push(watcherData);
- }
- return { watchers: watchers, watcherMap: watcherMap };
-};
-
-
-/**
- * @protected
- * @param {org_apache_flex_events_ValueChangeEvent} event The event.
- */
-org_apache_flex_core_ViewBaseDataBinding.prototype.deferredBindingsHandler =
- function(event) {
- var p;
- var destination;
- for (p in this.deferredBindings)
- {
- if (p != event.propertyName) continue;
- destination = this.strand_[p];
- destination.addBead(this.deferredBindings[p]);
- delete this.deferredBindings[p];
- }
-};
-
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js
deleted file mode 100644
index 9dba559..0000000
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Licensed 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.
- */
-
-goog.provide('org_apache_flex_core_graphics_Circle');
-
-goog.require('org_apache_flex_core_graphics_GraphicShape');
-
-
-
-/**
- * @constructor
- * @extends {org_apache_flex_core_graphics_GraphicShape}
- */
-org_apache_flex_core_graphics_Circle = function() {
- org_apache_flex_core_graphics_Circle.base(this, 'constructor');
-
- /**
- * @private
- * @type {number}
- */
- this.radius_ = 0;
-};
-goog.inherits(org_apache_flex_core_graphics_Circle,
- org_apache_flex_core_graphics_GraphicShape);
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_core_graphics_Circle.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'Circle',
- qName: 'org_apache_flex_core_graphics_Circle' }] };
-
-
-
-Object.defineProperties(org_apache_flex_core_graphics_Circle.prototype, {
- /** @expose */
- radius: {
- /** @this {org_apache_flex_core_graphics_Circle} */
- set: function(v) {
- this.radius_ = v;
- },
- /** @this {org_apache_flex_core_graphics_Circle} */
- get: function() {
- return this.radius_;
- }
- }
-});
-
-
-/**
- * @expose
- * @param {number} x The x location of the center of the circle.
- * @param {number} y The y location of the center of the circle.
- * @param {number} radius The radius of the circle.
- */
-org_apache_flex_core_graphics_Circle.prototype.drawCircle = function(x, y, radius) {
- var style = this.getStyleStr();
- var circle = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
- circle.flexjs_wrapper = this;
- circle.setAttribute('style', style);
- if (this.stroke)
- {
- circle.setAttribute('cx', String(radius + this.stroke.weight));
- circle.setAttribute('cy', String(radius + this.stroke.weight));
- this.setPosition(x - radius, y - radius, this.stroke.weight, this.stroke.weight);
- }
- else
- {
- circle.setAttribute('cx', String(radius));
- circle.setAttribute('cy', String(radius));
- this.setPosition(x - radius, y - radius, 0, 0);
- }
-
- circle.setAttribute('rx', String(radius));
- circle.setAttribute('ry', String(radius));
- this.element.appendChild(circle);
-
- this.resize(x, y, circle.getBBox());
- };
-
-
-/**
- * @override
- */
-org_apache_flex_core_graphics_Circle.prototype.draw = function() {
- this.drawCircle(this.x, this.y, this.radius);
- };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js
deleted file mode 100644
index 65469bb..0000000
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Licensed 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.
- */
-
-goog.provide('org_apache_flex_core_graphics_Ellipse');
-
-goog.require('org_apache_flex_core_graphics_GraphicShape');
-
-
-
-/**
- * @constructor
- * @extends {org_apache_flex_core_graphics_GraphicShape}
- */
-org_apache_flex_core_graphics_Ellipse = function() {
- org_apache_flex_core_graphics_Ellipse.base(this, 'constructor');
-
-};
-goog.inherits(org_apache_flex_core_graphics_Ellipse,
- org_apache_flex_core_graphics_GraphicShape);
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_core_graphics_Ellipse.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'Ellipse',
- qName: 'org_apache_flex_core_graphics_Ellipse' }] };
-
-
-/**
- * @expose
- * @param {number} x The x position of the top-left corner of the bounding box of the ellipse.
- * @param {number} y The y position of the top-left corner of the bounding box of the ellipse.
- * @param {number} width The width of the ellipse.
- * @param {number} height The height of the ellipse.
- */
-org_apache_flex_core_graphics_Ellipse.prototype.drawEllipse = function(x, y, width, height) {
- var style = this.getStyleStr();
- var ellipse = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
- ellipse.flexjs_wrapper = this;
- ellipse.setAttribute('style', style);
- if (this.stroke)
- {
- ellipse.setAttribute('cx', String(width / 2 + this.stroke.weight));
- ellipse.setAttribute('cy', String(height / 2 + this.stroke.weight));
- this.setPosition(x, y, this.stroke.weight * 2, this.stroke.weight * 2);
- }
- else
- {
- ellipse.setAttribute('cx', String(width / 2));
- ellipse.setAttribute('cy', String(height / 2));
- this.setPosition(x, y, 0, 0);
- }
- ellipse.setAttribute('rx', String(width / 2));
- ellipse.setAttribute('ry', String(height / 2));
- this.element.appendChild(ellipse);
-
- this.resize(x, y, ellipse.getBBox());
- };
-
-
-/**
- * @override
-*/
-org_apache_flex_core_graphics_Ellipse.prototype.draw = function() {
- this.drawEllipse(this.x, this.y, this.width, this.height);
- };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js
deleted file mode 100644
index 3d66aaf..0000000
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Licensed 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.
- */
-
-/**
- * org_apache_flex_core_graphics_GradientBase
- *
- * @fileoverview
- *
- * @suppress {checkTypes}
- */
-
-goog.provide('org_apache_flex_core_graphics_GradientBase');
-
-
-
-/**
- * @constructor
- */
-org_apache_flex_core_graphics_GradientBase = function() {
-};
-
-
-/**
- * @protected
- * @type {Array}
- */
-org_apache_flex_core_graphics_GradientBase.prototype.colors = [];
-
-
-/**
- * @protected
- * @type {Array}
- */
-org_apache_flex_core_graphics_GradientBase.prototype.ratios = [];
-
-
-/**
- * @protected
- * @type {Array}
- */
-org_apache_flex_core_graphics_GradientBase.prototype.alphas = [];
-
-
-/**
- * @type {Array}
- */
-org_apache_flex_core_graphics_GradientBase.prototype._entries = [];
-
-
-/**
- * @type {number}
- */
-org_apache_flex_core_graphics_GradientBase.prototype._rotation = 0.0;
-
-
-Object.defineProperties(org_apache_flex_core_graphics_GradientBase.prototype, {
- /** @expose */
- entries: {
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- get: function() {
- return this._entries;
- },
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- set: function(value) {
- this._entries = value;
- }
- },
- /** @expose */
- rotation: {
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- get: function() {
- return this._rotation;
- },
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- set: function(value) {
- this._rotation = value;
- }
- },
- /** @expose */
- x: {
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- get: function() {
- return this._x;
- },
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- set: function(value) {
- this._x = value;
- }
- },
- /** @expose */
- y: {
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- set: function(value) {
- this._y = value;
- },
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- get: function() {
- return this._y;
- }
- },
- /** @expose */
- newId: {
- /** @this {org_apache_flex_core_graphics_GradientBase} */
- get: function() {
- return 'gradient' + String(Math.floor((Math.random() * 100000) + 1));
- }
- }
-});
-
-
-/**
- * @type {number}
- */
-org_apache_flex_core_graphics_GradientBase.prototype._x = 0;
-
-
-/**
- * @type {number}
- */
-org_apache_flex_core_graphics_GradientBase.prototype._y = 0;
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_core_graphics_GradientBase.prototype.FLEXJS_CLASS_INFO = {
- names: [{ name: 'GradientBase', qName: 'org_apache_flex_core_graphics_GradientBase'}]
- };