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:55 UTC
[50/55] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - build
scripts work, examples all compile, DataBindingTest and FlexStore run
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/build.xml b/frameworks/projects/Graphics/build.xml
index 3e4fe14..e26dfea 100644
--- a/frameworks/projects/Graphics/build.xml
+++ b/frameworks/projects/Graphics/build.xml
@@ -27,16 +27,33 @@
<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 Graphics.swc">
</target>
-
+
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Graphics.swc">
+ </target>
+
<target name="test" unless="is.jenkins">
<!-- no tests yet
<ant dir="as/tests" />
+ <ant dir="asjs/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 +95,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/Graphics/js/src/org/apache/flex/core/graphics/Circle.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Circle.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Circle.js
new file mode 100644
index 0000000..9dba559
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Circle.js
@@ -0,0 +1,101 @@
+/**
+ * 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/Graphics/js/src/org/apache/flex/core/graphics/Ellipse.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Ellipse.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Ellipse.js
new file mode 100644
index 0000000..65469bb
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Ellipse.js
@@ -0,0 +1,80 @@
+/**
+ * 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/Graphics/js/src/org/apache/flex/core/graphics/GradientBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientBase.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientBase.js
new file mode 100644
index 0000000..3d66aaf
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientBase.js
@@ -0,0 +1,141 @@
+/**
+ * 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'}]
+ };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientEntry.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientEntry.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientEntry.js
new file mode 100644
index 0000000..632a4ed
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GradientEntry.js
@@ -0,0 +1,126 @@
+/**
+ * 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_GradientEntry
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('org_apache_flex_core_graphics_GradientEntry');
+
+
+
+/**
+ * @constructor
+ * @param {number} alpha
+ * @param {number} color
+ * @param {number} ratio
+ */
+org_apache_flex_core_graphics_GradientEntry = function(alpha, color, ratio) {
+ this._alpha = alpha;
+ this._color = color;
+ this._ratio = ratio;
+};
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype._alpha = 1.0;
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype._color = 0x000000;
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype._ratio = 0x000000;
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GradientEntry.prototype, {
+ /** @expose */
+ alpha: {
+ /** @this {org_apache_flex_core_graphics_GradientEntry} */
+ get: function() {
+ return this._alpha;
+ },
+ /** @this {org_apache_flex_core_graphics_GradientEntry} */
+ set: function(value) {
+ var /** @type {number} */ oldValue = this._alpha;
+ if (value != oldValue) {
+ this._alpha = value;
+ }
+ }
+ },
+ /** @expose */
+ color: {
+ /** @this {org_apache_flex_core_graphics_GradientEntry} */
+ get: function() {
+ return this._color;
+ },
+ /** @this {org_apache_flex_core_graphics_GradientEntry} */
+ set: function(value) {
+ var /** @type {number} */ oldValue = this._color;
+ if (value != oldValue) {
+ this._color = value;
+ }
+ }
+ },
+ /** @expose */
+ ratio: {
+ /** @this {org_apache_flex_core_graphics_GradientEntry} */
+ get: function() {
+ return this._ratio;
+ },
+ /** @this {org_apache_flex_core_graphics_GradientEntry} */
+ set: function(value) {
+ this._ratio = value;
+ }
+ }
+});
+
+
+/**
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} s
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype.begin = function(s) {
+ s.graphics.beginFill(this.color, this.alpha);
+};
+
+
+/**
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} s
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype.end = function(s) {
+ s.graphics.endFill();
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype.FLEXJS_CLASS_INFO = {
+ names: [{ name: 'GradientEntry', qName: 'org_apache_flex_core_graphics_GradientEntry'}]
+ };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js
new file mode 100644
index 0000000..4f6851c
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js
@@ -0,0 +1,204 @@
+/**
+ * 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_GraphicShape');
+goog.require('org_apache_flex_core_UIBase');
+goog.require('org_apache_flex_core_graphics_SolidColor');
+goog.require('org_apache_flex_core_graphics_SolidColorStroke');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_UIBase}
+ */
+org_apache_flex_core_graphics_GraphicShape = function() {
+
+ org_apache_flex_core_graphics_GraphicShape.base(this, 'constructor');
+
+ /**
+ * @private
+ * @type {org_apache_flex_core_graphics_IFill}
+ */
+ this.fill_ = null;
+
+ /**
+ * @private
+ * @type {org_apache_flex_core_graphics_IStroke}
+ */
+ this.stroke_ = null;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.x_ = 0;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.y_ = 0;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.xOffset_ = 0;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.yOffset_ = 0;
+
+ /**
+ * @expose
+ * @type {SVGElement}
+ */
+ this.element = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ this.element.flexjs_wrapper = this;
+ this.element.offsetLeft = 0;
+ this.element.offsetTop = 0;
+ this.element.offsetParent = null;
+ this.positioner = this.element;
+};
+goog.inherits(org_apache_flex_core_graphics_GraphicShape,
+ org_apache_flex_core_UIBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'GraphicShape',
+ qName: 'org_apache_flex_core_graphics_GraphicShape' }] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GraphicShape.prototype, {
+ /** @expose */
+ fill: {
+ /** @this {org_apache_flex_core_graphics_GraphicShape} */
+ get: function() {
+ return this.fill_;
+ },
+ /** @this {org_apache_flex_core_graphics_GraphicShape} */
+ set: function(value) {
+ this.fill_ = value;
+ }
+ },
+ stroke: {
+ /** @this {org_apache_flex_core_graphics_GraphicShape} */
+ get: function() {
+ return this.stroke_;
+ },
+ /** @this {org_apache_flex_core_graphics_GraphicShape} */
+ set: function(value) {
+ this.stroke_ = value;
+ }
+ }
+});
+
+
+/**
+ *
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.addedToParent = function() {
+ this.draw();
+ this.element.style.overflow = 'visible';
+ /*
+ * not sure this is valuable any longer
+ var bbox = this.element.getBBox();
+ if (bbox.width === 0 && !isNaN(this.width)) bbox.width = this.width;
+ if (bbox.height === 0 && !isNaN(this.height)) bbox.height = this.height;
+ this.resize(this.x, this.y, bbox);*/
+};
+
+
+/**
+ * This is where the drawing methods get called from.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.draw = function() {
+ //Overwrite in subclass
+};
+
+
+/**
+ * @expose
+ * @return {string} The style attribute.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.getStyleStr = function() {
+ var fillStr;
+ if (this.fill)
+ {
+ fillStr = this.fill.addFillAttrib(this);
+ }
+ else
+ {
+ fillStr = 'fill:none';
+ }
+
+ var strokeStr;
+ if (this.stroke)
+ {
+ strokeStr = this.stroke.addStrokeAttrib(this);
+ }
+ else
+ {
+ strokeStr = 'stroke:none';
+ }
+
+
+ return fillStr + ';' + strokeStr;
+};
+
+
+/**
+ * @expose
+ * @param {number} x X position.
+ * @param {number} y Y position.
+ * @param {Object} bbox The bounding box of the svg element.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.resize = function(x, y, bbox) {
+ var width = Math.max(this.width, bbox.width);
+ var height = Math.max(this.height, bbox.height);
+
+ this.element.style.position = 'absolute';
+ if (!isNaN(x)) this.element.style.top = String(x) + 'px';
+ if (!isNaN(y)) this.element.style.left = String(y) + 'px';
+ this.element.style.width = String(width) + 'px';
+ this.element.style.height = String(height) + 'px';
+ this.element.offsetLeft = x;
+ this.element.offsetTop = y;
+};
+
+
+/**
+ * @expose
+ * @param {number} x X position.
+ * @param {number} y Y position.
+ * @param {number} xOffset offset from x position.
+ * @param {number} yOffset offset from y position.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.setPosition = function(x, y, xOffset, yOffset) {
+ this.x_ = x;
+ this.y_ = y;
+ this.xOffset_ = xOffset;
+ this.yOffset_ = yOffset;
+ this.element.offsetLeft = xOffset;
+ this.element.offsetTop = yOffset;
+};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js
new file mode 100644
index 0000000..b5ec97f
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js
@@ -0,0 +1,232 @@
+/**
+ * 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_GraphicsContainer');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_GraphicsContainer = function() {
+ org_apache_flex_core_graphics_GraphicsContainer.base(this, 'constructor');
+};
+goog.inherits(org_apache_flex_core_graphics_GraphicsContainer, org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'GraphicsContainer',
+ qName: 'org_apache_flex_core_graphics_GraphicsContainer'}] };
+
+
+/**
+ * @expose
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.removeAllElements = function() {
+ var svg = this.element;
+ while (svg.lastChild) {
+ svg.removeChild(svg.lastChild);
+ }
+};
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GraphicsContainer.prototype, {
+ /** @expose */
+ numChildren: {
+ /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+ get: function() {
+ return this.internalChildren().length;
+ }
+ },
+ /** @expose */
+ width: {
+ /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+ set: function(value) {
+ org_apache_flex_utils_Language.superSetter(
+ org_apache_flex_core_graphics_GraphicsContainer, this, 'width', value);
+ this.element.setAttribute('width', String(value) + 'px');
+ this.element.style.width = String(value) + 'px';
+ }
+ },
+ /** @expose */
+ height: {
+ /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+ set: function(value) {
+ org_apache_flex_utils_Language.superSetter(
+ org_apache_flex_core_graphics_GraphicsContainer, this, 'height', value);
+ this.element.setAttribute('height', String(value) + 'px');
+ this.element.style.height = String(value) + 'px';
+ }
+ },
+ /** @expose */
+ x: {
+ /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+ set: function(value) {
+ org_apache_flex_utils_Language.superSetter(
+ org_apache_flex_core_graphics_GraphicsContainer, this, 'x', value);
+ this.element.setAttribute('x', String(value) + 'px');
+ this.element.style.position = 'absolute';
+ this.element.style.left = String(value) + 'px';
+ this.element.offsetLeft = value;
+ }
+ },
+ /** @expose */
+ y: {
+ /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+ set: function(value) {
+ org_apache_flex_utils_Language.superSetter(
+ org_apache_flex_core_graphics_GraphicsContainer, this, 'y', value);
+ this.element.setAttribute('y', String(value) + 'px');
+ this.element.style.position = 'absolute';
+ this.element.style.top = String(value) + 'px';
+ this.element.offsetTop = value;
+ }
+ }
+});
+
+
+/**
+ * @expose
+ * @param {number} x The x position of the top-left corner of the rectangle.
+ * @param {number} y The y position of the top-left corner.
+ * @param {number} width The width of the rectangle.
+ * @param {number} height The height of the rectangle.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawRect = function(x, y, width, height) {
+ var style = this.getStyleStr();
+ var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+ rect.flexjs_wrapper = this;
+ rect.offsetLeft = x;
+ rect.offsetTop = y;
+ rect.offsetParent = this;
+ rect.setAttribute('style', style);
+ rect.setAttribute('x', String(x) + 'px');
+ rect.setAttribute('y', String(y) + 'px');
+ rect.setAttribute('width', String(width) + 'px');
+ rect.setAttribute('height', String(height) + 'px');
+ this.element.appendChild(rect);
+};
+
+
+/**
+ * @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_GraphicsContainer.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.offsetLeft = x;
+ ellipse.offsetTop = y;
+ ellipse.offsetParent = this;
+ ellipse.setAttribute('style', style);
+ ellipse.setAttribute('cx', String(x + width / 2));
+ ellipse.setAttribute('cy', String(y + height / 2));
+ ellipse.setAttribute('rx', String(width / 2));
+ ellipse.setAttribute('ry', String(height / 2));
+ this.element.appendChild(ellipse);
+};
+
+
+/**
+ * @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_GraphicsContainer.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.offsetLeft = x;
+ circle.offsetTop = y;
+ circle.offsetParent = this;
+ circle.setAttribute('style', style);
+ circle.setAttribute('cx', String(x));
+ circle.setAttribute('cy', String(y));
+ circle.setAttribute('rx', String(radius));
+ circle.setAttribute('ry', String(radius));
+ this.element.appendChild(circle);
+};
+
+
+/**
+ * @expose
+ * @param {string} data A string containing a compact represention of the path segments.
+ * The value is a space-delimited string describing each path segment. Each
+ * segment entry has a single character which denotes the segment type and
+ * two or more segment parameters.
+ *
+ * If the segment command is upper-case, the parameters are absolute values.
+ * If the segment command is lower-case, the parameters are relative values.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawPath = function(data) {
+ var style = this.getStyleStr();
+ var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ path.flexjs_wrapper = this;
+ path.offsetLeft = 0;
+ path.offsetTop = 0;
+ path.offsetParent = this;
+ path.setAttribute('style', style);
+ path.setAttribute('d', data);
+ this.element.appendChild(path);
+};
+
+
+/**
+ * @expose
+ * @param {string} value The text string to draw.
+ * @param {number} x The x position of the text.
+ * @param {number} y The y position of the text.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawText = function(value, x, y) {
+ var style = this.getStyleStr();
+ var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
+ text.flexjs_wrapper = this;
+ text.offsetLeft = x;
+ text.offsetTop = y;
+ text.offsetParent = this;
+ text.setAttribute('style', style);
+ text.setAttribute('x', String(x) + 'px');
+ text.setAttribute('y', String(y + 15) + 'px');
+ var textNode = document.createTextNode(value);
+ text.appendChild(textNode);
+ this.element.appendChild(text);
+};
+
+
+/**
+ * @expose
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawLine = function() {
+};
+
+
+/**
+ * @expose
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawPolygon = function() {
+};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js
new file mode 100644
index 0000000..ac572d7
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js
@@ -0,0 +1,52 @@
+/**
+ * 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_graphics_IFill');
+
+
+
+/**
+ * IFill
+ *
+ * @interface
+ */
+org_apache_flex_core_graphics_IFill = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_IFill.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'IFill',
+ qName: 'org_apache_flex_core_graphics_IFill' }] };
+
+
+/**
+ * addFillAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the fill must be added.
+ * @return {string} The fill style attribute.
+ */
+org_apache_flex_core_graphics_IFill.prototype.addFillAttrib =
+ function(value) {};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js
new file mode 100644
index 0000000..398b4e6
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js
@@ -0,0 +1,52 @@
+/**
+ * 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_graphics_IStroke');
+
+
+
+/**
+ * IStroke
+ *
+ * @interface
+ */
+org_apache_flex_core_graphics_IStroke = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_IStroke.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'IStroke',
+ qName: 'org_apache_flex_core_graphics_IStroke' }] };
+
+
+/**
+ * addStrokeAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the stroke must be added.
+ * @return {string} The stroke style attribute.
+ */
+org_apache_flex_core_graphics_IStroke.prototype.addStrokeAttrib =
+ function(value) {};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js
new file mode 100644
index 0000000..b45f8d7
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js
@@ -0,0 +1,79 @@
+/**
+ * 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_Line');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Line = function() {
+ org_apache_flex_core_graphics_Line.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Line,
+ org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Line.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'Line',
+ qName: 'org_apache_flex_core_graphics_Line' }] };
+
+
+/**
+ * @expose
+ * @param {number} x1 The x1 attribute defines the start of the line on the x-axis.
+ * @param {number} y1 The y1 attribute defines the start of the line on the y-axis.
+ * @param {number} x2 The x2 attribute defines the end of the line on the x-axis.
+ * @param {number} y2 The y2 attribute defines the end of the line on the y-axis.
+ */
+org_apache_flex_core_graphics_Line.prototype.drawLine = function(x1, y1, x2, y2) {
+ var style = this.getStyleStr();
+ var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
+ line.flexjs_wrapper = this;
+ line.setAttribute('style', style);
+ line.setAttribute('x1', 0);
+ line.setAttribute('y1', y1);
+ line.setAttribute('x2', x2 - x1);
+ line.setAttribute('y2', y2);
+ this.setPosition(x1, y2, this.stroke.weight, this.stroke.weight);
+ this.element.appendChild(line);
+
+ this.resize(x, y, line.getBBox());
+ };
+
+
+/**
+ * @override
+ * @expose
+ * @param {number} x X position.
+ * @param {number} y Y position.
+ * @param {Object} bbox The bounding box of the svg element.
+ */
+org_apache_flex_core_graphics_Line.prototype.resize = function(x, y, bbox) {
+ this.element.setAttribute('width', String(bbox.width) + 'px');
+ this.element.setAttribute('height', String(bbox.height) + 'px');
+
+ this.element.setAttribute('style', 'position:absolute; left:' + String(x + bbox.x - this.xOffset_) +
+ 'px; top:' + String(bbox.y - this.yOffset_) + 'px;');
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js
new file mode 100644
index 0000000..5711ffc
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js
@@ -0,0 +1,125 @@
+/**
+ * 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_LinearGradient
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('org_apache_flex_core_graphics_LinearGradient');
+goog.require('org_apache_flex_core_graphics_GradientBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GradientBase}
+ * @implements {org_apache_flex_core_graphics_IFill}
+ */
+org_apache_flex_core_graphics_LinearGradient = function() {
+ org_apache_flex_core_graphics_LinearGradient.base(this, 'constructor');
+};
+goog.inherits(org_apache_flex_core_graphics_LinearGradient, org_apache_flex_core_graphics_GradientBase);
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_LinearGradient.prototype._scaleX = 1.0;
+
+
+Object.defineProperties(org_apache_flex_core_graphics_LinearGradient.prototype, {
+ /** @expose */
+ scaleX: {
+ /** @this {org_apache_flex_core_graphics_LinearGradient} */
+ get: function() {
+ return this._scaleX;
+ },
+ /** @this {org_apache_flex_core_graphics_LinearGradient} */
+ set: function(value) {
+ this._scaleX = value;
+ }
+ }
+});
+
+
+/**
+ * addFillAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the fill must be added.
+ * @return {string}
+ */
+org_apache_flex_core_graphics_LinearGradient.prototype.addFillAttrib = function(value) {
+ //Create and add a linear gradient def
+ var svgNS = value.element.namespaceURI;
+ var grad = document.createElementNS(svgNS, 'linearGradient');
+ var gradientId = this.newId;
+ grad.setAttribute('id', gradientId);
+
+ //Set x1, y1, x2, y2 of gradient
+ grad.setAttribute('x1', '0%');
+ grad.setAttribute('y1', '0%');
+ grad.setAttribute('x2', '100%');
+ grad.setAttribute('y2', '0%');
+
+ //Apply rotation to the gradient if rotation is a number
+ if (this.rotation)
+ {
+ grad.setAttribute('gradientTransform', 'rotate(' + this.rotation + ' 0.5 0.5)');
+ }
+
+ //Process gradient entries and create a stop for each entry
+ var entries = this.entries;
+ for (var i = 0; i < entries.length; i++)
+ {
+ var gradientEntry = entries[i];
+ var stop = document.createElementNS(svgNS, 'stop');
+ //Set Offset
+ stop.setAttribute('offset', String(gradientEntry.ratio * 100) + '%');
+ //Set Color
+ var color = Number(gradientEntry.color).toString(16);
+ if (color.length == 1) color = '00' + color;
+ if (color.length == 2) color = '00' + color;
+ if (color.length == 4) color = '00' + color;
+ stop.setAttribute('stop-color', '#' + String(color));
+ //Set Alpha
+ stop.setAttribute('stop-opacity', String(gradientEntry.alpha));
+
+ grad.appendChild(stop);
+ }
+
+ //Add defs element if not available already
+ //Add newly created gradient to defs element
+ var defs = value.element.querySelector('defs') ||
+ value.element.insertBefore(document.createElementNS(svgNS, 'defs'), value.element.firstChild);
+ defs.appendChild(grad);
+
+ //Return the fill attribute
+ return 'fill:url(#' + gradientId + ')';
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_LinearGradient.prototype.FLEXJS_CLASS_INFO = {
+ names: [{ name: 'LinearGradient', qName: 'org_apache_flex_core_graphics_LinearGradient'}],
+ interfaces: [org_apache_flex_core_graphics_IFill]
+ };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js
new file mode 100644
index 0000000..1a8c04c
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js
@@ -0,0 +1,101 @@
+/**
+ * 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_Path');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Path = function() {
+ org_apache_flex_core_graphics_Path.base(this, 'constructor');
+
+ /**
+ * @private
+ * @type {string}
+ */
+ this.data_ = '';
+};
+goog.inherits(org_apache_flex_core_graphics_Path,
+ org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Path.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'Path',
+ qName: 'org_apache_flex_core_graphics_Path' }] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_Path.prototype, {
+ /** @expose */
+ data: {
+ /** @this {org_apache_flex_core_graphics_Path} */
+ set: function(v) {
+ this.data_ = v;
+ },
+ /** @this {org_apache_flex_core_graphics_Path} */
+ get: function() {
+ return this.data_;
+ }
+ }
+});
+
+
+/**
+ * @expose
+ * @param {number} x The x location of the Path.
+ * @param {number} y The y location of the Path.
+ * @param {string} data A string containing a compact represention of the path segments.
+ * The value is a space-delimited string describing each path segment. Each
+ * segment entry has a single character which denotes the segment type and
+ * two or more segment parameters.
+ *
+ * If the segment command is upper-case, the parameters are absolute values.
+ * If the segment command is lower-case, the parameters are relative values.
+ */
+org_apache_flex_core_graphics_Path.prototype.drawPath = function(x, y, data) {
+ if (data == null || data.length === 0) return;
+ var style = this.getStyleStr();
+ var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ path.flexjs_wrapper = this;
+ path.setAttribute('style', style);
+ path.setAttribute('d', data);
+ this.element.appendChild(path);
+ if (this.stroke)
+ {
+ this.setPosition(x, y, this.stroke.weight, this.stroke.weight);
+ }
+ else
+ {
+ this.setPosition(x, y, 0, 0);
+ }
+
+ this.resize(x, y, path.getBBox());
+ };
+
+
+ /**
+ * @override
+ */
+org_apache_flex_core_graphics_Path.prototype.draw = function() {
+ this.drawPath(this.x, this.y, this.data);
+ };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js
new file mode 100644
index 0000000..2a3c849
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js
@@ -0,0 +1,80 @@
+/**
+ * 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_Rect');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Rect = function() {
+ org_apache_flex_core_graphics_Rect.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Rect,
+ org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Rect.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'Rect',
+ qName: 'org_apache_flex_core_graphics_Rect' }] };
+
+
+/**
+ * @expose
+ * @param {number} x The x position of the top-left corner of the rectangle.
+ * @param {number} y The y position of the top-left corner.
+ * @param {number} width The width of the rectangle.
+ * @param {number} height The height of the rectangle.
+ */
+org_apache_flex_core_graphics_Rect.prototype.drawRect = function(x, y, width, height) {
+ var style = this.getStyleStr();
+ var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+ rect.flexjs_wrapper = this;
+ rect.setAttribute('style', style);
+ if (this.stroke)
+ {
+ rect.setAttribute('x', String(this.stroke.weight / 2) + 'px');
+ rect.setAttribute('y', String(this.stroke.weight / 2) + 'px');
+ this.setPosition(x, y, this.stroke.weight, this.stroke.weight);
+ }
+ else
+ {
+ rect.setAttribute('x', '0' + 'px');
+ rect.setAttribute('y', '0' + 'px');
+ this.setPosition(x, y, 0, 0);
+ }
+ rect.setAttribute('width', String(width) + 'px');
+ rect.setAttribute('height', String(height) + 'px');
+ this.element.appendChild(rect);
+
+ this.resize(x, y, rect.getBBox());
+ };
+
+
+/**
+ * @override
+*/
+org_apache_flex_core_graphics_Rect.prototype.draw = function() {
+ this.drawRect(this.x, this.y, this.width, this.height);
+ };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js
new file mode 100644
index 0000000..d534260
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js
@@ -0,0 +1,92 @@
+/**
+ * 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_SolidColor');
+goog.require('org_apache_flex_core_graphics_IFill');
+
+
+
+/**
+ * @constructor
+ * @implements {org_apache_flex_core_graphics_IFill}
+ */
+org_apache_flex_core_graphics_SolidColor = function() {
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.alpha_ = 1.0;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.color_ = 1.0;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_SolidColor.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'SolidColor',
+ qName: 'org_apache_flex_core_graphics_SolidColor' }],
+ interfaces: [org_apache_flex_core_graphics_IFill] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_SolidColor.prototype, {
+ /** @expose */
+ color: {
+ /** @this {org_apache_flex_core_graphics_SolidColor} */
+ get: function() {
+ return this.color_;
+ },
+ /** @this {org_apache_flex_core_graphics_SolidColor} */
+ set: function(value) {
+ this.color_ = value;
+ }
+ },
+ /** @expose */
+ alpha: {
+ /** @this {org_apache_flex_core_graphics_SolidColor} */
+ get: function() {
+ return this.alpha_;
+ },
+ /** @this {org_apache_flex_core_graphics_SolidColor} */
+ set: function(value) {
+ this.alpha_ = value;
+ }
+ }
+});
+
+
+/**
+ * addFillAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the fill must be added.
+ * @return {string}
+ */
+org_apache_flex_core_graphics_SolidColor.prototype.addFillAttrib = function(value) {
+ var color = Number(this.color).toString(16);
+ if (color.length == 1) color = '00' + color;
+ if (color.length == 2) color = '00' + color;
+ if (color.length == 4) color = '00' + color;
+ return 'fill:#' + String(color) + ';fill-opacity:' + String(this.alpha);
+};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js
new file mode 100644
index 0000000..1ce52f6
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js
@@ -0,0 +1,109 @@
+/**
+ * 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_SolidColorStroke');
+goog.require('org_apache_flex_core_graphics_IStroke');
+
+
+
+/**
+ * @constructor
+ * @implements {org_apache_flex_core_graphics_IStroke}
+ *
+ */
+org_apache_flex_core_graphics_SolidColorStroke = function() {
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.alpha_ = 1.0;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.color_ = 1.0;
+
+ /**
+ * @private
+ * @type {number}
+ */
+ this.weight_ = 1.0;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_SolidColorStroke.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'SolidColorStroke',
+ qName: 'org_apache_flex_core_graphics_SolidColorStroke' }] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_SolidColorStroke.prototype, {
+ /** @expose */
+ color: {
+ /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+ get: function() {
+ return this.color_;
+ },
+ /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+ set: function(value) {
+ this.color_ = value;
+ }
+ },
+ /** @expose */
+ alpha: {
+ /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+ get: function() {
+ return this.alpha_;
+ },
+ /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+ set: function(value) {
+ this.alpha_ = value;
+ }
+ },
+ /** @expose */
+ weight: {
+ /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+ get: function() {
+ return this.weight_;
+ },
+ /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+ set: function(value) {
+ this.weight_ = value;
+ }
+ }
+});
+
+
+/**
+ * addStrokeAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the stroke must be added.
+ * @return {string}
+ */
+org_apache_flex_core_graphics_SolidColorStroke.prototype.addStrokeAttrib = function(value) {
+ var strokeColor = Number(this.color).toString(16);
+ if (strokeColor.length == 1) strokeColor = '00' + strokeColor;
+ if (strokeColor.length == 2) strokeColor = '00' + strokeColor;
+ if (strokeColor.length == 4) strokeColor = '00' + strokeColor;
+ return 'stroke:#' + String(strokeColor) + ';stroke-width:' +
+ String(this.weight) + ';stroke-opacity:' + String(this.alpha);
+ };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js
new file mode 100644
index 0000000..80afbda
--- /dev/null
+++ b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js
@@ -0,0 +1,70 @@
+/**
+ * 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_Text');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Text = function() {
+ org_apache_flex_core_graphics_Text.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Text,
+ org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Text.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'Rect',
+ qName: 'org_apache_flex_core_graphics_Text' }] };
+
+
+/**
+ * @expose
+ * @param {string} value The text to be drawn.
+ * @param {number} x The x position of the top-left corner of the rectangle.
+ * @param {number} y The y position of the top-left corner.
+ */
+org_apache_flex_core_graphics_Text.prototype.drawText = function(value, x, y) {
+ var style = this.getStyleStr();
+ var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
+ text.flexjs_wrapper = this;
+ text.setAttribute('style', style);
+ text.setAttribute('x', String(x) + 'px');
+ text.setAttribute('y', String(y) + 'px');
+ this.setPosition(x, y, 0, 0);
+ var textNode = document.createTextNode(value);
+ text.appendChild(textNode);
+ this.element.appendChild(text);
+
+ this.resize(x, y, text.getBBox());
+ };
+
+
+/**
+ * @override
+*/
+org_apache_flex_core_graphics_Text.prototype.draw = function() {
+
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/HTML/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/build.xml b/frameworks/projects/HTML/build.xml
index a07c9a6..67d632b 100644
--- a/frameworks/projects/HTML/build.xml
+++ b/frameworks/projects/HTML/build.xml
@@ -27,15 +27,30 @@
<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 HTML.swc">
</target>
-
+
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of HTML.swc">
+ </target>
+
<target name="test" unless="is.jenkins">
<!-- no tests yet
<ant dir="as/tests" />
-->
- <ant dir="asjs/tests" />
+ <ant dir="asjs/tests" />
+ </target>
+
+ <target name="test-js" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="js/tests" />
+ -->
</target>
<target name="clean">
@@ -79,4 +94,59 @@
</compc>
</target>
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling HTML/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/HTML/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/compile-asjs-config.xml b/frameworks/projects/HTML/compile-asjs-config.xml
new file mode 100644
index 0000000..eb658d5
--- /dev/null
+++ b/frameworks/projects/HTML/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/Binding.swc</path-element>
+ <path-element>../../libs/Core.swc</path-element>
+ <path-element>../../libs/Graphics.swc</path-element>
+ <path-element>../../libs/HTML.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/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js
index 6001515..379c8d5 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js
@@ -121,7 +121,7 @@ org_apache_flex_html_beads_DataItemRendererFactoryForArrayData.
var presModel = this.strand_.getBeadByType(org_apache_flex_core_IListPresentationModel);
dp = this.model.dataProvider;
- if (dp == undefined) return;
+ if (dp === undefined) return;
n = dp.length;
for (i = 0; i < n; i++) {
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/379e517c/frameworks/projects/HTML5/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML5/build.xml b/frameworks/projects/HTML5/build.xml
index 5055c94..3d71013 100644
--- a/frameworks/projects/HTML5/build.xml
+++ b/frameworks/projects/HTML5/build.xml
@@ -27,13 +27,29 @@
<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 HTML5.swc">
</target>
-
+
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of HTML5.swc">
+ </target>
+
<target name="test" unless="is.jenkins">
<!-- no tests yet
<ant dir="as/tests" />
+ <ant dir="asjs/tests" />
+ -->
+ </target>
+
+ <target name="test-js" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="js/tests" />
-->
</target>
@@ -78,4 +94,44 @@
</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/JQuery/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/JQuery/build.xml b/frameworks/projects/JQuery/build.xml
index d4474f3..24ace9a 100644
--- a/frameworks/projects/JQuery/build.xml
+++ b/frameworks/projects/JQuery/build.xml
@@ -27,13 +27,29 @@
<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 JQuery.swc">
</target>
-
+
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of JQuery.swc">
+ </target>
+
<target name="test" unless="is.jenkins">
<!-- no tests yet
<ant dir="as/tests" />
+ <ant dir="asjs/tests" />
+ -->
+ </target>
+
+ <target name="test-js" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="js/tests" />
-->
</target>
@@ -78,4 +94,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/Mobile/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Mobile/build.xml b/frameworks/projects/Mobile/build.xml
index 63576b3..a1e060e 100644
--- a/frameworks/projects/Mobile/build.xml
+++ b/frameworks/projects/Mobile/build.xml
@@ -27,13 +27,29 @@
<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 Mobile.swc">
</target>
-
+
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Mobile.swc">
+ </target>
+
<target name="test" unless="is.jenkins">
<!-- no tests yet
<ant dir="as/tests" />
+ <ant dir="asjs/tests" />
+ -->
+ </target>
+
+ <target name="test-js" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="js/tests" />
-->
</target>
@@ -78,4 +94,59 @@
</compc>
</target>
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling Mobile/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/Mobile/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Mobile/compile-asjs-config.xml b/frameworks/projects/Mobile/compile-asjs-config.xml
new file mode 100644
index 0000000..e198d6a
--- /dev/null
+++ b/frameworks/projects/Mobile/compile-asjs-config.xml
@@ -0,0 +1,71 @@
+<!--
+
+ 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/HTML.swc</path-element>
+ <path-element>../../libs/Mobile.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/Network/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/build.xml b/frameworks/projects/Network/build.xml
index 4df6f0f..6c05fe5 100644
--- a/frameworks/projects/Network/build.xml
+++ b/frameworks/projects/Network/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}"/>
-
- <target name="main" depends="clean,compile,test" description="Clean build of Network.swc">
+ <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/Network/js/src/org/apache/flex/net/JSONInputParser.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/js/src/org/apache/flex/net/JSONInputParser.js b/frameworks/projects/Network/js/src/org/apache/flex/net/JSONInputParser.js
deleted file mode 100644
index 83a41d1..0000000
--- a/frameworks/projects/Network/js/src/org/apache/flex/net/JSONInputParser.js
+++ /dev/null
@@ -1,48 +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_net_JSONInputParser');
-
-
-
-/**
- * @constructor
- */
-org_apache_flex_net_JSONInputParser = function() {
-};
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_net_JSONInputParser.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'JSONInputParser',
- qName: 'org_apache_flex_net_JSONInputParser'}] };
-
-
-/**
- * @expose
- * @param {string} s The input string.
- * @return {Array.<string>} The Array of unparsed objects.
- */
-org_apache_flex_net_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/Network/js/src/org/apache/flex/net/JSONItemConverter.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/js/src/org/apache/flex/net/JSONItemConverter.js b/frameworks/projects/Network/js/src/org/apache/flex/net/JSONItemConverter.js
deleted file mode 100644
index 5434a15..0000000
--- a/frameworks/projects/Network/js/src/org/apache/flex/net/JSONItemConverter.js
+++ /dev/null
@@ -1,48 +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_net_JSONItemConverter');
-
-
-
-/**
- * @constructor
- */
-org_apache_flex_net_JSONItemConverter = function() {
-};
-
-
-/**
- * Metadata
- *
- * @type {Object.<string, Array.<Object>>}
- */
-org_apache_flex_net_JSONItemConverter.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'JSONItemConverter',
- qName: 'org_apache_flex_net_JSONItemConverter'}] };
-
-
-/**
- * @expose
- * @param {string} s The input string.
- * @return {*} The object.
- */
-org_apache_flex_net_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);
-};