You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/11/08 01:54:29 UTC

[royale-asjs] branch develop updated (51ec68f -> 88ac815)

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

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


    from 51ec68f  Merge pull request #336 from nihavend/develop
     new 8c2b319  Spark Application and BorderContainer
     new 88ac815  Spark HelloWorld

The 2 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:
 .../SparkHelloWorld.as3proj}                       |   0
 .../{HelloWorld => SparkHelloWorld}/build.xml      |   2 +-
 .../{HelloWorld => SparkHelloWorld}/pom.xml        |   4 +-
 .../src/main/royale/HelloWorld.mxml                |  35 +-
 .../src/main/royale/mx/core/UIComponent.as         |   5 +-
 .../SparkRoyale/src/main/resources/defaults.css    |  16 +
 .../src/main/resources/spark-royale-manifest.xml   |   3 +-
 .../main/royale/spark/components/Application.as    | 111 +++++-
 .../royale/spark/components/BorderContainer.as     |  18 +-
 .../royale/spark/components/SkinnableContainer.as  | 403 +++++++++++++++++++--
 .../supportClasses/SkinnableComponent.as           |  37 --
 11 files changed, 531 insertions(+), 103 deletions(-)
 copy examples/mxroyale/{HelloWorld/HelloWorld.as3proj => SparkHelloWorld/SparkHelloWorld.as3proj} (100%)
 copy examples/mxroyale/{HelloWorld => SparkHelloWorld}/build.xml (97%)
 copy examples/mxroyale/{HelloWorld => SparkHelloWorld}/pom.xml (92%)
 copy examples/mxroyale/{HelloWorld => SparkHelloWorld}/src/main/royale/HelloWorld.mxml (51%)


[royale-asjs] 01/02: Spark Application and BorderContainer

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

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

commit 8c2b319b93b4836243393969aee14c5b922a4293
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Nov 7 17:46:55 2018 -0800

    Spark Application and BorderContainer
---
 .../src/main/royale/mx/core/UIComponent.as         |   5 +-
 .../SparkRoyale/src/main/resources/defaults.css    |  16 +
 .../src/main/resources/spark-royale-manifest.xml   |   3 +-
 .../main/royale/spark/components/Application.as    | 111 +++++-
 .../royale/spark/components/BorderContainer.as     |  18 +-
 .../royale/spark/components/SkinnableContainer.as  | 403 +++++++++++++++++++--
 .../supportClasses/SkinnableComponent.as           |  37 --
 7 files changed, 509 insertions(+), 84 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index 052d8dd..f637555 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -4294,12 +4294,11 @@ COMPILE::JS
      */
     public function get cornerRadius():Object
     {
-        trace("cornerRadius not implemented");
-        return 0;
+        return getStyle("borderRadius");
     }
     public function set cornerRadius(value:Object):void
     {
-        trace("cornerRadius not implemented");
+        setStyle("borderRadius", value);
     }
 	[Inspectable(category="General")]
 	
diff --git a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
index aa26fed..31bdb87 100644
--- a/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/SparkRoyale/src/main/resources/defaults.css
@@ -101,6 +101,15 @@ Panel .TitleBar
 {
 	background-color: #FFFFFF;
 }
