You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/06/07 19:38:44 UTC

[royale-asjs] branch develop updated (101b933 -> 1c3384c)

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from 101b933  jewel: remove unused code
     new c43ef21  core-ILayoutChildren: add core ILayoutChildren to trigger layout in children instances
     new a53e945  Jewel-LayoutChildren: implementation of ILayoutChildren to use in StyledLayoutBase
     new 38599c2  StyledLayoutBase: add LayoutChildren bead support
     new 721b20a  jewel-view: add ViewLayout
     new b4e09d4  jewel-layouts: remove obligatory children "sizeChanged" event in all case. Use now new bead "LaoutChildren" when needed
     new 1c3384c  DataGridLayoutPlayGround: Use the new LayoutChildren bead so inner datagrid resize as needed

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/royale/DataGridPlayGround.mxml        |  6 ++
 .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
 .../ILayoutChildren.as}                            | 25 +++---
 .../projects/Jewel/src/main/resources/defaults.css |  2 +-
 .../Jewel/src/main/resources/jewel-manifest.xml    |  2 +
 .../royale/jewel/beads/layouts/BasicLayout.as      | 21 +----
 .../royale/jewel/beads/layouts/GridLayout.as       |  2 -
 .../royale/jewel/beads/layouts/HorizontalLayout.as |  4 +-
 .../royale/jewel/beads/layouts/LayoutChildren.as   | 94 ++++++++++++++++++++++
 .../jewel/beads/layouts/SimpleHorizontalLayout.as  | 22 +----
 .../jewel/beads/layouts/SimpleVerticalLayout.as    | 20 -----
 .../royale/jewel/beads/layouts/StyledLayoutBase.as | 34 +++++++-
 .../jewel/beads/layouts/TileHorizontalLayout.as    |  2 +-
 .../jewel/beads/layouts/TileVerticalLayout.as      |  2 +-
 .../royale/jewel/beads/layouts/VerticalLayout.as   |  2 -
 .../royale/jewel/beads/layouts/ViewLayout.as}      | 40 ++++-----
 .../projects/Jewel/src/main/sass/_global.sass      |  2 +-
 17 files changed, 176 insertions(+), 105 deletions(-)
 copy frameworks/projects/Core/src/main/royale/org/apache/royale/core/{IRemovableBead.as => layout/ILayoutChildren.as} (68%)
 create mode 100644 frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/LayoutChildren.as
 copy frameworks/projects/{Core/src/main/royale/org/apache/royale/core/BrowserWindow.as => Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ViewLayout.as} (70%)


[royale-asjs] 04/06: jewel-view: add ViewLayout

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 721b20ad42f40bfd4a69c8b7e6d145b44fc874bc
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 7 21:12:50 2020 +0200

    jewel-view: add ViewLayout
