flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [04/10] git commit: [flex-asjs] [refs/heads/refactor-strand] - IStrand changes to Basic
Date Sat, 15 Jul 2017 21:35:33 GMT
IStrand changes to Basic


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c20bc2db
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c20bc2db
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c20bc2db

Branch: refs/heads/refactor-strand
Commit: c20bc2db5e8080f7cd6952a0990eb036dab2aa91
Parents: da96465
Author: Harbs <harbs@in-tools.com>
Authored: Sat Jul 15 23:58:44 2017 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Sat Jul 15 23:58:44 2017 +0300

----------------------------------------------------------------------
 .../flex/org/apache/flex/core/Application.as    | 36 ++++++++++-
 .../org/apache/flex/core/HTMLElementWrapper.as  | 67 ++++++++++++++++++++
 .../main/flex/org/apache/flex/core/UIBase.as    | 15 +++--
 .../flex/org/apache/flex/core/UIButtonBase.as   | 30 +++++++++
 .../flex/org/apache/flex/html/MXMLBeadView.as   | 36 +++++++++--
 .../org/apache/flex/html/beads/TextAreaView.as  | 33 +++++++++-
 .../supportClasses/TextFieldItemRenderer.as     | 30 +++++++++
 7 files changed, 233 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/Application.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/Application.as
index c92ad95..2bda2ad 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/Application.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/Application.as
@@ -33,6 +33,7 @@ package org.apache.flex.core
         import flash.events.Event;
         import flash.system.ApplicationDomain;
         import flash.utils.getQualifiedClassName;
+        import org.apache.flex.core.addBeadsToStrand
         import org.apache.flex.events.utils.MouseEventConverter;
     }
 
@@ -347,20 +348,37 @@ package org.apache.flex.core
 
         /**
          *  The array property that is used to add additional
-         *  beads to an MXML tag.  From ActionScript, just
-         *  call addBead directly.
+         *  beads to an MXML tag.  From ActionScript, use registerBead().
          *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
+        COMPILE::SWF
         public var beads:Array;
 
         COMPILE::SWF
         private var _beads:Vector.<IBead>;
 
         /**
+         *  @copy org.apache.flex.core.IStrand#registerBead()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        COMPILE::SWF
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
+
+        /**
          *  @copy org.apache.flex.core.IStrand#addBead()
          *
          *  @langversion 3.0
@@ -378,6 +396,20 @@ package org.apache.flex.core
         }
 
         /**
+         *  @copy org.apache.flex.core.IStrand#addBeads()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        COMPILE::SWF
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
+
+        /**
          *  @copy org.apache.flex.core.IStrand#getBeadByType()
          *
          *  @langversion 3.0

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/HTMLElementWrapper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/HTMLElementWrapper.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/HTMLElementWrapper.as
index f104b83..c65bba6 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/HTMLElementWrapper.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/HTMLElementWrapper.as
@@ -18,6 +18,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
+    import org.apache.flex.core.addBeadsToStrand;
+    
     COMPILE::SWF
     {
         import flash.display.Sprite;
@@ -38,12 +40,34 @@ package org.apache.flex.core
     public class HTMLElementWrapper extends Sprite
     {
         /**
+         *  @copy org.apache.flex.core.Application#beads
+         *  
+         *  The beads are not automatically added to the
+         *  strand.  Subclasses must decide when to
+         *  add the beads.
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public var beads:Array;
+        
+        /**
          * "abstract" method so we can override in JS
          * @param bead The new bead.
          */
         public function addBead(bead:IBead):void
         {            
         }
+        
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
     }
     
 	COMPILE::JS
@@ -140,6 +164,20 @@ package org.apache.flex.core
             }
         }
 
+        /**
+         *  @copy org.apache.flex.core.Application#beads
+         *  
+         *  The beads are not automatically added to the
+         *  strand.  Subclasses must decide when to
+         *  add the beads.
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public var beads:Array;
+        
 		protected var _beads:Vector.<IBead>;
         
 		//--------------------------------------
@@ -147,6 +185,22 @@ package org.apache.flex.core
 		//--------------------------------------
 
         /**
+         *  @copy org.apache.flex.core.IStrand#registerBead()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
+
+        /**
          * @param bead The new bead.
          */
 		public function addBead(bead:IBead):void
@@ -167,6 +221,19 @@ package org.apache.flex.core
 		}
 
         /**
+         *  @copy org.apache.flex.core.IStrand#addBeads()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
+
+        /**
          * @param classOrInterface The requested bead type.
          * @return The bead.
          */

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIBase.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIBase.as
index b9ba8c4..ec38a07 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIBase.as
@@ -23,6 +23,7 @@ package org.apache.flex.core
         import flash.display.DisplayObject;
         import flash.display.Sprite;
         import flash.display.Stage;
+        import org.apache.flex.core.addBeadsToStrand;
         import org.apache.flex.events.utils.MouseEventConverter;
     }
 	
@@ -1034,17 +1035,21 @@ package org.apache.flex.core
         {
             return this;
         }
-		
+
         /**
-         *  @copy org.apache.flex.core.Application#beads
+         *  @copy org.apache.flex.core.IStrand#addBeads()
          *  
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
+         *  @productversion FlexJS 0.9
          */