+
+SkinnableContainer
+{
+	IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView");
+	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.BasicLayout");
+	IViewport: ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
+	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
+}
+
 /* -------------------------------------------------------
 * SWF specific styles
 * -------------------------------------------------------
@@ -120,6 +129,13 @@ Panel .TitleBar
 		IBeadView:  ClassReference("mx.controls.beads.CheckBoxView");			
 	}
 	
+    SkinnableContainer
+    {
+	    IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
+	    IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
+	    IContentView: ClassReference("org.apache.royale.html.supportClasses.ContainerContentArea");
+    }
+
 	Label
 	{
 		IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
diff --git a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
index cb436d4..19d3e99 100644
--- a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
+++ b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml
@@ -44,6 +44,7 @@
 	<component id="RichText" class="spark.components.RichText"/>
 	<component id="Skin" class="spark.components.supportClasses.Skin"/>
 	<component id="SkinnableComponent" class="spark.components.supportClasses.SkinnableComponent"/>
+    <component id="SkinnableContainer" class="spark.components.SkinnableContainer"/>
 	<component id="ToggleButton" class="spark.components.ToggleButton"/>
 	<component id="ToggleButtonBase" class="spark.components.supportClasses.ToggleButtonBase"/>
 	<component id="DataRenderer" class="spark.components.DataRenderer"/>
@@ -65,7 +66,7 @@
 	<component id="SolidColor" class="mx.graphics.SolidColor" lookupOnly="true"/>
 	<component id="SolidColorStroke" class="mx.graphics.SolidColorStroke" lookupOnly="true"/>
 	<component id="NavigatorContent" class="spark.components.NavigatorContent"/>
-	<component id="BorderContainer" class="mx.core.Container" lookupOnly="true"/>
+	<component id="BorderContainer" class="spark.components.BorderContainer" />
 	<component id="Scroller" class="spark.components.Scroller"/>
 	<component id="DataGroup" class="spark.components.DataGroup"/>
 	<component id="VerticalLayout" class="spark.layouts.VerticalLayout"/>
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Application.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Application.as
index 2e62268..7b46169 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Application.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/Application.as
@@ -57,7 +57,27 @@ import mx.utils.LoaderUtil;
 import mx.utils.Platform; 
 import spark.layouts.supportClasses.LayoutBase; */
 
+COMPILE::SWF {
+    import flash.system.ApplicationDomain;
+    import flash.utils.getQualifiedClassName;
+}
+
 import mx.core.mx_internal;
+import mx.managers.ISystemManager;
+
+import org.apache.royale.binding.ApplicationDataBinding;
+import org.apache.royale.core.AllCSSValuesImpl;
+import org.apache.royale.core.IFlexInfo;
+import org.apache.royale.core.IParent;
+import org.apache.royale.core.IPopUpHost;
+import org.apache.royale.core.IPopUpHostParent;
+import org.apache.royale.core.IRenderedObject;
+import org.apache.royale.core.IStatesImpl;
+import org.apache.royale.core.IStrand;
+import org.apache.royale.core.IValuesImpl;
+import org.apache.royale.core.ValuesManager;
+import org.apache.royale.events.IEventDispatcher;
+
 use namespace mx_internal; 
 
 //--------------------------------------
@@ -232,7 +252,7 @@ use namespace mx_internal;
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class Application extends SkinnableContainer
+public class Application extends SkinnableContainer implements IStrand, IParent, IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject, IFlexInfo
 {
    // include "../core/Version.as";
 
@@ -291,6 +311,36 @@ public class Application extends SkinnableContainer
         /* showInAutomationHierarchy = true;
 
         initResizeBehavior(); */
+        
+        this.valuesImpl = new AllCSSValuesImpl();
+        addBead(new ApplicationDataBinding());
+    }
+
+    
+    private var _info:Object;
+    
+    /**
+     *  An Object containing information generated
+     *  by the compiler that is useful at startup time.
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     */
+    public function info():Object
+    {
+        COMPILE::SWF
+        {
+            if (!_info)
+            {
+                var mainClassName:String = getQualifiedClassName(this);
+                var initClassName:String = "_" + mainClassName + "_FlexInit";
+                var c:Class = ApplicationDomain.currentDomain.getDefinition(initClassName) as Class;
+                _info = c.info();
+            }
+        }
+        return _info;
     }
 
     //--------------------------------------------------------------------------
@@ -300,6 +350,25 @@ public class Application extends SkinnableContainer
     //--------------------------------------------------------------------------
     
     /**
+     *  The org.apache.royale.core.IValuesImpl that will
+     *  determine the default values and other values
+     *  for the application.  The most common choice
+     *  is org.apache.royale.core.SimpleCSSValuesImpl.
+     *
+     *  @see org.apache.royale.core.SimpleCSSValuesImpl
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     */
+    public function set valuesImpl(value:IValuesImpl):void
+    {
+        ValuesManager.valuesImpl = value;
+        ValuesManager.valuesImpl.init(this);
+    }
+    
+    /**
      *  @private
      *  Variable that determines whether this application is running on iOS.
      */
@@ -2204,6 +2273,46 @@ public class Application extends SkinnableContainer
 		
 		return _softKeyboardRect;
 	}*/