---
 .../projects/Jewel/src/main/resources/defaults.css |  2 +-
 .../Jewel/src/main/resources/jewel-manifest.xml    |  1 +
 .../royale/jewel/beads/layouts/ViewLayout.as       | 61 ++++++++++++++++++++++
 .../projects/Jewel/src/main/sass/_global.sass      |  2 +-
 4 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index cbf3b2f..34f96d4 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -50,7 +50,7 @@ button, input, textarea {
 
 j|View {
   IBeadView: ClassReference("org.apache.royale.html.beads.GroupView");
-  IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout");
+  IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.ViewLayout");
 }
 
 j|ApplicationResponsiveView {
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 3ca9b30..9bc20a7 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -196,6 +196,7 @@
 
     <component id="LayoutChildren" class="org.apache.royale.jewel.beads.layouts.LayoutChildren"/>
     <component id="BasicLayout" class="org.apache.royale.jewel.beads.layouts.BasicLayout"/>
+    <component id="ViewLayout" class="org.apache.royale.jewel.beads.layouts.ViewLayout"/>
     <component id="NullLayout" class="org.apache.royale.jewel.beads.layouts.NullLayout"/>
     <component id="SimpleHorizontalLayout" class="org.apache.royale.jewel.beads.layouts.SimpleHorizontalLayout"/>
     <component id="SimpleVerticalLayout" class="org.apache.royale.jewel.beads.layouts.SimpleVerticalLayout"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ViewLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ViewLayout.as
new file mode 100644
index 0000000..bd5f423
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ViewLayout.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.jewel.beads.layouts
+{
+    /**
+     *  The ViewLayout class is a layout class used in Jewel View class
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.10.0
+     */
+	public class ViewLayout extends StyledLayoutBase
+	{
+        /**
+         *  Constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         */
+        public function ViewLayout()
+        {
+            super();
+        }
+        
+        /**
+         * @copy org.apache.royale.core.IBeadLayout#layout
+         */
+		override public function layout():Boolean
+		{
+            COMPILE::SWF
+            {
+				// SWF TODO
+				return true;
+            }
+
+            COMPILE::JS
+            {
+                return true;
+            }
+		}     
+	}
+}
diff --git a/frameworks/projects/Jewel/src/main/sass/_global.sass b/frameworks/projects/Jewel/src/main/sass/_global.sass
index dca0bb3..edf3d91 100644
--- a/frameworks/projects/Jewel/src/main/sass/_global.sass
+++ b/frameworks/projects/Jewel/src/main/sass/_global.sass
@@ -49,7 +49,7 @@ button, input, textarea
 	
 j|View
 	IBeadView: ClassReference("org.apache.royale.html.beads.GroupView")
-	IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.NullLayout")
+	IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.ViewLayout")
 
 j|ApplicationResponsiveView
 	IBeadView: ClassReference("org.apache.royale.html.beads.GroupView")


[royale-asjs] 05/06: jewel-layouts: remove obligatory children "sizeChanged" event in all case. Use now new bead "LaoutChildren" when needed

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit b4e09d43230cf743862166f36a520cb73bf3eb2f
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 7 21:34:03 2020 +0200

    jewel-layouts: remove obligatory children "sizeChanged" event in all case. Use now new bead "LaoutChildren" when needed
---
 .../royale/jewel/beads/layouts/BasicLayout.as      | 21 +--------------------
 .../royale/jewel/beads/layouts/GridLayout.as       |  2 --
 .../royale/jewel/beads/layouts/HorizontalLayout.as |  4 +---
 .../jewel/beads/layouts/SimpleHorizontalLayout.as  | 22 +---------------------
 .../jewel/beads/layouts/SimpleVerticalLayout.as    | 20 --------------------
 .../jewel/beads/layouts/TileHorizontalLayout.as    |  2 +-
 .../jewel/beads/layouts/TileVerticalLayout.as      |  2 +-
 .../royale/jewel/beads/layouts/VerticalLayout.as   |  2 --
 8 files changed, 5 insertions(+), 70 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
index 223fb5e..53bdfda 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as
@@ -18,14 +18,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.beads.layouts
 {
-	COMPILE::JS {
-	import org.apache.royale.core.UIBase;
-    }
 	COMPILE::SWF {
 	import org.apache.royale.core.IUIBase;
 	import org.apache.royale.core.ILayoutChild;
-	}
 	import org.apache.royale.core.ILayoutView;
+	}
 	import org.apache.royale.events.Event;
 
     /**
@@ -86,7 +83,6 @@ package org.apache.royale.jewel.beads.layouts
 
         /**
          * @copy org.apache.royale.core.IBeadLayout#layout
-		 * @royaleignorecoercion org.apache.royale.core.UIBase
          */
 		override public function layout():Boolean
 		{
@@ -221,21 +217,6 @@ package org.apache.royale.jewel.beads.layouts
 		         *      position: absolute  
 				 *  }
 				 */
-				
-				// We just need to make chids resize themselves (through `sizeChanged` event)
-				var contentView:ILayoutView = layoutView;
-				var n:int = contentView.numElements;
-				var child:UIBase;
-
-				if (n == 0) return false;
-				
-				for(var i:int=0; i < n; i++) {
-					child = contentView.getElementAt(i) as UIBase;
-					if (!child)
-						continue;
-					child.dispatchEvent('sizeChanged');
-				}
-
                 return true;
             }
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as
index f32d177..2c1c20e 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as
@@ -200,8 +200,6 @@ package org.apache.royale.jewel.beads.layouts
 				 *		padding: 1em 0 0 1em;
 				 *	}
 				 */
