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/08/28 10:38:27 UTC

[royale-asjs] branch develop updated: jewel-layoutproxy: remove duplicated classes and create a new one "LayoutProxy"

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


The following commit(s) were added to refs/heads/develop by this push:
     new 2642e1b  jewel-layoutproxy: remove duplicated classes and create a new one "LayoutProxy"
2642e1b is described below

commit 2642e1b36ed0493aa20dfaf5038b1f23e0116624
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Aug 28 12:38:16 2020 +0200

    jewel-layoutproxy: remove duplicated classes and create a new one "LayoutProxy"
---
 .../projects/Jewel/src/main/royale/JewelClasses.as |   4 +-
 .../royale/jewel/beads/views/FormItemView.as       |   6 +-
 .../apache/royale/jewel/beads/views/WizardView.as  |   6 +-
 .../WizardLayoutProxy.as => LayoutProxy.as}        |  32 ++-
 .../supportClasses/formitem/FormItemLayoutProxy.as | 237 ---------------------
 5 files changed, 23 insertions(+), 262 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index 96ba3f1..2c2d428 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -115,12 +115,12 @@ import org.apache.royale.utils.observeElementSize;
         import org.apache.royale.jewel.supportClasses.datechooser.DateChooserTable; DateChooserTable;
         import org.apache.royale.jewel.supportClasses.table.TBodyContentArea; TBodyContentArea;
         import org.apache.royale.jewel.supportClasses.combobox.ComboBoxPopUp; ComboBoxPopUp;
-        import org.apache.royale.jewel.supportClasses.formitem.FormItemLayoutProxy; FormItemLayoutProxy;
-        import org.apache.royale.jewel.supportClasses.wizard.WizardLayoutProxy; WizardLayoutProxy;
         import org.apache.royale.jewel.supportClasses.button.SelectableButtonBase; SelectableButtonBase;
         
         import org.apache.royale.jewel.beads.views.DataGridView; DataGridView;
         import org.apache.royale.jewel.beads.layouts.DataGridLayout; DataGridLayout;
+        
+        import org.apache.royale.jewel.supportClasses.LayoutProxy; LayoutProxy;
 
         import org.apache.royale.jewel.supportClasses.util.positionInsideBoundingClientRect; positionInsideBoundingClientRect;
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/FormItemView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/FormItemView.as
index 2ced36b..f4e1337 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/FormItemView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/FormItemView.as
@@ -36,7 +36,7 @@ package org.apache.royale.jewel.beads.views
     import org.apache.royale.jewel.beads.controls.TextAlign;
     import org.apache.royale.jewel.beads.layouts.VerticalLayout;
     import org.apache.royale.jewel.beads.models.FormItemModel;
-    import org.apache.royale.jewel.supportClasses.formitem.FormItemLayoutProxy;
+    import org.apache.royale.jewel.supportClasses.LayoutProxy;
     import org.apache.royale.jewel.HGroup;
 
 
@@ -257,7 +257,7 @@ package org.apache.royale.jewel.beads.views
 			//_strand.addBead(layoutBead);
 		}
 