+     
+     //--------------------------------------------------------------------------
+     //
+     //  IPopUpHost
+     //
+     //--------------------------------------------------------------------------
+     
+     /**
+      *  Application can host popups but in the strandChildren
+      *
+      *  @langversion 3.0
+      *  @playerversion Flash 10.2
+      *  @playerversion AIR 2.6
+      *  @productversion Royale 0.0
+      */
+     public function get popUpParent():IPopUpHostParent
+     {
+         COMPILE::JS
+             {
+                 return systemManager as IPopUpHostParent;
+             }
+             COMPILE::SWF
+             {
+                 return strandChildren as IPopUpHostParent;
+             }
+     }
+     
+     override public function get systemManager():ISystemManager
+     {
+         return parent as ISystemManager;
+     }
+     
+     /**
+      */
+     public function get popUpHost():IPopUpHost
+     {
+         return this;
+     }
+     
+
 }
 
 }
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/BorderContainer.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/BorderContainer.as
index a892946..85262c0 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/BorderContainer.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/BorderContainer.as
@@ -240,22 +240,26 @@ public class BorderContainer extends SkinnableContainer
     {
         super(); 
     }
+    
 	public function get borderColor():uint 
 	{
-		return 0;
+		return getStyle("borderColor");
 
 	}
 	public function set borderColor(val:uint):void 
 	{
+        setStyle("borderColor", val);
 	}
+    
 	public function get borderWeight():Number 
 	{
-		return 0;
-
+		return getStyle("borderWidth");
 	}
 	public function set borderWeight(val:Number):void
 	{
+        setStyle("borderWidth", val);
 	}
+    
 	public function get dropShadowVisible():Boolean 
 	{
 		return false;
@@ -264,14 +268,14 @@ public class BorderContainer extends SkinnableContainer
 	public function set dropShadowVisible(val:Boolean):void 
 	{
 	}
+    
 	public function get borderStyle():String
-	{
-	    trace("BorderContainer:borderStyle not implemented");
-    	return "solid";
+    {
+    	return getStyle("borderStyle");
 	}
 	public function set borderStyle(value:String):void
 	{
-	    trace("BorderContainer:borderStyle not implemented");
+	    setStyle("borderStyle", value);
 	}
 	
 	public function get backgroundImage():Object
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
index 474363b..a311eaf 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/SkinnableContainer.as
@@ -29,14 +29,32 @@ import mx.utils.BitFlagUtil;
 
 import spark.components.supportClasses.SkinnableContainerBase;
 import spark.events.ElementExistenceEvent;
-import spark.layouts.supportClasses.LayoutBase; */
-import spark.components.supportClasses.SkinnableComponent;
+*/
 import mx.core.IUIComponent;
 import mx.core.IVisualElement;
 import mx.core.mx_internal;
 
+import spark.components.supportClasses.SkinnableComponent;
+import spark.layouts.supportClasses.LayoutBase;
+import spark.layouts.BasicLayout;
+
 use namespace mx_internal;
 
+import org.apache.royale.binding.ContainerDataBinding;
+import org.apache.royale.binding.DataBindingBase;
+import org.apache.royale.core.ContainerBaseStrandChildren;
+import org.apache.royale.core.IBeadLayout;
+import org.apache.royale.core.IChild;
+import org.apache.royale.core.IContainer;
+import org.apache.royale.core.IContainerBaseStrandChildrenHost;
+import org.apache.royale.core.ILayoutHost;
+import org.apache.royale.core.IParent;
+import org.apache.royale.core.ValuesManager;
+import org.apache.royale.events.ValueEvent;
+import org.apache.royale.events.Event;
+import org.apache.royale.utils.MXMLDataInterpreter;
+import org.apache.royale.utils.loadBeadFromValuesManager;
+
 /**
  *  Dispatched after the content for this component has been created. With deferred 
  *  instantiation, the content for a component may be created long after the 
@@ -231,6 +249,7 @@ include "../styles/metadata/SelectionFormatTextStyles.as"
 //--------------------------------------
 
 //[DefaultProperty("mxmlContentFactory")]
+[DefaultProperty("mxmlContent")]
 
 /**
  *  The SkinnableContainer class is the base class for skinnable containers that have 
@@ -344,7 +363,7 @@ include "../styles/metadata/SelectionFormatTextStyles.as"
  *  @playerversion AIR 1.5
  *  @productversion Royale 0.9.4
  */
-public class SkinnableContainer extends SkinnableComponent
+public class SkinnableContainer extends SkinnableComponent implements IContainer, IContainerBaseStrandChildrenHost
 {// SkinnableContainerBase 
  //    implements IDeferredContentOwner, IVisualElementContainer
    // include "../core/Version.as";
@@ -384,7 +403,20 @@ public class SkinnableContainer extends SkinnableComponent
         super();
     }
     
+    /**
+     * Returns the ILayoutHost which is its view. From ILayoutParent.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.8
+     */
+    public function getLayoutHost():ILayoutHost
+    {
+        return view as ILayoutHost;
+    }
     
+
     //----------------------------------
     //  textDecoration
     //----------------------------------
@@ -607,6 +639,8 @@ public class SkinnableContainer extends SkinnableComponent
     //  layout
     //----------------------------------
     
+    private var _layout:LayoutBase;
+    
     //[Inspectable(category="General")]
     
     /**
@@ -619,18 +653,24 @@ public class SkinnableContainer extends SkinnableComponent
      *  @playerversion AIR 1.5
      *  @productversion Royale 0.9.4
      */
-    /* public function get layout():LayoutBase
+    public function get layout():LayoutBase
     {
+        /*
         return (contentGroup) 
             ? contentGroup.layout 
             : contentGroupProperties.layout;
+        */
+        if (!_layout)
+            _layout = new BasicLayout();
+        return _layout;
     }
-     */
+    
     /**
      * @private
      */
-    /* public function set layout(value:LayoutBase):void
+    public function set layout(value:LayoutBase):void
     {
+        /*
         if (contentGroup)
         {
             contentGroup.layout = value;
@@ -639,8 +679,9 @@ public class SkinnableContainer extends SkinnableComponent
         }
         else
             contentGroupProperties.layout = value;
-        
-    } */
+        */
+        _layout = value;
+    }
     
     //----------------------------------
     //  mxmlContent