-				super.layout();
-
                 return true;
             }
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
index 3ffaeb2..8ebdb22 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as
@@ -333,9 +333,7 @@ package org.apache.royale.jewel.beads.layouts
             }
             COMPILE::JS
             {
-				super.layout();
-
-                return true;
+				return true;
             }
 		}
 	}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
index 06f09e4..529302a 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as
@@ -27,11 +27,6 @@ package org.apache.royale.jewel.beads.layouts
 	import org.apache.royale.core.ValuesManager;
 	import org.apache.royale.core.layout.EdgeData;
 	}
-	COMPILE::JS
-	{
-	import org.apache.royale.core.ILayoutView;
-	import org.apache.royale.core.UIBase;
-	}
 	import org.apache.royale.events.Event;
 	import org.apache.royale.jewel.beads.layouts.StyledLayoutBase;
 	
@@ -196,22 +191,7 @@ package org.apache.royale.jewel.beads.layouts
 				 *  .layout.horizontal > * {
 				 *    flex: 0 0 auto
 				 *  }
-				 */
-
-				// We just need to make chids resize themselves (through `sizeChanged` event)
-				var contentView:ILayoutView = layoutView;
-				var n:int = contentView.numElements;
-				var child:UIBase;
-
-				if (n == 0) return false;
-				
-				for(var i:int=0; i < n; i++) {
-					child = contentView.getElementAt(i) as UIBase;
-					if (!child)
-						continue;
-					child.dispatchEvent('sizeChanged');
-				}
-				
+				 */				
                 return true;
             }
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
index ffbe408..ee7a292 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as
@@ -27,11 +27,6 @@ package org.apache.royale.jewel.beads.layouts
 	import org.apache.royale.core.ValuesManager;
 	import org.apache.royale.core.layout.EdgeData;
 	}
-	COMPILE::JS
-	{
-	import org.apache.royale.core.ILayoutView;
-	import org.apache.royale.core.UIBase;
-	}
 	import org.apache.royale.events.Event;
 	import org.apache.royale.jewel.beads.layouts.StyledLayoutBase;
 
@@ -198,21 +193,6 @@ package org.apache.royale.jewel.beads.layouts
 				 *    flex: 0 1 auto
 				 *  }
 				 */
-
-				// We just need to make chids resize themselves (through `sizeChanged` event)
-				var contentView:ILayoutView = layoutView;
-				var n:int = contentView.numElements;
-				var child:UIBase;
-
-				if (n == 0) return false;
-				
-				for(var i:int=0; i < n; i++) {
-					child = contentView.getElementAt(i) as UIBase;
-					if (!child)
-						continue;
-					child.dispatchEvent('sizeChanged');
-				}
-
 				return true;
 			}
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as
index 3c5c8b9..72abbf1 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as
@@ -500,7 +500,7 @@ package org.apache.royale.jewel.beads.layouts
 					else
 						child.positioner.style.marginRight = null;
 					
-					child.dispatchEvent('sizeChanged');
+					child.dispatchEvent(new Event('sizeChanged'));
 				}
 				return true;
 			}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as
index b953c1b..cf0bcbe 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as
@@ -473,7 +473,7 @@ package org.apache.royale.jewel.beads.layouts
 					// else
 					// 	child.positioner.style.marginRight = null;
 					
-					child.dispatchEvent('sizeChanged');
+					child.dispatchEvent(new Event('sizeChanged'));
 				}
 				return true;
 			}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
index b714911..ffcdb2b 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as
@@ -334,8 +334,6 @@ package org.apache.royale.jewel.beads.layouts
 			}
 			COMPILE::JS
 			{
-				super.layout();
-
 				return true;
 			}
 		}


[royale-asjs] 02/06: Jewel-LayoutChildren: implementation of ILayoutChildren to use in StyledLayoutBase

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit a53e945e1ff5d02d01059157e35bcf5b050b2502
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 7 20:20:20 2020 +0200

    Jewel-LayoutChildren: implementation of ILayoutChildren to use in StyledLayoutBase
