You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/06/04 06:49:04 UTC
[GitHub] alinakazi closed pull request #235: Added ViewStack,
rpc.remoting & rpc.http
alinakazi closed pull request #235: Added ViewStack, rpc.remoting & rpc.http
URL: https://github.com/apache/royale-asjs/pull/235
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index 93f47e171..a8b84fcf0 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -48,10 +48,12 @@
<component id="VBox" class="mx.containers.VBox" />
<component id="VDividedBox" class="mx.containers.VDividedBox" />
<component id="Panel" class="mx.containers.Panel" />
- <!--<component id="ViewStack" class="mx.containers.ViewStack" /> waiting for commit -->
+ <component id="ViewStack" class="mx.containers.ViewStack" />
<component id="ApplicationLayout" class="mx.containers.beads.ApplicationLayout" />
<component id="BoxLayout" class="mx.containers.beads.BoxLayout" />
<component id="CanvasLayout" class="mx.containers.beads.CanvasLayout" />
+ <component id="RemoteObject" class="mx.rpc.remoting.mxml.RemoteObject" lookupOnly="true"/>
+ <component id="HTTPService" class="mx.rpc.http.mxml.HTTPService" lookupOnly="true"/>
<component id="NumberValidator" class="mx.validators.NumberValidator"/>
<component id="PhoneNumberValidator" class="mx.validators.PhoneNumberValidator"/>
<component id="DateValidator" class="mx.validators.DateValidator"/>
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 492a5bfd6..fddda2761 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -66,6 +66,8 @@ internal class MXRoyaleClasses
import mx.core.ClassFactory; ClassFactory;
import mx.effects.Tween; Tween;
import mx.system.ApplicationDomain; ApplicationDomain;
+ import mx.rpc.remoting.RemoteObject; mx.rpc.remoting.RemoteObject;
+ import mx.rpc.http.HTTPService; mx.rpc.http.HTTPService;
import mx.controls.treeClasses.ITreeDataDescriptor; ITreeDataDescriptor;
import mx.controls.treeClasses.TreeListData; TreeListData;
import mx.charts.chartClasses.RenderData; RenderData;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
new file mode 100644
index 000000000..21dc3a0c6
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ViewStack.as
@@ -0,0 +1,520 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.containers
+{
+ COMPILE::JS {
+ import goog.DEBUG;
+ }
+ import org.apache.royale.events.Event;
+ import mx.core.Container;
+ import mx.core.IUIComponent;
+ import mx.core.UIComponent;
+/*
+import flash.display.DisplayObject;
+import flash.events.Event;
+
+import mx.automation.IAutomationObject;
+import mx.core.Container;
+import mx.core.ContainerCreationPolicy;
+import mx.core.EdgeMetrics;
+import mx.core.IInvalidating;
+import mx.core.INavigatorContent;
+import mx.core.ISelectableList;
+import mx.core.IUIComponent;
+import mx.core.ScrollPolicy;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.effects.Effect;
+import mx.effects.EffectManager;
+import mx.events.ChildExistenceChangedEvent;
+import mx.events.CollectionEvent;
+import mx.events.CollectionEventKind;
+import mx.events.EffectEvent;
+import mx.events.FlexEvent;
+import mx.events.IndexChangedEvent;
+import mx.events.PropertyChangeEvent;
+import mx.geom.RoundedRectangle;
+import mx.managers.HistoryManager;
+import mx.managers.IHistoryManagerClient;
+
+use namespace mx_internal;
+*/
+//--------------------------------------
+// Events
+//--------------------------------------
+
+/**
+ * Dispatched when the selected child container changes.
+ *
+ * @eventType mx.events.IndexChangedEvent.CHANGE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+//[Event(name="change", type="mx.events.IndexChangedEvent")]
+
+//--------------------------------------
+// Styles
+//--------------------------------------
+
+//include "../styles/metadata/GapStyles.as"
+
+/**
+ * Number of pixels between the container's bottom border and its content area.
+ * The default value is 0.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+//[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ * Number of pixels between the container's top border and its content area.
+ * The default value is 0.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
+
+//--------------------------------------
+// Excluded APIs
+//--------------------------------------
+/*
+[Exclude(name="autoLayout", kind="property")]
+[Exclude(name="defaultButton", kind="property")]
+[Exclude(name="horizontalLineScrollSize", kind="property")]
+[Exclude(name="horizontalPageScrollSize", kind="property")]
+[Exclude(name="horizontalScrollBar", kind="property")]
+[Exclude(name="horizontalScrollPolicy", kind="property")]
+[Exclude(name="horizontalScrollPosition", kind="property")]
+[Exclude(name="maxHorizontalScrollPosition", kind="property")]
+[Exclude(name="maxVerticalScrollPosition", kind="property")]
+[Exclude(name="verticalLineScrollSize", kind="property")]
+[Exclude(name="verticalPageScrollSize", kind="property")]
+[Exclude(name="verticalScrollBar", kind="property")]
+[Exclude(name="verticalScrollPolicy", kind="property")]
+[Exclude(name="verticalScrollPosition", kind="property")]
+
+[Exclude(name="focusIn", kind="event")]
+[Exclude(name="focusOut", kind="event")]
+[Exclude(name="scroll", kind="event")]
+
+[Exclude(name="focusBlendMode", kind="style")]
+[Exclude(name="focusSkin", kind="style")]
+[Exclude(name="focusThickness", kind="style")]
+[Exclude(name="horizontalScrollBarStyleName", kind="style")]
+[Exclude(name="verticalScrollBarStyleName", kind="style")]
+
+[Exclude(name="focusInEffect", kind="effect")]
+[Exclude(name="focusOutEffect", kind="effect")]
+*/
+//--------------------------------------
+// Other metadata
+//--------------------------------------
+
+//[IconFile("ViewStack.png")]
+
+/**
+ * An MX ViewStack navigator container consists of a collection of child
+ * containers stacked on top of each other, where only one child
+ * at a time is visible.
+ * When a different child container is selected, it seems to replace
+ * the old one because it appears in the same location.
+ * However, the old child container still exists; it is just invisible.
+ *
+ * <p><b>Note:</b> The direct children of an MX navigator container must be
+ * MX containers, either MX layout or MX navigator containers,
+ * or the Spark NavigatorContent container.
+ * You cannot directly nest a control or a Spark container
+ * other than the Spark NavigatorContent container within a navigator;
+ * they must be children of an child MX container.</p>
+ *
+ * <p>A ViewStack container does not provide a user interface
+ * for selecting which child container is currently visible.
+ * Typically, you set its <code>selectedIndex</code> or
+ * <code>selectedChild</code> property in ActionScript in response to
+ * some user action.
+ * Alternately, you can associate an MX LinkBar, TabBar, ButtonBar, or ToggleButtonBar
+ * control or a Spark ButtonBar control with a ViewStack container to provide a navigation interface.
+ * To do so, specify the ViewStack container as the value of the
+ * <code>dataProvider</code> property of the LinkBar, TabBar or
+ * ToggleButtonBar container.</p>
+ *
+ * <p>You might decide to use a more complex navigator container than the
+ * ViewStack container, such as a TabNavigator container or Accordion
+ * container. In addition to having a collection of child containers,
+ * these containers provide their own user interface controls
+ * for navigating between their children.</p>
+ *
+ * <p>When you change the currently visible child container,
+ * you can use the <code>hideEffect</code> property of the container being
+ * hidden and the <code>showEffect</code> property of the newly visible child
+ * container to apply an effect to the child containers.
+ * The ViewStack container waits for the <code>hideEffect</code> of the child
+ * container being hidden to complete before it reveals the new child
+ * container.
+ * You can interrupt a currently playing effect if you change the
+ * <code>selectedIndex</code> property of the ViewStack container
+ * while an effect is playing.</p>
+ *
+ * <p>The ViewStack container has the following default sizing characteristics:</p>
+ * <table class="innertable">
+ * <tr>
+ * <th>Characteristic</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>Default size</td>
+ * <td>The width and height of the initial active child.</td>
+ * </tr>
+ * <tr>
+ * <td>Container resizing rules</td>
+ * <td>By default, ViewStack containers are sized only once to fit the size of the
+ * first child container. They do not resize when you navigate to other child
+ * containers. To force ViewStack containers to resize when you navigate
+ * to a different child container, set the resizeToContent property to true.</td>
+ * </tr>
+ * <tr>
+ * <td>Child sizing rules</td>
+ * <td>Children are sized to their default size. If the child is larger than the ViewStack
+ * container, it is clipped. If the child is smaller than the ViewStack container,
+ * it is aligned to the upper-left corner of the ViewStack container.</td>
+ * </tr>
+ * <tr>
+ * <td>Default padding</td>
+ * <td>0 pixels for top, bottom, left, and right values.</td>
+ * </tr>
+ * </table>
+ *
+ * @mxml
+ *
+ * <p>The <code><mx:ViewStack></code> tag inherits the
+ * tag attributes of its superclass, with the exception of scrolling-related
+ * attributes, and adds the following tag attributes:</p>
+ *
+ * <pre>
+ * <mx:ViewStack
+ * <b>Properties</b>
+ * historyManagementEnabled="false|true"
+ * resizeToContent="false|true"
+ * selectedIndex="0"
+ *
+ * <b>Styles</b>
+ * horizontalGap="8"
+ * paddingBottom="0"
+ * paddingTop="0"
+ * verticalGap="6"
+ *
+ * <b>Events</b>
+ * change="<i>No default</i>"
+ * >
+ * ...
+ * <i>child tags</i>
+ * ...
+ * </mx:ViewStack>
+ * </pre>
+ *
+ * @includeExample examples/ViewStackExample.mxml
+ *
+ * @see mx.controls.LinkBar
+ * @see mx.controls.ButtonBar
+ * @see mx.controls.TabBar
+ * @see mx.controls.ToggleButtonBar
+ * @see spark.components.ButtonBar
+ * @see mx.managers.HistoryManager
+ * @see mx.managers.LayoutManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class ViewStack extends Container //implements IHistoryManagerClient, ISelectableList
+{
+ //include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function ViewStack()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ //private var needToInstantiateSelectedChild:Boolean = false;
+
+ /**
+ * @private
+ * This flag gets set when selectedIndex is set.
+ * Later, when measure()
+ * is called, it causes the HistoryManager to save the state.
+ */
+ //private var bSaveState:Boolean = false;
+
+ /**
+ * @private
+ * This flag gets set by loadState().
+ * It prevents the newly restored state from being saved.
+ */
+ //private var bInLoadState:Boolean = false;
+
+ /**
+ * @private
+ * True until commitProperties has been called at least once.
+ */
+ //private var firstTime:Boolean = true;
+
+ /**
+ * @private
+ * We'll measure ourselves once and then store the results here
+ * for the lifetime of the ViewStack
+ */
+ /*
+ mx_internal var vsMinWidth:Number;
+ mx_internal var vsMinHeight:Number;
+ mx_internal var vsPreferredWidth:Number;
+ mx_internal var vsPreferredHeight:Number;
+ */
+ /**
+ * @private
+ * Remember which child has an overlay mask, if any.
+ * Used for the dissolve effect.
+ */
+ //private var effectOverlayChild:UIComponent;
+
+ /**
+ * @private
+ * Keep track of the overlay's targetArea
+ * Used for the dissolve effect.
+ */
+ //private var effectOverlayTargetArea:RoundedRectangle;
+
+ /**
+ * @private
+ * Store the last selectedIndex
+ */
+ //private var lastIndex:int = -1;
+
+ /**
+ * @private
+ * Whether a change event has to be dispatched in commitProperties()
+ */
+ //private var dispatchChangeEventPending:Boolean = false;
+
+ /**
+ * @private
+ * If we're in the middle of adding a child
+ */
+ private var addingChildren:Boolean = false;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // selectedChild
+ //----------------------------------
+
+ [Bindable("valueCommit")]
+ [Bindable("creationComplete")]
+
+ /**
+ * A reference to the currently visible child container.
+ * The default is a reference to the first child.
+ * If there are no children, this property is <code>null</code>.
+ *
+ * <p><strong>Note:</strong> You can only set this property in an
+ * ActionScript statement, not in MXML.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get selectedChild():Object //INavigatorContent
+ {
+ if (selectedIndex == -1)
+ return null;
+
+ return null; //INavigatorContent(getChildAt(selectedIndex));
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedChild(
+ value:Object):void //INavigatorContent):void
+ {
+ var newIndex:int; //= getChildIndex(DisplayObject(value));
+
+ if (newIndex >= 0 && newIndex < numChildren)
+ selectedIndex = newIndex;
+ }
+
+ //----------------------------------
+ // selectedIndex
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the selectedIndex property.
+ */
+ private var _selectedIndex:int = -1;
+
+ /**
+ * @private
+ */
+ private var proposedSelectedIndex:int = -1;
+
+ /**
+ * @private
+ */
+ private var initialSelectedIndex:int = -1;
+
+ [Bindable("change")]
+ [Bindable("valueCommit")]
+ [Bindable("creationComplete")]
+ [Inspectable(category="General")]
+
+ /**
+ * The zero-based index of the currently visible child container.
+ * Child indexes are in the range 0, 1, 2, ..., n - 1,
+ * where <i>n</i> is the number of children.
+ * The default value is 0, corresponding to the first child.
+ * If there are no children, the value of this property is <code>-1</code>.
+ *
+ * <p><strong>Note:</strong> When you add a new child to a ViewStack
+ * container, the <code>selectedIndex</code> property is automatically
+ * adjusted, if necessary, so that the selected child remains selected.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get selectedIndex():int
+ {
+ return proposedSelectedIndex == -1 ?
+ _selectedIndex :
+ proposedSelectedIndex;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedIndex(value:int):void
+ {
+ // Bail if the index isn't changing.
+ if (value == selectedIndex)
+ return;
+
+ // ignore, probably coming from tabbar
+ if (addingChildren)
+ return;
+
+ // Propose the specified value as the new value for selectedIndex.
+ // It gets applied later when measure() calls commitSelectedIndex().
+ // The proposed value can be "out of range", because the children
+ // may not have been created yet, so the range check is handled
+ // in commitSelectedIndex(), not here. Other calls to this setter
+ // can change the proposed index before it is committed. Also,
+ // childAddHandler() proposes a value of 0 when it creates the first
+ // child, if no value has yet been proposed.
+ proposedSelectedIndex = value;
+ invalidateProperties();
+
+ // Set a flag which will cause the HistoryManager to save state
+ // the next time measure() is called.
+ //if (historyManagementEnabled && _selectedIndex != -1 && !bInLoadState)
+ // bSaveState = true;
+
+ //dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ COMPILE::JS
+ override public function addChildAt(item:IUIComponent, index:int):IUIComponent //(item:DisplayObject, index:int):DisplayObject
+ {
+ addingChildren = true;
+ //var obj:DisplayObject = super.addChildAt(item, index);
+ var obj:IUIComponent = super.addChildAt(item, index);
+ //internalDispatchEvent(CollectionEventKind.ADD, obj, index);
+ //childAddHandler(item);
+ addingChildren = false;
+ return obj;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // IList Implementation
+ // Viewstack implements IList so it can be plugged into a Spark ButtonBar
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * IList implementation of length returns numChildren
+ */
+ public function get length():int
+ {
+ return numChildren;
+ }
+
+}
+
+}
+
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 1734bff89..45238f7fa 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -128,7 +128,7 @@ use namespace mx_internal;
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
//[Event(name="childAdd", type="mx.events.ChildExistenceChangedEvent")]
@@ -148,7 +148,7 @@ use namespace mx_internal;
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
[Event(name="childIndexChange", type="mx.events.IndexChangedEvent")]
@@ -164,7 +164,7 @@ use namespace mx_internal;
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
//[Event(name="childRemove", type="mx.events.ChildExistenceChangedEvent")]
@@ -180,7 +180,7 @@ use namespace mx_internal;
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
[Event(name="dataChange", type="mx.events.FlexEvent")]
@@ -205,7 +205,7 @@ use namespace mx_internal;
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
//[Event(name="scroll", type="mx.events.ScrollEvent")]
@@ -310,7 +310,7 @@ use namespace mx_internal;
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public class Container extends UIComponent
implements IDataRenderer, IChildList,
@@ -382,7 +382,7 @@ public class Container extends UIComponent
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public function Container()
{
@@ -399,7 +399,7 @@ public class Container extends UIComponent
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public function get paddingTop():Object
{
@@ -422,7 +422,7 @@ public class Container extends UIComponent
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public function get paddingBottom():Object
{
@@ -444,7 +444,7 @@ public class Container extends UIComponent
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public function get verticalGap():Object
{
@@ -646,7 +646,7 @@ public class Container extends UIComponent
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public function get data():Object
{
@@ -716,7 +716,7 @@ public class Container extends UIComponent
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
- * @productversion Flex 3
+ * @productversion Royale 0.9.3
*/
public function get viewMetricsAndPadding():EdgeMetrics
{
@@ -973,6 +973,499 @@ public class Container extends UIComponent
{
return super.getElementAt(index);
}
+
+ //----------------------------------
+ // childDescriptors
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the childDescriptors property.
+ * This variable is initialized in the construct() method
+ * using the childDescriptors in the initObj, which is autogenerated.
+ * If this Container was not created by createComponentFromDescriptor(),
+ * its childDescriptors property is null.
+ */
+ private var _childDescriptors:Array /* of UIComponentDescriptor */;
+
+ /**
+ * Array of UIComponentDescriptor objects produced by the MXML compiler.
+ *
+ * <p>Each UIComponentDescriptor object contains the information
+ * specified in one child MXML tag of the container's MXML tag.
+ * The order of the UIComponentDescriptor objects in the Array
+ * is the same as the order of the child tags.
+ * During initialization, the child descriptors are used to create
+ * the container's child UIComponent objects and its Repeater objects,
+ * and to give them the initial property values, event handlers, effects,
+ * and so on, that were specified in MXML.</p>
+ *
+ * @see mx.core.UIComponentDescriptor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get childDescriptors():Array /* of UIComponentDescriptor */
+ {
+ return _childDescriptors;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Overridden methods: DisplayObjectContainer
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds a child DisplayObject to this Container.
+ * The child is added after other existing children,
+ * so that the first child added has index 0,
+ * the next has index 1, an so on.
+ *
+ * <p><b>Note: </b>While the <code>child</code> argument to the method
+ * is specified as of type DisplayObject, the argument must implement
+ * the IUIComponent interface to be added as a child of a container.
+ * All Flex components implement this interface.</p>
+ *
+ * <p>Children are layered from back to front.
+ * In other words, if children overlap, the one with index 0
+ * is farthest to the back, and the one with index
+ * <code>numChildren - 1</code> is frontmost.
+ * This means the newly added children are layered
+ * in front of existing children.</p>
+ *
+ * @param child The DisplayObject to add as a child of this Container.
+ * It must implement the IUIComponent interface.
+ *
+ * @return The added child as an object of type DisplayObject.
+ * You typically cast the return value to UIComponent,
+ * or to the type of the added component.
+ *
+ * @see mx.core.IUIComponent
+ *
+ * @tiptext Adds a child object to this container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ COMPILE::SWF
+ override public function addChild(child:DisplayObject):DisplayObject
+ {
+ return addChildAt(child, numChildren);
+
+ /* Application and Panel are depending on addChild calling addChildAt */
+
+ /*
+ addingChild(child);
+
+ if (contentPane)
+ contentPane.addChild(child);
+ else
+ $addChild(child);
+
+ childAdded(child);
+
+ return child;
+ */
+ }
+
+ //----------------------------------
+ // creationPolicy
+ //----------------------------------
+
+ // Internal flag used when creationPolicy="none".
+ // When set, the value of the backing store _creationPolicy
+ // style is "auto" so descendants inherit the correct value.
+ private var creationPolicyNone:Boolean = false;
+
+ [Inspectable(enumeration="all,auto,none")]
+
+ /**
+ * The child creation policy for this MX Container.
+ * ActionScript values can be <code>ContainerCreationPolicy.AUTO</code>,
+ * <code>ContainerCreationPolicy.ALL</code>,
+ * or <code>ContainerCreationPolicy.NONE</code>.
+ * MXML values can be <code>auto</code>, <code>all</code>,
+ * or <code>none</code>.
+ *
+ * <p>If no <code>creationPolicy</code> is specified for a container,
+ * that container inherits its parent's <code>creationPolicy</code>.
+ * If no <code>creationPolicy</code> is specified for the Application,
+ * it defaults to <code>ContainerCreationPolicy.AUTO</code>.</p>
+ *
+ * <p>A <code>creationPolicy</code> of <code>ContainerCreationPolicy.AUTO</code> means
+ * that the container delays creating some or all descendants
+ * until they are needed, a process which is known as <i>deferred
+ * instantiation</i>.
+ * This policy produces the best startup time because fewer
+ * UIComponents are created initially.
+ * However, this introduces navigation delays when a user navigates
+ * to other parts of the application for the first time.
+ * Navigator containers such as Accordion, TabNavigator, and ViewStack
+ * implement the <code>ContainerCreationPolicy.AUTO</code> policy by creating all their
+ * children immediately, but wait to create the deeper descendants
+ * of a child until it becomes the selected child of the navigator
+ * container.</p>
+ *
+ * <p>A <code>creationPolicy</code> of <code>ContainerCreationPolicy.ALL</code> means
+ * that the navigator containers immediately create deeper descendants
+ * for each child, rather than waiting until that child is
+ * selected. For single-view containers such as a VBox container,
+ * there is no difference between the <code>ContainerCreationPolicy.AUTO</code> and
+ * <code>ContainerCreationPolicy.ALL</code> policies.</p>
+ *
+ * <p>A <code>creationPolicy</code> of <code>ContainerCreationPolicy.NONE</code> means
+ * that the container creates none of its children.
+ * In that case, it is the responsibility of the MXML author
+ * to create the children by calling the
+ * <code>createComponentsFromDescriptors()</code> method.</p>
+ *
+ * @default ContainerCreationPolicy.AUTO
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get creationPolicy():String
+ {
+ // Use an inheriting style as the backing storage for this property.
+ // This allows the property to be inherited by either mx or spark
+ // containers, and also to correctly cascade through containers that
+ // don't have this property (ie Group).
+ // This style is an implementation detail and should be considered
+ // private. Do not set it from CSS.
+ /*if (creationPolicyNone)
+ return ContainerCreationPolicy.NONE;*/
+ return getStyle("_creationPolicy");
+ }
+
+ /**
+ * @private
+ */
+ public function set creationPolicy(value:String):void
+ {
+ var styleValue:String = value;
+
+ /*if (value == ContainerCreationPolicy.NONE)
+ {
+ // creationPolicy of none is not inherited by descendants.
+ // In this case, set the style to "auto" and set a local
+ // flag for subsequent access to the creationPolicy property.
+ creationPolicyNone = true;
+ styleValue = ContainerCreationPolicy.AUTO;
+ }
+ else
+ {
+ creationPolicyNone = false;
+ }*/
+
+ setStyle("_creationPolicy", styleValue);
+
+ //setActualCreationPolicies(value);
+ }
+
+ //----------------------------------
+ // enabled
+ //----------------------------------
+
+ [Inspectable(category="General", enumeration="true,false", defaultValue="true")]
+
+ /**
+ * @private
+ */
+ override public function set enabled(value:Boolean):void
+ {
+ super.enabled = value;
+
+ // Scrollbars must be enabled/disabled when this container is.
+ /*if (horizontalScrollBar)
+ horizontalScrollBar.enabled = value;
+ if (verticalScrollBar)
+ verticalScrollBar.enabled = value;
+
+ invalidateProperties();
+
+ if (border && border is IInvalidating)
+ IInvalidating(border).invalidateDisplayList();*/
+ }
+
+ //----------------------------------
+ // numChildren
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the numChildren property.
+ */
+ /*mx_internal*/private var _numChildren:int = 0;
+
+ /**
+ * Number of child components in this container.
+ *
+ * <p>The number of children is initially equal
+ * to the number of children declared in MXML.
+ * At runtime, new children may be added by calling
+ * <code>addChild()</code> or <code>addChildAt()</code>,
+ * and existing children may be removed by calling
+ * <code>removeChild()</code>, <code>removeChildAt()</code>,
+ * or <code>removeAllChildren()</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ override public function get numChildren():int
+ {
+ return _numChildren;//contentPane ? contentPane.numChildren : _numChildren;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function removeElementAt(index:int):IVisualElement
+ {
+ return removeChildAt(index) as IVisualElement;
+ }
+
+ /**
+ * @inheritDoc
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function removeAllElements():void
+ {
+ for (var i:int = numElements - 1; i >= 0; i--)
+ {
+ removeElementAt(i);
+ }
+ }
+
+ /**
+ * Removes a child DisplayObject from the child list of this Container
+ * at the specified index.
+ * The removed child will have its <code>parent</code>
+ * property set to null.
+ * The child will still exist unless explicitly destroyed.
+ * If you add it to another container,
+ * it will retain its last known state.
+ *
+ * @param index The child index of the DisplayObject to remove.
+ *
+ * @return The removed child as an object of type DisplayObject.
+ * You typically cast the return value to UIComponent,
+ * or to the type of the removed component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ COMPILE::SWF
+ override public function removeChildAt(index:int):DisplayObject
+ {
+ return removeChild(getChildAt(index));
+
+ /*
+
+ Shouldn't implement removeChildAt() in terms of removeChild().
+ If we change this ViewStack IList, Application, and Panel are depending on it
+
+ */
+ }
+
+ /**
+ * @private
+ */
+ override public function validateDisplayList():void
+ {
+ // trace(">>Container validateLayoutPhase " + this);
+
+ var vm:EdgeMetrics;
+ /*
+ // If autoLayout is turned off and we haven't recently created or
+ // destroyed any children, then don't do any layout
+ if (_autoLayout || forceLayout)
+ {
+ doingLayout = true;
+ super.validateDisplayList();
+ doingLayout = false;
+ }
+ else
+ {
+ // Layout borders, Panel headers, and other border chrome.
+ layoutChrome(unscaledWidth, unscaledHeight);
+ }
+
+ // Set this to block requeuing when sizing children.
+ invalidateDisplayListFlag = true;
+
+ // Based on the positions of the children, determine
+ // whether a clip mask and scrollbars are needed.
+ if (createContentPaneAndScrollbarsIfNeeded())
+ {
+ // Redo layout if scrollbars just got created or destroyed (because
+ // now we may have more or less space).
+ if (_autoLayout || forceLayout)
+ {
+ doingLayout = true;
+ super.validateDisplayList();
+ doingLayout = false;
+ }
+
+ // If a scrollbar was created, that may precipitate the need
+ // for a second scrollbar, so run it a second time.
+ createContentPaneAndScrollbarsIfNeeded();
+ }
+
+ // The relayout performed by the above calls
+ // to super.validateDisplayList() may result
+ // in new max scroll positions that are less
+ // than previously-set scroll positions.
+ // For example, when a maximally-scrolled container
+ // is resized to be larger, the new max scroll positions
+ // are reduced and the current scroll positions
+ // will be invalid unless we clamp them.
+ if (clampScrollPositions())
+ scrollChildren();
+
+ if (contentPane)
+ {
+ vm = viewMetrics;
+
+ // Set the position and size of the overlay .
+ if (effectOverlay)
+ {
+ effectOverlay.x = 0;
+ effectOverlay.y = 0;
+ effectOverlay.width = unscaledWidth;
+ effectOverlay.height = unscaledHeight;
+ }
+
+ // Set the positions and sizes of the scrollbars.
+ if (horizontalScrollBar || verticalScrollBar)
+ {
+ // Get the view metrics and remove the thickness
+ // of the scrollbars from the view metrics.
+ // We can't simply get the border metrics,
+ // because some subclass (e.g.: Window)
+ // might add to the metrics.
+ if (verticalScrollBar &&
+ verticalScrollPolicy == ScrollPolicy.ON)
+ {
+ vm.right -= verticalScrollBar.minWidth;
+ }
+ if (horizontalScrollBar &&
+ horizontalScrollPolicy == ScrollPolicy.ON)
+ {
+ vm.bottom -= horizontalScrollBar.minHeight;
+ }
+
+ if (horizontalScrollBar)
+ {
+ var w:Number = unscaledWidth - vm.left - vm.right;
+ if (verticalScrollBar)
+ w -= verticalScrollBar.minWidth;
+
+ horizontalScrollBar.setActualSize(
+ w, horizontalScrollBar.minHeight);
+
+ horizontalScrollBar.move(vm.left,
+ unscaledHeight - vm.bottom -
+ horizontalScrollBar.minHeight);
+ }
+
+ if (verticalScrollBar)
+ {
+ var h:Number = unscaledHeight - vm.top - vm.bottom;
+ if (horizontalScrollBar)
+ h -= horizontalScrollBar.minHeight;
+
+ verticalScrollBar.setActualSize(
+ verticalScrollBar.minWidth, h);
+
+ verticalScrollBar.move(unscaledWidth - vm.right -
+ verticalScrollBar.minWidth,
+ vm.top);
+ }
+
+ // Set the position of the box
+ // that covers the gap between the scroll bars.
+ if (whiteBox)
+ {
+ whiteBox.x = verticalScrollBar.x;
+ whiteBox.y = horizontalScrollBar.y;
+ }
+ }
+
+ contentPane.x = vm.left;
+ contentPane.y = vm.top;
+
+ if (focusPane)
+ {
+ focusPane.x = vm.left
+ focusPane.y = vm.top;
+ }
+
+ scrollChildren();
+ }
+
+ invalidateDisplayListFlag = false;
+
+ // that blocks UI input as well as draws an alpha overlay.
+ // Make sure the blocker is correctly positioned and sized here.
+ if (blocker)
+ {
+ vm = viewMetrics;
+
+ if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_0)
+ vm = EdgeMetrics.EMPTY;
+
+ var bgColor:Object = enabled ?
+ null :
+ getStyle("backgroundDisabledColor");
+ if (bgColor === null || isNaN(Number(bgColor)))
+ bgColor = getStyle("backgroundColor");
+
+ if (bgColor === null || isNaN(Number(bgColor)))
+ bgColor = 0xFFFFFF;
+
+ var blockerAlpha:Number = getStyle("disabledOverlayAlpha");
+
+ if (isNaN(blockerAlpha))
+ blockerAlpha = 0.6;
+
+ blocker.x = vm.left;
+ blocker.y = vm.top;
+
+ var widthToBlock:Number = unscaledWidth - (vm.left + vm.right);
+ var heightToBlock:Number = unscaledHeight - (vm.top + vm.bottom);
+
+ blocker.graphics.clear();
+ blocker.graphics.beginFill(uint(bgColor), blockerAlpha);
+ blocker.graphics.drawRect(0, 0, widthToBlock, heightToBlock);
+ blocker.graphics.endFill();
+
+ // Blocker must be in front of everything
+ rawChildren.setChildIndex(blocker, rawChildren.numChildren - 1);
+ }
+
+ // trace("<<Container internalValidateDisplayList " + this);*/
+ }
+
}
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as
new file mode 100644
index 000000000..2c26e373f
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/HTTPService.as
@@ -0,0 +1,262 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.rpc.http
+{
+
+import mx.core.mx_internal;
+//import mx.messaging.ChannelSet;
+//import mx.messaging.config.LoaderConfig;
+//import mx.messaging.events.MessageEvent;
+//import mx.messaging.messages.IMessage;
+// mx.rpc.AbstractInvoker;
+//import mx.rpc.AsyncRequest;
+import mx.rpc.AsyncToken;
+//import mx.utils.URLUtil;
+
+// namespace mx_internal;
+
+/**
+ * Dispatched when an HTTPService call returns successfully.
+ * @eventType mx.rpc.events.ResultEvent.RESULT
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+[Event(name="result", type="mx.rpc.events.ResultEvent")]
+
+/**
+ * Dispatched when an HTTPService call fails.
+ * @eventType mx.rpc.events.FaultEvent.FAULT
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+[Event(name="fault", type="mx.rpc.events.FaultEvent")]
+
+/**
+ * The invoke event is fired when an HTTPService call is invoked so long as
+ * an Error is not thrown before the Channel attempts to send the message.
+ * @eventType mx.rpc.events.InvokeEvent.INVOKE
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+[Event(name="invoke", type="mx.rpc.events.InvokeEvent")]
+
+[ResourceBundle("rpc")]
+
+/**
+ * You use the HTTPService class to represent an
+ * HTTPService object in ActionScript. When you call the HTTPService object's
+ * <code>send()</code> method, it makes an HTTP request to the
+ * specified URL, and an HTTP response is returned. Optionally, you can pass
+ * parameters to the specified URL. When you do not go through the server-based
+ * proxy service, you can use only HTTP GET or POST methods. However, when you set
+ * the useProxy property to true and you use the server-based proxy service, you
+ * can also use the HTTP HEAD, OPTIONS, TRACE, and DELETE methods.
+ *
+ * <p><b>Note:</b> Due to a software limitation, HTTPService does not generate user-friendly
+ * error messages when using GET.</p>
+ *
+ * @see mx.rpc.http.mxml.HTTPService
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+public class HTTPService //extends AbstractInvoker
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates a new HTTPService. If you expect the service to send using relative URLs you may
+ * wish to specify the <code>rootURL</code> that will be the basis for determining the full URL (one example
+ * would be <code>Application.application.url</code>).
+ *
+ * @param rootURL The URL the HTTPService should use when computing relative URLS.
+ *
+ * @param destination An HTTPService destination name in the service-config.xml file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function HTTPService(rootURL:String = null, destination:String = null)
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constants
+ //
+ //--------------------------------------------------------------------------
+
+
+ /**
+ * @private
+ * Propagate event listeners down to the operation since it is firing some of the
+ * events.
+ */
+ public function addEventListener(type:String, listener:Function,
+ useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
+ {
+ /* operation.addEventListener(type, listener, useCapture, priority, useWeakReference);
+ super.addEventListener(type, listener, useCapture, priority, useWeakReference);*/
+ }
+
+
+ /**
+ * @private
+ */
+ private var _resultFormat:String ;
+
+ [Inspectable(enumeration="object,array,xml,flashvars,text,e4x", category="General")]
+ /**
+ * Value that indicates how you want to deserialize the result
+ * returned by the HTTP call. The value for this is based on the following:
+ * <ul>
+ * <li>Whether you are returning XML or name/value pairs.</li>
+ * <li>How you want to access the results; you can access results as an object,
+ * text, or XML.</li>
+ * </ul>
+ *
+ * <p>The default value is <code>object</code>. The following values are permitted:</p>
+ * <ul>
+ * <li><code>object</code> The value returned is XML and is parsed as a tree of ActionScript
+ * objects. This is the default.</li>
+ * <li><code>array</code> The value returned is XML and is parsed as a tree of ActionScript
+ * objects however if the top level object is not an Array, a new Array is created and the result
+ * set as the first item. If makeObjectsBindable is true then the Array
+ * will be wrapped in an ArrayCollection.</li>
+ * <li><code>xml</code> The value returned is XML and is returned as literal XML in an
+ * ActionScript XMLnode object.</li>
+ * <li><code>flashvars</code> The value returned is text containing
+ * name=value pairs separated by ampersands, which
+ * is parsed into an ActionScript object.</li>
+ * <li><code>text</code> The value returned is text, and is left raw.</li>
+ * <li><code>e4x</code> The value returned is XML and is returned as literal XML
+ * in an ActionScript XML object, which can be accessed using ECMAScript for
+ * XML (E4X) expressions.</li>
+ * </ul>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get resultFormat():String
+ {
+ return _resultFormat;
+ }
+
+ /**
+ * @private
+ */
+ public function set resultFormat(value:String):void
+ {
+
+ if (value != null)
+ {
+ _resultFormat = value;
+ }
+ }
+
+ [Inspectable(defaultValue="undefined", category="General")]
+ /**
+ * Location of the service. If you specify the <code>url</code> and a non-default destination,
+ * your destination in the services-config.xml file must allow the specified URL.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ //----------------------------------
+ // url
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var _url:String;
+
+ [Inspectable(defaultValue="undefined", category="General")]
+ /**
+ * Location of the service. If you specify the <code>url</code> and a non-default destination,
+ * your destination in the services-config.xml file must allow the specified URL.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get url():String
+ {
+ return _url;
+ }
+
+ /**
+ * @private
+ */
+ public function set url(value:String):void
+ {
+ _url = value;
+ }
+
+ /**
+ * Executes an HTTPService request. The parameters are optional, but if specified should
+ * be an Object containing name-value pairs or an XML object depending on the <code>contentType</code>.
+ *
+ * @param parameters An Object containing name-value pairs or an
+ * XML object, depending on the content type for service
+ * requests.
+ *
+ * @return An object representing the asynchronous completion token. It is the same object
+ * available in the <code>result</code> or <code>fault</code> event's <code>token</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function send(parameters:Object = null):AsyncToken
+ {
+ /*if (parameters == null)
+ parameters = request;*/
+
+ return null ; //operation.sendBody(parameters);
+ }
+ }
+}
+
+
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/mxml/HTTPService.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/mxml/HTTPService.as
new file mode 100644
index 000000000..895259e1a
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/http/mxml/HTTPService.as
@@ -0,0 +1,187 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.rpc.http.mxml
+{
+
+//import flash.events.ErrorEvent;
+//import flash.events.ErrorEvent;
+
+import mx.core.mx_internal;
+//import mx.core.IMXMLObject;
+import mx.managers.CursorManager;
+//import mx.messaging.events.MessageEvent;
+//import mx.messaging.messages.IMessage;
+//import mx.messaging.messages.AsyncMessage;
+//import mx.resources.IResourceManager;
+//import mx.resources.ResourceManager;
+import mx.rpc.AsyncToken;
+//import mx.rpc.AsyncDispatcher;
+import mx.rpc.Fault;
+import mx.rpc.http.HTTPService;
+//import mx.rpc.events.AbstractEvent;
+//import mx.rpc.events.FaultEvent;
+//import mx.rpc.mxml.Concurrency;
+//import mx.rpc.mxml.IMXMLSupport;
+import mx.validators.Validator;
+
+//use namespace mx_internal;
+
+//[ResourceBundle("rpc")]
+
+/**
+ * You use the <code><mx:HTTPService></code> tag to represent an
+ * HTTPService object in an MXML file. When you call the HTTPService object's
+ * <code>send()</code> method, it makes an HTTP request to the
+ * specified URL, and an HTTP response is returned. Optionally, you can pass
+ * parameters to the specified URL. When you do not go through the server-based
+ * proxy service, you can use only HTTP GET or POST methods. However, when you set
+ * the useProxy property to true and you use the server-based proxy service, you
+ * can also use the HTTP HEAD, OPTIONS, TRACE, and DELETE methods.
+ *
+ * <p><b>Note:</b> Due to a software limitation, HTTPService does not generate
+ * user-friendly error messages when using GET.
+ * </p>
+ *
+ * @mxml
+ * <p>
+ * The <mx:HTTPService> tag accepts the following tag attributes:
+ * </p>
+ * <pre>
+ * <mx:HTTPService
+ * <b>Properties</b>
+ * concurrency="multiple|single|last"
+ * contentType="application/x-www-form-urlencoded|application/xml"
+ * destination="<i>DefaultHTTP</i>"
+ * id="<i>No default.</i>"
+ * method="GET|POST|HEAD|OPTIONS|PUT|TRACE|DELETE"
+ * resultFormat="object|array|xml|e4x|flashvars|text"
+ * showBusyCursor="false|true"
+ * makeObjectsBindable="false|true"
+ * url="<i>No default.</i>"
+ * useProxy="false|true"
+ * xmlEncode="<i>No default.</i>"
+ * xmlDecode="<i>No default.</i>"
+ *
+ * <b>Events</b>
+ * fault="<i>No default.</i>"
+ * result="<i>No default.</i>"
+ * />
+ * </pre>
+ *
+ * The <code><mx:HTTPService></code> tag can have a single <mx:request> tag under which the parameters can be specified.
+ * </p>
+ *
+ * @includeExample examples/HTTPServiceExample.mxml -noswf
+ *
+ * @see mx.rpc.http.HTTPService
+ * @see mx.validators.Validator
+ * @see mx.managers.CursorManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+public class HTTPService extends mx.rpc.http.HTTPService //implements IMXMLSupport, IMXMLObject
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Creates a new HTTPService. This constructor is usually called by the generated code of an MXML document.
+ * You usually use the mx.rpc.http.HTTPService class to create an HTTPService in ActionScript.
+ *
+ * @param rootURL The URL the HTTPService should use when computing relative URLS.
+ *
+ * @param destination An HTTPService destination name in the service-config.xml file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function HTTPService(rootURL:String = null, destination:String = null)
+ {
+ super(rootURL, destination);
+
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+ private var _method:String ;
+
+ private var _showBusyCursor:Boolean = false;
+
+ //----------------------------------
+ // method
+ //----------------------------------
+
+ [Inspectable(enumeration="GET,get,POST,post,HEAD,head,OPTIONS,options,PUT,put,TRACE,trace,DELETE,delete", defaultValue="GET", category="General")]
+ /**
+ * HTTP method for sending the request. Permitted values are <code>GET</code>, <code>POST</code>, <code>HEAD</code>,
+ * <code>OPTIONS</code>, <code>PUT</code>, <code>TRACE</code> and <code>DELETE</code>.
+ * Lowercase letters are converted to uppercase letters. The default value is <code>GET</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get method():String
+ {
+ return _method;
+ }
+ public function set method(m:String):void
+ {
+ _method = m;
+ }
+ //----------------------------------
+ // showBusyCursor
+ //----------------------------------
+
+ [Inspectable(defaultValue="false", category="General")]
+ /**
+ * If <code>true</code>, a busy cursor is displayed while a service is executing. The default
+ * value is <code>false</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get showBusyCursor():Boolean
+ {
+ return _showBusyCursor;
+ }
+
+ public function set showBusyCursor(sbc:Boolean):void
+ {
+ _showBusyCursor = sbc;
+ }
+
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/remoting/RemoteObject.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/remoting/RemoteObject.as
new file mode 100644
index 000000000..cf6a9b094
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/remoting/RemoteObject.as
@@ -0,0 +1,245 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.rpc.remoting
+{
+import org.apache.royale.events.EventDispatcher;
+/*
+import mx.core.mx_internal;
+import mx.messaging.Channel;
+import mx.messaging.ChannelSet;
+import mx.messaging.channels.AMFChannel;
+import mx.messaging.channels.SecureAMFChannel;
+import mx.rpc.AbstractOperation;
+import mx.rpc.AbstractService;
+import mx.rpc.mxml.Concurrency;
+
+use namespace mx_internal;
+*/
+/**
+ * The RemoteObject class gives you access to classes on a remote application server.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+public dynamic class RemoteObject
+ // extends AbstractService
+{
+ //-------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //-------------------------------------------------------------------------
+
+ /**
+ * Creates a new RemoteObject.
+ * @param destination [optional] Destination of the RemoteObject; should match a destination name in the services-config.xml file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function RemoteObject(destination:String = null)
+ {
+ super();
+
+ // concurrency = Concurrency.MULTIPLE;
+ makeObjectsBindable = true;
+ showBusyCursor = false;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ private var _concurrency:String;
+
+// private var _endpoint:String;
+
+// private var _source:String;
+
+ private var _makeObjectsBindable:Boolean;
+
+ private var _showBusyCursor:Boolean;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ [Inspectable(enumeration="multiple,single,last", defaultValue="multiple", category="General")]
+ /**
+ * Value that indicates how to handle multiple calls to the same service. The default
+ * value is multiple. The following values are permitted:
+ * <ul>
+ * <li>multiple - Existing requests are not cancelled, and the developer is
+ * responsible for ensuring the consistency of returned data by carefully
+ * managing the event stream. This is the default.</li>
+ * <li>single - Making only one request at a time is allowed on the method; additional requests made
+ * while a request is outstanding are immediately faulted on the client and are not sent to the server.</li>
+ * <li>last - Making a request causes the client to ignore a result or fault for any current outstanding request.
+ * Only the result or fault for the most recent request will be dispatched on the client.
+ * This may simplify event handling in the client application, but care should be taken to only use
+ * this mode when results or faults for requests may be safely ignored.</li>
+ * </ul>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get concurrency():String
+ {
+ return _concurrency;
+ }
+
+ /**
+ * @private
+ */
+ public function set concurrency(c:String):void
+ {
+ _concurrency = c;
+ }
+
+ //----------------------------------
+ // destination
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * The destination of the service. This value should match a destination
+ * entry in the services-config.xml file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get destination():String
+ {
+ return "";
+ }
+
+ public function set destination(name:String):void
+ {
+ destination = name;
+ }
+
+ //----------------------------------
+ // makeObjectsBindable
+ //----------------------------------
+
+ [Inspectable(category="General", defaultValue="true")]
+
+ /**
+ * When this value is true, anonymous objects returned are forced to bindable objects.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get makeObjectsBindable():Boolean
+ {
+ return _makeObjectsBindable;
+ }
+
+ public function set makeObjectsBindable(b:Boolean):void
+ {
+ _makeObjectsBindable = b;
+ }
+
+ //----------------------------------
+ // showBusyCursor
+ //----------------------------------
+
+ [Inspectable(defaultValue="false", category="General")]
+ /**
+ * If <code>true</code>, a busy cursor is displayed while a service is executing. The default
+ * value is <code>false</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get showBusyCursor():Boolean
+ {
+ return _showBusyCursor;
+ }
+
+ public function set showBusyCursor(sbc:Boolean):void
+ {
+ _showBusyCursor = sbc;
+ }
+
+ //----------------------------------
+ // channelSet
+ //----------------------------------
+
+ /**
+ * Provides access to the ChannelSet used by the service. The
+ * ChannelSet can be manually constructed and assigned, or it will be
+ * dynamically created to use the configured Channels for the
+ * <code>destination</code> for this service.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+ public function get channelSet():Object
+ {
+ return "";
+ }
+
+ /**
+ * @private
+ */
+ public function set channelSet(value:Object):void
+ {
+ if (channelSet != value)
+ {
+ channelSet = value;
+ }
+ }
+
+ //-------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //-------------------------------------------------------------------------
+
+ private var eventDispatcher:EventDispatcher;
+
+ public function addEventListener(type:String, listener:Function,
+ useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
+ {
+ eventDispatcher.addEventListener(type, listener, useCapture, priority);
+ }
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/remoting/mxml/RemoteObject.as b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/remoting/mxml/RemoteObject.as
new file mode 100644
index 000000000..6262c1130
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/rpc/remoting/mxml/RemoteObject.as
@@ -0,0 +1,166 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.rpc.remoting.mxml
+{
+
+import org.apache.royale.events.Event;
+import mx.rpc.remoting.RemoteObject;
+
+/*import flash.events.ErrorEvent;
+
+import mx.core.mx_internal;
+import mx.core.IMXMLObject;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.rpc.AbstractOperation;
+import mx.rpc.events.FaultEvent;
+import mx.rpc.mxml.IMXMLSupport;
+import mx.rpc.remoting.mxml.Operation;
+
+use namespace mx_internal;
+*/
+[ResourceBundle("rpc")]
+
+/**
+ * Use the <mx:RemoteObject> tag to represent an HTTPService object in an MXML file.
+ * This tag gives you access to the methods of
+ * Java objects using Action Message Format (AMF) encoding.
+
+ * @mxml
+ * <p>
+ * The <mx:RemoteObject> tag accepts the following tag attributes:
+ * </p>
+ * <pre>
+ * <mx:RemoteObject
+ * <b>Properties</b>
+ * concurrency="multiple|single|last"
+ * destination="<i>No default.</i>"
+ * id="<i>No default.</i>"
+ * endpoint="<i>No default.</i>"
+ * showBusyCursor="false|true"
+ * source="<i>No default.</i>" (currently, Adobe ColdFusion only)
+ * makeObjectsBindable="false|true"
+ *
+ * <b>Events</b>
+ * fault="<i>No default.</i>"
+ * result="<i>No default.</i>"
+ * />
+ * </pre>
+ * </p>
+ *
+ * <p>
+ * <mx:RemoteObject> can have multiple <mx:method> tags, which have the following tag attributes:
+ * </p>
+ * <pre>
+ * <mx:method
+ * <b>Properties</b>
+ * concurrency="multiple|single|last"
+ * name="<i>No default, required.</i>"
+ * makeObjectsBindable="false|true"
+ *
+ * <b>Events</b>
+ * fault="<i>No default.</i>"
+ * result="<i>No default.</i>"
+ * />
+ * </pre>
+ * <p>
+ * It then can have a single <mx:arguments> child tag which is an array of objects that is passed
+ * in order.
+ *
+ * @includeExample examples/RemoteObjectExample.mxml -noswf
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ *
+ */
+public dynamic class RemoteObject extends mx.rpc.remoting.RemoteObject
+ // implements IMXMLSupport, IMXMLObject
+{
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Create a new RemoteObject.
+ *
+ * @param destination The destination of the RemoteObject, should match a destination name
+ * in the services-config.xml file.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Royale 0.9.3
+ */
+
+ public function RemoteObject(destination:String = null)
+ {
+ super(destination);
+
+ showBusyCursor = false;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ public static const FAULT:String = "fault";
+
+ //----------------------------------
+ // requestTimeout
+ //----------------------------------
+
+ [Inspectable(category="General")]
+
+ /**
+ * Provides access to the request timeout in seconds for sent messages.
+ * A value less than or equal to zero prevents request timeout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get requestTimeout():int
+ {
+ return 0;
+ }
+
+ /**
+ * @private
+ */
+ public function set requestTimeout(value:int):void
+ {
+ if (requestTimeout != value)
+ {
+ requestTimeout = value;
+ }
+ }
+
+ public static const RESULT:String = "result";
+
+}
+
+}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services