-        private var _formItemLayoutProxy:FormItemLayoutProxy;
+        private var _formItemLayoutProxy:LayoutProxy;
 
 		/**
 		 * The sub-element used as the parent of the container's elements. This does not
@@ -273,7 +273,7 @@ package org.apache.royale.jewel.beads.views
 			// we want to return a proxy for the formItem which will have numElements, getElementAt, etc.
 			// functions that will use the formItem.$numElements, formItem.$getElementAt, etc. functions
 			if (_formItemLayoutProxy == null) {
-				_formItemLayoutProxy = new FormItemLayoutProxy(_strand);
+				_formItemLayoutProxy = new LayoutProxy(_strand);
 			}
 			return _formItemLayoutProxy;
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/WizardView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/WizardView.as
index 90ae523..62627ae 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/WizardView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/WizardView.as
@@ -38,7 +38,7 @@ package org.apache.royale.jewel.beads.views
 	import org.apache.royale.jewel.Wizard;
 	import org.apache.royale.jewel.WizardPage;
 	import org.apache.royale.jewel.beads.models.WizardModel;
-	import org.apache.royale.jewel.supportClasses.wizard.WizardLayoutProxy;
+	import org.apache.royale.jewel.supportClasses.LayoutProxy;
 
 	/**
 	 *  The Wizard class creates the visual elements of the org.apache.royale.jewel.Wizard
@@ -360,7 +360,7 @@ package org.apache.royale.jewel.beads.views
 			// _strand.addBead(layoutBead);
 		}
 
-		private var _wizardLayoutProxy:WizardLayoutProxy;
+		private var _wizardLayoutProxy:LayoutProxy;
 
 		/**
 		 * The sub-element used as the parent of the container's elements. This does not
@@ -376,7 +376,7 @@ package org.apache.royale.jewel.beads.views
 			// we want to return a proxy for the wizard which will have numElements, getElementAt, etc.
 			// functions that will use the wizard.$numElements, wizard.$getElementAt, etc. functions
 			if (_wizardLayoutProxy == null) {
-				_wizardLayoutProxy = new WizardLayoutProxy(_strand);
+				_wizardLayoutProxy = new LayoutProxy(_strand);
 			}
 			return _wizardLayoutProxy;
 		}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/wizard/WizardLayoutProxy.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/LayoutProxy.as
similarity index 89%
rename from frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/wizard/WizardLayoutProxy.as
rename to frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/LayoutProxy.as
index deef222..3544350 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/wizard/WizardLayoutProxy.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/LayoutProxy.as
@@ -16,21 +16,19 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.jewel.supportClasses.wizard
+package org.apache.royale.jewel.supportClasses
 {
-	import org.apache.royale.core.UIBase;
-    import org.apache.royale.core.IChild;
-    import org.apache.royale.core.IContainerBaseStrandChildrenHost;
-    import org.apache.royale.core.ILayoutView;
-    import org.apache.royale.core.IParent;
-	import org.apache.royale.events.IEventDispatcher;
-
 	COMPILE::JS {
-		import org.apache.royale.core.WrappedHTMLElement;
+	import org.apache.royale.core.WrappedHTMLElement;
 	}
+	import org.apache.royale.core.IChild;
+	import org.apache.royale.core.IContainerBaseStrandChildrenHost;
+	import org.apache.royale.core.ILayoutView;
+	import org.apache.royale.core.IParent;
+	import org.apache.royale.core.StyledUIBase;
 
     /**
-     *  The WizardLayoutProxy class is used by Wizard in order for layouts to operate
+     *  The LayoutProxy class is used by components in order for layouts to operate
 	 *  on the Wizard itself. If Wizard were being used, its numElements, getElementAt, etc.
 	 *  functions would actually redirect to its Container content. In order for a layout
 	 *  to work on the Wizard directly (its PreviousButton, NextButton and Container),
@@ -42,7 +40,7 @@ package org.apache.royale.jewel.supportClasses.wizard
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.9.4
      */
