You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/08/25 15:32:09 UTC
[01/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Added
setLineStyle method to strokes
Repository: flex-asjs
Updated Branches:
refs/heads/spark 9d395280f -> 56cc9dd7f
Added setLineStyle method to strokes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e9dbfab7
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e9dbfab7
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e9dbfab7
Branch: refs/heads/spark
Commit: e9dbfab76cd4c106476529ecb211cd5e1df991bd
Parents: 498287b
Author: Harbs <ha...@in-tools.com>
Authored: Wed Jul 27 00:13:26 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Wed Jul 27 00:13:26 2016 +0300
----------------------------------------------------------------------
.../org/apache/flex/graphics/GradientBase.as | 2 +-
.../flex/org/apache/flex/graphics/IStroke.as | 1 +
.../flex/org/apache/flex/graphics/SolidColor.as | 2 +-
.../apache/flex/graphics/SolidColorStroke.as | 30 +++++++++++++++-----
.../flex/org/apache/flex/svg/LinearGradient.as | 4 +--
.../main/flex/org/apache/flex/html/Slider.as | 2 +-
6 files changed, 29 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
index 8b62ed6..bcc46c2 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/GradientBase.as
@@ -50,7 +50,7 @@ package org.apache.flex.graphics
*/
public function get newId():String
{
- return 'gradient' + String(Math.floor((Math.random() * 100000) + 1));
+ return 'gradient' + Math.floor((Math.random() * 100000) + 1);
}
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
index 8cd781f..fc17f24 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
@@ -33,6 +33,7 @@ package org.apache.flex.graphics
function set miterLimit(val:Number):void;
function get lineDash():Array;
function set lineDash(val:Array):void;
+ function setLineStyle(weight:Number=NaN,color:uint=0,alpha:Number = NaN,caps:String = null, joints:String = null, miterLimit:Number = NaN):void
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
index e3a2888..126193a 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColor.as
@@ -128,7 +128,7 @@ package org.apache.flex.graphics
COMPILE::JS
public function addFillAttrib(value:IGraphicShape):String
{
- return 'fill:' + CSSUtils.attributeFromColor(color) + ';fill-opacity:' + String(alpha);
+ return 'fill:' + CSSUtils.attributeFromColor(color) + ';fill-opacity:' + alpha;
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
index d64c35b..4efb417 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
@@ -134,13 +134,14 @@ package org.apache.flex.graphics
COMPILE::JS
public function addStrokeAttrib(value:IGraphicShape):String
{
- var att:Array = [];
- att.push('stroke:' + CSSUtils.attributeFromColor(color));
- att.push('stroke-width:' + String(weight));
- att.push('stroke-opacity:' + String(alpha));
- att.push('stroke-linecap:' + lineCap);
- att.push('stroke-linejoin:' + lineJoin);
- att.push('stroke-miterlimit:' + String(miterLimit));
+ var att:Array = [
+ 'stroke:' + CSSUtils.attributeFromColor(color),
+ 'stroke-width:' + weight,
+ 'stroke-opacity:' + alpha,
+ 'stroke-linecap:' + lineCap,
+ 'stroke-linejoin:' + lineJoin,
+ 'stroke-miterlimit:' + miterLimit
+ ];
if(lineDash && lineDash.length)
att.push('stroke-dasharray:' + lineDash.join(","));
return att.join(";");
@@ -246,6 +247,21 @@ package org.apache.flex.graphics
{
_lineDash = val;
}
+
+ public function setLineStyle(weight:Number=NaN,color:uint=0,alpha:Number = NaN,caps:String = null, joints:String = null, miterLimit:Number = NaN):void
+ {
+ if(!isNaN(weight))
+ _weight = weight;
+ _color = color;
+ if(!isNaN(alpha))
+ _alpha = alpha;
+ if(caps)
+ _lineCap = caps;
+ if(joints)
+ _lineJoin = joints;
+ if(!isNaN(miterLimit))
+ _miterLimit = miterLimit;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
index affee7a..7da2b2a 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/LinearGradient.as
@@ -102,12 +102,12 @@ package org.apache.flex.svg
var gradientEntry:GradientEntry = entries[i];
var stop:HTMLElement = document.createElementNS(svgNS, 'stop') as HTMLElement;
//Set Offset
- stop.setAttribute('offset', String(gradientEntry.ratio * 100) + '%');
+ stop.setAttribute('offset', "" + (gradientEntry.ratio * 100) + '%');
//Set Color
CSSUtils.attributeFromColor(gradientEntry.color)
stop.setAttribute('stop-color', CSSUtils.attributeFromColor(gradientEntry.color));
//Set Alpha
- stop.setAttribute('stop-opacity', String(gradientEntry.alpha));
+ stop.setAttribute('stop-opacity', gradientEntry.alpha);
grad.appendChild(stop);
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e9dbfab7/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
index 6944895..d10891c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
@@ -226,7 +226,7 @@ package org.apache.flex.html
var xloc:Number = p * (parseInt(track.element.style.width, 10) -
parseInt(thumb.element.style.width, 10));
- thumb.element.style.left = String(xloc) + 'px';
+ thumb.element.style.left = "" + xloc + 'px';
}
}
[14/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Added
IMatrix and MeagerMatrix to reduce overhead when creating Matrices.
Posted by ah...@apache.org.
Added IMatrix and MeagerMatrix to reduce overhead when creating Matrices.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/6b16b713
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/6b16b713
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/6b16b713
Branch: refs/heads/spark
Commit: 6b16b713c7116744acf33933ccecc1f9cf6e5578
Parents: b3ab3eb
Author: yishayw <yi...@hotmail.com>
Authored: Sun Jul 31 09:27:02 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Sun Jul 31 09:27:02 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 1 +
.../org/apache/flex/core/ITransformModel.as | 47 +++++++++++
.../apache/flex/core/TransformCompoundModel.as | 52 ++++++++++++
.../flex/org/apache/flex/core/TransformModel.as | 50 +++++++++++
.../org/apache/flex/core/TransformMoveXModel.as | 25 ++++++
.../org/apache/flex/core/TransformMoveYModel.as | 25 ++++++
.../apache/flex/core/TransformRotateModel.as | 28 +++++++
.../org/apache/flex/core/TransformScaleModel.as | 24 ++++++
.../main/flex/org/apache/flex/geom/Matrix.as | 76 +++++++++++++++--
.../flex/org/apache/flex/svg/TransformBead.as | 87 ++++++++++++++++++++
10 files changed, 407 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index a1cfe9c..df30ea2 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -107,6 +107,7 @@ internal class CoreClasses
import org.apache.flex.events.ValueEvent; ValueEvent;
import org.apache.flex.events.utils.MouseUtils; MouseUtils;
import org.apache.flex.geom.Matrix; Matrix;
+ import org.apache.flex.geom.MeagerMatrix; MeagerMatrix;
import org.apache.flex.geom.Point; Point;
import org.apache.flex.geom.Rectangle; Rectangle;
import org.apache.flex.utils.BinaryData; BinaryData;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
new file mode 100644
index 0000000..a88fcb6
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.IMatrix;
+
+ /**
+ * The ITransformModel interface describes the minimum set of properties
+ * needed to define a transformation on an object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ITransformModel extends IEventDispatcher, IBeadModel
+ {
+ /**
+ * The matrix of the Transform
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get matrix():IMatrix;
+ function set matrix(value:IMatrix):void;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
new file mode 100644
index 0000000..0a1b448
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
@@ -0,0 +1,52 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.IMatrix;
+
+ [DefaultProperty("transformModels")]
+ public class TransformCompoundModel extends TransformModel
+ {
+ public function set transformModels(value:Array):void
+ {
+ if (value && value.length > 0)
+ {
+ var length:int = value.length;
+ var product:IMatrix = (value[0] as ITransformModel).matrix.clone();
+ for (var i:int = 1; i < length; i++)
+ {
+ var current:IMatrix = (value[i] as ITransformModel).matrix;
+ concat(product, current);
+ }
+ matrix = product;
+ } else
+ {
+ matrix = null;
+ }
+ }
+
+ private function concat(product:IMatrix, factor:IMatrix):void
+ {
+ var result_a:Number = product.a * factor.a;
+ var result_b:Number = 0.0;
+ var result_c:Number = 0.0;
+ var result_d:Number = product.d * factor.d;
+ var result_tx:Number = product.tx * factor.a + factor.tx;
+ var result_ty:Number = product.ty * factor.d + factor.ty;
+ if (product.b != 0.0 || product.c != 0.0 || factor.b != 0.0 || factor.c != 0.0)
+ {
+ result_a = result_a + product.b * factor.c;
+ result_d = result_d + product.c * factor.b;
+ result_b = result_b + (product.a * factor.b + product.b * factor.d);
+ result_c = result_c + (product.c * factor.a + product.d * factor.c);
+ result_tx = result_tx + product.ty * factor.c;
+ result_ty = result_ty + product.tx * factor.b;
+ }
+ product.a = result_a;
+ product.b = result_b;
+ product.c = result_c;
+ product.d = result_d;
+ product.tx = result_tx;
+ product.ty = result_ty;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
new file mode 100644
index 0000000..4fa2a20
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
@@ -0,0 +1,50 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.geom.IMatrix;
+
+ public class TransformModel extends EventDispatcher implements ITransformModel
+ {
+
+ public static const CHANGE:String = "transferModelChange";
+
+ private var _matrix:IMatrix;
+ private var _strand:IStrand;
+
+ public function TransformModel()
+ {
+ }
+
+ public function get matrix():IMatrix
+ {
+ return _matrix;
+ }
+
+ private function dispatchModelChangeEvent():void
+ {
+ host.dispatchEvent(new Event(CHANGE));
+ }
+
+ private function get host():ITransformHost
+ {
+ return _strand as ITransformHost;
+ }
+
+ public function set matrix(value:IMatrix):void
+ {
+ _matrix = value;
+ if (_strand)
+ {
+ dispatchModelChangeEvent();
+ }
+ }
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ dispatchModelChangeEvent();
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
new file mode 100644
index 0000000..1cb692e
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
@@ -0,0 +1,25 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.MeagerMatrix;
+
+ public class TransformMoveXModel extends TransformModel
+ {
+ private var _x:Number;
+
+ public function TransformMoveXModel()
+ {
+ }
+
+ public function get x():Number
+ {
+ return _x;
+ }
+
+ public function set x(value:Number):void
+ {
+ _x = value;
+ matrix = new MeagerMatrix(1, 0, 0, 1, x, 0);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
new file mode 100644
index 0000000..13d0384
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
@@ -0,0 +1,25 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.MeagerMatrix;
+
+ public class TransformMoveYModel extends TransformModel
+ {
+ private var _y:Number;
+
+ public function TransformMoveYModel()
+ {
+ }
+
+ public function get y():Number
+ {
+ return _y;
+ }
+
+ public function set y(value:Number):void
+ {
+ _y = value;
+ matrix = new MeagerMatrix(1, 0, 0, 1, 0, y);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
new file mode 100644
index 0000000..90e0a46
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
@@ -0,0 +1,28 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.MeagerMatrix;
+
+
+ public class TransformRotateModel extends TransformModel
+ {
+ private var _angle:Number;
+
+ public function TransformRotateModel()
+ {
+ }
+
+ public function get angle():Number
+ {
+ return _angle;
+ }
+
+ public function set angle(value:Number):void
+ {
+ _angle = value;
+ var radians:Number = value * Math.PI/180;
+ matrix = new MeagerMatrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
+ }
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
new file mode 100644
index 0000000..798b66d
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
@@ -0,0 +1,24 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.MeagerMatrix;
+
+ public class TransformScaleModel extends TransformModel
+ {
+ private var _scale:Number
+ public function TransformScaleModel()
+ {
+ }
+
+ public function get scale():Number
+ {
+ return _scale;
+ }
+
+ public function set scale(value:Number):void
+ {
+ _scale = value;
+ matrix = new MeagerMatrix(scale, 0, 0, scale, 0, 0);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
index da88259..bf634e3 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
@@ -19,7 +19,7 @@
package org.apache.flex.geom
{
- public class Matrix
+ public class Matrix implements IMatrix
{
public function Matrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0)
{
@@ -31,14 +31,74 @@ package org.apache.flex.geom
this.ty = ty;
}
- public var a:Number;
- public var b:Number;
- public var c:Number;
- public var d:Number;
- public var tx:Number;
- public var ty:Number;
+ private var _a:Number;
+ private var _b:Number;
+ private var _c:Number;
+ private var _d:Number;
+ private var _tx:Number;
+ private var _ty:Number;
- public function clone():Matrix
+ public function get ty():Number
+ {
+ return _ty;
+ }
+
+ public function set ty(value:Number):void
+ {
+ _ty = value;
+ }
+
+ public function get tx():Number
+ {
+ return _tx;
+ }
+
+ public function set tx(value:Number):void
+ {
+ _tx = value;
+ }
+
+ public function get d():Number
+ {
+ return _d;
+ }
+
+ public function set d(value:Number):void
+ {
+ _d = value;
+ }
+
+ public function get c():Number
+ {
+ return _c;
+ }
+
+ public function set c(value:Number):void
+ {
+ _c = value;
+ }
+
+ public function get b():Number
+ {
+ return _b;
+ }
+
+ public function set b(value:Number):void
+ {
+ _b = value;
+ }
+
+ public function get a():Number
+ {
+ return _a;
+ }
+
+ public function set a(value:Number):void
+ {
+ _a = value;
+ }
+
+ public function clone():IMatrix
{
return new Matrix(a, b, c, d, tx, ty);
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6b16b713/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
new file mode 100644
index 0000000..60af498
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -0,0 +1,87 @@
+package org.apache.flex.svg
+{
+ import org.apache.flex.core.IBeadTransform;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITransformHost;
+ import org.apache.flex.core.ITransformModel;
+ import org.apache.flex.core.TransformModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.geom.IMatrix;
+
+ COMPILE::SWF {
+ import flash.display.Sprite;
+ import flash.geom.Matrix;
+ }
+
+ public class TransformBead implements IBeadTransform
+ {
+ private var _strand:IStrand;
+
+ public function TransformBead()
+ {
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ host.addEventListener(TransformModel.CHANGE, changeHandler);
+ var model:ITransformModel = transformModel;
+ if (model && model.matrix)
+ {
+ transform();
+ }
+ }
+
+ public function get transformModel():ITransformModel
+ {
+ return host.getBeadByType(ITransformModel) as ITransformModel;
+ }
+
+ COMPILE::SWF
+ public function transform():void
+ {
+ var element:Sprite = host.transformElement as Sprite;
+ var fjsm:org.apache.flex.geom.IMatrix = transformModel.matrix;
+ var flashMatrix:flash.geom.Matrix = new flash.geom.Matrix(fjsm.a, fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty);
+ element.transform.matrix = flashMatrix;
+ }
+ /**
+ * @flexjsignorecoercion HTMLElement
+ */
+ COMPILE::JS
+ public function transform():void
+ {
+ var element:org.apache.flex.core.WrappedHTMLElement = host.transformElement;
+ (element.parentNode as HTMLElement).setAttribute("overflow", "visible");
+ var fjsm:org.apache.flex.geom.IMatrix = transformModel.matrix;
+ var matrixArray:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
+ element.setAttribute("transform", "matrix(" +matrixArray.join(",") + ")";
+ }
+
+ private function changeHandler(e:Event):void
+ {
+ transform();
+ }
+
+ /**
+ * The host component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get host():ITransformHost
+ {
+ return _strand as ITransformHost;
+ }
+ }
+}
\ No newline at end of file
[37/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Removed
circular dependency from TodoListSample.
Posted by ah...@apache.org.
Removed circular dependency from TodoListSample.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/baa15e42
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/baa15e42
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/baa15e42
Branch: refs/heads/spark
Commit: baa15e42c96422b76d9e98053768347069a6a078
Parents: 94f5f3a
Author: Peter Ent <pe...@apache.org>
Authored: Tue Aug 16 10:46:42 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Tue Aug 16 10:46:42 2016 -0400
----------------------------------------------------------------------
.../src/sample/todo/controllers/TodoListController.as | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/baa15e42/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
index dc39c6d..4465fb3 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
@@ -20,16 +20,16 @@ package sample.todo.controllers {
import org.apache.flex.core.Application;
import org.apache.flex.core.IDocument;
import org.apache.flex.events.Event;
-
+
import sample.todo.events.TodoListEvent;
import sample.todo.models.TodoListModel;
public class TodoListController implements IDocument {
- private var app:TodoListSampleApp;
+ private var app:Application;
public function TodoListController(app:Application = null) {
if (app != null) {
- app = app as TodoListSampleApp;
+ this.app = app;
}
}
@@ -37,7 +37,7 @@ package sample.todo.controllers {
*
*/
public function setDocument(document:Object, id:String = null):void {
- app = document as TodoListSampleApp;
+ app = document as Application;
app.addEventListener("viewChanged", viewChangeHandler);
}
@@ -61,12 +61,12 @@ package sample.todo.controllers {
//todoModel.todos.push({title: evt.todo, selected: false});
todoModel.addTodo(evt.todo);
}
-
+
public function handleItemChecked(event:TodoListEvent):void {
var model: TodoListModel = app.model as TodoListModel;
model.toggleItemCheck(event.item);
}
-
+
public function handleItemRemove(event:TodoListEvent):void {
var model: TodoListModel = app.model as TodoListModel;
model.removeItem(event.item);
[09/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Added
compound transforms along with translate facades.
Posted by ah...@apache.org.
Added compound transforms along with translate facades.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/92e6ec92
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/92e6ec92
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/92e6ec92
Branch: refs/heads/spark
Commit: 92e6ec9262fbe817fed32358cb6eeaf7ece59f2f
Parents: 970f3e3
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 18:19:52 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 18:19:52 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 3 ++
.../apache/flex/core/TransformCompoundModel.as | 35 ++++++++++++++++++++
.../org/apache/flex/core/TransformMoveXModel.as | 25 ++++++++++++++
.../org/apache/flex/core/TransformMoveYModel.as | 25 ++++++++++++++
.../Core/src/main/resources/basic-manifest.xml | 3 ++
5 files changed, 91 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/92e6ec92/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index 72e9230..ed42da0 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -151,7 +151,10 @@ internal class CoreClasses
import org.apache.flex.core.IDateChooserModel; IDateChooserModel;
import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead;
import org.apache.flex.core.TransformModel; TransformModel;
+ import org.apache.flex.core.TransformCompoundModel; TransformCompoundModel;
import org.apache.flex.core.TransformRotateModel; TransformRotateModel;
+ import org.apache.flex.core.TransformMoveXModel; TransformMoveXModel;
+ import org.apache.flex.core.TransformMoveYModel; TransformMoveYModel;
import org.apache.flex.utils.CSSUtils; CSSUtils;
import org.apache.flex.utils.Proxy; Proxy;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/92e6ec92/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
new file mode 100644
index 0000000..d2b3339
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
@@ -0,0 +1,35 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.Matrix;
+
+ public class TransformCompoundModel extends TransformModel
+ {
+ private var _tranformModels:Array;
+
+ [DefaultProperty("transformModels")]
+ public function get tranformModels():Array
+ {
+ return _tranformModels;
+ }
+
+ public function set tranformModels(value:Array):void
+ {
+ _tranformModels = value;
+ if (value && value.length > 0)
+ {
+ var length:int = value.length;
+ var product:Matrix = (value[0] as ITransformModel).matrix.clone();
+ for (var i:int = 1; i < length; i++)
+ {
+ var current:Matrix = (value[i] as ITransformModel).matrix;
+ product.concat(current);
+ }
+ matrix = product;
+ } else
+ {
+ matrix = new Matrix();
+ }
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/92e6ec92/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
new file mode 100644
index 0000000..38948a9
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
@@ -0,0 +1,25 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.Matrix;
+
+ public class TransformMoveXModel extends TransformModel
+ {
+ private var _x:Number;
+
+ public function TransformMoveXModel()
+ {
+ }
+
+ public function get x():Number
+ {
+ return _x;
+ }
+
+ public function set x(value:Number):void
+ {
+ _x = value;
+ matrix = new Matrix(1, 0, 0, 1, x, 0);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/92e6ec92/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
new file mode 100644
index 0000000..9d03a60
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
@@ -0,0 +1,25 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.Matrix;
+
+ public class TransformMoveYModel extends TransformModel
+ {
+ private var _y:Number;
+
+ public function TransformMoveYModel()
+ {
+ }
+
+ public function get y():Number
+ {
+ return _y;
+ }
+
+ public function set y(value:Number):void
+ {
+ _y = value;
+ matrix = new Matrix(1, 0, 0, 1, 0, y);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/92e6ec92/frameworks/projects/Core/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/resources/basic-manifest.xml b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
index 0131eca..4958e66 100644
--- a/frameworks/projects/Core/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
@@ -38,6 +38,9 @@
<component id="ViewSourceContextMenuOption" class="org.apache.flex.utils.ViewSourceContextMenuOption" />
<component id="TransformModel" class="org.apache.flex.core.TransformModel" />
<component id="TransformRotateModel" class="org.apache.flex.core.TransformRotateModel" />
+ <component id="TransformCompoundModel" class="org.apache.flex.core.TransformCompoundModel" />
+ <component id="TransformMoveXModel" class="org.apache.flex.core.TransformMoveXModel" />
+ <component id="TransformMoveYModel" class="org.apache.flex.core.TransformMoveYModel" />
<component id="State" class="org.apache.flex.states.State"/>
</componentPackage>
[34/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Use
Matrix concat
Posted by ah...@apache.org.
Use Matrix concat
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ece2ee33
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ece2ee33
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ece2ee33
Branch: refs/heads/spark
Commit: ece2ee33a1f6c43f8c46992cb692c69564d9f711
Parents: 518f717
Author: Harbs <ha...@in-tools.com>
Authored: Sun Aug 14 22:49:17 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Sun Aug 14 22:49:17 2016 +0300
----------------------------------------------------------------------
.../apache/flex/core/TransformCompoundModel.as | 30 ++------------------
1 file changed, 2 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ece2ee33/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
index 9418fd1..ab7c12c 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
@@ -32,7 +32,7 @@ package org.apache.flex.core
for (var i:int = 1; i < length; i++)
{
var current:Matrix = (value[i] as ITransformModel).matrix;
- concat(product, current);
+ product.concat(current);
}
matrix = product;
} else
@@ -40,31 +40,5 @@ package org.apache.flex.core
matrix = null;
}
}
-
- private function concat(product:Matrix, factor:Matrix):void
- {
- var result_a:Number = product.a * factor.a;
- var result_b:Number = 0.0;
- var result_c:Number = 0.0;
- var result_d:Number = product.d * factor.d;
- var result_tx:Number = product.tx * factor.a + factor.tx;
- var result_ty:Number = product.ty * factor.d + factor.ty;
- if (product.b != 0.0 || product.c != 0.0 || factor.b != 0.0 || factor.c != 0.0)
- {
- result_a = result_a + product.b * factor.c;
- result_d = result_d + product.c * factor.b;
- result_b = result_b + (product.a * factor.b + product.b * factor.d);
- result_c = result_c + (product.c * factor.a + product.d * factor.c);
- result_tx = result_tx + product.ty * factor.c;
- result_ty = result_ty + product.tx * factor.b;
- }
- product.a = result_a;
- product.b = result_b;
- product.c = result_c;
- product.d = result_d;
- product.tx = result_tx;
- product.ty = result_ty;
- }
-
}
-}
\ No newline at end of file
+}
[31/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - fix build
Posted by ah...@apache.org.
fix build
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7048caa5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7048caa5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7048caa5
Branch: refs/heads/spark
Commit: 7048caa525904dc6e98838e6b1d2ebbbfca24943
Parents: bcb3c03
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 13 00:00:01 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sat Aug 13 00:00:01 2016 -0700
----------------------------------------------------------------------
asdoc/build.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7048caa5/asdoc/build.xml
----------------------------------------------------------------------
diff --git a/asdoc/build.xml b/asdoc/build.xml
index f967dba..efe63b1 100644
--- a/asdoc/build.xml
+++ b/asdoc/build.xml
@@ -79,7 +79,7 @@
<external-library-path dir="${env.AIR_HOME}/frameworks/libs/air">
<include name="airglobal.swc"/>
</external-library-path>
- <external-library-path dir="${env.FALCONJX_HOME}/../externs/google_maps/target">
+ <external-library-path dir="${FLEXJS_HOME}/js/libs">
<include name="google_maps.swc"/>
</external-library-path>
[21/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Merge
branch 'BinaryData_improvement' of https://github.com/greg-dove/flex-asjs
into develop
Posted by ah...@apache.org.
Merge branch 'BinaryData_improvement' of https://github.com/greg-dove/flex-asjs into develop
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/6e9672b5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/6e9672b5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/6e9672b5
Branch: refs/heads/spark
Commit: 6e9672b55ef5538f56c76a36e76637f462a55ebc
Parents: 13323e6 c8d147b
Author: Harbs <ha...@in-tools.com>
Authored: Wed Aug 3 10:38:20 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Wed Aug 3 10:38:20 2016 +0300
----------------------------------------------------------------------
.../flex/org/apache/flex/utils/BinaryData.as | 1089 ++++++++++++------
.../main/flex/org/apache/flex/utils/Endian.as | 31 +-
.../org/apache/flex/utils/IBinaryDataInput.as | 47 +
.../org/apache/flex/utils/IBinaryDataOutput.as | 42 +
.../test/flex/FlexUnitFlexJSApplication.mxml | 7 +-
.../flex/flexUnitTests/BinaryDataTesterTest.as | 565 +++++++++
.../src/test/flex/flexUnitTests/CoreTester.as | 28 +
.../src/test/flex/flexUnitTests/StrandTester.as | 27 -
.../flex/org/apache/flex/net/URLBinaryLoader.as | 2 +-
.../main/flex/org/apache/flex/net/URLStream.as | 2 +-
10 files changed, 1434 insertions(+), 406 deletions(-)
----------------------------------------------------------------------
[07/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Add to
new beads to manifest files.
Posted by ah...@apache.org.
Add to new beads to manifest files.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/fa40021e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/fa40021e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/fa40021e
Branch: refs/heads/spark
Commit: fa40021ed5dd43182e42f048f21c5151c0b84b71
Parents: 54fd2b4
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 13:24:24 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 13:24:24 2016 +0300
----------------------------------------------------------------------
frameworks/projects/Core/src/main/resources/basic-manifest.xml | 2 ++
frameworks/projects/Graphics/src/main/resources/svg-manifest.xml | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fa40021e/frameworks/projects/Core/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/resources/basic-manifest.xml b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
index a196a57..0131eca 100644
--- a/frameworks/projects/Core/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
@@ -36,6 +36,8 @@
<component id="ParentDocumentBead" class="org.apache.flex.core.ParentDocumentBead"/>
<component id="MixinManager" class="org.apache.flex.utils.MixinManager" />
<component id="ViewSourceContextMenuOption" class="org.apache.flex.utils.ViewSourceContextMenuOption" />
+ <component id="TransformModel" class="org.apache.flex.core.TransformModel" />
+ <component id="TransformRotateModel" class="org.apache.flex.core.TransformRotateModel" />
<component id="State" class="org.apache.flex.states.State"/>
</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fa40021e/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml b/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
index 0b49d33..08d278a 100644
--- a/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
+++ b/frameworks/projects/Graphics/src/main/resources/svg-manifest.xml
@@ -26,5 +26,6 @@
<component id="Rect" class="org.apache.flex.svg.Rect" />
<component id="CompoundGraphic" class="org.apache.flex.svg.CompoundGraphic" />
<component id="GraphicContainer" class="org.apache.flex.svg.GraphicContainer" />
- <component id="LinearGradient" class="org.apache.flex.svg.LinearGradient" />
+ <component id="TransformBead" class="org.apache.flex.svg.TransformBead" />
+ <component id="LinearGradient" class="org.apache.flex.svg.LinearGradient" />
</componentPackage>
[10/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Add
scale transform and fix default prop for compound transform.
Posted by ah...@apache.org.
Add scale transform and fix default prop for compound transform.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/766c76a0
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/766c76a0
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/766c76a0
Branch: refs/heads/spark
Commit: 766c76a0ff5645126782c53056e2e9662355547d
Parents: 92e6ec9
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 18:51:31 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 18:51:31 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 1 +
.../apache/flex/core/TransformCompoundModel.as | 12 +++++-----
.../org/apache/flex/core/TransformScaleModel.as | 24 ++++++++++++++++++++
.../Core/src/main/resources/basic-manifest.xml | 1 +
4 files changed, 32 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/766c76a0/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index ed42da0..3e86f1c 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -155,6 +155,7 @@ internal class CoreClasses
import org.apache.flex.core.TransformRotateModel; TransformRotateModel;
import org.apache.flex.core.TransformMoveXModel; TransformMoveXModel;
import org.apache.flex.core.TransformMoveYModel; TransformMoveYModel;
+ import org.apache.flex.core.TransformScaleModel; TransformScaleModel;
import org.apache.flex.utils.CSSUtils; CSSUtils;
import org.apache.flex.utils.Proxy; Proxy;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/766c76a0/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
index d2b3339..af7ee20 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
@@ -2,19 +2,19 @@ package org.apache.flex.core
{
import org.apache.flex.geom.Matrix;
+ [DefaultProperty("transformModels")]
public class TransformCompoundModel extends TransformModel
{
- private var _tranformModels:Array;
+ private var _transformModels:Array;
- [DefaultProperty("transformModels")]
- public function get tranformModels():Array
+ public function get transformModels():Array
{
- return _tranformModels;
+ return _transformModels;
}
- public function set tranformModels(value:Array):void
+ public function set transformModels(value:Array):void
{
- _tranformModels = value;
+ _transformModels = value;
if (value && value.length > 0)
{
var length:int = value.length;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/766c76a0/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
new file mode 100644
index 0000000..1ffe7d3
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
@@ -0,0 +1,24 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.Matrix;
+
+ public class TransformScaleModel extends TransformModel
+ {
+ private var _scale:Number
+ public function TransformScaleModel()
+ {
+ }
+
+ public function get scale():Number
+ {
+ return _scale;
+ }
+
+ public function set scale(value:Number):void
+ {
+ _scale = value;
+ matrix = new Matrix(scale, 0, 0, scale, 0, 0);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/766c76a0/frameworks/projects/Core/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/resources/basic-manifest.xml b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
index 4958e66..95aa8b5 100644
--- a/frameworks/projects/Core/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
@@ -41,6 +41,7 @@
<component id="TransformCompoundModel" class="org.apache.flex.core.TransformCompoundModel" />
<component id="TransformMoveXModel" class="org.apache.flex.core.TransformMoveXModel" />
<component id="TransformMoveYModel" class="org.apache.flex.core.TransformMoveYModel" />
+ <component id="TransformScaleModel" class="org.apache.flex.core.TransformScaleModel" />
<component id="State" class="org.apache.flex.states.State"/>
</componentPackage>
[38/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Merge
branch 'develop' into spark
Posted by ah...@apache.org.
Merge branch 'develop' into spark
Conflicts:
examples/flexjs/pom.xml
frameworks/projects/Binding/pom.xml
frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as
frameworks/projects/Core/pom.xml
frameworks/projects/Core/src/main/flex/org/apache/flex/events/EventDispatcher.as
frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicsContainer.as
frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cced9483
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cced9483
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cced9483
Branch: refs/heads/spark
Commit: cced94839cd31b3e1321066a52669e6888f6b77d
Parents: aaa01ca baa15e4
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 16 23:38:51 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 16 23:38:51 2016 -0700
----------------------------------------------------------------------
.gitignore | 6 +-
.mvn/extensions.xml | 19 +
ApproveFlexJS.xml | 2 +
RELEASE_NOTES | 5 +-
apache-flex-flexjs-installer-config.xml | 20 +-
asdoc/build.xml | 2 +-
build.properties | 10 +-
build.xml | 77 +-
distribution/pom.xml | 705 ++++++++
distribution/src/main/assembly/bin.xml | 30 +
.../src/main/assembly/component-air.xml | 134 ++
.../src/main/assembly/component-flash.xml | 32 +
.../src/main/assembly/component-fontkit.xml | 30 +
distribution/src/main/assembly/component.xml | 310 ++++
distribution/src/main/assembly/dir.xml | 32 +
.../src/main/assembly/filter.properties | 21 +
distribution/src/main/assembly/src.xml | 50 +
distribution/src/main/resources/air/adt | 24 +
distribution/src/main/resources/air/adt.bat | 22 +
distribution/src/main/resources/bin/acompc | 29 +
distribution/src/main/resources/bin/acompc.bat | 26 +
distribution/src/main/resources/bin/amxmlc | 29 +
distribution/src/main/resources/bin/amxmlc.bat | 26 +
distribution/src/main/resources/bin/compc | 71 +
distribution/src/main/resources/bin/compc.bat | 32 +
distribution/src/main/resources/bin/mxmlc | 71 +
distribution/src/main/resources/bin/mxmlc.bat | 33 +
distribution/src/main/resources/bin/optimizer | 62 +
.../src/main/resources/bin/optimizer.bat | 27 +
distribution/src/main/resources/bin/swcdepends | 71 +
.../src/main/resources/bin/swcdepends.bat | 31 +
distribution/src/main/resources/bin/swfdump | 62 +
distribution/src/main/resources/bin/swfdump.bat | 26 +
.../src/main/resources/flex-sdk-description.xml | 24 +
.../frameworks/air-config-template.xml | 439 +++++
.../main/resources/frameworks/air-config.xml | 440 +++++
.../frameworks/createjs-config-template.xml | 340 ++++
.../resources/frameworks/createjs-config.xml | 340 ++++
.../frameworks/flex-config-template.xml | 447 +++++
.../main/resources/frameworks/flex-config.xml | 447 +++++
.../frameworks/jquery-config-template.xml | 341 ++++
.../main/resources/frameworks/jquery-config.xml | 341 ++++
.../resources/frameworks/js-config-template.xml | 340 ++++
.../src/main/resources/frameworks/js-config.xml | 340 ++++
.../resources/frameworks/mxml-2009-manifest.xml | 45 +
.../frameworks/node-config-template.xml | 341 ++++
.../main/resources/frameworks/node-config.xml | 341 ++++
distribution/src/main/resources/js/bin/asjsc | 70 +
.../src/main/resources/js/bin/asjsc.bat | 29 +
.../src/main/resources/js/bin/asjscompc | 70 +
.../src/main/resources/js/bin/asjscompc.bat | 29 +
distribution/src/main/resources/js/bin/asnodec | 70 +
.../src/main/resources/js/bin/asnodec.bat | 29 +
distribution/src/main/resources/js/bin/compc | 70 +
.../src/main/resources/js/bin/compc.bat | 29 +
distribution/src/main/resources/js/bin/externc | 70 +
.../src/main/resources/js/bin/externc.bat | 29 +
distribution/src/main/resources/js/bin/jquery | 70 +
.../src/main/resources/js/bin/jquery.bat | 29 +
distribution/src/main/resources/js/bin/mxmlc | 70 +
.../src/main/resources/js/bin/mxmlc.bat | 29 +
examples/build.xml | 10 +
examples/build_example.xml | 8 +-
examples/flexjs/ChartExample/README.txt | 31 +
examples/flexjs/ChartExample/build.xml | 1 +
examples/flexjs/ChartExample/pom.xml | 87 +-
examples/flexjs/ChartExample/src/README.txt | 31 -
examples/flexjs/CordovaCameraExample/README.txt | 27 +
examples/flexjs/CordovaCameraExample/build.xml | 3 +-
examples/flexjs/CordovaCameraExample/pom.xml | 96 +-
.../flexjs/CordovaCameraExample/src/README.txt | 27 -
examples/flexjs/CreateJSExample/README.txt | 26 +
examples/flexjs/CreateJSExample/build.xml | 1 +
examples/flexjs/CreateJSExample/pom.xml | 94 +-
examples/flexjs/CreateJSExample/src/README.txt | 26 -
examples/flexjs/DataBindingExample/README.txt | 53 +
examples/flexjs/DataBindingExample/build.xml | 1 +
examples/flexjs/DataBindingExample/pom.xml | 86 +-
.../flexjs/DataBindingExample/src/README.txt | 53 -
.../flexjs/DataBindingExample_Flat/README.txt | 52 +
.../flexjs/DataBindingExample_Flat/build.xml | 1 +
examples/flexjs/DataBindingExample_Flat/pom.xml | 123 +-
.../DataBindingExample_Flat/src/README.txt | 52 -
examples/flexjs/DataBindingExample_as/build.xml | 1 +
examples/flexjs/DataBindingExample_as/pom.xml | 114 +-
.../src/DataBindingExample.as | 30 +-
examples/flexjs/DataGridExample/README.txt | 46 +
examples/flexjs/DataGridExample/build.xml | 3 +-
examples/flexjs/DataGridExample/pom.xml | 67 +-
examples/flexjs/DataGridExample/src/README.txt | 46 -
examples/flexjs/DesktopMap/build.xml | 3 +-
examples/flexjs/DesktopMap/pom.xml | 86 +-
examples/flexjs/FlexJSStore/build.xml | 1 +
examples/flexjs/FlexJSStore/pom.xml | 125 +-
examples/flexjs/FlexJSStore_jquery/build.xml | 1 +
examples/flexjs/FlexJSStore_jquery/pom.xml | 147 +-
.../flexjs/FlexWebsiteStatsViewer/README.txt | 23 +
.../flexjs/FlexWebsiteStatsViewer/build.xml | 1 +
examples/flexjs/FlexWebsiteStatsViewer/pom.xml | 96 +-
.../FlexWebsiteStatsViewer/src/README.txt | 23 -
examples/flexjs/HelloWorld/build.xml | 1 +
examples/flexjs/HelloWorld/pom.xml | 68 +
examples/flexjs/MapSearch/build.xml | 3 +-
examples/flexjs/MapSearch/pom.xml | 90 +-
examples/flexjs/MobileMap/README.txt | 42 +
examples/flexjs/MobileMap/build.xml | 73 +
examples/flexjs/MobileMap/pom.xml | 88 +
examples/flexjs/MobileMap/src/MobileMap.mxml | 71 +
examples/flexjs/MobileTrader/build.xml | 3 +-
examples/flexjs/MobileTrader/pom.xml | 106 +-
examples/flexjs/StorageExample/build.xml | 3 +-
examples/flexjs/StorageExample/pom.xml | 94 +-
examples/flexjs/StyleExample/build.xml | 46 +
examples/flexjs/StyleExample/pom.xml | 87 +
.../flexjs/StyleExample/src/MyInitialView.mxml | 427 +++++
.../flexjs/StyleExample/src/StyleExample.mxml | 34 +
.../flexjs/StyleExample/src/models/MyModel.as | 53 +
examples/flexjs/TodoListSampleApp/README.txt | 22 +
examples/flexjs/TodoListSampleApp/build.xml | 1 +
examples/flexjs/TodoListSampleApp/pom.xml | 70 +-
.../flexjs/TodoListSampleApp/src/README.txt | 22 -
.../todo/controllers/TodoListController.as | 25 +-
.../src/sample/todo/events/TodoListEvent.as | 7 +
.../src/sample/todo/models/TodoListModel.as | 71 +-
.../sample/todo/renderers/TodoItemRenderer.as | 21 +
.../renderers/TodoListItemRendererFactory.as | 68 +
.../src/sample/todo/views/TodoListView.mxml | 132 +-
examples/flexjs/TreeExample/build.xml | 3 +-
examples/flexjs/TreeExample/pom.xml | 65 +-
examples/flexjs/pom.xml | 100 +-
examples/native/AngularExample/pom.xml | 54 +
examples/native/ButtonExample/build.xml | 1 +
examples/native/ButtonExample/pom.xml | 54 +
examples/native/USStatesMap/build.xml | 1 +
examples/native/USStatesMap/pom.xml | 54 +
examples/native/pom.xml | 43 +-
examples/pom.xml | 142 +-
frameworks/air-config-template.xml | 1 +
frameworks/air-config.xml | 1 +
frameworks/asdoc-config.xml | 3 +-
frameworks/build.xml | 10 +-
frameworks/downloads.xml | 2 +
frameworks/flex-config-template.xml | 13 +
frameworks/flex-config.xml | 13 +
frameworks/fontsrc/build.xml | 1 +
frameworks/fontsrc/pom.xml | 145 ++
frameworks/jquery-config-template.xml | 1 +
frameworks/jquery-config.xml | 1 +
frameworks/js-config-template.xml | 1 +
frameworks/js-config.xml | 1 +
frameworks/js/FlexJS/build.xml | 6 +
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
frameworks/js/FlexJS/projects/CoreJS/.project | 18 +
.../src/main/config/compile-js-config.xml | 5 +
.../js/FlexJS/projects/CreateJSJS/build.xml | 2 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../js/FlexJS/projects/LanguageJS/build.xml | 138 ++
.../src/main/config/compile-js-config.xml | 76 +
.../src/main/config/compile-js-config.xml | 5 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../src/main/config/compile-js-config.xml | 4 +-
.../XMLJS/src/main/config/compile-js-config.xml | 5 +-
.../js/VanillaSDK/flash/events/MouseEvent.js | 18 +
frameworks/js/VanillaSDK/mx/core/UIComponent.js | 18 +
frameworks/js/VanillaSDK/other/ViewElement.js | 18 +
.../js/VanillaSDK/spark/components/Button.js | 18 +
.../js/VanillaSDK/spark/components/Group.js | 18 +
.../js/VanillaSDK/spark/components/Image.js | 18 +
.../js/VanillaSDK/spark/components/Label.js | 18 +
frameworks/node-config-template.xml | 1 +
frameworks/node-config.xml | 1 +
frameworks/pom.xml | 32 +-
frameworks/projects/Binding/pom.xml | 125 +-
.../flex/binding/ApplicationDataBinding.as | 20 +-
.../apache/flex/binding/ContainerDataBinding.as | 20 +-
.../flex/binding/MXMLBeadViewDataBinding.as | 20 +-
.../org/apache/flex/binding/ViewDataBinding.as | 21 +-
frameworks/projects/Charts/pom.xml | 195 +-
.../Charts/src/main/flex/ChartsClasses.as | 3 +
.../apache/flex/charts/beads/AxisBaseBead.as | 15 +-
.../org/apache/flex/charts/beads/ChartView.as | 107 +-
.../DataItemRendererFactoryForSeriesData.as | 1 +
.../controllers/ChartSeriesMouseController.as | 140 ++
.../flex/charts/beads/layouts/PieChartLayout.as | 4 +-
.../beads/models/ChartArraySelectionModel.as | 75 +
.../org/apache/flex/charts/core/IAxisBead.as | 2 +-
.../apache/flex/charts/core/IChartDataModel.as | 42 +
.../flex/charts/core/IChartItemRenderer.as | 11 +
.../flex/charts/optimized/SVGBoxItemRenderer.as | 12 +-
.../flex/charts/optimized/SVGChartAxisGroup.as | 14 +-
.../flex/charts/optimized/SVGChartDataGroup.as | 4 +-
.../optimized/SVGLineSegmentItemRenderer.as | 14 +-
.../charts/optimized/SVGWedgeItemRenderer.as | 14 +-
.../charts/supportClasses/BoxItemRenderer.as | 18 +-
.../charts/supportClasses/ChartAxisGroup.as | 12 +-
.../supportClasses/ILineSegmentItemRenderer.as | 2 +-
.../charts/supportClasses/IWedgeItemRenderer.as | 4 +-
.../supportClasses/LineSegmentItemRenderer.as | 4 +-
.../charts/supportClasses/WedgeItemRenderer.as | 175 +-
.../Charts/src/main/resources/defaults.css | 29 +-
frameworks/projects/Collections/pom.xml | 120 +-
.../src/main/flex/CollectionsClasses.as | 1 +
.../org/apache/flex/collections/Collection.as | 65 +
frameworks/projects/Core/pom.xml | 115 +-
.../projects/Core/src/main/flex/CoreClasses.as | 33 +-
.../projects/Core/src/main/flex/Namespace.as | 135 --
frameworks/projects/Core/src/main/flex/QName.as | 170 --
.../org/apache/flex/core/CSSFontFaceBead.as | 2 +-
.../flex/org/apache/flex/core/IBeadTransform.as | 45 +
.../flex/org/apache/flex/core/ITransformHost.as | 63 +
.../org/apache/flex/core/ITransformModel.as | 47 +
.../apache/flex/core/TransformCompoundModel.as | 44 +
.../flex/org/apache/flex/core/TransformModel.as | 68 +
.../org/apache/flex/core/TransformMoveXModel.as | 43 +
.../org/apache/flex/core/TransformMoveYModel.as | 43 +
.../apache/flex/core/TransformRotateModel.as | 46 +
.../org/apache/flex/core/TransformScaleModel.as | 42 +
.../flex/org/apache/flex/events/DetailEvent.as | 60 +
.../main/flex/org/apache/flex/events/Event.as | 5 +-
.../org/apache/flex/events/EventDispatcher.as | 20 +-
.../flex/org/apache/flex/events/MouseEvent.as | 2 +
.../org/apache/flex/events/ProgressEvent.as | 79 +
.../main/flex/org/apache/flex/geom/Matrix.as | 263 +++
.../src/main/flex/org/apache/flex/geom/Point.as | 101 +-
.../main/flex/org/apache/flex/geom/Rectangle.as | 248 ++-
.../flex/org/apache/flex/utils/BinaryData.as | 1079 +++++++++--
.../flex/org/apache/flex/utils/BrowserUtils.as | 62 +
.../main/flex/org/apache/flex/utils/CSSUtils.as | 151 +-
.../flex/org/apache/flex/utils/ColorUtil.as | 165 ++
.../main/flex/org/apache/flex/utils/Endian.as | 87 +
.../org/apache/flex/utils/IBinaryDataInput.as | 47 +
.../org/apache/flex/utils/IBinaryDataOutput.as | 42 +
.../main/flex/org/apache/flex/utils/Language.as | 432 -----
.../flex/org/apache/flex/utils/MixinManager.as | 18 +-
.../flex/org/apache/flex/utils/PointUtils.as | 82 +-
.../flex/org/apache/flex/utils/StringPadder.as | 69 +
.../flex/org/apache/flex/utils/StringTrimmer.as | 9 +-
.../flex/org/apache/flex/utils/StringUtil.as | 335 ++++
.../main/flex/org/apache/flex/utils/Timer.as | 17 +
.../main/flex/org/apache/flex/utils/UIDUtil.as | 258 +++
.../Core/src/main/resources/basic-manifest.xml | 6 +
.../test/flex/FlexUnitFlexJSApplication.mxml | 7 +-
.../flex/flexUnitTests/BinaryDataTesterTest.as | 565 ++++++
.../src/test/flex/flexUnitTests/CoreTester.as | 28 +
.../src/test/flex/flexUnitTests/StrandTester.as | 27 -
frameworks/projects/CreateJS/pom.xml | 224 ++-
.../src/main/config/compile-as-config.xml | 1 +
.../flex/org/apache/flex/createjs/CheckBox.as | 4 +-
.../main/flex/org/apache/flex/createjs/Label.as | 4 +-
.../flex/org/apache/flex/createjs/TextButton.as | 4 +-
.../apache/flex/createjs/core/CreateJSBase.as | 6 +-
.../org/apache/flex/createjs/core/UIBase.as | 12 +-
.../org/apache/flex/createjs/graphics/Circle.as | 10 +-
.../flex/createjs/graphics/GraphicShape.as | 8 +-
.../org/apache/flex/createjs/graphics/Rect.as | 10 +-
.../org/apache/flex/createjs/tween/Effect.as | 4 +-
.../org/apache/flex/createjs/tween/Sequence.as | 56 +-
.../org/apache/flex/createjs/tween/Tween.as | 57 +-
.../CreateJS/src/main/resources/defaults.css | 6 +
frameworks/projects/DragDrop/pom.xml | 120 +-
frameworks/projects/Effects/pom.xml | 120 +-
.../org/apache/flex/effects/PlatformWiper.as | 11 +-
frameworks/projects/Flat/pom.xml | 206 +--
frameworks/projects/Formatters/pom.xml | 147 +-
frameworks/projects/GoogleMaps/pom.xml | 145 +-
.../projects/Graphics/.actionScriptProperties | 27 +-
frameworks/projects/Graphics/.flexLibProperties | 5 +-
frameworks/projects/Graphics/pom.xml | 124 +-
.../Graphics/src/main/flex/GraphicsClasses.as | 30 +-
.../org/apache/flex/core/graphics/Circle.as | 96 -
.../org/apache/flex/core/graphics/Ellipse.as | 89 -
.../apache/flex/core/graphics/GradientBase.as | 229 ---
.../apache/flex/core/graphics/GradientEntry.as | 133 --
.../apache/flex/core/graphics/GraphicShape.as | 213 ---
.../flex/core/graphics/GraphicsContainer.as | 344 ----
.../flex/org/apache/flex/core/graphics/IFill.as | 32 -
.../org/apache/flex/core/graphics/IStroke.as | 29 -
.../apache/flex/core/graphics/LinearGradient.as | 123 --
.../flex/org/apache/flex/core/graphics/Path.as | 95 -
.../flex/org/apache/flex/core/graphics/Rect.as | 85 -
.../org/apache/flex/core/graphics/SolidColor.as | 112 --
.../flex/core/graphics/SolidColorStroke.as | 130 --
.../flex/org/apache/flex/core/graphics/Text.as | 139 --
.../graphics/utils/AdvancedLayoutFeatures.as | 1140 ------------
.../core/graphics/utils/CompoundTransform.as | 777 --------
.../core/graphics/utils/IAssetLayoutFeatures.as | 371 ----
.../flex/core/graphics/utils/MatrixUtil.as | 1605 ----------------
.../flex/core/graphics/utils/PathHelper.as | 1712 ------------------
.../core/graphics/utils/TransformOffsets.as | 367 ----
.../flex/org/apache/flex/graphics/CubicCurve.as | 56 +
.../org/apache/flex/graphics/GradientBase.as | 229 +++
.../org/apache/flex/graphics/GradientEntry.as | 133 ++
.../flex/org/apache/flex/graphics/ICircle.as | 20 +
.../apache/flex/graphics/ICompoundGraphic.as | 31 +
.../flex/org/apache/flex/graphics/IEllipse.as | 20 +
.../main/flex/org/apache/flex/graphics/IFill.as | 32 +
.../org/apache/flex/graphics/IGraphicShape.as | 30 +
.../main/flex/org/apache/flex/graphics/IPath.as | 20 +
.../org/apache/flex/graphics/IPathCommand.as | 29 +
.../main/flex/org/apache/flex/graphics/IRect.as | 20 +
.../flex/org/apache/flex/graphics/IStroke.as | 39 +
.../main/flex/org/apache/flex/graphics/IText.as | 20 +
.../flex/org/apache/flex/graphics/LineStyle.as | 59 +
.../flex/org/apache/flex/graphics/LineTo.as | 47 +
.../flex/org/apache/flex/graphics/MoveTo.as | 47 +
.../org/apache/flex/graphics/PathBuilder.as | 295 +++
.../org/apache/flex/graphics/QuadraticCurve.as | 51 +
.../flex/org/apache/flex/graphics/SolidColor.as | 134 ++
.../apache/flex/graphics/SolidColorStroke.as | 267 +++
.../graphics/utils/AdvancedLayoutFeatures.as | 1140 ++++++++++++
.../flex/graphics/utils/CompoundTransform.as | 777 ++++++++
.../flex/graphics/utils/IAssetLayoutFeatures.as | 371 ++++
.../apache/flex/graphics/utils/MatrixUtil.as | 1605 ++++++++++++++++
.../apache/flex/graphics/utils/PathHelper.as | 1712 ++++++++++++++++++
.../flex/graphics/utils/TransformOffsets.as | 367 ++++
.../src/main/flex/org/apache/flex/svg/Circle.as | 118 ++
.../flex/org/apache/flex/svg/CompoundGraphic.as | 585 ++++++
.../main/flex/org/apache/flex/svg/DOMWrapper.as | 56 +
.../main/flex/org/apache/flex/svg/Ellipse.as | 152 ++
.../org/apache/flex/svg/GraphicContainer.as | 208 +++
.../flex/org/apache/flex/svg/GraphicShape.as | 225 +++
.../flex/org/apache/flex/svg/LinearGradient.as | 126 ++
.../src/main/flex/org/apache/flex/svg/Path.as | 133 ++
.../src/main/flex/org/apache/flex/svg/Rect.as | 156 ++
.../src/main/flex/org/apache/flex/svg/Text.as | 150 ++
.../flex/org/apache/flex/svg/TransformBead.as | 106 ++
.../src/main/resources/basic-manifest.xml | 14 +-
.../src/main/resources/svg-manifest.xml | 31 +
frameworks/projects/HTML/pom.xml | 227 ++-
.../projects/HTML/src/main/flex/HTMLClasses.as | 7 +-
.../main/flex/org/apache/flex/html/CheckBox.as | 3 +-
.../main/flex/org/apache/flex/html/DataGrid.as | 2 +
.../org/apache/flex/html/DataGridButtonBar.as | 51 +
.../flex/html/DataGridButtonBarTextButton.as | 55 +
.../flex/org/apache/flex/html/DateChooser.as | 18 +-
.../src/main/flex/org/apache/flex/html/Label.as | 66 +-
.../flex/org/apache/flex/html/NumericStepper.as | 60 +-
.../flex/org/apache/flex/html/RadioButton.as | 13 +-
.../main/flex/org/apache/flex/html/Slider.as | 2 +-
.../main/flex/org/apache/flex/html/Spinner.as | 55 +-
.../flex/org/apache/flex/html/TextButton.as | 1 +
.../flex/html/accessories/CheckBoxIcon.as | 92 -
.../flex/html/accessories/RadioButtonIcon.as | 111 --
.../apache/flex/html/beads/CSSTextButtonView.as | 5 +-
.../apache/flex/html/beads/DataGridLinesBead.as | 14 +-
.../org/apache/flex/html/beads/DataGridView.as | 6 +-
...ererFactoryAndEventDispatcherForArrayData.as | 191 ++
.../apache/flex/html/beads/DateChooserView.as | 158 +-
.../flex/html/beads/DecrementButtonView.as | 10 +-
.../org/apache/flex/html/beads/ISpinnerView.as | 18 +-
.../flex/html/beads/IncrementButtonView.as | 10 +-
.../flex/org/apache/flex/html/beads/ListView.as | 15 +-
.../apache/flex/html/beads/RangeStepperView.as | 4 +-
.../apache/flex/html/beads/SimpleAlertView.as | 23 +-
.../flex/html/beads/SolidBackgroundBead.as | 6 +-
.../org/apache/flex/html/beads/SpinnerView.as | 109 +-
.../controllers/DateChooserMouseController.as | 3 +-
.../controllers/ItemRendererMouseController.as | 8 +-
.../ListSingleSelectionMouseController.as | 1 -
.../beads/controllers/SpinnerMouseController.as | 51 +-
.../flex/html/beads/layouts/TileLayout.as | 70 +-
.../ButtonBarButtonItemRenderer.as | 4 +-
.../flex/html/supportClasses/CheckBoxIcon.as | 92 +
.../DataGridButtonBarButtonItemRenderer.as | 81 +
.../html/supportClasses/DataItemRenderer.as | 1 +
.../html/supportClasses/DateChooserButton.as | 12 +-
.../html/supportClasses/DateHeaderButton.as | 48 +
.../html/supportClasses/GraphicsItemRenderer.as | 4 +-
.../flex/html/supportClasses/RadioButtonIcon.as | 111 ++
.../flex/html/supportClasses/SpinnerButton.as | 31 +
.../HTML/src/main/resources/basic-manifest.xml | 4 +-
.../HTML/src/main/resources/defaults.css | 16 +-
frameworks/projects/HTML5/pom.xml | 155 +-
frameworks/projects/JQuery/pom.xml | 170 +-
frameworks/projects/Language/build.xml | 119 ++
frameworks/projects/Language/pom.xml | 60 +
.../src/main/config/compile-as-config.xml | 69 +
.../Language/src/main/flex/LanguageClasses.as | 38 +
.../Language/src/main/flex/Namespace.as | 148 ++
.../projects/Language/src/main/flex/QName.as | 170 ++
.../main/flex/org/apache/flex/utils/Language.as | 443 +++++
frameworks/projects/Mobile/pom.xml | 190 +-
.../src/main/config/compile-as-config.xml | 1 +
.../Mobile/src/main/flex/CordovaClasses.as | 3 +-
.../apache/cordova/geolocation/Geolocation.as | 48 +
.../flex/mobile/beads/ToggleSwitchView.as | 6 +-
.../src/main/resources/cordova-manifest.xml | 1 +
frameworks/projects/Network/pom.xml | 120 +-
.../Network/src/main/flex/NetworkClasses.as | 4 +-
.../flex/org/apache/flex/net/BinaryUploader.as | 67 +-
.../flex/org/apache/flex/net/HTTPConstants.as | 141 ++
.../flex/org/apache/flex/net/HTTPService.as | 108 +-
.../main/flex/org/apache/flex/net/HTTPUtils.as | 46 +
.../flex/org/apache/flex/net/URLBinaryLoader.as | 189 ++
.../main/flex/org/apache/flex/net/URLLoader.as | 188 ++
.../main/flex/org/apache/flex/net/URLRequest.as | 95 +
.../main/flex/org/apache/flex/net/URLStream.as | 366 ++++
frameworks/projects/Reflection/pom.xml | 104 +-
frameworks/projects/Storage/pom.xml | 143 +-
frameworks/projects/XML/pom.xml | 129 +-
frameworks/projects/XML/src/main/flex/XML.as | 2 +-
.../projects/XML/src/main/flex/XMLList.as | 11 +
frameworks/projects/pom.xml | 115 +-
...ew Flex Project to FlexJS MVC Project.launch | 18 +
...rt New Flex Project to FlexJS Project.launch | 18 +
ide/flashbuilder/FlexJS (Cordova Build).launch | 20 +-
ide/flashbuilder/FlexJS (Cordova Run).launch | 20 +-
installer.properties/en_US.properties | 11 +-
installer.xml | 8 +
manualtests/.gitignore | 1 +
.../FlexJSTest_SVG/src/GraphicsView.mxml | 24 +-
manualtests/FlexJSTest_SVG/src/SkinsView.mxml | 15 +-
manualtests/VanillaSDK_POC/src/Example.as | 20 +-
manualtests/VanillaSDK_POC/src/Main.mxml | 20 +-
maven.xml | 472 -----
maven/flexjs-artifact.pom | 11 -
maven/flexjs-framework-framework.pom | 11 -
maven/flexjs-framework.pom | 141 --
migrate-to-maven.sh | 38 -
pom.xml | 360 ++--
settings-template.xml | 18 +
432 files changed, 30362 insertions(+), 13405 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/apache-flex-flexjs-installer-config.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/examples/flexjs/pom.xml
----------------------------------------------------------------------
diff --cc examples/flexjs/pom.xml
index 1ab28d3,baed66d..37372b5
--- a/examples/flexjs/pom.xml
+++ b/examples/flexjs/pom.xml
@@@ -20,63 -20,79 +20,79 @@@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.flex.flexjs.examples</groupId>
- <artifactId>examples</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>examples-flexjs</artifactId>
+ <parent>
+ <groupId>org.apache.flex.flexjs.examples</groupId>
+ <artifactId>examples</artifactId>
<version>0.7.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ </parent>
+
+ <artifactId>examples-flexjs</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Apache Flex - FlexJS: Examples: FlexJS</name>
- <modules>
- <module>ChartExample</module>
- <module>CordovaCameraExample</module>
- <module>CreateJSExample</module>
- <module>DataBindingExample</module>
- <module>DataBindingExample_as</module><!-- Flash error -->
- <module>DataBindingExample_Flat</module>
- <module>DataGridExample</module>
- <module>DesktopMap</module>
- <module>FlexJSStore</module>
- <module>FlexJSStore_jquery</module>
- <module>FlexWebsiteStatsViewer</module>
- <module>HelloWorld</module>
- <module>MapSearch</module>
- <module>MobileMap</module>
- <module>MobileTrader</module>
- <module>StorageExample</module>
- <module>StyleExample</module>
- <module>TodoListSampleApp</module>
- <module>TreeExample</module>
- </modules>
+ <modules>
+ <module>ChartExample</module>
+ <module>CordovaCameraExample</module>
+ <module>CreateJSExample</module>
+ <module>DataBindingExample</module>
- <!-- Needs "depends" support -->
- <!--module>DataBindingExample_as</module-->
++ <module>DataBindingExample_as</module>
+ <module>DataBindingExample_Flat</module>
+ <module>DataGridExample</module>
+ <module>DesktopMap</module>
- <!-- Ambiguous "MouseEvent" -->
- <!--module>FlexJSStore</module-->
- <!-- Ambiguous "MouseEvent" -->
- <!--module>FlexJSStore_jquery</module-->
- <!-- Ambiguous "MouseEvent" -->
- <!--module>FlexWebsiteStatsViewer</module-->
++ <module>FlexJSStore</module>
++ <module>FlexJSStore_jquery</module>
++ <module>FlexWebsiteStatsViewer</module>
++ <module>HelloWorld</module>
+ <module>MapSearch</module>
- <!-- Implicit coercion of a value with static type Event to a possibly unrelated type Event. -->
- <!--module>MobileTrader</module-->
- <!-- Ambiguous reference to IDataInput -->
- <!--module>StorageExample</module-->
++ <module>MobileMap</module>
++ <module>MobileTrader</module>
++ <module>StorageExample</module>
++ <module>StyleExample</module>
+ <module>TodoListSampleApp</module>
+ <module>TreeExample</module>
+ </modules>
- <dependencies>
- <dependency>
- <groupId>com.adobe.flash.framework</groupId>
- <artifactId>playerglobal</artifactId>
- <version>20.0</version>
- <type>swc</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.flex.flexjs.framework</groupId>
- <artifactId>Core</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <type>swc</type>
- </dependency>
- <dependency>
- <groupId>org.apache.flex.flexjs.framework</groupId>
- <artifactId>HTML</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <type>swc</type>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>Core</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>Language</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>HTML</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>Collections</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>Binding</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.flex.flexjs.framework</groupId>
+ <artifactId>Graphics</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <type>swc</type>
+ </dependency>
+ </dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/build.xml
----------------------------------------------------------------------
diff --cc frameworks/build.xml
index 7328482,e849d3f..e45e00b
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@@ -136,8 -136,8 +137,9 @@@
<ant dir="${basedir}/projects/HTML" target="clean"/>
<ant dir="${basedir}/projects/HTML5" target="clean"/>
<ant dir="${basedir}/projects/JQuery" target="clean"/>
+ <ant dir="${basedir}/projects/Language" target="clean"/>
<ant dir="${basedir}/projects/Mobile" target="clean"/>
+ <ant dir="${basedir}/projects/MX" target="clean"/>
<ant dir="${basedir}/projects/Network" target="clean"/>
<ant dir="${basedir}/projects/Reflection" target="clean"/>
<ant dir="${basedir}/projects/Storage" target="clean"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/flex-config-template.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/flex-config.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/ChartView.as
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IChartItemRenderer.as
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
index 1db0996,bc2fbe3..bec2374
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as
@@@ -25,9 -25,8 +25,9 @@@ package org.apache.flex.charts.optimize
import org.apache.flex.core.IItemRenderer;
import org.apache.flex.core.IItemRendererParent;
import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IVisualElement;
import org.apache.flex.core.UIBase;
- import org.apache.flex.core.graphics.GraphicsContainer;
+ import org.apache.flex.svg.CompoundGraphic;
import org.apache.flex.events.Event;
import org.apache.flex.geom.Point;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Core/src/main/flex/CoreClasses.as
index 149e506,3e86f1c..7a87f72
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@@ -122,13 -129,16 +129,18 @@@ internal class CoreClasse
{
import org.apache.flex.utils.PNGEncoder; PNGEncoder;
import org.apache.flex.utils.SolidBorderUtil; SolidBorderUtil;
- import org.apache.flex.utils.StringTrimmer; StringTrimmer;
import org.apache.flex.utils.HTMLLoader; HTMLLoader;
}
+ import org.apache.flex.utils.BrowserUtils; BrowserUtils;
+ import org.apache.flex.utils.Endian; Endian;
+ import org.apache.flex.utils.StringPadder; StringPadder;
+ import org.apache.flex.utils.StringTrimmer; StringTrimmer;
+ import org.apache.flex.utils.StringUtil; StringUtil;
import org.apache.flex.utils.Timer; Timer;
+ import org.apache.flex.utils.UIDUtil; UIDUtil;
import org.apache.flex.utils.UIUtils; UIUtils;
+ import org.apache.flex.utils.Display; Display;
+ import org.apache.flex.utils.Platform; Platform;
import org.apache.flex.core.ClassFactory; ClassFactory;
import org.apache.flex.states.AddItems; AddItems;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Core/src/main/flex/org/apache/flex/events/Event.as
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
index a3debe3,c2aa7de..08aea55
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
@@@ -18,40 -18,7 +18,6 @@@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.geom
{
- COMPILE::SWF
- {
- import flash.geom.Rectangle;
- }
-
- /**
- * The Rectangle class is a utility class for holding four coordinates of
- * a rectangle
- *
- * The ActionScript version simply wraps flash.geom.Rectangle to enable cross
- * compilation.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::SWF
- public class Rectangle extends flash.geom.Rectangle
- {
- public function Rectangle(x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0)
- {
- super(x, y, width, height);
- }
-
- /**
- * Convert rectangles of other types to this Rectangle type.
- */
- public static function convert(obj:Object):org.apache.flex.geom.Rectangle
- {
- return new org.apache.flex.geom.Rectangle(obj.x, obj.y, obj.width, obj.height);
- }
- }
--
/**
* The Rectangle class is a utility class for holding four coordinates of
* a rectangle
@@@ -95,31 -74,186 +73,187 @@@ public class Rectangl
}
public function set bottom(value:Number):void
{
- height = value - top;
+ height = value - y;
}
+
- public function get x():Number
+ public function clone():Rectangle
{
- return left;
+ return new Rectangle(x,y,width,height);
}
- public function set x(value:Number):void
+ public function get topLeft():Point
{
- left = value;
+ return new Point(x, y);
}
- public function get y():Number
+ public function set topLeft(value:Point):void
{
- return top;
+ width = width + (x - value.x);
+ height = height + (y - value.y);
+ x = value.x;
+ y = value.y;
}
-
- public function set y(value:Number):void
+
+ public function get bottomRight():Point
+ {
+ return new Point(right, bottom);
+ }
+
+ public function set bottomRight(value:Point):void
+ {
+ width = value.x - x;
+ height = value.y - y;
+ }
+
+ public function get size():Point
+ {
+ return new Point(width, height);
+ }
+
+ public function set size(value:Point):void
+ {
+ width = value.x;
+ height = value.y;
+ }
+
+ public function isEmpty():Boolean
+ {
+ return width <= 0 || height <= 0;
+ }
+
+ public function setEmpty():void
+ {
+ x = 0;
+ y = 0;
+ width = 0;
+ height = 0;
+ }
+
+ public function inflate(dx:Number, dy:Number):void
+ {
+ x = x - dx;
+ width = width + 2 * dx;
+ y = y - dy;
+ height = height + 2 * dy;
+ }
+
+ public function inflatePoint(point:Point):void
+ {
+ x = x - point.x;
+ width = width + 2 * point.x;
+ y = y - point.y;
+ height = height + 2 * point.y;
+ }
+
+ public function offset(dx:Number, dy:Number):void
+ {
+ x = x + dx;
+ y = y + dy;
+ }
+
+ public function offsetPoint(point:Point):void
+ {
+ x = x + point.x;
+ y = y + point.y;
+ }
+
+ public function contains(x:Number, y:Number):Boolean
+ {
+ return x >= x && x < x + width && y >= y && y < y + height;
+ }
+
+ public function containsPoint(point:Point):Boolean
+ {
+ return point.x >= x && point.x < x + width && point.y >= y && point.y < y + height;
+ }
+
+ public function containsRect(rect:Rectangle):Boolean
+ {
+ var r1:Number = rect.x + rect.width;
+ var b1:Number = rect.y + rect.height;
+ var r2:Number = x + width;
+ var b2:Number = y + height;
+ return rect.x >= x && rect.x < r2 && rect.y >= y && rect.y < b2 && r1 > x && r1 <= r2 && b1 > y && b1 <= b2;
+ }
+
+ public function intersection(toIntersect:Rectangle):Rectangle
+ {
+ var result:Rectangle = new Rectangle();
+ if (isEmpty() || toIntersect.isEmpty())
+ {
+ result.setEmpty();
+ return result;
+ }
+ result.x = Math.max(x, toIntersect.x);
+ result.y = Math.max(y, toIntersect.y);
+ result.width = Math.min(x + width, toIntersect.x + toIntersect.width) - result.x;
+ result.height = Math.min(y + height, toIntersect.y + toIntersect.height) - result.y;
+ if (result.width <= 0 || result.height <= 0)
+ {
+ result.setEmpty();
+ }
+ return result;
+ }
+
+ public function intersects(toIntersect:Rectangle):Boolean
+ {
+ if (isEmpty() || toIntersect.isEmpty())
+ {
+ return false;
+ }
+ var resultx:Number = Math.max(x, toIntersect.x);
+ var resulty:Number = Math.max(y, toIntersect.y);
+ var resultwidth:Number = Math.min(x + width, toIntersect.x + toIntersect.width) - resultx;
+ var resultheight:Number = Math.min(y + height, toIntersect.y + toIntersect.height) - resulty;
+ if (resultwidth <= 0 || resultheight <= 0)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public function union(toUnion:Rectangle):Rectangle
+ {
+ var r:Rectangle = null;
+ if (isEmpty())
+ {
+ return toUnion.clone();
+ }
+ if (toUnion.isEmpty())
+ {
+ return clone();
+ }
+ r = new Rectangle();
+ r.x = Math.min(x, toUnion.x);
+ r.y = Math.min(y, toUnion.y);
+ r.width = Math.max(x + width, toUnion.x + toUnion.width) - r.x;
+ r.height = Math.max(y + height, toUnion.y + toUnion.height) - r.y;
+ return r;
+ }
+
+ public function equals(toCompare:Rectangle):Boolean
+ {
+ return toCompare.x == x && toCompare.y == y && toCompare.width == width && toCompare.height == height;
+ }
+
+ public function toString():String
+ {
+ return "(x=" + x + ", y=" + y + ", w=" + width + ", h=" + height + ")";
+ }
+
+ public function copyFrom(sourceRect:Rectangle):void
{
- top = value;
+ x = sourceRect.x;
+ y = sourceRect.y;
+ width = sourceRect.width;
+ height = sourceRect.height;
}
- public static function convert(obj:Object):org.apache.flex.geom.Rectangle
+ public function setTo(xa:Number, ya:Number, widtha:Number, heighta:Number):void
{
- return new org.apache.flex.geom.Rectangle(obj.x, obj.y, obj.width, obj.height);
+ x = xa;
+ y = ya;
+ width = widtha;
+ height = heighta;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
----------------------------------------------------------------------
diff --cc frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
index c661ad3,ef00687..8a7cedb
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
@@@ -58,32 -58,33 +58,32 @@@ package org.apache.flex.util
* @productversion FlexJS 0.0
* @flexjsignorecoercion HTMLElement
*/
- COMPILE::SWF
- public static function globalToLocal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
+ public static function globalToLocal( pt:flash.geom.Point, local:Object ):org.apache.flex.geom.Point
{
- var fpt:flash.geom.Point = DisplayObject(local).globalToLocal(pt);
- return new org.apache.flex.geom.Point(fpt.x, fpt.y);
- }
-
- COMPILE::JS
- public static function globalToLocal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
- {
- var x:Number = pt.x;
- var y:Number = pt.y;
- var element:HTMLElement = local.element as HTMLElement;
-
- do {
- x -= element.offsetLeft;
- y -= element.offsetTop;
- if (local.hasOwnProperty('parent')) {
- local = local.parent;
- element = local.element as HTMLElement;
- } else {
- element = null;
- }
+ COMPILE::SWF
+ {
+ var fpt:flash.geom.Point = DisplayObject(local).globalToLocal(new flash.geom.Point(pt.x,pt.y));
+ return new org.apache.flex.geom.Point(fpt.x, fpt.y);
}
- while (element);
- return new org.apache.flex.geom.Point(x, y);
+ COMPILE::JS
+ {
+ var x:Number = pt.x;
+ var y:Number = pt.y;
+ var element:HTMLElement = local.element as HTMLElement;
+
+ do {
+ x -= element.offsetLeft;
+ y -= element.offsetTop;
+ if (local.hasOwnProperty('parent')) {
+ local = local.parent;
+ element = local.element as HTMLElement;
+ } else {
+ element = null;
+ }
+ }
+ while (element);
+ return new org.apache.flex.geom.Point(x, y);
-
- }
++ }
}
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/UIBase.as
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --cc frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
index db09068,0af846a..65220d3
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
@@@ -150,42 -184,32 +184,31 @@@ package org.apache.flex.html.bead
dayContainer = new Container();
var tileLayout:TileLayout = new TileLayout();
dayContainer.addBead(tileLayout);
- UIBase(_strand).addElement(dayContainer);
-
+ UIBase(_strand).addElement(dayContainer, false);
-
tileLayout.numColumns = 7;
- dayContainer.x = 0;
- dayContainer.y = monthLabel.y + monthLabel.height + 5;
-
- var sw:Number = UIBase(_strand).width;
- var sh:Number = UIBase(_strand).height;
- //trace("Strand's width x height is "+sw+" x "+sh);
- dayContainer.width = sw;
- dayContainer.height = sh - (monthLabel.height+5);
-
+
// the calendar has 7 columns with 6 rows, the first row are the day names
for(var i:int=0; i < 7; i++) {
var dayName:DateChooserButton = new DateChooserButton();
dayName.text = model.dayNames[i];
dayName.dayOfMonth = 0;
- dayContainer.addElement(dayName, false);
+ dayContainer.addElementNoChangeEvent(dayName);
}
-
+
_dayButtons = new Array();
-
+
for(i=0; i < 42; i++) {
var date:DateChooserButton = new DateChooserButton();
date.text = String(i+1);
- dayContainer.addElement(date, false);
+ dayContainer.addElementNoChangeEvent(date);
dayButtons.push(date);
}
-
- IEventDispatcher(dayContainer).dispatchEvent( new Event("itemsCreated") );
- IEventDispatcher(_strand).dispatchEvent( new Event("layoutNeeded") );
- IEventDispatcher(dayContainer).dispatchEvent( new Event("layoutNeeded") );
-
+
+ IEventDispatcher(dayContainer).dispatchEvent( new Event("itemsCreated") );
+
updateCalendar();
}
-
+
/**
* @private
*/
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/frameworks/projects/Mobile/src/main/flex/org/apache/flex/mobile/beads/ToggleSwitchView.as
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cced9483/manualtests/VanillaSDK_POC/src/Example.as
----------------------------------------------------------------------
[12/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - more
changes to try to get things to run
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/managers/systemClasses/ChildManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/systemClasses/ChildManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/systemClasses/ChildManager.as
new file mode 100644
index 0000000..9129891
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/systemClasses/ChildManager.as
@@ -0,0 +1,489 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers.systemClasses
+{
+
+COMPILE::SWF
+{
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.InteractiveObject;
+import flash.events.IEventDispatcher;
+import flex.events.FlashEventConverter;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.DisplayObjectContainer;
+ import flex.display.InteractiveObject;
+ import flex.events.IEventDispatcher;
+}
+
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModule;
+import mx.core.IFlexModuleFactory;
+import mx.core.IFontContextComponent;
+import mx.core.IInvalidating;
+import mx.core.IUIComponent;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+import mx.managers.ILayoutManagerClient;
+import mx.managers.ISystemManager;
+import mx.managers.ISystemManagerChildManager;
+import mx.managers.SystemManager;
+COMPILE::LATER
+{
+import mx.messaging.config.LoaderConfig;
+}
+import mx.preloaders.Preloader;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.utils.LoaderUtil;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+public class ChildManager implements ISystemManagerChildManager
+{
+ include "../../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * <p>This is the starting point for all Flex applications.
+ * This class is set to be the root class of a Flex SWF file.
+ * Flash Player instantiates an instance of this class,
+ * causing this constructor to be called.</p>
+ */
+ public function ChildManager(systemManager:IFlexModuleFactory)
+ {
+ super();
+
+ if (systemManager is ISystemManager)
+ {
+ systemManager["childManager"] = this;
+ this.systemManager = ISystemManager(systemManager);
+ this.systemManager.registerImplementation("mx.managers::ISystemManagerChildManager", this);
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var systemManager:ISystemManager;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Child management
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function addingChild(child:DisplayObject):void
+ {
+ var newNestLevel:int = 1;
+
+ // non-top level system managers may not be able to reference their parent if
+ // they are a proxy for popups.
+ if (!topLevel && DisplayObject(systemManager).parent)
+ {
+ // non-topLevel SystemManagers are buried by Flash.display.Loader and
+ // other non-framework layers so we have to figure out the nestlevel
+ // by searching up the parent chain.
+ var obj:DisplayObjectContainer = DisplayObject(systemManager).parent.parent;
+ while (obj)
+ {
+ if (obj is ILayoutManagerClient)
+ {
+ newNestLevel = ILayoutManagerClient(obj).nestLevel + 1;
+ break;
+ }
+ obj = obj.parent;
+ }
+ }
+ nestLevel = newNestLevel;
+
+ if (child is IUIComponent)
+ IUIComponent(child).systemManager = systemManager;
+
+ // If the document property isn't already set on the child,
+ // set it to be the same as this component's document.
+ // The document setter will recursively set it on any
+ // descendants of the child that exist.
+ if (child is IUIComponent &&
+ !IUIComponent(child).document)
+ {
+ IUIComponent(child).document = systemManager.document;
+ }
+
+ // Set the moduleFactory to the child, but don't overwrite an existing moduleFactory.
+ if (child is IFlexModule && IFlexModule(child).moduleFactory == null)
+ IFlexModule(child).moduleFactory = systemManager;
+
+ // Set the font context in non-UIComponent children.
+ // UIComponent children use moduleFactory.
+ if (child is IFontContextComponent && !child is UIComponent &&
+ IFontContextComponent(child).fontContext == null)
+ IFontContextComponent(child).fontContext = systemManager;
+
+ // Set the nestLevel of the child to be one greater
+ // than the nestLevel of this component.
+ // The nestLevel setter will recursively set it on any
+ // descendants of the child that exist.
+ if (child is ILayoutManagerClient)
+ ILayoutManagerClient(child).nestLevel = nestLevel + 1;
+
+ COMPILE::LATER
+ {
+ if (child is InteractiveObject)
+ if (InteractiveObject(systemManager).doubleClickEnabled)
+ InteractiveObject(child).doubleClickEnabled = true;
+ }
+
+ if (child is IUIComponent)
+ IUIComponent(child).parentChanged(DisplayObjectContainer(systemManager));
+
+ // Sets up the inheritingStyles and nonInheritingStyles objects
+ // and their proto chains so that getStyle() works.
+ // If this object already has some children,
+ // then reinitialize the children's proto chains.
+ if (child is IStyleClient)
+ IStyleClient(child).regenerateStyleCache(true);
+
+ if (child is ISimpleStyleClient)
+ ISimpleStyleClient(child).styleChanged(null);
+
+ if (child is IStyleClient)
+ IStyleClient(child).notifyStyleChangeInChildren(null, true);
+
+ // Need to check to see if the child is an UIComponent
+ // without actually linking in the UIComponent class.
+ if (child is UIComponent)
+ UIComponent(child).initThemeColor();
+
+ // Inform the component that it's style properties
+ // have been fully initialized. Most components won't care,
+ // but some need to react to even this early change.
+ if (child is UIComponent)
+ UIComponent(child).stylesInitialized();
+ }
+
+ /**
+ * @private
+ */
+ public function childAdded(child:DisplayObject):void
+ {
+ if (child.hasEventListener(FlexEvent.ADD))
+ child.dispatchEvent(new FlexEvent(FlexEvent.ADD));
+
+ if (child is IUIComponent)
+ IUIComponent(child).initialize(); // calls child.createChildren()
+ }
+
+ /**
+ * @private
+ */
+ public function removingChild(child:DisplayObject):void
+ {
+ if (child.hasEventListener(FlexEvent.REMOVE))
+ child.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
+ }
+
+ /**
+ * @private
+ */
+ public function childRemoved(child:DisplayObject):void
+ {
+ if (child is IUIComponent)
+ IUIComponent(child).parentChanged(null);
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Styles
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Call regenerateStyleCache() on all children of this SystemManager.
+ * If the recursive parameter is true, continue doing this
+ * for all descendants of these children.
+ */
+ public function regenerateStyleCache(recursive:Boolean):void
+ {
+ var foundTopLevelWindow:Boolean = false;
+
+ var n:int = systemManager.rawChildren.numChildren;
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IStyleClient =
+ systemManager.rawChildren.getChildAt(i) as IStyleClient;
+
+ if (child)
+ child.regenerateStyleCache(recursive);
+
+ if (isTopLevelWindow(DisplayObject(child)))
+ foundTopLevelWindow = true;
+
+ // Refetch numChildren because notifyStyleChangedInChildren()
+ // can add/delete a child and therefore change numChildren.
+ n = systemManager.rawChildren.numChildren;
+ }
+
+ // During startup the top level window isn't added
+ // to the child list until late into the startup sequence.
+ // Make sure we call regenerateStyleCache()
+ // on the top level window even if it isn't a child yet.
+ if (!foundTopLevelWindow && topLevelWindow is IStyleClient)
+ IStyleClient(topLevelWindow).regenerateStyleCache(recursive);
+ }
+
+ /**
+ * @private
+ * Call styleChanged() and notifyStyleChangeInChildren()
+ * on all children of this SystemManager.
+ * If the recursive parameter is true, continue doing this
+ * for all descendants of these children.
+ */
+ public function notifyStyleChangeInChildren(styleProp:String,
+ recursive:Boolean):void
+ {
+ var foundTopLevelWindow:Boolean = false;
+
+ var n:int = systemManager.rawChildren.numChildren;
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IStyleClient =
+ systemManager.rawChildren.getChildAt(i) as IStyleClient;
+
+ if (child)
+ {
+ child.styleChanged(styleProp);
+ child.notifyStyleChangeInChildren(styleProp, recursive);
+ }
+
+ if (isTopLevelWindow(DisplayObject(child)))
+ foundTopLevelWindow = true;
+
+ // Refetch numChildren because notifyStyleChangedInChildren()
+ // can add/delete a child and therefore change numChildren.
+ n = systemManager.rawChildren.numChildren;
+ }
+
+ // During startup the top level window isn't added
+ // to the child list until late into the startup sequence.
+ // Make sure we call notifyStyleChangeInChildren()
+ // on the top level window even if it isn't a child yet.
+ if (!foundTopLevelWindow && topLevelWindow is IStyleClient)
+ {
+ IStyleClient(topLevelWindow).styleChanged(styleProp);
+ IStyleClient(topLevelWindow).notifyStyleChangeInChildren(
+ styleProp, recursive);
+ }
+ }
+
+ /**
+ * @private
+ * Instantiates an instance of the top level window
+ * and adds it as a child of the SystemManager.
+ */
+ public function initializeTopLevelWindow(width:Number, height:Number):void
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:mx.utils.PerfUtil = mx.utils.PerfUtil.getInstance();
+ perfUtil.markTime("ChildManager.initializeTopLevelWindow().start");
+ perfUtil.markTime("SystemManager.create().start");
+ }
+
+ var app:IUIComponent;
+ // Create a new instance of the toplevel class
+ systemManager.document = app = topLevelWindow = IUIComponent(systemManager.create());
+ COMPILE::SWF
+ {
+ FlashEventConverter.setupAllConverters(app as DisplayObject);
+ }
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("SystemManager.create().end");
+ }
+
+ if (systemManager.document)
+ {
+ // Add listener for the creationComplete event
+ IEventDispatcher(app).addEventListener(FlexEvent.CREATION_COMPLETE,
+ appCreationCompleteHandler);
+
+ COMPILE::LATER
+ {
+ // if somebody has set this in our applicationdomain hierarchy, don't overwrite it
+ if (!LoaderConfig._url)
+ {
+ LoaderConfig._url = LoaderUtil.normalizeURL(systemManager.loaderInfo);
+ LoaderConfig._parameters = systemManager.loaderInfo.parameters;
+ LoaderConfig._swfVersion = systemManager.loaderInfo.swfVersion;
+ }
+ }
+
+ IFlexDisplayObject(app).setActualSize(width, height);
+
+ // Wait for the app to finish its initialization sequence
+ // before doing an addChild().
+ // Otherwise, the measurement/layout code will cause the
+ // player to do a bunch of unnecessary screen repaints,
+ // which slows application startup time.
+
+ // Pass the application instance to the preloader.
+ // Note: preloader can be null when the user chooses
+ // Control > Play in the standalone player.
+ if (preloader)
+ preloader.registerApplication(app);
+
+ // The Application doesn't get added to the SystemManager in the standard way.
+ // We want to recursively create the entire application subtree and process
+ // it with the LayoutManager before putting the Application on the display list.
+ // So here we what would normally happen inside an override of addChild().
+ // Leter, when we actually attach the Application instance,
+ // we call super.addChild(), which is the bare player method.
+ addingChild(DisplayObject(app));
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("Application.createChildren().start");
+ }
+
+ childAdded(DisplayObject(app)); // calls app.createChildren()
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("Application.createChildren().end");
+ }
+ }
+ else
+ {
+ systemManager.document = this;
+ }
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("ChildManager.initializeTopLevelWindow().end");
+ }
+ }
+
+ /**
+ * Override this function if you want to perform any logic
+ * when the application has finished initializing itself.
+ */
+ private function appCreationCompleteHandler(event:FlexEvent):void
+ {
+ if (!topLevel && DisplayObject(systemManager).parent)
+ {
+ var obj:DisplayObjectContainer = DisplayObject(systemManager).parent.parent;
+ while (obj)
+ {
+ if (obj is IInvalidating)
+ {
+ IInvalidating(obj).invalidateSize();
+ IInvalidating(obj).invalidateDisplayList();
+ return;
+ }
+ obj = obj.parent;
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods to implement SystemManager methods
+ //
+ // systemManager may be a SystemManager or WindowedSystemManager
+ // so we use the array access operertor to get at the methods/properties.
+ //
+ //--------------------------------------------------------------------------
+
+ private function isTopLevelWindow(object:DisplayObject):Boolean
+ {
+ return systemManager["isTopLevelWindow"](object);
+ }
+
+
+ private function get topLevel():Boolean
+ {
+ return systemManager["topLevel"];
+ }
+
+ private function set topLevel(topLevel:Boolean):void
+ {
+ systemManager["topLevel"] = topLevel;
+ }
+
+ private function get topLevelWindow():IUIComponent
+ {
+ return systemManager["topLevelWindow"];
+ }
+
+ private function set topLevelWindow(window:IUIComponent):void
+ {
+ systemManager["topLevelWindow"] = window;
+ }
+
+ private function get nestLevel():int
+ {
+ return systemManager["nestLevel"];
+ }
+
+ private function set nestLevel(level:int):void
+ {
+ systemManager["nestLevel"] = level;
+ }
+
+ private function get preloader():Preloader
+ {
+ return systemManager["preloader"];
+ }
+
+ private function set preloader(preloader:Preloader):void
+ {
+ systemManager["preloader"] = preloader;
+ }
+}
+
+}
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/preloaders/DownloadProgressBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/preloaders/DownloadProgressBar.as b/frameworks/projects/MX/src/main/flex/mx/preloaders/DownloadProgressBar.as
new file mode 100644
index 0000000..b5114d9
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/preloaders/DownloadProgressBar.as
@@ -0,0 +1,1916 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.preloaders
+{
+
+COMPILE::LATER
+{
+import flash.display.GradientType;
+import flash.display.Graphics;
+import flash.display.Loader;
+import flash.display.LoaderInfo;
+import flash.events.IOErrorEvent;
+import flash.geom.Matrix;
+import flash.geom.Rectangle;
+import flash.net.URLRequest;
+import flash.system.ApplicationDomain;
+import flash.system.LoaderContext;
+import flash.text.TextField;
+import flash.text.TextFormat;
+import flash.utils.getDefinitionByName;
+import flash.utils.getTimer;
+import mx.events.FlexEvent;
+import mx.events.RSLEvent;
+import mx.geom.RoundedRectangle;
+import mx.graphics.RectangularDropShadow;
+}
+COMPILE::SWF
+{
+import flash.display.Sprite;
+import flash.events.Event;
+import flash.events.ProgressEvent;
+}
+COMPILE::JS
+{
+import flex.display.DisplayObject;
+import flex.display.Sprite;
+import flex.events.Event;
+import flex.events.ProgressEvent;
+}
+
+
+/**
+ * The DownloadProgressBar class displays download progress.
+ * It is used by the Preloader control to provide user feedback
+ * while the application is downloading and loading.
+ *
+ * <p>The download progress bar displays information about
+ * two different phases of the application:
+ * the download phase and the initialization phase. </p>
+ *
+ * <p>In the Application container, use the
+ * the <code>preloader</code> property to specify the name of your subclass.</p>
+ *
+ * <p>You can implement a custom download progress bar component
+ * by creating a subclass of the DownloadProgressBar class.
+ * Do not implement a download progress bar as an MXML component
+ * because it loads too slowly.</p>
+ *
+ * @see mx.core.Application
+ * @see mx.preloaders.IPreloaderDisplay
+ * @see mx.preloaders.Preloader
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class DownloadProgressBar extends Sprite implements IPreloaderDisplay
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function DownloadProgressBar()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The minimum number of milliseconds
+ * that the display should appear visible.
+ * If the downloading and initialization of the application
+ * takes less time than this value, then Flex pauses for this amount
+ * of time before dispatching the <code>complete</code> event.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var MINIMUM_DISPLAY_TIME:uint = 0;
+
+ /**
+ * The percentage of the progress bar that the downloading phase
+ * fills when the SWF file is fully downloaded.
+ * The rest of the progress bar is filled during the initializing phase.
+ * This should be a value from 0 to 100.
+ *
+ * @default 60
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected var DOWNLOAD_PERCENTAGE:uint = 60;
+
+ /**
+ * @private
+ */
+ private var _showProgressBar:Boolean = true;
+
+ /**
+ * @private
+ * Cached Rectangle returned by the labelRect getter.
+ */
+ COMPILE::LATER
+ private var _labelRect:Rectangle = labelRect;
+
+ /**
+ * @private
+ * Cached Rectangle returned by the percentRect getter.
+ */
+ COMPILE::LATER
+ private var _percentRect:Rectangle = percentRect;
+
+ /**
+ * @private
+ * Cached RoundedRectangle returned by the borderRect getter.
+ */
+ COMPILE::LATER
+ private var _borderRect:RoundedRectangle = borderRect;
+
+ /**
+ * @private
+ * Cached RoundedRectangle returned by the barFrameRect getter.
+ */
+ COMPILE::LATER
+ private var _barFrameRect:RoundedRectangle = barFrameRect;
+
+ /**
+ * @private
+ * Cached RoundedRectangle returned by the barRect getter.
+ */
+ COMPILE::LATER
+ private var _barRect:RoundedRectangle = barRect;
+
+ /**
+ * @private
+ */
+ private var _xOffset:Number = 20;
+
+ /**
+ * @private
+ */
+ private var _yOffset:Number = 20;
+
+ /**
+ * @private
+ */
+ private var _maximum:Number = 0;
+
+ /**
+ * @private
+ */
+ private var _value:Number = 0;
+
+ /**
+ * @private
+ */
+ private var _barSprite:Sprite;
+
+ /**
+ * @private
+ */
+ private var _barFrameSprite:Sprite;
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private var _labelObj:TextField;
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private var _percentObj:TextField;
+
+ /**
+ * @private
+ */
+ private var _startTime:int;
+
+ /**
+ * @private
+ */
+ private var _displayTime:int;
+
+ /**
+ * @private
+ */
+ private var _startedLoading:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var _startedInit:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var _showingDisplay:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var _displayStartCount:uint = 0;
+
+ /**
+ * @private
+ */
+ private var _initProgressCount:uint = 0;
+
+ /**
+ * The total number of validation events you expect to get
+ * in the initializing phase. This should be an integer
+ * greater or equal to 4 (and note that if it is greater than 4
+ * you might have an inefficiency in your initialization code)
+ *
+ * @default 6
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ protected var initProgressTotal:uint = 6;
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // visible
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the visible property.
+ */
+ private var _visible:Boolean = false;
+
+ /**
+ * Specifies whether the download progress bar is visible.
+ *
+ * <p>When the Preloader control determines that the progress bar should be displayed,
+ * it sets this value to <code>true</code>. When the Preloader control determines that
+ * the progress bar should be hidden, it sets the value to <code>false</code>.</p>
+ *
+ * <p>A subclass of the DownloadProgressBar class should never modify this property.
+ * Instead, you can override the setter method to recognize when
+ * the Preloader control modifies it, and perform any necessary actions. </p>
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ override public function get visible():Boolean
+ {
+ return _visible;
+ }
+
+ /**
+ * @private
+ */
+ override public function set visible(value:Boolean):void
+ {
+ COMPILE::LATER
+ {
+ if (!_visible && value)
+ show();
+
+ else if (_visible && !value )
+ hide();
+ }
+
+ _visible = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties: IPreloaderDisplay
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // backgroundAlpha
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the backgroundAlpha property.
+ */
+ private var _backgroundAlpha:Number = 1;
+
+ /**
+ * Alpha level of the SWF file or image defined by
+ * the <code>backgroundImage</code> property, or the color defined by
+ * the <code>backgroundColor</code> property.
+ * Valid values range from 0 to 1.0.
+ *
+ * <p>You can specify either a <code>backgroundColor</code>
+ * or a <code>backgroundImage</code>, but not both.</p>
+ *
+ * @default 1.0
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get backgroundAlpha():Number
+ {
+ if (!isNaN(_backgroundAlpha))
+ return _backgroundAlpha;
+ else
+ return 1;
+ }
+
+ /**
+ * @private
+ */
+ public function set backgroundAlpha(value:Number):void
+ {
+ _backgroundAlpha = value;
+ }
+
+ //----------------------------------
+ // backgroundColor
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the backgroundColor property.
+ */
+ private var _backgroundColor:uint;
+
+ /**
+ * Background color of a download progress bar.
+ * You can have either a <code>backgroundColor</code> or a
+ * <code>backgroundImage</code>, but not both.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get backgroundColor():uint
+ {
+ return _backgroundColor;
+ }
+
+ /**
+ * @private
+ */
+ public function set backgroundColor(value:uint):void
+ {
+ _backgroundColor = value;
+ }
+
+ //----------------------------------
+ // backgroundImage
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the backgroundImage property.
+ */
+ private var _backgroundImage:Object;
+
+ /**
+ * The background image of the application,
+ * which is passed in by the preloader.
+ * You can specify either a <code>backgroundColor</code>
+ * or a <code>backgroundImage</code>, but not both.
+ *
+ * <p>A value of null means "not set".
+ * If this style and the <code>backgroundColor</code> style are undefined,
+ * the component has a transparent background.</p>
+ *
+ * <p>The preloader does not display embedded images.
+ * You can only use images loaded at runtime.</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get backgroundImage():Object
+ {
+ return _backgroundImage;
+ }
+
+ /**
+ * @private
+ */
+ public function set backgroundImage(value:Object):void
+ {
+ _backgroundImage = value;
+ }
+
+ //----------------------------------
+ // backgroundSize
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the backgroundSize property.
+ */
+ private var _backgroundSize:String = "";
+
+ /**
+ * Scales the image specified by <code>backgroundImage</code>
+ * to different percentage sizes.
+ * A value of <code>"100%"</code> stretches the image
+ * to fit the entire component.
+ * To specify a percentage value, you must include the percent sign (%).
+ * A value of <code>"auto"</code>, maintains
+ * the original size of the image.
+ *
+ * @default "auto"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get backgroundSize():String
+ {
+ return _backgroundSize;
+ }
+
+ /**
+ * @private
+ */
+ public function set backgroundSize(value:String):void
+ {
+ _backgroundSize = value;
+ }
+
+ //----------------------------------
+ // preloader
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the preloader property.
+ */
+ private var _preloader:Sprite;
+
+ /**
+ * The Preloader class passes in a reference to itself to the display class
+ * so that it can listen for events from the preloader.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function set preloader(value:Sprite):void
+ {
+ _preloader = value;
+
+ COMPILE::LATER
+ {
+ value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+ value.addEventListener(Event.COMPLETE, completeHandler);
+
+ value.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
+ value.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
+ value.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
+
+ value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
+ value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
+ }
+ }
+
+ //----------------------------------
+ // stageHeight
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the stageHeight property.
+ */
+ private var _stageHeight:Number = 375;
+
+ /**
+ * The height of the stage,
+ * which is passed in by the Preloader class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get stageHeight():Number
+ {
+ return _stageHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set stageHeight(value:Number):void
+ {
+ _stageHeight = value;
+ }
+
+ //----------------------------------
+ // stageWidth
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the stageHeight property.
+ */
+ private var _stageWidth:Number = 500;
+
+ /**
+ * The width of the stage,
+ * which is passed in by the Preloader class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get stageWidth():Number
+ {
+ return _stageWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set stageWidth(value:Number):void
+ {
+ _stageWidth = value;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // barFrameRect
+ //----------------------------------
+
+ /**
+ * The dimensions of the progress bar border.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get barFrameRect():RoundedRectangle
+ {
+ return new RoundedRectangle(14, 40, 154, 4);
+ }
+
+ //----------------------------------
+ // barRect
+ //----------------------------------
+
+ /**
+ * The dimensions of the progress bar.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get barRect():RoundedRectangle
+ {
+ return new RoundedRectangle(14, 39, 154, 6, 0);
+ }
+
+ //----------------------------------
+ // borderRect
+ //----------------------------------
+
+ /**
+ * The dimensions of the border of the display.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get borderRect():RoundedRectangle
+ {
+ return new RoundedRectangle(0, 0, 182, 60, 4);
+ }
+
+ //----------------------------------
+ // downloadingLabel
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the downloadingLabel property.
+ */
+ private var _downloadingLabel:String = "Loading";
+
+ /**
+ * The string to display as the label while in the downloading phase.
+ *
+ * @default "Loading"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function get downloadingLabel():String
+ {
+ return _downloadingLabel;
+ }
+
+ /**
+ * @private
+ */
+ protected function set downloadingLabel(value:String):void
+ {
+ _downloadingLabel = value;
+ }
+
+ //----------------------------------
+ // initializingLabel
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the initializingLabel property.
+ */
+ private static var _initializingLabel:String = "Initializing";
+
+ /**
+ * The string to display as the label while in the initializing phase.
+ *
+ * @default "Initializing"
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function get initializingLabel():String
+ {
+ return _initializingLabel;
+ }
+
+ /**
+ * @private
+ */
+ public static function set initializingLabel(value:String):void
+ {
+ _initializingLabel = value;
+ }
+
+ //----------------------------------
+ // label
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the label property.
+ */
+ COMPILE::LATER
+ private var _label:String = "";
+
+ /**
+ * Text to display when the progress bar is active.
+ * The Preloader class sets this value
+ * before displaying the progress bar.
+ * Implementing this property in a subclass is optional.
+ *
+ * @default ""
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get label():String
+ {
+ return _label;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ protected function set label(value:String):void
+ {
+ if (!(value is Function))
+ _label = value;
+
+ draw();
+ }
+
+ //----------------------------------
+ // labelFormat
+ //----------------------------------
+
+ /**
+ * The TextFormat object of the TextField component of the label.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get labelFormat():TextFormat
+ {
+ var tf:TextFormat = new TextFormat();
+ tf.color = 0x333333;
+ tf.font = "Verdana";
+ tf.size = 10;
+ return tf;
+ }
+
+ //----------------------------------
+ // labelRect
+ //----------------------------------
+
+ /**
+ * The dimensions of the TextField component for the label.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get labelRect():Rectangle
+ {
+ return new Rectangle(14, 17, 100, 16);
+ }
+
+ //----------------------------------
+ // percentFormat
+ //----------------------------------
+
+ /**
+ * The TextFormat of the TextField component for displaying the percent.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get percentFormat():TextFormat
+ {
+ var tf:TextFormat = new TextFormat();
+ tf.align = "right";
+ tf.color = 0x000000;
+ tf.font = "Verdana";
+ tf.size = 10;
+ return tf;
+ }
+
+ //----------------------------------
+ // percentRect
+ //----------------------------------
+
+ /**
+ * The dimensions of the TextField component for displaying the percent.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get percentRect():Rectangle
+ {
+ return new Rectangle(108, 4, 34, 16);
+ }
+
+ //----------------------------------
+ // showLabel
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the showLabel property.
+ */
+ COMPILE::LATER
+ private var _showLabel:Boolean = true;
+
+ /**
+ * Controls whether to display the label, <code>true</code>,
+ * or not, <code>false</code>.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get showLabel():Boolean
+ {
+ return _showLabel;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ protected function set showLabel(value:Boolean):void
+ {
+ _showLabel = value;
+
+ draw();
+ }
+
+ //----------------------------------
+ // showPercentage
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the showPercentage property.
+ */
+ COMPILE::LATER
+ private var _showPercentage:Boolean = false;
+
+ /**
+ * Controls whether to display the percentage, <code>true</code>,
+ * or not, <code>false</code>.
+ *
+ * @default true
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function get showPercentage():Boolean
+ {
+ return _showPercentage;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ protected function set showPercentage(value:Boolean):void
+ {
+ _showPercentage = value;
+
+ draw();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods:IPreloaderDisplay
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Called by the Preloader after the download progress bar
+ * has been added as a child of the Preloader.
+ * This should be the starting point for configuring your download progress bar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function initialize():void
+ {
+ COMPILE::LATER
+ {
+ _startTime = getTimer();
+
+ center(stageWidth, stageHeight);
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Centers the download progress bar based on the passed in dimensions.
+ *
+ * @param width The width of the area in which to center the download progress bar.
+ *
+ * @param height The height of the area in which to center the download progress bar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function center(width:Number, height:Number):void
+ {
+ _xOffset = Math.floor((width - _borderRect.width) / 2);
+ _yOffset = Math.floor((height - _borderRect.height) / 2);
+ }
+
+ /**
+ * @private
+ * Updates the display.
+ */
+ COMPILE::LATER
+ private function draw():void
+ {
+ var percentage:Number;
+
+ if (_startedLoading)
+ {
+ if (!_startedInit)
+ {
+ // 0 to MaxDL Percentage
+ percentage = Math.round(getPercentLoaded(_value, _maximum) *
+ DOWNLOAD_PERCENTAGE / 100);
+ }
+ else
+ {
+ // MaxDL percentage to 100
+ percentage = Math.round((getPercentLoaded(_value, _maximum) *
+ (100 - DOWNLOAD_PERCENTAGE) / 100) +
+ DOWNLOAD_PERCENTAGE);
+ }
+ }
+ else
+ {
+ percentage = getPercentLoaded(_value, _maximum);
+ }
+
+ if (_labelObj)
+ _labelObj.text = _label;
+
+ if (_percentObj)
+ {
+ if (!_showPercentage)
+ {
+ _percentObj.visible = false;
+ _percentObj.text = "";
+ }
+ else
+ {
+ _percentObj.text = String(percentage) + "%";
+ }
+ }
+
+ if (_barSprite && _barFrameSprite)
+ {
+ if (!_showProgressBar)
+ {
+ _barSprite.visible = false;
+ _barFrameSprite.visible = false;
+ }
+ else
+ {
+ drawProgressBar(percentage);
+ }
+ }
+ }
+
+ /**
+ * Creates the subcomponents of the display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function createChildren():void
+ {
+ COMPILE::LATER
+ {
+ var g:Graphics = graphics;
+
+ var labelObj:TextField;
+ var percentObj:TextField;
+
+ // Draw the background first
+ // Same value as StyleManager.NOT_A_COLOR. However, we don't want to bring in StyleManager at this point.
+ if (backgroundColor != 0xFFFFFFFF)
+ {
+ g.beginFill(backgroundColor, backgroundAlpha);
+ g.drawRect(0, 0, stageWidth, stageHeight);
+ }
+
+ if (backgroundImage != null)
+ loadBackgroundImage(backgroundImage);
+
+ _barFrameSprite = new Sprite();
+ _barSprite = new Sprite();
+
+ addChild(_barFrameSprite);
+ addChild(_barSprite);
+
+ // Draw the outside border and fill.
+ g.beginFill(0xCCCCCC, 0.4);
+ g.drawRoundRect(calcX(_borderRect.x),
+ calcY(_borderRect.y),
+ _borderRect.width,
+ _borderRect.height,
+ _borderRect.cornerRadius * 2,
+ _borderRect.cornerRadius * 2);
+ g.drawRoundRect(calcX(_borderRect.x + 1),
+ calcY(_borderRect.y + 1),
+ _borderRect.width - 2,
+ _borderRect.height - 2,
+ _borderRect.cornerRadius - 1 * 2,
+ _borderRect.cornerRadius - 1 * 2);
+ g.endFill();
+
+ g.beginFill(0xCCCCCC,0.4);
+ g.drawRoundRect(calcX(_borderRect.x + 1),
+ calcY(_borderRect.y + 1),
+ _borderRect.width - 2,
+ _borderRect.height - 2,
+ _borderRect.cornerRadius - 1 * 2,
+ _borderRect.cornerRadius - 1 * 2);
+ g.endFill();
+
+ var frame_g:Graphics = _barFrameSprite.graphics;
+
+ // Draw the bar frame border and fill
+ var matrix:Matrix = new Matrix();
+ matrix.createGradientBox(_barFrameRect.width, _barFrameRect.height,
+ Math.PI / 2, calcX(_barFrameRect.x), calcY(_barFrameRect.y));
+
+ frame_g.beginGradientFill(GradientType.LINEAR,
+ [ 0x5C6266, 0xB5B8BA ],
+ [ 1.0, 1.0 ],
+ [ 0, 0xFF ],
+ matrix);
+ frame_g.drawRoundRect(calcX(_barFrameRect.x),
+ calcY(_barFrameRect.y),
+ _barFrameRect.width,
+ _barFrameRect.height,
+ _barFrameRect.cornerRadius * 2,
+ _barFrameRect.cornerRadius * 2);
+ frame_g.drawRoundRect(calcX(_barFrameRect.x + 1),
+ calcY(_barFrameRect.y + 1),
+ _barFrameRect.width - 2,
+ _barFrameRect.height - 2,
+ _barFrameRect.cornerRadius * 2,
+ _barFrameRect.cornerRadius * 2);
+ frame_g.endFill();
+
+ // Attach the label TextField.
+ _labelObj = new TextField();
+ _labelObj.x = calcX(_labelRect.x);
+ _labelObj.y = calcY(_labelRect.y);
+ _labelObj.width = _labelRect.width;
+ _labelObj.height = _labelRect.height;
+ _labelObj.selectable = false;
+ _labelObj.defaultTextFormat = labelFormat;
+ addChild(_labelObj);
+
+ // Attach the percentage TextField.
+ _percentObj = new TextField();
+ _percentObj.x = calcX(_percentRect.x);
+ _percentObj.y = calcY(_percentRect.y);
+ _percentObj.width = _percentRect.width;
+ _percentObj.height = _percentRect.height;
+ _percentObj.selectable = false;
+ _percentObj.defaultTextFormat = percentFormat;
+ addChild(_percentObj);
+
+ // Create dropshadow
+ var ds:RectangularDropShadow = new RectangularDropShadow();
+ ds.color = 0x000000;
+ ds.angle = 90;
+ ds.alpha = .6;
+ ds.distance = 2;
+ ds.tlRadius = ds.trRadius = ds.blRadius = ds.brRadius = _borderRect.cornerRadius;
+ ds.drawShadow(g,
+ calcX(_borderRect.x),
+ calcY(_borderRect.y),
+ _borderRect.width,
+ _borderRect.height);
+
+ // Draw the top line
+ g.lineStyle(1,0xFFFFFF, .3);
+ g.moveTo(calcX(_borderRect.x) + _borderRect.cornerRadius, calcY(_borderRect.y));
+ g.lineTo(calcX(_borderRect.x) - _borderRect.cornerRadius + _borderRect.width, calcY(_borderRect.y));
+ }
+ }
+
+ /**
+ * @private
+ * Draws the progress bar.
+ */
+ private function drawProgressBar(percentage:Number):void
+ {
+ COMPILE::LATER
+ {
+ var g:Graphics = _barSprite.graphics;
+ g.clear();
+
+ var colors:Array = [ 0xFFFFFF, 0xFFFFFF ];
+ var ratios:Array = [ 0, 0xFF ];
+ var matrix:Matrix = new Matrix();
+
+ // Middle
+ var barWidth:Number = _barRect.width * percentage / 100;
+ var barWidthSplit:Number = barWidth / 2;
+ var barHeight:Number = _barRect.height-4;
+ var barX:Number = calcX(_barRect.x);
+ var barY:Number = calcY(_barRect.y) + 2;
+ var barY2:Number;
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .39, .85],
+ ratios, matrix);
+
+ g.drawRect(barX, barY, barWidthSplit, barHeight);
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX + barWidthSplit, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [.85, 1.0],
+ ratios, matrix);
+ g.drawRect(barX + barWidthSplit, barY, barWidthSplit, barHeight);
+
+ // Outer highlight
+ barWidthSplit = barWidth / 3;
+ barHeight = _barRect.height;
+ barY = calcY(_barRect.y);
+ barY2 = barY + barHeight - 1;
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .05, .15],
+ ratios, matrix);
+
+ g.drawRect(barX, barY, barWidthSplit, 1);
+ g.drawRect(barX, barY2, barWidthSplit, 1);
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX + barWidthSplit, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .15, .25],
+ ratios, matrix);
+
+ g.drawRect(barX + barWidthSplit, barY, barWidthSplit, 1);
+ g.drawRect(barX + barWidthSplit, barY2, barWidthSplit, 1);
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX + barWidthSplit * 2, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .25, .1],
+ ratios, matrix);
+
+ g.drawRect(barX + barWidthSplit * 2, barY, barWidthSplit, 1);
+ g.drawRect(barX + barWidthSplit * 2, barY2, barWidthSplit, 1);
+
+ // Inner highlight
+ barWidthSplit = barWidth / 3;
+ barHeight = _barRect.height;
+ barY = calcY(_barRect.y) + 1;
+ barY2 = calcY(_barRect.y) + barHeight - 2;
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .15, .30],
+ ratios, matrix);
+
+ g.drawRect(barX, barY, barWidthSplit, 1);
+ g.drawRect(barX, barY2, barWidthSplit, 1);
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX + barWidthSplit, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .30, .40],
+ ratios, matrix);
+
+ g.drawRect(barX + barWidthSplit, barY, barWidthSplit, 1);
+ g.drawRect(barX + barWidthSplit, barY2, barWidthSplit, 1);
+
+ matrix.createGradientBox(barWidthSplit, barHeight,
+ 0, barX + barWidthSplit * 2, barY);
+ g.beginGradientFill(GradientType.LINEAR, colors, [ .40, .25],
+ ratios, matrix);
+
+ g.drawRect(barX + barWidthSplit * 2, barY, barWidthSplit, 1);
+ g.drawRect(barX + barWidthSplit * 2, barY2, barWidthSplit, 1);
+ }
+ }
+
+ /**
+ * Updates the display of the download progress bar
+ * with the current download information.
+ * A typical implementation divides the loaded value by the total value
+ * and displays a percentage.
+ * If you do not implement this method, you should create
+ * a progress bar that displays an animation to indicate to the user
+ * that a download is occurring.
+ *
+ * <p>The <code>setProgress()</code> method is only called
+ * if the application is being downloaded from a remote server
+ * and the application is not in the browser cache.</p>
+ *
+ * @param completed Number of bytes of the application SWF file
+ * that have been downloaded.
+ *
+ * @param total Size of the application SWF file in bytes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function setProgress(completed:Number, total:Number):void
+ {
+ if (!isNaN(completed) &&
+ !isNaN(total) &&
+ completed >= 0 &&
+ total > 0)
+ {
+ _value = Number(completed);
+ _maximum = Number(total);
+ draw();
+ }
+ }
+
+ /**
+ * Returns the percentage value of the application loaded.
+ *
+ * @param loaded Number of bytes of the application SWF file
+ * that have been downloaded.
+ *
+ * @param total Size of the application SWF file in bytes.
+ *
+ * @return The percentage value of the loaded application.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function getPercentLoaded(loaded:Number, total:Number):Number
+ {
+ var perc:Number;
+
+ if (loaded == 0 || total == 0 || isNaN(total) || isNaN(loaded))
+ return 0;
+ else
+ perc = 100 * loaded/total;
+
+ if (isNaN(perc) || perc <= 0)
+ return 0;
+ else if (perc > 99)
+ return 99;
+ else
+ return Math.round(perc);
+ }
+
+ /**
+ * @private
+ * Make the display class visible.
+ */
+ COMPILE::LATER
+ private function show():void
+ {
+ _showingDisplay = true;
+ calcScale();
+ draw();
+ _displayTime = getTimer(); // Time when the display is shown.
+ }
+
+ /**
+ * @private
+ */
+ private function hide():void
+ {
+ }
+
+ /**
+ * @private
+ */
+ private function calcX(base:Number):Number
+ {
+ return base + _xOffset;
+ }
+
+ /**
+ * @private
+ */
+ private function calcY(base:Number):Number
+ {
+ return base + _yOffset;
+ }
+
+ /**
+ * @private
+ * Figure out the scale for the display class based on the stage size.
+ * Then creates the children subcomponents.
+ */
+ COMPILE::LATER
+ private function calcScale():void
+ {
+ if (stageWidth < 160 || stageHeight < 120)
+ {
+ scaleX = 1.0;
+ scaleY = 1.0;
+ }
+ else if (stageWidth < 240 || stageHeight < 150)
+ {
+ // Scale to appropriate size
+ createChildren();
+ var scale:Number = Math.min(stageWidth / 240.0,
+ stageHeight / 150.0);
+ scaleX = scale;
+ scaleY = scale;
+ }
+ else
+ {
+ createChildren();
+ }
+ }
+
+ /**
+ * Defines the algorithm for determining whether to show
+ * the download progress bar while in the download phase.
+ *
+ * @param elapsedTime number of milliseconds that have elapsed
+ * since the start of the download phase.
+ *
+ * @param event The ProgressEvent object that contains
+ * the <code>bytesLoaded</code> and <code>bytesTotal</code> properties.
+ *
+ * @return If the return value is <code>true</code>, then show the
+ * download progress bar.
+ * The default behavior is to show the download progress bar
+ * if more than 700 milliseconds have elapsed
+ * and if Flex has downloaded less than half of the bytes of the SWF file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function showDisplayForDownloading(elapsedTime:int,
+ event:ProgressEvent):Boolean
+ {
+ return elapsedTime > 700 &&
+ event.bytesLoaded < event.bytesTotal / 2;
+ }
+
+ /**
+ * Defines the algorithm for determining whether to show the download progress bar
+ * while in the initialization phase, assuming that the display
+ * is not currently visible.
+ *
+ * @param elapsedTime number of milliseconds that have elapsed
+ * since the start of the download phase.
+ *
+ * @param count number of times that the <code>initProgress</code> event
+ * has been received from the application.
+ *
+ * @return If <code>true</code>, then show the download progress bar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function showDisplayForInit(elapsedTime:int, count:int):Boolean
+ {
+ return elapsedTime > 300 && count == 2;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private function loadBackgroundImage(classOrString:Object):void
+ {
+ var cls:Class;
+
+ // The "as" operator checks to see if classOrString
+ // can be coerced to a Class
+ if (classOrString && classOrString as Class)
+ {
+ // Load background image given a class pointer
+ cls = Class(classOrString);
+ initBackgroundImage(new cls());
+ }
+ else if (classOrString && classOrString is String)
+ {
+ try
+ {
+ cls = Class(getDefinitionByName(String(classOrString)));
+ }
+ catch(e:Error)
+ {
+ // ignore
+ }
+
+ if (cls)
+ {
+ var newStyleObj:DisplayObject = new cls();
+ initBackgroundImage(newStyleObj);
+ }
+ else
+ {
+ // Loading the image is slightly different
+ // than in Loader.loadContent()... is this on purpose?
+
+ // Load background image from external URL
+ var loader:Loader = new Loader();
+ loader.contentLoaderInfo.addEventListener(
+ Event.COMPLETE, loader_completeHandler);
+ loader.contentLoaderInfo.addEventListener(
+ IOErrorEvent.IO_ERROR, loader_ioErrorHandler);
+ var loaderContext:LoaderContext = new LoaderContext();
+ loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
+ loader.load(new URLRequest(String(classOrString)), loaderContext);
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private function initBackgroundImage(image:DisplayObject):void
+ {
+ addChildAt(image,0);
+
+ var backgroundImageWidth:Number = image.width;
+ var backgroundImageHeight:Number = image.height;
+
+ // Scale according to backgroundSize
+ var percentage:Number = calcBackgroundSize();
+ if (isNaN(percentage))
+ {
+ var sX:Number = 1.0;
+ var sY:Number = 1.0;
+ }
+ else
+ {
+ var scale:Number = percentage * 0.01;
+ sX = scale * stageWidth / backgroundImageWidth;
+ sY = scale * stageHeight / backgroundImageHeight;
+ }
+
+ image.scaleX = sX;
+ image.scaleY = sY;
+
+ // Center everything.
+ // Use a scrollRect to position and clip the image.
+ var offsetX:Number =
+ Math.round(0.5 * (stageWidth - backgroundImageWidth * sX));
+ var offsetY:Number =
+ Math.round(0.5 * (stageHeight - backgroundImageHeight * sY));
+
+ image.x = offsetX;
+ image.y = offsetY;
+
+ // Adjust alpha to match backgroundAlpha
+ if (!isNaN(backgroundAlpha))
+ image.alpha = backgroundAlpha;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private function calcBackgroundSize():Number
+ {
+ var percentage:Number = NaN;
+
+ if (backgroundSize)
+ {
+ var index:int = backgroundSize.indexOf("%");
+ if (index != -1)
+ percentage = Number(backgroundSize.substr(0, index));
+ }
+
+ return percentage;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Event listener for the <code>ProgressEvent.PROGRESS</code> event.
+ * This implementation updates the progress bar
+ * with the percentage of bytes downloaded.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function progressHandler(event:ProgressEvent):void
+ {
+ var loaded:uint = event.bytesLoaded;
+ var total:uint = event.bytesTotal;
+
+ var elapsedTime:int = getTimer() - _startTime;
+
+ // Only show the Loading phase if it will appear for awhile.
+ if (_showingDisplay || showDisplayForDownloading(elapsedTime, event))
+ {
+ if (!_startedLoading)
+ {
+ show();
+ label = downloadingLabel;
+ _startedLoading = true;
+ }
+
+ setProgress(event.bytesLoaded, event.bytesTotal);
+ }
+ }
+
+ /**
+ * Event listener for the <code>Event.COMPLETE</code> event.
+ * The default implementation does nothing.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function completeHandler(event:Event):void
+ {
+ }
+
+ /**
+ * Event listener for the <code>RSLEvent.RSL_PROGRESS</code> event.
+ * The default implementation does nothing.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function rslProgressHandler(event:RSLEvent):void
+ {
+ }
+
+ /**
+ * Event listener for the <code>RSLEvent.RSL_COMPLETE</code> event.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function rslCompleteHandler(event:RSLEvent):void
+ {
+ var word:String = "library";
+ if (event.isResourceModule)
+ word = "module";
+
+ label = "Loaded " + word + " " + event.rslIndex + " of " + event.rslTotal;
+ }
+
+ /**
+ * Event listener for the <code>RSLEvent.RSL_ERROR</code> event.
+ * This event listner handles any errors detected when downloading an RSL.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function rslErrorHandler(event:RSLEvent):void
+ {
+ _preloader.removeEventListener(ProgressEvent.PROGRESS,
+ progressHandler);
+
+ _preloader.removeEventListener(Event.COMPLETE,
+ completeHandler);
+
+ _preloader.removeEventListener(RSLEvent.RSL_PROGRESS,
+ rslProgressHandler);
+
+ _preloader.removeEventListener(RSLEvent.RSL_COMPLETE,
+ rslCompleteHandler);
+
+ _preloader.removeEventListener(RSLEvent.RSL_ERROR,
+ rslErrorHandler);
+
+ _preloader.removeEventListener(FlexEvent.INIT_PROGRESS,
+ initProgressHandler);
+
+ _preloader.removeEventListener(FlexEvent.INIT_COMPLETE,
+ initCompleteHandler);
+
+ if (!_showingDisplay)
+ {
+ show();
+ _showingDisplay = true;
+ }
+
+ label = "RSL Error " + (event.rslIndex + 1) + " of " + event.rslTotal;
+
+ var errorField:ErrorField = new ErrorField(this);
+ errorField.show(event.errorText);
+ }
+
+ /**
+ * @private
+ * Helper function that dispatches the Complete event to the preloader.
+ *
+ * @param event The event object.
+ */
+ private function timerHandler(event:Event = null):void
+ {
+ dispatchEvent(new Event(Event.COMPLETE));
+ }
+
+ /**
+ * Event listener for the <code>FlexEvent.INIT_PROGRESS</code> event.
+ * This implementation updates the progress bar
+ * each time the event is dispatched, and changes the text of the label.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function initProgressHandler(event:Event):void
+ {
+ var elapsedTime:int = getTimer() - _startTime;
+ _initProgressCount++;
+
+ if (!_showingDisplay &&
+ showDisplayForInit(elapsedTime, _initProgressCount))
+ {
+ _displayStartCount = _initProgressCount;
+ show();
+ }
+
+ if (_showingDisplay)
+ {
+ if (!_startedInit)
+ {
+ // First init progress event.
+ _startedInit = true;
+ label = initializingLabel;
+ }
+
+ var loaded:Number = 100 * _initProgressCount /
+ (initProgressTotal - _displayStartCount);
+
+ setProgress(Math.min(loaded, 100), 100);
+ }
+ }
+
+ /**
+ * Event listener for the <code>FlexEvent.INIT_COMPLETE</code> event.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ protected function initCompleteHandler(event:Event):void
+ {
+ var elapsedTime:int = getTimer() - _displayTime;
+
+ if (_showingDisplay && elapsedTime < MINIMUM_DISPLAY_TIME)
+ {
+ var timer:Timer = new Timer(MINIMUM_DISPLAY_TIME - elapsedTime, 1);
+ timer.addEventListener(TimerEvent.TIMER, timerHandler);
+ timer.start();
+ }
+ else
+ {
+ timerHandler();
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::LATER
+ private function loader_completeHandler(event:Event):void
+ {
+ var target:DisplayObject = DisplayObject(LoaderInfo(event.target).loader);
+
+ initBackgroundImage(target);
+ }
+
+ COMPILE::LATER
+ private function loader_ioErrorHandler(event:IOErrorEvent):void
+ {
+ // Swallow the error
+ }
+
+}
+
+}
+
+COMPILE::LATER
+{
+import flash.display.DisplayObject;
+import flash.display.Sprite;
+import flash.text.TextField;
+import flash.text.TextFormat;
+import flash.system.Capabilities;
+import flash.text.TextFieldAutoSize;
+import flash.display.DisplayObjectContainer;
+import flash.display.Stage;
+import mx.preloaders.DownloadProgressBar;
+}
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+/**
+ * @private
+ *
+ * Area to display error messages to help debug startup problems.
+ *
+ */
+COMPILE::LATER
+class ErrorField extends Sprite
+{
+ private var downloadProgressBar:DownloadProgressBar;
+ private const MIN_WIDTH_INCHES:int = 2; // min width of error message in inches
+ private const MAX_WIDTH_INCHES:int = 6; // max width of error message in inches
+ private const TEXT_MARGIN_PX:int = 10;
+
+
+ //----------------------------------
+ // labelFormat
+ //----------------------------------
+
+ /**
+ * The TextFormat object of the TextField component of the label.
+ * This is a read-only property which you must override
+ * if you need to change it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function get labelFormat():TextFormat
+ {
+ var tf:TextFormat = new TextFormat();
+ tf.color = 0x000000;
+ tf.font = "Verdana";
+ tf.size = 10;
+ return tf;
+ }
+
+
+ /**
+ * @private
+ *
+ * @param - parent - parent of the error field.
+ */
+ public function ErrorField(downloadProgressBar:DownloadProgressBar)
+ {
+ super();
+ this.downloadProgressBar = downloadProgressBar;
+ }
+
+
+ /**
+ * Create and show the error message.
+ *
+ * @param errorText - text for error message.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function show(errorText:String):void
+ {
+ if (errorText == null || errorText.length == 0)
+ return;
+
+ var screenWidth:Number = downloadProgressBar.stageWidth;
+ var screenHeight:Number = downloadProgressBar.stageHeight;
+
+ // create the text field for the message and
+ // add it to the parent.
+ var textField:TextField = new TextField();
+
+ textField.autoSize = TextFieldAutoSize.LEFT;
+ textField.multiline = true;
+ textField.wordWrap = true;
+ textField.background = true;
+ textField.defaultTextFormat = labelFormat;
+ textField.text = errorText;
+
+ textField.width = Math.max(MIN_WIDTH_INCHES * Capabilities.screenDPI, screenWidth - (TEXT_MARGIN_PX * 2));
+ textField.width = Math.min(MAX_WIDTH_INCHES * Capabilities.screenDPI, textField.width);
+ textField.y = Math.max(0, screenHeight - TEXT_MARGIN_PX - textField.height);
+
+ // center field horizontally
+ textField.x = (screenWidth - textField.width) / 2;
+
+ downloadProgressBar.parent.addChild(this);
+ this.addChild(textField);
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as b/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as
index 1a341a9..ca29aa8 100644
--- a/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as
+++ b/frameworks/projects/MX/src/main/flex/mx/preloaders/Preloader.as
@@ -40,7 +40,7 @@ COMPILE::JS
import flex.display.MovieClip;
import flex.display.Sprite;
import flex.events.Event;
- import flex.events.IEventDispatcher;
+ import org.apache.flex.events.IEventDispatcher;
import flex.events.IOErrorEvent;
import flex.events.ProgressEvent;
import flex.events.TimerEvent;
@@ -377,6 +377,7 @@ public class Preloader extends Sprite
rslDone = true;
}
}
+ rslDone = true;
}
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/resources/defaults.css b/frameworks/projects/MX/src/main/resources/defaults.css
new file mode 100644
index 0000000..2851cfd
--- /dev/null
+++ b/frameworks/projects/MX/src/main/resources/defaults.css
@@ -0,0 +1,288 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+@namespace "library://ns.adobe.com/flex/mx";
+
+/* Global style declaration */
+global
+{
+ /* framework styles */
+ accentColor: #0099FF;
+ alignmentBaseline: "useDominantBaseline";
+ backgroundAlpha: 1.0; /* this runs the opacity of nearly every square piece of the components */
+ /* backgroundDisabledColor: #DDDDDD; */
+ backgroundSize: "auto";
+ baselineShift: 0;
+ bevel: true;
+ blockProgression: "tb";
+ borderAlpha: 1.0;
+ borderCapColor: #919999;
+ borderColor: #696969;
+ borderSides: "left top right bottom";
+ borderStyle: "inset";
+ borderThickness: 1;
+ borderVisible: true;
+ breakOpportunity: "auto";
+ buttonColor: #6F7777;
+ caretColor: #0167FF;
+ cffHinting: "horizontalStem";
+ chromeColor: #CCCCCC;
+ closeDuration: 50;
+ color: #000000;
+ columnCount: "auto";
+ columnGap: 20;
+ columnWidth: "auto";
+ contentBackgroundAlpha: 1;
+ contentBackgroundColor: #FFFFFF;
+ cornerRadius: 2;
+ digitCase: "default";
+ digitWidth: "default";
+ direction: "ltr";
+ disabledAlpha: 0.5;
+ disabledColor: #AAB3B3;
+ disabledIconColor: #999999;
+ dominantBaseline: "auto";
+ dropShadowColor: #000000;
+ dropShadowVisible: false;
+ embedFonts: false;
+ errorColor: #FE0000;
+ fillAlphas: 0.6, 0.4, 0.75, 0.65; /* last pair are for OVER state */
+ fillColor: #FFFFFF; /* kill this?? */
+ fillColors: #FFFFFF, #CCCCCC, #FFFFFF, #EEEEEE;
+ filled: true;
+ firstBaselineOffset: "auto";
+ focusAlpha: 0.55;
+ focusBlendMode: "normal";
+ focusColor: #70B2EE;
+ focusRoundedCorners: "tl tr bl br";
+ /** COMPILE::LATER
+ focusSkin: ClassReference("mx.skins.halo.HaloFocusRect");
+ **/
+ focusThickness: 2;
+ focusedTextSelectionColor: #A8C6EE;
+ fontAntiAliasType: "advanced";
+ fontFamily: "Arial";
+ fontGridFitType: "pixel";
+ fontLookup: "embeddedCFF";
+ fontSharpness: 0;
+ fontSize: 12;
+ fontStyle: "normal";
+ fontThickness: 0;
+ fontWeight: "normal";
+ /* footerColors: #E7E7E7, #C7C7C7; */
+ /* headerColors: #E7E7E7, #D9D9D9; */
+ /* headerHeight: 28; */
+ highlightAlphas: 0.3, 0; /* use this to control the 'light' cast on the components */
+ horizontalAlign: "left";
+ horizontalGap: 8;
+ horizontalGridLineColor: #F7F7F7;
+ horizontalGridLines: false;
+ iconColor: #111111;
+ iconPlacement: "left";
+ inactiveTextSelectionColor: #E8E8E8;
+ indentation: 17;
+ indicatorGap: 14;
+ interactionMode: "mouse";
+ justificationRule: "auto";
+ justificationStyle: "auto";
+ kerning: "default";
+ layoutDirection: "ltr";
+ leading: 2;
+ leadingModel: "auto";
+ ligatureLevel: "common";
+ letterSpacing: 0;
+ lineBreak: "toFit";
+ lineHeight: "120%";
+ lineThrough: false;
+ locale: "en";
+ modalTransparency: 0.5;
+ modalTransparencyBlur: 3;
+ modalTransparencyColor: #DDDDDD;
+ modalTransparencyDuration: 100;
+ openDuration: 1;
+ paddingBottom: 0;
+ paddingLeft: 0;
+ paddingRight: 0;
+ paddingTop: 0;
+ paragraphEndIndent: 0;
+ paragraphSpaceAfter: 0;
+ paragraphSpaceBefore: 0;
+ paragraphStartIndent: 0;
+ renderingMode: "cff";
+ repeatDelay: 500;
+ repeatInterval: 35;
+ rollOverColor: #CEDBEF;
+ roundedBottomCorners: true;
+ selectionColor: #A8C6EE;
+ selectionDisabledColor: #DDDDDD;
+ selectionDuration: 250;
+ shadowCapColor: #D5DDDD;
+ shadowColor: #EEEEEE;
+ shadowDirection: "center";
+ shadowDistance: 2;
+ stroked: false;
+ strokeWidth: 1;
+ symbolColor: #000000;
+ tabStops: ClassReference(null);
+ textAlign: "start";
+ textAlignLast: "start";
+ textAlpha: 1.0;
+ textDecoration: "none";
+ textFieldClass: ClassReference("mx.core.UITextField");
+ textIndent: 0;
+ textJustify: "interWord";
+ textRollOverColor: 0;
+ textRotation: "auto";
+ textSelectedColor: 0;
+ themeColor: #70B2EE;
+ /*
+ //themeColor: #80FF4D; // haloGreen
+ //themeColor: #FFB600; // haloOrange
+ //themeColor: #AECAD9; // haloSilver
+ */
+ trackingLeft: 0;
+ trackingRight: 0;
+ typographicCase: "default";
+ unfocusedTextSelectionColor: #E8E8E8;
+ showErrorSkin: true;
+ showErrorTip: true;
+ useRollOver: true;
+ version: "4.0.0";
+ verticalAlign: "top";
+ verticalGap: 6;
+ verticalGridLineColor: #D5DDDD;
+ verticalGridLines: true;
+ whiteSpaceCollapse: "collapse";
+
+
+ /* spark styles */
+
+ /* Looks */
+ backgroundImageFillMode : "scale";
+ borderWeight : 1;
+
+ /* Behaviors */
+ autoThumbVisibility: true;
+ fixedThumbSize: false;
+ fullScreenHideControlsDelay: 3000;
+ horizontalScrollPolicy: "auto";
+ liveDragging: true;
+ rollOverOpenDelay: 200;
+ slideDuration: 300;
+ smoothScrolling: true;
+ verticalScrollPolicy: "auto";
+
+}
+
+/*
+//------------------------------
+// CursorManager
+//------------------------------
+
+COMPILE::LATER
+CursorManager
+{
+ busyCursor: ClassReference("mx.skins.halo.BusyCursor");
+ busyCursorBackground: Embed(source="Assets.swf",symbol="mx.skins.cursor.BusyCursor");
+}
+*/
+
+/*
+//------------------------------
+// DragManager
+//------------------------------
+
+COMPILE::LATER
+DragManager
+{
+ copyCursor: Embed(source="Assets.swf",symbol="mx.skins.cursor.DragCopy");
+ defaultDragImageSkin: ClassReference("mx.skins.halo.DefaultDragImage");
+ linkCursor: Embed(source="Assets.swf",symbol="mx.skins.cursor.DragLink");
+ moveCursor: Embed(source="Assets.swf",symbol="mx.skins.cursor.DragMove");
+ rejectCursor: Embed(source="Assets.swf",symbol="mx.skins.cursor.DragReject");
+}
+*/
+
+/*
+//------------------------------
+// .errorTip
+//------------------------------
+*/
+
+.errorTip
+{
+ borderColor: #CE2929;
+ borderStyle: "errorTipRight";
+ color: #FFFFFF;
+ fontSize: 10;
+ fontWeight: "bold";
+ shadowColor: #000000;
+ paddingBottom: 4;
+ paddingLeft: 4;
+ paddingRight: 4;
+ paddingTop: 4;
+}
+
+/*
+//------------------------------
+// .headerDragProxyStyle
+//------------------------------
+*/
+
+.headerDragProxyStyle
+{
+ fontWeight: "bold";
+}
+
+/*
+//------------------------------
+// SWFLoader
+//------------------------------
+
+COMPILE::LATER
+SWFLoader
+{
+ brokenImageBorderSkin: ClassReference("mx.skins.halo.BrokenImageBorderSkin");
+ brokenImageSkin: Embed(source="Assets.swf",symbol="__brokenImage");
+}
+*/
+
+/*
+//------------------------------
+// ToolTip
+//------------------------------
+
+COMPILE::LATER
+ToolTip
+{
+ backgroundColor: #FFFFCC;
+ backgroundAlpha: 0.95;
+ borderColor: #919999;
+ borderSkin: ClassReference("mx.skins.halo.ToolTipBorder");
+ borderStyle: "toolTip";
+ cornerRadius: 2;
+ fontSize: 10;
+ paddingBottom: 2;
+ paddingLeft: 4;
+ paddingRight: 4;
+ paddingTop: 2;
+}
+*/
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/test/flex/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/test/flex/build.xml b/frameworks/projects/MX/src/test/flex/build.xml
index 16f772b..c347fac 100644
--- a/frameworks/projects/MX/src/test/flex/build.xml
+++ b/frameworks/projects/MX/src/test/flex/build.xml
@@ -139,13 +139,8 @@
<arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
<arg value="-accessible=false" />
<arg value="-debug" />
- <arg value="-define=COMPILE::SWF,true" />
- <arg value="-define=COMPILE::JS,false" />
- <arg value="-define=COMPILE::LATER,false" />
- <arg value="-define=CONFIG::performanceInstrumentation,false" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
- <arg value="-source-path+=${FLEXJS_HOME}/frameworks/projects/MX/src/main/flex" />
<arg value="-library-path+=${FLEXJS_HOME}/frameworks/libs" />
<!-- need to figure out better way to find these -->
<arg value="-library-path+=${FLEXJS_HOME}/../flex-sdk/frameworks/locale/en_US" />
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/test/flex/src/TestCompile.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/test/flex/src/TestCompile.mxml b/frameworks/projects/MX/src/test/flex/src/TestCompile.mxml
index 663b776..427952f 100644
--- a/frameworks/projects/MX/src/test/flex/src/TestCompile.mxml
+++ b/frameworks/projects/MX/src/test/flex/src/TestCompile.mxml
@@ -22,6 +22,8 @@ limitations under the License.
xmlns:mx="library://ns.apache.org/flexjs/mx"
xmlns:js="library://ns.apache.org/flexjs/basic"
applicationComplete="runTests()"
+ usePreloader="false"
+ preloader="mx.preloaders.DownloadProgressBar"
>
<fx:Script>
<![CDATA[
[29/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - string
conversion
Posted by ah...@apache.org.
string conversion
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c98d892d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c98d892d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c98d892d
Branch: refs/heads/spark
Commit: c98d892d5f3d8378bedc42023f38303416e87878
Parents: 895f366
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 9 13:59:36 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 9 13:59:36 2016 -0700
----------------------------------------------------------------------
.../src/main/flex/org/apache/flex/utils/Language.as | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c98d892d/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as b/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
index 611bb0f..9ddc0d7 100644
--- a/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
+++ b/frameworks/projects/Language/src/main/flex/org/apache/flex/utils/Language.as
@@ -105,6 +105,17 @@ package org.apache.flex.utils
}
/**
+ * int()
+ *
+ * @param value The value to be cast.
+ * @return {string}
+ */
+ static public function string(value:*):String
+ {
+ return value == null ? null : value.toString();
+ }
+
+ /**
* is()
*
* @param leftOperand The lefthand operand of the
[08/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Listen
to strand events instead of model events and avoid initialization order
problems.
Posted by ah...@apache.org.
Listen to strand events instead of model events and avoid initialization order problems.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/970f3e3a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/970f3e3a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/970f3e3a
Branch: refs/heads/spark
Commit: 970f3e3af89fbbbc16972e73e22c80f7b58f4d6e
Parents: fa40021
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 15:49:22 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 15:49:22 2016 +0300
----------------------------------------------------------------------
.../flex/org/apache/flex/core/ITransformHost.as | 3 ++-
.../flex/org/apache/flex/core/TransformModel.as | 25 +++++++++++++++--
.../flex/org/apache/flex/svg/TransformBead.as | 28 ++++++++------------
3 files changed, 36 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/970f3e3a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
index 3553cc3..84192b1 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
@@ -18,6 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
+ import org.apache.flex.events.IEventDispatcher;
@@ -30,7 +31,7 @@ package org.apache.flex.core
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- public interface ITransformHost extends IStrand
+ public interface ITransformHost extends IStrand, IEventDispatcher
{
/**
* Each ITransformHost has an element that is actually added to
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/970f3e3a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
index 6f0df64..ca5ce11 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
@@ -6,7 +6,11 @@ package org.apache.flex.core
public class TransformModel extends EventDispatcher implements ITransformModel
{
+
+ public static const CHANGE:String = "transferModelChange";
+
private var _matrix:Matrix;
+ private var _strand:IStrand;
public function TransformModel()
{
@@ -17,13 +21,30 @@ package org.apache.flex.core
return _matrix;
}
+ private function dispatchModelChangeEvent():void
+ {
+ host.dispatchEvent(new Event(CHANGE));
+ }
+
+ private function get host():ITransformHost
+ {
+ return _strand as ITransformHost;
+ }
+
public function set matrix(value:Matrix):void
{
_matrix = value;
- dispatchEvent(new Event(Event.CHANGE));
+ if (_strand)
+ {
+ dispatchModelChangeEvent();
+ }
}
- public function set strand(value:IStrand):void {}
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ dispatchModelChangeEvent();
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/970f3e3a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index e852db5..5585b8a 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -1,22 +1,21 @@
package org.apache.flex.svg
{
+ import org.apache.flex.core.IBeadTransform;
import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITransformHost;
import org.apache.flex.core.ITransformModel;
+ import org.apache.flex.core.TransformModel;
import org.apache.flex.events.Event;
import org.apache.flex.geom.Matrix;
- import org.apache.flex.core.IBeadTransform;
- import org.apache.flex.core.ITransformHost;
COMPILE::SWF {
import flash.display.Sprite;
import flash.geom.Matrix;
}
-
public class TransformBead implements IBeadTransform
{
private var _strand:IStrand;
- private var transformModel:ITransformModel;
public function TransformBead()
{
@@ -32,25 +31,20 @@ package org.apache.flex.svg
*/
public function set strand(value:IStrand):void
{
- if (!(value is GraphicContainer))
- {
- throw new Error("This bead only works with svg GraphicContainers");
- return;
- }
_strand = value;
- transformModel = value.getBeadByType(ITransformModel) as ITransformModel;
- if (!transformModel)
- {
- throw new Error("An ITransformModel needs to be defined.");
- return;
- }
- transformModel.addEventListener(Event.CHANGE, changeHandler);
- if (transformModel.matrix)
+ host.addEventListener(TransformModel.CHANGE, changeHandler);
+ var model:ITransformModel = transformModel;
+ if (model && model.matrix)
{
transform();
}
}
+ public function get transformModel():ITransformModel
+ {
+ return host.getBeadByType(ITransformModel) as ITransformModel;
+ }
+
COMPILE::SWF
public function transform():void
{
[15/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Added
IMatrix and MeagerMatrix to reduce overhead when creating Matrices.
Posted by ah...@apache.org.
Added IMatrix and MeagerMatrix to reduce overhead when creating Matrices.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3882e749
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3882e749
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3882e749
Branch: refs/heads/spark
Commit: 3882e74916035b05608eee156f59f7d89d310278
Parents: 6b16b71
Author: yishayw <yi...@hotmail.com>
Authored: Sun Jul 31 09:33:24 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Sun Jul 31 09:33:24 2016 +0300
----------------------------------------------------------------------
.../main/flex/org/apache/flex/geom/IMatrix.as | 19 ++++
.../flex/org/apache/flex/geom/MeagerMatrix.as | 106 +++++++++++++++++++
2 files changed, 125 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3882e749/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
new file mode 100644
index 0000000..352fe52
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
@@ -0,0 +1,19 @@
+package org.apache.flex.geom
+{
+ public interface IMatrix
+ {
+ function get a():Number;
+ function set a(value:Number):void;
+ function get b():Number;
+ function set b(value:Number):void;
+ function get c():Number;
+ function set c(value:Number):void;
+ function get d():Number;
+ function set d(value:Number):void;
+ function get tx():Number;
+ function set tx(value:Number):void;
+ function get ty():Number;
+ function set ty(value:Number):void;
+ function clone():IMatrix
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3882e749/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as
new file mode 100644
index 0000000..595b64d
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as
@@ -0,0 +1,106 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.geom
+{
+
+ public class MeagerMatrix implements IMatrix
+ {
+ public function MeagerMatrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0)
+ {
+ this.a = a;
+ this.b = b;
+ this.c = c;
+ this.d = d;
+ this.tx = tx;
+ this.ty = ty;
+
+ }
+ private var _a:Number;
+ private var _b:Number;
+ private var _c:Number;
+ private var _d:Number;
+ private var _tx:Number;
+ private var _ty:Number;
+
+ public function get ty():Number
+ {
+ return _ty;
+ }
+
+ public function set ty(value:Number):void
+ {
+ _ty = value;
+ }
+
+ public function get tx():Number
+ {
+ return _tx;
+ }
+
+ public function set tx(value:Number):void
+ {
+ _tx = value;
+ }
+
+ public function get d():Number
+ {
+ return _d;
+ }
+
+ public function set d(value:Number):void
+ {
+ _d = value;
+ }
+
+ public function get c():Number
+ {
+ return _c;
+ }
+
+ public function set c(value:Number):void
+ {
+ _c = value;
+ }
+
+ public function get b():Number
+ {
+ return _b;
+ }
+
+ public function set b(value:Number):void
+ {
+ _b = value;
+ }
+
+ public function get a():Number
+ {
+ return _a;
+ }
+
+ public function set a(value:Number):void
+ {
+ _a = value;
+ }
+
+ public function clone():IMatrix
+ {
+ return new MeagerMatrix(a, b, c, d, tx, ty);
+ }
+ }
+}
\ No newline at end of file
[41/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Modified
some examples to remove circular-dependencies from the code.
Posted by ah...@apache.org.
Modified some examples to remove circular-dependencies from the code.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/670bbaa0
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/670bbaa0
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/670bbaa0
Branch: refs/heads/spark
Commit: 670bbaa0ab544292e332e6a3d9d3c20c5f9418d0
Parents: 27256ce
Author: Peter Ent <pe...@apache.org>
Authored: Thu Aug 18 14:10:40 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Thu Aug 18 14:10:40 2016 -0400
----------------------------------------------------------------------
examples/flexjs/DataBindingExample/pom.xml | 1 -
.../src/controllers/MyController.as | 55 ++++++++++++--------
.../src/controllers/MyController.as | 55 ++++++++++++--------
.../src/controllers/MyController.as | 55 ++++++++++++--------
examples/flexjs/TodoListSampleApp/pom.xml | 1 -
.../todo/controllers/TodoListController.as | 22 ++++----
6 files changed, 111 insertions(+), 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/670bbaa0/examples/flexjs/DataBindingExample/pom.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/DataBindingExample/pom.xml b/examples/flexjs/DataBindingExample/pom.xml
index 3e6ac92..90e2f70 100644
--- a/examples/flexjs/DataBindingExample/pom.xml
+++ b/examples/flexjs/DataBindingExample/pom.xml
@@ -42,7 +42,6 @@
<extensions>true</extensions>
<configuration>
<mainClass>DataBindingExample.mxml</mainClass>
- <removeCirculars>true</removeCirculars>
</configuration>
</plugin>
<plugin>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/670bbaa0/examples/flexjs/DataBindingExample/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/DataBindingExample/src/controllers/MyController.as b/examples/flexjs/DataBindingExample/src/controllers/MyController.as
index 2ee16ae..b7d52bd 100644
--- a/examples/flexjs/DataBindingExample/src/controllers/MyController.as
+++ b/examples/flexjs/DataBindingExample/src/controllers/MyController.as
@@ -19,63 +19,74 @@
package controllers
{
import org.apache.flex.events.Event;
-
+
import org.apache.flex.core.Application;
import org.apache.flex.core.IDocument;
-
+ import org.apache.flex.net.HTTPService;
+ import org.apache.flex.collections.LazyCollection;
+
import models.MyModel;
-
+
public class MyController implements IDocument
{
public function MyController(app:Application = null)
{
if (app)
{
- this.app = app as DataBindingExample;
app.addEventListener("viewChanged", viewChangeHandler);
}
}
-
+
+ private var model:MyModel;
+ private var initialView:Object;
+ private var service:HTTPService;
+ private var collection:LazyCollection;
+
private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
- private var app:DataBindingExample;
-
+
private function viewChangeHandler(event:Event):void
{
+ var app:Application = event.target as Application;
app.initialView.addEventListener("buttonClicked", buttonClickHandler);
app.initialView.addEventListener("radioClicked", radioClickHandler);
app.initialView.addEventListener("listChanged", listChangedHandler);
+
+ initialView = app.initialView;
+ model = app.model as MyModel;
+ service = app["service"] as HTTPService;
+ collection = app["collection"] as LazyCollection;
}
-
+
private function buttonClickHandler(event:Event):void
{
- var sym:String = MyInitialView(app.initialView).symbol;
- app.service.url = queryBegin + sym + queryEnd;
- app.service.send();
- app.service.addEventListener("complete", completeHandler);
+ var sym:String = MyInitialView(initialView).symbol;
+ service.url = queryBegin + sym + queryEnd;
+ service.send();
+ service.addEventListener("complete", completeHandler);
}
-
+
private function radioClickHandler(event:Event):void
{
- var field:String = MyInitialView(app.initialView).requestedField;
- MyModel(app.model).requestedField = field;
+ var field:String = MyInitialView(initialView).requestedField;
+ model.requestedField = field;
}
-
+
private function completeHandler(event:Event):void
{
- MyModel(app.model).responseData = app.collection.getItemAt(0);
+ model.responseData = collection.getItemAt(0);
}
-
+
private function listChangedHandler(event:Event):void
{
- MyModel(app.model).stockSymbol = MyInitialView(app.initialView).symbol;
+ model.stockSymbol = MyInitialView(initialView).symbol;
}
-
+
public function setDocument(document:Object, id:String = null):void
{
- this.app = document as DataBindingExample;
+ var app:Application = document as Application;
app.addEventListener("viewChanged", viewChangeHandler);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/670bbaa0/examples/flexjs/DataBindingExample_Flat/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/DataBindingExample_Flat/src/controllers/MyController.as b/examples/flexjs/DataBindingExample_Flat/src/controllers/MyController.as
index 2ee16ae..b7d52bd 100644
--- a/examples/flexjs/DataBindingExample_Flat/src/controllers/MyController.as
+++ b/examples/flexjs/DataBindingExample_Flat/src/controllers/MyController.as
@@ -19,63 +19,74 @@
package controllers
{
import org.apache.flex.events.Event;
-
+
import org.apache.flex.core.Application;
import org.apache.flex.core.IDocument;
-
+ import org.apache.flex.net.HTTPService;
+ import org.apache.flex.collections.LazyCollection;
+
import models.MyModel;
-
+
public class MyController implements IDocument
{
public function MyController(app:Application = null)
{
if (app)
{
- this.app = app as DataBindingExample;
app.addEventListener("viewChanged", viewChangeHandler);
}
}
-
+
+ private var model:MyModel;
+ private var initialView:Object;
+ private var service:HTTPService;
+ private var collection:LazyCollection;
+
private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
- private var app:DataBindingExample;
-
+
private function viewChangeHandler(event:Event):void
{
+ var app:Application = event.target as Application;
app.initialView.addEventListener("buttonClicked", buttonClickHandler);
app.initialView.addEventListener("radioClicked", radioClickHandler);
app.initialView.addEventListener("listChanged", listChangedHandler);
+
+ initialView = app.initialView;
+ model = app.model as MyModel;
+ service = app["service"] as HTTPService;
+ collection = app["collection"] as LazyCollection;
}
-
+
private function buttonClickHandler(event:Event):void
{
- var sym:String = MyInitialView(app.initialView).symbol;
- app.service.url = queryBegin + sym + queryEnd;
- app.service.send();
- app.service.addEventListener("complete", completeHandler);
+ var sym:String = MyInitialView(initialView).symbol;
+ service.url = queryBegin + sym + queryEnd;
+ service.send();
+ service.addEventListener("complete", completeHandler);
}
-
+
private function radioClickHandler(event:Event):void
{
- var field:String = MyInitialView(app.initialView).requestedField;
- MyModel(app.model).requestedField = field;
+ var field:String = MyInitialView(initialView).requestedField;
+ model.requestedField = field;
}
-
+
private function completeHandler(event:Event):void
{
- MyModel(app.model).responseData = app.collection.getItemAt(0);
+ model.responseData = collection.getItemAt(0);
}
-
+
private function listChangedHandler(event:Event):void
{
- MyModel(app.model).stockSymbol = MyInitialView(app.initialView).symbol;
+ model.stockSymbol = MyInitialView(initialView).symbol;
}
-
+
public function setDocument(document:Object, id:String = null):void
{
- this.app = document as DataBindingExample;
+ var app:Application = document as Application;
app.addEventListener("viewChanged", viewChangeHandler);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/670bbaa0/examples/flexjs/DataBindingExample_as/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/DataBindingExample_as/src/controllers/MyController.as b/examples/flexjs/DataBindingExample_as/src/controllers/MyController.as
index 2ee16ae..b7d52bd 100644
--- a/examples/flexjs/DataBindingExample_as/src/controllers/MyController.as
+++ b/examples/flexjs/DataBindingExample_as/src/controllers/MyController.as
@@ -19,63 +19,74 @@
package controllers
{
import org.apache.flex.events.Event;
-
+
import org.apache.flex.core.Application;
import org.apache.flex.core.IDocument;
-
+ import org.apache.flex.net.HTTPService;
+ import org.apache.flex.collections.LazyCollection;
+
import models.MyModel;
-
+
public class MyController implements IDocument
{
public function MyController(app:Application = null)
{
if (app)
{
- this.app = app as DataBindingExample;
app.addEventListener("viewChanged", viewChangeHandler);
}
}
-
+
+ private var model:MyModel;
+ private var initialView:Object;
+ private var service:HTTPService;
+ private var collection:LazyCollection;
+
private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
- private var app:DataBindingExample;
-
+
private function viewChangeHandler(event:Event):void
{
+ var app:Application = event.target as Application;
app.initialView.addEventListener("buttonClicked", buttonClickHandler);
app.initialView.addEventListener("radioClicked", radioClickHandler);
app.initialView.addEventListener("listChanged", listChangedHandler);
+
+ initialView = app.initialView;
+ model = app.model as MyModel;
+ service = app["service"] as HTTPService;
+ collection = app["collection"] as LazyCollection;
}
-
+
private function buttonClickHandler(event:Event):void
{
- var sym:String = MyInitialView(app.initialView).symbol;
- app.service.url = queryBegin + sym + queryEnd;
- app.service.send();
- app.service.addEventListener("complete", completeHandler);
+ var sym:String = MyInitialView(initialView).symbol;
+ service.url = queryBegin + sym + queryEnd;
+ service.send();
+ service.addEventListener("complete", completeHandler);
}
-
+
private function radioClickHandler(event:Event):void
{
- var field:String = MyInitialView(app.initialView).requestedField;
- MyModel(app.model).requestedField = field;
+ var field:String = MyInitialView(initialView).requestedField;
+ model.requestedField = field;
}
-
+
private function completeHandler(event:Event):void
{
- MyModel(app.model).responseData = app.collection.getItemAt(0);
+ model.responseData = collection.getItemAt(0);
}
-
+
private function listChangedHandler(event:Event):void
{
- MyModel(app.model).stockSymbol = MyInitialView(app.initialView).symbol;
+ model.stockSymbol = MyInitialView(initialView).symbol;
}
-
+
public function setDocument(document:Object, id:String = null):void
{
- this.app = document as DataBindingExample;
+ var app:Application = document as Application;
app.addEventListener("viewChanged", viewChangeHandler);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/670bbaa0/examples/flexjs/TodoListSampleApp/pom.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/pom.xml b/examples/flexjs/TodoListSampleApp/pom.xml
index c2cf144..06ada34 100644
--- a/examples/flexjs/TodoListSampleApp/pom.xml
+++ b/examples/flexjs/TodoListSampleApp/pom.xml
@@ -48,7 +48,6 @@
<extensions>true</extensions>
<configuration>
<mainClass>TodoListSampleApp.mxml</mainClass>
- <removeCirculars>true</removeCirculars>
</configuration>
</plugin>
<plugin>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/670bbaa0/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
index 4465fb3..6402a9c 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
@@ -25,20 +25,25 @@ package sample.todo.controllers {
import sample.todo.models.TodoListModel;
public class TodoListController implements IDocument {
- private var app:Application;
+
+ private var model:TodoListModel;
public function TodoListController(app:Application = null) {
- if (app != null) {
- this.app = app;
- }
+ if (app != null) {
+ // store the model for future use.
+ model = app.model as TodoListModel;
+ }
}
/**
*
*/
public function setDocument(document:Object, id:String = null):void {
- app = document as Application;
+ var app:Application = document as Application;
app.addEventListener("viewChanged", viewChangeHandler);
+
+ // store the model for future use
+ model = app.model as TodoListModel;
}
/**
@@ -46,6 +51,7 @@ package sample.todo.controllers {
* @param event
*/
private function viewChangeHandler(event:Event):void {
+ var app:Application = event.target as Application;
app.initialView.addEventListener(TodoListEvent.LOG_TODO, logTodo);
app.initialView.addEventListener(TodoListEvent.ITEM_CHECKED,handleItemChecked);
app.initialView.addEventListener(TodoListEvent.ITEM_REMOVE_REQUEST, handleItemRemove);
@@ -57,18 +63,14 @@ package sample.todo.controllers {
*/
public function logTodo(evt:TodoListEvent):void {
// still need to change model a view get the changes
- var todoModel:TodoListModel = app.model as TodoListModel;
- //todoModel.todos.push({title: evt.todo, selected: false});
- todoModel.addTodo(evt.todo);
+ model.addTodo(evt.todo);
}
public function handleItemChecked(event:TodoListEvent):void {
- var model: TodoListModel = app.model as TodoListModel;
model.toggleItemCheck(event.item);
}
public function handleItemRemove(event:TodoListEvent):void {
- var model: TodoListModel = app.model as TodoListModel;
model.removeItem(event.item);
}
}
[24/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Fixed
XML bugs
Posted by ah...@apache.org.
Fixed XML bugs
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5121d5cf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5121d5cf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5121d5cf
Branch: refs/heads/spark
Commit: 5121d5cf1327c9e00d83870768a50435c0874335
Parents: 3dea25a
Author: Harbs <ha...@in-tools.com>
Authored: Thu Aug 4 23:15:14 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Thu Aug 4 23:15:14 2016 +0300
----------------------------------------------------------------------
frameworks/projects/XML/src/main/flex/XML.as | 2 +-
frameworks/projects/XML/src/main/flex/XMLList.as | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5121d5cf/frameworks/projects/XML/src/main/flex/XML.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XML.as b/frameworks/projects/XML/src/main/flex/XML.as
index 9c45b5c..c629c8b 100644
--- a/frameworks/projects/XML/src/main/flex/XML.as
+++ b/frameworks/projects/XML/src/main/flex/XML.as
@@ -787,7 +787,7 @@ package
if(name.matches(_children[i].name()))
list.appendChild(_children[i]);
- list.concat(_children[i].descendants());
+ list.concat(_children[i].descendants(name));
}
}
return list;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5121d5cf/frameworks/projects/XML/src/main/flex/XMLList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/XML/src/main/flex/XMLList.as b/frameworks/projects/XML/src/main/flex/XMLList.as
index 18e4917..59982b0 100644
--- a/frameworks/projects/XML/src/main/flex/XMLList.as
+++ b/frameworks/projects/XML/src/main/flex/XMLList.as
@@ -201,6 +201,17 @@ package
public function child(propertyName:Object):XMLList
{
var retVal:XMLList = new XMLList();
+ var propNum:Number = parseInt(propertyName,10);
+ if(propNum.toString() == propertyName)
+ {
+ if(propNum >= 0 && propNum < _xmlArray.length)
+ {
+ retVal.appendChild(_xmlArray[propNum]);
+ retVal.targetObject = _xmlArray[propNum];
+ }
+ return retVal;
+ }
+
var len:int = _xmlArray.length;
for (var i:int=0;i<len;i++)
{
[13/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - more
changes to try to get things to run
Posted by ah...@apache.org.
more changes to try to get things to 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/aaa01ca6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/aaa01ca6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/aaa01ca6
Branch: refs/heads/spark
Commit: aaa01ca6ac83accbcce80cde4f75936a091abbfc
Parents: 259732a
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 28 12:17:25 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 28 12:17:25 2016 -0700
----------------------------------------------------------------------
.../main/flex/org/apache/flex/utils/Platform.as | 2 +-
.../MX/src/main/config/compile-as-config.xml | 4 +
.../projects/MX/src/main/flex/MXClasses.as | 3 +
.../flashx/textLayout/compose/ISWFContext.as | 78 +
.../MX/src/main/flex/flex/display/ModuleInfo.as | 35 +
.../main/flex/flex/display/TopOfDisplayList.as | 34 +-
.../flex/flex/events/FlashEventConverter.as | 205 ++
.../MX/src/main/flex/mx/core/Application.as | 30 +-
.../MX/src/main/flex/mx/core/UIComponent.as | 12 +
.../src/main/flex/mx/managers/LayoutManager.as | 1259 ++++++++++++
.../src/main/flex/mx/managers/SystemManager.as | 46 +-
.../mx/managers/layoutClasses/PriorityQueue.as | 398 ++++
.../mx/managers/systemClasses/ChildManager.as | 489 +++++
.../flex/mx/preloaders/DownloadProgressBar.as | 1916 ++++++++++++++++++
.../MX/src/main/flex/mx/preloaders/Preloader.as | 3 +-
.../projects/MX/src/main/resources/defaults.css | 288 +++
frameworks/projects/MX/src/test/flex/build.xml | 5 -
.../MX/src/test/flex/src/TestCompile.mxml | 2 +
18 files changed, 4769 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Platform.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Platform.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Platform.as
index 35725cf..4b667b7 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Platform.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Platform.as
@@ -89,7 +89,7 @@ package org.apache.flex.utils
{
COMPILE::SWF
{
- if (!platform)
+ if (!_platform)
{
var cap: Class = Capabilities;
var version: String = Capabilities.version;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/config/compile-as-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/config/compile-as-config.xml b/frameworks/projects/MX/src/main/config/compile-as-config.xml
index 7f3365e..7dcbd89 100644
--- a/frameworks/projects/MX/src/main/config/compile-as-config.xml
+++ b/frameworks/projects/MX/src/main/config/compile-as-config.xml
@@ -80,6 +80,10 @@
</compiler>
<include-file>
+ <name>defaults.css</name>
+ <path>../resources/defaults.css</path>
+ </include-file>
+ <include-file>
<name>js/out/*</name>
<path>../../../../../js/FlexJS/projects/MXJS/target/generated-sources/flexjs/*</path>
</include-file>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/MXClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/MXClasses.as b/frameworks/projects/MX/src/main/flex/MXClasses.as
index d637ae9..060f351 100644
--- a/frameworks/projects/MX/src/main/flex/MXClasses.as
+++ b/frameworks/projects/MX/src/main/flex/MXClasses.as
@@ -28,8 +28,11 @@ package
internal class MXClasses
{
+ import flashx.textLayout.compose.ISWFContext; ISWFContext;
import mx.core.UIComponent; UIComponent;
import mx.modules.IModule; IModule;
+ import mx.preloaders.DownloadProgressBar; DownloadProgressBar;
+ import mx.managers.systemClasses.ChildManager; ChildManager;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/flashx/textLayout/compose/ISWFContext.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flashx/textLayout/compose/ISWFContext.as b/frameworks/projects/MX/src/main/flex/flashx/textLayout/compose/ISWFContext.as
new file mode 100644
index 0000000..10c1028
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flashx/textLayout/compose/ISWFContext.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flashx.textLayout.compose
+{
+ /**
+ * The ISWFContext interface allows a SWF file to share its context with other SWF files that load it.
+ * An application that loads a SWF file of type ISWFContext can call methods in the context of the loaded SWF file.
+ * The main usage is for calling the FTE TextLine creation methods.
+ *
+ * <p>There are two reasons for an application to use
+ * this interface to control TextLine creation: </p>
+ * <ul>
+ * <li><strong>Reuse an embedded font: </strong> if an application wants to use a font embedded in a loaded SWF file,
+ * the application can access the font if a TextLine
+ * is created in the context of the loaded SWF file.</li>
+ * <li><strong>Reuse existing TextLine instances</strong>: reusing existing TextLine instances can result in faster recompose times.
+ * TLF reuses existing TextLine instances internally. TLF reuses
+ * a TextLine by calling <code>TextBlock.recreateTextLine()</code>
+ * instead of <code>TextBlock.createTextLine()</code> when TLF recognizes that a TextLine is extant.</li>
+ * </ul>
+ *
+ *
+ * <p>Your application may have additional TextLine instances that can be reused.
+ * To manually reuse existing TextLine instances:</p>
+ * <ol>
+ * <li>trap calls to <code>TextBlock.createTextLine()</code>, then</li>
+ * <li>call <code>TextBlock.recreateTextLine()</code> with the extant TextLine instance instead
+ * of <code>TextBlock.createTextLine()</code>.</li>
+ * </ol>
+ * <p>Please note, however, that the <code>TextBlock.recreateTextLine()</code> is available
+ * only in Flash Player 10.1 and later.</p>
+ *
+ * @see flash.text.engine.TextBlock#createTextLine()
+ * @see flash.text.engine.TextBlock#recreateTextLine()
+ * @includeExample examples\EmbeddedFontLineCreator.as -noswf
+ * @includeExample examples\FontConsumer.as -noswf
+ *
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @langversion 3.0
+ */
+ public interface ISWFContext
+ {
+ /**
+ * A way to call a method in a client controlled context.
+ *
+ * @param fn The function or method to call
+ * @param thisArg The this pointer for the function
+ * @param argArray The arguments for the function
+ * @param returns If true, the function returns a value
+ *
+ * @return Whatever the function returns, if anything.
+ *
+ * @see Function#apply()
+
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ */
+ function callInContext(fn:Function, thisArg:Object, argArray:Array, returns:Boolean=true):*;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as b/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
index 2ce5c93..2bf9996 100644
--- a/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
+++ b/frameworks/projects/MX/src/main/flex/flex/display/ModuleInfo.as
@@ -54,6 +54,12 @@ package flex.display
return loaderInfo.url;
}
+ COMPILE::SWF
+ public function get parameters():Object
+ {
+ return loaderInfo.parameters;
+ }
+
COMPILE::JS
public function get height():Number
{
@@ -71,5 +77,34 @@ package flex.display
{
return document.URL;
}
+
+ COMPILE::JS
+ private var _parameters:Object;
+
+ COMPILE::JS
+ public function get parameters():Object
+ {
+ if (!_parameters)
+ _parameters = makeParameters(document.URL);
+ return _parameters;
+ }
+
+ COMPILE::JS
+ private function makeParameters(url:String):Object
+ {
+ if (url == null || url.length == 0)
+ return {};
+
+ url = url.substring(1); // remove leading ?
+ var parts:Array = url.split("&");
+ var parms:Object = {};
+ for each (var part:String in parts)
+ {
+ var subParts:Array = part.split("=");
+ parms[subParts[0]] = subParts[1];
+ }
+ return parms;
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as b/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
index b56732f..5588393 100644
--- a/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
+++ b/frameworks/projects/MX/src/main/flex/flex/display/TopOfDisplayList.as
@@ -19,8 +19,12 @@
package flex.display
{
+ import org.apache.flex.events.EventDispatcher;
+
COMPILE::SWF
{
+ import flash.display.DisplayObject;
+ import flash.display.InteractiveObject;
import flash.display.Stage;
}
COMPILE::JS
@@ -31,7 +35,7 @@ COMPILE::JS
}
COMPILE::SWF
-public class TopOfDisplayList extends Stage
+public class TopOfDisplayList extends EventDispatcher
{
public function TopOfDisplayList(stage:Stage)
{
@@ -39,16 +43,40 @@ public class TopOfDisplayList extends Stage
_stage = stage;
}
- override public function get width():Number
+ public function get width():Number
{
return _stage.stageWidth;
}
- override public function get height():Number
+ public function get height():Number
{
return _stage.stageHeight;
}
+ public function getChildAt(index:int):flash.display.DisplayObject
+ {
+ return _stage.getChildAt(index);
+ }
+
+ /**
+ */
+ public function get focus():flash.display.InteractiveObject
+ {
+ return _stage.focus;
+ }
+
+ /**
+ */
+ public function set focus(value:flash.display.InteractiveObject):void
+ {
+ _stage.focus = value;
+ }
+
+ public function invalidate():void
+ {
+ _stage.invalidate();
+ }
+
private var _stage:Stage;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/flex/events/FlashEventConverter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/events/FlashEventConverter.as b/frameworks/projects/MX/src/main/flex/flex/events/FlashEventConverter.as
new file mode 100644
index 0000000..bfab166
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/flex/events/FlashEventConverter.as
@@ -0,0 +1,205 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flex.events
+{
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+ import flash.events.FocusEvent;
+ import flash.events.IEventDispatcher;
+ import flash.utils.Dictionary;
+
+ import flex.display.InteractiveObject;
+
+ /**
+ * Mouse events conversion.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::SWF
+ public class FlashEventConverter
+ {
+ private static function mouseEventConverter(event:flash.events.Event):void
+ {
+ var srcClass:Class;
+ var destClass:Class;
+ var converter:Function;
+ for (var c:Class in eventClassMap)
+ {
+ if (event is c)
+ {
+ srcClass = c;
+ destClass = eventClassMap[c];
+ converter = eventClassConverters[c];
+ }
+ }
+ if (!srcClass)
+ {
+ srcClass = flash.events.Event;
+ destClass = flex.events.Event;
+ converter = eventConverter;
+ }
+ if (!(event is destClass))
+ {
+ var newEvent:flex.events.Event = converter(event) as flex.events.Event;
+ event.stopImmediatePropagation();
+ event.target.dispatchEvent(newEvent);
+ }
+ }
+
+ /**
+ * The map of events classes to convert.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static var eventClassMap:Dictionary = new Dictionary();
+
+ /**
+ * The map of events class conversion functions.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static var eventClassConverters:Dictionary = new Dictionary();
+
+ /**
+ * The list of events to convert by intercepting in capture phase
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static var captureConvertedEvents:Array = [
+ flash.events.Event.ACTIVATE,
+ flash.events.Event.ADDED,
+ flash.events.Event.DEACTIVATE,
+ flash.events.Event.REMOVED
+ ];
+
+ /**
+ * The list of stage events to convert that can't be captured
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static var stageConvertedEvents:Array = [
+ flash.events.Event.ACTIVATE,
+ flash.events.Event.ADDED,
+ flash.events.Event.DEACTIVATE,
+ flash.events.Event.ENTER_FRAME,
+ flash.events.Event.REMOVED,
+ flash.events.Event.RENDER
+ ];
+
+ /**
+ * The event handler that converts the events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static var eventHandler:Function = mouseEventConverter;
+
+ /**
+ * The target used to capture and convert the events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private static var captureTarget:DisplayObject;
+
+ /**
+ * Set up the top level converter.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function setupAllConverters(target:DisplayObject):void
+ {
+ captureTarget = target;
+ for each (var eventType:String in captureConvertedEvents)
+ target.addEventListener(eventType, eventHandler, true, 9999);
+
+ if (target.stage)
+ for each (eventType in stageConvertedEvents)
+ target.stage.addEventListener(eventType, eventHandler, false, 9999);
+
+ // don't add this. It is the default if no other matches
+ // eventClassMap[flash.events.Event] = flex.events.Event;
+ eventClassMap[flash.events.FocusEvent] = flex.events.FocusEvent;
+ eventClassConverters[flash.events.FocusEvent] = focusEventConverter;
+ }
+
+ /**
+ * Set up the top level converter.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function removeAllConverters(target:DisplayObject):void
+ {
+ captureTarget = target;
+ for each (var eventType:String in captureConvertedEvents)
+ target.removeEventListener(eventType, eventHandler, true);
+ }
+
+ /**
+ * Add another event to convert.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function addEventType(type:String):void
+ {
+ if (!captureTarget)
+ captureConvertedEvents.push(type);
+ else
+ captureTarget.addEventListener(type, eventHandler, false, 9999);
+ }
+
+ private static function focusEventConverter(e:flash.events.FocusEvent):flex.events.FocusEvent
+ {
+ return new flex.events.FocusEvent(e.type, e.bubbles, e.cancelable, e.relatedObject as flex.display.InteractiveObject, e.shiftKey, e.keyCode);
+ }
+
+ private static function eventConverter(e:flash.events.Event):flex.events.Event
+ {
+ return new flex.events.Event(e.type, e.bubbles, e.cancelable);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/Application.as b/frameworks/projects/MX/src/main/flex/mx/core/Application.as
index 431e56b..4cfb16a 100644
--- a/frameworks/projects/MX/src/main/flex/mx/core/Application.as
+++ b/frameworks/projects/MX/src/main/flex/mx/core/Application.as
@@ -49,6 +49,8 @@ import mx.managers.FocusManager;
import mx.managers.IActiveWindowManager;
import mx.managers.ILayoutManager;
import mx.managers.ISystemManager;
+// force-link this here. In flex-sdk, it gets dragged in by Effect.
+import mx.managers.LayoutManager; LayoutManager;
import mx.styles.CSSStyleDeclaration;
import mx.styles.IStyleClient;
import mx.utils.LoaderUtil;
@@ -1048,16 +1050,8 @@ public class Application extends LayoutContainer
var sm:ISystemManager = systemManager;
- COMPILE::SWF
- {
- _url = LoaderUtil.normalizeURL(root.loaderInfo);
- _parameters = root.loaderInfo.parameters;
- }
- COMPILE::JS
- {
- _url = LoaderUtil.normalizeURL(window.location.href);
- _parameters = makeParameters(window.location.search);
- }
+ _url = LoaderUtil.normalizeURL(sm.moduleInfo);
+ _parameters = sm.moduleInfo.parameters;
initManagers(sm);
_descriptor = null;
@@ -1884,22 +1878,6 @@ public class Application extends LayoutContainer
invalidateDisplayList();
}
- COMPILE::JS
- private function makeParameters(url:String):Object
- {
- if (url == null || url.length == 0)
- return {};
-
- url = url.substring(1); // remove leading ?
- var parts:Array = url.split("&");
- var parms:Object = {};
- for each (var part:String in parts)
- {
- var subParts:Array = part.split("=");
- parms[subParts[0]] = subParts[1];
- }
- return parms;
- }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
index bf66b1e..6fe7bff 100644
--- a/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
@@ -14964,6 +14964,18 @@ public class UIComponent extends Sprite
return NameUtil.displayObjectToString(this);
}
+ COMPILE::SWF
+ override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void
+ {
+ super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ super.addEventListener(type, flashListener, true, 9999);
+ }
+
+ COMPILE::SWF
+ private function flashListener(e:flash.events.Event):void
+ {
+ trace(e.type, e.target);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/managers/LayoutManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/LayoutManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/LayoutManager.as
new file mode 100644
index 0000000..066dc50
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/LayoutManager.as
@@ -0,0 +1,1259 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+COMPILE::SWF
+{
+import flash.display.Stage;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+}
+COMPILE::JS
+{
+ import flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+}
+
+import mx.core.ILayoutElement;
+import mx.core.UIComponent;
+import mx.core.UIComponentGlobals;
+import mx.core.mx_internal;
+import mx.events.DynamicEvent;
+import mx.events.FlexEvent;
+import mx.managers.layoutClasses.PriorityQueue;
+
+CONFIG::performanceInstrumentation
+{
+import mx.utils.PerfUtil;
+}
+
+use namespace mx_internal;
+
+/**
+ * The LayoutManager is the engine behind
+ * Flex's measurement and layout strategy.
+ * Layout is performed in three phases; commit, measurement, and layout.
+ *
+ * <p>Each phase is distinct from the others and all UIComponents of
+ * one phase are processed prior to moving on to the next phase.
+ * During the processing of UIComponents in a phase, requests for
+ * UIComponents to get re-processed by some phase may occur.
+ * These requests are queued and are only processed
+ * during the next run of the phase.</p>
+ *
+ * <p>The <b>commit</b> phase begins with a call to
+ * <code>validateProperties()</code>, which walks through a list
+ * (reverse sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateProperties()">
+ * <code>validateProperties()</code></a>method.</p>
+ *
+ * <p>The objects in the list are processed in reversed nesting order,
+ * with the <b>least</b> deeply nested object accessed first.
+ * This can also be referred to as top-down or outside-in ordering.</p>
+ *
+ * <p>This phase allows components whose contents depend on property
+ * settings to configure themselves prior to the measurement
+ * and the layout phases.
+ * For the sake of performance, sometimes a component's property setter
+ * method does not do all the work to update to the new property value.
+ * Instead, the property setter calls the <code>invalidateProperties()</code>
+ * method, deferring the work until this phase runs.
+ * This prevents unnecessary work if the property is set multiple times.</p>
+ *
+ * <p>The <b>measurement</b> phase begins with a call to
+ * <code>validateSize()</code>, which walks through a list
+ * (sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateSize()"><code>validateSize()</code></a>
+ * method to determine if the object has changed in size.</p>
+ *
+ * <p>If an object's <a href="../core/UIComponent.html#invalidateSize()">
+ * <code>invalidateSize()</code></a> method was previously called,
+ * then the <code>validateSize()</code> method is called.
+ * If the size or position of the object was changed as a result of the
+ * <code>validateSize()</code> call, then the object's
+ * <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> method is called, thus adding
+ * the object to the processing queue for the next run of the layout phase.
+ * Additionally, the object's parent is marked for both measurement
+ * and layout phases, by calling
+ * <a href="../core/UIComponent.html#invalidateSize()">
+ * <code>invalidateSize()</code></a> and
+ * <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> respectively.</p>
+ *
+ * <p>The objects in the list are processed by nesting order,
+ * with the <b>most</b> deeply nested object accessed first.
+ * This can also be referred to as bottom-up inside-out ordering.</p>
+ *
+ * <p>The <b>layout</b> phase begins with a call to the
+ * <code>validateDisplayList()</code> method, which walks through a list
+ * (reverse sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateDisplayList()">
+ * <code>validateDisplayList()</code></a> method to request the object to size
+ * and position all components contained within it (i.e. its children).</p>
+ *
+ * <p>If an object's <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> method was previously called,
+ * then <code>validateDisplayList()</code> method for the object is called.</p>
+ *
+ * <p>The objects in the list are processed in reversed nesting order,
+ * with the <b>least</b> deeply nested object accessed first.
+ * This can also be referred to as top-down or outside-in ordering.</p>
+ *
+ * <p>In general, components do not override the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, or <code>validateDisplayList()</code> methods.
+ * In the case of UIComponents, most components override the
+ * <code>commitProperties()</code>, <code>measure()</code>, or
+ * <code>updateDisplayList()</code> methods, which are called
+ * by the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, or
+ * <code>validateDisplayList()</code> methods, respectively.</p>
+ *
+ * <p>At application startup, a single instance of the LayoutManager is created
+ * and stored in the <code>UIComponent.layoutManager</code> property.
+ * All components are expected to use that instance.
+ * If you do not have access to the UIComponent object,
+ * you can also access the LayoutManager using the static
+ * <code>LayoutManager.getInstance()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class LayoutManager extends EventDispatcher implements ILayoutManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * The sole instance of this singleton class.
+ */
+ private static var instance:LayoutManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Returns the sole instance of this singleton class,
+ * creating it if it does not already exist.
+ *
+ * @return Returns the sole instance of this singleton class,
+ * creating it if it does not already exist.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static function getInstance():LayoutManager
+ {
+ if (!instance)
+ instance = new LayoutManager();
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ * @private
+ */
+ public function LayoutManager()
+ {
+ super();
+
+ systemManager = SystemManagerGlobals.topLevelSystemManagers[0];
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * A queue of objects that need to dispatch updateComplete events
+ * when invalidation processing is complete
+ */
+ private var updateCompleteQueue:PriorityQueue = new PriorityQueue();
+
+ /**
+ * @private
+ * A queue of objects to be processed during the first phase
+ * of invalidation processing, when an ILayoutManagerClient has
+ * its validateProperties() method called (which in a UIComponent
+ * calls commitProperties()).
+ * Objects are added to this queue by invalidateProperties()
+ * and removed by validateProperties().
+ */
+ private var invalidatePropertiesQueue:PriorityQueue = new PriorityQueue();
+
+ /**
+ * @private
+ * A flag indicating whether there are objects
+ * in the invalidatePropertiesQueue.
+ * It is set true by invalidateProperties()
+ * and set false by validateProperties().
+ */
+ private var invalidatePropertiesFlag:Boolean = false;
+
+ // flag when in validateClient to check the properties queue again
+ private var invalidateClientPropertiesFlag:Boolean = false;
+
+ /**
+ * @private
+ * A queue of objects to be processed during the second phase
+ * of invalidation processing, when an ILayoutManagerClient has
+ * its validateSize() method called (which in a UIComponent
+ * calls measure()).
+ * Objects are added to this queue by invalidateSize().
+ * and removed by validateSize().
+ */
+ private var invalidateSizeQueue:PriorityQueue = new PriorityQueue();
+
+ /**
+ * @private
+ * A flag indicating whether there are objects
+ * in the invalidateSizeQueue.
+ * It is set true by invalidateSize()
+ * and set false by validateSize().
+ */
+ private var invalidateSizeFlag:Boolean = false;
+
+ // flag when in validateClient to check the size queue again
+ private var invalidateClientSizeFlag:Boolean = false;
+
+ /**
+ * @private
+ * A queue of objects to be processed during the third phase
+ * of invalidation processing, when an ILayoutManagerClient has
+ * its validateDisplayList() method called (which in a
+ * UIComponent calls updateDisplayList()).
+ * Objects are added to this queue by invalidateDisplayList()
+ * and removed by validateDisplayList().
+ */
+ private var invalidateDisplayListQueue:PriorityQueue = new PriorityQueue();
+
+ /**
+ * @private
+ * A flag indicating whether there are objects
+ * in the invalidateDisplayListQueue.
+ * It is set true by invalidateDisplayList()
+ * and set false by validateDisplayList().
+ */
+ private var invalidateDisplayListFlag:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var waitedAFrame:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var listenersAttached:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var originalFrameRate:Number;
+
+ /**
+ * @private
+ * used in validateClient to quickly estimate whether we have to
+ * search the queues again
+ */
+ private var targetLevel:int = int.MAX_VALUE;
+
+ /**
+ * @private
+ * the top level systemmanager
+ */
+ private var systemManager:ISystemManager;
+
+ /**
+ * @private
+ * the current object being validated
+ * it could be wrong if the validating object calls validateNow on something.
+ */
+ private var currentObject:ILayoutManagerClient;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // usePhasedInstantiation
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the usePhasedInstantiation property.
+ */
+ private var _usePhasedInstantiation:Boolean = false;
+
+ /**
+ * A flag that indicates whether the LayoutManager allows screen updates
+ * between phases.
+ * If <code>true</code>, measurement and layout are done in phases, one phase
+ * per screen update.
+ * All components have their <code>validateProperties()</code>
+ * and <code>commitProperties()</code> methods
+ * called until all their properties are validated.
+ * The screen will then be updated.
+ *
+ * <p>Then all components will have their <code>validateSize()</code>
+ * and <code>measure()</code>
+ * methods called until all components have been measured, then the screen
+ * will be updated again. </p>
+ *
+ * <p>Finally, all components will have their
+ * <code>validateDisplayList()</code> and
+ * <code>updateDisplayList()</code> methods called until all components
+ * have been validated, and the screen will be updated again.
+ * If in the validation of one phase, an earlier phase gets invalidated,
+ * the LayoutManager starts over.
+ * This is more efficient when large numbers of components
+ * are being created an initialized. The framework is responsible for setting
+ * this property.</p>
+ *
+ * <p>If <code>false</code>, all three phases are completed before the screen is updated.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get usePhasedInstantiation():Boolean
+ {
+ return _usePhasedInstantiation;
+ }
+
+ /**
+ * @private
+ */
+ public function set usePhasedInstantiation(value:Boolean):void
+ {
+ if (_usePhasedInstantiation != value)
+ {
+ _usePhasedInstantiation = value;
+
+ // While we're doing phased instantiation, temporarily increase
+ // the frame rate. That will cause the enterFrame and render
+ // events to fire more promptly, which improves performance.
+ COMPILE::SWF
+ {
+ try {
+ // can't use FlexGlobals here. It may not be setup yet
+ var stage:Stage = systemManager.stage;
+ if (stage)
+ {
+ if (value)
+ {
+ originalFrameRate = stage.frameRate;
+ stage.frameRate = 1000;
+ }
+ else
+ {
+ stage.frameRate = originalFrameRate;
+ }
+ }
+ }
+ catch (e:SecurityError)
+ {
+ // trace("ignoring security error changing the framerate " + e);
+ }
+ }
+ }
+ }
+
+ //----------------------------------
+ // debugHelper
+ //----------------------------------
+
+ /*
+ // LAYOUT_DEBUG
+ import mx.managers.layoutClasses.LayoutDebugHelper;
+ private static var _layoutDebugHelper:LayoutDebugHelper;
+
+ public static function get debugHelper():LayoutDebugHelper
+ {
+ if (!_layoutDebugHelper)
+ {
+ _layoutDebugHelper = new LayoutDebugHelper();
+ _layoutDebugHelper.mouseEnabled = false;
+ var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0]
+ sm.addChild(_layoutDebugHelper);
+ }
+ return _layoutDebugHelper;
+ } */
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Invalidation
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds an object to the list of components that want their
+ * <code>validateProperties()</code> method called.
+ * A component should call this method when a property changes.
+ * Typically, a property setter method
+ * stores a the new value in a temporary variable and calls
+ * the <code>invalidateProperties()</code> method
+ * so that its <code>validateProperties()</code>
+ * and <code>commitProperties()</code> methods are called
+ * later, when the new value will actually be applied to the component and/or
+ * its children. The advantage of this strategy is that often, more than one
+ * property is changed at a time and the properties may interact with each
+ * other, or repeat some code as they are applied, or need to be applied in
+ * a specific order. This strategy allows the most efficient method of
+ * applying new property values.
+ *
+ * @param obj The object whose property changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function invalidateProperties(obj:ILayoutManagerClient ):void
+ {
+ if (!invalidatePropertiesFlag && systemManager)
+ {
+ invalidatePropertiesFlag = true;
+
+ if (!listenersAttached)
+ attachListeners(systemManager);
+ }
+
+ // trace("LayoutManager adding " + Object(obj) + " to invalidatePropertiesQueue");
+
+ if (targetLevel <= obj.nestLevel)
+ invalidateClientPropertiesFlag = true;
+
+ invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
+
+ // trace("LayoutManager added " + Object(obj) + " to invalidatePropertiesQueue");
+ }
+
+ /**
+ * Adds an object to the list of components that want their
+ * <code>validateSize()</code> method called.
+ * Called when an object's size changes.
+ *
+ * <p>An object's size can change for two reasons:</p>
+ *
+ * <ol>
+ * <li>The content of the object changes. For example, the size of a
+ * button changes when its <code>label</code> is changed.</li>
+ * <li>A script explicitly changes one of the following properties:
+ * <code>minWidth</code>, <code>minHeight</code>,
+ * <code>explicitWidth</code>, <code>explicitHeight</code>,
+ * <code>maxWidth</code>, or <code>maxHeight</code>.</li>
+ * </ol>
+ *
+ * <p>When the first condition occurs, it's necessary to recalculate
+ * the measurements for the object.
+ * When the second occurs, it's not necessary to recalculate the
+ * measurements because the new size of the object is known.
+ * However, it's necessary to remeasure and relayout the object's
+ * parent.</p>
+ *
+ * @param obj The object whose size changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function invalidateSize(obj:ILayoutManagerClient ):void
+ {
+ if (!invalidateSizeFlag && systemManager)
+ {
+ invalidateSizeFlag = true;
+
+ if (!listenersAttached)
+ {
+ attachListeners(systemManager);
+ }
+ }
+
+ // trace("LayoutManager adding " + Object(obj) + " to invalidateSizeQueue");
+
+ if (targetLevel <= obj.nestLevel)
+ invalidateClientSizeFlag = true;
+
+ invalidateSizeQueue.addObject(obj, obj.nestLevel);
+
+ // trace("LayoutManager added " + Object(obj) + " to invalidateSizeQueue");
+ }
+
+ /**
+ * Called when a component changes in some way that its layout and/or visuals
+ * need to be changed.
+ * In that case, it is necessary to run the component's layout algorithm,
+ * even if the component's size hasn't changed. For example, when a new child component
+ * is added, or a style property changes or the component has been given
+ * a new size by its parent.
+ *
+ * @param obj The object that changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function invalidateDisplayList(obj:ILayoutManagerClient ):void
+ {
+ if (!invalidateDisplayListFlag && systemManager)
+ {
+ invalidateDisplayListFlag = true;
+
+ if (!listenersAttached)
+ {
+ attachListeners(systemManager);
+ }
+ }
+ else if (!invalidateDisplayListFlag && !systemManager)
+ {
+ // trace("systemManager is null");
+ }
+
+ // trace("LayoutManager adding " + Object(obj) + " to invalidateDisplayListQueue");
+
+ invalidateDisplayListQueue.addObject(obj, obj.nestLevel);
+
+ // trace("LayoutManager added " + Object(obj) + " to invalidateDisplayListQueue");
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Commitment, measurement, layout, and drawing
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Validates all components whose properties have changed and have called
+ * the <code>invalidateProperties()</code> method.
+ * It calls the <code>validateProperties()</code> method on those components
+ * and will call <code>validateProperties()</code> on any other components that are
+ * invalidated while validating other components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function validateProperties():void
+ {
+ // trace("--- LayoutManager: validateProperties --->");
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:PerfUtil = PerfUtil.getInstance();
+ perfUtil.markTime("validateProperties().start");
+ }
+
+ // Keep traversing the invalidatePropertiesQueue until we've reached the end.
+ // More elements may get added to the queue while we're in this loop, or a
+ // a recursive call to this function may remove elements from the queue while
+ // we're in this loop.
+ var obj:ILayoutManagerClient = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
+ while (obj)
+ {
+ // trace("LayoutManager calling validateProperties() on " + Object(obj) + " " + DisplayObject(obj).width + " " + DisplayObject(obj).height);
+
+ CONFIG::performanceInstrumentation
+ {
+ var token:int = perfUtil.markStart();
+ }
+
+ if (obj.nestLevel)
+ {
+ currentObject = obj;
+ obj.validateProperties();
+ if (!obj.updateCompletePendingFlag)
+ {
+ updateCompleteQueue.addObject(obj, obj.nestLevel);
+ obj.updateCompletePendingFlag = true;
+ }
+ }
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markEnd(".validateProperties()", token, 2 /*tolerance*/, obj);
+ }
+
+ // Once we start, don't stop.
+ obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallest());
+ }
+
+ if (invalidatePropertiesQueue.isEmpty())
+ {
+ // trace("Properties Queue is empty");
+
+ invalidatePropertiesFlag = false;
+ }
+
+ // trace("<--- LayoutManager: validateProperties ---");
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("validateProperties().end");
+ }
+ }
+
+ /**
+ * Validates all components whose properties have changed and have called
+ * the <code>invalidateSize()</code> method.
+ * It calls the <code>validateSize()</code> method on those components
+ * and will call the <code>validateSize()</code> method
+ * on any other components that are
+ * invalidated while validating other components.
+ * The </code>validateSize()</code> method starts with
+ * the most deeply nested child in the tree of display objects
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function validateSize():void
+ {
+ // trace("--- LayoutManager: validateSize --->");
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:PerfUtil = PerfUtil.getInstance();
+ perfUtil.markTime("validateSize().start");
+ }
+
+ var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
+ while (obj)
+ {
+ // trace("LayoutManager calling validateSize() on " + Object(obj));
+ CONFIG::performanceInstrumentation
+ {
+ var objToken:int;
+ if (PerfUtil.detailedSampling)
+ objToken = perfUtil.markStart();
+ }
+
+ if (obj.nestLevel)
+ {
+ currentObject = obj;
+ obj.validateSize();
+ if (!obj.updateCompletePendingFlag)
+ {
+ updateCompleteQueue.addObject(obj, obj.nestLevel);
+ obj.updateCompletePendingFlag = true;
+ }
+ }
+
+ CONFIG::performanceInstrumentation
+ {
+ if (PerfUtil.detailedSampling)
+ perfUtil.markEnd(".validateSize()", objToken, 2 /*tolerance*/, obj);
+ }
+ // trace("LayoutManager validateSize: " + Object(obj) + " " + IFlexDisplayObject(obj).measuredWidth + " " + IFlexDisplayObject(obj).measuredHeight);
+
+ obj = ILayoutManagerClient(invalidateSizeQueue.removeLargest());
+ }
+
+ if (invalidateSizeQueue.isEmpty())
+ {
+ // trace("Measurement Queue is empty");
+
+ invalidateSizeFlag = false;
+ }
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("validateSize().end");
+ }
+ // trace("<--- LayoutManager: validateSize ---");
+ }
+
+ /**
+ * Validates all components whose properties have changed and have called
+ * the <code>invalidateDisplayList()</code> method.
+ * It calls <code>validateDisplayList()</code> method on those components
+ * and will call the <code>validateDisplayList()</code> method
+ * on any other components that are
+ * invalidated while validating other components.
+ * The <code>validateDisplayList()</code> method starts with
+ * the least deeply nested child in the tree of display objects
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ private function validateDisplayList():void
+ {
+ // trace("--- LayoutManager: validateDisplayList --->");
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:PerfUtil = PerfUtil.getInstance();
+ perfUtil.markTime("validateDisplayList().start");
+ }
+
+ var obj:ILayoutManagerClient = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
+ while (obj)
+ {
+ // trace("LayoutManager calling validateDisplayList on " + Object(obj) + " " + DisplayObject(obj).width + " " + DisplayObject(obj).height);
+ CONFIG::performanceInstrumentation
+ {
+ var objToken:int;
+ if (PerfUtil.detailedSampling)
+ objToken = perfUtil.markStart();
+ }
+
+ if (obj.nestLevel)
+ {
+ currentObject = obj;
+ obj.validateDisplayList();
+ if (!obj.updateCompletePendingFlag)
+ {
+ updateCompleteQueue.addObject(obj, obj.nestLevel);
+ obj.updateCompletePendingFlag = true;
+ }
+ }
+ // trace("LayoutManager return from validateDisplayList on " + Object(obj) + " " + DisplayObject(obj).width + " " + DisplayObject(obj).height);
+
+ CONFIG::performanceInstrumentation
+ {
+ if (PerfUtil.detailedSampling)
+ perfUtil.markEnd(".validateDisplayList()", objToken, 2 /*tolerance*/, obj);
+ }
+
+ // Once we start, don't stop.
+ obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallest());
+ }
+
+
+ if (invalidateDisplayListQueue.isEmpty())
+ {
+ // trace("Layout Queue is empty");
+
+ invalidateDisplayListFlag = false;
+ }
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markTime("validateDisplayList().end");
+ }
+ // trace("<--- LayoutManager: validateDisplayList ---");
+ }
+
+ /**
+ * @private
+ */
+ private function doPhasedInstantiation():void
+ {
+ // trace(">>DoPhasedInstantation");
+
+ // If phasing, do only one phase: validateProperties(),
+ // validateSize(), or validateDisplayList().
+ if (usePhasedInstantiation)
+ {
+ if (invalidatePropertiesFlag)
+ {
+ validateProperties();
+
+ // The Preloader listens for this event.
+ systemManager.document.dispatchEvent(
+ new Event("validatePropertiesComplete"));
+ }
+
+ else if (invalidateSizeFlag)
+ {
+ validateSize();
+
+ // The Preloader listens for this event.
+ systemManager.document.dispatchEvent(
+ new Event("validateSizeComplete"));
+ }
+
+ else if (invalidateDisplayListFlag)
+ {
+ validateDisplayList();
+
+ // The Preloader listens for this event.
+ systemManager.document.dispatchEvent(
+ new Event("validateDisplayListComplete"));
+ }
+ }
+
+ // Otherwise, do one pass of all three phases.
+ else
+ {
+ if (invalidatePropertiesFlag)
+ validateProperties();
+
+ if (invalidateSizeFlag)
+ validateSize();
+
+ if (invalidateDisplayListFlag)
+ validateDisplayList();
+ }
+
+ // trace("invalidatePropertiesFlag " + invalidatePropertiesFlag);
+ // trace("invalidateSizeFlag " + invalidateSizeFlag);
+ // trace("invalidateDisplayListFlag " + invalidateDisplayListFlag);
+
+ if (invalidatePropertiesFlag ||
+ invalidateSizeFlag ||
+ invalidateDisplayListFlag)
+ {
+ attachListeners(systemManager);
+ }
+ else
+ {
+ usePhasedInstantiation = false;
+
+ listenersAttached = false;
+
+ var obj:ILayoutManagerClient = ILayoutManagerClient(updateCompleteQueue.removeLargest());
+ while (obj)
+ {
+ if (!obj.initialized && obj.processedDescriptors)
+ obj.initialized = true;
+ if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE))
+ obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
+ obj.updateCompletePendingFlag = false;
+ obj = ILayoutManagerClient(updateCompleteQueue.removeLargest());
+ }
+
+ // trace("updateComplete");
+
+ dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
+ }
+
+ // trace("<<DoPhasedInstantation");
+ }
+
+ /**
+ * When properties are changed, components generally do not apply those changes immediately.
+ * Instead the components usually call one of the LayoutManager's invalidate methods and
+ * apply the properties at a later time. The actual property you set can be read back
+ * immediately, but if the property affects other properties in the component or its
+ * children or parents, those other properties may not be immediately updated. To
+ * guarantee that the values are updated, you can call the <code>validateNow()</code> method.
+ * It updates all properties in all components before returning.
+ * Call this method only when necessary as it is a computationally intensive call.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function validateNow():void
+ {
+ if (!usePhasedInstantiation)
+ {
+ var infiniteLoopGuard:int = 0;
+ while (listenersAttached && infiniteLoopGuard++ < 100)
+ doPhasedInstantiation();
+ }
+ }
+
+ /**
+ * When properties are changed, components generally do not apply those changes immediately.
+ * Instead the components usually call one of the LayoutManager's invalidate methods and
+ * apply the properties at a later time. The actual property you set can be read back
+ * immediately, but if the property affects other properties in the component or its
+ * children or parents, those other properties may not be immediately updated.
+ *
+ * <p>To guarantee that the values are updated,
+ * you can call the <code>validateClient()</code> method.
+ * It updates all properties in all components whose nest level is greater than or equal
+ * to the target component before returning.
+ * Call this method only when necessary as it is a computationally intensive call.</p>
+ *
+ * @param target The component passed in is used to test which components
+ * should be validated. All components contained by this component will have their
+ * <code>validateProperties()</code>, <code>commitProperties()</code>,
+ * <code>validateSize()</code>, <code>measure()</code>,
+ * <code>validateDisplayList()</code>,
+ * and <code>updateDisplayList()</code> methods called.
+ *
+ * @param skipDisplayList If <code>true</code>,
+ * does not call the <code>validateDisplayList()</code>
+ * and <code>updateDisplayList()</code> methods.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean = false):void
+ {
+ CONFIG::performanceInstrumentation
+ {
+ var perfUtil:PerfUtil = PerfUtil.getInstance();
+ var token:int = perfUtil.markStart();
+ }
+
+ var lastCurrentObject:ILayoutManagerClient = currentObject;
+
+ var obj:ILayoutManagerClient;
+ var i:int = 0;
+ var done:Boolean = false;
+ var oldTargetLevel:int = targetLevel;
+
+ // the theory here is that most things that get validated are deep in the tree
+ // and so there won't be nested calls to validateClient. However if there is,
+ // we don't want to have a more sophisticated scheme of keeping track
+ // of dirty flags at each level that is being validated, but we definitely
+ // do not want to keep scanning the queues unless we're pretty sure that
+ // something might be dirty so we just say that if something got dirty
+ // during this call at a deeper nesting than the first call to validateClient
+ // then we'll scan the queues. So we only change targetLevel if we're the
+ // outer call to validateClient and only that call restores it.
+ if (targetLevel == int.MAX_VALUE)
+ targetLevel = target.nestLevel;
+
+ // trace("--- LayoutManager: validateClient ---> target = " + target);
+
+ while (!done)
+ {
+ // assume we won't find anything
+ done = true;
+
+ // Keep traversing the invalidatePropertiesQueue until we've reached the end.
+ // More elements may get added to the queue while we're in this loop, or a
+ // a recursive call to this function may remove elements from the queue while
+ // we're in this loop.
+ obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
+ while (obj)
+ {
+ // trace("LayoutManager calling validateProperties() on " + Object(obj) + " " + DisplayObject(obj).width + " " + DisplayObject(obj).height);
+
+ if (obj.nestLevel)
+ {
+ currentObject = obj;
+ obj.validateProperties();
+ if (!obj.updateCompletePendingFlag)
+ {
+ updateCompleteQueue.addObject(obj, obj.nestLevel);
+ obj.updateCompletePendingFlag = true;
+ }
+ }
+
+ // Once we start, don't stop.
+ obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
+ }
+
+ if (invalidatePropertiesQueue.isEmpty())
+ {
+ // trace("Properties Queue is empty");
+
+ invalidatePropertiesFlag = false;
+ invalidateClientPropertiesFlag = false;
+ }
+
+ // trace("--- LayoutManager: validateSize --->");
+
+ obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
+ while (obj)
+ {
+ // trace("LayoutManager calling validateSize() on " + Object(obj));
+
+ if (obj.nestLevel)
+ {
+ currentObject = obj;
+ obj.validateSize();
+ if (!obj.updateCompletePendingFlag)
+ {
+ updateCompleteQueue.addObject(obj, obj.nestLevel);
+ obj.updateCompletePendingFlag = true;
+ }
+ }
+
+ // trace("LayoutManager validateSize: " + Object(obj) + " " + IFlexDisplayObject(obj).measuredWidth + " " + IFlexDisplayObject(obj).measuredHeight);
+
+ if (invalidateClientPropertiesFlag)
+ {
+ // did any properties get invalidated while validating size?
+ obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
+ if (obj)
+ {
+ // re-queue it. we'll pull it at the beginning of the loop
+ invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
+ done = false;
+ break;
+ }
+ }
+
+ obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
+ }
+
+ if (invalidateSizeQueue.isEmpty())
+ {
+ // trace("Measurement Queue is empty");
+
+ invalidateSizeFlag = false;
+ invalidateClientSizeFlag = false;
+ }
+
+ if (!skipDisplayList)
+ {
+ // trace("--- LayoutManager: validateDisplayList --->");
+
+ obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
+ while (obj)
+ {
+ // trace("LayoutManager calling validateDisplayList on " + Object(obj) + " " + DisplayObject(obj).width + " " + DisplayObject(obj).height);
+
+ if (obj.nestLevel)
+ {
+ currentObject = obj;
+ obj.validateDisplayList();
+ if (!obj.updateCompletePendingFlag)
+ {
+ updateCompleteQueue.addObject(obj, obj.nestLevel);
+ obj.updateCompletePendingFlag = true;
+ }
+ }
+ // trace("LayoutManager return from validateDisplayList on " + Object(obj) + " " + DisplayObject(obj).width + " " + DisplayObject(obj).height);
+
+ if (invalidateClientPropertiesFlag)
+ {
+ // did any properties get invalidated while validating size?
+ obj = ILayoutManagerClient(invalidatePropertiesQueue.removeSmallestChild(target));
+ if (obj)
+ {
+ // re-queue it. we'll pull it at the beginning of the loop
+ invalidatePropertiesQueue.addObject(obj, obj.nestLevel);
+ done = false;
+ break;
+ }
+ }
+
+ if (invalidateClientSizeFlag)
+ {
+ obj = ILayoutManagerClient(invalidateSizeQueue.removeLargestChild(target));
+ if (obj)
+ {
+ // re-queue it. we'll pull it at the beginning of the loop
+ invalidateSizeQueue.addObject(obj, obj.nestLevel);
+ done = false;
+ break;
+ }
+ }
+
+ // Once we start, don't stop.
+ obj = ILayoutManagerClient(invalidateDisplayListQueue.removeSmallestChild(target));
+ }
+
+
+ if (invalidateDisplayListQueue.isEmpty())
+ {
+ // trace("Layout Queue is empty");
+
+ invalidateDisplayListFlag = false;
+ }
+ }
+ }
+
+ if (oldTargetLevel == int.MAX_VALUE)
+ {
+ targetLevel = int.MAX_VALUE;
+ if (!skipDisplayList)
+ {
+ obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
+ while (obj)
+ {
+ if (!obj.initialized)
+ obj.initialized = true;
+
+ if (obj.hasEventListener(FlexEvent.UPDATE_COMPLETE))
+ obj.dispatchEvent(new FlexEvent(FlexEvent.UPDATE_COMPLETE));
+ obj.updateCompletePendingFlag = false;
+ obj = ILayoutManagerClient(updateCompleteQueue.removeLargestChild(target));
+ }
+ }
+ }
+
+ currentObject = lastCurrentObject;
+
+ CONFIG::performanceInstrumentation
+ {
+ perfUtil.markEnd(" validateClient()", token, 2 /*tolerance*/, target);
+ }
+
+ // trace("<--- LayoutManager: validateClient --- target = " + target);
+ }
+
+ /**
+ * Returns <code>true</code> if there are components that need validating;
+ * <code>false</code> if all components have been validated.
+ *
+ * @return Returns <code>true</code> if there are components that need validating;
+ * <code>false</code> if all components have been validated.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function isInvalid():Boolean
+ {
+ return invalidatePropertiesFlag ||
+ invalidateSizeFlag ||
+ invalidateDisplayListFlag;
+ }
+
+ /**
+ * @private
+ * callLater() is called immediately after an object is created.
+ * We really want to wait one more frame before starting in.
+ */
+ private function waitAFrame(event:Event):void
+ {
+ // trace(">>LayoutManager:WaitAFrame");
+
+ systemManager.removeEventListener(Event.ENTER_FRAME, waitAFrame);
+ systemManager.addEventListener(Event.ENTER_FRAME, doPhasedInstantiationCallback);
+ waitedAFrame = true;
+
+ // trace("<<LayoutManager:WaitAFrame");
+ }
+
+ public function attachListeners(systemManager:ISystemManager):void
+ {
+ if (!waitedAFrame)
+ {
+ systemManager.addEventListener(Event.ENTER_FRAME, waitAFrame);
+ }
+ else
+ {
+ systemManager.addEventListener(Event.ENTER_FRAME, doPhasedInstantiationCallback);
+ if (!usePhasedInstantiation)
+ {
+ COMPILE::SWF
+ {
+ if (systemManager && (systemManager.stage || usingBridge(systemManager)))
+ {
+ systemManager.addEventListener(Event.RENDER, doPhasedInstantiationCallback);
+ if (systemManager.stage)
+ systemManager.stage.invalidate();
+ }
+ }
+ }
+ }
+
+ listenersAttached = true;
+ }
+
+ private function doPhasedInstantiationCallback(event:Event):void
+ {
+ // if our background processing is suspended, then we shouldn't do any
+ // validation
+ if (UIComponentGlobals.callLaterSuspendCount > 0)
+ return;
+
+ systemManager.removeEventListener(Event.ENTER_FRAME, doPhasedInstantiationCallback);
+ COMPILE::SWF
+ {
+ systemManager.removeEventListener(Event.RENDER, doPhasedInstantiationCallback);
+ }
+
+ if (!UIComponentGlobals.catchCallLaterExceptions)
+ {
+ doPhasedInstantiation();
+ }
+
+ else
+ {
+ try
+ {
+ doPhasedInstantiation();
+ }
+ catch(e:Error)
+ {
+ // Dispatch a callLaterError dynamic event for Design View.
+ var callLaterErrorEvent:DynamicEvent = new DynamicEvent("callLaterError");
+ callLaterErrorEvent.error = e;
+ callLaterErrorEvent.source = this;
+ callLaterErrorEvent.object = currentObject;
+ systemManager.dispatchEvent(callLaterErrorEvent);
+ }
+ }
+ currentObject = null;
+ }
+
+ private var _usingBridge:int = -1;
+
+ /**
+ * @private
+ */
+ private function usingBridge(sm:ISystemManager):Boolean
+ {
+ COMPILE::LATER
+ {
+ if (_usingBridge == 0) return false;
+ if (_usingBridge == 1) return true;
+
+ if (!sm) return false;
+
+ // no types so no dependencies
+ var mp:Object = sm.getImplementation("mx.managers::IMarshalSystemManager");
+ if (!mp)
+ {
+ _usingBridge = 0;
+ return false;
+ }
+ if (mp.useSWFBridge())
+ {
+ _usingBridge = 1;
+ return true;
+ }
+ _usingBridge = 0;
+ }
+ return false;
+ }
+
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as
index b54bc51..ab629e3 100644
--- a/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/SystemManager.as
@@ -25,10 +25,10 @@ COMPILE::SWF
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Graphics;
+ import flash.display.Loader;
+ import flash.display.LoaderInfo;
import flash.display.MovieClip;
import flash.display.Sprite;
- import flash.display.LoaderInfo;
- import flash.display.Loader;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageQuality;
@@ -39,12 +39,14 @@ COMPILE::SWF
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
- import flash.ui.Keyboard;
import flash.geom.Point;
import flash.system.ApplicationDomain;
import flash.text.Font;
import flash.text.TextFormat;
- import flash.utils.Dictionary;
+ import flash.ui.Keyboard;
+ import flash.utils.Dictionary;
+
+ import flex.events.FlashEventConverter;
}
COMPILE::JS
{
@@ -1695,6 +1697,7 @@ public class SystemManager extends MovieClip
// Use weak listener because we don't always know when we
// no longer need this listener
stage.addEventListener(type, stageEventHandler, false, 0, true);
+ stage.addEventListener(type, flashListener, true, 9999);
}
}
catch (error:SecurityError)
@@ -1726,10 +1729,12 @@ public class SystemManager extends MovieClip
if (stage)
{
stage.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+ stage.addEventListener(type, flashListener, false, 9999);
}
else
{
super.addEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler, false, 0, true);
+ super.addEventListener(type, flashListener, true, 9999);
}
}
catch (error:SecurityError)
@@ -1750,9 +1755,15 @@ public class SystemManager extends MovieClip
try
{
if (stage)
+ {
stage.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ stage.addEventListener(type, flashListener, false, 9999);
+ }
else
+ {
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ super.addEventListener(type, flashListener, true, 9999);
+ }
}
catch (error:SecurityError)
{
@@ -1785,8 +1796,15 @@ public class SystemManager extends MovieClip
super.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ super.addEventListener(type, flashListener, true, 9999);
}
+ COMPILE::SWF
+ private function flashListener(e:flash.events.Event):void
+ {
+ trace(e.type, e.target);
+ }
+
/**
* @private
*/
@@ -2296,6 +2314,21 @@ public class SystemManager extends MovieClip
domain);
}
}
+ COMPILE::SWF
+ {
+ // Initialize the preloader.
+ preloader.initialize(
+ usePreloader,
+ preloaderDisplayClass,
+ preloaderBackgroundColor,
+ preloaderBackgroundAlpha,
+ preloaderBackgroundImage,
+ preloaderBackgroundSize,
+ isStageRoot ? stage.stageWidth : loaderInfo.width,
+ isStageRoot ? stage.stageHeight : loaderInfo.height,
+ null,
+ null);
+ }
COMPILE::JS
{
@@ -2912,6 +2945,10 @@ public class SystemManager extends MovieClip
}
// Add the application as child 1.
noTopMostIndex = noTopMostIndex + 1;
+ COMPILE::SWF
+ {
+ FlashEventConverter.removeAllConverters(app as DisplayObject);
+ }
super.addChildAt(DisplayObject(app), 1);
CONFIG::performanceInstrumentation
@@ -3243,6 +3280,7 @@ public class SystemManager extends MovieClip
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, false, 1000);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, mouseEventHandler, false, 1000);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 1000);
+ FlashEventConverter.setupAllConverters(this);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/aaa01ca6/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as b/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
new file mode 100644
index 0000000..4aca9b9
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
@@ -0,0 +1,398 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers.layoutClasses
+{
+
+COMPILE::SWF
+{
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+ import flex.display.DisplayObjectContainer;
+}
+
+import mx.core.IChildList;
+import mx.core.IRawChildrenContainer;
+import mx.managers.ILayoutManagerClient;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * The PriorityQueue class provides a general purpose priority queue.
+ * It is used internally by the LayoutManager.
+ */
+public class PriorityQueue
+{
+ include "../../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function PriorityQueue()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var priorityBins:Array = [];
+
+ /**
+ * @private
+ * The smallest occupied index in arrayOfDictionaries.
+ */
+ private var minPriority:int = 0;
+
+ /**
+ * @private
+ * The largest occupied index in arrayOfDictionaries.
+ */
+ private var maxPriority:int = -1;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function addObject(obj:Object, priority:int):void
+ {
+ // Update our min and max priorities.
+ if (maxPriority < minPriority)
+ {
+ minPriority = maxPriority = priority;
+ }
+ else
+ {
+ if (priority < minPriority)
+ minPriority = priority;
+ if (priority > maxPriority)
+ maxPriority = priority;
+ }
+
+ var bin:PriorityBin = priorityBins[priority];
+
+ if (!bin)
+ {
+ // If no hash exists for the specified priority, create one.
+ bin = new PriorityBin();
+ priorityBins[priority] = bin;
+ bin.items[obj] = true;
+ bin.length++;
+ }
+ else
+ {
+ // If we don't already hold the obj in the specified hash, add it
+ // and update our item count.
+ if (bin.items[obj] == null)
+ {
+ bin.items[obj] = true;
+ bin.length++;
+ }
+ }
+
+ }
+
+ /**
+ * @private
+ */
+ public function removeLargest():Object
+ {
+ var obj:Object = null;
+
+ if (minPriority <= maxPriority)
+ {
+ var bin:PriorityBin = priorityBins[maxPriority];
+ while (!bin || bin.length == 0)
+ {
+ maxPriority--;
+ if (maxPriority < minPriority)
+ return null;
+ bin = priorityBins[maxPriority];
+ }
+
+ // Remove the item with largest priority from our priority queue.
+ // Must use a for loop here since we're removing a specific item
+ // from a 'Dictionary' (no means of directly indexing).
+ for (var key:Object in bin.items )
+ {
+ obj = key;
+ removeChild(ILayoutManagerClient(key), maxPriority);
+ break;
+ }
+
+ // Update maxPriority if applicable.
+ while (!bin || bin.length == 0)
+ {
+ maxPriority--;
+ if (maxPriority < minPriority)
+ break;
+ bin = priorityBins[maxPriority];
+ }
+
+ }
+
+ return obj;
+ }
+
+ /**
+ * @private
+ */
+ public function removeLargestChild(client:ILayoutManagerClient ):Object
+ {
+ var max:int = maxPriority;
+ var min:int = client.nestLevel;
+
+ while (min <= max)
+ {
+ var bin:PriorityBin = priorityBins[max];
+ if (bin && bin.length > 0)
+ {
+ if (max == client.nestLevel)
+ {
+ // If the current level we're searching matches that of our
+ // client, no need to search the entire list, just check to see
+ // if the client exists in the queue (it would be the only item
+ // at that nestLevel).
+ if (bin.items[client])
+ {
+ removeChild(ILayoutManagerClient(client), max);
+ return client;
+ }
+ }
+ else
+ {
+ for (var key:Object in bin.items )
+ {
+ if ((key is DisplayObject) && contains(DisplayObject(client), DisplayObject(key)))
+ {
+ removeChild(ILayoutManagerClient(key), max);
+ return key;
+ }
+ }
+ }
+
+ max--;
+ }
+ else
+ {
+ if (max == maxPriority)
+ maxPriority--;
+ max--;
+ if (max < min)
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @private
+ */
+ public function removeSmallest():Object
+ {
+ var obj:Object = null;
+
+ if (minPriority <= maxPriority)
+ {
+ var bin:PriorityBin = priorityBins[minPriority];
+ while (!bin || bin.length == 0)
+ {
+ minPriority++;
+ if (minPriority > maxPriority)
+ return null;
+ bin = priorityBins[minPriority];
+ }
+
+ // Remove the item with smallest priority from our priority queue.
+ // Must use a for loop here since we're removing a specific item
+ // from a 'Dictionary' (no means of directly indexing).
+ for (var key:Object in bin.items )
+ {
+ obj = key;
+ removeChild(ILayoutManagerClient(key), minPriority);
+ break;
+ }
+
+ // Update minPriority if applicable.
+ while (!bin || bin.length == 0)
+ {
+ minPriority++;
+ if (minPriority > maxPriority)
+ break;
+ bin = priorityBins[minPriority];
+ }
+ }
+
+ return obj;
+ }
+
+ /**
+ * @private
+ */
+ public function removeSmallestChild(client:ILayoutManagerClient ):Object
+ {
+ var min:int = client.nestLevel;
+
+ while (min <= maxPriority)
+ {
+ var bin:PriorityBin = priorityBins[min];
+ if (bin && bin.length > 0)
+ {
+ if (min == client.nestLevel)
+ {
+ // If the current level we're searching matches that of our
+ // client, no need to search the entire list, just check to see
+ // if the client exists in the queue (it would be the only item
+ // at that nestLevel).
+ if (bin.items[client])
+ {
+ removeChild(ILayoutManagerClient(client), min);
+ return client;
+ }
+ }
+ else
+ {
+ for (var key:Object in bin.items)
+ {
+ if ((key is DisplayObject) && contains(DisplayObject(client), DisplayObject(key)))
+ {
+ removeChild(ILayoutManagerClient(key), min);
+ return key;
+ }
+ }
+ }
+
+ min++;
+ }
+ else
+ {
+ if (min == minPriority)
+ minPriority++;
+ min++;
+ if (min > maxPriority)
+ break;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @private
+ */
+ public function removeChild(client:ILayoutManagerClient, level:int=-1):Object
+ {
+ var priority:int = (level >= 0) ? level : client.nestLevel;
+ var bin:PriorityBin = priorityBins[priority];
+ if (bin && bin.items[client] != null)
+ {
+ delete bin.items[client];
+ bin.length--;
+ return client;
+ }
+ return null;
+ }
+
+ /**
+ * @private
+ */
+ public function removeAll():void
+ {
+ priorityBins.length = 0;
+ minPriority = 0;
+ maxPriority = -1;
+ }
+
+ /**
+ * @private
+ */
+ public function isEmpty():Boolean
+ {
+ return minPriority > maxPriority;
+ }
+
+ /**
+ * @private
+ */
+ private function contains(parent:DisplayObject, child:DisplayObject):Boolean
+ {
+ if (parent is IRawChildrenContainer)
+ {
+ var rawChildren:IChildList = IRawChildrenContainer(parent).rawChildren;
+ return rawChildren.contains(child);
+ }
+ else if (parent is DisplayObjectContainer)
+ {
+ return DisplayObjectContainer(parent).contains(child);
+ }
+
+ return parent == child;
+ }
+
+}
+
+}
+
+COMPILE::LATER
+{
+import flash.utils.Dictionary;
+}
+
+/**
+ * Represents one priority bucket of entries.
+ * @private
+ */
+class PriorityBin
+{
+ public var length:int;
+ COMPILE::LATER
+ {
+ public var items:Dictionary = new Dictionary();
+ }
+ public var items:Object = new Object();
+
+}
[27/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Updated
TodoListSample so it works for SWF and JS, without using event bubbling.
Posted by ah...@apache.org.
Updated TodoListSample so it works for SWF and JS, without using event bubbling.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4ef1bb43
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4ef1bb43
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4ef1bb43
Branch: refs/heads/spark
Commit: 4ef1bb430d12ead4285a92768e0b13e40aa753ee
Parents: eb11ac1
Author: Peter Ent <pe...@apache.org>
Authored: Fri Aug 5 13:18:45 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri Aug 5 13:18:45 2016 -0400
----------------------------------------------------------------------
.../todo/controllers/TodoListController.as | 18 +++++-
.../src/sample/todo/events/TodoListEvent.as | 7 ++
.../src/sample/todo/models/TodoListItem.as | 66 -------------------
.../src/sample/todo/models/TodoListModel.as | 37 ++++-------
.../sample/todo/renderers/TodoItemRenderer.as | 10 +--
.../renderers/TodoListItemRendererFactory.as | 68 ++++++++++++++++++++
.../src/sample/todo/views/TodoListView.mxml | 14 +++-
7 files changed, 119 insertions(+), 101 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
index efd9168..dc39c6d 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
@@ -17,12 +17,12 @@
//
////////////////////////////////////////////////////////////////////////////////
package sample.todo.controllers {
- import sample.todo.events.TodoListEvent;
- import sample.todo.models.TodoListModel;
-
import org.apache.flex.core.Application;
import org.apache.flex.core.IDocument;
import org.apache.flex.events.Event;
+
+ import sample.todo.events.TodoListEvent;
+ import sample.todo.models.TodoListModel;
public class TodoListController implements IDocument {
private var app:TodoListSampleApp;
@@ -47,6 +47,8 @@ package sample.todo.controllers {
*/
private function viewChangeHandler(event:Event):void {
app.initialView.addEventListener(TodoListEvent.LOG_TODO, logTodo);
+ app.initialView.addEventListener(TodoListEvent.ITEM_CHECKED,handleItemChecked);
+ app.initialView.addEventListener(TodoListEvent.ITEM_REMOVE_REQUEST, handleItemRemove);
}
/**
@@ -59,5 +61,15 @@ package sample.todo.controllers {
//todoModel.todos.push({title: evt.todo, selected: false});
todoModel.addTodo(evt.todo);
}
+
+ public function handleItemChecked(event:TodoListEvent):void {
+ var model: TodoListModel = app.model as TodoListModel;
+ model.toggleItemCheck(event.item);
+ }
+
+ public function handleItemRemove(event:TodoListEvent):void {
+ var model: TodoListModel = app.model as TodoListModel;
+ model.removeItem(event.item);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/events/TodoListEvent.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/events/TodoListEvent.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/events/TodoListEvent.as
index c4d5fd1..7c55b61 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/events/TodoListEvent.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/events/TodoListEvent.as
@@ -22,11 +22,18 @@ package sample.todo.events {
public class TodoListEvent extends Event {
public static const LOG_TODO:String = "logTodoEvent";
+ public static const ITEM_CHECKED:String = "itemChecked";
+ public static const ITEM_REMOVE_REQUEST:String = "itemRemoveRequest";
/**
* the todo to log
*/
public var todo:String = null;
+
+ /**
+ * handle item selection or removal
+ */
+ public var item:Object = null;
public function TodoListEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false) {
super(type, bubbles, cancelable);
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as
deleted file mode 100644
index 4e10082..0000000
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as
+++ /dev/null
@@ -1,66 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package sample.todo.models
-{
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- [Event("titleChanged","org.apache.flex.events.Event")]
- [Event("selectedChanged","org.apache.flex.events.Event")]
- [Event("removeItem","org.apache.flex.events.Event")]
-
- public class TodoListItem extends EventDispatcher
- {
- public function TodoListItem(title:String, selected:Boolean)
- {
- super();
- _title = title;
- _selected = selected;
- }
-
- private var _title:String;
- [Event("titleChanged")]
- public function get title():String
- {
- return _title;
- }
- public function set title(value:String):void
- {
- _title = value;
- dispatchEvent(new Event("titleChanged"));
- }
-
- private var _selected:Boolean;
- [Event("selectedChanged")]
- public function get selected():Boolean
- {
- return _selected;
- }
- public function set selected(value:Boolean):void
- {
- _selected = value;
- dispatchEvent(new Event("selectedChanged"));
- }
-
- public function remove():void
- {
- dispatchEvent(new Event("removeItem"));
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
index acf2104..780d4f5 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
@@ -24,29 +24,11 @@ package sample.todo.models {
public function TodoListModel() {
super();
_filterFunction();
-
- addTodo("Get something").selected = true;
- addTodo("Do this").selected = true;
- addTodo("Do that");
}
-
- private function titleChangeHandler(event:Event):void
- {
- dispatchEvent(new Event("todoListChanged"));
- }
-
- private function selectChangeHandler(event:Event):void
- {
- dispatchEvent(new Event("todoListChanged"));
- }
-
- private function removeHandler(event:Event):void
- {
- var item:TodoListItem = event.target as TodoListItem;
- removeItem(item);
- }
- private var _todos:Array = [];
+ private var _todos:Array = [{title:"Get something", selected:true},
+ {title:"Do this", selected:true},
+ {title:"Do that", selected:false}];
private var _filteredList:Array = [];
private var _filterFunction:Function = showAllTodos;
@@ -62,12 +44,9 @@ package sample.todo.models {
dispatchEvent(new Event("todoListChanged"));
}
- public function addTodo(value:String):TodoListItem
+ public function addTodo(value:String):Object
{
- var item:TodoListItem = new TodoListItem(value, false);
- item.addEventListener("titleChanged", titleChangeHandler);
- item.addEventListener("selectedChanged", titleChangeHandler);
- item.addEventListener("removeItem", removeHandler);
+ var item:Object = {title:value, selected:false};
_todos.push(item);
_filterFunction();
@@ -103,6 +82,12 @@ package sample.todo.models {
_filterFunction = showCompletedTodos;
}
+ public function toggleItemCheck(item:Object) : void {
+ item.selected = !item.selected;
+ _filterFunction();
+ dispatchEvent(new Event("todoListChanged"));
+ }
+
public function removeItem(item:Object) : void {
var index:int = _todos.indexOf(item);
if (index >= 0) {
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
index 5e0dd50..7a0d6e3 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
@@ -24,9 +24,9 @@ package sample.todo.renderers {
import org.apache.flex.html.CheckBox;
import org.apache.flex.html.Label;
import org.apache.flex.html.supportClasses.DataItemRenderer;
-
- [Event("checked","org.apache.flex.events.Event")]
- [Event("remove","org.apache.flex.events.Event")]
+
+ [Event("checkChanged","org.apache.flex.events.Event")]
+ [Event("removeRequest","org.apache.flex.events.Event")]
public class TodoItemRenderer extends DataItemRenderer {
@@ -79,12 +79,12 @@ package sample.todo.renderers {
private function checkBoxChange(event:Event):void
{
- data.selected = !data.selected;
+ dispatchEvent(new Event("checkChanged"));
}
private function removeClick(event:MouseEvent):void
{
- data.remove();
+ dispatchEvent(new Event("removeRequest"));
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoListItemRendererFactory.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoListItemRendererFactory.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoListItemRendererFactory.as
new file mode 100644
index 0000000..54f11ff
--- /dev/null
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoListItemRendererFactory.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package sample.todo.renderers {
+
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.beads.DataItemRendererFactoryAndEventDispatcherForArrayData;
+
+ import sample.todo.events.TodoListEvent;
+ import sample.todo.renderers.TodoItemRenderer;
+
+ [Event(name="itemChecked", type="sample.todo.events.TodoListEvent")]
+ [Event(name="itemRemoveRequest", type="sample.todo.events.TodoListEvent")]
+
+ public class TodoListItemRendererFactory extends DataItemRendererFactoryAndEventDispatcherForArrayData {
+
+
+ private var _strand:IStrand;
+
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ _strand = value;
+ }
+
+ override protected function itemRendererCreated(ir:ISelectableItemRenderer):void
+ {
+ IEventDispatcher(ir).addEventListener("checkChanged",itemChecked);
+ IEventDispatcher(ir).addEventListener("removeRequest",itemRemove);
+ }
+
+ private function itemChecked(event:Event):void
+ {
+ var renderer:TodoItemRenderer = event.target as TodoItemRenderer;
+
+ var newEvent:TodoListEvent = new TodoListEvent(TodoListEvent.ITEM_CHECKED);
+ newEvent.item = renderer.data;
+ dispatchEvent(newEvent);
+ }
+
+ private function itemRemove(event:Event):void
+ {
+ var renderer:TodoItemRenderer = event.target as TodoItemRenderer;
+
+ var newEvent:TodoListEvent = new TodoListEvent(TodoListEvent.ITEM_REMOVE_REQUEST);
+ newEvent.item = renderer.data;
+ dispatchEvent(newEvent);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ef1bb43/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml b/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
index a1bd2c8..310cfc0 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
@@ -20,7 +20,8 @@ limitations under the License.
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic"
xmlns:svg="library://ns.apache.org/flexjs/svg"
- initComplete="setup()">
+ initComplete="setup()"
+ xmlns:renderers="sample.todo.renderers.*">
<fx:Script>
<![CDATA[
@@ -51,6 +52,13 @@ limitations under the License.
todoInput.text = "";
}
+ private function forwardEvent(event:TodoListEvent):void
+ {
+ var newEvent:TodoListEvent = new TodoListEvent(event.type);
+ newEvent.item = event.item;
+ dispatchEvent(newEvent);
+ }
+
private function updateStatus(event:org.apache.flex.events.Event):void {
var numberLeft:Number = 0;
@@ -106,6 +114,10 @@ limitations under the License.
itemRenderer="sample.todo.renderers.TodoItemRenderer"
dataProvider="{TodoListModel(applicationModel).todos}"
width="100%" height="400">
+ <js:beads>
+ <renderers:TodoListItemRendererFactory itemChecked="forwardEvent(event)"
+ itemRemoveRequest="forwardEvent(event)" />
+ </js:beads>
</js:List>
<js:Container>
[36/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - exclude
one more file from source release package
Posted by ah...@apache.org.
exclude one more file from source release package
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/94f5f3ad
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/94f5f3ad
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/94f5f3ad
Branch: refs/heads/spark
Commit: 94f5f3adc1ccbc7761dfa39a9116f4914f7112dd
Parents: 30587b1
Author: Alex Harui <ah...@apache.org>
Authored: Sun Aug 14 21:59:32 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Aug 14 21:59:39 2016 -0700
----------------------------------------------------------------------
pom.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/94f5f3ad/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d16af54..29ac1d5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -157,6 +157,8 @@
<exclude>examples/**</exclude>
<!-- JSON files can't contain comments -->
<exclude>**/*.json</exclude>
+ <!-- This is appended to the LICENSE file for binary packages-->
+ <exclude>LICENSE.bin</exclude>
<!-- Stuff that needs to be removed -->
<exclude>fxg2svg/**</exclude>
[04/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - First
working version on JS side.
Posted by ah...@apache.org.
First working version on JS side.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/37251739
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/37251739
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/37251739
Branch: refs/heads/spark
Commit: 372517392e007d846fecb8785450ac0fc26249cf
Parents: a94a923
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 11:00:23 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 11:00:23 2016 +0300
----------------------------------------------------------------------
.../flex/graphics/TransformRotateModel.as | 28 +++++++++++++++++
.../org/apache/flex/svg/GraphicContainer.as | 32 +-------------------
.../flex/org/apache/flex/svg/TransformBead.as | 9 ++++--
3 files changed, 35 insertions(+), 34 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37251739/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
new file mode 100644
index 0000000..2dd97fc
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
@@ -0,0 +1,28 @@
+package org.apache.flex.graphics
+{
+ import org.apache.flex.geom.Matrix;
+
+
+ public class TransformRotateModel extends TransformModel
+ {
+ private var _angle:Number;
+
+ public function TransformRotateModel()
+ {
+ }
+
+ public function get angle():Number
+ {
+ return _angle;
+ }
+
+ public function set angle(value:Number):void
+ {
+ _angle = value;
+ var radians:Number = value * Math.PI/180;
+ matrix = new Matrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
+ }
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37251739/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index b40b53b..351bcec 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -33,28 +33,6 @@ package org.apache.flex.svg
super();
}
- /**
- * @private
- */
- override public function addElement(c:Object, dispatchEvent:Boolean = true):void
- {
- if(c is GraphicShape)
- super.addElement(c, dispatchEvent);
- else
- throw new Error("Only svg elements can be added to svg containers");
- }
-
- /**
- * @private
- */
- override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
- {
- if(c is GraphicShape)
- super.addElementAt(c, index, dispatchEvent);
- else
- throw new Error("Only svg elements can be added to svg containers");
- }
-
public function get transformElement():IFlexJSElement
{
return element;
@@ -89,7 +67,7 @@ package org.apache.flex.svg
element.flexjs_wrapper = this;
graphicGroup = new GraphicGroup();
- addElement(graphicGroup);
+ super.addElement(graphicGroup);
return element;
}
@@ -122,10 +100,6 @@ package org.apache.flex.svg
*/
override public function addElement(c:Object, dispatchEvent:Boolean = true):void
{
- if(!(c is GraphicShape))
- {
- throw new Error("Only svg elements can be added to svg containers");
- }
graphicGroup.addElement(c, dispatchEvent);
if (dispatchEvent)
this.dispatchEvent(new Event("childrenAdded"));
@@ -141,10 +115,6 @@ package org.apache.flex.svg
*/
override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
{
- if(!(c is GraphicShape))
- {
- throw new Error("Only svg elements can be added to svg containers");
- }
graphicGroup.addElementAt(c, index, dispatchEvent);
if (dispatchEvent)
this.dispatchEvent(new Event("childrenAdded"));
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/37251739/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index ed9de0e..3cba59b 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -59,14 +59,17 @@ package org.apache.flex.svg
var flashMatrix:flash.geom.Matrix = new flash.geom.Matrix(fjsm.a, fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty);
element.transform.matrix = flashMatrix;
}
-
+ /**
+ * @flexjsignorecoercion HTMLElement
+ */
COMPILE::JS
public function transform():void
{
var element:org.apache.flex.core.WrappedHTMLElement = host.transformElement;
+ (element.parentNode as HTMLElement).setAttribute("overflow", "visible");
var fjsm:org.apache.flex.geom.Matrix = transformModel.matrix;
- var elem:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
- element.setAttribute("transform", "matrix(" +elem.join(",") + ")";
+ var matrixArray:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
+ element.setAttribute("transform", "matrix(" +matrixArray.join(",") + ")";
}
private function changeHandler(e:Event):void
[28/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Backed
out previous change that was adversely affecting the SWF version.
Posted by ah...@apache.org.
Backed out previous change that was adversely affecting the SWF version.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/895f3666
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/895f3666
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/895f3666
Branch: refs/heads/spark
Commit: 895f36663e890f12ed15a5bfce5917f779a840cf
Parents: 4ef1bb4
Author: Peter Ent <pe...@apache.org>
Authored: Fri Aug 5 14:16:10 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri Aug 5 14:16:10 2016 -0400
----------------------------------------------------------------------
.../flex/html/supportClasses/DataItemRenderer.as | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/895f3666/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
index 71d534a..8b4ad5b 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
@@ -138,23 +138,19 @@ package org.apache.flex.html.supportClasses
{
super.updateRenderer();
- var color:uint = ValuesManager.valuesImpl.getValue(this, "background-color", "selected");
-
background.graphics.clear();
- background.graphics.beginFill(color, (down||selected||hovered)?1:0);
+ background.graphics.beginFill(useColor, (down||selected||hovered)?1:0);
background.graphics.drawRect(0, 0, width, height);
background.graphics.endFill();
}
COMPILE::JS
{
- if (selected) {
- element.className = element.className + " selected";
- }
- else {
- if (element.className.endsWith(" selected")) {
- element.className = element.className.replace(" selected", "");
- }
- }
+ if (selected)
+ element.style.backgroundColor = '#9C9C9C';
+ else if (hovered)
+ element.style.backgroundColor = '#ECECEC';
+ else
+ element.style.backgroundColor = null;
}
}
[11/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Fixed
issues with StyleExample and updated DataChooserMouseController to accept
MouseEvent.
Posted by ah...@apache.org.
Fixed issues with StyleExample and updated DataChooserMouseController to accept MouseEvent.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b3ab3eb3
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b3ab3eb3
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b3ab3eb3
Branch: refs/heads/spark
Commit: b3ab3eb3e21181530025fcc48cd2872394c4f1f3
Parents: e9dbfab
Author: Peter Ent <pe...@apache.org>
Authored: Thu Jul 28 14:58:43 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Thu Jul 28 14:58:43 2016 -0400
----------------------------------------------------------------------
examples/flexjs/StyleExample/src/MyInitialView.mxml | 8 ++++----
.../html/beads/controllers/DateChooserMouseController.as | 3 ++-
2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b3ab3eb3/examples/flexjs/StyleExample/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/StyleExample/src/MyInitialView.mxml b/examples/flexjs/StyleExample/src/MyInitialView.mxml
index c67fe52..944d9ea 100644
--- a/examples/flexjs/StyleExample/src/MyInitialView.mxml
+++ b/examples/flexjs/StyleExample/src/MyInitialView.mxml
@@ -396,10 +396,10 @@ limitations under the License.
<js:CheckBox text="Check Me, please!" />
<js:Spacer height="20" />
- <js:RadioButton text="Apples" groupName="fruits" />
- <js:RadioButton text="Oranges" groupName="fruits" />
- <js:RadioButton text="Grapes" groupName="fruits" />
- <js:RadioButton text="Bananas" groupName="fruits" />
+ <js:RadioButton text="Apples" groupName="fruits" value="1" selected="true" />
+ <js:RadioButton text="Oranges" groupName="fruits" value="2" />
+ <js:RadioButton text="Grapes" groupName="fruits" value="3" />
+ <js:RadioButton text="Bananas" groupName="fruits" value="4" />
<js:Spacer height="10" />
<js:Label id="output" text="An Example of a Label" />
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b3ab3eb3/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
index 0aaa052..c0bed5b 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
@@ -27,6 +27,7 @@ package org.apache.flex.html.beads.controllers
import org.apache.flex.core.IBeadView;
import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
+ import org.apache.flex.events.MouseEvent;
import org.apache.flex.events.IEventDispatcher;
/**
@@ -112,7 +113,7 @@ package org.apache.flex.html.beads.controllers
/**
* @private
*/
- private function dayButtonClickHandler(event:Event):void
+ private function dayButtonClickHandler(event:MouseEvent):void
{
var dateButton:DateChooserButton = event.target as DateChooserButton;
if (dateButton.dayOfMonth > 0) {
[50/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Merge
branch 'develop' into spark
Posted by ah...@apache.org.
Merge branch 'develop' into spark
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/56cc9dd7
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/56cc9dd7
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/56cc9dd7
Branch: refs/heads/spark
Commit: 56cc9dd7f2578ba2e27c1c54901a1514afe874e9
Parents: 075cac2 6d4521d
Author: Alex Harui <ah...@apache.org>
Authored: Thu Aug 25 08:22:58 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Aug 25 08:22:58 2016 -0700
----------------------------------------------------------------------
ApproveFlexJS.xml | 45 +++++++++--------
LICENSE | 5 ++
.../CordovaCameraExample-app.xml | 2 +-
examples/flexjs/DataBindingExample/pom.xml | 1 -
.../src/controllers/MyController.as | 53 ++++++++++++--------
.../src/controllers/MyController.as | 53 ++++++++++++--------
.../src/controllers/MyController.as | 53 ++++++++++++--------
examples/flexjs/DesktopMap/DesktopMap-app.xml | 2 +-
examples/flexjs/MapSearch/MapSearch-app.xml | 2 +-
.../StorageExample/StorageExample-app.xml | 2 +-
examples/flexjs/TodoListSampleApp/pom.xml | 1 -
.../todo/controllers/TodoListController.as | 22 ++++----
.../org/apache/flex/createjs/Application.as | 2 +-
13 files changed, 142 insertions(+), 101 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56cc9dd7/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as
----------------------------------------------------------------------
[05/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - First
working version on JS side.
Posted by ah...@apache.org.
First working version on JS side.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/054a000d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/054a000d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/054a000d
Branch: refs/heads/spark
Commit: 054a000d87569ed0d5b346d1fa81d8b4260a256a
Parents: 3725173
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 11:01:07 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 11:01:07 2016 +0300
----------------------------------------------------------------------
frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/054a000d/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
index b8a5765..17a1349 100644
--- a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
+++ b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
@@ -40,6 +40,7 @@ internal class GraphicsClasses
import org.apache.flex.svg.CompoundGraphic; CompoundGraphic;
import org.apache.flex.svg.LinearGradient; LinearGradient;
import org.apache.flex.graphics.TransformModel; TransformModel;
+ import org.apache.flex.graphics.TransformRotateModel; TransformRotateModel;
import org.apache.flex.svg.TransformBead; TransformBead;
}
[45/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - fix
order of static initializers for now. FalconJX will some day use a cinit()
Posted by ah...@apache.org.
fix order of static initializers for now. FalconJX will some day use a cinit()
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/075cac2b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/075cac2b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/075cac2b
Branch: refs/heads/spark
Commit: 075cac2b019e30f67ecfb99a18b85f46e55a6c7c
Parents: d0dc34f
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 23:06:27 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 23:06:27 2016 -0700
----------------------------------------------------------------------
frameworks/projects/MX/src/main/flex/mx/binding/Binding.as | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/075cac2b/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as b/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
index c19cced..e5ece14 100644
--- a/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/Binding.as
@@ -41,7 +41,6 @@ public class Binding
// Certain errors are normal during binding execution, so we swallow them.
// 1507 - invalid null argument
// 2005 - argument error (null gets converted to 0)
- mx_internal static var allowedErrors:Object = generateAllowedErrors();
mx_internal static function generateAllowedErrors():Object
{
var o:Object = {};
@@ -49,6 +48,7 @@ public class Binding
o[2005] = 1;
return o;
}
+ mx_internal static var allowedErrors:Object = generateAllowedErrors();
//--------------------------------------------------------------------------
//
[22/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Found a
couple of minor bugs while fixing an example.
Posted by ah...@apache.org.
Found a couple of minor bugs while fixing an example.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f57cfc42
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f57cfc42
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f57cfc42
Branch: refs/heads/spark
Commit: f57cfc42ea8a18772940b95668e13ea7cb8b2f87
Parents: 6e9672b
Author: Peter Ent <pe...@apache.org>
Authored: Wed Aug 3 17:27:27 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Aug 3 17:27:27 2016 -0400
----------------------------------------------------------------------
.../HTML/src/main/flex/org/apache/flex/html/beads/ListView.as | 4 ++--
.../org/apache/flex/html/supportClasses/DataItemRenderer.as | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f57cfc42/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
index cab97f8..3018600 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
@@ -165,12 +165,12 @@ package org.apache.flex.html.beads
if (lastSelectedIndex != -1)
{
var ir:ISelectableItemRenderer = dataGroup.getItemRendererForIndex(lastSelectedIndex) as ISelectableItemRenderer;
- ir.selected = false;
+ if (ir != null) ir.selected = false;
}
if (listModel.selectedIndex != -1)
{
ir = dataGroup.getItemRendererForIndex(listModel.selectedIndex) as ISelectableItemRenderer;
- ir.selected = true;
+ if (ir != null) ir.selected = true;
}
lastSelectedIndex = listModel.selectedIndex;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f57cfc42/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
index 796e6b7..71d534a 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
@@ -148,10 +148,12 @@ package org.apache.flex.html.supportClasses
COMPILE::JS
{
if (selected) {
- element.className = "StringItemRenderer selected";
+ element.className = element.className + " selected";
}
else {
- element.className = "StringItemRenderer";
+ if (element.className.endsWith(" selected")) {
+ element.className = element.className.replace(" selected", "");
+ }
}
}
}
[39/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - clean up
after merge
Posted by ah...@apache.org.
clean up after merge
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/1144a442
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1144a442
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1144a442
Branch: refs/heads/spark
Commit: 1144a4424051dff7b26d5d93e1ff4653e9502d1f
Parents: cced948
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 17 13:03:51 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 17 13:03:51 2016 -0700
----------------------------------------------------------------------
frameworks/js/FlexJS/projects/MXJS/build.xml | 23 +------
.../MXJS/src/main/config/compile-js-config.xml | 10 +--
.../org/apache/flex/charts/core/IAxisGroup.as | 4 +-
.../main/flex/org/apache/flex/geom/Rectangle.as | 10 +++
.../flex/org/apache/flex/utils/PointUtils.as | 2 +-
.../org/apache/flex/svg/GraphicContainer.as | 72 ++++++++++++++++----
.../apache/flex/html/beads/DateChooserView.as | 2 +-
.../MX/src/main/flex/flex/display/Graphics.as | 24 ++++---
.../MX/src/main/flex/flex/display/Shape.as | 4 +-
.../MX/src/main/flex/flex/display/Sprite.as | 4 +-
.../MX/src/main/flex/flex/text/TextField.as | 12 ----
.../MX/src/main/flex/mx/core/UIComponent.as | 4 +-
12 files changed, 97 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/js/FlexJS/projects/MXJS/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/MXJS/build.xml b/frameworks/js/FlexJS/projects/MXJS/build.xml
index 5618669..931b965 100644
--- a/frameworks/js/FlexJS/projects/MXJS/build.xml
+++ b/frameworks/js/FlexJS/projects/MXJS/build.xml
@@ -59,13 +59,8 @@
<arg value="-compiler.strict-xml=true" />
<arg value="-keep-asdoc" /><!-- allows compiler to see @flexjsignorecoercion annotations -->
<arg value="-output=${basedir}/target/generated-sources/flexjs" />
- <arg value="-load-config=${basedir}/src/main/config/compile-js-config.xml" />
- <arg value="+playerglobal.version=${playerglobal.version}" />
- <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
- <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
- <arg value="-external-library-path+=${JS.SWC}" />
- <!-- this is not on external-library path otherwise goog.requires are not generated -->
- <arg value="-library-path+=${GCL.SWC}" />
+ <arg value="-load-config=${FLEX_HOME}/frameworks/js-config.xml" />
+ <arg value="-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
</java>
</target>
@@ -79,13 +74,9 @@
<compc fork="true"
output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
+ <load-config filename="${FLEX_HOME}/frameworks/js-config.xml" />
<load-config filename="src/main/config/compile-js-config.xml" />
- <arg value="+playerglobal.version=${playerglobal.version}" />
- <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
<arg value="-compiler.strict-xml=true" />
- <arg value="-external-library-path=${JS.SWC}" />
- <!-- this is not on external-library path otherwise goog.requires are not generated -->
- <arg value="-library-path+=${GCL.SWC}" />
</compc>
<copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/js/FlexJS/libs/${target.name}" />
</target>
@@ -100,14 +91,6 @@
</target>
<target name="check-compiler" depends="check-falcon-home, check-falconjx-home">
- <condition property="JS.SWC" value="${FALCONJX_HOME}/../js/libs/js.swc" >
- <available file="${FALCONJX_HOME}/../js/libs/js.swc" />
- </condition>
- <property name="JS.SWC" value="${FALCONJX_HOME}/../externs/js/target/js.swc" />
- <condition property="GCL.SWC" value="${FALCONJX_HOME}/../js/libs/GCL.swc" >
- <available file="${FALCONJX_HOME}/../js/libs/GCL.swc" />
- </condition>
- <property name="GCL.SWC" value="${FALCONJX_HOME}/../externs/GCL/target/GCL.swc" />
<path id="lib.path">
<fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
</path>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/js/FlexJS/projects/MXJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/MXJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/MXJS/src/main/config/compile-js-config.xml
index a1e507a..73ab68a 100644
--- a/frameworks/js/FlexJS/projects/MXJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/MXJS/src/main/config/compile-js-config.xml
@@ -21,9 +21,6 @@
<compiler>
<accessible>false</accessible>
- <external-library-path>
- </external-library-path>
-
<mxml>
<children-as-data>true</children-as-data>
</mxml>
@@ -61,11 +58,13 @@
<locale/>
<library-path>
+ <path-element>../../../../../../../../js/libs/GCL.swc</path-element>
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
<path-element>../../../../../libs/BindingJS.swc</path-element>
<path-element>../../../../../libs/CoreJS.swc</path-element>
+ <path-element>../../../../../libs/LanguageJS.swc</path-element>
<path-element>../../../../../libs/GraphicsJS.swc</path-element>
<path-element>../../../../../libs/CollectionsJS.swc</path-element>
<path-element>../../../../../libs/ReflectionJS.swc</path-element>
@@ -99,8 +98,5 @@
<include-namespaces>
<uri>library://ns.apache.org/flexjs/mx</uri>
</include-namespaces>
-
- <target-player>${playerglobal.version}</target-player>
-
-
+
</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as
index 575c91d..5b9a1d9 100644
--- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as
+++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as
@@ -18,8 +18,8 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.charts.core
{
- import org.apache.flex.core.graphics.IFill;
- import org.apache.flex.core.graphics.IStroke;
+ import org.apache.flex.graphics.IFill;
+ import org.apache.flex.graphics.IStroke;
import org.apache.flex.core.IVisualElement;
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
index 08aea55..d893738 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Rectangle.as
@@ -255,6 +255,16 @@ public class Rectangle
width = widtha;
height = heighta;
}
+
+
+ /**
+ * Convert rectangles of other types to this Rectangle type.
+ */
+ public static function convert(obj:Object):org.apache.flex.geom.Rectangle
+ {
+ return new org.apache.flex.geom.Rectangle(obj.x, obj.y, obj.width, obj.height);
+ }
+
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
index 8a7cedb..134ff09 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/PointUtils.as
@@ -58,7 +58,7 @@ package org.apache.flex.utils
* @productversion FlexJS 0.0
* @flexjsignorecoercion HTMLElement
*/
- public static function globalToLocal( pt:flash.geom.Point, local:Object ):org.apache.flex.geom.Point
+ public static function globalToLocal( pt:org.apache.flex.geom.Point, local:Object ):org.apache.flex.geom.Point
{
COMPILE::SWF
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index 48c51d1..d72bc04 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -16,6 +16,7 @@ package org.apache.flex.svg
import org.apache.flex.core.ContainerBase;
import org.apache.flex.core.IFlexJSElement;
import org.apache.flex.core.ITransformHost;
+ import org.apache.flex.core.IVisualElement;
COMPILE::JS
{
@@ -85,7 +86,7 @@ package org.apache.flex.svg
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- override public function getElementAt(index:int):Object
+ override public function getElementAt(index:int):IVisualElement
{
return graphicGroup.getElementAt(index);
}
@@ -98,11 +99,11 @@ package org.apache.flex.svg
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- override public function addElement(c:Object, dispatchEvent:Boolean = true):void
+ override public function addElement(c:IVisualElement):IVisualElement
{
- graphicGroup.addElement(c, dispatchEvent);
- if (dispatchEvent)
- this.dispatchEvent(new Event("childrenAdded"));
+ graphicGroup.addElement(c);
+ this.dispatchEvent(new Event("childrenAdded"));
+ return c;
}
/**
@@ -113,11 +114,11 @@ package org.apache.flex.svg
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
+ override public function addElementAt(c:IVisualElement, index:int):IVisualElement
{
- graphicGroup.addElementAt(c, index, dispatchEvent);
- if (dispatchEvent)
- this.dispatchEvent(new Event("childrenAdded"));
+ graphicGroup.addElementAt(c, index);
+ this.dispatchEvent(new Event("childrenAdded"));
+ return c;
}
/**
@@ -128,11 +129,11 @@ package org.apache.flex.svg
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- override public function removeElement(c:Object, dispatchEvent:Boolean = true):void
+ override public function removeElement(c:IVisualElement):IVisualElement
{
- graphicGroup.removeElement(c, dispatchEvent);
- if (dispatchEvent)
- this.dispatchEvent(new Event("childrenRemoved"));
+ graphicGroup.removeElement(c);
+ this.dispatchEvent(new Event("childrenRemoved"));
+ return c;
}
/**
@@ -156,7 +157,7 @@ package org.apache.flex.svg
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- override public function getElementIndex(c:Object):int
+ override public function getElementIndex(c:IVisualElement):int
{
return graphicGroup.getElementIndex(c);
}
@@ -174,6 +175,49 @@ package org.apache.flex.svg
{
return graphicGroup.numElements;
}
+
+ /**
+ * @copy org.apache.flex.core.IParent#addElement()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function addElementNoChangeEvent(c:IVisualElement):IVisualElement
+ {
+ graphicGroup.addElement(c);
+ return c;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#addElementAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function addElementAtNoChangeEvent(c:IVisualElement, index:int):IVisualElement
+ {
+ graphicGroup.addElementAt(c, index);
+ return c;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#removeElement()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function removeElementNoChangeEvent(c:IVisualElement):IVisualElement
+ {
+ graphicGroup.removeElement(c);
+ return c;
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
index 65220d3..58374af 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
@@ -184,7 +184,7 @@ package org.apache.flex.html.beads
dayContainer = new Container();
var tileLayout:TileLayout = new TileLayout();
dayContainer.addBead(tileLayout);
- UIBase(_strand).addElement(dayContainer, false);
+ UIBase(_strand).addElement(dayContainer);
tileLayout.numColumns = 7;
// the calendar has 7 columns with 6 rows, the first row are the day names
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as b/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as
index bee750c..8de5e3e 100644
--- a/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as
+++ b/frameworks/projects/MX/src/main/flex/flex/display/Graphics.as
@@ -19,14 +19,15 @@
package flex.display
{
- import org.apache.flex.core.graphics.GraphicsContainer;
- import org.apache.flex.core.graphics.SolidColor;
+ import org.apache.flex.svg.CompoundGraphic;
+ import org.apache.flex.graphics.SolidColor;
+ import org.apache.flex.graphics.PathBuilder;
public class Graphics
{
- private var host:GraphicsContainer;
+ private var host:CompoundGraphic;
- public function Graphics(host:GraphicsContainer)
+ public function Graphics(host:CompoundGraphic)
{
this.host = host;
}
@@ -64,19 +65,20 @@ package flex.display
public function lineTo(x:Number, y:Number):void
{
- var path:String = "M " + lastX.toString() + " " + lastY.toString();
- path += "L " + x.toString() + " " + y.toString();
- host.drawPath(path);
+ var path:PathBuilder = new PathBuilder();
+ path.moveTo(lastX, lastY);
+ path.lineTo(x, y);
+ host.drawPathCommands(path);
lastX = x;
lastY = y;
}
public function curveTo(mx:Number, my:Number, x:Number, y:Number):void
{
- var path:String = "M " + lastX.toString() + " " + lastY.toString();
- path += "Q " + mx.toString() + " " + my.toString() + " "
- + x.toString() + " " + y.toString();
- host.drawPath(path);
+ var path:PathBuilder = new PathBuilder();
+ path.moveTo(lastX, lastY);
+ path.quadraticCurveTo(mx, my, x, y);
+ host.drawPathCommands(path);
lastX = x;
lastY = y;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/MX/src/main/flex/flex/display/Shape.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/Shape.as b/frameworks/projects/MX/src/main/flex/flex/display/Shape.as
index bfcd184..bbdf1b4 100644
--- a/frameworks/projects/MX/src/main/flex/flex/display/Shape.as
+++ b/frameworks/projects/MX/src/main/flex/flex/display/Shape.as
@@ -19,12 +19,12 @@
package flex.display
{
- import org.apache.flex.core.graphics.GraphicsContainer;
+ import org.apache.flex.svg.CompoundGraphic;
import org.apache.flex.geom.Point;
import org.apache.flex.utils.PointUtils;
import mx.managers.SystemManagerGlobals;
- public class Shape extends GraphicsContainer
+ public class Shape extends CompoundGraphic
{
COMPILE::JS
private var _name:String;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as b/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
index 6b6d668..a83a292 100644
--- a/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
+++ b/frameworks/projects/MX/src/main/flex/flex/display/Sprite.as
@@ -19,12 +19,12 @@
package flex.display
{
- import org.apache.flex.core.graphics.GraphicsContainer;
+ import org.apache.flex.svg.CompoundGraphic;
import org.apache.flex.geom.Point;
import org.apache.flex.utils.PointUtils;
import mx.managers.SystemManagerGlobals;
- public class Sprite extends GraphicsContainer implements DisplayObjectContainer
+ public class Sprite extends CompoundGraphic implements DisplayObjectContainer
{
COMPILE::JS
private var _name:String;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/MX/src/main/flex/flex/text/TextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/flex/text/TextField.as b/frameworks/projects/MX/src/main/flex/flex/text/TextField.as
index 80f88ff..3e97256 100644
--- a/frameworks/projects/MX/src/main/flex/flex/text/TextField.as
+++ b/frameworks/projects/MX/src/main/flex/flex/text/TextField.as
@@ -367,18 +367,6 @@ public class TextField extends Label
return null;
}
- private var _selectable:Boolean;
- public function get selectable():Boolean
- {
- trace("TextField.selectable not implemented");
- return _selectable;
- }
- public function set selectable(value:Boolean):void
- {
- _selectable = value;
- trace("TextField.selectable not implemented");
- }
-
public function get selectionBeginIndex():int
{
trace("TextField.selectionBeginIndex not implemented");
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1144a442/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
index 6fe7bff..ea50d16 100644
--- a/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponent.as
@@ -14026,7 +14026,7 @@ public class UIComponent extends Sprite
{
if (!root || root is TopOfDisplayList || root[fakeMouseX] === undefined)
return super.mouseX;
- return globalToLocal(new Point(root[fakeMouseX], 0)).x;
+ return PointUtils.globalToLocal(new Point(root[fakeMouseX], 0), this).x;
}
/**
@@ -14037,7 +14037,7 @@ public class UIComponent extends Sprite
{
if (!root || root is TopOfDisplayList || root[fakeMouseY] === undefined)
return super.mouseY;
- return globalToLocal(new Point(0, root[fakeMouseY])).y;
+ return PointUtils.globalToLocal(new Point(0, root[fakeMouseY]), this).y;
}
[23/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Updated
the TodoListExample so it works for both SWF and JS.
Posted by ah...@apache.org.
Updated the TodoListExample so it works for both SWF and JS.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3dea25a1
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3dea25a1
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3dea25a1
Branch: refs/heads/spark
Commit: 3dea25a1f3c37ae383480523756d8a75fa070918
Parents: f57cfc4
Author: Peter Ent <pe...@apache.org>
Authored: Wed Aug 3 17:28:36 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Aug 3 17:28:36 2016 -0400
----------------------------------------------------------------------
.../todo/controllers/TodoListController.as | 3 +-
.../src/sample/todo/models/TodoListItem.as | 66 ++++++++++
.../src/sample/todo/models/TodoListModel.as | 88 ++++++++++++--
.../sample/todo/renderers/TodoItemRenderer.as | 21 ++++
.../src/sample/todo/views/TodoListView.mxml | 120 ++++++++++++-------
5 files changed, 245 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3dea25a1/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
index cbc4b1e..efd9168 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/controllers/TodoListController.as
@@ -57,6 +57,7 @@ package sample.todo.controllers {
// still need to change model a view get the changes
var todoModel:TodoListModel = app.model as TodoListModel;
//todoModel.todos.push({title: evt.todo, selected: false});
+ todoModel.addTodo(evt.todo);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3dea25a1/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as
new file mode 100644
index 0000000..4e10082
--- /dev/null
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListItem.as
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package sample.todo.models
+{
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ [Event("titleChanged","org.apache.flex.events.Event")]
+ [Event("selectedChanged","org.apache.flex.events.Event")]
+ [Event("removeItem","org.apache.flex.events.Event")]
+
+ public class TodoListItem extends EventDispatcher
+ {
+ public function TodoListItem(title:String, selected:Boolean)
+ {
+ super();
+ _title = title;
+ _selected = selected;
+ }
+
+ private var _title:String;
+ [Event("titleChanged")]
+ public function get title():String
+ {
+ return _title;
+ }
+ public function set title(value:String):void
+ {
+ _title = value;
+ dispatchEvent(new Event("titleChanged"));
+ }
+
+ private var _selected:Boolean;
+ [Event("selectedChanged")]
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+ dispatchEvent(new Event("selectedChanged"));
+ }
+
+ public function remove():void
+ {
+ dispatchEvent(new Event("removeItem"));
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3dea25a1/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
index e4d06b1..acf2104 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/models/TodoListModel.as
@@ -17,26 +17,98 @@
//
////////////////////////////////////////////////////////////////////////////////
package sample.todo.models {
+ import org.apache.flex.events.Event;
import org.apache.flex.events.EventDispatcher;
public class TodoListModel extends EventDispatcher {
public function TodoListModel() {
super();
+ _filterFunction();
+
+ addTodo("Get something").selected = true;
+ addTodo("Do this").selected = true;
+ addTodo("Do that");
}
+
+ private function titleChangeHandler(event:Event):void
+ {
+ dispatchEvent(new Event("todoListChanged"));
+ }
+
+ private function selectChangeHandler(event:Event):void
+ {
+ dispatchEvent(new Event("todoListChanged"));
+ }
+
+ private function removeHandler(event:Event):void
+ {
+ var item:TodoListItem = event.target as TodoListItem;
+ removeItem(item);
+ }
- private var _todos:Array = [
- {title: "Get something", selected: true},
- {title: "Do this", selected: true},
- {title: "Do that", selected: false}
- ];
+ private var _todos:Array = [];
+
+ private var _filteredList:Array = [];
+ private var _filterFunction:Function = showAllTodos;
- [Bindable]
+ [Bindable("todoListChanged")]
public function get todos():Array {
- return _todos;
+ return _filteredList;
}
public function set todos(value:Array):void {
_todos = value;
+ _filterFunction();
+ dispatchEvent(new Event("todoListChanged"));
}
+
+ public function addTodo(value:String):TodoListItem
+ {
+ var item:TodoListItem = new TodoListItem(value, false);
+ item.addEventListener("titleChanged", titleChangeHandler);
+ item.addEventListener("selectedChanged", titleChangeHandler);
+ item.addEventListener("removeItem", removeHandler);
+ _todos.push(item);
+
+ _filterFunction();
+
+ return item;
+ }
+
+ public function showAllTodos() : void {
+ _filteredList = _todos.slice();
+ dispatchEvent(new Event("todoListChanged"));
+ _filterFunction = showAllTodos;
+ }
+
+ public function showActiveTodos() : void {
+ _filteredList = [];
+ for (var i:int=0; i < _todos.length; i++) {
+ if (!_todos[i].selected) {
+ _filteredList.push(_todos[i]);
+ }
+ }
+ dispatchEvent(new Event("todoListChanged"));
+ _filterFunction = showActiveTodos;
+ }
+
+ public function showCompletedTodos() : void {
+ _filteredList = [];
+ for (var i:int=0; i < _todos.length; i++) {
+ if (_todos[i].selected) {
+ _filteredList.push(_todos[i]);
+ }
+ }
+ dispatchEvent(new Event("todoListChanged"));
+ _filterFunction = showCompletedTodos;
+ }
+
+ public function removeItem(item:Object) : void {
+ var index:int = _todos.indexOf(item);
+ if (index >= 0) {
+ _todos.splice(index,1);
+ }
+ _filterFunction();
+ }
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3dea25a1/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as b/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
index a4fa9f1..5e0dd50 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/renderers/TodoItemRenderer.as
@@ -17,14 +17,22 @@
//
////////////////////////////////////////////////////////////////////////////////
package sample.todo.renderers {
+
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.MouseEvent;
import org.apache.flex.html.Button;
import org.apache.flex.html.CheckBox;
import org.apache.flex.html.Label;
import org.apache.flex.html.supportClasses.DataItemRenderer;
+ [Event("checked","org.apache.flex.events.Event")]
+ [Event("remove","org.apache.flex.events.Event")]
+
public class TodoItemRenderer extends DataItemRenderer {
+
public function TodoItemRenderer() {
super();
+ className = "TodoItemRenderer";
}
private var checkbox:CheckBox;
@@ -36,12 +44,14 @@ package sample.todo.renderers {
checkbox = new CheckBox();
addElement(checkbox);
+ checkbox.addEventListener("change", checkBoxChange);
title = new Label();
addElement(title);
removeButton = new Button();
addElement(removeButton);
+ removeButton.addEventListener("click", removeClick);
}
override public function set data(value:Object):void {
@@ -52,6 +62,7 @@ package sample.todo.renderers {
}
override public function adjustSize():void {
+ var hgt:Number = this.height;
var cy:Number = this.height / 2;
checkbox.x = 10;
@@ -65,5 +76,15 @@ package sample.todo.renderers {
updateRenderer();
}
+
+ private function checkBoxChange(event:Event):void
+ {
+ data.selected = !data.selected;
+ }
+
+ private function removeClick(event:MouseEvent):void
+ {
+ data.remove();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3dea25a1/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml b/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
index 3a4c7e4..a1bd2c8 100644
--- a/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
+++ b/examples/flexjs/TodoListSampleApp/src/sample/todo/views/TodoListView.mxml
@@ -19,69 +19,100 @@ limitations under the License.
-->
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic"
- xmlns:svg="library://ns.apache.org/flexjs/svg">
+ xmlns:svg="library://ns.apache.org/flexjs/svg"
+ initComplete="setup()">
<fx:Script>
<![CDATA[
- import sample.todo.events.TodoListEvent;
-
- /**
- * add to the list the text entered by the user, in the text box,
- * as a new todo list item
- */
- public function logTodo():void {
- var logEvent:TodoListEvent = new TodoListEvent(TodoListEvent.LOG_TODO);
- logEvent.todo = todoInput.text;
- dispatchEvent(logEvent);
-
- //todoList.width = Math.random() * 200; // to show changes v�a ENTER key
- }
-
- /**
- * show all todos
- */
- private function showAll():void {
- }
-
- /**
- * show active todos
- */
- private function showActive():void {
- }
-
- /**
- * show completed todos
- */
- private function showCompleted():void {
- }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.controllers.ItemRendererMouseController;
+
+ import sample.todo.events.TodoListEvent;
+ import sample.todo.models.TodoListModel;
+ import sample.todo.renderers.TodoItemRenderer;
+
+ private function setup():void {
+ // Listening for events on the model will update the UI. Functions like
+ // showActive() change the model which results in this event being
+ // dispatched.
+ (applicationModel as TodoListModel).addEventListener("todoListChanged", updateStatus);
+ updateStatus(null);
+ }
+
+ /**
+ * add to the list the text entered by the user, in the text box,
+ * as a new todo list item
+ */
+ public function logTodo():void {
+ var logEvent:TodoListEvent = new TodoListEvent(TodoListEvent.LOG_TODO);
+ logEvent.todo = todoInput.text;
+ dispatchEvent(logEvent);
+
+ todoInput.text = "";
+ }
+
+ private function updateStatus(event:org.apache.flex.events.Event):void {
+ var numberLeft:Number = 0;
+
+ var model: TodoListModel = applicationModel as TodoListModel;
+ var list: Array = model.todos;
+ for (var i:int=0; i < list.length; i++) {
+ var item:Object = list[i];
+ numberLeft += item.selected ? 0 : 1;
+ }
+
+ statusLabel.text = numberLeft + " items left";
+ }
+
+ /**
+ * show all todos
+ */
+ private function showAll():void {
+ (applicationModel as TodoListModel).showAllTodos();
+ }
+
+ /**
+ * show active todos
+ */
+ private function showActive():void {
+ (applicationModel as TodoListModel).showActiveTodos();
+ }
+
+ /**
+ * show completed todos
+ */
+ private function showCompleted():void {
+ (applicationModel as TodoListModel).showCompletedTodos();
+ }
]]>
</fx:Script>
+
+ <js:beads>
+ <js:ViewDataBinding />
+ </js:beads>
<js:Panel title="FlexJS TODO List" width="600">
<js:beads>
<js:VerticalLayout/>
</js:beads>
- <js:TextInput id="todoInput"
- width="300"
- change="logTodo()"/>
+ <js:HContainer width="100%">
+ <js:TextInput id="todoInput"
+ width="85%"/>
+ <js:TextButton text="Enter" click="logTodo()" width="15%" />
+ </js:HContainer>
<js:List id="todoList"
itemRenderer="sample.todo.renderers.TodoItemRenderer"
- width="300" height="400">
- <!-- dataProvider="{TodoListModel(applicationModel).todos}" -->
- <js:beads>
- <js:ConstantBinding sourceID="applicationModel"
- sourcePropertyName="todos"
- destinationPropertyName="dataProvider"/>
- </js:beads>
+ dataProvider="{TodoListModel(applicationModel).todos}"
+ width="100%" height="400">
</js:List>
<js:Container>
<js:beads>
<js:HorizontalLayout/>
</js:beads>
- <js:Label id="statusLabel" text="N items left"/>
+ <js:Label id="statusLabel" text="N items left" width="295"/>
<svg:TextButton text="All" width="100" height="30" click="showAll()" />
<svg:TextButton text="Active" width="100" height="30" click="showActive()" />
<svg:TextButton text="Completed" width="100" height="30" click="showCompleted()" />
@@ -101,7 +132,8 @@ limitations under the License.
}
renderers|TodoItemRenderer {
- height: 40;
+ backgroundColor: #FFFFFF;
+ height: 40px;
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
}
</fx:Style>
[16/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Merge
commit '726775219086ae65a22e3293a8ea04584210b2cc' into develop
Posted by ah...@apache.org.
Merge commit '726775219086ae65a22e3293a8ea04584210b2cc' into develop
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4cfde5b2
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4cfde5b2
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4cfde5b2
Branch: refs/heads/spark
Commit: 4cfde5b26c1748651fd04d7797433f8abd80a404
Parents: 3882e74 766c76a
Author: yishayw <yi...@hotmail.com>
Authored: Sun Jul 31 10:47:28 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Sun Jul 31 10:47:28 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 13 +-
.../flex/org/apache/flex/core/IBeadTransform.as | 45 +++++
.../flex/org/apache/flex/core/ITransformHost.as | 63 +++++++
.../Core/src/main/resources/basic-manifest.xml | 6 +
.../projects/Graphics/.actionScriptProperties | 21 ---
frameworks/projects/Graphics/.flexLibProperties | 23 +--
.../org/apache/flex/svg/GraphicContainer.as | 175 ++++++++++++++++---
.../src/main/resources/svg-manifest.xml | 3 +-
8 files changed, 283 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4cfde5b2/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
[03/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Merging
Posted by ah...@apache.org.
Merging
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a94a9230
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a94a9230
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a94a9230
Branch: refs/heads/spark
Commit: a94a92300af057c7810c5309d35dfbb4195e4836
Parents: 518995e 9cd2852
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 02:52:35 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 02:52:35 2016 +0300
----------------------------------------------------------------------
.gitignore | 1 +
distribution/src/main/assembly/component.xml | 7 ++-
.../main/resources/frameworks/flex-config.xml | 6 ++-
.../flex/binding/ApplicationDataBinding.as | 20 +++++--
.../apache/flex/binding/ContainerDataBinding.as | 20 +++++--
.../flex/binding/MXMLBeadViewDataBinding.as | 20 +++++--
.../org/apache/flex/binding/ViewDataBinding.as | 16 +++++-
frameworks/projects/Graphics/pom.xml | 4 ++
.../main/flex/org/apache/flex/svg/DOMWrapper.as | 56 ++++++++++++++++++++
.../src/main/resources/basic-manifest.xml | 9 ----
.../src/main/resources/svg-manifest.xml | 30 +++++++++++
manualtests/.gitignore | 1 +
12 files changed, 169 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
[06/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Moved
transform classes that were not specific to graphics to core.
Posted by ah...@apache.org.
Moved transform classes that were not specific to graphics to core.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/54fd2b4d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/54fd2b4d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/54fd2b4d
Branch: refs/heads/spark
Commit: 54fd2b4d89fc539a80ee8136f1e45b958868c1f8
Parents: 054a000
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 11:45:23 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 11:45:23 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 8 ++-
.../flex/org/apache/flex/core/IBeadTransform.as | 45 ++++++++++++++
.../flex/org/apache/flex/core/ITransformHost.as | 62 +++++++++++++++++++
.../flex/org/apache/flex/core/TransformModel.as | 29 +++++++++
.../apache/flex/core/TransformRotateModel.as | 28 +++++++++
.../Graphics/src/main/flex/GraphicsClasses.as | 2 -
.../org/apache/flex/graphics/IBeadTransform.as | 46 --------------
.../org/apache/flex/graphics/ITransformHost.as | 64 --------------------
.../org/apache/flex/graphics/TransformModel.as | 31 ----------
.../flex/graphics/TransformRotateModel.as | 28 ---------
.../org/apache/flex/svg/GraphicContainer.as | 2 +-
.../flex/org/apache/flex/svg/TransformBead.as | 4 +-
12 files changed, 173 insertions(+), 176 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index 2fa67a5..72e9230 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -40,7 +40,8 @@ internal class CoreClasses
import org.apache.flex.core.IAlertModel; IAlertModel;
import org.apache.flex.core.IBead; IBead;
import org.apache.flex.core.IBeadController; IBeadController;
- import org.apache.flex.core.IBeadLayout; IBeadLayout;
+ import org.apache.flex.core.IBeadLayout; IBeadLayout;
+ import org.apache.flex.core.IBeadTransform; IBeadTransform;
import org.apache.flex.core.IBeadModel; IBeadModel;
import org.apache.flex.core.IBeadView; IBeadView;
COMPILE::SWF
@@ -68,6 +69,7 @@ internal class CoreClasses
import org.apache.flex.core.IPopUp; IPopUp;
import org.apache.flex.core.IRangeModel; IRangeModel;
import org.apache.flex.core.ITransformModel; ITransformModel;
+ import org.apache.flex.core.ITransformHost; ITransformHost;
import org.apache.flex.core.IRollOverModel; IRollOverModel;
COMPILE::SWF
{
@@ -147,7 +149,9 @@ internal class CoreClasses
import org.apache.flex.core.IDataGridModel; IDataGridModel;
import org.apache.flex.core.IDataGridPresentationModel; IDataGridPresentationModel;
import org.apache.flex.core.IDateChooserModel; IDateChooserModel;
- import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead;
+ import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead;
+ import org.apache.flex.core.TransformModel; TransformModel;
+ import org.apache.flex.core.TransformRotateModel; TransformRotateModel;
import org.apache.flex.utils.CSSUtils; CSSUtils;
import org.apache.flex.utils.Proxy; Proxy;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IBeadTransform.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IBeadTransform.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IBeadTransform.as
new file mode 100644
index 0000000..41e52e4
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IBeadTransform.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+
+ /**
+ * The IBeadTransform interface is the basic interface for the
+ * container views that transform drawable objects that implement ITransformHost
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IBeadTransform extends IBead
+ {
+
+ /**
+ * Transform the ITransformHost. The implementor of this method should
+ * have concrete knowledge of ITransformHost implementor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function transform():void;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
new file mode 100644
index 0000000..3553cc3
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformHost.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+
+
+
+ /**
+ * The ITransformHost interface is the basic interface for the
+ * container views that have an IBeadTransform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ITransformHost extends IStrand
+ {
+ /**
+ * Each ITransformHost has an element that is actually added to
+ * the platform's display list DOM. It may not be the actual
+ * component itself.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::SWF
+ function get transformElement():IFlexJSElement;
+
+ /**
+ * Each ITransformHost has an element that is actually added to
+ * the platform's display list DOM. It may not be the actual
+ * component itself.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::JS
+ function get transformElement():org.apache.flex.core.WrappedHTMLElement;
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
new file mode 100644
index 0000000..6f0df64
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
@@ -0,0 +1,29 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.geom.Matrix;
+
+ public class TransformModel extends EventDispatcher implements ITransformModel
+ {
+ private var _matrix:Matrix;
+
+ public function TransformModel()
+ {
+ }
+
+ public function get matrix():Matrix
+ {
+ return _matrix;
+ }
+
+ public function set matrix(value:Matrix):void
+ {
+ _matrix = value;
+ dispatchEvent(new Event(Event.CHANGE));
+ }
+
+ public function set strand(value:IStrand):void {}
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
new file mode 100644
index 0000000..b08c767
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
@@ -0,0 +1,28 @@
+package org.apache.flex.core
+{
+ import org.apache.flex.geom.Matrix;
+
+
+ public class TransformRotateModel extends TransformModel
+ {
+ private var _angle:Number;
+
+ public function TransformRotateModel()
+ {
+ }
+
+ public function get angle():Number
+ {
+ return _angle;
+ }
+
+ public function set angle(value:Number):void
+ {
+ _angle = value;
+ var radians:Number = value * Math.PI/180;
+ matrix = new Matrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
+ }
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
index 17a1349..55fccb5 100644
--- a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
+++ b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
@@ -39,8 +39,6 @@ internal class GraphicsClasses
import org.apache.flex.svg.Text; Text;
import org.apache.flex.svg.CompoundGraphic; CompoundGraphic;
import org.apache.flex.svg.LinearGradient; LinearGradient;
- import org.apache.flex.graphics.TransformModel; TransformModel;
- import org.apache.flex.graphics.TransformRotateModel; TransformRotateModel;
import org.apache.flex.svg.TransformBead; TransformBead;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as
deleted file mode 100644
index 1a8f61c..0000000
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as
+++ /dev/null
@@ -1,46 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.graphics
-{
- import org.apache.flex.core.IBead;
-
- /**
- * The IBeadTransform interface is the basic interface for the
- * container views that transform drawable objects that implement ITransformHost
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IBeadTransform extends IBead
- {
-
- /**
- * Transform the ITransformHost. The implementor of this method should
- * have concrete knowledge of ITransformHost implementor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function transform():void;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as
deleted file mode 100644
index 6310dd0..0000000
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as
+++ /dev/null
@@ -1,64 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.graphics
-{
- import org.apache.flex.core.IFlexJSElement;
- import org.apache.flex.core.IStrand;
-
-
-
- /**
- * The ITransformHost interface is the basic interface for the
- * container views that have an IBeadTransform.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface ITransformHost extends IStrand
- {
- /**
- * Each ITransformHost has an element that is actually added to
- * the platform's display list DOM. It may not be the actual
- * component itself.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::SWF
- function get transformElement():IFlexJSElement;
-
- /**
- * Each ITransformHost has an element that is actually added to
- * the platform's display list DOM. It may not be the actual
- * component itself.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::JS
- function get transformElement():org.apache.flex.core.WrappedHTMLElement;
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as
deleted file mode 100644
index 68d650b..0000000
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.flex.graphics
-{
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITransformModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.geom.Matrix;
-
- public class TransformModel extends EventDispatcher implements ITransformModel
- {
- private var _matrix:Matrix;
-
- public function TransformModel()
- {
- }
-
- public function get matrix():Matrix
- {
- return _matrix;
- }
-
- public function set matrix(value:Matrix):void
- {
- _matrix = value;
- dispatchEvent(new Event(Event.CHANGE));
- }
-
- public function set strand(value:IStrand):void {}
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
deleted file mode 100644
index 2dd97fc..0000000
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformRotateModel.as
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.flex.graphics
-{
- import org.apache.flex.geom.Matrix;
-
-
- public class TransformRotateModel extends TransformModel
- {
- private var _angle:Number;
-
- public function TransformRotateModel()
- {
- }
-
- public function get angle():Number
- {
- return _angle;
- }
-
- public function set angle(value:Number):void
- {
- _angle = value;
- var radians:Number = value * Math.PI/180;
- matrix = new Matrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
- }
-
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index 351bcec..0967b85 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -15,7 +15,7 @@ package org.apache.flex.svg
{
import org.apache.flex.core.ContainerBase;
import org.apache.flex.core.IFlexJSElement;
- import org.apache.flex.graphics.ITransformHost;
+ import org.apache.flex.core.ITransformHost;
COMPILE::JS
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54fd2b4d/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index 3cba59b..e852db5 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -4,8 +4,8 @@ package org.apache.flex.svg
import org.apache.flex.core.ITransformModel;
import org.apache.flex.events.Event;
import org.apache.flex.geom.Matrix;
- import org.apache.flex.graphics.IBeadTransform;
- import org.apache.flex.graphics.ITransformHost;
+ import org.apache.flex.core.IBeadTransform;
+ import org.apache.flex.core.ITransformHost;
COMPILE::SWF {
import flash.display.Sprite;
[44/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - fix up a
few issues Falcon caught in Flex source. Falcon is a bit pickier than MXMLC
Posted by ah...@apache.org.
fix up a few issues Falcon caught in Flex source. Falcon is a bit pickier than MXMLC
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d0dc34ff
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d0dc34ff
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d0dc34ff
Branch: refs/heads/spark
Commit: d0dc34ff20b7025635db08182c7155ba5cc6eb5e
Parents: d781656
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 22:20:17 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:20:17 2016 -0700
----------------------------------------------------------------------
frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as | 2 +-
.../MX/src/main/flex/mx/containers/utilityClasses/BoxLayout.as | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d0dc34ff/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as b/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as
index 94c862a..0bd0579 100644
--- a/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as
+++ b/frameworks/projects/MX/src/main/flex/mx/binding/BindabilityInfo.as
@@ -195,7 +195,7 @@ public class BindabilityInfo
}
}
- var numChildren:int = childDesc.length();
+ var numChildren:int = childDesc.length;
if (numChildren == 0)
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d0dc34ff/frameworks/projects/MX/src/main/flex/mx/containers/utilityClasses/BoxLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/containers/utilityClasses/BoxLayout.as b/frameworks/projects/MX/src/main/flex/mx/containers/utilityClasses/BoxLayout.as
index 18e9260..08eb3c9 100644
--- a/frameworks/projects/MX/src/main/flex/mx/containers/utilityClasses/BoxLayout.as
+++ b/frameworks/projects/MX/src/main/flex/mx/containers/utilityClasses/BoxLayout.as
@@ -91,7 +91,7 @@ public class BoxLayout extends Layout
{
var target:Container = super.target;
- var isVertical:Boolean = isVertical();
+ var isVertical:Boolean = this.isVertical();
var minWidth:Number = 0;
var minHeight:Number = 0;
[35/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - also
pick up swcs from the way the approval script sets up falconjx
Posted by ah...@apache.org.
also pick up swcs from the way the approval script sets up falconjx
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/30587b17
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/30587b17
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/30587b17
Branch: refs/heads/spark
Commit: 30587b177205813955e295bc0edf25841f00e022
Parents: ece2ee3
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 13 23:34:00 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Aug 14 21:59:39 2016 -0700
----------------------------------------------------------------------
build.xml | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/30587b17/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index a74d3af..5410b78 100644
--- a/build.xml
+++ b/build.xml
@@ -342,6 +342,12 @@
property="FLEXJS_TYPEDEFS_HOME"
value="${basedir}"/>
+ <echo>basedir is ${basedir}</echo>
+ <available file="${basedir}/../falconjx/js/libs/js.swc"
+ type="file"
+ property="FLEXJS_TYPEDEFS_HOME"
+ value="${basedir}/../falconjx/js/libs"/>
+
<fail message="FLEXJS_TYPEDEFS_HOME must be set to a folder containing js/target/js.swc such as the flex-typedefs repo"
unless="FLEXJS_TYPEDEFS_HOME"/>
</target>
[33/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Remove
MeagerMatrix removed Vector3D Reimplemented Matrix using compatible licensed
code Added chainability to Matrix methods
Posted by ah...@apache.org.
Remove MeagerMatrix
removed Vector3D
Reimplemented Matrix using compatible licensed code
Added chainability to Matrix methods
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/518f7173
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/518f7173
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/518f7173
Branch: refs/heads/spark
Commit: 518f71734bb20c81dbccfb217d58bfe047979f40
Parents: 91b7669
Author: Harbs <ha...@in-tools.com>
Authored: Sun Aug 14 22:34:36 2016 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Sun Aug 14 22:34:36 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 1 -
.../org/apache/flex/core/ITransformModel.as | 6 +-
.../apache/flex/core/TransformCompoundModel.as | 8 +-
.../flex/org/apache/flex/core/TransformModel.as | 8 +-
.../org/apache/flex/core/TransformMoveXModel.as | 4 +-
.../org/apache/flex/core/TransformMoveYModel.as | 4 +-
.../apache/flex/core/TransformRotateModel.as | 4 +-
.../org/apache/flex/core/TransformScaleModel.as | 4 +-
.../main/flex/org/apache/flex/geom/IMatrix.as | 37 --
.../main/flex/org/apache/flex/geom/Matrix.as | 432 ++++++++-----------
.../flex/org/apache/flex/geom/MeagerMatrix.as | 106 -----
.../main/flex/org/apache/flex/geom/Vector3D.as | 208 ---------
.../flex/org/apache/flex/svg/TransformBead.as | 6 +-
13 files changed, 195 insertions(+), 633 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index 3a69a31..3e86f1c 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -110,7 +110,6 @@ internal class CoreClasses
import org.apache.flex.events.ValueEvent; ValueEvent;
import org.apache.flex.events.utils.MouseUtils; MouseUtils;
import org.apache.flex.geom.Matrix; Matrix;
- import org.apache.flex.geom.MeagerMatrix; MeagerMatrix;
import org.apache.flex.geom.Point; Point;
import org.apache.flex.geom.Rectangle; Rectangle;
import org.apache.flex.utils.BinaryData; BinaryData;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
index a88fcb6..56cb961 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
@@ -19,7 +19,7 @@
package org.apache.flex.core
{
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.IMatrix;
+ import org.apache.flex.geom.Matrix;
/**
* The ITransformModel interface describes the minimum set of properties
@@ -40,8 +40,8 @@ package org.apache.flex.core
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- function get matrix():IMatrix;
- function set matrix(value:IMatrix):void;
+ function get matrix():Matrix;
+ function set matrix(value:Matrix):void;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
index ce2e6d2..9418fd1 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
@@ -18,7 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
- import org.apache.flex.geom.IMatrix;
+ import org.apache.flex.geom.Matrix;
[DefaultProperty("transformModels")]
public class TransformCompoundModel extends TransformModel
@@ -28,10 +28,10 @@ package org.apache.flex.core
if (value && value.length > 0)
{
var length:int = value.length;
- var product:IMatrix = (value[0] as ITransformModel).matrix.clone();
+ var product:Matrix = (value[0] as ITransformModel).matrix.clone();
for (var i:int = 1; i < length; i++)
{
- var current:IMatrix = (value[i] as ITransformModel).matrix;
+ var current:Matrix = (value[i] as ITransformModel).matrix;
concat(product, current);
}
matrix = product;
@@ -41,7 +41,7 @@ package org.apache.flex.core
}
}
- private function concat(product:IMatrix, factor:IMatrix):void
+ private function concat(product:Matrix, factor:Matrix):void
{
var result_a:Number = product.a * factor.a;
var result_b:Number = 0.0;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
index e2c083b..063b682 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
@@ -20,21 +20,21 @@ package org.apache.flex.core
{
import org.apache.flex.events.Event;
import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.geom.IMatrix;
+ import org.apache.flex.geom.Matrix;
public class TransformModel extends EventDispatcher implements ITransformModel
{
public static const CHANGE:String = "transferModelChange";
- private var _matrix:IMatrix;
+ private var _matrix:Matrix;
private var _strand:IStrand;
public function TransformModel()
{
}
- public function get matrix():IMatrix
+ public function get matrix():Matrix
{
return _matrix;
}
@@ -49,7 +49,7 @@ package org.apache.flex.core
return _strand as ITransformHost;
}
- public function set matrix(value:IMatrix):void
+ public function set matrix(value:Matrix):void
{
_matrix = value;
if (_strand)
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
index 40dd15f..78f2747 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
@@ -18,7 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
- import org.apache.flex.geom.MeagerMatrix;
+ import org.apache.flex.geom.Matrix;
public class TransformMoveXModel extends TransformModel
{
@@ -36,7 +36,7 @@ package org.apache.flex.core
public function set x(value:Number):void
{
_x = value;
- matrix = new MeagerMatrix(1, 0, 0, 1, x, 0);
+ matrix = new Matrix(1, 0, 0, 1, x, 0);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
index 51b9ba5..4d9f657 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
@@ -18,7 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
- import org.apache.flex.geom.MeagerMatrix;
+ import org.apache.flex.geom.Matrix;
public class TransformMoveYModel extends TransformModel
{
@@ -36,7 +36,7 @@ package org.apache.flex.core
public function set y(value:Number):void
{
_y = value;
- matrix = new MeagerMatrix(1, 0, 0, 1, 0, y);
+ matrix = new Matrix(1, 0, 0, 1, 0, y);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
index 62bc7f6..1b9d1a8 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
@@ -18,7 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
- import org.apache.flex.geom.MeagerMatrix;
+ import org.apache.flex.geom.Matrix;
public class TransformRotateModel extends TransformModel
@@ -38,7 +38,7 @@ package org.apache.flex.core
{
_angle = value;
var radians:Number = value * Math.PI/180;
- matrix = new MeagerMatrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
+ matrix = new Matrix(Math.cos(radians), Math.sin(radians), -Math.sin(radians), Math.cos(radians));
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
index ccd24a8..c8c29a8 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
@@ -18,7 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
- import org.apache.flex.geom.MeagerMatrix;
+ import org.apache.flex.geom.Matrix;
public class TransformScaleModel extends TransformModel
{
@@ -35,7 +35,7 @@ package org.apache.flex.core
public function set scale(value:Number):void
{
_scale = value;
- matrix = new MeagerMatrix(scale, 0, 0, scale, 0, 0);
+ matrix = new Matrix(scale, 0, 0, scale, 0, 0);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
deleted file mode 100644
index abc6348..0000000
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
+++ /dev/null
@@ -1,37 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.geom
-{
- public interface IMatrix
- {
- function get a():Number;
- function set a(value:Number):void;
- function get b():Number;
- function set b(value:Number):void;
- function get c():Number;
- function set c(value:Number):void;
- function get d():Number;
- function set d(value:Number):void;
- function get tx():Number;
- function set tx(value:Number):void;
- function get ty():Number;
- function set ty(value:Number):void;
- function clone():IMatrix
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
index bf634e3..41ca075 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
@@ -19,7 +19,7 @@
package org.apache.flex.geom
{
- public class Matrix implements IMatrix
+ public class Matrix
{
public function Matrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0)
{
@@ -31,319 +31,233 @@ package org.apache.flex.geom
this.ty = ty;
}
- private var _a:Number;
- private var _b:Number;
- private var _c:Number;
- private var _d:Number;
- private var _tx:Number;
- private var _ty:Number;
+ public var a:Number;
+ public var b:Number;
+ public var c:Number;
+ public var d:Number;
+ public var tx:Number;
+ public var ty:Number;
- public function get ty():Number
+ /**
+ * Returns a copy of the Matrix
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function clone():Matrix
{
- return _ty;
- }
-
- public function set ty(value:Number):void
- {
- _ty = value;
- }
-
- public function get tx():Number
- {
- return _tx;
- }
-
- public function set tx(value:Number):void
- {
- _tx = value;
- }
-
- public function get d():Number
- {
- return _d;
- }
-
- public function set d(value:Number):void
- {
- _d = value;
- }
-
- public function get c():Number
- {
- return _c;
- }
-
- public function set c(value:Number):void
- {
- _c = value;
- }
-
- public function get b():Number
- {
- return _b;
- }
-
- public function set b(value:Number):void
- {
- _b = value;
+ return new Matrix(a, b, c, d, tx, ty);
}
-
- public function get a():Number
+
+ /**
+ * Adds the Matrix the current one
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function concat(m:Matrix):Matrix
{
- return _a;
+ var newa:Number = a * m.a + b * m.c;
+ b = a * m.b + b * m.d;
+ a = newa;
+
+ var newc:Number = c * m.a + d * m.c;
+ d = c * m.b + d * m.d;
+ c = newc;
+
+ var newtx:Number = tx * m.a + ty * m.c + m.tx;
+ ty = tx * m.b + ty * m.d + m.ty;
+ tx = newtx;
+ return this;
}
- public function set a(value:Number):void
+ /**
+ * Calculates the Matrix determinant
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function determinant():Number
{
- _a = value;
- }
-
- public function clone():IMatrix
- {
- return new Matrix(a, b, c, d, tx, ty);
- }
-
- public function concat(m:Matrix):void
- {
- var result_a:Number = a * m.a;
- var result_b:Number = 0.0;
- var result_c:Number = 0.0;
- var result_d:Number = d * m.d;
- var result_tx:Number = tx * m.a + m.tx;
- var result_ty:Number = ty * m.d + m.ty;
- if (b != 0.0 || c != 0.0 || m.b != 0.0 || m.c != 0.0)
- {
- result_a = result_a + b * m.c;
- result_d = result_d + c * m.b;
- result_b = result_b + (a * m.b + b * m.d);
- result_c = result_c + (c * m.a + d * m.c);
- result_tx = result_tx + ty * m.c;
- result_ty = result_ty + tx * m.b;
- }
- a = result_a;
- b = result_b;
- c = result_c;
- d = result_d;
- tx = result_tx;
- ty = result_ty;
+ return a * d - b * c;
}
- public function invert():void
+ /**
+ * Inverts the Matrix.
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function invert():Matrix
{
- var a0:* = NaN;
- var a1:* = NaN;
- var a2:* = NaN;
- var a3:* = NaN;
- var det:* = NaN;
- var result_ty:* = NaN;
- if (b == 0.0 && c == 0.0)
+ // if b and c are both 0, we can simplify this.
+ if (b == 0 && c == 0)
{
a = 1 / a;
d = 1 / d;
- b = c = 0.0;
- tx = -a * tx;
- ty = -d * ty;
+ tx *= -a;
+ ty *= -d;
}
else
{
- a0 = a;
- a1 = b;
- a2 = c;
- a3 = d;
- det = a0 * a3 - a1 * a2;
- if (det == 0.0)
+ var det:Number = determinant();
+ if (det == 0)
{
identity();
- return;
+ return this;
}
det = 1 / det;
- a = a3 * det;
- b = -a1 * det;
- c = -a2 * det;
- d = a0 * det;
- result_ty = -(b * tx + d * ty);
- tx = -(a * tx + c * ty);
- ty = result_ty;
+ var newa:Number = d * det;
+ d = a * det;
+ a = newa;
+ b *= -det;
+ c *= -det;
+
+ var newtx:Number = - a * tx - c * ty;
+ ty = - b * tx - d * ty;
+ tx = newtx;
}
+ return this;
}
- public function identity():void
+ /**
+ * Resets the matrix to the default values.
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function identity():Matrix
{
a = d = 1;
- b = c = 0.0;
- tx = ty = 0.0;
+ b = c = tx = ty = 0;
+ return this;
}
- public function createBox(scaleX:Number, scaleY:Number, rotation:Number = 0, tx:Number = 0, ty:Number = 0):void
+ /**
+ * Rotates the Matrix by the specified value.
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function rotate(angle:Number):Matrix
{
- var u:Number = Math.cos(rotation);
- var v:Number = Math.sin(rotation);
- a = u * scaleX;
- b = v * scaleY;
- c = -v * scaleX;
- d = u * scaleY;
- tx = tx;
- ty = ty;
- }
+ var cos:Number = Math.cos(angle);
+ var sin:Number = Math.sin(angle);
+
+ var newa:Number = a * cos - b * sin;
+ b = a * sin + b * cos;
+ a = newa;
- public function createGradientBox(width:Number, height:Number, rotation:Number = 0, tx:Number = 0, ty:Number = 0):void
- {
- createBox(width / 1638.4, height / 1638.4, rotation, tx + width / 2, ty + height / 2);
- }
+ var newc:Number = c * cos - d * sin;
+ d = c * sin + d * cos;
+ c = newc;
- public function rotate(angle:Number):void
- {
- var u:Number = Math.cos(angle);
- var v:Number = Math.sin(angle);
- var result_a:Number = u * a - v * b;
- var result_b:Number = v * a + u * b;
- var result_c:Number = u * c - v * d;
- var result_d:Number = v * c + u * d;
- var result_tx:Number = u * tx - v * ty;
- var result_ty:Number = v * tx + u * ty;
- a = result_a;
- b = result_b;
- c = result_c;
- d = result_d;
- tx = result_tx;
- ty = result_ty;
+ var newtx:Number = tx * cos - ty * sin;
+ ty = tx * sin + ty * cos;
+ tx = newtx;
+ return this;
}
- public function translate(dx:Number, dy:Number):void
+ /**
+ * Moves the Matrix by the specified amount
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function translate(x:Number, y:Number):Matrix
{
- tx = tx + dx;
- ty = ty + dy;
+ tx += x;
+ ty += y;
+ return this;
}
- public function scale(sx:Number, sy:Number):void
+ /**
+ * Scales the Matrix by the specified amount.
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function scale(x:Number, y:Number):Matrix
{
- a = a * sx;
- b = b * sy;
- c = c * sx;
- d = d * sy;
- tx = tx * sx;
- ty = ty * sy;
+ a *= x;
+ b *= y;
+ c *= x;
+ d *= y;
+ tx *= x;
+ ty *= y;
+ return this;
}
+ /**
+ * Uses the Matrix to transform the point without the translation values.
+ * Returns a new Point. The original Point is unchanged.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
public function deltaTransformPoint(point:Point):Point
{
return new Point(a * point.x + c * point.y, d * point.y + b * point.x);
}
+ /**
+ * Uses the Matrix to transform the point including the translation values.
+ * Returns a new Point. The original Point is unchanged.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
public function transformPoint(point:Point):Point
{
return new Point(a * point.x + c * point.y + tx, d * point.y + b * point.x + ty);
}
+ /**
+ * Returns a string representation of the Matrix.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
public function toString():String
{
return "(a=" + a + ", b=" + b + ", c=" + c + ", d=" + d + ", tx=" + tx + ", ty=" + ty + ")";
}
- public function copyFrom(sourceMatrix:Matrix):void
- {
- a = sourceMatrix.a;
- b = sourceMatrix.b;
- c = sourceMatrix.c;
- d = sourceMatrix.d;
- tx = sourceMatrix.tx;
- ty = sourceMatrix.ty;
- }
-
- public function setTo(aa:Number, ba:Number, ca:Number, da:Number, txa:Number, tya:Number):void
- {
- a = aa;
- b = ba;
- c = ca;
- d = da;
- tx = txa;
- ty = tya;
- }
-
- public function copyRowTo(row:uint, vector3D:Vector3D):void
+ /**
+ * Copies the values from another Matrix.
+ * Returns the matrix so the methods can be chained.
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.7
+ */
+ public function copyFrom(source:Matrix):Matrix
{
- switch (row)
- {
- case 0:
- break;
- case 1:
- vector3D.x = b;
- vector3D.y = d;
- vector3D.z = ty;
- break;
- case 2:
- case 3:
- vector3D.x = 0;
- vector3D.y = 0;
- vector3D.z = 1;
- break;
- default:
- vector3D.x = a;
- vector3D.y = c;
- vector3D.z = tx;
- }
- }
-
- public function copyColumnTo(column:uint, vector3D:Vector3D):void
- {
- switch (column)
- {
- case 0:
- break;
- case 1:
- vector3D.x = c;
- vector3D.y = d;
- vector3D.z = 0;
- break;
- case 2:
- case 3:
- vector3D.x = tx;
- vector3D.y = ty;
- vector3D.z = 1;
- break;
- default:
- vector3D.x = a;
- vector3D.y = b;
- vector3D.z = 0;
- }
- }
-
- public function copyRowFrom(row:uint, vector3D:Vector3D):void
- {
- switch (row)
- {
- case 0:
- break;
- case 1:
- case 2:
- b = vector3D.x;
- d = vector3D.y;
- ty = vector3D.z;
- break;
- default:
- a = vector3D.x;
- c = vector3D.y;
- tx = vector3D.z;
- }
+ a = source.a;
+ b = source.b;
+ c = source.c;
+ d = source.d;
+ tx = source.tx;
+ ty = source.ty;
+ return this;
}
- public function copyColumnFrom(column:uint, vector3D:Vector3D):void
- {
- switch (column)
- {
- case 0:
- break;
- case 1:
- case 2:
- b = vector3D.x;
- d = vector3D.y;
- ty = vector3D.z;
- break;
- default:
- a = vector3D.x;
- c = vector3D.y;
- tx = vector3D.z;
- }
- }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as
deleted file mode 100644
index 595b64d..0000000
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/MeagerMatrix.as
+++ /dev/null
@@ -1,106 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.geom
-{
-
- public class MeagerMatrix implements IMatrix
- {
- public function MeagerMatrix(a:Number = 1, b:Number = 0, c:Number = 0, d:Number = 1, tx:Number = 0, ty:Number = 0)
- {
- this.a = a;
- this.b = b;
- this.c = c;
- this.d = d;
- this.tx = tx;
- this.ty = ty;
-
- }
- private var _a:Number;
- private var _b:Number;
- private var _c:Number;
- private var _d:Number;
- private var _tx:Number;
- private var _ty:Number;
-
- public function get ty():Number
- {
- return _ty;
- }
-
- public function set ty(value:Number):void
- {
- _ty = value;
- }
-
- public function get tx():Number
- {
- return _tx;
- }
-
- public function set tx(value:Number):void
- {
- _tx = value;
- }
-
- public function get d():Number
- {
- return _d;
- }
-
- public function set d(value:Number):void
- {
- _d = value;
- }
-
- public function get c():Number
- {
- return _c;
- }
-
- public function set c(value:Number):void
- {
- _c = value;
- }
-
- public function get b():Number
- {
- return _b;
- }
-
- public function set b(value:Number):void
- {
- _b = value;
- }
-
- public function get a():Number
- {
- return _a;
- }
-
- public function set a(value:Number):void
- {
- _a = value;
- }
-
- public function clone():IMatrix
- {
- return new MeagerMatrix(a, b, c, d, tx, ty);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Vector3D.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Vector3D.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Vector3D.as
deleted file mode 100644
index b661d97..0000000
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Vector3D.as
+++ /dev/null
@@ -1,208 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.geom
-{
- COMPILE::SWF
- {
- import flash.geom.Vector3D;
- }
-
- COMPILE::SWF
- public class Vector3D extends flash.geom.Vector3D
- {
- public function Vector3D(x:Number = 0.0, y:Number = 0.0, z:Number = 0.0, w:Number = 0.0)
- {
- super(x,y,z,w);
- }
- override public function clone():flash.geom.Vector3D
- {
- return new org.apache.flex.geom.Vector3D(this.x,this.y,this.z,this.w);
- }
-
- }
-
- COMPILE::JS
- public class Vector3D
- {
- public static const X_AXIS:Vector3D = new Vector3D(1,0,0);
- public static const Y_AXIS:Vector3D = new Vector3D(0,1,0);
- public static const Z_AXIS:Vector3D = new Vector3D(0,0,1);
- public var x:Number;
- public var y:Number;
- public var z:Number;
- public var w:Number;
- public function Vector3D(x:Number = 0.0, y:Number = 0.0, z:Number = 0.0, w:Number = 0.0)
- {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- }
-
- public static function angleBetween(a:Vector3D, b:Vector3D) : Number
- {
- var dot:Number = a.x * b.x + a.y * b.y + a.z * b.z;
- var al:Number = a.length;
- var bl:Number = b.length;
- dot = dot / (al * bl);
- return Math.acos(dot);
- }
-
- public static function distance(pt1:Vector3D, pt2:Vector3D) : Number
- {
- return pt1.subtract(pt2).length;
- }
-
- public function clone():Vector3D
- {
- return new Vector3D(this.x,this.y,this.z,this.w);
- }
-
- public function dotProduct(a:Vector3D):Number
- {
- return this.x * a.x + this.y * a.y + this.z * a.z;
- }
-
- public function crossProduct(a:Vector3D) : Vector3D
- {
- return new Vector3D(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x,1);
- }
-
- public function get length() : Number
- {
- var r:Number = this.x * this.x + this.y * this.y + this.z * this.z;
- if(r <= 0)
- {
- return 0;
- }
- return Math.sqrt(r);
- }
-
- public function get lengthSquared() : Number
- {
- return this.x * this.x + this.y * this.y + this.z * this.z;
- }
-
- public function normalize() : Number
- {
- var len:Number = this.length;
- var lenInv:Number = len != 0?1 / len:0;
- this.x = this.x * lenInv;
- this.y = this.y * lenInv;
- this.z = this.z * lenInv;
- return len;
- }
-
- public function scaleBy(s:Number) : void
- {
- this.x = this.x * s;
- this.y = this.y * s;
- this.z = this.z * s;
- }
-
- public function incrementBy(a:Vector3D) : void
- {
- this.x = this.x + a.x;
- this.y = this.y + a.y;
- this.z = this.z + a.z;
- }
-
- public function decrementBy(a:Vector3D) : void
- {
- this.x = this.x - a.x;
- this.y = this.y - a.y;
- this.z = this.z - a.z;
- }
-
- public function add(a:Vector3D) : Vector3D
- {
- return new Vector3D(this.x + a.x,this.y + a.y,this.z + a.z);
- }
-
- public function subtract(a:Vector3D) : Vector3D
- {
- return new Vector3D(this.x - a.x,this.y - a.y,this.z - a.z);
- }
-
- public function negate() : void
- {
- this.x = -this.x;
- this.y = -this.y;
- this.z = -this.z;
- }
-
- public function equals(toCompare:Vector3D, allFour:Boolean = false) : Boolean
- {
- return this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z && (allFour?this.w == toCompare.w:true);
- }
-
- public function nearEquals(toCompare:Vector3D, tolerance:Number, allFour:Boolean = false) : Boolean
- {
- var diff:Number = this.x - toCompare.x;
- diff = diff < 0?0 - diff:diff;
- var goodEnough:Boolean = diff < tolerance;
- if(goodEnough)
- {
- diff = this.y - toCompare.y;
- diff = diff < 0?0 - diff:diff;
- goodEnough = diff < tolerance;
- if(goodEnough)
- {
- diff = this.z - toCompare.z;
- diff = diff < 0?0 - diff:diff;
- goodEnough = diff < tolerance;
- if(goodEnough && allFour)
- {
- diff = this.w = toCompare.w;
- diff = diff < 0?0 - diff:diff;
- goodEnough = diff < tolerance;
- }
- }
- }
- return goodEnough;
- }
-
- public function project() : void
- {
- var tRecip:Number = 1 / this.w;
- this.x = this.x * tRecip;
- this.y = this.y * tRecip;
- this.z = this.z * tRecip;
- }
-
- public function toString() : String
- {
- return "Vector3D(" + this.x + ", " + this.y + ", " + this.z + ")";
- }
-
- public function copyFrom(sourceVector3D:Vector3D) : void
- {
- this.x = sourceVector3D.x;
- this.y = sourceVector3D.y;
- this.z = sourceVector3D.z;
- }
-
- public function setTo(xa:Number, ya:Number, za:Number) : void
- {
- this.x = xa;
- this.y = ya;
- this.z = za;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518f7173/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index e37f4df..19fe765 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -24,7 +24,7 @@ package org.apache.flex.svg
import org.apache.flex.core.ITransformModel;
import org.apache.flex.core.TransformModel;
import org.apache.flex.events.Event;
- import org.apache.flex.geom.IMatrix;
+ import org.apache.flex.geom.Matrix;
COMPILE::SWF {
import flash.display.Sprite;
@@ -67,7 +67,7 @@ package org.apache.flex.svg
public function transform():void
{
var element:Sprite = host.transformElement as Sprite;
- var fjsm:org.apache.flex.geom.IMatrix = transformModel.matrix;
+ var fjsm:org.apache.flex.geom.Matrix = transformModel.matrix;
var flashMatrix:flash.geom.Matrix = new flash.geom.Matrix(fjsm.a, fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty);
element.transform.matrix = flashMatrix;
}
@@ -79,7 +79,7 @@ package org.apache.flex.svg
{
var element:org.apache.flex.core.WrappedHTMLElement = host.transformElement;
(element.parentNode as HTMLElement).setAttribute("overflow", "visible");
- var fjsm:org.apache.flex.geom.IMatrix = transformModel.matrix;
+ var fjsm:org.apache.flex.geom.Matrix = transformModel.matrix;
var matrixArray:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
var transformStr:String = "matrix(" + matrixArray.join(",") + ")";
element.setAttribute("transform", transformStr);
[25/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - - Fixed
a wrong classifier in the directory distribution for windows systems
Posted by ah...@apache.org.
- Fixed a wrong classifier in the directory distribution for windows systems
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/022fcd0b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/022fcd0b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/022fcd0b
Branch: refs/heads/spark
Commit: 022fcd0babd6ef4ea8b1e6e6ee8c4d5d386223d2
Parents: 5121d5c
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Fri Aug 5 09:53:16 2016 +0200
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Fri Aug 5 09:53:44 2016 +0200
----------------------------------------------------------------------
distribution/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/022fcd0b/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 1f80358..a3d4fcb 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -662,7 +662,7 @@
<groupId>com.adobe.air.runtime</groupId>
<artifactId>air-captive</artifactId>
<version>${air.version}</version>
- <classifier>mac</classifier>
+ <classifier>win</classifier>
<type>zip</type>
</dependency>
</dependencies>
[30/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - fix
default value for FLEX_HOME
Posted by ah...@apache.org.
fix default value for FLEX_HOME
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/bcb3c034
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/bcb3c034
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/bcb3c034
Branch: refs/heads/spark
Commit: bcb3c034472a03e1a2baf68952533bb13d64c47f
Parents: c98d892
Author: Alex Harui <ah...@apache.org>
Authored: Thu Aug 11 09:08:15 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Aug 11 09:08:15 2016 -0700
----------------------------------------------------------------------
examples/build_example.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bcb3c034/examples/build_example.xml
----------------------------------------------------------------------
diff --git a/examples/build_example.xml b/examples/build_example.xml
index 5e1c12d..988ef1a 100644
--- a/examples/build_example.xml
+++ b/examples/build_example.xml
@@ -29,7 +29,7 @@
</and>
</condition>
- <condition property="FALCON_HOME" value="${FLEXJS_HOME}/../flex-falcon/compiler/lib">
+ <condition property="FALCON_HOME" value="${FLEXJS_HOME}/../flex-falcon/compiler">
<and>
<not>
<isset property="FALCON_HOME" />
[26/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Added a
new itemRenderer factory that extends EventDispatcher,
allowing custom itemRenderers to intercept events from the itemRenderers and
forward them.
Posted by ah...@apache.org.
Added a new itemRenderer factory that extends EventDispatcher, allowing custom itemRenderers to intercept events from the itemRenderers and forward them.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/eb11ac15
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/eb11ac15
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/eb11ac15
Branch: refs/heads/spark
Commit: eb11ac158183a3ee41e90a1f5ef0a027a5f8894f
Parents: 022fcd0
Author: Peter Ent <pe...@apache.org>
Authored: Fri Aug 5 13:17:16 2016 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri Aug 5 13:17:16 2016 -0400
----------------------------------------------------------------------
.../projects/HTML/src/main/flex/HTMLClasses.as | 1 +
...ererFactoryAndEventDispatcherForArrayData.as | 191 +++++++++++++++++++
2 files changed, 192 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb11ac15/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
index 51b5e48..f5c0f41 100644
--- a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
+++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
@@ -144,6 +144,7 @@ internal class HTMLClasses
import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
import org.apache.flex.html.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
import org.apache.flex.html.beads.DataItemRendererFactoryForArrayList; DataItemRendererFactoryForArrayList;
+ import org.apache.flex.html.beads.DataItemRendererFactoryAndEventDispatcherForArrayData; DataItemRendererFactoryAndEventDispatcherForArrayData;
import org.apache.flex.html.beads.DataItemRendererFactoryForHierarchicalData; DataItemRendererFactoryForHierarchicalData;
import org.apache.flex.html.supportClasses.DataGroup; DataGroup;
import org.apache.flex.html.supportClasses.Viewport; Viewport;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb11ac15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
new file mode 100644
index 0000000..3c55c60
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryAndEventDispatcherForArrayData.as
@@ -0,0 +1,191 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IDataProviderItemRendererMapper;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IListPresentationModel;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.SimpleCSSStyles;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.List;
+
+ /**
+ * The DataItemRendererFactoryAndEventDispatcherForArrayData class reads an
+ * array of data and creates an item renderer for every
+ * item in the array. As each itemRenderer is created, a function is called
+ * that can be overridden in a subclass. Other implementations of
+ * IDataProviderItemRendererMapper map different data
+ * structures or manage a virtual set of renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataItemRendererFactoryAndEventDispatcherForArrayData extends EventDispatcher implements IBead, IDataProviderItemRendererMapper
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataItemRendererFactoryAndEventDispatcherForArrayData()
+ {
+ super()
+ }
+
+ private var selectionModel:ISelectionModel;
+
+ private var labelField:String;
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+ if (listView == null) {
+ IEventDispatcher(_strand).addEventListener("viewChanged", completeSetup);
+ }
+ else {
+ completeSetup(null);
+ }
+ }
+
+ private function completeSetup(event:Event):void
+ {
+ selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+
+ labelField = (listView.host as List).labelField;
+
+ if (!itemRendererFactory)
+ {
+ _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
+ _strand.addBead(_itemRendererFactory);
+ }
+
+ dataProviderChangeHandler(null);
+ }
+
+ private var _itemRendererFactory:IItemRendererClassFactory;
+
+ /**
+ * The org.apache.flex.core.IItemRendererClassFactory used
+ * to generate instances of item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererFactory():IItemRendererClassFactory
+ {
+ return _itemRendererFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set itemRendererFactory(value:IItemRendererClassFactory):void
+ {
+ _itemRendererFactory = value;
+ }
+
+ /**
+ * The org.apache.flex.core.IItemRendererParent that will
+ * parent the item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ private function dataProviderChangeHandler(event:Event):void
+ {
+ var dp:Array = selectionModel.dataProvider as Array;
+ if (!dp)
+ return;
+
+ dataGroup.removeAllElements();
+
+ var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+ var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
+
+ var n:int = dp.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ISelectableItemRenderer;
+ ir.index = i;
+ ir.labelField = labelField;
+ if (presentationModel) {
+ var style:SimpleCSSStyles = new SimpleCSSStyles();
+ style.marginBottom = presentationModel.separatorThickness;
+ UIBase(ir).style = style;
+ UIBase(ir).height = presentationModel.rowHeight;
+ }
+ dataGroup.addElement(ir);
+ ir.data = dp[i];
+
+ itemRendererCreated(ir);
+ }
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+ }
+
+ /**
+ * Override this function in a subclass to hook event listeners or other features into
+ * the itemRenderer when it has been created and set.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function itemRendererCreated(ir:ISelectableItemRenderer):void
+ {
+ // do something with this in a subclass
+ }
+ }
+}
[40/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - update
license for Matrix class
Posted by ah...@apache.org.
update license for Matrix class
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/27256ce8
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/27256ce8
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/27256ce8
Branch: refs/heads/spark
Commit: 27256ce84d60f43ac735ad769be85beaeb896810
Parents: baa15e4
Author: Alex Harui <ah...@apache.org>
Authored: Thu Aug 18 07:55:18 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Aug 18 07:55:18 2016 -0700
----------------------------------------------------------------------
LICENSE | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/27256ce8/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 15de483..11cf80d 100644
--- a/LICENSE
+++ b/LICENSE
@@ -225,3 +225,8 @@ https://en.wikipedia.org/wiki/File:USA_CIA_Map.svg#file
Most of the .as files in frameworks/projects/GoogleMaps/src/main/flex/google
are derived from the google_maps_api_v3_11.js externs file in the
Google Closure Library which are available under Apache License 2.0.
+
+The file frameworks/projects/Core/src/main/flex/org/apache/flex/geom/Matrix.as
+is derived from OpenFL (https://github.com/openfl) which is available under an
+MIT License.
+
[43/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] -
implement priority queue without dictionary
Posted by ah...@apache.org.
implement priority queue without dictionary
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d7816567
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d7816567
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d7816567
Branch: refs/heads/spark
Commit: d7816567402c2f332fa49d0b9c668048c94f18f6
Parents: 4e61ce4
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 22:19:43 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:19:43 2016 -0700
----------------------------------------------------------------------
.../flex/mx/managers/ILayoutManagerClient.as | 11 ++
.../mx/managers/layoutClasses/PriorityQueue.as | 117 ++++++++++++-------
2 files changed, 83 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d7816567/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
index 1eb5d42..60c45bc 100644
--- a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
@@ -206,6 +206,17 @@ public interface ILayoutManagerClient extends IEventDispatcher
* @productversion Flex 3
*/
function validateDisplayList():void;
+
+ /**
+ * Unique identifier for each instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get uid():String;
+
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d7816567/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as b/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
index 4aca9b9..423d67c 100644
--- a/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/layoutClasses/PriorityQueue.as
@@ -119,20 +119,10 @@ public class PriorityQueue
// If no hash exists for the specified priority, create one.
bin = new PriorityBin();
priorityBins[priority] = bin;
- bin.items[obj] = true;
- bin.length++;
- }
- else
- {
- // If we don't already hold the obj in the specified hash, add it
- // and update our item count.
- if (bin.items[obj] == null)
- {
- bin.items[obj] = true;
- bin.length++;
- }
}
+ bin.add(obj as ILayoutManagerClient);
+
}
/**
@@ -153,15 +143,7 @@ public class PriorityQueue
bin = priorityBins[maxPriority];
}
- // Remove the item with largest priority from our priority queue.
- // Must use a for loop here since we're removing a specific item
- // from a 'Dictionary' (no means of directly indexing).
- for (var key:Object in bin.items )
- {
- obj = key;
- removeChild(ILayoutManagerClient(key), maxPriority);
- break;
- }
+ obj = bin.next();
// Update maxPriority if applicable.
while (!bin || bin.length == 0)
@@ -196,7 +178,7 @@ public class PriorityQueue
// client, no need to search the entire list, just check to see
// if the client exists in the queue (it would be the only item
// at that nestLevel).
- if (bin.items[client])
+ if (bin.hasItem(client))
{
removeChild(ILayoutManagerClient(client), max);
return client;
@@ -204,12 +186,12 @@ public class PriorityQueue
}
else
{
- for (var key:Object in bin.items )
+ for each (var obj:Object in bin.items )
{
- if ((key is DisplayObject) && contains(DisplayObject(client), DisplayObject(key)))
+ if ((obj is DisplayObject) && contains(DisplayObject(client), DisplayObject(obj)))
{
- removeChild(ILayoutManagerClient(key), max);
- return key;
+ removeChild(ILayoutManagerClient(obj), max);
+ return obj;
}
}
}
@@ -247,15 +229,7 @@ public class PriorityQueue
bin = priorityBins[minPriority];
}
- // Remove the item with smallest priority from our priority queue.
- // Must use a for loop here since we're removing a specific item
- // from a 'Dictionary' (no means of directly indexing).
- for (var key:Object in bin.items )
- {
- obj = key;
- removeChild(ILayoutManagerClient(key), minPriority);
- break;
- }
+ obj = bin.next();
// Update minPriority if applicable.
while (!bin || bin.length == 0)
@@ -288,7 +262,7 @@ public class PriorityQueue
// client, no need to search the entire list, just check to see
// if the client exists in the queue (it would be the only item
// at that nestLevel).
- if (bin.items[client])
+ if (bin.hasItem(client))
{
removeChild(ILayoutManagerClient(client), min);
return client;
@@ -296,12 +270,12 @@ public class PriorityQueue
}
else
{
- for (var key:Object in bin.items)
+ for each (var obj:Object in bin.items)
{
- if ((key is DisplayObject) && contains(DisplayObject(client), DisplayObject(key)))
+ if ((obj is DisplayObject) && contains(DisplayObject(client), DisplayObject(obj)))
{
- removeChild(ILayoutManagerClient(key), min);
- return key;
+ removeChild(ILayoutManagerClient(obj), min);
+ return obj;
}
}
}
@@ -328,10 +302,9 @@ public class PriorityQueue
{
var priority:int = (level >= 0) ? level : client.nestLevel;
var bin:PriorityBin = priorityBins[priority];
- if (bin && bin.items[client] != null)
+ if (bin && bin.hasItem(client) != null)
{
- delete bin.items[client];
- bin.length--;
+ bin.remove(client);
return client;
}
return null;
@@ -381,6 +354,7 @@ COMPILE::LATER
{
import flash.utils.Dictionary;
}
+import mx.managers.ILayoutManagerClient;
/**
* Represents one priority bucket of entries.
@@ -388,11 +362,64 @@ import flash.utils.Dictionary;
*/
class PriorityBin
{
- public var length:int;
COMPILE::LATER
{
public var items:Dictionary = new Dictionary();
}
- public var items:Object = new Object();
+
+ public function PriorityBin()
+ {
+ arr = [];
+ map = {};
+ }
+
+ private var arr:Array;
+ private var map:Object;
+
+ public function get length():int
+ {
+ return arr.length;
+ }
+
+ public function add(obj:ILayoutManagerClient):void
+ {
+ if (map[obj.uid] == null)
+ {
+ arr.push(obj);
+ map[obj.uid] = obj;
+ }
+ }
+
+ public function remove(obj:ILayoutManagerClient):void
+ {
+ var i:int = arr.indexOf(obj);
+ arr.splice(i, 1);
+ delete map[obj.uid];
+ }
+
+ public function next():ILayoutManagerClient
+ {
+ if (arr.length == 0) return null;
+
+ var obj:ILayoutManagerClient = arr.shift() as ILayoutManagerClient;
+ delete map[obj.uid];
+ return obj;
+ }
+
+ public function hasItem(obj:ILayoutManagerClient):Boolean
+ {
+ return map[obj.uid] != null;
+ }
+
+ public function empty():void
+ {
+ arr.length == 0;
+ map = {};
+ }
+
+ public function get items():Object
+ {
+ return arr;
+ }
}
[32/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - clean
better
Posted by ah...@apache.org.
clean better
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/91b7669b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/91b7669b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/91b7669b
Branch: refs/heads/spark
Commit: 91b7669bb8372b0f28de6415b3c1ce436e61f444
Parents: 7048caa
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 13 09:43:43 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sat Aug 13 09:43:43 2016 -0700
----------------------------------------------------------------------
frameworks/fontsrc/build.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91b7669b/frameworks/fontsrc/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/fontsrc/build.xml b/frameworks/fontsrc/build.xml
index 149021f..e672b59 100644
--- a/frameworks/fontsrc/build.xml
+++ b/frameworks/fontsrc/build.xml
@@ -86,6 +86,7 @@
</target>
<target name="clean">
+ <delete dir="${basedir}/target" />
<delete file="${basedir}/../fonts/flat-ui-icons-regular.swf" />
</target>
</project>
[49/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - fix
error found by nonfunction test
Posted by ah...@apache.org.
fix error found by nonfunction test
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/6d4521d9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/6d4521d9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/6d4521d9
Branch: refs/heads/spark
Commit: 6d4521d9afc382fda800c002f541610dc353b328
Parents: 19f790d
Author: Alex Harui <ah...@apache.org>
Authored: Wed Aug 24 08:09:03 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 24 08:10:15 2016 -0700
----------------------------------------------------------------------
.../CreateJS/src/main/flex/org/apache/flex/createjs/Application.as | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6d4521d9/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as
index db85a4a..4113dea 100644
--- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as
+++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as
@@ -392,7 +392,7 @@ package org.apache.flex.createjs
*/
public function get numElements():int
{
- return stage.numChildren();
+ return stage.numChildren;
}
}
}
[46/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - clean up
more copyright years
Posted by ah...@apache.org.
clean up more copyright years
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b502a55c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b502a55c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b502a55c
Branch: refs/heads/spark
Commit: b502a55caf7f6f6118a7a2291fd068a7cb62eacf
Parents: 232f6e7
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 20 00:04:55 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 24 08:10:14 2016 -0700
----------------------------------------------------------------------
examples/flexjs/CordovaCameraExample/CordovaCameraExample-app.xml | 2 +-
examples/flexjs/DesktopMap/DesktopMap-app.xml | 2 +-
examples/flexjs/MapSearch/MapSearch-app.xml | 2 +-
examples/flexjs/StorageExample/StorageExample-app.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b502a55c/examples/flexjs/CordovaCameraExample/CordovaCameraExample-app.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/CordovaCameraExample/CordovaCameraExample-app.xml b/examples/flexjs/CordovaCameraExample/CordovaCameraExample-app.xml
index c882034..1bcc5c3 100644
--- a/examples/flexjs/CordovaCameraExample/CordovaCameraExample-app.xml
+++ b/examples/flexjs/CordovaCameraExample/CordovaCameraExample-app.xml
@@ -55,7 +55,7 @@
<!-- <description></description> -->
<!-- Copyright information. Optional -->
- <copyright>Copyright 2015 The Apache Software Foundation.</copyright>
+ <copyright>Copyright 2016 The Apache Software Foundation.</copyright>
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
<!-- <publisherID></publisherID> -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b502a55c/examples/flexjs/DesktopMap/DesktopMap-app.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/DesktopMap/DesktopMap-app.xml b/examples/flexjs/DesktopMap/DesktopMap-app.xml
index 70c4c50..7bca53d 100644
--- a/examples/flexjs/DesktopMap/DesktopMap-app.xml
+++ b/examples/flexjs/DesktopMap/DesktopMap-app.xml
@@ -55,7 +55,7 @@
<!-- <description></description> -->
<!-- Copyright information. Optional -->
- <copyright>Copyright 2015 The Apache Software Foundation.</copyright>
+ <copyright>Copyright 2016 The Apache Software Foundation.</copyright>
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
<!-- <publisherID></publisherID> -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b502a55c/examples/flexjs/MapSearch/MapSearch-app.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MapSearch/MapSearch-app.xml b/examples/flexjs/MapSearch/MapSearch-app.xml
index 35715a7..dd8488b 100644
--- a/examples/flexjs/MapSearch/MapSearch-app.xml
+++ b/examples/flexjs/MapSearch/MapSearch-app.xml
@@ -55,7 +55,7 @@
<!-- <description></description> -->
<!-- Copyright information. Optional -->
- <copyright>Copyright 2015 The Apache Software Foundation.</copyright>
+ <copyright>Copyright 2016 The Apache Software Foundation.</copyright>
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
<!-- <publisherID></publisherID> -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b502a55c/examples/flexjs/StorageExample/StorageExample-app.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/StorageExample/StorageExample-app.xml b/examples/flexjs/StorageExample/StorageExample-app.xml
index 62657d2..92e3d53 100644
--- a/examples/flexjs/StorageExample/StorageExample-app.xml
+++ b/examples/flexjs/StorageExample/StorageExample-app.xml
@@ -55,7 +55,7 @@
<!-- <description></description> -->
<!-- Copyright information. Optional -->
- <copyright>Copyright 2015 The Apache Software Foundation.</copyright>
+ <copyright>Copyright 2016 The Apache Software Foundation.</copyright>
<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
<!-- <publisherID></publisherID> -->
[20/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Fixed
some errors spotted by Jenkins, but not by the up2date ant script.
Posted by ah...@apache.org.
Fixed some errors spotted by Jenkins, but not by the up2date ant script.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/13323e6b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/13323e6b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/13323e6b
Branch: refs/heads/spark
Commit: 13323e6b6cb7e88237f843db385ab7da6f036250
Parents: 2124051
Author: yishayw <yi...@hotmail.com>
Authored: Mon Aug 1 10:37:11 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Mon Aug 1 10:37:11 2016 +0300
----------------------------------------------------------------------
.../src/main/flex/org/apache/flex/svg/GraphicContainer.as | 2 +-
.../Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13323e6b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index 0967b85..48c51d1 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -181,10 +181,10 @@ import org.apache.flex.core.ContainerBase;
class GraphicGroup extends ContainerBase
{
- COMPILE::JS
/**
* @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
*/
+ COMPILE::JS
override protected function createElement():org.apache.flex.core.WrappedHTMLElement
{
element = document.createElementNS('http://www.w3.org/2000/svg', 'g') as org.apache.flex.core.WrappedHTMLElement;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13323e6b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index 8db37a0..e37f4df 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -81,7 +81,8 @@ package org.apache.flex.svg
(element.parentNode as HTMLElement).setAttribute("overflow", "visible");
var fjsm:org.apache.flex.geom.IMatrix = transformModel.matrix;
var matrixArray:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
- element.setAttribute("transform", "matrix(" +matrixArray.join(",") + ")";
+ var transformStr:String = "matrix(" + matrixArray.join(",") + ")";
+ element.setAttribute("transform", transformStr);
}
private function changeHandler(e:Event):void
[47/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - tune up
approval script
Posted by ah...@apache.org.
tune up approval script
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/232f6e7e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/232f6e7e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/232f6e7e
Branch: refs/heads/spark
Commit: 232f6e7e990f30620c8da19547026207d7eab953
Parents: 670bbaa
Author: Alex Harui <ah...@apache.org>
Authored: Thu Aug 18 23:44:57 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 24 08:10:14 2016 -0700
----------------------------------------------------------------------
ApproveFlexJS.xml | 43 +++++++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/232f6e7e/ApproveFlexJS.xml
----------------------------------------------------------------------
diff --git a/ApproveFlexJS.xml b/ApproveFlexJS.xml
index 4bb7595..1031bdf 100644
--- a/ApproveFlexJS.xml
+++ b/ApproveFlexJS.xml
@@ -399,6 +399,7 @@
<exclude name="js/lib/google/**"/>
<!-- compiled output -->
<exclude name="frameworks/projects/*/target/**"/>
+ <exclude name="frameworks/js/FlexJS/projects/*/target/**"/>
<!-- swcs -->
<exclude name="frameworks/libs/Binding.swc"/>
<exclude name="frameworks/libs/Charts.swc"/>
@@ -413,31 +414,33 @@
<exclude name="frameworks/libs/Graphics.swc"/>
<exclude name="frameworks/libs/HTML.swc"/>
<exclude name="frameworks/libs/HTML5.swc"/>
- <exclude name="frameworks/libs/JQuery.swc"/>
+ <exclude name="frameworks/libs/jQuery.swc"/>
+ <exclude name="frameworks/libs/Language.swc"/>
<exclude name="frameworks/libs/Mobile.swc"/>
<exclude name="frameworks/libs/Network.swc"/>
<exclude name="frameworks/libs/Reflection.swc"/>
<exclude name="frameworks/libs/Storage.swc"/>
<exclude name="frameworks/libs/XML.swc"/>
- <exclude name="frameworks/externs/Binding.swc"/>
- <exclude name="frameworks/externs/Charts.swc"/>
- <exclude name="frameworks/externs/Collections.swc"/>
- <exclude name="frameworks/externs/Core.swc"/>
- <exclude name="frameworks/externs/CreateJS.swc"/>
- <exclude name="frameworks/externs/DragDrop.swc"/>
- <exclude name="frameworks/externs/Effects.swc"/>
- <exclude name="frameworks/externs/Flat.swc"/>
- <exclude name="frameworks/externs/Formatters.swc"/>
- <exclude name="frameworks/externs/GoogleMaps.swc"/>
- <exclude name="frameworks/externs/Graphics.swc"/>
- <exclude name="frameworks/externs/HTML.swc"/>
- <exclude name="frameworks/externs/HTML5.swc"/>
- <exclude name="frameworks/externs/JQuery.swc"/>
- <exclude name="frameworks/externs/Mobile.swc"/>
- <exclude name="frameworks/externs/Network.swc"/>
- <exclude name="frameworks/externs/Reflection.swc"/>
- <exclude name="frameworks/externs/Storage.swc"/>
- <exclude name="frameworks/externs/XML.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/BindingJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/ChartsJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/CollectionsJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/CoreJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/CreateJSJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/DragDropJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/EffectsJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/FlatJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/FormattersJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/GoogleMapsJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/GraphicsJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/HTMLJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/HTML5JS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/jQueryJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/LanguageJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/MobileJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/NetworkJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/ReflectionJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/StorageJS.swc"/>
+ <exclude name="frameworks/js/FlexJS/libs/XMLJS.swc"/>
</fileset>
</rat:report>
[02/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] -
TransformBead working.
Posted by ah...@apache.org.
TransformBead working.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/518995ed
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/518995ed
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/518995ed
Branch: refs/heads/spark
Commit: 518995ed1f9fb2edba8a58b4038c85e1c8b2d4c9
Parents: 580eded
Author: yishayw <yi...@hotmail.com>
Authored: Thu Jul 28 02:47:21 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Thu Jul 28 02:47:21 2016 +0300
----------------------------------------------------------------------
.../projects/Core/src/main/flex/CoreClasses.as | 1 +
.../org/apache/flex/core/ITransformModel.as | 47 +++++
.../projects/Graphics/.actionScriptProperties | 21 --
frameworks/projects/Graphics/.flexLibProperties | 23 +--
.../Graphics/src/main/flex/GraphicsClasses.as | 2 +
.../org/apache/flex/graphics/IBeadTransform.as | 46 +++++
.../org/apache/flex/graphics/ITransformHost.as | 64 ++++++
.../org/apache/flex/graphics/TransformModel.as | 31 +++
.../org/apache/flex/svg/GraphicContainer.as | 201 +++++++++++++++++--
.../flex/org/apache/flex/svg/TransformBead.as | 90 +++++++++
10 files changed, 465 insertions(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index a1cfe9c..2fa67a5 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -67,6 +67,7 @@ internal class CoreClasses
import org.apache.flex.core.IParentIUIBase; IParentIUIBase;
import org.apache.flex.core.IPopUp; IPopUp;
import org.apache.flex.core.IRangeModel; IRangeModel;
+ import org.apache.flex.core.ITransformModel; ITransformModel;
import org.apache.flex.core.IRollOverModel; IRollOverModel;
COMPILE::SWF
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
new file mode 100644
index 0000000..56cb961
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ITransformModel.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Matrix;
+
+ /**
+ * The ITransformModel interface describes the minimum set of properties
+ * needed to define a transformation on an object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ITransformModel extends IEventDispatcher, IBeadModel
+ {
+ /**
+ * The matrix of the Transform
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get matrix():Matrix;
+ function set matrix(value:Matrix):void;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/.actionScriptProperties b/frameworks/projects/Graphics/.actionScriptProperties
index f3a3b57..f398fbb 100644
--- a/frameworks/projects/Graphics/.actionScriptProperties
+++ b/frameworks/projects/Graphics/.actionScriptProperties
@@ -1,22 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
-
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
--->
<actionScriptProperties analytics="false" mainApplicationPath="Graphics.as" projectUUID="ff3e0531-b7c9-4b0c-9146-05c27a47f837" version="11">
<compiler additionalCompilerArguments="-locale en_US -define=COMPILE::SWF,true -define=COMPILE::JS,false -load-config=../config/compile-as-config.xml" autoRSLOrdering="true" copyDependentFiles="false" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="target" removeUnusedRSL="true" sourceFolderPath="src/main/flex" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="false" verifyDigests="true" warn="true">
<compilerSourcePath/>
@@ -31,19 +13,16 @@ limitations under the License.
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Collections.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Mobile.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/HTML.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Core.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Binding.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Charts.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Graphics.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
- <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/core.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/Network.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/GoogleMaps.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/DragDrop.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/CreateJS.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
- <libraryPathEntry kind="3" linkType="1" path="/Core/target/Core.swc" useDefaultLinkType="false"/>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/.flexLibProperties
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/.flexLibProperties b/frameworks/projects/Graphics/.flexLibProperties
index 20339ea..096c2b5 100644
--- a/frameworks/projects/Graphics/.flexLibProperties
+++ b/frameworks/projects/Graphics/.flexLibProperties
@@ -1,24 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
<flexLibProperties includeAllClasses="true" useMultiPlatformConfig="false" version="3">
- <includeClasses/>
+ <includeClasses>
+ <classEntry path="org.apache.flex.svg.TransformBead"/>
+ <classEntry path="org.apache.flex.graphics.ITransformHost"/>
+ </includeClasses>
<includeResources/>
<namespaceManifests/>
</flexLibProperties>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
index 0cc1db9..b8a5765 100644
--- a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
+++ b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
@@ -39,6 +39,8 @@ internal class GraphicsClasses
import org.apache.flex.svg.Text; Text;
import org.apache.flex.svg.CompoundGraphic; CompoundGraphic;
import org.apache.flex.svg.LinearGradient; LinearGradient;
+ import org.apache.flex.graphics.TransformModel; TransformModel;
+ import org.apache.flex.svg.TransformBead; TransformBead;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as
new file mode 100644
index 0000000..1a8f61c
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IBeadTransform.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.graphics
+{
+ import org.apache.flex.core.IBead;
+
+ /**
+ * The IBeadTransform interface is the basic interface for the
+ * container views that transform drawable objects that implement ITransformHost
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IBeadTransform extends IBead
+ {
+
+ /**
+ * Transform the ITransformHost. The implementor of this method should
+ * have concrete knowledge of ITransformHost implementor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function transform():void;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as
new file mode 100644
index 0000000..6310dd0
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/ITransformHost.as
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.graphics
+{
+ import org.apache.flex.core.IFlexJSElement;
+ import org.apache.flex.core.IStrand;
+
+
+
+ /**
+ * The ITransformHost interface is the basic interface for the
+ * container views that have an IBeadTransform.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ITransformHost extends IStrand
+ {
+ /**
+ * Each ITransformHost has an element that is actually added to
+ * the platform's display list DOM. It may not be the actual
+ * component itself.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::SWF
+ function get transformElement():IFlexJSElement;
+
+ /**
+ * Each ITransformHost has an element that is actually added to
+ * the platform's display list DOM. It may not be the actual
+ * component itself.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::JS
+ function get transformElement():org.apache.flex.core.WrappedHTMLElement;
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as
new file mode 100644
index 0000000..68d650b
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/TransformModel.as
@@ -0,0 +1,31 @@
+package org.apache.flex.graphics
+{
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITransformModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.geom.Matrix;
+
+ public class TransformModel extends EventDispatcher implements ITransformModel
+ {
+ private var _matrix:Matrix;
+
+ public function TransformModel()
+ {
+ }
+
+ public function get matrix():Matrix
+ {
+ return _matrix;
+ }
+
+ public function set matrix(value:Matrix):void
+ {
+ _matrix = value;
+ dispatchEvent(new Event(Event.CHANGE));
+ }
+
+ public function set strand(value:IStrand):void {}
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index d156f2d..b40b53b 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -14,15 +14,19 @@
package org.apache.flex.svg
{
import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IParent;
- import org.apache.flex.events.Event;
+ import org.apache.flex.core.IFlexJSElement;
+ import org.apache.flex.graphics.ITransformHost;
COMPILE::JS
{
- import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.UIBase;
}
- public class GraphicContainer extends ContainerBase
+ [DefaultProperty("mxmlContent")]
+
+ COMPILE::SWF
+ public class GraphicContainer extends ContainerBase implements ITransformHost
{
public function GraphicContainer()
{
@@ -30,12 +34,50 @@ package org.apache.flex.svg
}
/**
+ * @private
+ */
+ override public function addElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ if(c is GraphicShape)
+ super.addElement(c, dispatchEvent);
+ else
+ throw new Error("Only svg elements can be added to svg containers");
+ }
+
+ /**
+ * @private
+ */
+ override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
+ {
+ if(c is GraphicShape)
+ super.addElementAt(c, index, dispatchEvent);
+ else
+ throw new Error("Only svg elements can be added to svg containers");
+ }
+
+ public function get transformElement():IFlexJSElement
+ {
+ return element;
+ }
+
+ }
+
+ COMPILE::JS
+ public class GraphicContainer extends UIBase implements ITransformHost, IContainer
+ {
+ private var graphicGroup:ContainerBase;
+
+ public function GraphicContainer()
+ {
+ super();
+ }
+
+ /**
* @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
*/
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
+ override protected function createElement():org.apache.flex.core.WrappedHTMLElement
{
- element = document.createElementNS('http://www.w3.org/2000/svg', 'svg') as WrappedHTMLElement;
+ element = document.createElementNS('http://www.w3.org/2000/svg', 'svg') as org.apache.flex.core.WrappedHTMLElement;
positioner = element;
@@ -46,34 +88,151 @@ package org.apache.flex.svg
positioner.style.position = 'relative';
element.flexjs_wrapper = this;
- /*addEventListener('childrenAdded',
- runLayoutHandler);
- addEventListener('elementRemoved',
- runLayoutHandler);*/
-
+ graphicGroup = new GraphicGroup();
+ addElement(graphicGroup);
return element;
}
+
+
+ public function get transformElement():org.apache.flex.core.WrappedHTMLElement
+ {
+ return graphicGroup.element;
+ }
+
/**
- * @private
+ * @copy org.apache.flex.core.IParent#getElementAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function getElementAt(index:int):Object
+ {
+ return graphicGroup.getElementAt(index);
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#addElement()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
*/
override public function addElement(c:Object, dispatchEvent:Boolean = true):void
{
- if(c is GraphicShape)
- super.addElement(c, dispatchEvent);
- else
+ if(!(c is GraphicShape))
+ {
throw new Error("Only svg elements can be added to svg containers");
+ }
+ graphicGroup.addElement(c, dispatchEvent);
+ if (dispatchEvent)
+ this.dispatchEvent(new Event("childrenAdded"));
}
/**
- * @private
+ * @copy org.apache.flex.core.IParent#addElementAt()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
*/
override public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
{
- if(c is GraphicShape)
- super.addElementAt(c, index, dispatchEvent);
- else
+ if(!(c is GraphicShape))
+ {
throw new Error("Only svg elements can be added to svg containers");
+ }
+ graphicGroup.addElementAt(c, index, dispatchEvent);
+ if (dispatchEvent)
+ this.dispatchEvent(new Event("childrenAdded"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#removeElement()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function removeElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ graphicGroup.removeElement(c, dispatchEvent);
+ if (dispatchEvent)
+ this.dispatchEvent(new Event("childrenRemoved"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IContainer#childrenAdded()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function childrenAdded():void
+ {
+ dispatchEvent(new Event("childrenAdded"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IParent#getElementIndex()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function getElementIndex(c:Object):int
+ {
+ return graphicGroup.getElementIndex(c);
}
+
+
+ /**
+ * The number of elements in the parent.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function get numElements():int
+ {
+ return graphicGroup.numElements;
+ }
+ }
+}
- }
+import org.apache.flex.core.ContainerBase;
+
+class GraphicGroup extends ContainerBase
+{
+ COMPILE::JS
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ override protected function createElement():org.apache.flex.core.WrappedHTMLElement
+ {
+ element = document.createElementNS('http://www.w3.org/2000/svg', 'g') as org.apache.flex.core.WrappedHTMLElement;
+
+ positioner = element;
+
+ // absolute positioned children need a non-null
+ // position value in the parent. It might
+ // get set to 'absolute' if the container is
+ // also absolutely positioned
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ /*addEventListener('childrenAdded',
+ runLayoutHandler);
+ addEventListener('elementRemoved',
+ runLayoutHandler);*/
+
+ return element;
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/518995ed/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
new file mode 100644
index 0000000..ed9de0e
--- /dev/null
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -0,0 +1,90 @@
+package org.apache.flex.svg
+{
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITransformModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.geom.Matrix;
+ import org.apache.flex.graphics.IBeadTransform;
+ import org.apache.flex.graphics.ITransformHost;
+
+ COMPILE::SWF {
+ import flash.display.Sprite;
+ import flash.geom.Matrix;
+ }
+
+
+ public class TransformBead implements IBeadTransform
+ {
+ private var _strand:IStrand;
+ private var transformModel:ITransformModel;
+
+ public function TransformBead()
+ {
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ if (!(value is GraphicContainer))
+ {
+ throw new Error("This bead only works with svg GraphicContainers");
+ return;
+ }
+ _strand = value;
+ transformModel = value.getBeadByType(ITransformModel) as ITransformModel;
+ if (!transformModel)
+ {
+ throw new Error("An ITransformModel needs to be defined.");
+ return;
+ }
+ transformModel.addEventListener(Event.CHANGE, changeHandler);
+ if (transformModel.matrix)
+ {
+ transform();
+ }
+ }
+
+ COMPILE::SWF
+ public function transform():void
+ {
+ var element:Sprite = host.transformElement as Sprite;
+ var fjsm:org.apache.flex.geom.Matrix = transformModel.matrix;
+ var flashMatrix:flash.geom.Matrix = new flash.geom.Matrix(fjsm.a, fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty);
+ element.transform.matrix = flashMatrix;
+ }
+
+ COMPILE::JS
+ public function transform():void
+ {
+ var element:org.apache.flex.core.WrappedHTMLElement = host.transformElement;
+ var fjsm:org.apache.flex.geom.Matrix = transformModel.matrix;
+ var elem:Array = [fjsm.a , fjsm.b, fjsm.c, fjsm.d, fjsm.tx, fjsm.ty];
+ element.setAttribute("transform", "matrix(" +elem.join(",") + ")";
+ }
+
+ private function changeHandler(e:Event):void
+ {
+ transform();
+ }
+
+ /**
+ * The host component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get host():ITransformHost
+ {
+ return _strand as ITransformHost;
+ }
+ }
+}
\ No newline at end of file
[42/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - force
link TextFieldFactory
Posted by ah...@apache.org.
force link TextFieldFactory
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4e61ce4a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4e61ce4a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4e61ce4a
Branch: refs/heads/spark
Commit: 4e61ce4a7ee833122fa11f516e57485b54e30239
Parents: 1144a44
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 22:19:03 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:19:03 2016 -0700
----------------------------------------------------------------------
.../MX/src/main/flex/mx/core/Application.as | 2 +
.../src/main/flex/mx/core/TextFieldFactory.as | 225 +++++++++++++++++++
2 files changed, 227 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4e61ce4a/frameworks/projects/MX/src/main/flex/mx/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/Application.as b/frameworks/projects/MX/src/main/flex/mx/core/Application.as
index 4cfb16a..10dab2a 100644
--- a/frameworks/projects/MX/src/main/flex/mx/core/Application.as
+++ b/frameworks/projects/MX/src/main/flex/mx/core/Application.as
@@ -51,6 +51,8 @@ import mx.managers.ILayoutManager;
import mx.managers.ISystemManager;
// force-link this here. In flex-sdk, it gets dragged in by Effect.
import mx.managers.LayoutManager; LayoutManager;
+// force-link this here. In flex-sdk, it gets injected somehow.
+import mx.core.TextFieldFactory; TextFieldFactory;
import mx.styles.CSSStyleDeclaration;
import mx.styles.IStyleClient;
import mx.utils.LoaderUtil;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4e61ce4a/frameworks/projects/MX/src/main/flex/mx/core/TextFieldFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/TextFieldFactory.as b/frameworks/projects/MX/src/main/flex/mx/core/TextFieldFactory.as
new file mode 100644
index 0000000..371f7a9
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/core/TextFieldFactory.as
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+COMPILE::SWF
+{
+ import flash.text.TextField;
+}
+COMPILE::JS
+{
+ import flex.text.TextField;
+}
+COMPILE::LATER
+{
+import flash.utils.Dictionary;
+}
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ * Singleton to create TextFields in the context of various ModuleFactories.
+ * One module factory will have at most one TextField created for it.
+ * The text fields are only used for measurement;
+ * they are not on the display list.
+ */
+public class TextFieldFactory implements ITextFieldFactory
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ *
+ * This classes singleton.
+ */
+ private static var instance:ITextFieldFactory;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public static function getInstance():ITextFieldFactory
+ {
+ if (!instance)
+ instance = new TextFieldFactory();
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Cache of TextFields. Limit of one per module factory.
+ * In this Dictionary, each key is a weak reference
+ * to an IFlexModuleFactory and each value is a Dictionary
+ * with a single entry (a TextField as a weak key).
+ */
+ COMPILE::LATER
+ private var textFields:Dictionary = new Dictionary(true);
+ COMPILE::SWF
+ private var textField:TextField;
+ COMPILE::JS
+ private var textField:TextField;
+
+ /**
+ * @private
+ * Cache of FTETextFields. Limit of one per module factory.
+ * In this Dictionary, each key is a weak reference
+ * to an IFlexModuleFactory and each value is a Dictionary
+ * with a single entry (a FTETextField as a weak key).
+ */
+ COMPILE::LATER
+ private var fteTextFields:Dictionary = new Dictionary(true);
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Creates an instance of TextField
+ * in the context of the specified IFlexModuleFactory.
+ *
+ * @param moduleFactory The IFlexModuleFactory requesting the TextField.
+ *
+ * @return A FTETextField created in the context
+ * of <code>moduleFactory</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function createTextField(moduleFactory:IFlexModuleFactory):TextField
+ {
+ COMPILE::LATER
+ {
+ // Check to see if we already have a text field for this module factory.
+ var textField:TextField = null;
+ var textFieldDictionary:Dictionary = textFields[moduleFactory];
+
+ if (textFieldDictionary)
+ {
+ for (var iter:Object in textFieldDictionary)
+ {
+ textField = TextField(iter);
+ break;
+ }
+ }
+ if (!textField)
+ {
+ if (moduleFactory)
+ textField = TextField(moduleFactory.create("flash.text.TextField"));
+ else
+ textField = new TextField();
+
+ // The dictionary could be empty, but not null because entries in the dictionary
+ // could be garbage collected.
+ if (!textFieldDictionary)
+ textFieldDictionary = new Dictionary(true);
+ textFieldDictionary[textField] = 1;
+ textFields[moduleFactory] = textFieldDictionary;
+ }
+ }
+ if (!textField)
+ textField = new TextField();
+
+ return textField;
+ }
+
+ /**
+ * @private
+ * Creates an instance of FTETextField
+ * in the context of the specified module factory.
+ *
+ * @param moduleFactory The IFlexModuleFactory requesting the TextField.
+ * May not be <code>null</code>.
+ *
+ * @return A FTETextField created in the context
+ * of <code>moduleFactory</code>.
+ * The return value is loosely typed as Object
+ * to avoid linking in FTETextField (and therefore much of TLF).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ public function createFTETextField(moduleFactory:IFlexModuleFactory):Object
+ {
+ COMPILE::LATER
+ {
+ // Check to see if we already have a text field for this module factory.
+ var fteTextField:Object = null;
+ var fteTextFieldDictionary:Dictionary = fteTextFields[moduleFactory];
+
+ if (fteTextFieldDictionary)
+ {
+ for (var iter:Object in fteTextFieldDictionary)
+ {
+ fteTextField = iter;
+ break;
+ }
+ }
+ if (!fteTextField)
+ {
+ if (moduleFactory)
+ {
+ fteTextField = moduleFactory.create(
+ "mx.core.FTETextField");
+ fteTextField.fontContext = moduleFactory;
+ }
+
+ // The dictionary could be empty, but not null because entries in the dictionary
+ // could be garbage collected.
+ if (!fteTextFieldDictionary)
+ fteTextFieldDictionary = new Dictionary(true);
+ fteTextFieldDictionary[fteTextField] = 1;
+ fteTextFields[moduleFactory] = fteTextFieldDictionary;
+ }
+ return fteTextField;
+ }
+ return textField;
+ }
+}
+
+}
[48/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - update
link in approval scripts
Posted by ah...@apache.org.
update link in approval scripts
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/19f790df
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/19f790df
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/19f790df
Branch: refs/heads/spark
Commit: 19f790df61b6c4bab216d9b4235638d160011a56
Parents: b502a55
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 20 07:31:41 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Aug 24 08:10:15 2016 -0700
----------------------------------------------------------------------
ApproveFlexJS.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/19f790df/ApproveFlexJS.xml
----------------------------------------------------------------------
diff --git a/ApproveFlexJS.xml b/ApproveFlexJS.xml
index 1031bdf..daa40e2 100644
--- a/ApproveFlexJS.xml
+++ b/ApproveFlexJS.xml
@@ -136,7 +136,7 @@
unless="release.version"/>
<condition property="package.url.path"
- value="http://apacheflexbuild.cloudapp.net:8080/job/flex-asjs/lastSuccessfulBuild/artifact/out">
+ value="http://apacheflexbuild.cloudapp.net:8080/job/flex-asjs_release_branch/lastSuccessfulBuild/artifact/out">
<not>
<isset property="rc" />
</not>
[17/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Add
transform bead to GraphicClasses
Posted by ah...@apache.org.
Add transform bead to GraphicClasses
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c2eebc8b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c2eebc8b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c2eebc8b
Branch: refs/heads/spark
Commit: c2eebc8b19c392a234e9c61284ca272bf8be645e
Parents: 4cfde5b
Author: yishayw <yi...@hotmail.com>
Authored: Sun Jul 31 10:59:09 2016 +0300
Committer: yishayw <yi...@hotmail.com>
Committed: Sun Jul 31 10:59:09 2016 +0300
----------------------------------------------------------------------
frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2eebc8b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
index 916d6b4..ae4f401 100644
--- a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
+++ b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as
@@ -38,6 +38,7 @@ internal class GraphicsClasses
import org.apache.flex.graphics.SolidColorStroke; SolidColorStroke;
import org.apache.flex.svg.Text; Text;
import org.apache.flex.svg.CompoundGraphic; CompoundGraphic;
+ import org.apache.flex.svg.TransformBead; TransformBead;
import org.apache.flex.svg.LinearGradient; LinearGradient;
import org.apache.flex.graphics.CubicCurve; CubicCurve;
import org.apache.flex.graphics.LineStyle; LineStyle;
[19/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Added
missing License Headers
Posted by ah...@apache.org.
Added missing License Headers
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/21240510
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/21240510
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/21240510
Branch: refs/heads/spark
Commit: 2124051088e1aabbde94ed5d5e35897259fe092d
Parents: c2eebc8
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Mon Aug 1 08:45:38 2016 +0200
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Mon Aug 1 08:45:38 2016 +0200
----------------------------------------------------------------------
.../apache/flex/core/TransformCompoundModel.as | 18 ++++++++++++++++++
.../flex/org/apache/flex/core/TransformModel.as | 18 ++++++++++++++++++
.../org/apache/flex/core/TransformMoveXModel.as | 18 ++++++++++++++++++
.../org/apache/flex/core/TransformMoveYModel.as | 18 ++++++++++++++++++
.../org/apache/flex/core/TransformRotateModel.as | 18 ++++++++++++++++++
.../org/apache/flex/core/TransformScaleModel.as | 18 ++++++++++++++++++
.../src/main/flex/org/apache/flex/geom/IMatrix.as | 18 ++++++++++++++++++
.../projects/Graphics/.actionScriptProperties | 18 ++++++++++++++++++
frameworks/projects/Graphics/.flexLibProperties | 18 ++++++++++++++++++
.../flex/org/apache/flex/svg/TransformBead.as | 18 ++++++++++++++++++
10 files changed, 180 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
index 0a1b448..ce2e6d2 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformCompoundModel.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
import org.apache.flex.geom.IMatrix;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
index 4fa2a20..e2c083b 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformModel.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
import org.apache.flex.events.Event;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
index 1cb692e..40dd15f 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveXModel.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
import org.apache.flex.geom.MeagerMatrix;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
index 13d0384..51b9ba5 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformMoveYModel.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
import org.apache.flex.geom.MeagerMatrix;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
index 90e0a46..62bc7f6 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformRotateModel.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
import org.apache.flex.geom.MeagerMatrix;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
index 798b66d..ccd24a8 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/TransformScaleModel.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
import org.apache.flex.geom.MeagerMatrix;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
index 352fe52..abc6348 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/geom/IMatrix.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.geom
{
public interface IMatrix
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Graphics/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/.actionScriptProperties b/frameworks/projects/Graphics/.actionScriptProperties
index f398fbb..d67949b 100644
--- a/frameworks/projects/Graphics/.actionScriptProperties
+++ b/frameworks/projects/Graphics/.actionScriptProperties
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<actionScriptProperties analytics="false" mainApplicationPath="Graphics.as" projectUUID="ff3e0531-b7c9-4b0c-9146-05c27a47f837" version="11">
<compiler additionalCompilerArguments="-locale en_US -define=COMPILE::SWF,true -define=COMPILE::JS,false -load-config=../config/compile-as-config.xml" autoRSLOrdering="true" copyDependentFiles="false" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="target" removeUnusedRSL="true" sourceFolderPath="src/main/flex" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="false" verifyDigests="true" warn="true">
<compilerSourcePath/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Graphics/.flexLibProperties
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/.flexLibProperties b/frameworks/projects/Graphics/.flexLibProperties
index 096c2b5..0d6f4f8 100644
--- a/frameworks/projects/Graphics/.flexLibProperties
+++ b/frameworks/projects/Graphics/.flexLibProperties
@@ -1,4 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
<flexLibProperties includeAllClasses="true" useMultiPlatformConfig="false" version="3">
<includeClasses>
<classEntry path="org.apache.flex.svg.TransformBead"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21240510/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
index 60af498..8db37a0 100644
--- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
+++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/TransformBead.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.svg
{
import org.apache.flex.core.IBeadTransform;
[18/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - [Fix]
Fixed integration of Endian changes with network classes.
Posted by ah...@apache.org.
[Fix] Fixed integration of Endian changes with network classes.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c8d147b9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c8d147b9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c8d147b9
Branch: refs/heads/spark
Commit: c8d147b97f59d266ca58feec0aa3f305e0446998
Parents: 20f2611
Author: greg-dove <gr...@gmail.com>
Authored: Mon Aug 1 04:57:30 2016 +1200
Committer: greg-dove <gr...@gmail.com>
Committed: Mon Aug 1 04:57:30 2016 +1200
----------------------------------------------------------------------
.../Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as | 2 +-
.../Network/src/main/flex/org/apache/flex/net/URLStream.as | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c8d147b9/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
index 4d5d293..5785c62 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLBinaryLoader.as
@@ -56,7 +56,7 @@ package org.apache.flex.net
* @playerversion AIR 2.6
* @productversion FlexJS 0.7.0
*/
- public var endian:String = Endian.DEFAULT;
+ public var endian:String = Endian.BIG_ENDIAN;
private var stream:URLStream;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c8d147b9/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
index eeb6912..2ac8517 100644
--- a/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
+++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/net/URLStream.as
@@ -258,7 +258,7 @@ package org.apache.flex.net
* @playerversion AIR 2.6
* @productversion FlexJS 0.7.0
*/
- public var endian:String = Endian.DEFAULT;
+ public var endian:String = Endian.BIG_ENDIAN;
private function cleanupCallbacks():void
{