You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2017/03/29 21:26:20 UTC

[4/6] git commit: [flex-asjs] [refs/heads/feature/chart-work] - Added IStrandPrivate work with ContainerBaseStrandChildren.

Added IStrandPrivate work with ContainerBaseStrandChildren.


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

Branch: refs/heads/feature/chart-work
Commit: 388e7b485da57e66656b1d9fa748d7ac17d22227
Parents: bbca528
Author: Peter Ent <pe...@apache.org>
Authored: Wed Mar 29 17:07:02 2017 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Wed Mar 29 17:07:02 2017 -0400

----------------------------------------------------------------------
 .../projects/Core/src/main/flex/CoreClasses.as  |  1 +
 .../flex/org/apache/flex/core/IContainer.as     | 10 +++--
 .../flex/org/apache/flex/core/IStrandPrivate.as | 39 ++++++++++++++++++++
 .../flex/org/apache/flex/core/ContainerBase.as  | 16 +++++---
 .../flex/core/ContainerBaseStrandChildren.as    |  4 +-
 .../org/apache/flex/core/DataContainerBase.as   |  3 +-
 .../org/apache/flex/html/beads/ContainerView.as |  2 +-
 .../html/supportClasses/ScrollingViewport.as    |  4 +-
 .../org/apache/flex/svg/GraphicContainer.as     | 15 +-------
 9 files changed, 66 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/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 a97b4e2..11b8b8b 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -97,6 +97,7 @@ internal class CoreClasses
     import org.apache.flex.core.ISelectableItemRenderer; ISelectableItemRenderer;
     import org.apache.flex.core.ISelectionModel; ISelectionModel;
     import org.apache.flex.core.IStrand; IStrand;
+	import org.apache.flex.core.IStrandPrivate; IStrandPrivate;
     import org.apache.flex.core.IStrandWithModel; IStrandWithModel;
     import org.apache.flex.core.ITextModel; ITextModel;
     import org.apache.flex.core.ITitleBarModel; ITitleBarModel;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IContainer.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IContainer.as
index 44be7ad..346d003 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IContainer.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IContainer.as
@@ -45,9 +45,13 @@ package org.apache.flex.core
 		function childrenAdded():void;
 		
 		/**
-		 * This method is for internal use only
+		 * Returns a object to access the immediate children of the strand.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.8
 		 */
-		COMPILE::SWF
-		function $addElement(c:IChild, dispatchEvent:Boolean = true):void;
+		function get strandChildren():IParent;
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStrandPrivate.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStrandPrivate.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStrandPrivate.as
new file mode 100644
index 0000000..ed8dc2f
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/IStrandPrivate.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 IStrandPrivate interface is implemented by components that permit 
+	 *  access to their direct children.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.8
+     */
+	public interface IStrandPrivate
+	{
+		function $numElements():int;
+		function $addElement(c:IChild, dispatchEvent:Boolean = true):void;
+		function $addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void;
+		function $removeElement(c:IChild, dispatchEvent:Boolean = true):void;
+		function $getElementIndex(c:IChild):int;
+		function $getElementAt(index:int):IChild;
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBase.as
index f95ec8e..c5cbe03 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBase.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBase.as
@@ -18,13 +18,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
-	import org.apache.flex.core.IChrome;
-	import org.apache.flex.core.IMXMLDocument;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.ValueChangeEvent;
-	import org.apache.flex.states.State;
-	import org.apache.flex.utils.MXMLDataInterpreter;
 
     /**
      *  Indicates that the state change has completed.  All properties
@@ -60,6 +56,14 @@ package org.apache.flex.core
      */
     [Event(name="childrenAdded", type="org.apache.flex.events.Event")]
     
+	/**
+	 * Indicates that the default property of the Container is MXML elements.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+	 */
 	[DefaultProperty("mxmlContent")]
     
     /**
@@ -72,7 +76,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class ContainerBase extends GroupBase implements IContainer
+	public class ContainerBase extends GroupBase implements IContainer, IStrandPrivate
 	{
         /**
          *  Constructor.
@@ -177,6 +181,8 @@ package org.apache.flex.core
 		 * operate directly at strand level. While these function are available on
 		 * both SWF and JS platforms, they really only have meaning on the SWF-side. 
 		 * Other subclasses may provide use on the JS-side.
+		 *
+		 * @see org.apache.flex.core.IContainer#strandChildren
 		 */
 		
 		/**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBaseStrandChildren.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBaseStrandChildren.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBaseStrandChildren.as
index e961c1f..d831004 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBaseStrandChildren.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ContainerBaseStrandChildren.as
@@ -43,10 +43,10 @@ package org.apache.flex.core
 		{
 			super();
 			
-			this.owner = owner as ContainerBase;
+			this.owner = owner as IStrandPrivate;
 		}
 		
-		public var owner:ContainerBase;
+		public var owner:IStrandPrivate;
 		
 		/**
 		 *  @private

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/DataContainerBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/DataContainerBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/DataContainerBase.as
index 3d9e555..c73a403 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/DataContainerBase.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/DataContainerBase.as
@@ -20,6 +20,7 @@ package org.apache.flex.core
 {
 	import org.apache.flex.core.IMXMLDocument;
 	import org.apache.flex.core.IContainer;
+	import org.apache.flex.core.IParent;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.ItemAddedEvent;
@@ -49,7 +50,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	public class DataContainerBase extends UIBase implements ILayoutParent, ILayoutView, IItemRendererParent, IContentViewHost, IContainer
+	public class DataContainerBase extends UIBase implements ILayoutParent, ILayoutView, IItemRendererParent, IContentViewHost, IContainer, IParent, IStrandPrivate
 	{
         /**
          *  Constructor.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
index 31a2d2c..36d285c 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
@@ -146,7 +146,7 @@ package org.apache.flex.html.beads
             createViewport();
 
 			var chost:IContainer = host as IContainer;
-			chost.$addElement(viewport.contentView);
+			chost.strandChildren.addElement(viewport.contentView);
 
 			super.strand = value;
 		}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
index 795e676..a58b036 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
@@ -198,14 +198,14 @@ package org.apache.flex.html.supportClasses
 			{
 				if (_verticalScroller == null) {
 					_verticalScroller = createVerticalScrollBar();
-					(_strand as IContainer).$addElement(_verticalScroller);
+					(_strand as IContainer).strandChildren.addElement(_verticalScroller);
 				}
 			}
 			if (needH)
 			{
 				if (_horizontalScroller == null) {
 					_horizontalScroller = createHorizontalScrollBar();
-					(_strand as IContainer).$addElement(_horizontalScroller);
+					(_strand as IContainer).strandChildren.addElement(_horizontalScroller);
 				}
 			}
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/388e7b48/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
index 6b05fea..8bd841f 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/GraphicContainer.as
@@ -37,7 +37,7 @@ package org.apache.flex.svg
     }
 
 	COMPILE::JS
-	public class GraphicContainer extends UIBase implements ITransformHost, IContainer
+	public class GraphicContainer extends ContainerBase implements ITransformHost
 	{
 		private var graphicGroup:ContainerBase;
 
@@ -137,19 +137,6 @@ package org.apache.flex.svg
 		}
 
 		/**
-		 *  @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