---
 .../Jewel/src/main/resources/jewel-manifest.xml    |  1 +
 .../royale/jewel/beads/layouts/LayoutChildren.as   | 94 ++++++++++++++++++++++
 2 files changed, 95 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 6ad95cb..3ca9b30 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -194,6 +194,7 @@
     <component id="ComboBoxDisabled" class="org.apache.royale.jewel.beads.controls.combobox.ComboBoxDisabled"/>
     <component id="ComboBoxTruncateText" class="org.apache.royale.jewel.beads.controls.combobox.ComboBoxTruncateText"/>
 
+    <component id="LayoutChildren" class="org.apache.royale.jewel.beads.layouts.LayoutChildren"/>
     <component id="BasicLayout" class="org.apache.royale.jewel.beads.layouts.BasicLayout"/>
     <component id="NullLayout" class="org.apache.royale.jewel.beads.layouts.NullLayout"/>
     <component id="SimpleHorizontalLayout" class="org.apache.royale.jewel.beads.layouts.SimpleHorizontalLayout"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/LayoutChildren.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/LayoutChildren.as
new file mode 100644
index 0000000..5862498
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/LayoutChildren.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.jewel.beads.layouts
+{
+    import org.apache.royale.core.layout.ILayoutChildren;
+    import org.apache.royale.core.IStrand;
+    import org.apache.royale.core.ILayoutView;
+    import org.apache.royale.core.UIBase;
+    import org.apache.royale.events.Event;
+
+    /**
+     *  The LayoutChildren class is an ILayoutChildren implememntation that indicates layout
+	 *  classes like StyledLayoutBase to layout childrens
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.10.0
+     */
+	public class LayoutChildren implements ILayoutChildren
+	{
+        /**
+         *  Constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         */
+        public function LayoutChildren()
+        {
+            super();
+        }
+
+        private var _strand:IStrand;
+
+        /**
+		 *  @copy org.apache.royale.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.10.0
+		 */
+		public function set strand(value:IStrand):void
+		{
+            _strand = value;
+        }
+
+		/**
+		 *  trigger the corresponding layout algorithm in all child
+         *  elements.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.10
+		 *  @royaleignorecoercion org.apache.royale.core.ILayoutView
+		 *  @royaleignorecoercion org.apache.royale.core.UIBase
+		 */
+		public function executeLayoutChildren():void
+		{
+			// We just need to make chids resize themselves (through `sizeChanged` event)
+			var contentView:ILayoutView = _strand as ILayoutView;
+			var n:int = contentView.numElements;
+			var child:UIBase;
+
+			if (n == 0) return;
+			
+			for(var i:int=0; i < n; i++) {
+				child = contentView.getElementAt(i) as UIBase;
+				if (!child)
+					continue;
+				child.dispatchEvent(new Event('sizeChanged'));
+			}
+		}
+	}
+}


[royale-asjs] 01/06: core-ILayoutChildren: add core ILayoutChildren to trigger layout in children instances

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit c43ef21861abe273a7f276ebdc75237755baaf6e
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 7 20:17:16 2020 +0200

    core-ILayoutChildren: add core ILayoutChildren to trigger layout in children instances
---
 .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
 .../apache/royale/core/layout/ILayoutChildren.as   | 46 ++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as b/frameworks/projects/Core/src/main/royale/CoreClasses.as
index e4a28d7..ff662a0 100644
--- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
@@ -60,6 +60,7 @@ internal class CoreClasses
 
 	import org.apache.royale.core.layout.IPaddings; IPaddings;
 	import org.apache.royale.core.layout.ILayoutStyleProperties; ILayoutStyleProperties;