-		public var beads:Array;
-		
+        COMPILE::SWF
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
+
         COMPILE::SWF
 		private var _beads:Vector.<IBead>;
         

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIButtonBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIButtonBase.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIButtonBase.as
index 0935c2c..bc84800 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIButtonBase.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/UIButtonBase.as
@@ -21,6 +21,7 @@ package org.apache.flex.core
 	import flash.display.DisplayObject;
 	import flash.display.SimpleButton;
 	
+    import org.apache.flex.core.addBeadsToStrand;
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IMeasurementBead;
@@ -730,6 +731,22 @@ package org.apache.flex.core
 		private var strand:Vector.<IBead>;
 
         /**
+         *  @copy org.apache.flex.core.IStrand#registerBead()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
+
+        /**
          *  @copy org.apache.flex.core.UIBase#addBead()
          *  
          *  @langversion 3.0
@@ -750,6 +767,19 @@ package org.apache.flex.core
 		}
 		
         /**
+         *  @copy org.apache.flex.core.IStrand#addBeads()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
+
+        /**
          *  @copy org.apache.flex.core.UIBase#getBeadByType()
          *  
          *  @langversion 3.0

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/MXMLBeadView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/MXMLBeadView.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/MXMLBeadView.as
index 4bfa105..f436e19 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/MXMLBeadView.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/MXMLBeadView.as
@@ -19,7 +19,7 @@
 package org.apache.flex.html
 {
 	import org.apache.flex.states.State;
-
+    import org.apache.flex.core.addBeadsToStrand;
 	import org.apache.flex.core.IBead;
     import org.apache.flex.core.ILayoutHost;
     import org.apache.flex.core.IParent;
@@ -77,10 +77,7 @@ package org.apache.flex.html
 
             dispatchEvent(new Event("strandChanged"));
 
-            for each (var bead:IBead in beads)
-                addBead(bead);
-
-            dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
+            addBeads();
 
             MXMLDataInterpreter.generateMXMLInstances(this, IParent(value), MXMLDescriptor);
 
@@ -257,6 +254,22 @@ package org.apache.flex.html
         private var _beads:Array;
 
         /**
+         *  @copy org.apache.flex.core.IStrand#registerBead()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
+
+        /**
          *  @copy org.apache.flex.core.IStrand#addBead()
          *
          *  @langversion 3.0
@@ -273,6 +286,19 @@ package org.apache.flex.html
         }
 
         /**
+         *  @copy org.apache.flex.core.IStrand#addBeads()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
+
+        /**
          *  @copy org.apache.flex.core.IStrand#getBeadByType()
          *
          *  @langversion 3.0

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
index ef25539..e41e446 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
@@ -23,6 +23,7 @@ package org.apache.flex.html.beads
 	import flash.events.IEventDispatcher;
 	import flash.text.TextFieldType;
 	
+	import org.apache.flex.core.addBeadsToStrand;
 	import org.apache.flex.core.IBead;
     import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IScrollBarModel;
@@ -104,8 +105,7 @@ package org.apache.flex.html.beads
 		{
 			super.strand = value;
 			
-            for each (var bead:IBead in beads)
-                addBead(bead);
+            addBeads();
             
 			// add a border to this
 			_border = new Border();
@@ -204,6 +204,22 @@ package org.apache.flex.html.beads
 		private var _beads:Vector.<IBead>;
 
         /**
+         *  @copy org.apache.flex.core.IStrand#registerBead()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
+
+        /**
          *  @copy org.apache.flex.core.UIBase#addBead()
          *  
          *  @langversion 3.0
@@ -218,6 +234,19 @@ package org.apache.flex.html.beads
 			_beads.push(bead);
 			bead.strand = this;
 		}
+
+        /**
+         *  @copy org.apache.flex.core.IStrand#addBeads()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
 		
         /**
          *  @copy org.apache.flex.core.UIBase#getBeadByType()

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c20bc2db/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
index bcada9c..1599e20 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
@@ -21,6 +21,7 @@ package org.apache.flex.html.supportClasses
     import flash.display.DisplayObject;
     import flash.text.TextFieldType;
     
+	import org.apache.flex.core.addBeadsToStrand;
     import org.apache.flex.core.CSSTextField;
     import org.apache.flex.core.IBead;
     import org.apache.flex.core.IBeadController;
@@ -481,6 +482,22 @@ package org.apache.flex.html.supportClasses
         public var beads:Array;
         
         private var _beads:Vector.<IBead>;
+
+        /**
+         *  @copy org.apache.flex.core.IStrand#registerBead()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function registerBead(bead:IBead):void
+        {
+            if(beads)
+                beads.push(bead);
+            else
+                beads = [bead];
+        }
 		
 		/**
 		 * @private
@@ -492,6 +509,19 @@ package org.apache.flex.html.supportClasses
             _beads.push(bead);
             bead.strand = this;
         }
+
+        /**
+         *  @copy org.apache.flex.core.IStrand#addBeads()
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.9
+         */
+        public function addBeads():void
+        {
+            addBeadsToStrand(this,beads);
+        }
         
 		/**
 		 * @private


Mime
View raw message