@@ -685,6 +726,19 @@ public class SkinnableContainer extends SkinnableComponent
             _contentModified = true;
     }
      */
+     
+     /**
+      *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
+      *  
+      *  @langversion 3.0
+      *  @playerversion Flash 10.2
+      *  @playerversion AIR 2.6
+      *  @productversion Royale 0.8
+      * 
+      *  @royalesuppresspublicvarwarning
+      */
+     public var mxmlContent:Array;
+
     /**
      *  override setting of children
      */
@@ -848,6 +902,53 @@ public class SkinnableContainer extends SkinnableComponent
     } 
     
     /**
+     *  @copy org.apache.royale.core.Application#MXMLDescriptor
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.8
+     */
+    public function get MXMLDescriptor():Array
+    {
+        return _mxmlDescriptor;
+    }
+    
+    /**
+     *  @private
+     */
+    public function setMXMLDescriptor(document:Object, value:Array):void
+    {
+        _mxmlDocument = document;
+        _mxmlDescriptor = value;
+    }
+    
+    /**
+     *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.8
+     */
+    public function generateMXMLAttributes(data:Array):void
+    {
+        MXMLDataInterpreter.generateMXMLProperties(this, data);
+    }
+    
+    /*
+    * IContainer
+    */
+    
+    /**
+     *  @private
+     */
+    public function childrenAdded():void
+    {
+        dispatchEvent(new ValueEvent("childrenAdded"));
+    }
+    
+    /**
      *  @inheritDoc
      *  
      *  @langversion 3.0
@@ -895,39 +996,46 @@ public class SkinnableContainer extends SkinnableComponent
     //
     //--------------------------------------------------------------------------
     
-    /* private var creatingDeferredContent:Boolean;
+    //--------------------------------------------------------------------------
+    //
+    //  IMXMLDocument et al
+    //
+    //--------------------------------------------------------------------------
     
-    override protected function generateMXMLInstances(document:Object, data:Array, recursive:Boolean = true):void
+    private var _mxmlDescriptor:Array;
+    private var _mxmlDocument:Object = this;
+    
+    override public function addedToParent():void
     {
-        // don't generate children during super.createChildren
-        if (!creatingDeferredContent)
-		{
-			setMXMLDescriptor(data);
-            return;
-		}
+        if (!initialized) {
+            // each MXML file can also have styles in fx:Style block
+            ValuesManager.valuesImpl.init(this);
+        }
+        
+        if (MXMLDescriptor)
+            component = this;
         
-        super.generateMXMLInstances(document, data, recursive);
+        super.addedToParent();		
+        
+        // disabled for now to see if we can use spark LayoutBase instead
+        // Load the layout bead if it hasn't already been loaded.
+        //loadBeadFromValuesManager(IBeadLayout, "iBeadLayout", this);
+        
+        dispatchEvent(new Event("initComplete"));
+        if ((isHeightSizedToContent() || !isNaN(explicitHeight)) &&
+            (isWidthSizedToContent() || !isNaN(explicitWidth)))
+            dispatchEvent(new Event("layoutNeeded"));
     }
-    */
-    /**
-     *  Create content children, if the <code>creationPolicy</code> property 
-     *  is not equal to <code>none</code>.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Royale 0.9.4
-     */
-    /* override protected function createChildren():void
+    
+    override protected function createChildren():void
     {
-        super.createChildren();
+        MXMLDataInterpreter.generateMXMLInstances(_mxmlDocument, this, MXMLDescriptor);
         
-        // TODO (rfrishbe): When navigator support is added, this is where we would 
-        // determine if content should be created now, or wait until
-        // later. For now, we always create content here unless
-        // creationPolicy="none".
-        createContentIfNeeded();
-    } */
+        if (getBeadByType(DataBindingBase) == null)
+            addBead(new ContainerDataBinding());
+        
+        dispatchEvent(new Event("initBindings"));
+    }
    
     /**
      *  @inheritDoc
@@ -1155,6 +1263,231 @@ public class SkinnableContainer extends SkinnableComponent
         // Re-dispatch the event
         dispatchEvent(event);
     } */