-	public class WizardLayoutProxy implements ILayoutView, IParent
+	public class LayoutProxy implements ILayoutView, IParent
 	{
         /**
          *  Constructor.
@@ -52,7 +50,7 @@ package org.apache.royale.jewel.supportClasses.wizard
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.9.4
          */
-		public function WizardLayoutProxy(host:Object)
+		public function LayoutProxy(host:Object)
 		{
 			super();
 			_host = host;
@@ -75,7 +73,7 @@ package org.apache.royale.jewel.supportClasses.wizard
 		 *  @productversion Royale 0.9.4
 		 */
 		public function get width():Number {
-			return (host as UIBase).width;
+			return (host as StyledUIBase).width;
 		}
 
 		/**
@@ -88,7 +86,7 @@ package org.apache.royale.jewel.supportClasses.wizard
 		 *  @productversion Royale 0.9.4
 		 */
 		public function get height():Number {
-			return (host as UIBase).height;
+			return (host as StyledUIBase).height;
 		}
 
 		/**
@@ -197,7 +195,7 @@ package org.apache.royale.jewel.supportClasses.wizard
 		COMPILE::JS
 		public function get element():WrappedHTMLElement
 		{
-			return (host as UIBase).element;
+			return (host as StyledUIBase).element;
 		}
 
 		/**
@@ -213,7 +211,7 @@ package org.apache.royale.jewel.supportClasses.wizard
 		COMPILE::JS
 		public function setDisplayStyleForLayout(value:String):void
 		{
-			(host as UIBase).setDisplayStyleForLayout(value);
+			(host as StyledUIBase).setDisplayStyleForLayout(value);
 		}
 		/**
 		 * @royaleignorecoercion org.apache.royale.core.UIBase
@@ -221,7 +219,7 @@ package org.apache.royale.jewel.supportClasses.wizard
 		COMPILE::JS
 		public function get displayStyleForLayout():String
 		{
-			return (host as UIBase).displayStyleForLayout;
+			return (host as StyledUIBase).displayStyleForLayout;
 		}
 
 	}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/formitem/FormItemLayoutProxy.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/formitem/FormItemLayoutProxy.as
deleted file mode 100644
index 704d518..0000000
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/formitem/FormItemLayoutProxy.as
+++ /dev/null
@@ -1,237 +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.royale.jewel.supportClasses.formitem
-{
-	import org.apache.royale.core.UIBase;
-    import org.apache.royale.core.IChild;
-    import org.apache.royale.core.IContainerBaseStrandChildrenHost;
-    import org.apache.royale.core.ILayoutView;
-    import org.apache.royale.core.IParent;
-	import org.apache.royale.events.IEventDispatcher;
-
-	COMPILE::JS {
-		import org.apache.royale.core.WrappedHTMLElement;
-	}
-
-    /**
-     *  The FormItemLayoutProxy class is used by Wizard in order for layouts to operate
-	 *  on the Wizard itself. If Wizard were being used, its numElements, getElementAt, etc.
-	 *  functions would actually redirect to its Container content. In order for a layout
-	 *  to work on the Wizard directly (its PreviousButton, NextButton and Container),
-	 *  this proxy is used which will invoke the Wizard's $numElements, $getElementAt, etc
-	 *  functions.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Royale 0.9.4
-     */
-	public class FormItemLayoutProxy implements ILayoutView, IParent
-	{
-        /**
-         *  Constructor.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-		public function FormItemLayoutProxy(host:Object)
-		{
-			super();
-			_host = host;
-		}
-
-		private var _host:Object;
-
-		public function get host():Object
-		{
-			return _host;
-		}
-
-		/**
-		 *  @royaleignorecoercion org.apache.royale.core.UIBase
-		 *  The width of the bounding box.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
-		 */
-		public function get width():Number {
-			return (host as UIBase).width;
-		}
-
-		/**
-		 *  @royaleignorecoercion org.apache.royale.core.UIBase
-		 * The height of the bounding box.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
-		 */
-		public function get height():Number {
-			return (host as UIBase).height;
-		}
-
-		/**
-		 *  @royaleignorecoercion org.apache.royale.core.IContainerBaseStrandChildrenHost
-		 *  The number of elements in the parent.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
-		 */
-		public function get numElements():int
-		{
-			return (host as IContainerBaseStrandChildrenHost).$numElements;
-		}
-
-		/**
-		 *  @royaleignorecoercion org.apache.royale.core.IContainerBaseStrandChildrenHost
-		 *  Get a component from the parent.
-		 *
-		 *  @param c The index of the subcomponent.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
-		 */
-		public function getElementAt(index:int):IChild
-		{
-			return (host as IContainerBaseStrandChildrenHost).$getElementAt(index);
-		}
-
-        /**
-         *  @royaleignorecoercion org.apache.royale.core.IContainerBaseStrandChildrenHost
-         *  Gets the index of this subcomponent.
-         * 
-         *  @param c The subcomponent to add.
-         *  @return The index (zero-based).
-         * 
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-        public function getElementIndex(c:IChild):int
-        {
-            return (host as IContainerBaseStrandChildrenHost).$getElementIndex(c);
-        }
-        
-        /**
-         *  @royaleignorecoercion org.apache.royale.core.IContainerBaseStrandChildrenHost
-         *  Add a component to the parent.
-         * 
-         *  @param c The subcomponent to add.
-         *  @param dispatchEvent Whether to dispatch an event after adding the child.
-         * 
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-        public function addElement(c:IChild, dispatchEvent:Boolean = true):void
-        {
-            (host as IContainerBaseStrandChildrenHost).$addElement(c);
-        }
-        
-        /**
-         *  @royaleignorecoercion org.apache.royale.core.IContainerBaseStrandChildrenHost
-         *  Add a component to the parent.
-         * 
-         *  @param c The subcomponent to add.
-         *  @param index The index where the subcomponent should be added.
-         *  @param dispatchEvent Whether to dispatch an event after adding the child.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-        public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
-        {
-            return (host as IContainerBaseStrandChildrenHost).$addElementAt(c, index);
-        }
-        
-        /**
-         *  @royaleignorecoercion org.apache.royale.core.IContainerBaseStrandChildrenHost
-         *  Remove a component from the parent.
-         * 
-         *  @param c The subcomponent to remove.
-         *  @param dispatchEvent Whether to dispatch an event after removing the child.
-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9.4
-         */
-        public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
-        {
-            return (host as IContainerBaseStrandChildrenHost).$removeElement(c);
-        }
-        
-		/**
-		 * @royaleignorecoercion org.apache.royale.core.UIBase
-		 */
-		COMPILE::JS
-		public function get somethingelse():WrappedHTMLElement
-		{
-			return (host as UIBase).element;
-		}
-
-		/**
-		 * @royaleignorecoercion org.apache.royale.core.UIBase
-		 */
-		COMPILE::JS
-		public function get element():WrappedHTMLElement
-		{
-			return (host as UIBase).element;
-		}
-
-		/**
-		 *  @royaleignorecoercion org.apache.royale.core.UIBase
-		 *  The display style is used for both visible
-		 *  and layout so is managed as a special case.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.9.4
-		 */
-		COMPILE::JS
-		public function setDisplayStyleForLayout(value:String):void
-		{
-			(host as UIBase).setDisplayStyleForLayout(value);
-		}
-		/**
-		 * @royaleignorecoercion org.apache.royale.core.UIBase
-		 */
-		COMPILE::JS
-		public function get displayStyleForLayout():String
-		{
-			return (host as UIBase).displayStyleForLayout;
-		}
-
-	}
-}