royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yish...@apache.org
Subject [royale-asjs] 01/03: Make GraphicContainer mxml enabled. Still half-baked.
Date Thu, 11 Jan 2018 08:22:43 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 31c93e06c914855b8bff1203f1755f7234931494
Author: DESKTOP-RH4S838\Yishay <yishayjobs@hotmail.com>
AuthorDate: Wed Jan 10 17:10:28 2018 +0200

    Make GraphicContainer mxml enabled. Still half-baked.
---
 .../org/apache/royale/svg/GraphicContainer.as      | 76 ++++++++++++++++++----
 1 file changed, 62 insertions(+), 14 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/GraphicContainer.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/GraphicContainer.as
index 2864f70..12b768b 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/GraphicContainer.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/svg/GraphicContainer.as
@@ -19,9 +19,11 @@ package org.apache.royale.svg
 {
     import org.apache.royale.core.GroupBase;
     import org.apache.royale.core.IChild;
+    import org.apache.royale.core.IMXMLDocument;
     import org.apache.royale.core.IRoyaleElement;
     import org.apache.royale.core.ITransformHost;
-	import org.apache.royale.events.ValueEvent;
+    import org.apache.royale.events.ValueEvent;
+    import org.apache.royale.utils.MXMLDataInterpreter;
 
 	COMPILE::JS
 	{
@@ -30,22 +32,16 @@ package org.apache.royale.svg
 		import org.apache.royale.events.Event;
 	}
 
+	/**
+	 * The default property uses when additional MXML content appears within an element's
+	 * definition in an MXML file.
+	 */
 	[DefaultProperty("mxmlContent")]
-
-	COMPILE::SWF
-    public class GraphicContainer extends GroupBase implements ITransformHost
-    {
-        public function GraphicContainer()
-        {
-            super();
-        }
-
-    }
-
-	COMPILE::JS
-	public class GraphicContainer extends GroupBase implements ITransformHost
+	public class GraphicContainer extends GroupBase implements ITransformHost, IMXMLDocument
 	{
 		private var graphicGroup:GroupBase;
+		private var _mxmlDescriptor:Array;
+		private var _mxmlDocument:Object = this;
 
 		public function GraphicContainer()
 		{
@@ -55,6 +51,7 @@ package org.apache.royale.svg
 		/**
 		 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 		 */
+		COMPILE::JS
 		override protected function createElement():org.apache.royale.core.WrappedHTMLElement
 		{
 			element = document.createElementNS('http://www.w3.org/2000/svg', 'svg') as org.apache.royale.core.WrappedHTMLElement;
@@ -75,6 +72,7 @@ package org.apache.royale.svg
 			element.setAttribute('class', value);
 		}
 
+		COMPILE::JS
 		override public function get transformElement():org.apache.royale.core.WrappedHTMLElement
 		{
 			return graphicGroup.element;
@@ -88,6 +86,7 @@ package org.apache.royale.svg
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
 		 */
+		COMPILE::JS
 		override public function getElementAt(index:int):IChild
 		{
 			return graphicGroup.getElementAt(index);
@@ -101,6 +100,7 @@ package org.apache.royale.svg
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
 		 */
+		COMPILE::JS
 		override public function addElement(c:IChild, dispatchEvent:Boolean = true):void
 		{
 			graphicGroup.addElement(c, dispatchEvent);
@@ -116,6 +116,7 @@ package org.apache.royale.svg
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
 		 */
+		COMPILE::JS
 		override public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean = true):void
 		{
 			graphicGroup.addElementAt(c, index, dispatchEvent);
@@ -131,6 +132,7 @@ package org.apache.royale.svg
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
 		 */
+		COMPILE::JS
 		override public function removeElement(c:IChild, dispatchEvent:Boolean = true):void
 		{
 			graphicGroup.removeElement(c, dispatchEvent);
@@ -146,6 +148,7 @@ package org.apache.royale.svg
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
 		 */
+		COMPILE::JS
 		override public function getElementIndex(c:IChild):int
 		{
 			return graphicGroup.getElementIndex(c);
@@ -160,6 +163,7 @@ package org.apache.royale.svg
 		 *  @playerversion AIR 2.6
 		 *  @productversion Royale 0.0
 		 */
+		COMPILE::JS
 		override public function get numElements():int
 		{
 			return graphicGroup.numElements;
@@ -181,6 +185,50 @@ package org.apache.royale.svg
 			element.setAttribute("y", value);
         }
 
+		/**
+		 *  @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.9
+		 */
+		public function generateMXMLAttributes(data:Array):void
+		{
+			MXMLDataInterpreter.generateMXMLProperties(this, data);
+		}
+		
+		/**
+		 *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 */
+		public var mxmlContent:Array;
 	}
 }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <commits@royale.apache.org>.

Mime
View raw message