+	import org.apache.royale.core.layout.ILayoutChildren; ILayoutChildren;
 
 	COMPILE::SWF
 	{
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/layout/ILayoutChildren.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/layout/ILayoutChildren.as
new file mode 100644
index 0000000..226c298
--- /dev/null
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/layout/ILayoutChildren.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.royale.core.layout
+{
+    import org.apache.royale.core.IBead;
+
+    /**
+     *  The ILayoutChildren interface is a configurator marker bead
+     *  that indicate to layout classes (i.e: StyledLayoutBase) that child instances must 
+     *  refresh layout due to changes in size.
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.10.0
+     */
+	public interface ILayoutChildren extends IBead
+	{
+        /**
+		 *  trigger the corresponding layout algorithm in all child
+         *  elements.
+		 * 
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.10.0
+		 */
+        function executeLayoutChildren():void;
+	}
+}


[royale-asjs] 03/06: StyledLayoutBase: add LayoutChildren bead support

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 38599c2675cb8019d793b285e120a2179686d1e3
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 7 20:23:27 2020 +0200

    StyledLayoutBase: add LayoutChildren bead support
---
 .../royale/jewel/beads/layouts/StyledLayoutBase.as | 34 +++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/StyledLayoutBase.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/StyledLayoutBase.as
index 7f0f46e..e25b588 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/StyledLayoutBase.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/StyledLayoutBase.as
@@ -25,8 +25,10 @@ package org.apache.royale.jewel.beads.layouts
 	import org.apache.royale.core.LayoutBase;
 	import org.apache.royale.core.StyledUIBase;
 	import org.apache.royale.core.ValuesManager;
+	import org.apache.royale.core.layout.ILayoutChildren;
 	import org.apache.royale.core.layout.ILayoutStyleProperties;
 	import org.apache.royale.events.Event;
+	import org.apache.royale.utils.loadBeadFromValuesManager;
 	import org.apache.royale.utils.sendStrandEvent;
 	
     /**
@@ -329,7 +331,9 @@ package org.apache.royale.jewel.beads.layouts
 		public function executeLayout():void
 		{
 			if (layout()) {
-				viewBead.afterLayout();
+				if(layoutChildren)
+					layoutChildren.executeLayoutChildren();
+				viewBead.afterLayout();	
 			}
 
 			isLayoutRunning = false;
@@ -351,5 +355,33 @@ package org.apache.royale.jewel.beads.layouts
 			}
 			*/
 		}
+
+		private var _layoutChildren:ILayoutChildren;
+        
+        /**
+         *  The org.apache.royale.core.ILayoutChildren used 
+         *  to initialize instances of item renderers.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         *  @royaleignorecoercion org.apache.royale.core.IItemRendererInitializer
+         */
+        public function get layoutChildren():ILayoutChildren
+        {
+            if(!_layoutChildren)
+                _layoutChildren = loadBeadFromValuesManager(ILayoutChildren, "iItemRendererInitializer", _strand) as ILayoutChildren;
+            
+            return _layoutChildren;
+        }
+        
+        /**
+         *  @private
+         */
+        public function set layoutChildren(value:ILayoutChildren):void
+        {
+            _layoutChildren = value;
+        }
 	}
 }


[royale-asjs] 06/06: DataGridLayoutPlayGround: Use the new LayoutChildren bead so inner datagrid resize as needed

Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 1c3384c8124e55f9865fa086cc1e3c336fb17cce
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 7 21:35:04 2020 +0200

    DataGridLayoutPlayGround: Use the new LayoutChildren bead so inner datagrid resize as needed
---
 examples/jewel/TourDeJewel/src/main/royale/DataGridPlayGround.mxml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/examples/jewel/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/jewel/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 828856e..dd38563 100644
--- a/examples/jewel/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/jewel/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -216,6 +216,9 @@ limitations under the License.
 		
 		<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
 			<j:Card localId="card2" height="400">
+				<j:beads>
+					<j:LayoutChildren/>
+				</j:beads>
 				<j:CardHeader itemsVerticalAlign="itemsCenter">
 					<j:BarSection>
 						<html:H3 text="Percentage Width and Height" className="primary-normal"/>
@@ -225,6 +228,9 @@ limitations under the License.
 					</j:BarSection>
 				</j:CardHeader>
 				<j:CardPrimaryContent>
+					<j:beads>
+						<j:LayoutChildren/>
+					</j:beads>
 					<j:Label multiline="true">
 						<j:html><![CDATA[<p><i>width</i> and <i>height</i> set to 100%, no <i>columnWidth</i> or <i>rowHeight</i>, and default <i>dataProvider</i>.<br>Note: this card need to set <i>height</i> so datagrid 100% could work.</p>]]></j:html>
 					</j:Label>