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/03/22 21:30:11 UTC
[royale-asjs] branch feature/MXRoyale updated (34d0f1c -> c93a85d)
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a change to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.
from 34d0f1c Added mx:Text. Enabled more properties such as selectable. Updated ControlsExample.
new c6f6680 add $ methods so they can be overridden
new f62ec1c Flex has states and transitions out-of-the-box
new 4f2d2a1 try using addedToParent
new fdcf746 try to implement more APIs
new 10aa230 need custom context for mustella
new ecc81f5 need the right parent
new 4fc74ec need button view that doesn't require SimpleButton
new 5bcd087 fix some of the wrapping
new e1515f9 ignore 'not implemented' output
new 67efe4f try unwrapping the SWF side. Otherwise Basic views would need to be adjusted to use . Seems to work. SWF mxtests passed
new 8f01fb6 fix paths to scripts
new c93a85d handle no initialView
The 12 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:
build.xml | 6 +-
.../main/royale/org/apache/royale/core/UIBase.as | 78 +++++++++--
.../MXRoyale/src/main/resources/defaults.css | 9 +-
.../MXRoyale/src/main/royale/MXRoyaleClasses.as | 4 +
.../controls}/beads/CSSImageAndTextButtonView.as | 10 +-
.../src/main/royale/mx/core/Application.as | 40 +++---
.../MXRoyale/src/main/royale/mx/core/Container.as | 12 ++
.../MXRoyale/src/main/royale/mx/core/IChildList.as | 41 ++++--
.../main/royale/mx/core/IDisplayObjectInterface.as | 4 +-
.../src/main/royale/mx/core/IFlexDisplayObject.as | 7 +
.../src/main/royale/mx/core/UIComponent.as | 151 +++++++++------------
mustella/src/main/java/marmotinni/TestStep.java | 3 +-
.../main/java/mustella/MustellaResultsParser.java | 3 +
.../tests/mxtests/basicTests/BasicTests-config.xml | 1 +
.../{ => mxtests}/basicTests/RoyaleContext.as | 2 +-
15 files changed, 231 insertions(+), 140 deletions(-)
copy frameworks/projects/{Basic/src/main/royale/org/apache/royale/html => MXRoyale/src/main/royale/mx/controls}/beads/CSSImageAndTextButtonView.as (98%)
copy mustella/tests/{ => mxtests}/basicTests/RoyaleContext.as (95%)
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 11/12: fix paths to scripts
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 8f01fb65381e43c2a4ba090814fe99da8483362c
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 14:24:30 2018 -0700
fix paths to scripts
---
build.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/build.xml b/build.xml
index 9de51d6..61f6bc7 100644
--- a/build.xml
+++ b/build.xml
@@ -1585,9 +1585,9 @@ limitations under the License.
<echo>script=${basedir}/mustella/tests/mxTests/halo/scripts/CheckBoxTestScript.mxml</echo>
<java classname="marmotinni.MarmotinniRunner" classpath="${basedir}/mustella/target/classes" fork="true" failonerror="yes">
<!--<arg value="browser=chrome" />-->
- <arg value="url=file://${basedir}/mustella/tests/mxTests/bin/js-debug/index.html" />
- <arg value="script=${basedir}/mustella/tests/mxTests/halo/scripts/ButtonTestScript.mxml" />
- <arg value="script=${basedir}/mustella/tests/mxTests/halo/scripts/CheckBoxTestScript.mxml" />
+ <arg value="url=file://${basedir}/mustella/tests/mxTests/basicTests/bin/js-debug/index.html" />
+ <arg value="script=${basedir}/mustella/tests/mxTests/basicTests/halo/scripts/ButtonTestScript.mxml" />
+ <!--<arg value="script=${basedir}/mustella/tests/mxTests/basicTests/halo/scripts/CheckBoxTestScript.mxml" />-->
<!--<arg value="showSteps=true" />-->
<arg value="${profile_arg}" />
<classpath>
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 03/12: try using addedToParent
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 4f2d2a18934f67d0d99f3fecc2c8ba59465be024
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 12:00:39 2018 -0700
try using addedToParent
---
.../src/main/royale/mx/core/Application.as | 41 +++++++++++++---------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
index 4ebe1f6..68935af 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
@@ -84,6 +84,7 @@ import org.apache.royale.events.Event;
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.events.ValueChangeEvent;
import org.apache.royale.states.State;
+import org.apache.royale.utils.MixinManager;
import org.apache.royale.utils.MXMLDataInterpreter;
import org.apache.royale.utils.Timer;
import org.apache.royale.utils.loadBeadFromValuesManager;
@@ -351,16 +352,22 @@ public class Application extends Container implements IStrand, IParent, IEventDi
return _info;
}
+ COMPILE::SWF
+ {
+ [SWFOverride(returns="flash.display.DisplayObjectContainer")]
+ override public function get parent():IParent
+ {
+ // may not work in sub-apps
+ var p:* = root;
+ return p;
+ }
+ }
+
COMPILE::SWF
private function initHandler(event:flash.events.Event):void
{
MouseEventConverter.setupAllConverters(stage);
- for each (var bead:IBead in beads)
- addBead(bead);
-
- dispatchEvent(new org.apache.royale.events.Event("beadsAdded"));
-
if (dispatchEvent(new org.apache.royale.events.Event("preinitialize", false, true)))
this.initialize();
else
@@ -390,8 +397,12 @@ public class Application extends Container implements IStrand, IParent, IEventDi
COMPILE::SWF
override public function initialize():void
{
- MXMLDataInterpreter.generateMXMLInstances(this, instanceParent, MXMLDescriptor);
-
+ addBead(new MixinManager());
+ // the application is never added to the dom via addChild
+ // because the parent is the browser, not an IUIBase, but we
+ // need to run most of the code that usually runs when added.
+ addedToParent();
+
this.initManagers();
dispatchEvent(new org.apache.royale.events.Event("initialize"));
@@ -507,12 +518,6 @@ public class Application extends Container implements IStrand, IParent, IEventDi
COMPILE::JS
public function start():void
{
- for (var index:int in beads) {
- addBead(beads[index]);
- }
-
- dispatchEvent(new org.apache.royale.events.Event("beadsAdded"));
-
if (dispatchEvent(new org.apache.royale.events.Event("preinitialize", false, true)))
initialize();
else {
@@ -543,9 +548,13 @@ public class Application extends Container implements IStrand, IParent, IEventDi
{
var body:HTMLElement = document.getElementsByTagName('body')[0];
body.appendChild(element);
-
- MXMLDataInterpreter.generateMXMLInstances(this, instanceParent, MXMLDescriptor);
-
+
+ // the application is never added to the dom via addChild
+ // because the parent is the browser, not an IUIBase, but we
+ // need to run most of the code that usually runs when added.
+ addBead(new MixinManager());
+ addedToParent();
+
dispatchEvent('initialize');
// if (initialView)
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 07/12: need button view that doesn't require
SimpleButton
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 4fc74ec2f455e5130116b4f2728abad16afc3de4
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 12:56:09 2018 -0700
need button view that doesn't require SimpleButton
---
.../MXRoyale/src/main/resources/defaults.css | 4 +-
.../MXRoyale/src/main/royale/MXRoyaleClasses.as | 4 +
.../mx/controls/beads/CSSImageAndTextButtonView.as | 369 +++++++++++++++++++++
3 files changed, 375 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 44caa0a..43f45f4 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -38,7 +38,7 @@ global {
Button
{
- IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageAndTextModel");
+ IBeadModel: ClassReference("org.apache.royale.html.beads.models.ImageAndTextModel");
border: 0.5px solid black;
background-color: #EEEEEE;
padding: 4px 4px;
@@ -92,7 +92,7 @@ TextInput
Button
{
- IBeadView: ClassReference("org.apache.royale.html.beads.CSSImageAndTextButtonView");
+ IBeadView: ClassReference("mx.controls.beads.CSSImageAndTextButtonView");
}
Container
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index a652839..09968ff 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -31,6 +31,10 @@ internal class MXRoyaleClasses
import mx.core.Container; Container;
import mx.containers.beads.ApplicationLayout; ApplicationLayout;
import mx.containers.beads.BoxLayout; BoxLayout;
+ COMPILE::SWF
+ {
+ import mx.controls.beads.CSSImageAndTextButtonView; CSSImageAndTextButtonView;
+ }
}
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
new file mode 100644
index 0000000..7f9f969
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
@@ -0,0 +1,369 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.controls.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+ import flash.text.TextField;
+ import flash.text.TextFieldType;
+
+ import org.apache.royale.core.BeadViewBase;
+ import org.apache.royale.core.CSSTextField;
+ import org.apache.royale.core.IBeadView;
+ import org.apache.royale.core.IStrand;
+ import org.apache.royale.core.UIBase;
+ import org.apache.royale.core.ValuesManager;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+ import org.apache.royale.html.TextButton;
+ import org.apache.royale.html.beads.models.ImageAndTextModel;
+ import org.apache.royale.utils.CSSUtils;
+ import org.apache.royale.utils.SolidBorderUtil;
+ import org.apache.royale.utils.StringTrimmer;
+
+ /**
+ * The CSSTextButtonView class is the default view for
+ * the mx.core.Button class.
+ * It allows the look of the button to be expressed
+ * in CSS via the background-image style and displays
+ * a text label. This view does not support right-to-left
+ * text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class CSSImageAndTextButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function CSSImageAndTextButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upTextField.selectable = false;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.type = TextFieldType.DYNAMIC;
+ upTextField.autoSize = "left";
+ downTextField.autoSize = "left";
+ overTextField.autoSize = "left";
+ upSprite.addChild(upTextField);
+ downSprite.addChild(downTextField);
+ overSprite.addChild(overTextField);
+ }
+
+ private var textModel:ImageAndTextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.royale.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ textModel = value.getBeadByType(ImageAndTextModel) as ImageAndTextModel;
+ textModel.addEventListener("textChange", textChangeHandler);
+ textModel.addEventListener("htmlChange", htmlChangeHandler);
+ textModel.addEventListener("imageChange", imageChangeHandler);
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ upTextField.styleParent = _strand;
+ downTextField.styleParent = _strand;
+ overTextField.styleParent = _strand;
+ upTextField.parentDrawsBackground = true;
+ downTextField.parentDrawsBackground = true;
+ overTextField.parentDrawsBackground = true;
+ upTextField.parentHandlesPadding = true;
+ downTextField.parentHandlesPadding = true;
+ overTextField.parentHandlesPadding = true;
+ UIBase(value).$addChild(upSprite);
+ /* TODO switch sprites on mouse state
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+ */
+ if (textModel.text !== null)
+ text = textModel.text;
+ if (textModel.html !== null)
+ html = textModel.html;
+
+ setupSkins();
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, overTextField, "hover");
+ setupSkin(downSprite, downTextField, "active");
+ setupSkin(upSprite, upTextField);
+ updateHitArea();
+ }
+
+ private function setupSkin(sprite:Sprite, textField:TextField, state:String = null):void
+ {
+ var sw:uint = DisplayObject(_strand).width;
+ var sh:uint = DisplayObject(_strand).height;
+
+ textField.defaultTextFormat.leftMargin = 0;
+ textField.defaultTextFormat.rightMargin = 0;
+ // set it again so it gets noticed
+ textField.defaultTextFormat = textField.defaultTextFormat;
+
+ var borderColor:uint;
+ var borderThickness:uint;
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
+ if (borderStyles is Array)
+ {
+ borderColor = CSSUtils.toColor(borderStyles[2]);
+ borderStyle = borderStyles[1];
+ borderThickness = borderStyles[0];
+ }
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
+ var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
+ if (value != null)
+ borderStyle = value as String;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
+ if (value != null)
+ borderColor = CSSUtils.toColor(value);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
+ if (value != null)
+ borderThickness = value as uint;
+ if (borderStyle == "none")
+ {
+ borderStyle = "solid";
+ borderThickness = 0;
+ }
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = 2 * (value as Number);
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
+ }
+ }
+
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
+ var bgColor:uint;
+ var bgAlpha:Number = 1;
+ if (backgroundColor != null)
+ {
+ bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
+ if (bgColor & 0xFF000000)
+ {
+ bgAlpha = bgColor >>> 24 / 255;
+ bgColor = bgColor & 0xFFFFFF;
+ }
+ }
+ if (borderStyle == "solid")
+ {
+ var useWidth:Number = Math.max(sw,textField.textWidth);
+ var useHeight:Number = Math.max(sh,textField.textHeight);
+
+ if ((useWidth-pl-pr-2*borderThickness) < textField.textWidth)
+ useWidth = textField.textWidth+pl+pr+2*borderThickness;
+ if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
+ useHeight = textField.textHeight+pt+pb+2*borderThickness;
+
+ sprite.graphics.clear();
+ SolidBorderUtil.drawBorder(sprite.graphics,
+ 0, 0, useWidth, useHeight,
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
+ textField.y = ((useHeight - textField.textHeight) / 2) - 2;
+ textField.x = ((useWidth - textField.textWidth) / 2) - 2;
+ }
+ var backgroundImage:Object = image;
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ sprite.addChild(textField);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ updateHitArea();
+ loader.x = pl;
+ textField.x = loader.width + pl;
+ textField.y = pt;
+ loader.y = (textField.height + pt + pb - loader.height) / 2;
+ sprite.graphics.clear();
+ SolidBorderUtil.drawBorder(sprite.graphics,
+ 0, 0, textField.x + textField.width + pr + borderThickness,
+ textField.y + textField.height + pb + borderThickness,
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
+ });
+ }
+ var textColor:Object = ValuesManager.valuesImpl.getValue(_strand, "color", state);
+ if (textColor) {
+ textField.textColor = Number(textColor);
+ }
+ }
+
+ private function textChangeHandler(event:org.apache.royale.events.Event):void
+ {
+ text = textModel.text;
+ }
+
+ private function htmlChangeHandler(event:org.apache.royale.events.Event):void
+ {
+ html = textModel.html;
+ }
+
+ private function sizeChangeHandler(event:org.apache.royale.events.Event):void
+ {
+ setupSkins();
+ }
+
+ private var upTextField:CSSTextField;
+ private var downTextField:CSSTextField;
+ private var overTextField:CSSTextField;
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+
+ /**
+ * The URL of an icon to use in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function get image():String
+ {
+ return textModel.image;
+ }
+
+ private function imageChangeHandler(event:org.apache.royale.events.Event):void
+ {
+ setupSkins();
+ }
+
+ /**
+ * The text to be displayed in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ updateHitArea();
+ }
+
+ private function updateHitArea():void
+ {
+ var useWidth:uint = Math.max(DisplayObject(_strand).width, upTextField.textWidth);
+ var useHeight:uint = Math.max(DisplayObject(_strand).height, upTextField.textHeight);
+
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, useWidth, useHeight);
+ shape.graphics.endFill();
+
+ }
+
+ /**
+ * The html-formatted text to be displayed in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function get html():String
+ {
+ return upTextField.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ upTextField.htmlText = value;
+ downTextField.htmlText = value;
+ overTextField.htmlText = value;
+ }
+ }
+}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 08/12: fix some of the wrapping
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 5bcd0872c44320cce4e3883b43907fc878062f9e
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 14:09:57 2018 -0700
fix some of the wrapping
---
.../projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index 8c51c31..33a61f4 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -1326,7 +1326,7 @@ package org.apache.royale.core
{
COMPILE::SWF
{
- return numChildren;
+ return $numChildren;
}
COMPILE::JS
{
@@ -1586,7 +1586,7 @@ package org.apache.royale.core
COMPILE::SWF
public function $addChildAt(child:DisplayObject, index:int):DisplayObject
{
- return super.addChild(child, int);
+ return super.addChildAt(child, int);
}
COMPILE::SWF
public function $removeChildAt(index:int):DisplayObject
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 05/12: need custom context for mustella
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 10aa2300f777e8dc03854a2c4269dd204bedc6c8
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 12:02:18 2018 -0700
need custom context for mustella
---
.../tests/mxtests/basicTests/BasicTests-config.xml | 1 +
mustella/tests/mxtests/basicTests/RoyaleContext.as | 43 ++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/mustella/tests/mxtests/basicTests/BasicTests-config.xml b/mustella/tests/mxtests/basicTests/BasicTests-config.xml
index 67ece0d..eb106d1 100644
--- a/mustella/tests/mxtests/basicTests/BasicTests-config.xml
+++ b/mustella/tests/mxtests/basicTests/BasicTests-config.xml
@@ -98,5 +98,6 @@
<symbol>ExitWhenDone</symbol>
<symbol>SetShowRTE</symbol>
<symbol>SendFormattedResultsToLog</symbol>
+ <symbol>RoyaleContext</symbol>
</includes>
</flex-config>
diff --git a/mustella/tests/mxtests/basicTests/RoyaleContext.as b/mustella/tests/mxtests/basicTests/RoyaleContext.as
new file mode 100644
index 0000000..1ffce6b
--- /dev/null
+++ b/mustella/tests/mxtests/basicTests/RoyaleContext.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+[Mixin]
+public class RoyaleContext
+{
+ public function RoyaleContext()
+ {
+ super();
+ }
+
+ public static function init(o:Object):void
+ {
+ UnitTester.contextFunction = contextFunction;
+ }
+
+ public static function contextFunction():Object
+ {
+ return UnitTester._root;
+ }
+}
+
+
+}
+
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 01/12: add $ methods so they can be overridden
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit c6f6680fbce88287fd369569a24377b716d4f577
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 11:58:39 2018 -0700
add $ methods so they can be overridden
---
.../main/royale/org/apache/royale/core/UIBase.as | 70 ++++++++++++++++++----
1 file changed, 58 insertions(+), 12 deletions(-)
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index b80f377..12b0d02 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -30,8 +30,8 @@ package org.apache.royale.core
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.events.MouseEvent;
import org.apache.royale.events.ValueChangeEvent;
+ import org.apache.royale.utils.StringUtil;
import org.apache.royale.utils.loadBeadFromValuesManager;
- import org.apache.royale.utils.StringUtil;
COMPILE::JS
{
@@ -1181,13 +1181,13 @@ package org.apache.royale.core
if (c is IUIBase)
{
if (c is IRenderedObject)
- addChild(IRenderedObject(c).$displayObject);
+ $addChild(IRenderedObject(c).$displayObject);
else
- addChild(c as DisplayObject);
+ $addChild(c as DisplayObject);
IUIBase(c).addedToParent();
}
else
- addChild(c as DisplayObject);
+ $addChild(c as DisplayObject);
}
COMPILE::JS
{
@@ -1212,13 +1212,13 @@ package org.apache.royale.core
if (c is IUIBase)
{
if (c is IRenderedObject)
- addChildAt(IUIBase(c).$displayObject, index);
+ $addChildAt(IUIBase(c).$displayObject, index);
else
- addChildAt(c as DisplayObject, index);
+ $addChildAt(c as DisplayObject, index);
IUIBase(c).addedToParent();
}
else
- addChildAt(c as DisplayObject, index);
+ $addChildAt(c as DisplayObject, index);
}
COMPILE::JS
{
@@ -1246,7 +1246,7 @@ package org.apache.royale.core
{
COMPILE::SWF
{
- return getChildAt(index) as IChild;
+ return $getChildAt(index) as IChild;
}
COMPILE::JS
{
@@ -1272,9 +1272,9 @@ package org.apache.royale.core
COMPILE::SWF
{
if (c is IRenderedObject)
- return getChildIndex(IRenderedObject(c).$displayObject);
+ return $getChildIndex(IRenderedObject(c).$displayObject);
else
- return getChildIndex(c as DisplayObject);
+ return $getChildIndex(c as DisplayObject);
}
COMPILE::JS
{
@@ -1303,9 +1303,9 @@ package org.apache.royale.core
COMPILE::SWF
{
if (c is IRenderedObject)
- removeChild(IRenderedObject(c).$displayObject);
+ $removeChild(IRenderedObject(c).$displayObject);
else
- removeChild(c as DisplayObject);
+ $removeChild(c as DisplayObject);
}
COMPILE::JS
{
@@ -1576,6 +1576,52 @@ package org.apache.royale.core
return super.dispatchEvent(event);
}
}
+
+ COMPILE::SWF
+ public function $addChild(child:DisplayObject):DisplayObject
+ {
+ return super.addChild(child);
+ }
+ COMPILE::SWF
+ public function $addChildAt(child:DisplayObject, index:int):DisplayObject
+ {
+ return super.addChild(child, int);
+ }
+ COMPILE::SWF
+ public function $removeChildAt(index:int):DisplayObject
+ {
+ return super.removeChildAt(int);
+ }
+ COMPILE::SWF
+ public function $removeChild(child:DisplayObject):DisplayObject
+ {
+ return super.removeChild(child);
+ }
+ COMPILE::SWF
+ public function $getChildAt(index:int):DisplayObject
+ {
+ return super.getChildAt(int);
+ }
+ COMPILE::SWF
+ public function $setChildIndex(index:int):void
+ {
+ super.setChildIndex(int);
+ }
+ COMPILE::SWF
+ public function $getChildIndex(child:DisplayObject):int
+ {
+ return super.getChildIndex(child);
+ }
+ COMPILE::SWF
+ public function $getChildByName(name:String):DisplayObject
+ {
+ return super.getChildByName(name);
+ }
+ COMPILE::SWF
+ public function get $numChildren():int
+ {
+ return super.numChildren;
+ }
}
}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 04/12: try to implement more APIs
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit fdcf746411a9659dd67c612ff33b2897063def7a
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 12:01:04 2018 -0700
try to implement more APIs
---
.../src/main/royale/mx/core/UIComponent.as | 90 ++++++++++++----------
1 file changed, 49 insertions(+), 41 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 72ad4ad..f9002e4 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -46,14 +46,19 @@ import mx.managers.ICursorManager;
import mx.managers.IFocusManager;
import mx.managers.ISystemManager;
+import org.apache.royale.core.CallLaterBead;
+import org.apache.royale.core.IStatesImpl;
+import org.apache.royale.core.IStatesObject;
import org.apache.royale.core.TextLineMetrics;
import org.apache.royale.core.UIBase;
import org.apache.royale.core.ValuesManager;
import org.apache.royale.events.Event;
import org.apache.royale.events.KeyboardEvent;
+import org.apache.royale.events.ValueChangeEvent;
import org.apache.royale.geom.Point;
import org.apache.royale.geom.Rectangle;
import org.apache.royale.html.accessories.ToolTipBead;
+import org.apache.royale.utils.loadBeadFromValuesManager;
/*
import mx.managers.IToolTipManagerClient;
@@ -149,6 +154,7 @@ public class UIComponent extends UIBase
implements IChildList,
IFlexDisplayObject,
IInvalidating,
+ IStatesObject,
IUIComponent, IVisualElement
{
//--------------------------------------------------------------------------
@@ -1769,14 +1775,21 @@ public class UIComponent extends UIBase
*/
public function set currentState(value:String):void
{
- // TODO
- if (GOOG::DEBUG)
- trace("currentState not implemented");
-
+ var event:ValueChangeEvent = new ValueChangeEvent("currentStateChange", false, false, _currentState, value)
_currentState = value;
+ addEventListener("stateChangeComplete", stateChangeCompleteHandler);
+ dispatchEvent(event);
}
-
+ private function stateChangeCompleteHandler(event:Event):void
+ {
+ callLater(dispatchUpdateComplete);
+ }
+
+ protected function dispatchUpdateComplete():void
+ {
+ dispatchEvent(new Event("updateComplete"));
+ }
//----------------------------------
// states
//----------------------------------
@@ -1808,9 +1821,19 @@ public class UIComponent extends UIBase
public function set states(value:Array):void
{
_states = value;
- // TODO
- if (GOOG::DEBUG)
- trace("states not implemented");
+ _currentState = _states[0].name;
+
+ try {
+ loadBeadFromValuesManager(IStatesImpl, "iStatesImpl", this);
+ }
+ //TODO: Need to handle this case more gracefully
+ catch(e:Error)
+ {
+ COMPILE::SWF
+ {
+ trace(e.message);
+ }
+ }
}
//----------------------------------
@@ -2001,22 +2024,19 @@ public class UIComponent extends UIBase
/**
* @private
+ * @royaleignorecoercion mx.core.IUIComponent
*/
COMPILE::SWF
{ override }
[SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
public function addChild(child:IUIComponent):IUIComponent
{
- // TODO
- if (GOOG::DEBUG)
- trace("addChild not implemented");
-
-
- return child;
+ return addElement(child) as IUIComponent;
}
/**
* @private
+ * @royaleignorecoercion mx.core.IUIComponent
*/
COMPILE::SWF
{
@@ -2026,15 +2046,12 @@ public class UIComponent extends UIBase
public function addChildAt(child:IUIComponent,
index:int):IUIComponent
{
- // TODO
- if (GOOG::DEBUG)
- trace("addChildAt not implemented");
-
- return child;
+ return addElementAt(child, index) as IUIComponent;
}
/**
* @private
+ * @royaleignorecoercion mx.core.IUIComponent
*/
[SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
COMPILE::SWF
@@ -2043,16 +2060,13 @@ public class UIComponent extends UIBase
}
public function removeChild(child:IUIComponent):IUIComponent
{
- // TODO
- if (GOOG::DEBUG)
- trace("removeChild not implemented");
-
- return child;
+ return removeElement(child) as IUIComponent;
}
/**
* @private
+ * @royaleignorecoercion mx.core.IUIComponent
*/
[SWFOverride(returns="flash.display.DisplayObject")]
COMPILE::SWF
@@ -2061,13 +2075,10 @@ public class UIComponent extends UIBase
}
public function removeChildAt(index:int):IUIComponent
{
- // TODO
if (GOOG::DEBUG)
trace("removeChildAt not implemented");
- var child:IUIComponent = getChildAt(index);
-
- return child;
+ return null;
}
/**
@@ -2081,20 +2092,14 @@ public class UIComponent extends UIBase
}
public function getChildAt(index:int):IUIComponent
{
- COMPILE::SWF
- {
- return super.getChildAt(index) as IUIComponent;
- }
- COMPILE::JS
- {
- return getElementAt(index) as IUIComponent;
- }
+ return getElementAt(index) as IUIComponent;
}
/**
* @private
*/
- COMPILE::JS
+ COMPILE::SWF
+ { override }
public function get numChildren():int
{
return numElements;
@@ -2532,6 +2537,7 @@ public class UIComponent extends UIBase
{
}
+ private var callLaterBead:CallLaterBead;
/**
* Queues a function to be called later.
@@ -2557,9 +2563,12 @@ public class UIComponent extends UIBase
public function callLater(method:Function,
args:Array /* of Object */ = null):void
{
- if (GOOG::DEBUG)
- trace("callLater not implemented");
-
+ if (!callLaterBead)
+ {
+ callLaterBead = new CallLaterBead();
+ addBead(callLaterBead);
+ }
+ callLaterBead.callLater(method, args, this);
}
@@ -3237,7 +3246,6 @@ public class UIComponent extends UIBase
return true;
}
-
}
}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 12/12: handle no initialView
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit c93a85de5ac9d8f3e0d52700e1ba820d712215b0
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 14:24:50 2018 -0700
handle no initialView
---
mustella/src/main/java/marmotinni/TestStep.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mustella/src/main/java/marmotinni/TestStep.java b/mustella/src/main/java/marmotinni/TestStep.java
index 8d964e7..e0c07c6 100644
--- a/mustella/src/main/java/marmotinni/TestStep.java
+++ b/mustella/src/main/java/marmotinni/TestStep.java
@@ -103,7 +103,8 @@ public class TestStep {
{
sb.append("var target = document.getElementsByTagName('body')[0];");
sb.append("target = target.royale_wrapper;");
- sb.append("target = target.initialView;");
+ sb.append("if (target.initialView)");
+ sb.append(" target = target.initialView;");
if (target == null || target.length() == 0)
{
return;
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 02/12: Flex has states and transitions out-of-the-box
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit f62ec1c65b3ec76218bd7ea597e850b16087716b
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 12:00:03 2018 -0700
Flex has states and transitions out-of-the-box
---
frameworks/projects/MXRoyale/src/main/resources/defaults.css | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index f79af38..44caa0a 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -25,6 +25,11 @@
box-sizing: border-box;
}
+global {
+ IStatesImpl: ClassReference("org.apache.royale.core.StatesWithTransitionsImpl");
+ IEffectTimer: ClassReference("org.apache.royale.utils.EffectTimer");
+}
+
/* -------------------------------------------------------
* Common Platform Styles
* -------------------------------------------------------
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 06/12: need the right parent
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit ecc81f50b62fc46be661d0a54ac25ab804e10bd8
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 12:55:19 2018 -0700
need the right parent
---
.../projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as | 6 ++++++
frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as | 3 +--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index 12b0d02..8c51c31 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -21,6 +21,7 @@ package org.apache.royale.core
COMPILE::SWF
{
import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
import flash.display.Sprite;
import flash.display.Stage;
import org.apache.royale.events.utils.MouseEventConverter;
@@ -1622,6 +1623,11 @@ package org.apache.royale.core
{
return super.numChildren;
}
+ COMPILE::SWF
+ public function get $parent():DisplayObjectContainer
+ {
+ return super.parent;
+ }
}
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
index 68935af..b1cf1b4 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
@@ -357,8 +357,7 @@ public class Application extends Container implements IStrand, IParent, IEventDi
[SWFOverride(returns="flash.display.DisplayObjectContainer")]
override public function get parent():IParent
{
- // may not work in sub-apps
- var p:* = root;
+ var p:* = $parent;
return p;
}
}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 09/12: ignore 'not implemented' output
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit e1515f99c7d18bded41778710cb6bc702744b6f9
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 14:10:57 2018 -0700
ignore 'not implemented' output
---
mustella/src/main/java/mustella/MustellaResultsParser.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mustella/src/main/java/mustella/MustellaResultsParser.java b/mustella/src/main/java/mustella/MustellaResultsParser.java
index e6fcfb2..68eba90 100644
--- a/mustella/src/main/java/mustella/MustellaResultsParser.java
+++ b/mustella/src/main/java/mustella/MustellaResultsParser.java
@@ -154,6 +154,9 @@ public class MustellaResultsParser {
else if (s.startsWith("Avertissement"))
{
}
+ else if (s.contains("not implemented"))
+ {
+ }
else if (s.trim().equals(""))
{
}
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.
[royale-asjs] 10/12: try unwrapping the SWF side. Otherwise Basic
views would need to be adjusted to use . Seems to work. SWF mxtests passed
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 67efe4fff528ca71d5522db6a5252a56f1c8c2c2
Author: Alex Harui <ah...@apache.org>
AuthorDate: Thu Mar 22 14:12:03 2018 -0700
try unwrapping the SWF side. Otherwise Basic views would need to be adjusted to use . Seems to work. SWF mxtests passed
---
.../MXRoyale/src/main/royale/mx/core/Container.as | 12 +++++
.../MXRoyale/src/main/royale/mx/core/IChildList.as | 41 +++++++++++----
.../main/royale/mx/core/IDisplayObjectInterface.as | 4 +-
.../src/main/royale/mx/core/IFlexDisplayObject.as | 7 +++
.../src/main/royale/mx/core/UIComponent.as | 61 +++++-----------------
5 files changed, 66 insertions(+), 59 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
index 5565ac5..feca242 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -77,6 +77,10 @@ import mx.events.ChildExistenceChangedEvent;
*/
import mx.events.FlexEvent;
import mx.events.IndexChangedEvent;
+COMPILE::SWF
+{
+import flash.display.DisplayObject;
+}
/*
import mx.events.ScrollEvent;
@@ -853,6 +857,14 @@ public class Container extends UIComponent
return contentView.getElementAt(index);
}
+ COMPILE::SWF
+ override public function getChildAt(index:int):DisplayObject
+ {
+ var layoutHost:ILayoutHost = view as ILayoutHost;
+ var contentView:IParent = layoutHost.contentView as IParent;
+ return contentView.getElementAt(index) as DisplayObject;
+ }
+
/*
* IStrandPrivate
*
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as
index 0801f18..1f12495 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as
@@ -20,7 +20,10 @@
package mx.core
{
-import org.apache.royale.geom.Point;
+COMPILE::SWF
+{
+ import flash.display.DisplayObject;
+}
/**
* The IChildList interface defines the properties and methods
@@ -109,8 +112,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
+ COMPILE::JS
function addChild(child:IUIComponent):IUIComponent;
+ COMPILE::SWF
+ function addChild(child:DisplayObject):DisplayObject;
/**
* Adds a child DisplayObject to this child list at the index specified.
@@ -133,8 +138,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")]
+ COMPILE::JS
function addChildAt(child:IUIComponent, index:int):IUIComponent;
+ COMPILE::SWF
+ function addChildAt(child:DisplayObject, index:int):DisplayObject;
/**
* Removes the specified child DisplayObject from this child list.
@@ -155,8 +162,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
+ COMPILE::JS
function removeChild(child:IUIComponent):IUIComponent;
+ COMPILE::SWF
+ function removeChild(child:DisplayObject):DisplayObject;
/**
* Removes the child DisplayObject at the specified index
@@ -177,8 +186,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.display.DisplayObject")]
+ COMPILE::JS
function removeChildAt(index:int):IUIComponent;
+ COMPILE::SWF
+ function removeChildAt(index:int):DisplayObject;
/**
* Gets the child DisplayObject at the specified index in this child list.
@@ -193,8 +204,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.display.DisplayObject")]
+ COMPILE::JS
function getChildAt(index:int):IUIComponent;
+ COMPILE::SWF
+ function getChildAt(index:int):DisplayObject;
/**
* Gets the child DisplayObject with the specified name
@@ -209,8 +222,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.display.DisplayObject")]
+ COMPILE::JS
function getChildByName(name:String):IUIComponent;
+ COMPILE::SWF
+ function getChildByName(name:String):DisplayObject;
/**
* Gets the index of a specific child in this child list.
@@ -254,8 +269,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
+ COMPILE::JS
function getChildIndex(child:IUIComponent):int;
+ COMPILE::SWF
+ function getChildIndex(child:DisplayObject):int;
/**
* Changes the index of a particular child in this child list.
@@ -272,8 +289,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")]
+ COMPILE::JS
function setChildIndex(child:IUIComponent, newIndex:int):void;
+ COMPILE::SWF
+ function setChildIndex(child:DisplayObject, newIndex:int):void;
/**
* Determines if a DisplayObject is in this child list,
@@ -290,8 +309,10 @@ public interface IChildList
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
+ COMPILE::JS
function contains(child:IUIComponent):Boolean;
+ COMPILE::SWF
+ function contains(child:DisplayObject):Boolean;
}
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as
index c338f0d..abb957a 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as
@@ -170,7 +170,7 @@
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")]
+ COMPILE::JS
function globalToLocal(point:Point):Point;
/**
@@ -181,6 +181,6 @@
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")]
+ COMPILE::JS
function localToGlobal(point:Point):Point;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as
index a6ff897..0ca3f86 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as
@@ -23,7 +23,14 @@ package mx.core
import org.apache.royale.core.IParent;
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.geom.Rectangle;
+COMPILE::JS
+{
import org.apache.royale.geom.Point;
+}
+COMPILE::SWF
+{
+import flash.geom.Point;
+}
/**
* The IFlexDisplayObject interface defines the interface for skin elements.
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 f9002e4..3e41a81 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -59,6 +59,7 @@ import org.apache.royale.geom.Point;
import org.apache.royale.geom.Rectangle;
import org.apache.royale.html.accessories.ToolTipBead;
import org.apache.royale.utils.loadBeadFromValuesManager;
+import org.apache.royale.utils.PointUtils;
/*
import mx.managers.IToolTipManagerClient;
@@ -2026,9 +2027,7 @@ public class UIComponent extends UIBase
* @private
* @royaleignorecoercion mx.core.IUIComponent
*/
- COMPILE::SWF
- { override }
- [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
+ COMPILE::JS
public function addChild(child:IUIComponent):IUIComponent
{
return addElement(child) as IUIComponent;
@@ -2038,11 +2037,7 @@ public class UIComponent extends UIBase
* @private
* @royaleignorecoercion mx.core.IUIComponent
*/
- COMPILE::SWF
- {
- override
- }
- [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")]
+ COMPILE::JS
public function addChildAt(child:IUIComponent,
index:int):IUIComponent
{
@@ -2053,11 +2048,7 @@ public class UIComponent extends UIBase
* @private
* @royaleignorecoercion mx.core.IUIComponent
*/
- [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
- COMPILE::SWF
- {
- override
- }
+ COMPILE::JS
public function removeChild(child:IUIComponent):IUIComponent
{
return removeElement(child) as IUIComponent;
@@ -2068,11 +2059,7 @@ public class UIComponent extends UIBase
* @private
* @royaleignorecoercion mx.core.IUIComponent
*/
- [SWFOverride(returns="flash.display.DisplayObject")]
- COMPILE::SWF
- {
- override
- }
+ COMPILE::JS
public function removeChildAt(index:int):IUIComponent
{
if (GOOG::DEBUG)
@@ -2085,11 +2072,7 @@ public class UIComponent extends UIBase
* @private
* @royaleignorecoercion mx.core.IUIComponent
*/
- [SWFOverride(returns="flash.display.DisplayObject")]
- COMPILE::SWF
- {
- override
- }
+ COMPILE::JS
public function getChildAt(index:int):IUIComponent
{
return getElementAt(index) as IUIComponent;
@@ -2108,9 +2091,7 @@ public class UIComponent extends UIBase
/**
* @private
*/
- [SWFOverride(params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")]
- COMPILE::SWF
- { override }
+ COMPILE::JS
public function setChildIndex(child:IUIComponent, index:int):void
{
if (GOOG::DEBUG)
@@ -2120,9 +2101,7 @@ public class UIComponent extends UIBase
/**
* @private
*/
- [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
- COMPILE::SWF
- { override }
+ COMPILE::JS
public function getChildIndex(child:IUIComponent):int
{
return getElementIndex(child);
@@ -2131,9 +2110,7 @@ public class UIComponent extends UIBase
/**
* @private
*/
- [SWFOverride(returns="flash.display.DisplayObject")]
- COMPILE::SWF
- { override }
+ COMPILE::JS
public function getChildByName(name:String):IUIComponent
{
if (GOOG::DEBUG)
@@ -2144,9 +2121,7 @@ public class UIComponent extends UIBase
/**
* @private
*/
- [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")]
- COMPILE::SWF
- { override }
+ COMPILE::JS
public function contains(child:IUIComponent):Boolean
{
if (GOOG::DEBUG)
@@ -2425,14 +2400,10 @@ public class UIComponent extends UIBase
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- COMPILE::SWF
- { override }
- [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")]
+ COMPILE::JS
public function localToGlobal(value:Point):Point
{
- if (GOOG::DEBUG)
- trace("localToGlobal not implemented");
- return value;
+ return PointUtils.localToGlobal(value, this);
}
/**
@@ -2443,14 +2414,10 @@ public class UIComponent extends UIBase
* @playerversion AIR 1.1
* @productversion Flex 3
*/
- COMPILE::SWF
- { override }
- [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")]
+ COMPILE::JS
public function globalToLocal(value:Point):Point
{
- if (GOOG::DEBUG)
- trace("globalToLocal not implemented");
- return value;
+ return PointUtils.globalToLocal(value, this);
}
/**
--
To stop receiving notification emails like this one, please contact
aharui@apache.org.