+     
+     //--------------------------------------------------------------------------
+     //  StrandChildren
+     //--------------------------------------------------------------------------
+     
+     private var _strandChildren:ContainerBaseStrandChildren;
+     
+     /**
+      * @copy org.apache.royale.core.IContentViewHost#strandChildren
+      *  
+      *  @langversion 3.0
+      *  @playerversion Flash 10.2
+      *  @playerversion AIR 2.6
+      *  @productversion Royale 0.8
+      */
+     
+     /**
+      * @private
+      */
+     public function get strandChildren():IParent
+     {
+         if (_strandChildren == null) {
+             _strandChildren = new ContainerBaseStrandChildren(this);
+         }
+         return _strandChildren;
+     }
+     
+     //--------------------------------------------------------------------------
+     //
+     //  element/child handlers
+     //
+     //--------------------------------------------------------------------------
+     
+     
+     /**
+      * @private
+      */
+     COMPILE::JS
+     override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+     {
+         super.addElement(c, dispatchEvent);
+         if (dispatchEvent)
+             this.dispatchEvent(new ValueEvent("childrenAdded", c));
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::JS
+     override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+     {
+         super.addElementAt(c, index, dispatchEvent);
+         if (dispatchEvent)
+             this.dispatchEvent(new ValueEvent("childrenAdded", c));
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::JS
+     override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+     {
+         super.removeElement(c, dispatchEvent);
+         //TODO This should possibly be ultimately refactored to be more PAYG
+         if (dispatchEvent)
+             this.dispatchEvent(new ValueEvent("childrenRemoved", c));
+     }
+     
+     /*
+     * The following functions are for the SWF-side only and re-direct element functions
+     * to the content area, enabling scrolling and clipping which are provided automatically
+     * in the JS-side. 
+     */
+     
+     /**
+      * @private
+      */
+     COMPILE::SWF
+     override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
+     {
+         var contentView:IParent = getLayoutHost().contentView as IParent;
+         contentView.addElement(c, dispatchEvent);
+         if (dispatchEvent)
+             this.dispatchEvent(new ValueEvent("childrenAdded", c));
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::SWF
+     override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+     {
+         var contentView:IParent = getLayoutHost().contentView as IParent;
+         contentView.addElementAt(c, index, dispatchEvent);
+         if (dispatchEvent)
+             this.dispatchEvent(new ValueEvent("childrenAdded", c));
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::SWF
+     override public function getElementIndex(c:IChild):int
+     {
+         var layoutHost:ILayoutHost = view as ILayoutHost;
+         var contentView:IParent = layoutHost.contentView as IParent;
+         return contentView.getElementIndex(c);
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::SWF
+     override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
+     {
+         var layoutHost:ILayoutHost = view as ILayoutHost;
+         var contentView:IParent = layoutHost.contentView as IParent;
+         contentView.removeElement(c, dispatchEvent);
+         //TODO This should possibly be ultimately refactored to be more PAYG
+         if(dispatchEvent)
+             this.dispatchEvent(new ValueEvent("childrenRemoved", c));
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::SWF
+     override public function get numElements():int
+     {
+         var layoutHost:ILayoutHost = view as ILayoutHost;
+         var contentView:IParent = layoutHost.contentView as IParent;
+         return contentView.numElements;
+     }
+     
+     /**
+      * @private
+      */
+     COMPILE::SWF
+     override public function getElementAt(index:int):IChild
+     {
+         var layoutHost:ILayoutHost = view as ILayoutHost;
+         var contentView:IParent = layoutHost.contentView as IParent;
+         return contentView.getElementAt(index);
+     }
+     
+     [SWFOverride(returns="flash.display.DisplayObject"))]
+     COMPILE::SWF
+     override public function getChildAt(index:int):IUIComponent
+     {
+         var layoutHost:ILayoutHost = view as ILayoutHost;
+         var contentView:IParent = layoutHost.contentView as IParent;
+         return contentView.getElementAt(index) as IUIComponent;
+     }
+     
+     /*
+     * IContainerBaseStrandChildrenHost
+     *
+     * These "internal" function provide a backdoor way for proxy classes to
+     * 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.royale.core.IContainer#strandChildren
+     */
+     
+     /**
+      * @private
+      * @suppress {undefinedNames}
+      * Support strandChildren.
+      */
+     public function get $numElements():int
+     {
+         return super.numElements;
+     }
+     
+     /**
+      * @private
+      * @suppress {undefinedNames}
+      * Support strandChildren.
+      */
+     public function $addElement(c:IChild, dispatchEvent:Boolean = true):void
+     {
+         super.addElement(c, dispatchEvent);
+     }
+     
+     /**
+      * @private
+      * @suppress {undefinedNames}
+      * Support strandChildren.
+      */
+     public function $addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
+     {
+         super.addElementAt(c, index, dispatchEvent);
+     }
+     
+     /**
+      * @private
+      * @suppress {undefinedNames}
+      * Support strandChildren.
+      */
+     public function $removeElement(c:IChild, dispatchEvent:Boolean = true):void
+     {
+         super.removeElement(c, dispatchEvent);
+     }
+     
+     /**
+      * @private
+      * @suppress {undefinedNames}
+      * Support strandChildren.
+      */
+     public function $getElementIndex(c:IChild):int
+     {
+         return super.getElementIndex(c);
+     }
+     
+     /**
+      * @private
+      * @suppress {undefinedNames}
+      * Support strandChildren.
+      */
+     public function $getElementAt(index:int):IChild
+     {
+         return super.getElementAt(index);
+     }
+
 }
 
 }
diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableComponent.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableComponent.as
index bcae3b3..cedeafc 100644
--- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableComponent.as
+++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/SkinnableComponent.as
@@ -291,44 +291,7 @@ public class SkinnableComponent extends UIComponent
             dataGroupProperties.dataProvider = value;
         dispatchEvent(new Event("dataProviderChanged")); */
     }
-	//----------------------------------
-    //  layout copied from SkinnableDataContainer
-    //----------------------------------
-    
-    [Inspectable(category="General")]
-    
-    /**
-     *  @copy spark.components.supportClasses.GroupBase#layout
-     *
-     *  @default VerticalLayout
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Royale 0.9.4
-     */     
-    public function get layout():Object
-    {
-        /* return (dataGroup) 
-            ? dataGroup.layout 
-            : dataGroupProperties.layout; */
-			return null;
-    }
 
-    /**
-     *  @private
-     */
-    public function set layout(value:Object):void
-    { //value:LayoutBase)
-       /*  if (dataGroup)
-        {
-            dataGroup.layout = value;
-            dataGroupProperties = BitFlagUtil.update(dataGroupProperties as uint, 
-                                                     LAYOUT_PROPERTY_FLAG, true);
-        }
-        else
-            dataGroupProperties.layout = value; */
-    }
 	//----------------------------------
     //  itemRenderer copied from SkinnableDataContainer
     //----------------------------------


[royale-asjs] 02/02: Spark HelloWorld

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

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

commit 88ac815e22413e5c7b72587120b84dc8b5fb22c2
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Nov 7 17:48:27 2018 -0800

    Spark HelloWorld
---
 .../SparkHelloWorld/SparkHelloWorld.as3proj        | 98 ++++++++++++++++++++++
 examples/mxroyale/SparkHelloWorld/build.xml        | 54 ++++++++++++
 examples/mxroyale/SparkHelloWorld/pom.xml          | 67 +++++++++++++++
 .../src/main/royale/HelloWorld.mxml                | 39 +++++++++
 4 files changed, 258 insertions(+)

diff --git a/examples/mxroyale/SparkHelloWorld/SparkHelloWorld.as3proj b/examples/mxroyale/SparkHelloWorld/SparkHelloWorld.as3proj
new file mode 100644
index 0000000..95f75bd
--- /dev/null
+++ b/examples/mxroyale/SparkHelloWorld/SparkHelloWorld.as3proj
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<project>
+  <output>
+    <movie path="bin-debug/HelloWorld.swf"/>
+    <movie width="800"/>
+    <movie fps="60"/>
+    <movie height="600"/>
+    <movie platform="Flash Player"/>
+    <movie version="11"/>
+    <movie disabled="False"/>
+    <movie background="#FFFFFF"/>
+    <movie input=""/>
+  </output>
+  &lt;!-- Other classes to be compiled into your SWF --&gt;
+  <classpaths>
+    <class path="src/main/royale"/>
+  </classpaths>
+  <moonshineResourcePaths></moonshineResourcePaths>
+  <moonshineNativeExtensionPaths></moonshineNativeExtensionPaths>
+  <build>
+    <option optimize="False"/>
+    <option showActionScriptWarnings="True"/>
+    <option staticLinkRSL="False"/>
+    <option locale=""/>
+    <option showBindingWarnings="True"/>
+    <option compilerConstants=""/>
+    <option showDeprecationWarnings="True"/>
+    <option antBuildPath="build/build.xml"/>
+    <option additional="-theme=${royalelib}/themes/Basic/src/basic.css"/>
+    <option showUnusedTypeSelectorWarnings="True"/>
+    <option customSDK=""/>
+    <option strict="True"/>
+    <option accessible="False"/>
+    <option useNetwork="True"/>
+    <option allowSourcePathOverlap="False"/>
+    <option useResourceBundleMetadata="True"/>
+    <option benchmark="False"/>
+    <option warnings="True"/>
+    <option es="False"/>
+    <option verboseStackTraces="False"/>
+    <option loadConfig=""/>
+    <option linkReport=""/>
+  </build>
+  <includeLibraries></includeLibraries>
+  <libraryPaths></libraryPaths>
+  <externalLibraryPaths></externalLibraryPaths>
+  <rslPaths></rslPaths>
+  <intrinsics>
+    <element path="Library/AS3/frameworks/Flex4"/>
+    <element path="Library\AS3\frameworks\Flex4"/>
+  </intrinsics>
+  <library></library>
+  <compileTargets>
+    <compile path="src/main/royale/HelloWorld.mxml"/>
+  </compileTargets>
+  <hiddenPaths></hiddenPaths>
+  <preBuildCommand>null</preBuildCommand>
+  <postBuildCommand alwaysRun="False">null</postBuildCommand>
+  <trustSVNCertificate>False</trustSVNCertificate>
+  <options>
+    <option isExportedToExistingSource="False"/>
+    <option isPrimeFacesVisualEditor="False"/>
+    <option visualEditorExportPath=""/>
+    <option showHiddenPaths="False"/>
+    <option testMovie=""/>
+    <option testMovieCommand=""/>
+    <option defaultBuildTargets=""/>
+  </options>
+  <moonshineRunCustomization>
+    <option launchMethod="Simulator"/>
+    <option targetPlatform="2"/>
+    <option urlToLaunch=""/>
+    <option projectType="2"/>
+    <option deviceSimulator="null"/>
+    <deviceSimulator>null</deviceSimulator>
+    <certAndroid>null</certAndroid>
+    <certIos>null</certIos>
+    <certIosProvisioning>null</certIosProvisioning>
+  </moonshineRunCustomization>
+</project>
\ No newline at end of file
diff --git a/examples/mxroyale/SparkHelloWorld/build.xml b/examples/mxroyale/SparkHelloWorld/build.xml
new file mode 100644
index 0000000..7f030ee
--- /dev/null
+++ b/examples/mxroyale/SparkHelloWorld/build.xml
@@ -0,0 +1,54 @@
+<?xml version="1.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.
+
+-->
+
+
+<project name="sparkhelloworld" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../.."/>
+    <property name="example" value="HelloWorld" />
+    
+    <property file="${ROYALE_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${ROYALE_HOME}/build.properties"/>
+    <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+
+    <include file="${basedir}/../../build_example.xml" />
+    
+    <target name="main" depends="clean,build_example.compile" description="Clean build of ${example}">
+    </target>
+    
+    <target name="clean">
+        <delete dir="${basedir}/bin" failonerror="false" />
+        <delete dir="${basedir}/bin-debug" failonerror="false" />
+        <delete dir="${basedir}/bin-release" failonerror="false" />
+        <delete dir="${basedir}/target" failonerror="false" />
+    </target>
+
+    <target name="examine" depends="build_example.get.browser">
+        <property name="which" value="debug" />
+        <echo message="Make sure label appears."/>
+        <exec executable="${browser}" dir="${basedir}/bin-${which}" failonerror="true">
+            <arg value="${basedir}/bin-${which}/${example}.html"/>
+        </exec>
+        <exec executable="${browser}" dir="${basedir}/bin/js-${which}" failonerror="true">
+            <arg value="${basedir}/bin/js-${which}/index.html"/>
+        </exec>
+    </target>
+
+</project>
diff --git a/examples/mxroyale/SparkHelloWorld/pom.xml b/examples/mxroyale/SparkHelloWorld/pom.xml
new file mode 100644
index 0000000..a560a4d
--- /dev/null
+++ b/examples/mxroyale/SparkHelloWorld/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<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>
+
+  <parent>
+    <groupId>org.apache.royale.examples</groupId>
+    <artifactId>examples-mxroyale</artifactId>
+    <version>0.9.5-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>HelloWorld-SparkRoyale</artifactId>
+  <version>0.9.5-SNAPSHOT</version>
+  <packaging>swf</packaging>
+
+  <name>Apache Royale: Examples: SparkRoyale: HelloWorld</name>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.royale.compiler</groupId>
+        <artifactId>royale-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <mainClass>HelloWorld.mxml</mainClass>
+          <targets>JSRoyale,SWF</targets>
+          <debug>false</debug>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.adobe.flash.framework</groupId>
+      <artifactId>playerglobal</artifactId>
+      <version>${flash.version}</version>
+      <type>swc</type>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>BasicTheme</artifactId>
+      <version>0.9.5-SNAPSHOT</version>
+      <type>swc</type>
+      <scope>theme</scope>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/examples/mxroyale/SparkHelloWorld/src/main/royale/HelloWorld.mxml b/examples/mxroyale/SparkHelloWorld/src/main/royale/HelloWorld.mxml
new file mode 100644
index 0000000..4ea4e19
--- /dev/null
+++ b/examples/mxroyale/SparkHelloWorld/src/main/royale/HelloWorld.mxml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+               xmlns:s="library://ns.apache.org/royale/spark">
+    
+    <!--<s:Panel title="BorderContainer Component Example"
+             width="75%" height="75%" 
+             horizontalCenter="0" verticalCenter="0"> -->
+        
+        <s:BorderContainer 
+            backgroundColor="red" cornerRadius="10"
+            borderStyle="inset" borderWeight="4" 
+            left="10" right="10" top="10" bottom="10">
+            <s:layout>
+                <s:HorizontalLayout 
+                    paddingLeft="5" paddingRight="5" 
+                    paddingTop="5" paddingBottom="5"/>
+            </s:layout>
+            <s:Label text="Hello World"/>
+        </s:BorderContainer> 
+    <!--</s:Panel>-->
+</s:Application>
\ No newline at end of file